@eturnity/eturnity_reusable_components 1.2.40 → 1.2.41
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
@@ -1,8 +1,9 @@
|
|
1
1
|
<template>
|
2
2
|
<page-container>
|
3
3
|
<button-container
|
4
|
-
:isDisabled="isDisabled"
|
5
4
|
:type="type"
|
5
|
+
:minWidth="minWidth"
|
6
|
+
:isDisabled="isDisabled"
|
6
7
|
:customColor="customColor"
|
7
8
|
>
|
8
9
|
{{ text }}
|
@@ -14,37 +15,39 @@
|
|
14
15
|
// To use:
|
15
16
|
// import MainButton from "@eturnity/eturnity_reusable_components/src/components/buttons/mainButton"
|
16
17
|
// <main-button
|
17
|
-
// type="secondary" // primary, secondary, cancel
|
18
|
-
// :isDisabled="true"
|
19
18
|
// text="Click Me"
|
20
19
|
// customColor="#ab5348"
|
20
|
+
// type="secondary" // primary, secondary, cancel
|
21
|
+
// :isDisabled="true"
|
22
|
+
// :minWidth="minWidth"
|
21
23
|
// />
|
22
24
|
|
23
25
|
import styled from "vue-styled-components"
|
24
26
|
|
25
27
|
const PageContainer = styled.div``
|
26
28
|
|
27
|
-
const ButtonAttrs = { type: String, isDisabled: Boolean, customColor: String }
|
29
|
+
const ButtonAttrs = { type: String, isDisabled: Boolean, minWidth: String, customColor: String }
|
28
30
|
const ButtonContainer = styled("div", ButtonAttrs)`
|
29
31
|
padding: 7px 15px;
|
30
32
|
font-size: 13px;
|
31
33
|
color: ${(props) => props.theme.colors.white};
|
32
34
|
background-color: ${(props) =>
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
35
|
+
props.isDisabled
|
36
|
+
? props.theme.colors.disabled
|
37
|
+
: props.customColor
|
38
|
+
? props.customColor
|
39
|
+
: props.type === "primary"
|
40
|
+
? props.theme.colors.black
|
41
|
+
: props.type === "secondary"
|
42
|
+
? props.theme.colors.grey3
|
43
|
+
: props.type === "cancel"
|
44
|
+
? props.theme.colors.red
|
45
|
+
: props.theme.colors.black};
|
44
46
|
border-radius: 4px;
|
45
47
|
text-align: center;
|
46
48
|
cursor: ${(props) => (props.isDisabled ? "not-allowed" : "pointer")};
|
47
49
|
user-select: none;
|
50
|
+
${(props) => (props.minWidth ? `min-width: ${props.minWidth};` : '')};
|
48
51
|
|
49
52
|
&:hover {
|
50
53
|
opacity: ${(props) => (props.isDisabled ? "1" : "0.8")};
|
@@ -77,6 +80,10 @@ export default {
|
|
77
80
|
required: false,
|
78
81
|
default: null,
|
79
82
|
},
|
83
|
+
minWidth: {
|
84
|
+
required: false,
|
85
|
+
default: null
|
86
|
+
}
|
80
87
|
},
|
81
88
|
}
|
82
89
|
</script>
|
@@ -74,7 +74,7 @@ const InputLabel = styled('div', labelAttrs)`
|
|
74
74
|
};
|
75
75
|
|
76
76
|
font-size: ${(props) => (props.fontSize ? props.fontSize : '13px')};
|
77
|
-
font-
|
77
|
+
font-family: 'Lato-Bold', Arial;
|
78
78
|
`
|
79
79
|
|
80
80
|
const LabelWrapper = styled.div`
|
@@ -138,7 +138,7 @@ const InputContainer = styled('input', inputProps)`
|
|
138
138
|
min-width: ${(props) => (props.minWidth ? props.minWidth : 'unset')};
|
139
139
|
max-height: ${(props) => props.inputHeight};
|
140
140
|
box-sizing: border-box; // to allow width of 100% with padding
|
141
|
-
font-weight:
|
141
|
+
font-weight: 400;
|
142
142
|
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'auto')};
|
143
143
|
background-color: ${(props) =>
|
144
144
|
props.isDisabled ? props.theme.colors.grey5 :
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<template>
|
2
2
|
<component-wrapper :layout="layout">
|
3
3
|
<radio-wrapper v-for="(item, index) in options" :key="item.value">
|
4
|
-
<label-container :size="size" :isDisabled="item.disabled" :isChecked="selectedOption === item.value">
|
4
|
+
<label-container :size="size" :isDisabled="item.disabled" :isChecked="selectedOption === item.value" :checkmarkColor="checkmarkColor">
|
5
5
|
<radio
|
6
6
|
type="radio"
|
7
7
|
:value="selectedOption"
|
@@ -83,7 +83,7 @@ const RadioWrapper = styled.div`
|
|
83
83
|
grid-gap: 10px;
|
84
84
|
`
|
85
85
|
|
86
|
-
const containerProps = { size: String, isDisabled: Boolean, isChecked: Boolean }
|
86
|
+
const containerProps = { size: String, isDisabled: Boolean, isChecked: Boolean, checkmarkColor: String }
|
87
87
|
const LabelContainer = styled("label", containerProps)`
|
88
88
|
display: grid;
|
89
89
|
grid-template-columns: auto 1fr auto;
|
@@ -139,7 +139,7 @@ const LabelContainer = styled("label", containerProps)`
|
|
139
139
|
? "8px"
|
140
140
|
: "6px"};
|
141
141
|
border-radius: 100%;
|
142
|
-
background: ${(props) => props.theme.colors.
|
142
|
+
background: ${(props) => props.checkmarkColor ? props.checkmarkColor : props.theme.colors.green};
|
143
143
|
}
|
144
144
|
}
|
145
145
|
`
|
@@ -220,6 +220,10 @@ export default {
|
|
220
220
|
name: {
|
221
221
|
required: false,
|
222
222
|
default: ''
|
223
|
+
},
|
224
|
+
checkmarkColor: {
|
225
|
+
required: false,
|
226
|
+
default: ''
|
223
227
|
}
|
224
228
|
},
|
225
229
|
data() {
|