@eturnity/eturnity_reusable_components 7.51.16-EPDM-13568.1 → 7.51.16-EPDM-13568.3

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "7.51.16-EPDM-13568.1",
3
+ "version": "7.51.16-EPDM-13568.3",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
package/src/App.vue CHANGED
@@ -1,22 +1,22 @@
1
1
  <template>
2
- <ThemeProvider :style="{ height: '100%' }" :theme="getTheme()">
2
+ <ThemeProvider :style="{ height: '100%' }" :theme="theme">
3
3
  <RouterView />
4
4
  </ThemeProvider>
5
5
  </template>
6
6
 
7
7
  <script>
8
8
  import { ThemeProvider } from 'vue3-styled-components'
9
- import theme from './assets/theme'
9
+ import theme from '@/assets/theme.js'
10
10
 
11
11
  export default {
12
12
  name: 'App',
13
13
  components: {
14
14
  ThemeProvider,
15
15
  },
16
- methods: {
17
- getTheme() {
18
- return theme
19
- },
16
+ setup() {
17
+ return {
18
+ theme,
19
+ }
20
20
  },
21
21
  }
22
22
  </script>
@@ -0,0 +1,5 @@
1
+ <svg width="12" height="11" viewBox="0 0 12 11" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M1.48791 8.60607C2.0063 8.2283 2.71145 7.71445 3.97197 7.71445C4.5703 7.71445 5.04544 7.82349 5.45393 7.99996C5.84112 8.16724 6.14723 8.38769 6.39326 8.56488L6.4106 8.57737C6.67117 8.76496 6.86936 8.90486 7.10995 9.00878C7.33842 9.10745 7.62765 9.18186 8.04848 9.18186C8.83404 9.18186 9.16094 8.94855 9.63985 8.60676C9.77269 8.51195 9.91723 8.4088 10.0865 8.29996C10.405 8.09514 10.8293 8.18732 11.0341 8.50586C11.2389 8.82439 11.1467 9.24866 10.8282 9.45348C10.7333 9.5145 10.6339 9.58693 10.5267 9.66506C10.0086 10.0426 9.3078 10.5533 8.04848 10.5533C7.45001 10.5533 6.97476 10.4442 6.56619 10.2678C6.17879 10.1005 5.87258 9.87993 5.62647 9.70269L5.60933 9.69035C5.34871 9.50272 5.15058 9.36282 4.91005 9.25891C4.68167 9.16025 4.39259 9.08586 3.97197 9.08586C3.18671 9.08586 2.8624 9.31732 2.38624 9.65715C2.24614 9.75714 2.09289 9.86651 1.91089 9.98213C1.59124 10.1852 1.16749 10.0907 0.964421 9.77102C0.761356 9.45136 0.855873 9.02761 1.17553 8.82455C1.27346 8.76234 1.37636 8.68735 1.48791 8.60607Z" fill="#5900CC"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M1.48791 5.17755C2.0063 4.79979 2.71145 4.28594 3.97197 4.28594C4.5703 4.28594 5.04544 4.39497 5.45393 4.57145C5.84112 4.73872 6.14723 4.95918 6.39326 5.13636L6.4106 5.14885C6.67117 5.33645 6.86936 5.47635 7.10995 5.58026C7.33842 5.67894 7.62765 5.75334 8.04848 5.75334C8.83404 5.75334 9.16094 5.52004 9.63985 5.17824C9.77269 5.08344 9.91723 4.98028 10.0865 4.87144C10.405 4.66662 10.8293 4.75881 11.0341 5.07734C11.2389 5.39588 11.1467 5.82014 10.8282 6.02496C10.7333 6.08599 10.6339 6.15842 10.5267 6.23654C10.0086 6.61409 9.3078 7.12475 8.04848 7.12475C7.45001 7.12475 6.97476 7.01572 6.56619 6.83926C6.17879 6.67194 5.87258 6.45142 5.62647 6.27417L5.60933 6.26183C5.34871 6.0742 5.15058 5.93431 4.91005 5.83039C4.68167 5.73173 4.39259 5.65734 3.97197 5.65734C3.18671 5.65734 2.8624 5.88881 2.38624 6.22864C2.24614 6.32863 2.09289 6.438 1.91089 6.55361C1.59124 6.75668 1.16749 6.66216 0.964421 6.3425C0.761356 6.02285 0.855873 5.5991 1.17553 5.39603C1.27346 5.33382 1.37636 5.25884 1.48791 5.17755Z" fill="#5900CC"/>
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M1.48791 1.74904C2.0063 1.37127 2.71145 0.857422 3.97197 0.857422C4.5703 0.857422 5.04544 0.966459 5.45393 1.14293C5.84112 1.31021 6.14723 1.53066 6.39326 1.70785L6.4106 1.72034C6.67117 1.90793 6.86936 2.04783 7.10995 2.15175C7.33842 2.25042 7.62765 2.32483 8.04848 2.32483C8.83404 2.32483 9.16094 2.09152 9.63985 1.74973C9.77269 1.65492 9.91723 1.55177 10.0865 1.44293C10.405 1.23811 10.8293 1.33029 11.0341 1.64883C11.2389 1.96736 11.1467 2.39163 10.8282 2.59645C10.7333 2.65747 10.6339 2.7299 10.5267 2.80803C10.0086 3.18557 9.3078 3.69623 8.04848 3.69623C7.45001 3.69623 6.97476 3.58721 6.56619 3.41075C6.17879 3.24343 5.87258 3.0229 5.62647 2.84566L5.60933 2.83332C5.34871 2.64569 5.15058 2.50579 4.91005 2.40188C4.68167 2.30322 4.39259 2.22883 3.97197 2.22883C3.18671 2.22883 2.8624 2.46029 2.38624 2.80012C2.24614 2.90011 2.09289 3.00948 1.91089 3.1251C1.59124 3.32816 1.16749 3.23365 0.964421 2.91399C0.761356 2.59433 0.855873 2.17058 1.17553 1.96752C1.27346 1.90531 1.37636 1.83032 1.48791 1.74904Z" fill="#5900CC"/>
5
+ </svg>
@@ -1,7 +1,7 @@
1
1
  const theme = {
2
2
  colors: {
3
- primary: '#48a2d0',
4
- secondary: '#fdb813',
3
+ primary: '#5900CC',
4
+ secondary: '#FAF5FF',
5
5
  tertiary: '#d5d5d5',
6
6
  black: '#263238',
7
7
  yellow: '#fdb813',
@@ -1,19 +1,31 @@
1
1
  <template>
2
2
  <PageContainer>
3
3
  <ButtonWrapper
4
+ :button-size="buttonSize"
4
5
  :custom-color="customColor"
5
- :height="height"
6
6
  :is-disabled="isDisabled"
7
7
  :min-width="minWidth"
8
+ :theme-type="themeType"
9
+ :type="type"
10
+ :variant="variant"
8
11
  >
9
- <IconContainer :width="height">
12
+ <IconContainer
13
+ :button-size="buttonSize"
14
+ :theme-type="themeType"
15
+ :type="type"
16
+ :variant="variant"
17
+ >
10
18
  <Icon
11
- :color="fontColor ? fontColor : theme.colors.white"
19
+ :color="
20
+ iconColor ||
21
+ theme.mainButton[themeType][type][variant].textColor ||
22
+ theme.colors.white
23
+ "
12
24
  :name="iconName"
13
25
  size="14px"
14
26
  />
15
27
  </IconContainer>
16
- <ButtonContainer :font-color="fontColor" :font-size="fontSize">
28
+ <ButtonContainer :button-size="buttonSize">
17
29
  {{ text }}
18
30
  </ButtonContainer>
19
31
  </ButtonWrapper>
@@ -40,61 +52,96 @@
40
52
  const PageContainer = styled.div``
41
53
 
42
54
  const ButtonAttrs = {
55
+ type: String,
43
56
  isDisabled: Boolean,
44
57
  minWidth: String,
45
58
  customColor: String,
46
- height: String,
59
+ buttonSize: String,
60
+ themeType: String,
61
+ variant: String,
47
62
  }
48
63
  const ButtonWrapper = styled('div', ButtonAttrs)`
49
64
  display: grid;
50
65
  grid-template-columns: auto 1fr;
66
+ font-size: ${(props) =>
67
+ props.theme?.mainButton?.size?.[props.buttonSize]?.fontSize};
68
+ color: ${(props) =>
69
+ props.isDisabled
70
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
71
+ .disabled.textColor
72
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
73
+ .textColor};
51
74
  background-color: ${(props) =>
52
75
  props.isDisabled
53
- ? props.theme.colors.disabled
76
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
77
+ .disabled.backgroundColor
54
78
  : props.customColor
55
- ? props.theme.colors[props.customColor]
56
- ? props.theme.colors[props.customColor]
57
- : props.customColor
58
- : props.theme.colors.yellow};
79
+ ? props.customColor
80
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
81
+ .default};
82
+ border: ${(props) => {
83
+ const borderValue = props.isDisabled
84
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
85
+ .disabled.borderColor
86
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
87
+ .borderColor
88
+ return borderValue ? '1px solid ' + borderValue : 'none'
89
+ }};
59
90
  cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
60
91
  user-select: none;
61
92
  border-radius: 4px;
62
93
  overflow: hidden;
63
- min-width: ${(props) => (props.minWidth ? props.minWidth : 'initial')};
64
- height: ${(props) => props.height};
94
+ min-width: ${(props) => props.minWidth || 'initial'};
65
95
 
66
96
  &:hover {
67
- opacity: ${(props) => (props.isDisabled ? '1' : '0.8')};
97
+ background-color: ${(props) =>
98
+ props.isDisabled
99
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
100
+ .disabled.backgroundColor
101
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
102
+ .hover};
68
103
  }
69
104
 
70
105
  &:active {
71
- opacity: 1;
106
+ background-color: ${(props) =>
107
+ props.isDisabled
108
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
109
+ .disabled.backgroundColor
110
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
111
+ .active};
72
112
  }
73
113
  `
74
114
 
75
115
  const ButtonContainerAttrs = {
76
- fontSize: String,
77
- fontColor: String,
116
+ buttonSize: String,
78
117
  }
79
118
  const ButtonContainer = styled('div', ButtonContainerAttrs)`
80
- font-size: ${(props) => props.fontSize};
81
- color: ${(props) =>
82
- props.fontColor ? props.fontColor : props.theme.colors.white};
83
119
  display: flex;
84
120
  align-items: center;
85
121
  justify-content: center;
86
- padding: 0 14px;
122
+ padding: ${(props) =>
123
+ props.theme?.mainButton?.size?.[props.buttonSize]?.padding};
87
124
  `
88
125
 
89
126
  const IconContainerAttrs = {
90
- width: String,
127
+ buttonSize: String,
128
+ themeType: String,
129
+ type: String,
130
+ variant: String,
91
131
  }
92
132
  const IconContainer = styled('div', IconContainerAttrs)`
93
133
  display: grid;
94
134
  align-items: center;
95
135
  justify-items: center;
96
- width: ${(props) => props.width};
97
- background: ${(props) => props.theme.colors.white + '1a'};
136
+ width: ${(props) =>
137
+ props.theme?.mainButton?.size?.[props.buttonSize]?.iconWidth};
138
+ background: rgba(255, 255, 255, 0.1);
139
+ border-right: ${(props) => {
140
+ const borderColor =
141
+ props.theme.mainButton[props.themeType][props.type][props.variant]
142
+ .borderColor
143
+ return borderColor ? `1px solid ${borderColor}` : 'none'
144
+ }};
98
145
  `
99
146
 
100
147
  export default {
@@ -107,35 +154,53 @@
107
154
  Icon,
108
155
  },
109
156
  props: {
157
+ type: {
158
+ required: false,
159
+ default: 'primary',
160
+ type: String,
161
+ },
162
+ variant: {
163
+ required: false,
164
+ default: 'main',
165
+ type: String,
166
+ },
167
+ themeType: {
168
+ type: String,
169
+ default: 'light',
170
+ required: false,
171
+ },
172
+ buttonSize: {
173
+ type: String,
174
+ default: 'medium',
175
+ required: false,
176
+ },
110
177
  isDisabled: {
111
178
  required: false,
112
179
  default: false,
180
+ type: Boolean,
113
181
  },
114
182
  text: {
115
183
  required: true,
184
+ type: String,
116
185
  },
117
186
  minWidth: {
118
187
  required: false,
119
188
  default: null,
189
+ type: String,
120
190
  },
121
191
  customColor: {
122
192
  required: false,
123
193
  default: null,
194
+ type: String,
124
195
  },
125
196
  iconName: {
126
197
  required: true,
198
+ type: String,
127
199
  },
128
- fontColor: {
200
+ iconColor: {
129
201
  required: false,
130
202
  default: null,
131
- },
132
- fontSize: {
133
- required: false,
134
- default: '13px',
135
- },
136
- height: {
137
- required: false,
138
- default: '30px',
203
+ type: String,
139
204
  },
140
205
  },
141
206
  data() {
@@ -143,5 +208,14 @@
143
208
  theme: Theme,
144
209
  }
145
210
  },
211
+ // computed: {
212
+ // getIconColor() {
213
+ // console.log(this.theme[this.themeType][this.type][this.variant])
214
+ // return (
215
+ // this.iconColor ||
216
+ // this.theme[this.themeType][this.type][this.variant].textColor
217
+ // )
218
+ // },
219
+ // },
146
220
  }
147
221
  </script>
@@ -2,6 +2,7 @@
2
2
  <PageContainer>
3
3
  <ButtonContainer
4
4
  :id="id"
5
+ :button-size="buttonSize"
5
6
  :custom-color="customColor"
6
7
  :data-id="dataId"
7
8
  :data-qa-id="dataQaId"
@@ -10,10 +11,12 @@
10
11
  :is-disabled="isDisabled"
11
12
  :min-width="minWidth"
12
13
  :no-wrap="noWrap"
14
+ :theme-type="theme"
13
15
  :type="type"
16
+ :variant="variant"
14
17
  >
15
18
  <LabelComponent :has-icon="Boolean(icon)">
16
- <Icon v-if="icon" :name="icon" :color="iconColor" size="14px" />
19
+ <Icon v-if="icon" :color="iconColor" :name="icon" size="14px" />
17
20
  {{ text }}
18
21
  </LabelComponent>
19
22
  </ButtonContainer>
@@ -46,30 +49,40 @@
46
49
  fontColor: String,
47
50
  noWrap: Boolean,
48
51
  height: String,
52
+ variant: String,
53
+ buttonSize: String,
54
+ themeType: String,
49
55
  }
50
56
  const ButtonContainer = styled('div', ButtonAttrs)`
51
57
  display: flex;
52
58
  justify-content: center;
53
- padding: 7px 15px;
54
- font-size: 14px;
59
+ padding: ${(props) =>
60
+ props.theme?.mainButton?.size?.[props.buttonSize]?.padding};
61
+ font-size: ${(props) =>
62
+ props.theme?.mainButton?.size?.[props.buttonSize]?.fontSize};
55
63
  color: ${(props) =>
56
64
  props.isDisabled
57
- ? props.theme.colors.white
58
- : props.fontColor
59
- ? props.fontColor
60
- : props.theme.colors.white};
65
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
66
+ .disabled.textColor
67
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
68
+ .textColor};
61
69
  background-color: ${(props) =>
62
70
  props.isDisabled
63
- ? props.theme.colors.disabled
71
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
72
+ .disabled.backgroundColor
64
73
  : props.customColor
65
74
  ? props.customColor
66
- : props.type === 'primary'
67
- ? props.theme.colors.black
68
- : props.type === 'secondary'
69
- ? props.theme.colors.grey3
70
- : props.type === 'cancel'
71
- ? props.theme.colors.red
72
- : props.theme.colors.black};
75
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
76
+ .default};
77
+
78
+ border: ${(props) => {
79
+ const borderValue = props.isDisabled
80
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
81
+ .disabled.borderColor
82
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
83
+ .borderColor
84
+ return borderValue ? '1px solid ' + borderValue : 'none'
85
+ }};
73
86
  border-radius: 4px;
74
87
  text-align: center;
75
88
  cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
@@ -79,11 +92,21 @@
79
92
  height: ${(props) => props.height};
80
93
 
81
94
  &:hover {
82
- opacity: ${(props) => (props.isDisabled ? '1' : '0.8')};
95
+ background-color: ${(props) =>
96
+ props.isDisabled
97
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
98
+ .disabled.backgroundColor
99
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
100
+ .hover};
83
101
  }
84
102
 
85
103
  &:active {
86
- opacity: 1;
104
+ background-color: ${(props) =>
105
+ props.isDisabled
106
+ ? props.theme.mainButton[props.themeType][props.type][props.variant]
107
+ .disabled.backgroundColor
108
+ : props.theme.mainButton[props.themeType][props.type][props.variant]
109
+ .active};
87
110
  }
88
111
  `
89
112
 
@@ -109,7 +132,12 @@
109
132
  props: {
110
133
  type: {
111
134
  required: false,
112
- default: 'primary',
135
+ default: 'primary', // primary, secondary, tertiary, ghost
136
+ type: String,
137
+ },
138
+ variant: {
139
+ required: false,
140
+ default: 'main', // main, cancel
113
141
  type: String,
114
142
  },
115
143
  isDisabled: {
@@ -169,6 +197,15 @@
169
197
  type: String,
170
198
  default: '',
171
199
  },
200
+ theme: {
201
+ type: String,
202
+ default: 'light',
203
+ },
204
+ buttonSize: {
205
+ type: String,
206
+ default: 'medium',
207
+ required: false,
208
+ },
172
209
  },
173
210
  }
