@woosmap/ui 3.163.0 → 3.165.0
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
|
@@ -13,9 +13,9 @@ export default class Switch extends Component {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
render() {
|
|
16
|
-
const { id, text, checked, onChange, name, optionLabels, disabled } = this.props;
|
|
16
|
+
const { id, text, checked, onChange, name, optionLabels, isSmall, disabled } = this.props;
|
|
17
17
|
return (
|
|
18
|
-
<div className=
|
|
18
|
+
<div className={cl('switch', { 'switch--small': isSmall })}>
|
|
19
19
|
<div className="switch__container">
|
|
20
20
|
<input
|
|
21
21
|
type="checkbox"
|
|
@@ -62,6 +62,7 @@ Switch.defaultProps = {
|
|
|
62
62
|
name: null,
|
|
63
63
|
disabled: false,
|
|
64
64
|
text: '',
|
|
65
|
+
isSmall: false,
|
|
65
66
|
};
|
|
66
67
|
|
|
67
68
|
Switch.propTypes = {
|
|
@@ -72,4 +73,5 @@ Switch.propTypes = {
|
|
|
72
73
|
optionLabels: PropTypes.array,
|
|
73
74
|
disabled: PropTypes.bool,
|
|
74
75
|
text: PropTypes.string,
|
|
76
|
+
isSmall: PropTypes.bool,
|
|
75
77
|
};
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
display flex
|
|
3
3
|
align-items center
|
|
4
4
|
mbi()
|
|
5
|
+
&--small
|
|
6
|
+
mbi(.6rem)
|
|
5
7
|
&__container
|
|
6
8
|
position relative
|
|
7
9
|
margin-right 1rem
|
|
@@ -10,6 +12,8 @@
|
|
|
10
12
|
vertical-align middle
|
|
11
13
|
user-select none
|
|
12
14
|
text-align left
|
|
15
|
+
.switch--small &
|
|
16
|
+
width 2.4rem
|
|
13
17
|
&__checkbox
|
|
14
18
|
display none
|
|
15
19
|
&__label
|
|
@@ -28,6 +32,8 @@
|
|
|
28
32
|
&__text
|
|
29
33
|
&--disabled
|
|
30
34
|
opacity .4
|
|
35
|
+
.switch--small &
|
|
36
|
+
font-size $fontSizeSmall
|
|
31
37
|
&__inner
|
|
32
38
|
display block
|
|
33
39
|
width 200%
|
|
@@ -44,6 +50,8 @@
|
|
|
44
50
|
color white
|
|
45
51
|
font-weight bold
|
|
46
52
|
box-sizing border-box
|
|
53
|
+
.switch--small &
|
|
54
|
+
height 1.3rem
|
|
47
55
|
&:before
|
|
48
56
|
content attr(data-yes)
|
|
49
57
|
text-transform uppercase
|
|
@@ -68,6 +76,9 @@
|
|
|
68
76
|
bottom 0
|
|
69
77
|
right 1.6rem
|
|
70
78
|
transition all 0.3s ease-in 0s
|
|
79
|
+
.switch--small &
|
|
80
|
+
width 1.1rem
|
|
81
|
+
right 1.1rem
|
|
71
82
|
&__checkbox
|
|
72
83
|
&:checked + .switch__label
|
|
73
84
|
.switch
|