@eturnity/eturnity_reusable_components 1.1.66 → 1.1.69

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "1.1.66",
3
+ "version": "1.1.69",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
package/src/App.vue CHANGED
@@ -55,6 +55,7 @@
55
55
  size="small"
56
56
  :isDisabled="false"
57
57
  />
58
+ <external-button text="Click me!" minWidth="500px" />
58
59
  </page-container>
59
60
  </ThemeProvider>
60
61
  </template>
@@ -70,6 +71,7 @@ import InputNumber from "@/components/inputs/inputNumber"
70
71
  import Checkbox from "@/components/inputs/checkbox"
71
72
  import PageSubtitle from "@/components/pageSubtitle"
72
73
  import Spinner from "@/components/spinner"
74
+ import ExternalButton from "@/components/buttons/externalButton"
73
75
  // import TableDropdown from "@/components/tableDropdown"
74
76
 
75
77
  const PageContainer = styled.div`
@@ -88,6 +90,7 @@ export default {
88
90
  PageSubtitle,
89
91
  Spinner,
90
92
  Checkbox,
93
+ ExternalButton,
91
94
  // TableDropdown,
92
95
  },
93
96
  data() {
@@ -159,6 +162,9 @@ export default {
159
162
  isDropdownOpen() {
160
163
  return this.dropdownOpen
161
164
  },
165
+ onClickButton() {
166
+ console.log("Test")
167
+ },
162
168
  toggleDropdownOpen() {
163
169
  this.dropdownOpen = !this.dropdownOpen
164
170
  },
@@ -0,0 +1,6 @@
1
+ <svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0 4C0 1.79086 1.79086 0 4 0H30V30H4C1.79086 30 0 28.2091 0 26V4Z" fill="white" fill-opacity="0.1"/>
3
+ <path d="M20.65 22H9.24995C8.54995 22 7.94995 21.4 7.94995 20.7V9.3C7.94995 8.6 8.54995 8 9.24995 8H13.95V10H10.85C10.35 10 9.94995 10.4 9.94995 10.9V19.2C9.94995 19.6 10.35 20 10.85 20H19.15C19.65 20 20.05 19.6 20.05 19.1V16H22.05V20.7C21.95 21.4 21.35 22 20.65 22Z" fill="white"/>
4
+ <path d="M15.95 8H21.95V14L15.95 8Z" fill="white"/>
5
+ <path d="M20.809 10.6108L19.3948 9.19659L12.2531 16.3383L13.6673 17.7525L20.809 10.6108Z" fill="white"/>
6
+ </svg>
@@ -11,7 +11,7 @@ const theme = {
11
11
  lightGray: "#f2f2f2",
12
12
  white: "#fff",
13
13
  blue: "#48a2d0",
14
- red: "#ff7e7e",
14
+ red: "#ff5656",
15
15
  blue1: "#e4efff",
16
16
  grey1: "#666",
17
17
  grey2: "#c4c4c4",
@@ -0,0 +1,101 @@
1
+ <template>
2
+ <page-container>
3
+ <button-wrapper
4
+ :isDisabled="isDisabled"
5
+ :minWidth="minWidth"
6
+ :customColor="customColor"
7
+ >
8
+ <icon-container>
9
+ <icon-element
10
+ :src="require('../../../assets/icons/external_icon.svg')"
11
+ />
12
+ </icon-container>
13
+ <button-container>{{ text }}</button-container>
14
+ </button-wrapper>
15
+ </page-container>
16
+ </template>
17
+
18
+ <script>
19
+ // import ExternalButton from "@eturnity/eturnity_reusable_components/src/components/buttons/externalButton"
20
+ // <main-button
21
+ // :isDisabled="true"
22
+ // text="Click Me"
23
+ // minWidth="300px"
24
+ // customColor="#000"
25
+ // />
26
+
27
+ import styled from "vue-styled-components"
28
+
29
+ const PageContainer = styled.div``
30
+
31
+ const ButtonAttrs = {
32
+ isDisabled: Boolean,
33
+ minWidth: String,
34
+ customColor: String,
35
+ }
36
+ const ButtonWrapper = styled("div", ButtonAttrs)`
37
+ display: grid;
38
+ grid-template-columns: auto 1fr;
39
+ background-color: ${(props) =>
40
+ props.isDisabled
41
+ ? props.theme.colors.disabled
42
+ : props.customColor
43
+ ? props.customColor
44
+ : props.theme.colors.yellow};
45
+ cursor: ${(props) => (props.isDisabled ? "not-allowed" : "pointer")};
46
+ user-select: none;
47
+ border-radius: 4px;
48
+ min-width: ${(props) => (props.minWidth ? props.minWidth : "initial")};
49
+
50
+ &:hover {
51
+ opacity: ${(props) => (props.isDisabled ? "1" : "0.8")};
52
+ }
53
+
54
+ &:active {
55
+ opacity: 1;
56
+ }
57
+ `
58
+
59
+ const ButtonContainer = styled.div`
60
+ padding: 7px 15px;
61
+ font-size: 13px;
62
+ color: ${(props) => props.theme.colors.white};
63
+ text-align: center;
64
+ `
65
+
66
+ const IconContainer = styled.div`
67
+ display: grid;
68
+ align-items: center;
69
+ justify-items: center;
70
+ `
71
+
72
+ const IconElement = styled.img``
73
+
74
+ export default {
75
+ name: "external-button",
76
+ components: {
77
+ PageContainer,
78
+ ButtonContainer,
79
+ ButtonWrapper,
80
+ IconContainer,
81
+ IconElement,
82
+ },
83
+ props: {
84
+ isDisabled: {
85
+ required: false,
86
+ default: false,
87
+ },
88
+ text: {
89
+ required: true,
90
+ },
91
+ minWidth: {
92
+ required: false,
93
+ default: null,
94
+ },
95
+ customColor: {
96
+ required: false,
97
+ default: null,
98
+ },
99
+ },
100
+ }
101
+ </script>
@@ -0,0 +1,82 @@
1
+ <template>
2
+ <page-container>
3
+ <button-container
4
+ :isDisabled="isDisabled"
5
+ :type="type"
6
+ :customColor="customColor"
7
+ >
8
+ {{ text }}
9
+ </button-container>
10
+ </page-container>
11
+ </template>
12
+
13
+ <script>
14
+ // To use:
15
+ // import MainButton from "@eturnity/eturnity_reusable_components/src/components/buttons/mainButton"
16
+ // <main-button
17
+ // type="secondary" // primary, secondary, cancel
18
+ // :isDisabled="true"
19
+ // text="Click Me"
20
+ // customColor="#ab5348"
21
+ // />
22
+
23
+ import styled from "vue-styled-components"
24
+
25
+ const PageContainer = styled.div``
26
+
27
+ const ButtonAttrs = { type: String, isDisabled: Boolean, customColor: String }
28
+ const ButtonContainer = styled("div", ButtonAttrs)`
29
+ padding: 7px 15px;
30
+ font-size: 13px;
31
+ color: ${(props) => props.theme.colors.white};
32
+ background-color: ${(props) =>
33
+ props.isDisabled
34
+ ? props.theme.colors.disabled
35
+ : props.customColor
36
+ ? props.customColor
37
+ : props.type === "primary"
38
+ ? props.theme.colors.black
39
+ : props.type === "secondary"
40
+ ? props.theme.colors.grey3
41
+ : props.type === "cancel"
42
+ ? props.theme.colors.red
43
+ : props.theme.colors.black};
44
+ border-radius: 4px;
45
+ text-align: center;
46
+ cursor: ${(props) => (props.isDisabled ? "not-allowed" : "pointer")};
47
+ user-select: none;
48
+
49
+ &:hover {
50
+ opacity: ${(props) => (props.isDisabled ? "1" : "0.8")};
51
+ }
52
+
53
+ &:active {
54
+ opacity: 1;
55
+ }
56
+ `
57
+
58
+ export default {
59
+ name: "main-button",
60
+ components: {
61
+ PageContainer,
62
+ ButtonContainer,
63
+ },
64
+ props: {
65
+ type: {
66
+ required: false,
67
+ default: "primary",
68
+ },
69
+ isDisabled: {
70
+ required: false,
71
+ default: false,
72
+ },
73
+ text: {
74
+ required: true,
75
+ },
76
+ customColor: {
77
+ required: false,
78
+ default: null,
79
+ },
80
+ },
81
+ }
82
+ </script>