174
211
  </script>
@@ -297,12 +297,13 @@
297
297
  <MainButton
298
298
  v-if="buttonText.cancel"
299
299
  :text="buttonText.cancel"
300
- type="cancel"
300
+ type="primary"
301
+ variant="cancel"
301
302
  @click="$emit('on-cancel-view')"
302
303
  />
303
304
  <ResetContainer v-if="!filterViews || !filterViews.length">
304
305
  <ResetButton @click="$emit('on-reset-filters')">
305
- <Icon :color="theme.colors.blue" :name="'update'" size="14px" />
306
+ <Icon :color="theme.colors.primary" :name="'update'" size="14px" />
306
307
  <div>{{ $gettext('reset_filters') }}</div>
307
308
  </ResetButton>
308
309
  </ResetContainer>
@@ -475,7 +476,7 @@
475
476
  margin-top: 20px;
476
477
  align-self: center;
477
478
  font-size: 13px;
478
- color: ${(props) => props.theme.colors.blue};
479
+ color: ${(props) => props.theme.colors.primary};
479
480
  cursor: pointer;
480
481
  `
481
482
 
@@ -143,6 +143,7 @@
143
143
  background-color: ${(props) =>
144
144
  props.backgroundColor ? props.backgroundColor : 'transparent'};
145
145
  padding: ${(props) => (props.backgroundColor ? '3px' : '0')};
146
+ border-radius: 4px;
146
147
  }
147
148
  svg path:not(.fix) {
148
149
  ${({ theme, color }) => color && `fill: ${theme.colors[color] || color};`}
@@ -19,6 +19,7 @@
19
19
  <TextWrapper :style="wrapperStyle">
20
20
  <TextOverlay
21
21
  ref="infoBox"
22
+ :app-theme="appTheme"
22
23
  :image="image"
23
24
  :style="boxStyle"
24
25
  :width="infoBoxWidth"
@@ -36,7 +37,7 @@
36
37
  </slot>
37
38
  </span>
38
39
  </TextOverlay>
39
- <Arrow :image="image" :style="arrowStyle" />
40
+ <!-- <Arrow :image="image" :style="arrowStyle" /> -->
40
41
  </TextWrapper>
41
42
  </Teleport>
42
43
  </PageContainer>
@@ -57,11 +58,14 @@
57
58
  import styled from 'vue3-styled-components'
58
59
  import theme from '../../assets/theme.js'
59
60
 
60
- const TextOverlay = styled('div')`
61
- background-color: ${(props) =>
62
- props.image ? props.theme.colors.white : props.theme.colors.black};
61
+ const TextOverlayAttrs = {
62
+ appTheme: String,
63
+ image: Boolean,
64
+ width: Number,
65
+ }
66
+ const TextOverlay = styled('div', TextOverlayAttrs)`
63
67
  color: ${(props) =>
64
- props.image ? props.theme.colors.grey1 : props.theme.colors.white};
68
+ props.image ? props.theme.colors.grey1 : props.theme.colors.black};
65
69
  font-size: ${(props) => (props.image ? '12px' : '13px')};
66
70
  border-radius: 4px;
67
71
  padding: 10px;
@@ -82,16 +86,20 @@
82
86
  }
83
87
  `
