@cypress-design/react-checkbox 0.4.5 → 0.4.6
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/CHANGELOG.md +6 -0
- package/Checkbox.tsx +2 -2
- package/CheckboxReact.cy.tsx +12 -0
- package/dist/index.es.mjs +4 -4
- package/dist/index.es.mjs.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @cypress-design/react-checkbox
|
|
2
2
|
|
|
3
|
+
## 0.4.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#112](https://github.com/cypress-io/cypress-design/pull/112) [`d229b48`](https://github.com/cypress-io/cypress-design/commit/d229b48a3806a882abe83c9ebf9c32ed18d2c47f) Thanks [@elevatebart](https://github.com/elevatebart)! - fix: when label is too big avoid checkbox shrinking
|
|
8
|
+
|
|
3
9
|
## 0.4.5
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/Checkbox.tsx
CHANGED
|
@@ -81,7 +81,7 @@ export const Checkbox: FunctionComponent<CheckboxProps> = ({
|
|
|
81
81
|
)}
|
|
82
82
|
<span
|
|
83
83
|
className={clsx([
|
|
84
|
-
`block border-1 border-solid rounded h-16px w-16px flex items-center text-white`,
|
|
84
|
+
`block border-1 border-solid rounded h-16px w-16px flex flex-shrink-0 items-center text-white`,
|
|
85
85
|
disabled
|
|
86
86
|
? 'border-gray-200 bg-gray-100'
|
|
87
87
|
: localChecked
|
|
@@ -97,7 +97,7 @@ export const Checkbox: FunctionComponent<CheckboxProps> = ({
|
|
|
97
97
|
<span
|
|
98
98
|
className={clsx([
|
|
99
99
|
disabled ? 'text-gray-500' : 'text-gray-800',
|
|
100
|
-
'block ml-
|
|
100
|
+
'block ml-8px text-16px leading-24px font-light select-none',
|
|
101
101
|
])}
|
|
102
102
|
>
|
|
103
103
|
{label}
|
package/CheckboxReact.cy.tsx
CHANGED
|
@@ -38,4 +38,16 @@ describe('Checkbox', () => {
|
|
|
38
38
|
cy.get('svg').click()
|
|
39
39
|
cy.get('input[type="checkbox"]').should('not.be.checked')
|
|
40
40
|
})
|
|
41
|
+
|
|
42
|
+
it('keeps its width when label is long', () => {
|
|
43
|
+
mount(
|
|
44
|
+
<Checkbox
|
|
45
|
+
label="lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
|
46
|
+
id="lorem-checkbox"
|
|
47
|
+
onChange={() => {}}
|
|
48
|
+
/>
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
cy.get('label span:first-child').invoke('outerWidth').should('equal', 16)
|
|
52
|
+
})
|
|
41
53
|
})
|
package/dist/index.es.mjs
CHANGED
|
@@ -88,7 +88,7 @@ var compileReactIconProperties = function (_a) {
|
|
|
88
88
|
}
|
|
89
89
|
return newAttributes;
|
|
90
90
|
}, {});
|
|
91
|
-
var componentProps = __assign({ width: size, height: size, fill: 'none', dangerouslySetInnerHTML: {
|
|
91
|
+
var componentProps = __assign({ width: size, height: size, viewBox: "0 0 " + size + " " + size, fill: 'none', dangerouslySetInnerHTML: {
|
|
92
92
|
__html: body
|
|
93
93
|
} }, filteredAttributes);
|
|
94
94
|
if (attributes.className) {
|
|
@@ -130,7 +130,7 @@ var Checkbox = function (_a) {
|
|
|
130
130
|
// <windi-keep strokeColor="white"/>
|
|
131
131
|
React.createElement(IconCheckmarkSmall, { strokeColor: "white", className: "absolute" })),
|
|
132
132
|
React.createElement("span", { className: clsx([
|
|
133
|
-
"block border-1 border-solid rounded h-16px w-16px flex items-center text-white",
|
|
133
|
+
"block border-1 border-solid rounded h-16px w-16px flex flex-shrink-0 items-center text-white",
|
|
134
134
|
disabled
|
|
135
135
|
? 'border-gray-200 bg-gray-100'
|
|
136
136
|
: localChecked
|
|
@@ -143,11 +143,11 @@ var Checkbox = function (_a) {
|
|
|
143
143
|
]) }),
|
|
144
144
|
label && (React.createElement("span", { className: clsx([
|
|
145
145
|
disabled ? 'text-gray-500' : 'text-gray-800',
|
|
146
|
-
'block ml-
|
|
146
|
+
'block ml-8px text-16px leading-24px font-light select-none',
|
|
147
147
|
]) }, label)))));
|
|
148
148
|
};
|
|
149
149
|
|
|
150
150
|
export { Checkbox as default };
|
|
151
151
|
|
|
152
|
-
/* <windicss-keep class="block relative flex items-center absolute inset-0 w-0 h-0 opacity-0 border-1 border-solid rounded h-16px w-16px text-white border-gray-200 bg-gray-100 border-indigo-500 bg-indigo-400 border-jade-500 bg-jade-400 border-red-500 bg-red-400 bg-white text-gray-500 text-gray-800 ml-
|
|
152
|
+
/* <windicss-keep class="block relative flex items-center absolute inset-0 w-0 h-0 opacity-0 border-1 border-solid rounded h-16px w-16px flex-shrink-0 text-white border-gray-200 bg-gray-100 border-indigo-500 bg-indigo-400 border-jade-500 bg-jade-400 border-red-500 bg-red-400 bg-white text-gray-500 text-gray-800 ml-8px text-16px leading-24px font-light select-none icon-dark-white"> */
|
|
153
153
|
//# sourceMappingURL=index.es.mjs.map
|