@welcome-ui/checkbox
Advanced tools
Comparing version 1.0.12-alpha.0 to 1.0.15-alpha.0
{ | ||
"dist/welcome-ui.cjs.js": { | ||
"bundled": 8254, | ||
"minified": 6673, | ||
"gzipped": 2634 | ||
"bundled": 8243, | ||
"minified": 6659, | ||
"gzipped": 2640 | ||
}, | ||
"dist/welcome-ui.es.js": { | ||
"bundled": 7939, | ||
"minified": 6407, | ||
"gzipped": 2541, | ||
"bundled": 7937, | ||
"minified": 6404, | ||
"gzipped": 2549, | ||
"treeshaked": { | ||
"rollup": { | ||
"code": 5450, | ||
"code": 5440, | ||
"import_statements": 855 | ||
}, | ||
"webpack": { | ||
"code": 6765 | ||
"code": 6755 | ||
} | ||
@@ -19,0 +19,0 @@ } |
@@ -16,3 +16,3 @@ 'use strict'; | ||
var S = require('@xstyled/system'); | ||
var Checkbox = require('reakit/Checkbox'); | ||
var Checkbox$2 = require('reakit/Checkbox'); | ||
var difference = _interopDefault(require('lodash.difference')); | ||
@@ -119,5 +119,5 @@ | ||
} | ||
var InputCheckbox = | ||
var Checkbox = | ||
/*#__PURE__*/ | ||
styled__default(filterComponent(Checkbox.Checkbox))(function (_ref) { | ||
styled__default(filterComponent(Checkbox$2.Checkbox))(function (_ref) { | ||
var connected = _ref.connected, | ||
@@ -129,3 +129,3 @@ _ref$order = _ref.order, | ||
var InputCheckbox$1 = | ||
var Checkbox$1 = | ||
/*#__PURE__*/ | ||
@@ -136,3 +136,3 @@ React.forwardRef(function (_ref, ref) { | ||
_ref$Component = _ref.Component, | ||
Component = _ref$Component === void 0 ? InputCheckbox : _ref$Component, | ||
Component = _ref$Component === void 0 ? Checkbox : _ref$Component, | ||
dataTestId = _ref.dataTestId, | ||
@@ -157,5 +157,6 @@ name = _ref.name, | ||
}); | ||
InputCheckbox$1.type = 'InputCheckbox'; | ||
InputCheckbox$1.displayName = 'InputCheckbox'; | ||
Checkbox$1.type = 'Checkbox'; | ||
Checkbox$1.displayName = 'Checkbox'; | ||
exports.InputCheckbox = InputCheckbox$1; | ||
exports.Checkbox = Checkbox$1; | ||
exports.default = Checkbox$1; |
@@ -9,3 +9,3 @@ import _extends from '@babel/runtime/helpers/esm/extends'; | ||
import { createSystemComponent, compose, backgrounds, basics, borders, color, display, flexboxes, grids, height, maxHeight, maxWidth, minHeight, minWidth, positioning, space, typography, verticalAlign, width, margin, marginBottom, marginLeft, marginRight, marginTop, mx, my, th } from '@xstyled/system'; | ||
import { Checkbox } from 'reakit/Checkbox'; | ||
import { Checkbox as Checkbox$2 } from 'reakit/Checkbox'; | ||
import difference from 'lodash.difference'; | ||
@@ -112,5 +112,5 @@ | ||
} | ||
var InputCheckbox = | ||
var Checkbox = | ||
/*#__PURE__*/ | ||
styled(filterComponent(Checkbox))(function (_ref) { | ||
styled(filterComponent(Checkbox$2))(function (_ref) { | ||
var connected = _ref.connected, | ||
@@ -122,3 +122,3 @@ _ref$order = _ref.order, | ||
var InputCheckbox$1 = | ||
var Checkbox$1 = | ||
/*#__PURE__*/ | ||
@@ -129,3 +129,3 @@ forwardRef(function (_ref, ref) { | ||
_ref$Component = _ref.Component, | ||
Component = _ref$Component === void 0 ? InputCheckbox : _ref$Component, | ||
Component = _ref$Component === void 0 ? Checkbox : _ref$Component, | ||
dataTestId = _ref.dataTestId, | ||
@@ -150,5 +150,6 @@ name = _ref.name, | ||
}); | ||
InputCheckbox$1.type = 'InputCheckbox'; | ||
InputCheckbox$1.displayName = 'InputCheckbox'; | ||
Checkbox$1.type = 'Checkbox'; | ||
Checkbox$1.displayName = 'Checkbox'; | ||
export { InputCheckbox$1 as InputCheckbox }; | ||
export default Checkbox$1; | ||
export { Checkbox$1 as Checkbox }; |
12
index.js
@@ -8,4 +8,4 @@ import React, { forwardRef } from 'react' | ||
export const InputCheckbox = forwardRef( | ||
({ checked = false, Component = S.InputCheckbox, dataTestId, name, onChange, ...rest }, ref) => { | ||
export const Checkbox = forwardRef( | ||
({ checked = false, Component = S.Checkbox, dataTestId, name, onChange, ...rest }, ref) => { | ||
const handleChange = e => { | ||
@@ -30,6 +30,6 @@ e.target.checked = !e.target.checked | ||
InputCheckbox.type = 'InputCheckbox' | ||
InputCheckbox.displayName = 'InputCheckbox' | ||
Checkbox.type = 'Checkbox' | ||
Checkbox.displayName = 'Checkbox' | ||
InputCheckbox.propTypes = { | ||
Checkbox.propTypes = { | ||
...FINAL_FORM_INPUT_TYPES, | ||
@@ -41,1 +41,3 @@ checked: bool, | ||
} | ||
export default Checkbox |
import React from 'react' | ||
import { fireEvent } from '@testing-library/react' | ||
import { Form, getFormValues } from '../../../docz/Form' | ||
import { Form, getFormValues } from '../../docz/Form' | ||
import { render } from '../Core/utils/tests' | ||
import { ConnectedField } from '../ConnectedField' | ||
import { InputCheckbox } from './index' | ||
import Checkbox from './index' | ||
@@ -16,7 +16,7 @@ const expectChecked = (element, valuesElement, value) => { | ||
test('<InputCheckbox> toggles on input click', () => { | ||
test('<Checkbox> toggles on input click', () => { | ||
const { container, getByTestId } = render( | ||
<Form initialValues={{}}> | ||
<ConnectedField | ||
component={InputCheckbox} | ||
component={Checkbox} | ||
dataTestId="inputCheckbox" | ||
@@ -41,7 +41,7 @@ label="Checkbox" | ||
test('<InputCheckbox> toggles on label click', () => { | ||
test('<Checkbox> toggles on label click', () => { | ||
const { container, getByTestId } = render( | ||
<Form initialValues={{}}> | ||
<ConnectedField | ||
component={InputCheckbox} | ||
component={Checkbox} | ||
dataTestId="inputCheckbox" | ||
@@ -48,0 +48,0 @@ label="Checkbox" |
{ | ||
"name": "@welcome-ui/checkbox", | ||
"version": "1.0.12-alpha.0", | ||
"version": "1.0.15-alpha.0", | ||
"description": "Customizable design system with react • styled-components • styled-system and reakit.", | ||
@@ -46,6 +46,3 @@ "main": "dist/welcome-ui.cjs.js", | ||
}, | ||
"gitHead": "5df73bdc0cea3ce47b7466285c7519f05d7644e8", | ||
"devDependencies": { | ||
"@welcome-ui/connected-field": "^1.0.12-alpha.0" | ||
} | ||
"gitHead": "79a9de68d9ce0960eb9dbc6dcc799faea6f079f2" | ||
} |
@@ -8,3 +8,3 @@ import styled, { css } from '@xstyled/styled-components' | ||
export const InputCheckbox = styled(filterComponent(ReakitCheckbox))( | ||
export const Checkbox = styled(filterComponent(ReakitCheckbox))( | ||
({ connected, order = '-1' }) => css` | ||
@@ -11,0 +11,0 @@ ${fieldStyles}; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
0
428
23285
1