From 9386a0faadc1e2ca3379868da6f83bcd6b07dfe0 Mon Sep 17 00:00:00 2001 From: joneff Date: Mon, 18 Oct 2021 00:24:48 +0300 Subject: [PATCH] chore: enhance radio and checkbox wrappers and docs --- packages/html/src/checkbox/README.md | 22 ++++++++++++++++ packages/html/src/checkbox/checkbox.jsx | 35 ++++++++++++++----------- packages/html/src/radio/README.md | 21 +++++++++++++++ packages/html/src/radio/radio.jsx | 32 ++++++++++++---------- 4 files changed, 81 insertions(+), 29 deletions(-) diff --git a/packages/html/src/checkbox/README.md b/packages/html/src/checkbox/README.md index e69de29bb2d..5f3a8aee8eb 100644 --- a/packages/html/src/checkbox/README.md +++ b/packages/html/src/checkbox/README.md @@ -0,0 +1,22 @@ +```html + + + + + +``` diff --git a/packages/html/src/checkbox/checkbox.jsx b/packages/html/src/checkbox/checkbox.jsx index 061fe4a4c04..9851b1a13ef 100644 --- a/packages/html/src/checkbox/checkbox.jsx +++ b/packages/html/src/checkbox/checkbox.jsx @@ -58,20 +58,21 @@ function CheckboxStatic(props) { } ]; - let legacyClasses = [ - ownClassName, - 'k-checkbox', - { - 'k-state-hover': hover === true, - 'k-state-focus': focus === true, - 'k-state-invalid': invalid === true, - 'k-state-disabled': disabled === true, - 'k-checked': checked === true, - 'k-state-indeterminate': isIndeterminate, - } - ]; - if (legacy) { + + let legacyClasses = [ + ownClassName, + 'k-checkbox', + { + 'k-state-hover': hover === true, + 'k-state-focus': focus === true, + 'k-state-invalid': invalid === true, + 'k-state-disabled': disabled === true, + 'k-checked': checked === true, + 'k-state-indeterminate': isIndeterminate, + } + ]; + return ( ); @@ -86,10 +87,15 @@ CheckboxStatic.defaultProps = { ...globalDefaultProps, id: '', - name: '' + name: '', + + size: 'medium', + rounded: 'medium' }; CheckboxStatic.propTypes = { + className: typeof '', + id: typeof '', name: typeof '', value: typeof '', @@ -110,7 +116,6 @@ CheckboxStatic.propTypes = { aria: typeof false, legacy: typeof false, - className: typeof '', htmlAttributes: typeof [] }; diff --git a/packages/html/src/radio/README.md b/packages/html/src/radio/README.md index e69de29bb2d..642ccf8727a 100644 --- a/packages/html/src/radio/README.md +++ b/packages/html/src/radio/README.md @@ -0,0 +1,21 @@ +```html + + + + + +``` diff --git a/packages/html/src/radio/radio.jsx b/packages/html/src/radio/radio.jsx index ccc13d2c426..e3fcff987b1 100644 --- a/packages/html/src/radio/radio.jsx +++ b/packages/html/src/radio/radio.jsx @@ -48,19 +48,20 @@ function RadioStatic(props) { } ]; - let legacyClasses = [ - ownClassName, - 'k-radio', - { - 'k-state-hover': hover === true, - 'k-state-focus': focus === true, - 'k-state-invalid': invalid === true, - 'k-state-disabled': disabled === true, - 'k-state-checked': checked === true, - } - ]; - if (legacy) { + + let legacyClasses = [ + ownClassName, + 'k-radio', + { + 'k-state-hover': hover === true, + 'k-state-focus': focus === true, + 'k-state-invalid': invalid === true, + 'k-state-disabled': disabled === true, + 'k-state-checked': checked === true, + } + ]; + return ; } @@ -71,10 +72,14 @@ RadioStatic.defaultProps = { ...globalDefaultProps, id: '', - name: '' + name: '', + + size: 'medium' }; RadioStatic.propTypes = { + className: typeof '', + id: typeof '', name: typeof '', value: typeof '', @@ -92,7 +97,6 @@ RadioStatic.propTypes = { aria: typeof false, legacy: typeof false, - className: typeof '', htmlAttributes: typeof [] };