84
88
 
85
- const Arrow = styled('div')`
86
- position: absolute;
87
- width: 0;
88
- height: 0;
89
- border: 8px solid transparent;
90
- border-top-color: ${(props) =>
91
- props.image ? props.theme.colors.white : props.theme.colors.black};
92
- filter: ${(props) =>
93
- props.image ? 'drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1))' : 'none'};
94
- `
89
+ // const Arrow = styled('div')`
90
+ // position: absolute;
91
+ // width: 0;
92
+ // height: 0;
93
+ // border: 8px solid transparent;
94
+ // border-top-color: ${(props) =>
95
+ // props.image
96
+ // ? props.theme.colors.white
97
+ // : props.appTheme === 'dark'
98
+ // ? props.theme.colors.grey5
99
+ // : props.theme.colors.black};
100
+ // filter: ${(props) =>
101
+ // props.image ? 'drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1))' : 'none'};
102
+ // `
95
103
 
96
104
  const PageContainer = styled('div')`
97
105
  display: inline-block;
@@ -113,7 +121,7 @@
113
121
  components: {
114
122
  IconComponent,
115
123
  TextOverlay,
116
- Arrow,
124
+ // Arrow,
117
125
  PageContainer,
118
126
  TextWrapper,
119
127
  OverlayImage,
@@ -165,6 +173,11 @@
165
173
  default: false,
166
174
  required: false,
167
175
  },
176
+ appTheme: {
177
+ type: String,
178
+ default: 'light', // light or dark
179
+ required: false,
180
+ },
168
181
  },
169
182
  setup(props) {
170
183
  const isVisible = ref(false)
@@ -182,7 +195,11 @@
182
195
 
183
196
  const textStyle = computed(() => ({
184
197
  fontSize: props.image ? '12px' : '13px',
185
- color: props.image ? theme.colors.grey1 : theme.colors.white,
198
+ color: props.image
199
+ ? theme.colors.grey1
200
+ : props.appTheme === 'dark'
201
+ ? theme.colors.black
202
+ : theme.colors.white,
186
203
  textAlign: props.image ? 'right' : 'left',
187
204
  }))
188
205
 
@@ -312,7 +329,9 @@
312
329
  overflowY: 'auto',
313
330
  backgroundColor: props.image
314
331
  ? theme.colors.white
315
- : theme.colors.black,
332
+ : props.appTheme === 'light'
333
+ ? theme.colors.black
334
+ : theme.colors.grey5,
316
335
  }
317
336
  }
318
337
 
@@ -354,7 +373,6 @@
354
373
  }
355
374
 
356
375
  const updatePosition = async () => {
357
- console.log('updatePosition')
358
376
  if (!infoBox.value || !textContent.value) return
359
377
 
360
378
  // First make the content visible but hidden to get accurate measurements
@@ -25,6 +25,7 @@
25
25
  <InfoText
26
26
  v-if="labelInfoText"
27
27
  :align-arrow="labelInfoAlign"
28
+ :app-theme="appTheme"
28
29
  :text="labelInfoText"
29
30
  />
30
31
  </LabelWrapper>
@@ -474,6 +475,10 @@
474
475
  },
475
476
  inheritAttrs: false,
476
477
  props: {
478
+ appTheme: {
479
+ type: String,
480
+ required: false,
481
+ },
477
482
  placeholder: {
478
483
  type: String,
479
484
  required: false,
@@ -21,6 +21,7 @@
21
21
  <InfoText
22
22
  v-if="infoTextMessage != ''"
23
23
  :align-arrow="infoTextAlign"
24
+ :app-theme="appTheme"
24
25
  data-test-id="info_text_message"
25
26
  :size="fontSize ? fontSize : '16px'"
26
27
  :text="infoTextMessage"
@@ -263,6 +264,11 @@
263
264
  default: '',
264
265
  type: String,
265
266
  },
267
+ appTheme: {
268
+ type: String,
269
+ required: false,
270
+ default: 'light',
271
+ },
266
272
  alignItems: {
267
273
  required: false,
268
274
  default: 'horizontal',
@@ -59,7 +59,8 @@
59
59
  <MainButton :text="$gettext('Delete')" @click="onDelete" />
60
60
  <MainButton
61
61
  :text="$gettext('Cancel')"
62
- type="cancel"
62
+ type="primary"
63
+ variant="cancel"
63
64
  @click="closeDeleteModal"
64
65
  />
65
66
  </CtaContainer>
@@ -13,27 +13,49 @@
13
13
  @click="$emit('tab-click', { activeKey: item.key })"
14
14
  >
15
15
  <IconContainer :is-active="activeTab === item.key">
16
- <Icon color="#fff" cursor="pointer" :name="item.icon" size="18px" />
16
+ <Icon
17
+ :color="
18
+ activeTab === item.key
19
+ ? theme.colors.white
20
+ : theme.colors.primary
21
+ "
22
+ cursor="pointer"
23
+ :name="item.icon"
24
+ size="18px"
25
+ />
17
26
  </IconContainer>
18
- <ListText>{{ $gettext(item.label) }}</ListText>
27
+ <ListText :is-active="activeTab === item.key">{{
28
+ $gettext(item.label)
29
+ }}</ListText>
19
30
  </ListItem>
20
31
  <CollapseWrapper v-else :key="idx + item.key">
21
32
  <CollapseContainer
22
33
  :data-id="`sub_menu_settings_${item.key}`"
34
+ :is-active="activeParentTab === item.key"
23
35
  @click="toggleActiveDropdown(item.key)"
24
36
  >
25
37
  <IconContainer :is-active="activeParentTab === item.key">
26
38
  <Icon
27
- color="#fff"
39
+ :color="
40
+ activeParentTab === item.key
41
+ ? theme.colors.white
42
+ : theme.colors.primary
43
+ "
28
44
  cursor="pointer"
29
45
  :name="item.icon"
30
46
  size="18px"
31
47
  />
32
48
  </IconContainer>
33
- <ListText>{{ $gettext(item.label) }}</ListText>
49
+ <ListText :is-active="activeTab === item.key">{{
50
+ $gettext(item.label)
51
+ }}</ListText>
34
52
  <ArrowContainer>
35
53
  <Icon
36
- color="white"
54
+ :color="
55
+ activeDropdown === item.key
56
+ ? theme.colors.white
57
+ : theme.colors.primary
58
+ "
37
59
  :name="activeDropdown === item.key ? 'arrow_up' : 'arrow_down'"
38
60
  size="10px"
39
61
  />
@@ -66,7 +88,7 @@
66
88
  @click="$emit('on-logout')"
67
89
  >
68
90
  <RotateIcon
69
- color="#fff"
91
+ :color="theme.colors.primary"
70
92
  cursor="pointer"
71
93
  name="initial_situation"
72
94
  size="18px"
@@ -81,16 +103,17 @@
81
103
  import styled from 'vue3-styled-components'
82
104
  import Icon from '../icon'
83
105
  import Spinner from '../spinner'
106
+ import theme from '@/assets/theme.js'
84
107
 
85
108
  const PageAttrs = { isLoading: Boolean }
86
109
  const PageContainer = styled('div', PageAttrs)`
