@eturnity/eturnity_reusable_components 9.19.5 → 9.19.7

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": "9.19.5",
3
+ "version": "9.19.7",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -0,0 +1,3 @@
1
+ <svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0 9.2998V3.7002C0 3.14839 -8.9407e-07 2.70429 0.0292969 2.3457C0.0590662 1.98136 0.121634 1.66133 0.272461 1.36523C0.512144 0.894829 0.894829 0.512144 1.36523 0.272461C1.66133 0.121634 1.98136 0.0590662 2.3457 0.0292969C2.70429 -8.9407e-07 3.14839 0 3.7002 0H5.16699C5.44299 0.00017567 5.66699 0.223966 5.66699 0.5C5.66699 0.776034 5.44299 0.999824 5.16699 1H3.7002C3.13189 1 2.73518 1.00019 2.42676 1.02539C2.12471 1.05009 1.95091 1.09613 1.81934 1.16309C1.53709 1.3069 1.3069 1.53709 1.16309 1.81934C1.09613 1.95091 1.05009 2.12471 1.02539 2.42676C1.00019 2.73518 1 3.13189 1 3.7002V9.2998C1 9.86811 1.00019 10.2648 1.02539 10.5732C1.05009 10.8753 1.09613 11.0491 1.16309 11.1807C1.3069 11.4629 1.53709 11.6931 1.81934 11.8369C1.95091 11.9039 2.12471 11.9499 2.42676 11.9746C2.73518 11.9998 3.13189 12 3.7002 12H9.2998C9.86811 12 10.2648 11.9998 10.5732 11.9746C10.8753 11.9499 11.0491 11.9039 11.1807 11.8369C11.4629 11.6931 11.6931 11.4629 11.8369 11.1807C11.9039 11.0491 11.9499 10.8753 11.9746 10.5732C11.9998 10.2648 12 9.86811 12 9.2998V7.83301C12.0002 7.55701 12.224 7.33301 12.5 7.33301C12.776 7.33301 12.9998 7.55701 13 7.83301V9.2998C13 9.85161 13 10.2957 12.9707 10.6543C12.9409 11.0186 12.8784 11.3387 12.7275 11.6348C12.4879 12.1052 12.1052 12.4879 11.6348 12.7275C11.3387 12.8784 11.0186 12.9409 10.6543 12.9707C10.2957 13 9.85161 13 9.2998 13H3.7002C3.14839 13 2.70429 13 2.3457 12.9707C1.98136 12.9409 1.66133 12.8784 1.36523 12.7275C0.89483 12.4879 0.512145 12.1052 0.272461 11.6348C0.121634 11.3387 0.0590662 11.0186 0.0292969 10.6543C-8.9407e-07 10.2957 0 9.85161 0 9.2998ZM13 4.5C13 4.77614 12.7761 4.99999 12.5 5C12.2239 5 12 4.77614 12 4.5V1.70703L6.85352 6.85352C6.65825 7.04878 6.34175 7.04878 6.14648 6.85352C5.95122 6.65825 5.95122 6.34175 6.14648 6.14648L11.293 1H8.5C8.22386 1 8 0.776142 8 0.5C8 0.223861 8.22386 0 8.5 0H12.5C12.7761 8.7615e-06 13 0.223866 13 0.5V4.5Z" fill="#263238"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="14" height="10" viewBox="0 0 14 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M13.1025 0.00488281C13.6067 0.0562146 14 0.482323 14 1V9L13.9951 9.10254C13.9472 9.57297 13.573 9.94722 13.1025 9.99512L13 10H1C0.482323 10 0.0562145 9.60667 0.00488281 9.10254L0 9V1C1.28852e-07 0.447715 0.447715 2.41596e-08 1 0H13L13.1025 0.00488281ZM7.85352 5.0166C7.33985 5.37221 6.66015 5.37222 6.14648 5.0166L1 1.45312V9H13V1.45312L7.85352 5.0166ZM6.71582 4.19531C6.88681 4.31338 7.11319 4.31338 7.28418 4.19531L11.8994 1H2.10059L6.71582 4.19531Z" fill="#263238"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="14" height="12" viewBox="0 0 14 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M13 0C13.5523 0 14 0.447715 14 1V11C14 11.5523 13.5523 12 13 12H1C0.447715 12 0 11.5523 0 11V1C0 0.447715 0.447715 0 1 0H13ZM1 11H13V3H1V11ZM5.14648 4.64648C5.34175 4.45122 5.65825 4.45122 5.85352 4.64648C6.04878 4.84175 6.04878 5.15825 5.85352 5.35352L4.20703 7L5.85352 8.64648C6.04878 8.84175 6.04878 9.15825 5.85352 9.35352C5.65825 9.54878 5.34175 9.54878 5.14648 9.35352L3.2168 7.42383C2.98301 7.18962 2.98301 6.81039 3.2168 6.57617L5.14648 4.64648ZM8.14648 4.64648C8.34175 4.45122 8.65825 4.45122 8.85352 4.64648L10.7832 6.57617C11.017 6.81039 11.017 7.18962 10.7832 7.42383L8.85352 9.35352C8.65825 9.54878 8.34175 9.54878 8.14648 9.35352C7.95122 9.15825 7.95122 8.84175 8.14648 8.64648L9.79297 7L8.14648 5.35352C7.95122 5.15825 7.95122 4.84175 8.14648 4.64648ZM1 2H13V1H1V2Z" fill="#263238"/>
3
+ </svg>
@@ -1,9 +1,12 @@
1
1
  <template>
