@eturnity/eturnity_reusable_components 8.49.1 → 8.49.2-EPDM-16285.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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Accordion from './index.vue'
|
|
2
|
+
import theme from '@/assets/theme'
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
title: 'Accordion',
|
|
@@ -26,6 +27,9 @@ const Template = (args, { argTypes }) => ({
|
|
|
26
27
|
</div>
|
|
27
28
|
</template>
|
|
28
29
|
</Accordion>`,
|
|
30
|
+
provide: {
|
|
31
|
+
theme,
|
|
32
|
+
},
|
|
29
33
|
})
|
|
30
34
|
|
|
31
35
|
export const Default = Template.bind({})
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
: 'eturnityGrey'
|
|
26
26
|
"
|
|
27
27
|
:font-size="fontSize"
|
|
28
|
+
:font-weight="labelFontWeight"
|
|
28
29
|
>{{ label }}
|
|
29
30
|
<IsRequiredLabelStar v-if="isRequiredLabel" />
|
|
30
31
|
<OptionalLabel v-if="labelOptional">
|
|
@@ -287,14 +288,14 @@
|
|
|
287
288
|
overflow: hidden;`}
|
|
288
289
|
`
|
|
289
290
|
|
|
290
|
-
const labelAttrs = { fontSize: String, fontColor: String }
|
|
291
|
+
const labelAttrs = { fontSize: String, fontColor: String, fontWeight: String }
|
|
291
292
|
const InputLabel = styled('div', labelAttrs)`
|
|
292
293
|
color: ${(props) =>
|
|
293
294
|
props.theme.colors[props.fontColor]
|
|
294
295
|
? props.theme.colors[props.fontColor]
|
|
295
296
|
: props.fontColor};
|
|
296
297
|
font-size: ${(props) => props.fontSize};
|
|
297
|
-
font-weight:
|
|
298
|
+
font-weight: ${(props) => props.fontWeight};
|
|
298
299
|
`
|
|
299
300
|
const OptionalLabel = styled.span`
|
|
300
301
|
font-weight: 300;
|
|
@@ -539,6 +540,11 @@
|
|
|
539
540
|
label: {
|
|
540
541
|
required: false,
|
|
541
542
|
},
|
|
543
|
+
labelFontWeight: {
|
|
544
|
+
required: false,
|
|
545
|
+
default: '700',
|
|
546
|
+
type: String,
|
|
547
|
+
},
|
|
542
548
|
isRequiredLabel: {
|
|
543
549
|
required: false,
|
|
544
550
|
default: false,
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import styled from 'vue3-styled-components'
|
|
2
|
+
|
|
3
|
+
const TEXT_VARIANTS = {
|
|
4
|
+
HEADING_MEDIUM: 'heading-medium',
|
|
5
|
+
HEADING_LARGE: 'heading-large',
|
|
6
|
+
BODY_SMALL: 'body-small',
|
|
7
|
+
BODY_MEDIUM: 'body-medium',
|
|
8
|
+
BODY_LARGE: 'body-large',
|
|
9
|
+
SUBHEADING_SMALL: 'subheading-small',
|
|
10
|
+
SUBHEADING_MEDIUM: 'subheading-medium',
|
|
11
|
+
SUBHEADING_LARGE: 'subheading-large',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const textVariants = {
|
|
15
|
+
[TEXT_VARIANTS.HEADING_MEDIUM]: {
|
|
16
|
+
fontSize: '20px',
|
|
17
|
+
fontWeight: '500',
|
|
18
|
+
lineHeight: '130%',
|
|
19
|
+
letterSpacing: '-0.3px',
|
|
20
|
+
},
|
|
21
|
+
[TEXT_VARIANTS.HEADING_LARGE]: {
|
|
22
|
+
fontSize: '24px',
|
|
23
|
+
fontWeight: '500',
|
|
24
|
+
lineHeight: '130%',
|
|
25
|
+
letterSpacing: '-0.36px',
|
|
26
|
+
},
|
|
27
|
+
[TEXT_VARIANTS.SUBHEADING_SMALL]: {
|
|
28
|
+
fontSize: '12px',
|
|
29
|
+
fontWeight: '500',
|
|
30
|
+
lineHeight: '140%',
|
|
31
|
+
letterSpacing: '-0.12px',
|
|
32
|
+
},
|
|
33
|
+
[TEXT_VARIANTS.SUBHEADING_MEDIUM]: {
|
|
34
|
+
fontSize: '14px',
|
|
35
|
+
fontWeight: '500',
|
|
36
|
+
lineHeight: '140%',
|
|
37
|
+
letterSpacing: '-0.14px',
|
|
38
|
+
},
|
|
39
|
+
[TEXT_VARIANTS.SUBHEADING_LARGE]: {
|
|
40
|
+
fontSize: '16px',
|
|
41
|
+
fontWeight: '500',
|
|
42
|
+
lineHeight: '140%',
|
|
43
|
+
letterSpacing: '-0.16px',
|
|
44
|
+
},
|
|
45
|
+
[TEXT_VARIANTS.BODY_SMALL]: {
|
|
46
|
+
fontSize: '12px',
|
|
47
|
+
fontWeight: '400',
|
|
48
|
+
lineHeight: '150%',
|
|
49
|
+
},
|
|
50
|
+
[TEXT_VARIANTS.BODY_MEDIUM]: {
|
|
51
|
+
fontSize: '14px',
|
|
52
|
+
fontWeight: '400',
|
|
53
|
+
lineHeight: '150%',
|
|
54
|
+
},
|
|
55
|
+
[TEXT_VARIANTS.BODY_LARGE]: {
|
|
56
|
+
fontSize: '16px',
|
|
57
|
+
fontWeight: '400',
|
|
58
|
+
lineHeight: '150%',
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const StyledText = styled('div', {
|
|
63
|
+
fontColor: String,
|
|
64
|
+
type: String,
|
|
65
|
+
})`
|
|
66
|
+
color: ${(props) => props.fontColor};
|
|
67
|
+
font-style: normal;
|
|
68
|
+
|
|
69
|
+
font-size: ${(props) => textVariants[props.type]?.fontSize ?? '14px'};
|
|
70
|
+
font-weight: ${(props) => textVariants[props.type]?.fontWeight ?? '400'};
|
|
71
|
+
line-height: ${(props) => textVariants[props.type]?.lineHeight ?? '150%'};
|
|
72
|
+
letter-spacing: ${(props) =>
|
|
73
|
+
textVariants[props.type]?.letterSpacing ?? 'normal'};
|
|
74
|
+
`
|
|
75
|
+
|
|
76
|
+
export default StyledText
|