{"bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"a130da20f1d7856ea1b48bcfe276e9d1dda173ee","tarball":"https://registry.npmjs.org/@material/banner/-/banner-15.0.0-canary.d96330c08.0.tgz","fileCount":31,"integrity":"sha512-6n5lFQgMoMH4Sa49haEOhORKy6uAnp+CgTO913BFLrPkIppBOa/lgkqEsNF8EzJSqbwudyCTLcs5sWNJICTuAw==","signatures":[{"sig":"MEUCIQDg9qB0PflHEb1FAZfDjCnuGM4k02JtpLAolowFNzAFEAIgFR4ckBOl4epRjwfq3tOt/e1+9dFygcjKFqot8gIpZ4o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":788890,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCHTLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpXgA//avmd+M1keseMZWGKclmUGMQDb4jCdMsve59qzzBWCfFpY/+K\r\nDCVQk1Mq5cYdOakIw1v+tDFivG7kRE+C99mkUPXb9dysyQhzahym/ZkK4922\r\n8sXRPyQwbGrinlflphbc9xfPsvgQhNc7mWXd3nsG9lKNZUYFa31J+zQdRBOF\r\nDxvL3dAvnIXh23sh696G3KqHkDLnc04G9E/u5F8fLYthgj2WY6ZFmB9OWeKr\r\nglXfdXhOXxfow/UfqzKMG2gQ+mQVaU78WtVuYaWPKSKvr4vD97f9HbJ/eHaJ\r\n341dHiPqgehSFIQrQ3r8g2NxlEfkw+fkkJieIXRR0Na+kfrMMz6o4cqiUelD\r\nFYxzxpjBSvMDTkfNDT0ab8JdCZXcBvpCSSPcUlo3dgsefmgk9YmEwjPtUtHg\r\nb7G7FAnR9WVxEiHt7rIqZ93dS0Wt8fwixTw7K2PTPXOjUSOmSDZqegN64YWT\r\nxxEcw2GQo6FboZ7je1s02taCam7P3RMfQ9nyI5gBU7EHJWp5lWxcggDdtdmf\r\nEYuP0n2Wrke0SJmRM+byp0yot8kXUP/jiEYSN2BFXtVMrT2beEQ0T/vxmUBD\r\nHCUUJ4rgogWcOnn2/B6BkGlan2lfwGKPjvGzpyh9r/kaEF9CtHeu8e0va8pX\r\n5WlMy9dFf4XBWPJGG1+jmPVHmkyfBKLuylE=\r\n=MazS\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":"6a6d53aa84a0c0a10bb15c3cfb596881140bddb2","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.21.3+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":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","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.21.3","dependencies":{"tslib":"^2.1.0","@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/ripple":"15.0.0-canary.d96330c08.0","@material/tokens":"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/banner_15.0.0-canary.d96330c08.0_1678275787032_0.1535323205037018","host":"s3://npm-registry-packages"},"_id":"@material/banner@15.0.0-canary.d96330c08.0","version":"15.0.0-canary.d96330c08.0"}