2
2
  <Wrapper
3
3
  v-show="!isLoading"
4
+ :border="border"
5
+ :box-shadow="boxShadow"
4
6
  :class="viewCardClass"
5
7
  data-test-id="card_main_wrapper"
6
8
  :min-width="minWidth"
9
+ :padding="padding"
7
10
  :width="width"
8
11
  >
9
12
  <Spinner
@@ -13,7 +16,11 @@
13
16
  size="50px"
14
17
  />
15
18
  <CardWrapper v-else>
16
- <CardTitle :class="titleClass" data-test-id="card_title">
19
+ <CardTitle
20
+ v-if="title && title.length > 0"
21
+ :class="titleClass"
22
+ data-test-id="card_title"
23
+ >
17
24
  {{ $gettext(title) }}
18
25
  <InfoText
19
26
  v-if="showPopover && popoverText !== ''"
@@ -44,16 +51,24 @@
44
51
  import Spinner from '../spinner'
45
52
  import InfoText from '../infoText'
46
53
 
47
- const WrapperProps = { width: [Number, String], minWidth: [Number, String] }
54
+ const WrapperProps = {
55
+ width: [Number, String],
56
+ minWidth: [Number, String],
57
+ boxShadow: String,
58
+ border: String,
59
+ padding: String,
60
+ }
48
61
  const Wrapper = styled('div', WrapperProps)`
49
62
  max-width: ${(props) => props.width};
50
63
  min-width: ${(props) => props.minWidth};
51
- padding: 20px;
52
- box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2),
53
- 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
64
+ padding: ${(props) => props.padding};
65
+ box-shadow: ${(props) =>
66
+ props.boxShadow ||
67
+ '0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)'};
54
68
  border-radius: 4px;
55
69
  background-color: ${(props) => props.theme.colors.white};
56
70
  height: 100%;
71
+ ${(props) => props.border && `border: ${props.border};`}
57
72
  `
58
73
 
59
74
  const CardWrapper = styled('div')`
@@ -113,6 +128,21 @@
113
128
  type: Boolean,
114
129
  default: false,
115
130
  },
131
+ boxShadow: {
132
+ type: String,
133
+ required: false,
134
+ default: null,
135
+ },
136
+ border: {
137
+ type: String,
138
+ required: false,
139
+ default: null,
140
+ },
141
+ padding: {
142
+ type: String,
143
+ required: false,
144
+ default: '20px',
145
+ },
116
146
  },
117
147
  }
118
148
  </script>
@@ -2,15 +2,20 @@
2
2
  <InfoContainer
3
3
  :align-items="alignItems"
4
4
  :border-color="borderColor"
5
+ :border-radius="borderRadius"
5
6
  :border-style="borderStyle"
6
7
  :color="color"
7
8
  data-test-id="info_card_wrapper"
9
+ :hide-default-icon="hideDefaultIcon"
8
10
  :min-height="minHeight"
9
11
  :min-width="minWidth"
10
12
  :padding="padding"
11
13
  :preset-styles="presetStyles"
12
14
  >
13
- <IconWrapper :size="iconWrapperSize ? iconWrapperSize : iconSize">
15
+ <IconWrapper
16
+ v-if="!hideDefaultIcon"
17
+ :size="iconWrapperSize ? iconWrapperSize : iconSize"
18
+ >
14
19
  <RCIcon
15
20
  :color="iconColor ? iconColor : presetStyles.iconColor"
16
21
  data-test-id="info_card_icon"
@@ -19,7 +24,10 @@
19
24
  :size="iconSize"
20
25
  />
21
26
  </IconWrapper>
22
- <TextContainer data-test-id="info_card_text_container">
27
+ <TextContainer
28
+ data-test-id="info_card_text_container"
29
+ :hide-default-icon="hideDefaultIcon"
30
+ >
23
31
  <slot></slot>
24
32
  </TextContainer>
25
33
  </InfoContainer>
@@ -35,11 +43,13 @@
35
43
  minWidth: String,
36
44
  color: String,
37
45
  alignItems: String,
46
+ hideDefaultIcon: Boolean,
38
47
  padding: String,
39
48
  borderColor: String,
40
49
  borderStyle: String,
41
50
  presetStyles: Object,
42
51
  }
52
+
43
53
  const InfoContainer = styled('div', infoContainerAttrs)`
