{"bugs":{"url":"https://github.com/material-components/material-components-web/issues"},"dist":{"shasum":"8f16b25d81c24539a8e4e7f4c2974b048f597f12","tarball":"https://registry.npmjs.org/@material/checkbox/-/checkbox-7.0.0-canary.deb212de4.0.tgz","fileCount":38,"integrity":"sha512-eVHhvLDrYSUtLSeD7jUjSO//R+PNYKZsiFvgoj8Bc329/U067iWbKogQx4x1SIYhEkvrXYGCKkvWykz4IYKCJw==","signatures":[{"sig":"MEUCIQCq6e/PfeRUIV3HlarTNbuD/S24XV3KsyvMxY6F51zwcwIgdhxZJVEdOdfVerg+E3edaQASVydaTJsQG5L3zXw+ERo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":549326,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeszfGCRA9TVsSAnZWagAAalQP/jROZd9636DRjfFXlfjP\nJE1ot3m9dQckVnfwSjPeiwBzOrsqyabIPnBarkUx/yQuSMV0BUjIlixxsqLm\nEFm0lhmQYnATjPdXshmwxx61cJm58+O8KXHGjCaV5xTOU1EOC5wi2cUgYO9V\nlhmrto6i+hIkXc9tgtkXVdx/Iqqj7ZxrRzYy9xv98JVpBFrUfqT0sxM6fggT\nGf071nabi+ALpclc2KT0MBwmJX3qW1ihilOXeIUj9bKP1JZy8hewmv2UdcaB\nEmOSZjFiwF9+nWIFjKq4a4OdGMsoq4I4ffQ89r7QcY2apVX+XQzl89MG2GO5\nXYIdsPs68pE0GIW/vQe5FS614ELdF/9g5YE8n7nFvjjwC32NEqcLuSoEvBwd\nzuQau3XA3DurHL/G7ARo5P7hEZKqm9FfmzlrjcDRzn6BCw0IqlIXgl2M1SXr\nB13TdMfyNGSzia0PJmbb5cQttQAHPkDHHPw6/1wPzKt0CRToNZ14S02yZuEu\nuqdfzzG6HiyoTqzFF+dCjD3oJliu42btS1d6doXQ4gtbFICoFzcQfL05pJ3M\ncOkNMcTW+ziRrchLDUzUdLBjGAdMt17ZI8C+LgZESvnr9iAnfjd6hq+Jjb88\nsV23LY13fDzBM9xcKaK/9UNB0mLv27ldk82OeWKT0wGMa59XVcMGAvhFWlt5\ne9fL\r\n=J/1M\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/mdc.checkbox.js","name":"@material/checkbox","types":"dist/mdc.checkbox.d.ts","module":"./index.js","readme":"<!--docs:\ntitle: \"Checkboxes\"\nlayout: detail\nsection: components\nexcerpt: \"Checkboxes allow the user to select multiple options from a set.\"\niconId: selection_control\npath: /catalog/input-controls/checkboxes/\n-->\n\n# Checkboxes\n\n<!--<div class=\"article__asset\">\n  <a class=\"article__asset-link\"\n     href=\"https://material-components.github.io/material-components-web-catalog/#/component/checkbox\">\n    <img src=\"{{ site.rootpath }}/images/mdc_web_screenshots/checkboxes.png\"\n    width=\"99\" alt=\"Checkbox screenshot\">\n  </a>\n</div>-->\n\nCheckboxes allow the user to select one or more items from a set.\n\n## Design & API Documentation\n\n<ul class=\"icon-list\">\n  <li class=\"icon-list-item icon-list-item--spec\">\n    <a href=\"https://material.io/go/design-checkboxes\">Material Design guidelines: Selection Controls – Checkbox</a>\n  </li>\n  <li class=\"icon-list-item icon-list-item--link\">\n    <a href=\"https://material-components.github.io/material-components-web-catalog/#/component/checkbox\">Demo</a>\n  </li>\n</ul>\n\n## Installation\n\n```\nnpm install @material/checkbox\n```\n\n## Basic Usage\n\nWe recommend using MDC Checkbox with [MDC Form Field](../mdc-form-field) for enhancements such as label alignment, label activation of the ripple interaction effect, and RTL-awareness.\n\n```html\n<div class=\"mdc-form-field\">\n  <div class=\"mdc-checkbox\">\n    <input type=\"checkbox\"\n           class=\"mdc-checkbox__native-control\"\n           id=\"checkbox-1\"/>\n    <div class=\"mdc-checkbox__background\">\n      <svg class=\"mdc-checkbox__checkmark\"\n           viewBox=\"0 0 24 24\">\n        <path class=\"mdc-checkbox__checkmark-path\"\n              fill=\"none\"\n              d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"/>\n      </svg>\n      <div class=\"mdc-checkbox__mixedmark\"></div>\n    </div>\n    <div class=\"mdc-checkbox__ripple\"></div>\n  </div>\n  <label for=\"checkbox-1\">Checkbox 1</label>\n</div>\n```\n\n> **Note**: If you are using IE, you need to include a closing `</path>` tag if you wish to avoid console warnings.\n\n### Styles\n\n```scss\n@use \"@material/form-field/mdc-form-field\";\n@use \"@material/checkbox/mdc-checkbox\";\n```\n\n### JavaScript Instantiation\n\nThe checkbox will work without JavaScript, but you can enhance it with a ripple interaction effect by instantiating `MDCCheckbox` on the `mdc-checkbox` element. To activate the ripple effect upon interacting with the label, you must also instantiate `MDCFormField` on the `mdc-form-field` element and set the `MDCCheckbox` instance as its `input`.\n\n```js\nimport {MDCFormField} from '@material/form-field';\nimport {MDCCheckbox} from '@material/checkbox';\n\nconst checkbox = new MDCCheckbox(document.querySelector('.mdc-checkbox'));\nconst formField = new MDCFormField(document.querySelector('.mdc-form-field'));\nformField.input = checkbox;\n```\n\n> See [Importing the JS component](../../docs/importing-js.md) for more information on how to import JavaScript.\n\n## Variants\n\n### Disabled\n\nNote that `mdc-checkbox--disabled` is necessary on the root element of CSS-only checkboxes to prevent hover states from activating. Checkboxes that use the JavaScript component do not need this class; a `disabled` attribute on the `<input>` element is sufficient.\n\n```html\n<div class=\"mdc-checkbox mdc-checkbox--disabled\">\n  <input type=\"checkbox\"\n         id=\"basic-disabled-checkbox\"\n         class=\"mdc-checkbox__native-control\"\n         disabled />\n  <div class=\"mdc-checkbox__background\">\n    <svg class=\"mdc-checkbox__checkmark\"\n         viewBox=\"0 0 24 24\">\n      <path class=\"mdc-checkbox__checkmark-path\"\n            fill=\"none\"\n            d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"/>\n    </svg>\n    <div class=\"mdc-checkbox__mixedmark\"></div>\n  </div>\n  <div class=\"mdc-checkbox__ripple\"></div>\n</div>\n<label for=\"basic-disabled-checkbox\" id=\"basic-disabled-checkbox-label\">This is my disabled checkbox</label>\n```\n\n### Indeterminate\n\nNote that `data-indeterminate=\"true\"` is necessary on the input element for initial render, or in a CSS-only mode. Checkboxes that use the Javascript component can modify the `indeterminate` property at runtime.\n\n```html\n<div class=\"mdc-checkbox\">\n  <input type=\"checkbox\"\n         id=\"basic-indeterminate-checkbox\"\n         class=\"mdc-checkbox__native-control\"\n         data-indeterminate=\"true\"/>\n  <div class=\"mdc-checkbox__background\">\n    <svg class=\"mdc-checkbox__checkmark\"\n         viewBox=\"0 0 24 24\">\n      <path class=\"mdc-checkbox__checkmark-path\"\n            fill=\"none\"\n            d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"/>\n    </svg>\n    <div class=\"mdc-checkbox__mixedmark\"></div>\n  </div>\n  <div class=\"mdc-checkbox__ripple\"></div>\n</div>\n<label for=\"basic-indeterminate-checkbox\" id=\"basic-indeterminate-checkbox-label\">This is my indeterminate checkbox</label>\n```\n\n## Additional Information\n\n### Accessibility\n\nMaterial Design spec advises that touch targets should be at least 48 x 48 px.\nTo meet this requirement, add the `mdc-checkbox--touch` class to your checkbox as follows:\n\n```html\n<div class=\"mdc-touch-target-wrapper\">\n  <div class=\"mdc-checkbox mdc-checkbox--touch\">\n    <input type=\"checkbox\"\n           class=\"mdc-checkbox__native-control\"\n           id=\"checkbox-1\"/>\n    <div class=\"mdc-checkbox__background\">\n      <svg class=\"mdc-checkbox__checkmark\"\n           viewBox=\"0 0 24 24\">\n        <path class=\"mdc-checkbox__checkmark-path\"\n              fill=\"none\"\n              d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"/>\n      </svg>\n      <div class=\"mdc-checkbox__mixedmark\"></div>\n    </div>\n    <div class=\"mdc-checkbox__ripple\"></div>\n  </div>\n</div>\n```\n\nNote that the outer `mdc-touch-target-wrapper` element is only necessary if you want to avoid potentially overlapping touch targets on adjacent elements (due to collapsing margins).\n\n## Style Customization\n\nMDC Checkbox uses [MDC Theme](../mdc-theme)'s `secondary` color by default for \"marked\" states (i.e., checked or indeterminate).\n\n### Sass Mixins\n\nMixin | Description\n--- | ---\n`container-colors($unmarked-stroke-color, $unmarked-fill-color, $marked-stroke-color, $marked-fill-color, $generate-keyframes)` | Sets stroke & fill colors for both marked and unmarked state of enabled checkbox. Set $generate-keyframes to false to prevent the mixin from generating @keyframes.\n`disabled-container-colors($unmarked-stroke-color, $unmarked-fill-color, $marked-stroke-color, $marked-fill-color)` | Sets stroke & fill colors for both marked and unmarked state of disabled checkbox.\n`ink-color($color)` | Sets the ink color of the checked and indeterminate icons for an enabled checkbox\n`disabled-ink-color($color)` | Sets the ink color of the checked and indeterminate icons for a disabled checkbox\n`focus-indicator-color($color)` | Sets the color of the focus indicator (ripple) when checkbox is selected or is in indeterminate state.\n`ripple-size($ripple-size)` | Sets the ripple size of the checkbox.\n`density($density-scale)` | Sets density scale for checkbox, Supported density scales are `-3`, `-2`, `-1`, and `0` (default).\n\nThe ripple effect for the Checkbox component is styled using [MDC Ripple](../mdc-ripple) mixins.\n\n## `MDCCheckbox` Properties and Methods\n\nProperty Name | Type | Description\n--- | --- | ---\n`checked` | `boolean` | Setter/getter for the checkbox's checked state\n`indeterminate` | `boolean` | Setter/getter for the checkbox's indeterminate state\n`disabled` | `boolean` | Setter/getter for the checkbox's disabled state\n`value` | `string` | Setter/getter for the checkbox's\n\n## Usage within Web Frameworks\n\nIf you are using a JavaScript framework, such as React or Angular, you can create a Checkbox for your framework. Depending on your needs, you can use the _Simple Approach: Wrapping MDC Web Vanilla Components_, or the _Advanced Approach: Using Foundations and Adapters_. Please follow the instructions [here](../../docs/integrating-into-frameworks.md).\n\n### `MDCCheckboxAdapter`\n\nMethod Signature | Description\n--- | ---\n`addClass(className: string) => void` | Adds a class to the root element.\n`removeClass(className: string) => void` | Removes a class from the root element.\n`forceLayout() => void` | Force-trigger a layout on the root element. This is needed to restart animations correctly. If you find that you do not need to do this, you can simply make it a no-op.\n`isAttachedToDOM() => boolean` | Returns true if the component is currently attached to the DOM, false otherwise.\n`isIndeterminate() => boolean` | Returns true if the component is in the indeterminate state.\n`isChecked() => boolean` | Returns true if the component is checked.\n`hasNativeControl() => boolean` | Returns true if the input is present in the component.\n`setNativeControlDisabled(disabled: boolean) => void` | Sets the input to disabled.\n`setNativeControlAttr(attr: string, value: string) => void` | Sets an HTML attribute to the given value on the native input element.\n`removeNativeControlAttr(attr: string) => void` | Removes an attribute from the native input element.\n\n### `MDCCheckboxFoundation`\n\nMethod Signature | Description\n--- | ---\n`setDisabled(disabled: boolean) => void` | Updates the `disabled` property on the underlying input. Does nothing when the underlying input is not present.\n`handleAnimationEnd() => void` | `animationend` event handler that should be applied to the root element.\n`handleChange() => void` | `change` event handler that should be applied to the checkbox element.\n","gitHead":"fe9c146f82589e5f1c471dbb4986ed6b3a7caf54","license":"MIT","_npmUser":{"name":"abhiomkar","email":"abhiomkar@gmail.com"},"homepage":"https://github.com/material-components/material-components-web#readme","keywords":["material components","material design","checkbox"],"repository":{"url":"git+https://github.com/material-components/material-components-web.git","type":"git","directory":"packages/mdc-checkbox"},"_npmVersion":"lerna/3.20.2/node@v10.20.1+x64 (linux)","description":"The Material Components for the web checkbox component","directories":{},"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":"williamernest","email":"williamernest@google.com"}],"sideEffects":false,"_nodeVersion":"10.20.1","dependencies":{"tslib":"^1.9.3","@material/dom":"7.0.0-canary.deb212de4.0","@material/base":"7.0.0-canary.deb212de4.0","@material/theme":"7.0.0-canary.deb212de4.0","@material/ripple":"7.0.0-canary.deb212de4.0","@material/density":"7.0.0-canary.deb212de4.0","@material/animation":"7.0.0-canary.deb212de4.0","@material/touch-target":"7.0.0-canary.deb212de4.0","@material/feature-targeting":"7.0.0-canary.deb212de4.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/checkbox_7.0.0-canary.deb212de4.0_1588803525429_0.9615716148585889","host":"s3://npm-registry-packages"},"_id":"@material/checkbox@7.0.0-canary.deb212de4.0","version":"7.0.0-canary.deb212de4.0"}