87
- background-color: ${(props) =>
88
- props.isLoading ? props.theme.colors.white : props.theme.colors.grey6};
110
+ background-color: ${(props) => props.theme.colors.white};
89
111
  padding: 14px 12px;
90
112
  min-width: 220px;
91
113
  display: flex;
92
114
  flex-direction: column;
93
115
  justify-content: space-between;
116
+ border-right: 1px solid rgba(89, 0, 204, 0.2);
94
117
  `
95
118
 
96
119
  const ListContainer = styled.div`
@@ -109,17 +132,19 @@
109
132
  padding: 4px;
110
133
  border-radius: 6px;
111
134
  background-color: ${(props) =>
112
- props.isActive ? 'rgba(255, 255, 255, 0.1)' : ''};
135
+ props.isActive ? props.theme.colors.primary : ''};
113
136
 
114
137
  :hover {
115
- background-color: rgba(255, 255, 255, 0.1);
138
+ background-color: rgba(89, 0, 204, 0.2);
116
139
  }
117
140
  `
118
141
 
119
- const ListText = styled.div`
142
+ const ListTextAttrs = { isActive: Boolean }
143
+ const ListText = styled('div', ListTextAttrs)`
120
144
  font-size: 16px;
121
145
  font-weight: 700;
122
- color: ${(props) => props.theme.colors.white};
146
+ color: ${(props) =>
147
+ props.isActive ? props.theme.colors.white : props.theme.colors.primary};
123
148
  `
