{"bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"53740c984fafa33985d56e3b954e5efef02215b0","tarball":"https://registry.npmjs.org/@material/banner/-/banner-14.0.0-canary.c047f7c19.0.tgz","fileCount":31,"integrity":"sha512-3J2ayEe57wlBcfVLxHA5zxDWHrvaZaohm/sAU+0hpIv/X44zAyhbYLubpFR9DLVEhP+CcAESGBHgseHHFeEXdQ==","signatures":[{"sig":"MEQCIClmH/NYyeB1dhfHcjQPKXsR+wjH/f5Cdsg4Hu7ANCC9AiBZRFRpNzkWOpywRSoltmMB/skKcb1GA/kaDjOx5/8FQw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":455240,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1cukCRA9TVsSAnZWagAAs0oP/1bM8I7lslRpn9RchPtP\nyJ+vBusZBK5SumD0BYlq7wRmNWYwN6TmAEPmaOz0kdj6+wbgOCE1A6FyFX/Y\ncu0JoAobraD7XWMYxjHxVb7kMhYZd9/f1+m2GcAYi6qC7zZPbiHsaNzqae7W\nWs5k78NsdQpS0WzjPesxHqfviuqqfIwi4JzUMbNHAqs63wUhBJ06vg3v8RXd\nDUH85JQleYQZg6YZ9VWULlbB0B1GyRKs3DcQ7dJE43qcenJLHTULnc2xje3m\nHFETgdxHMHgtvYnTMkMXNZhAay7sKHHwG9qm/WPQ7SQDMwtjUzzU2slLDBUL\nDS+b20JkNJzeYCfGS+Y5aFaS2UAsZmqj9OlxYTWCcxHzbDpbzsNUIpC0OrbX\nqqm7lFypgJC4Ke2FzvvghuxucldQRrwuuDrw2fpt/HGSvP7nKvjhtipyEpsA\n1uQwgG0WI/jz81LuMN11rU16ERkImbdfi+1Jw+q4g/xxtJ2tLmD+3mbhBG0Y\nEae7dPmCVaxRnTRfA/FSeGNrDS/QIBJmwwJtd8Rio//tFUXXhDI0bC8UJ9N5\nf6zJjcKbu2duXqpkWDYcFGAJ3repS8+UnNdjQ5zlpbNCJeX1+YHASsZ2RTYz\nL2eavBtAjzFiV7mViO5lTZ2SoTawIAe1/SRryGL+20ULN0jdG4iGhK0vVzMH\nggEr\r\n=0KUG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.banner.js","name":"@material/banner","module":"index.js","readme":"<!--docs:\ntitle: \"Banner\"\nlayout: detail\nsection: components\nexcerpt: \"A banner displays a prominent message and related optional actions.\"\niconId: banner\npath: /catalog/banners/\n-->\n\n# Banner\n\nA banner displays a prominent message and related optional actions.\n\n![Banner example](images/banner.png)\n\n**Contents**\n\n* [Using banners](#using-banners)\n* [Banners](#banners)\n* [API](#api)\n* [Usage within web frameworks](#usage-within-web-frameworks)\n\n## Using banners\n\nA banner displays an important, succinct message, and provides actions for users to address (or dismiss the banner). It requires a user action to be dismissed.\n\nBanners should be displayed at the top of the screen, below a top app bar. They’re persistent and nonmodal, allowing the user to either ignore them or interact with them at any time. Only one banner should be shown at a time.\n\n### Installing banners\n\n```\nnpm install @material/banner\n```\n\n### Styles\n\n```scss\n@use \"@material/banner/styles\";\n```\n\n### JavaScript instantiation\n\n```js\nimport {MDCBanner} from '@material/banner';\nconst banner = new MDCBanner(document.querySelector('.mdc-banner'));\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n## Banners\n\n### Banner example\n\n```html\n<div class=\"mdc-banner\" role=\"banner\">\n  <div class=\"mdc-banner__content\"\n       role=\"alertdialog\"\n       aria-live=\"assertive\">\n    <div class=\"mdc-banner__graphic-text-wrapper\">\n      <div class=\"mdc-banner__text\">\n        There was a problem processing a transaction on your credit card.\n      </div>\n    </div>\n    <div class=\"mdc-banner__actions\">\n      <button type=\"button\" class=\"mdc-button mdc-banner__primary-action\">\n        <div class=\"mdc-button__ripple\"></div>\n        <div class=\"mdc-button__label\">Fix it</div>\n      </button>\n    </div>\n  </div>\n</div>\n```\n\n### Variants\n\n#### Centered\n\nBy default, banners are positioned as leading.\n\nThey can optionally be displayed centered by adding the `mdc-banner--centered` modifier class to the root element:\n\n```html\n<div class=\"mdc-banner mdc-banner--centered\">\n  ...\n</div>\n```\n\nAlternatively, you can call the `position-centered` mixin from Sass:\n\n```scss\n.my-banner {\n  @include banner.position-centered;\n}\n```\n\n#### Fixed banner\n\nWhen used below top app bars, banners should remain fixed at the top of the screen. This can be done by adding the `mdc-banner__fixed` wrapper element around the content element:\n\n```html\n<div class=\"mdc-banner\" role=\"banner\">\n  <div class=\"mdc-banner__fixed\">\n    <div class=\"mdc-banner__content\"\n         role=\"alertdialog\"\n         aria-live=\"assertive\">\n      <div class=\"mdc-banner__graphic-text-wrapper\">\n        <div class=\"mdc-banner__text\">\n          There was a problem processing a transaction on your credit card.\n        </div>\n      </div>\n      <div class=\"mdc-banner__actions\">\n        <button type=\"button\" class=\"mdc-button mdc-banner__primary-action\">\n          <div class=\"mdc-button__ripple\"></div>\n          <div class=\"mdc-button__label\">Fix it</div>\n        </button>\n      </div>\n    </div>\n  </div>\n</div>\n```\n\n#### Banner with graphic\n\nImages can help communicate a banner’s message.\n\n```html\n<div class=\"mdc-banner\" role=\"banner\">\n  <div class=\"mdc-banner__content\"\n       role=\"alertdialog\"\n       aria-live=\"assertive\">\n    <div class=\"mdc-banner__graphic-text-wrapper\">\n      <div class=\"mdc-banner__graphic\" role=\"img\" alt=\"\"><i class=\"material-icons mdc-banner__icon\">error_outline</i></div>\n      <div class=\"mdc-banner__text\">\n        There was a problem processing a transaction on your credit card.\n      </div>\n    </div>\n    <div class=\"mdc-banner__actions\">\n      <button type=\"button\" class=\"mdc-button mdc-banner__primary-action\">\n        <div class=\"mdc-button__ripple\"></div>\n        <div class=\"mdc-button__label\">Fix it</div>\n      </button>\n    </div>\n  </div>\n</div>\n```\n\n#### Banner with two actions\n\nBanners may have one or two low-emphasis text buttons.\n\n```html\n<div class=\"mdc-banner\" role=\"banner\">\n  <div class=\"mdc-banner__content\"\n       role=\"alertdialog\"\n       aria-live=\"assertive\">\n    <div class=\"mdc-banner__graphic-text-wrapper\">\n      <div class=\"mdc-banner__text\">\n        There was a problem processing a transaction on your credit card.\n      </div>\n    </div>\n    <div class=\"mdc-banner__actions\">\n      <button type=\"button\" class=\"mdc-button mdc-banner__secondary-action\">\n        <div class=\"mdc-button__ripple\"></div>\n        <div class=\"mdc-button__label\">Learn more</div>\n      </button>\n      <button type=\"button\" class=\"mdc-button mdc-banner__primary-action\">\n        <div class=\"mdc-button__ripple\"></div>\n        <div class=\"mdc-button__label\">Fix it</div>\n      </button>\n    </div>\n  </div>\n</div>\n```\n\n\n#### Mobile stacked\n\nOn mobile view, banners with long text should have their action(s) be positioned _below_ the text instead of alongside it. This can be accomplished by adding the `mdc-banner--mobile-stacked` modifier class to the root element:\n\n```html\n<div class=\"mdc-banner mdc-banner--mobile-stacked\">\n  ...\n</div>\n```\n\nAlternatively, banner can be in stacked layout regardless of mobile-breakpoint, with the `layout-stacked` mixin from Sass:\n\n```scss\n.my-banner {\n  @include banner-theme.layout-stacked;\n}\n```\n\n## API\n\n### Sass mixins\n\nAccess to theme mixins require importing the banner's theme style module.\n\n```scss\n@use \"@material/banner\";\n```\n\nMixin | Description\n--- | ---\n`fill-color($color)` | Sets the fill color of the banner.\n`text-color($color)` | Sets the color of the banners's text.\n`divider-color($color)` | Sets the color of the banner's divider.\n`min-width($min-width, $mobile-breakpoint)` | Sets the `min-width` of the banner content on tablet/desktop devices. On mobile, the width is automatically set to 100%.\n`max-width($max-width)` | Sets the `max-width` of the banner content.\n`position-centered()` | Sets the banner content to centered instead of leading.\n`z-index($z-index)` | Sets the z-index of the banner.\n\n### `MDCBanner` events\n\nEvent name | `event.detail` | Description\n--- | --- | ---\n`MDCBanner:closing` | `MDCBannerCloseEventDetail` | Indicates when the banner begins its closing animation.\n`MDCBanner:closed` | `MDCBannerCloseEventDetail` | Indicates when the banner finishes its closing animation.\n`MDCBanner:opening` | `{}` | Indicates when the banner begins its opening animation.\n`MDCBanner:opened` | `{}` | Indicates when the banner finishes its opening animation.\n\n### `MDCBanner` properties and methods\n\nProperty | Value Type | Description\n--- | --- | ---\n`isOpen` | `boolean` (read-only) | Returns whether the banner is open.\n\nMethod Signature | Description\n--- | ---\n`open() => void` | Opens the banner.\n`close(reason: CloseReason) => void` | Closes the banner, with the specified action indicating why it was closed.\n`getText() => string` | Gets the text of the banner.\n`setText(text: string) => void` | Sets the text of the banner.\n`getPrimaryActionText() => string` | Gets the banner's primary action text.\n`setPrimaryActionText(actionButtonText: string) => void` | Sets the banner's primary action text.\n`getSecondaryActionText() => string \\| null` | Gets the banner's secondary action text. Returns null if the banner has no secondary action.\n`setSecondaryActionText(actionButtonText: string) => void` | Sets the banner's secondary action text.\n`layout() => void` | Recalculates layout. With height being calculated dynamically recommended to call on window `resize` events.\n\n### Usage within frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a banner for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\nSee [MDCBannerAdapter](./adapter.ts) and [MDCBannerFoundation](./foundation.ts) for up-to-date code documentation of banner foundation APIs.\n","gitHead":"f89c0e152ba1bb64d7b262b279d38cf5d93dd788","license":"MIT","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"homepage":"https://github.com/material-components/material-components-web#readme","keywords":["material components","material design","banner"],"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-banner"},"_npmVersion":"lerna/3.20.2/node@v14.18.2+x64 (linux)","description":"The Material Components Web banner component.","directories":{},"maintainers":[{"name":"yefim","email":"hi@yef.im"},{"name":"abhiomkar","email":"abhiomkar@gmail.com"},{"name":"azakus","email":"dfreedm2@gmail.com"},{"name":"bicknellr","email":"bicknellr@gmail.com"},{"name":"material-admin","email":"aprigogin+npm@google.com"},{"name":"aprigogin","email":"andrey.prigogin@gmail.com"},{"name":"patrickrodee","email":"prodee@google.com"},{"name":"aomarks","email":"aomarks@gmail.com"},{"name":"emarquez","email":"emarquez@google.com"},{"name":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","email":"asyncliz@gmail.com"},{"name":"candysonya","email":"wangchan518@gmail.com"},{"name":"ssuarez","email":"sayrisuarez@google.com"},{"name":"taylorv","email":"brian.t.vann@gmail.com"}],"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/button":"14.0.0-canary.c047f7c19.0","@material/ripple":"14.0.0-canary.c047f7c19.0","@material/tokens":"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/banner_14.0.0-canary.c047f7c19.0_1641401251956_0.09850418060332955","host":"s3://npm-registry-packages"},"_id":"@material/banner@14.0.0-canary.c047f7c19.0","version":"14.0.0-canary.c047f7c19.0"}