{"bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"190ad4511e444d6c433ebe132d92e6a6721d49e6","tarball":"https://registry.npmjs.org/@material/banner/-/banner-14.0.0-canary.b094eaa4e.0.tgz","fileCount":31,"integrity":"sha512-rgYsGB7aPzrrwztUxEzjvsxfTKoxW8pdZPmipOVlQIZZUjXyTnCk5BGCmyhRjeYfyDbdXXLgAsmTLrn+jrDovA==","signatures":[{"sig":"MEUCIQDgVLXB86+2CSV/WeY3HJeVdsKlm5aDLxigsvbl+uqczQIgFy88T/icBGoVIBB2ZlmKIudiidqBkwpxUeX+OF6ncmQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":460009,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4cR0CRA9TVsSAnZWagAAu/UP/A/7W1jdx/ltV+II6oEm\ns4BuIlWvB+O9TC6aetzusr772XNMvzcYjJs8TP2OOHrlzgoZcBZv0SNweFCq\nb3zp+90TGNLg+oaddk2/VnQb2Nqjv8H6R7Ux/Q8/GPTAhZAciikEkyKMcOrN\nd0r8KfJ2N82p/57o2yFBh2mjLuUXoBwNoub83QgJk5p+fQt5lC0YGmxlHo3V\n/idbZtwAYJOzcM2pN2314+Yey04EzDduUMGEkYdOhc0CMpUl9wyhspbZIcv6\nUVjBKVm8VImfgBH+/JjV5gHBaHmLrndiWGFytZbQjKfpdA6qX3rLS0UqD2k7\nxb1R+7dXOANjEMd6tjbBw/P7jJrhetnPUdVVuiGSD6F53QkWJcJXo68FBHkr\nJXq0hI1VTqufJp+sIrnGWym5SdMvVqrfutMwnDZWJA1J5cz8AZT/9KPfa/H4\n1su0v5qpjV3JuzyNFcseq2xNAYKScN/CclQAJQwydQnYX3rV2kEmFZA0ZsCF\nrmwgUspxMWTOXYJV46jT/x94rFbyb3G/QyXsgWr2bXuSFqnUdYgmnwae3YEc\nBs1W6Z98M3pdoo4U6g7gVdpsoIcUyuFgZECVvKCTvPdf8MGY9ZCqR6b+6xZ3\nP4zE0wF6FF+0wLGA+QzHJPVRF9PgbQ6YIubYBTGJdPih7xPRv/z6yUCgTFjp\nhJai\r\n=Ljqs\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":"6b11b48b933746de14be90d79974d10e1fd48289","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.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":"allanchen","email":"allanchen@google.com"},{"name":"esgonzalez","email":"esgonzalez@google.com"},{"name":"asyncliz","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.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/button":"14.0.0-canary.b094eaa4e.0","@material/ripple":"14.0.0-canary.b094eaa4e.0","@material/tokens":"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/banner_14.0.0-canary.b094eaa4e.0_1642185844633_0.7715194325530896","host":"s3://npm-registry-packages"},"_id":"@material/banner@14.0.0-canary.b094eaa4e.0","version":"14.0.0-canary.b094eaa4e.0"}