124
149
 
125
150
  const IconContainer = styled('div', IconAttrs)`
@@ -128,18 +153,16 @@
128
153
  justify-items: center;
129
154
  width: 32px;
130
155
  height: 32px;
131
- background-color: ${(props) =>
132
- props.isActive ? props.theme.colors.red : 'rgba(255, 255, 255, 0.2)'};
133
156
  border-radius: 6px;
134
157
 
135
158
  ${({ isButton = false }) =>
136
159
  isButton &&
137
160
  `
138
- cursor: pointer;
139
- &:hover {
140
- background-color: rgba(255, 255, 255, 0.3);
141
- }
142
- `}
161
+ cursor: pointer;
162
+ &:hover {
163
+ background-color: rgba(89, 0, 204, 0.2);
164
+ }
165
+ `}
143
166
  `
144
167
 
145
168
  const SpinnerContainer = styled.div`
@@ -159,7 +182,7 @@
159
182
  const AppVersion = styled.p`
160
183
  font-size: 11px;
161
184
  line-height: 13px;
162
- color: ${(props) => props.theme.colors.white};
185
+ color: ${(props) => props.theme.colors.primary};
163
186
  margin-right: 6px;
164
187
  `
165
188
 
@@ -173,20 +196,19 @@
173
196
  margin-left: 65px;
