@micromag/element-checkbox 0.3.235 → 0.3.236

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-checkbox",
3
- "version": "0.3.235",
3
+ "version": "0.3.236",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@babel/runtime": "^7.13.10",
52
- "@micromag/core": "^0.3.235",
52
+ "@micromag/core": "^0.3.236",
53
53
  "change-case": "^4.1.2",
54
54
  "classnames": "^2.2.6",
55
55
  "lodash": "^4.17.21",
@@ -60,5 +60,5 @@
60
60
  "publishConfig": {
61
61
  "access": "public"
62
62
  },
63
- "gitHead": "e1f899344bb55abf06daa6247d9adbd7401a765b"
63
+ "gitHead": "8ef5fca04d5826f68ec3ffa8cd0065b4e776ed10"
64
64
  }
@@ -1 +0,0 @@
1
- .micromag-element-checkbox-container{position:relative}.micromag-element-checkbox-container .micromag-element-checkbox-label{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-ms-flex-align:center;align-items:center;margin-bottom:0}.micromag-element-checkbox-container .micromag-element-checkbox-input{margin-right:5px}
package/es/index.js DELETED
@@ -1,65 +0,0 @@
1
- import _objectSpread from '@babel/runtime/helpers/objectSpread2';
2
- import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
- import React from 'react';
4
- import PropTypes$1 from 'prop-types';
5
- import classNames from 'classnames';
6
- import { PropTypes } from '@micromag/core';
7
-
8
- var styles = {"container":"micromag-element-checkbox-container","label":"micromag-element-checkbox-label","input":"micromag-element-checkbox-input"};
9
-
10
- var propTypes = {
11
- option: PropTypes.textElement,
12
- value: PropTypes$1.bool,
13
- onChange: PropTypes$1.func,
14
- focusable: PropTypes$1.bool,
15
- checkboxStyle: PropTypes$1.object,
16
- // eslint-disable-line
17
- className: PropTypes$1.string
18
- };
19
- var defaultProps = {
20
- option: null,
21
- value: null,
22
- onChange: null,
23
- focusable: true,
24
- checkboxStyle: null,
25
- className: null
26
- };
27
-
28
- var Checkbox = function Checkbox(_ref) {
29
- var option = _ref.option,
30
- value = _ref.value,
31
- _onChange = _ref.onChange,
32
- focusable = _ref.focusable,
33
- checkboxStyle = _ref.checkboxStyle,
34
- className = _ref.className;
35
-
36
- var _ref2 = option || {},
37
- _ref2$body = _ref2.body,
38
- body = _ref2$body === void 0 ? null : _ref2$body;
39
-
40
- return /*#__PURE__*/React.createElement("div", {
41
- className: classNames([styles.container, _defineProperty({}, className, className !== null)]),
42
- style: _objectSpread({}, checkboxStyle)
43
- }, /*#__PURE__*/React.createElement("label", {
44
- className: classNames([styles.label, {
45
- active: body === value
46
- }])
47
- }, /*#__PURE__*/React.createElement("input", {
48
- className: styles.input,
49
- type: "checkbox",
50
- autoComplete: "off",
51
- value: value === true,
52
- checked: value === true,
53
- tabIndex: focusable ? '0' : '-1',
54
- onChange: function onChange() {
55
- if (_onChange !== null) {
56
- _onChange(!value);
57
- }
58
- }
59
- }), body));
60
- };
61
-
62
- Checkbox.propTypes = propTypes;
63
- Checkbox.defaultProps = defaultProps;
64
-
65
- export { Checkbox as default };
package/lib/index.js DELETED
@@ -1,75 +0,0 @@
1
- 'use strict';
2
-
3
- var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
4
- var _defineProperty = require('@babel/runtime/helpers/defineProperty');
5
- var React = require('react');
6
- var PropTypes = require('prop-types');
7
- var classNames = require('classnames');
8
- var core = require('@micromag/core');
9
-
10
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
-
12
- var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
13
- var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
14
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
15
- var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
16
- var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
17
-
18
- var styles = {"container":"micromag-element-checkbox-container","label":"micromag-element-checkbox-label","input":"micromag-element-checkbox-input"};
19
-
20
- var propTypes = {
21
- option: core.PropTypes.textElement,
22
- value: PropTypes__default["default"].bool,
23
- onChange: PropTypes__default["default"].func,
24
- focusable: PropTypes__default["default"].bool,
25
- checkboxStyle: PropTypes__default["default"].object,
26
- // eslint-disable-line
27
- className: PropTypes__default["default"].string
28
- };
29
- var defaultProps = {
30
- option: null,
31
- value: null,
32
- onChange: null,
33
- focusable: true,
34
- checkboxStyle: null,
35
- className: null
36
- };
37
-
38
- var Checkbox = function Checkbox(_ref) {
39
- var option = _ref.option,
40
- value = _ref.value,
41
- _onChange = _ref.onChange,
42
- focusable = _ref.focusable,
43
- checkboxStyle = _ref.checkboxStyle,
44
- className = _ref.className;
45
-
46
- var _ref2 = option || {},
47
- _ref2$body = _ref2.body,
48
- body = _ref2$body === void 0 ? null : _ref2$body;
49
-
50
- return /*#__PURE__*/React__default["default"].createElement("div", {
51
- className: classNames__default["default"]([styles.container, _defineProperty__default["default"]({}, className, className !== null)]),
52
- style: _objectSpread__default["default"]({}, checkboxStyle)
53
- }, /*#__PURE__*/React__default["default"].createElement("label", {
54
- className: classNames__default["default"]([styles.label, {
55
- active: body === value
56
- }])
57
- }, /*#__PURE__*/React__default["default"].createElement("input", {
58
- className: styles.input,
59
- type: "checkbox",
60
- autoComplete: "off",
61
- value: value === true,
62
- checked: value === true,
63
- tabIndex: focusable ? '0' : '-1',
64
- onChange: function onChange() {
65
- if (_onChange !== null) {
66
- _onChange(!value);
67
- }
68
- }
69
- }), body));
70
- };
71
-
72
- Checkbox.propTypes = propTypes;
73
- Checkbox.defaultProps = defaultProps;
74
-
75
- module.exports = Checkbox;