44
54
  display: flex;
45
55
  align-items: ${(props) =>
@@ -50,7 +60,7 @@
50
60
  padding: ${(props) =>
51
61
  props.padding ? props.padding : props.presetStyles.padding};
52
62
  color: ${(props) => (props.color ? props.color : props.presetStyles.color)};
53
- border-radius: 4px;
63
+ border-radius: ${(props) => props.borderRadius};
54
64
  background-color: ${(props) =>
55
65
  props.backgroundColor
56
66
  ? props.backgroundColor
@@ -62,9 +72,14 @@
62
72
  props.borderColor ? props.borderColor : props.presetStyles.borderColor};
63
73
  `
64
74
 
65
- const TextContainer = styled.div`
75
+ const TextContainer = styled('div', {
76
+ hideDefaultIcon: Boolean,
77
+ })`
66
78
  font-size: 14px;
79
+ flex: ${(props) => (props.hideDefaultIcon ? '1' : '0 1 auto')};
67
80
  width: 100%;
81
+ max-width: none;
82
+ min-width: 0;
68
83
  `
69
84
 
70
85
  const IconWrapper = styled('div', {
@@ -75,6 +90,7 @@
75
90
  display: flex;
76
91
  align-items: center;
77
92
  justify-content: center;
93
+ flex-shrink: 0;
78
94
  `
79
95
 
80
96
  export default {
@@ -121,6 +137,11 @@
121
137
  type: String,
122
138
  default: '',
123
139
  },
140
+ /** When true, the leading icon is omitted and the slot spans the full row width. */
141
+ hideDefaultIcon: {
142
+ type: Boolean,
143
+ default: false,
144
+ },
124
145
  padding: {
125
146
  required: false,
126
147
  type: String,
@@ -136,6 +157,11 @@
136
157
  type: String,
137
158
  default: '',
138
159
  },
160
+ borderRadius: {
161
+ required: false,
162
+ type: String,
163
+ default: '4px',
164
+ },
139
165
  iconName: {
140
166
  required: false,
141
167
  type: String,
@@ -520,10 +520,10 @@
520
520
  : props.fontColor};
521
521
  max-height: 300px;
522
522
  overflow-y: auto;
523
+ overflow-x: hidden;
523
524
  ${(props) =>
524
525
  props.dropdownMatchMaxContent
525
526
  ? `
526
- overflow-x: visible;
527
527
  align-items: stretch;
528
528
  `
529
529
  : ''}
@@ -76,14 +76,13 @@
76
76
  :data-qa-id="`sidebar_responsible_option_${
77
77
  optionIdx + 1
78
78
  }`"
79
- min-width="min-content"
80
79
  :value="item.id"
81
80
  >
82
81
  <ResponsibleOptionRow>
83
82
  <ResponsibleOptionAvatar>{{
84
83
  initialsFromFullName(item.full_name)
85
84
  }}</ResponsibleOptionAvatar>
86
- <SelectOptionText>{{
85
+ <SelectOptionText :title="item.full_name">{{
87
86
  item.full_name
88
87
  }}</SelectOptionText>
89
88
  </ResponsibleOptionRow>
@@ -688,8 +687,8 @@
688
687
  flex-direction: row;
689
688
  align-items: center;
690
689
  gap: 10px;
691
- width: max-content;
692
- min-width: 100%;
690
+ width: 100%;
691
+ min-width: 0;
693
692
  box-sizing: border-box;
694
693
  `
695
694
 
@@ -712,9 +711,11 @@
712
711
  font-size: 14px;
713
712
  font-weight: 400;
714
713
  color: ${(p) => p.theme.semanticColors.grey[800]};
715
- flex: 0 1 auto;
714
+ flex: 1 1 auto;
715
+ min-width: 0;
716
716
  white-space: nowrap;
717
- overflow: visible;
717
+ overflow: hidden;
718
+ text-overflow: ellipsis;
718
719
  `
719
720
 
720
721
  export default {
@@ -2,9 +2,11 @@
2
2
  <ProgressionStepContainer :number-of-steps="progressionSteps.length">
3
3
  <template v-for="(step, stepIndex) in progressionSteps" :key="step.index">
4
4
  <ProgressionStepItem>
5
- <BoxContainer
5
+ <MarkerContainer
6
+ :disable-click="disableClick"
6
7
  :is-active="stepIndex == currentStepIndex"
7
8
  :is-valid="stepIndex < currentStepIndex"
9
+ :shape="markerShape"
8
10
  @click="
9
11
  stepIndex < currentStepIndex ? $emit('on-step-click', step) : null
10
12
  "
@@ -14,7 +16,7 @@
14
16
  :color="theme.semanticColors.purple[500]"
15
17
  :hovered-color="theme.semanticColors.purple[500]"
16
18
  name="checkmark_thin"
17
- size="16px"
19
+ :size="markerShape === 'circle' ? '10px' : '16px'"
18
20
  />
19
21
  <NumberContainer
20
22
  v-else
@@ -23,13 +25,32 @@
23
25
  >
24
26
  {{ step.number }}
25
27
  </NumberContainer>
26
- </BoxContainer>
27
- <StepLabel>{{ step.label }}</StepLabel>
28
+ </MarkerContainer>
29
+ <StepLabel>
30
+ <StyledText
31
+ :font-color="
32
+ stepIndex === currentStepIndex
33
+ ? theme.semanticColors.grey[900]
34
+ : theme.semanticColors.grey[800]
35
+ "
36
+ :type="labelTextType"
37
+ >
38
+ {{ step.label }}
39
+ </StyledText>
40
+ </StepLabel>
28
41
  </ProgressionStepItem>
29
42
  <StepIntermediateLine
30
- v-if="stepIndex < progressionSteps.length - 1"
31
- :is-valid="stepIndex < currentStepIndex"
43
+ v-if="
44
+ separatorType === 'line' && stepIndex < progressionSteps.length - 1
45
+ "
32
46
  />
47
+ <IconContainer
48
+ v-if="
49
+ separatorType === 'arrow' && stepIndex < progressionSteps.length - 1
50
+ "
51
+ >
52
+ <RcIcon :color="theme.colors.black" name="next" size="16px" />
53
+ </IconContainer>
33
54
  </template>
34
55
  </ProgressionStepContainer>
35
56
  </template>
@@ -40,10 +61,12 @@
40
61
  // <ProgressionSteps
41
62
  // :current-step="ProgressionStep"
42
63
  // :progression-steps="ProgressionSteps" [{label,value,number}]
64
+ // marker-shape="box" | "circle"
43
65
  // @on-step-click="onStepClick"
44
66
  // />
45
67
  import styled from 'vue3-styled-components'
46
68
  import RcIcon from '../icon'
69
+ import StyledText from '../styledText'
47
70
  import theme from '@/assets/theme.js'
48
71
 
49
72
  const StyledComponents = {
@@ -61,37 +84,52 @@
61
84
  flex-direction: row;
62
85
  align-items: center;
63
86
  `,
64
- BoxContainer: styled('div', {
87
+ MarkerContainer: styled('div', {
88
+ disableClick: Boolean,
65
89
  isActive: Boolean,
66
90
  isValid: Boolean,
91
+ shape: String,
67
92
  })`
68
93
  display: flex;
69
94
  justify-content: center;
70
95
  align-items: center;
71
- width: 32px;
72
- height: 32px;
73
- font-size: 16px;
74
- background-color: ${({ theme, isValid, isActive }) =>
96
+ flex-shrink: 0;
97
+ box-sizing: border-box;
98
+ width: ${({ shape }) => (shape === 'circle' ? '16px' : '32px')};
99
+ height: ${({ shape }) => (shape === 'circle' ? '16px' : '32px')};
100
+ min-width: ${({ shape }) => (shape === 'circle' ? '16px' : '32px')};
101
+ min-height: ${({ shape }) => (shape === 'circle' ? '16px' : '32px')};
102
+ aspect-ratio: ${({ shape }) => (shape === 'circle' ? '1' : 'auto')};
103
+ font-size: ${({ shape }) => (shape === 'circle' ? '10px' : '16px')};
104
+ background-color: ${({ theme, isValid, isActive, shape }) =>
75
105
  isActive
76
106
  ? theme.semanticColors.purple[500]
77
107
  : isValid
78
108
  ? theme.semanticColors.purple[200]
109
+ : shape === 'circle'
110
+ ? theme.semanticColors.grey[50]
79
111
  : theme.semanticColors.grey[200]};
80
- color: ${({ theme, isValid, isActive }) =>
112
+ color: ${({ theme, isActive }) =>
81
113
  isActive ? theme.colors.white : theme.semanticColors.grey[800]};
82
114
  margin: 0 10px;
83
- border-radius: 5px;
84
- cursor: ${({ isValid }) => (isValid ? 'pointer' : 'default')};
115
+ border-radius: ${({ shape }) => (shape === 'circle' ? '50%' : '5px')};
116
+ cursor: ${({ isValid, disableClick }) =>
117
+ isValid && !disableClick ? 'pointer' : 'default'};
85
118
  &:hover {
86
- ${({ theme, isValid, isActive }) =>
87
- isValid
119
+ ${({ theme, isValid, disableClick }) =>
120
+ isValid && !disableClick
88
121
  ? 'background-color:' + theme.semanticColors.purple[100] + ';'
89
122
  : ''}
90
123
  }
124
+
125
+ ${({ shape, isActive, isValid }) =>
126
+ shape === 'circle' &&
127
+ !isActive &&
128
+ !isValid &&
129
+ `border: 1px solid ${theme.semanticColors.grey[400]};`}
91
130
  `,
92
- StepIntermediateLine: styled('div', { isValid: Boolean })`
131
+ StepIntermediateLine: styled.div`
93
132
  height: 2px;
94
- margin: 0 10px;
95
133
  background-color: ${({ theme }) => theme.semanticColors.grey[400]};
96
134
  `,
97
135
  StepLabel: styled.div`
@@ -99,12 +137,16 @@
99
137
  margin: 0 10px;
100
138
  `,
101
139
  NumberContainer: styled.div``,
140
+ IconContainer: styled.div`
141
+ margin: 0 16px;
142
+ `,
102
143
  }
103
144
  export default {
104
145
  name: 'ProgressionSteps',
105
146
  components: {
106
147
  ...StyledComponents,
107
148
  RcIcon,
149
+ StyledText,
108
150
  },
109
151
  props: {
110
152
  progressionSteps: {
@@ -115,7 +157,29 @@
115
157
  type: String,
116
158
  required: true,
117
159
  },
160
+ labelTextType: {
161
+ type: String,
162
+ required: false,
163
+ default: 'subheading-large',
164
+ },
165
+ separatorType: {
166
+ type: String,
167
+ required: false,
168
+ default: 'line',
169
+ },
170
+ markerShape: {
171
+ type: String,
172
+ required: false,
173
+ default: 'box',
174
+ validator: (value) => ['box', 'circle'].includes(value),
175
+ },
176
+ disableClick: {
177
+ type: Boolean,
178
+ required: false,
179
+ default: false,
180
+ },
118
181
  },
182
+ emits: ['on-step-click'],
119
183
  data() {
120
184
  return {
121
185
  theme,
@@ -39,6 +39,14 @@ export const Default = {
39
39
  args: {
40
40
  'current-step': 'step1',
41
41
  'progression-steps': PROGRESSION_STEP_LIST,
42
+ 'marker-shape': 'box',
43
+ },
44
+ }
45
+
46
+ export const CircleIndicators = {
47
+ args: {
48
+ ...Default.args,
49
+ 'marker-shape': 'circle',
42
50
  },
43
51
  }
44
52