174
197
  padding: 8px;
175
198
  border-radius: 6px;
176
- color: ${(props) => props.theme.colors.white};
199
+ color: ${(props) =>
200
+ props.isActive ? props.theme.colors.white : props.theme.colors.primary};
177
201
  font-weight: 700;
178
- ${({ isActive }) =>
179
- isActive &&
180
- `
181
- background: rgba(255, 255, 255, 0.1);
182
- `}
202
+ background: ${(props) =>
203
+ props.isActive ? props.theme.colors.primary : ''};
183
204
 
184
205
  &:hover {
185
- background: rgba(255, 255, 255, 0.1);
206
+ background: rgba(89, 0, 204, 0.2);
186
207
  }
187
208
  `
188
209
 
189
- const CollapseContainer = styled.div`
210
+ const CollapseContainerAttrs = { isActive: Boolean }
211
+ const CollapseContainer = styled('div', CollapseContainerAttrs)`
190
212
  display: grid;
191
213
  grid-template-columns: auto 1fr auto;
192
214
  grid-gap: 20px;
@@ -194,8 +216,16 @@
194
216
  border-radius: 6px;
195
217
  align-items: center;
196
218
  cursor: pointer;
219
+ background: ${(props) =>
220
+ props.isActive ? props.theme.colors.primary : ''};
221
+
197
222
  &:hover {
198
- background: rgba(255, 255, 255, 0.1);
223
+ background: rgba(89, 0, 204, 0.2);
224
+ }
225
+
226
+ div {
227
+ color: ${(props) =>
228
+ props.isActive ? props.theme.colors.white : props.theme.colors.primary};
199
229
  }
200
230
  `
