feat: Add Min-Width Style Variables for Switch Component (#20829)

* chore: Export form typescript interface

* Feat -- Min-Width Style Variables for Switch Component

Implementation of feature request from @LuisRodriguezLD

Co-authored-by: 二货机器人 <smith3816@gmail.com>
This commit is contained in:
Hami Abdi 2020-01-11 07:24:10 -08:00 committed by 二货机器人
parent 29316b4e9d
commit d70637edba
3 changed files with 7 additions and 5 deletions

View File

@ -1,5 +1,5 @@
import InternalForm, { useForm, FormInstance } from './Form';
import Item from './FormItem';
import InternalForm, { useForm, FormInstance, FormProps } from './Form';
import Item, { FormItemProps } from './FormItem';
import List from './FormList';
import { FormProvider } from './context';
import warning from '../_util/warning';
@ -29,6 +29,6 @@ Form.create = () => {
);
};
export { FormInstance };
export { FormInstance, FormProps, FormItemProps };
export default Form;

View File

@ -631,6 +631,8 @@
// ---
@switch-height: 22px;
@switch-sm-height: 16px;
@switch-min-width: 44px;
@switch-sm-min-width: 28px;
@switch-sm-checked-margin-left: -(@switch-sm-height - 3px);
@switch-disabled-opacity: 0.4;
@switch-color: @primary-color;

View File

@ -10,7 +10,7 @@
position: relative;
display: inline-block;
box-sizing: border-box;
min-width: 44px;
min-width: @switch-min-width;
height: @switch-height;
line-height: @switch-height - 2px;
vertical-align: middle;
@ -101,7 +101,7 @@
}
&-small {
min-width: 28px;
min-width: @switch-sm-min-width;
height: @switch-sm-height;
line-height: @switch-sm-height - 2px;