201
231
 
@@ -252,6 +282,7 @@
252
282
  data() {
253
283
  return {
254
284
  activeDropdown: null,
285
+ theme,
255
286
  }
256
287
  },
257
288
  mounted() {
@@ -72,11 +72,11 @@
72
72
  ${(props) =>
73
73
  props.isWhite ? props.theme.colors.grey5 : props.theme.colors.white};
74
74
  border-top-color: ${(props) =>
75
- props.isWhite ? props.theme.colors.white : props.theme.colors.brightBlue};
75
+ props.isWhite ? props.theme.colors.white : props.theme.colors.primary};
76
76
  border-right-color: ${(props) =>
77
- props.isWhite ? props.theme.colors.white : props.theme.colors.brightBlue};
77
+ props.isWhite ? props.theme.colors.white : props.theme.colors.primary};
78
78
  border-bottom-color: ${(props) =>
79
- props.isWhite ? props.theme.colors.white : props.theme.colors.brightBlue};
79
+ props.isWhite ? props.theme.colors.white : props.theme.colors.primary};
80
80
  animation: spin 1s linear infinite;
81
81
  transform: rotate(90deg);
82
82
 
@@ -25,18 +25,19 @@
25
25
  item.type === 'template')
26
26
  "
27
27
  />
28
- <TemplateButton
28
+ <MainButton
29
29
  v-if="
30
30
  item.type &&
31
31
  item.type === 'template' &&
32
32
  (item.value === '' || item.value === '-')
33
33
  "
34
34
  :key="index + '_button'"
35
- :show-archived="showArchived"
35
+ button-size="small"
36
+ :text="$gettext('Use template...')"
37
+ :type="primary"
38
+ :variant="showArchived ? 'cancel' : 'main'"
36
39
  @click.stop="onTemplateClick(item.row)"
37
- >
38
- {{ $gettext('Use template...') }}
39
- </TemplateButton>
40
+ />
40
41
  <TemplateLink
41
42
  v-else-if="
42
43
  item.type && item.type === 'template' && item.value !== ''
@@ -137,12 +138,13 @@
137
138
  <span v-if="option !== 'template'">
138
139
  {{ !!item[option] ? item[option] : '-' }}
139
140
  </span>
140
- <TemplateButton
141
+ <MainButton
141
142
  v-else-if="option === 'template' && item.has_template"
143
+ button-size="small"
144
+ :text="$gettext('Use template...')"
145
+ :type="primary"
142
146
  @click.stop="onTemplateClick(item)"
143
- >
144
- {{ $gettext('Use template...') }}
145
- </TemplateButton>
147
+ />
146
148
  <NoTemplate
147
149
  v-else-if="option === 'template' && !item.has_template"
148
150
  >
@@ -196,6 +198,7 @@
196
198
  import Icon from '../icon'
197
199
  import theme from '@/assets/theme.js'
198
200
  import InfoText from '../infoText'
201
+ import MainButton from '../buttons/mainButton'
199
202
 
200
203
  const rowAttrs = { disabled: Boolean, isOpen: Boolean }
201
204
  const DropdownRow = styled('div', rowAttrs)`
@@ -354,17 +357,6 @@
354
357
  `
355
358
 
356
359
  const templateAttrs = { showArchived: Boolean }
357
- const TemplateButton = styled('div', templateAttrs)`
358
- cursor: pointer;
359
- background-color: #263238;
360
- color: ${(props) =>
361
- props.showArchived ? props.theme.colors.red : props.theme.colors.white};
362
- padding: 4px 10px;
363
- display: inline-block;
364
- border-radius: 4px;
365
- text-align: center;
366
- margin-left: 15px;
367
- `
368
360
 
369
361
  const NoTemplate = styled('div', templateAttrs)`
370
362
  color: ${(props) =>
@@ -458,7 +450,7 @@
458
450
  OptionsWrapper,
459
451
  OptionsItem,
460
452
  SearchContainer,
461
- TemplateButton,
453
+ MainButton,
462
454
  NoTemplate,
463
455
  TemplateLink,
464
456
  InputText,
@@ -91,7 +91,7 @@
91
91
  }
92
92
 
93
93
  ::-webkit-scrollbar-thumb {
94
- border-bottom: 10px solid ${(props) => props.theme.colors.brightBlue}; // width of the actual scrollbar
94
+ border-bottom: 10px solid ${(props) => props.theme.colors.primary}; // width of the actual scrollbar
95
95
  border-radius: 4px;
96
96
  }
97
97
  `
@@ -154,7 +154,7 @@
154
154
 
155
155
  th {
156
156
  padding: 11px 15px;
157
- background-color: ${(props) => props.theme.colors.blue1};
157
+ background-color: ${(props) => props.theme.colors.grey5};
158
158
  cursor: auto;
159
159
  height: 40px;
160
160