@eturnity/eturnity_reusable_components 8.19.2 → 8.19.3
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 +1 -1
- package/src/assets/svgIcons/download.svg +3 -3
- package/src/assets/svgIcons/filter.svg +3 -0
- package/src/assets/svgIcons/kanban_view.svg +6 -0
- package/src/assets/svgIcons/plus_button.svg +3 -3
- package/src/assets/svgIcons/table_view.svg +3 -0
- package/src/assets/theme.js +53 -5
- package/src/components/banner/banner/Banner.stories.js +99 -43
- package/src/components/banner/infoBanner/InfoBanner.stories.js +72 -30
- package/src/components/buttons/buttonIcon/ButtonIcon.stories.js +167 -0
- package/src/components/buttons/buttonIcon/index.vue +40 -6
- package/src/components/buttons/mainButton/MainButton.stories.js +115 -34
- package/src/components/draggableCard/draggableCard.stories.js +110 -54
- package/src/components/filter/filterSettings.vue +1 -1
- package/src/components/filterComponent/viewFilter.vue +605 -0
- package/src/components/filterComponent/viewSettings.vue +281 -0
- package/src/components/filterComponent/viewSort.vue +330 -0
- package/src/components/icon/Icon.stories.js +220 -0
- package/src/components/icon/index.vue +8 -1
- package/src/components/inputs/searchInput/index.vue +1 -1
- package/src/components/inputs/select/index.vue +6 -5
- package/src/components/inputs/select/option/index.vue +5 -0
- package/src/components/projectMarker/ProjectMarker.stories.js +130 -0
- package/src/components/selectedOptions/index.vue +13 -2
- package/src/components/selectedOptions/selectedOptions.stories.js +135 -37
- package/src/components/spinner/Spinner.stories.js +70 -18
- package/src/components/spinnerGif/SpinnerGif.stories.js +86 -0
- package/src/components/tableDropdown/TableDropdown.stories.js +192 -0
- package/src/components/tables/mainTable/MainTable.stories.js +151 -0
- package/src/components/tabsHeader/TabsHeader.stories.js +142 -0
- package/src/components/tabsHeader/index.vue +33 -9
- package/src/components/videoThumbnail/videoThumbnail.stories.js +90 -17
- package/src/helpers/translateLang.js +95 -24
- package/src/components/icon/Icons.stories.js +0 -31
package/package.json
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
<svg
|
2
|
-
<
|
3
|
-
<path
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M11 6.5L7 10.5L3 6.5" fill="white"/>
|
3
|
+
<path d="M13 13H1M11 6.5L7 10.5M7 10.5L3 6.5M7 10.5V1" stroke="#6F20DC" stroke-linecap="round" stroke-linejoin="round"/>
|
4
4
|
</svg>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M13.4158 2.25103L13.4158 2.25108L8.42717 7.31882C8.42716 7.31884 8.42714 7.31885 8.42712 7.31887C8.1884 7.56134 8.05563 7.88855 8.05556 8.22814V8.22824V13.2099C8.05555 13.2553 8.04535 13.2998 8.02606 13.3399L8.47674 13.5565L8.02606 13.3399C8.00678 13.38 7.97909 13.4145 7.94567 13.441C7.91227 13.4674 7.87394 13.4854 7.83373 13.494C7.79354 13.5027 7.752 13.5019 7.71209 13.4918L7.71185 13.4917L6.15653 13.0967C6.09806 13.0818 6.0446 13.0471 6.00557 12.9963C5.96643 12.9454 5.94445 12.8815 5.94444 12.8148V8.22824V8.22814C5.94437 7.88855 5.8116 7.56134 5.57288 7.31887C5.57286 7.31885 5.57284 7.31883 5.57283 7.31882L0.584213 2.25108L0.58416 2.25103C0.531197 2.19724 0.500044 2.12265 0.5 2.04323C0.5 2.0432 0.5 2.04316 0.5 2.04313V0.790114C0.5 0.710654 0.531146 0.636004 0.58413 0.58218C0.636851 0.528623 0.706668 0.5 0.777778 0.5H13.2222C13.2933 0.5 13.3631 0.528623 13.4159 0.58218C13.4689 0.636003 13.5 0.710653 13.5 0.790114V2.04313C13.5 2.04316 13.5 2.0432 13.5 2.04323C13.5 2.12265 13.4688 2.19724 13.4158 2.25103Z" stroke="#263238" stroke-linecap="round" stroke-linejoin="round"/>
|
3
|
+
</svg>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M3 2C2.44772 2 2 2.44772 2 3V9C2 9.55229 2.44772 10 3 10H3.5C4.05228 10 4.5 9.55229 4.5 9V3C4.5 2.44772 4.05228 2 3.5 2H3Z" fill="#6F20DC"/>
|
3
|
+
<path d="M5.75 3C5.75 2.44772 6.19772 2 6.75 2H7.25C7.80228 2 8.25 2.44772 8.25 3V5C8.25 5.55228 7.80228 6 7.25 6H6.75C6.19772 6 5.75 5.55228 5.75 5V3Z" fill="#6F20DC"/>
|
4
|
+
<path d="M10.5 2C9.94771 2 9.5 2.44772 9.5 3V11C9.5 11.5523 9.94771 12 10.5 12H11C11.5523 12 12 11.5523 12 11V3C12 2.44772 11.5523 2 11 2H10.5Z" fill="#6F20DC"/>
|
5
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0 2C0 0.89543 0.895431 0 2 0H12C13.1046 0 14 0.895431 14 2V12C14 13.1046 13.1046 14 12 14H2C0.89543 14 0 13.1046 0 12V2ZM2 1H12C12.5523 1 13 1.44772 13 2V12C13 12.5523 12.5523 13 12 13H2C1.44772 13 1 12.5523 1 12V2C1 1.44772 1.44772 1 2 1Z" fill="#6F20DC"/>
|
6
|
+
</svg>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<svg width="
|
2
|
-
<path d="
|
3
|
-
<path d="
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M6 1C6 0.447716 6.44772 0 7 0C7.55228 0 8 0.447715 8 1V13C8 13.5523 7.55228 14 7 14C6.44772 14 6 13.5523 6 13V1Z" fill="white"/>
|
3
|
+
<path d="M13 6C13.5523 6 14 6.44772 14 7C14 7.55228 13.5523 8 13 8H1C0.447716 8 1.95702e-08 7.55228 4.37113e-08 7C6.78524e-08 6.44772 0.447715 6 1 6L13 6Z" fill="white"/>
|
4
4
|
</svg>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0 2V12C0 13.1046 0.89543 14 2 14H12C13.1046 14 14 13.1046 14 12V2C14 0.895431 13.1046 0 12 0H2C0.895431 0 0 0.89543 0 2ZM7.5 3.5H13V6H7.5V3.5ZM6.5 3.5H1V6H6.5V3.5ZM1 7V9.5H6.5V7H1ZM1 10.5V12C1 12.5523 1.44772 13 2 13H6.5V10.5H1ZM7.5 13H12C12.5523 13 13 12.5523 13 12V10.5H7.5V13ZM13 9.5V7H7.5V9.5H13Z" fill="#263238"/>
|
3
|
+
</svg>
|
package/src/assets/theme.js
CHANGED
@@ -333,7 +333,7 @@ const theme = (() => {
|
|
333
333
|
borderColor: semanticColors.grey[300],
|
334
334
|
},
|
335
335
|
active: {
|
336
|
-
backgroundColor: semanticColors.
|
336
|
+
backgroundColor: semanticColors.purple[100],
|
337
337
|
textColor: semanticColors.purple[600],
|
338
338
|
borderColor: semanticColors.grey[600],
|
339
339
|
},
|
@@ -377,12 +377,12 @@ const theme = (() => {
|
|
377
377
|
borderColor: '',
|
378
378
|
},
|
379
379
|
hover: {
|
380
|
-
backgroundColor: semanticColors.
|
380
|
+
backgroundColor: semanticColors.purple[200],
|
381
381
|
textColor: semanticColors.purple[700],
|
382
382
|
borderColor: '',
|
383
383
|
},
|
384
384
|
active: {
|
385
|
-
backgroundColor: semanticColors.
|
385
|
+
backgroundColor: semanticColors.purple[100],
|
386
386
|
textColor: semanticColors.purple[600],
|
387
387
|
borderColor: '',
|
388
388
|
},
|
@@ -416,6 +416,30 @@ const theme = (() => {
|
|
416
416
|
},
|
417
417
|
},
|
418
418
|
},
|
419
|
+
filter: {
|
420
|
+
main: {
|
421
|
+
default: {
|
422
|
+
backgroundColor: colors.white,
|
423
|
+
textColor: semanticColors.teal[800],
|
424
|
+
borderColor: semanticColors.teal[100],
|
425
|
+
},
|
426
|
+
hover: {
|
427
|
+
backgroundColor: semanticColors.teal[50],
|
428
|
+
textColor: semanticColors.teal[800],
|
429
|
+
borderColor: semanticColors.teal[100],
|
430
|
+
},
|
431
|
+
active: {
|
432
|
+
backgroundColor: semanticColors.teal[100],
|
433
|
+
textColor: semanticColors.teal[800],
|
434
|
+
borderColor: semanticColors.teal[100],
|
435
|
+
},
|
436
|
+
disabled: {
|
437
|
+
textColor: semanticColors.grey[600],
|
438
|
+
backgroundColor: semanticColors.grey[300],
|
439
|
+
borderColor: '',
|
440
|
+
},
|
441
|
+
},
|
442
|
+
},
|
419
443
|
},
|
420
444
|
dark: {
|
421
445
|
// theme
|
@@ -429,12 +453,12 @@ const theme = (() => {
|
|
429
453
|
borderColor: '',
|
430
454
|
},
|
431
455
|
hover: {
|
432
|
-
backgroundColor: semanticColors.
|
456
|
+
backgroundColor: semanticColors.purple[100],
|
433
457
|
textColor: semanticColors.teal[800],
|
434
458
|
borderColor: '',
|
435
459
|
},
|
436
460
|
active: {
|
437
|
-
backgroundColor: semanticColors.
|
461
|
+
backgroundColor: semanticColors.purple[100],
|
438
462
|
textColor: semanticColors.teal[800],
|
439
463
|
borderColor: '',
|
440
464
|
},
|
@@ -615,6 +639,30 @@ const theme = (() => {
|
|
615
639
|
},
|
616
640
|
},
|
617
641
|
},
|
642
|
+
filter: {
|
643
|
+
main: {
|
644
|
+
default: {
|
645
|
+
backgroundColor: colors.white,
|
646
|
+
textColor: semanticColors.teal[800],
|
647
|
+
borderColor: semanticColors.teal[100],
|
648
|
+
},
|
649
|
+
hover: {
|
650
|
+
backgroundColor: semanticColors.teal[100],
|
651
|
+
textColor: semanticColors.teal[800],
|
652
|
+
borderColor: semanticColors.teal[100],
|
653
|
+
},
|
654
|
+
active: {
|
655
|
+
backgroundColor: semanticColors.teal[100],
|
656
|
+
textColor: semanticColors.teal[800],
|
657
|
+
borderColor: semanticColors.teal[100],
|
658
|
+
},
|
659
|
+
disabled: {
|
660
|
+
textColor: semanticColors.grey[600],
|
661
|
+
backgroundColor: semanticColors.grey[300],
|
662
|
+
borderColor: '',
|
663
|
+
},
|
664
|
+
},
|
665
|
+
},
|
618
666
|
},
|
619
667
|
size: {
|
620
668
|
large: {
|
@@ -5,60 +5,116 @@ export default {
|
|
5
5
|
title: 'Banner',
|
6
6
|
component: Banner,
|
7
7
|
tags: ['autodocs'],
|
8
|
+
argTypes: {
|
9
|
+
isOpen: {
|
10
|
+
control: 'boolean',
|
11
|
+
description: 'Whether the banner is visible',
|
12
|
+
},
|
13
|
+
isLoading: {
|
14
|
+
control: 'boolean',
|
15
|
+
description: 'Whether to show a loading spinner',
|
16
|
+
},
|
17
|
+
hideClose: {
|
18
|
+
control: 'boolean',
|
19
|
+
description: 'Whether to hide the close button',
|
20
|
+
},
|
21
|
+
backdrop: {
|
22
|
+
control: 'select',
|
23
|
+
options: ['white', 'dark'],
|
24
|
+
description: 'Type of backdrop overlay',
|
25
|
+
},
|
26
|
+
position: {
|
27
|
+
control: 'select',
|
28
|
+
options: ['fixed', 'absolute', 'relative'],
|
29
|
+
description: 'Position of the banner',
|
30
|
+
},
|
31
|
+
stopPropagation: {
|
32
|
+
control: 'boolean',
|
33
|
+
description:
|
34
|
+
'Whether to stop event propagation when clicking the modal container',
|
35
|
+
},
|
36
|
+
},
|
8
37
|
}
|
9
38
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
position: 'fixed',
|
28
|
-
stopPropagation: true,
|
39
|
+
const Template = (args) => ({
|
40
|
+
components: { Banner },
|
41
|
+
setup() {
|
42
|
+
return { args }
|
43
|
+
},
|
44
|
+
template: `
|
45
|
+
<Banner v-bind="args" @on-close="onClose">
|
46
|
+
<div style="padding: 20px;">
|
47
|
+
<h2>Banner Content</h2>
|
48
|
+
<p>This is some example content inside the banner.</p>
|
49
|
+
</div>
|
50
|
+
</Banner>
|
51
|
+
`,
|
52
|
+
methods: {
|
53
|
+
onClose() {
|
54
|
+
console.log('Banner closed')
|
55
|
+
},
|
29
56
|
},
|
57
|
+
provide: {
|
58
|
+
theme,
|
59
|
+
},
|
60
|
+
})
|
61
|
+
|
62
|
+
export const Default = Template.bind({})
|
63
|
+
Default.args = {
|
64
|
+
isOpen: false,
|
65
|
+
isLoading: false,
|
66
|
+
hideClose: false,
|
67
|
+
backdrop: 'white',
|
68
|
+
position: 'fixed',
|
69
|
+
stopPropagation: true,
|
30
70
|
}
|
31
71
|
|
32
|
-
export const OpenedBanner = {
|
33
|
-
|
34
|
-
|
35
|
-
|
72
|
+
export const OpenedBanner = Template.bind({})
|
73
|
+
OpenedBanner.args = {
|
74
|
+
isOpen: true,
|
75
|
+
isLoading: false,
|
76
|
+
hideClose: false,
|
77
|
+
backdrop: 'white',
|
78
|
+
position: 'fixed',
|
79
|
+
stopPropagation: true,
|
36
80
|
}
|
37
81
|
|
38
|
-
export const LoadingBanner = {
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
82
|
+
export const LoadingBanner = Template.bind({})
|
83
|
+
LoadingBanner.args = {
|
84
|
+
isOpen: true,
|
85
|
+
isLoading: true,
|
86
|
+
hideClose: false,
|
87
|
+
backdrop: 'white',
|
88
|
+
position: 'fixed',
|
89
|
+
stopPropagation: true,
|
43
90
|
}
|
44
91
|
|
45
|
-
export const HiddenCloseButton = {
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
92
|
+
export const HiddenCloseButton = Template.bind({})
|
93
|
+
HiddenCloseButton.args = {
|
94
|
+
isOpen: true,
|
95
|
+
isLoading: false,
|
96
|
+
hideClose: true,
|
97
|
+
backdrop: 'white',
|
98
|
+
position: 'fixed',
|
99
|
+
stopPropagation: true,
|
50
100
|
}
|
51
101
|
|
52
|
-
export const DarkBackdrop = {
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
102
|
+
export const DarkBackdrop = Template.bind({})
|
103
|
+
DarkBackdrop.args = {
|
104
|
+
isOpen: true,
|
105
|
+
isLoading: false,
|
106
|
+
hideClose: false,
|
107
|
+
backdrop: 'dark',
|
108
|
+
position: 'fixed',
|
109
|
+
stopPropagation: true,
|
57
110
|
}
|
58
111
|
|
59
|
-
export const AbsolutePositionBanner = {
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
112
|
+
export const AbsolutePositionBanner = Template.bind({})
|
113
|
+
AbsolutePositionBanner.args = {
|
114
|
+
isOpen: true,
|
115
|
+
isLoading: false,
|
116
|
+
hideClose: false,
|
117
|
+
backdrop: 'white',
|
118
|
+
position: 'absolute',
|
119
|
+
stopPropagation: true,
|
64
120
|
}
|
@@ -1,42 +1,84 @@
|
|
1
1
|
import InfoBanner from './index.vue'
|
2
2
|
import theme from '@/assets/theme'
|
3
|
+
|
3
4
|
export default {
|
4
5
|
title: 'InfoBanner',
|
5
6
|
component: InfoBanner,
|
6
7
|
tags: ['autodocs'],
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
// </RCInfoBanner>
|
17
|
-
|
18
|
-
export const Default = {
|
19
|
-
args: {
|
20
|
-
isOpen: false,
|
21
|
-
buttonLabel: 'Got it',
|
8
|
+
argTypes: {
|
9
|
+
isOpen: {
|
10
|
+
control: 'boolean',
|
11
|
+
description: 'Whether the banner is visible',
|
12
|
+
},
|
13
|
+
buttonLabel: {
|
14
|
+
control: 'text',
|
15
|
+
description: 'Custom label for the confirmation button',
|
16
|
+
},
|
22
17
|
},
|
23
18
|
}
|
24
19
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
20
|
+
const Template = (args) => ({
|
21
|
+
components: { InfoBanner },
|
22
|
+
setup() {
|
23
|
+
return { args }
|
29
24
|
},
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
25
|
+
template: `
|
26
|
+
<InfoBanner v-bind="args" @on-close="onClose">
|
27
|
+
<template #title>
|
28
|
+
<h2>Information Title</h2>
|
29
|
+
</template>
|
30
|
+
<template #body>
|
31
|
+
<p>This is some important information that needs to be displayed to the user. It can contain multiple paragraphs and will be properly formatted.</p>
|
32
|
+
</template>
|
33
|
+
</InfoBanner>
|
34
|
+
`,
|
35
|
+
methods: {
|
36
|
+
onClose() {
|
37
|
+
console.log('InfoBanner closed')
|
34
38
|
},
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
},
|
40
|
+
provide: {
|
41
|
+
theme,
|
42
|
+
},
|
43
|
+
})
|
44
|
+
|
45
|
+
export const Default = Template.bind({})
|
46
|
+
Default.args = {
|
47
|
+
isOpen: false,
|
48
|
+
buttonLabel: 'Got it',
|
49
|
+
}
|
50
|
+
|
51
|
+
export const OpenedInfoBanner = Template.bind({})
|
52
|
+
OpenedInfoBanner.args = {
|
53
|
+
isOpen: true,
|
54
|
+
buttonLabel: 'Got it',
|
55
|
+
}
|
56
|
+
|
57
|
+
export const CustomButtonLabel = Template.bind({})
|
58
|
+
CustomButtonLabel.args = {
|
59
|
+
isOpen: true,
|
60
|
+
buttonLabel: 'I understand',
|
61
|
+
}
|
62
|
+
|
63
|
+
export const LongContent = Template.bind({})
|
64
|
+
LongContent.args = {
|
65
|
+
isOpen: true,
|
66
|
+
buttonLabel: 'Got it',
|
42
67
|
}
|
68
|
+
LongContent.template = `
|
69
|
+
<InfoBanner v-bind="args" @on-close="onClose">
|
70
|
+
<template #title>
|
71
|
+
<h2>Detailed Information</h2>
|
72
|
+
</template>
|
73
|
+
<template #body>
|
74
|
+
<p>This is a longer piece of content that demonstrates how the InfoBanner handles multiple paragraphs and longer text.</p>
|
75
|
+
<p>It includes:</p>
|
76
|
+
<ul>
|
77
|
+
<li>Multiple paragraphs</li>
|
78
|
+
<li>Bullet points</li>
|
79
|
+
<li>Different types of content</li>
|
80
|
+
</ul>
|
81
|
+
<p>All of this content should be properly formatted and scrollable if needed.</p>
|
82
|
+
</template>
|
83
|
+
</InfoBanner>
|
84
|
+
`
|
@@ -0,0 +1,167 @@
|
|
1
|
+
import ButtonIcon from './index.vue'
|
2
|
+
import theme from '@/assets/theme'
|
3
|
+
|
4
|
+
export default {
|
5
|
+
title: 'Components/Buttons/ButtonIcon',
|
6
|
+
component: ButtonIcon,
|
7
|
+
tags: ['autodocs'],
|
8
|
+
argTypes: {
|
9
|
+
type: {
|
10
|
+
control: 'select',
|
11
|
+
options: ['primary', 'secondary', 'tertiary'],
|
12
|
+
description: 'Button type',
|
13
|
+
},
|
14
|
+
variant: {
|
15
|
+
control: 'select',
|
16
|
+
options: ['main', 'cancel', 'danger'],
|
17
|
+
description: 'Button variant',
|
18
|
+
},
|
19
|
+
appTheme: {
|
20
|
+
control: 'select',
|
21
|
+
options: ['light', 'dark'],
|
22
|
+
description: 'Application theme',
|
23
|
+
},
|
24
|
+
buttonSize: {
|
25
|
+
control: 'select',
|
26
|
+
options: ['small', 'medium', 'large'],
|
27
|
+
description: 'Button size',
|
28
|
+
},
|
29
|
+
isDisabled: {
|
30
|
+
control: 'boolean',
|
31
|
+
description: 'Whether the button is disabled',
|
32
|
+
},
|
33
|
+
text: {
|
34
|
+
control: 'text',
|
35
|
+
description: 'Button text',
|
36
|
+
},
|
37
|
+
minWidth: {
|
38
|
+
control: 'text',
|
39
|
+
description: 'Minimum width of the button',
|
40
|
+
},
|
41
|
+
customColor: {
|
42
|
+
control: 'color',
|
43
|
+
description: 'Custom background color',
|
44
|
+
},
|
45
|
+
iconName: {
|
46
|
+
control: 'text',
|
47
|
+
description: 'Name of the icon to display',
|
48
|
+
},
|
49
|
+
iconColor: {
|
50
|
+
control: 'color',
|
51
|
+
description: 'Custom color for the icon',
|
52
|
+
},
|
53
|
+
fontSize: {
|
54
|
+
control: 'text',
|
55
|
+
description: 'Font size of the button text',
|
56
|
+
},
|
57
|
+
isActive: {
|
58
|
+
control: 'boolean',
|
59
|
+
description: 'Whether the button is in active state',
|
60
|
+
},
|
61
|
+
fillType: {
|
62
|
+
control: 'select',
|
63
|
+
options: ['fill', 'stroke'],
|
64
|
+
description: 'How to fill the icon',
|
65
|
+
},
|
66
|
+
},
|
67
|
+
}
|
68
|
+
|
69
|
+
const Template = (args) => ({
|
70
|
+
components: { ButtonIcon },
|
71
|
+
setup() {
|
72
|
+
return { args }
|
73
|
+
},
|
74
|
+
template: '<ButtonIcon v-bind="args" />',
|
75
|
+
provide: {
|
76
|
+
theme,
|
77
|
+
},
|
78
|
+
})
|
79
|
+
|
80
|
+
export const Default = Template.bind({})
|
81
|
+
Default.args = {
|
82
|
+
type: 'primary',
|
83
|
+
variant: 'main',
|
84
|
+
appTheme: 'light',
|
85
|
+
buttonSize: 'medium',
|
86
|
+
isDisabled: false,
|
87
|
+
text: 'Click Me',
|
88
|
+
minWidth: '200px',
|
89
|
+
customColor: null,
|
90
|
+
iconName: 'settings',
|
91
|
+
iconColor: null,
|
92
|
+
fontSize: '14px',
|
93
|
+
isActive: false,
|
94
|
+
fillType: 'fill',
|
95
|
+
}
|
96
|
+
|
97
|
+
export const Secondary = Template.bind({})
|
98
|
+
Secondary.args = {
|
99
|
+
...Default.args,
|
100
|
+
type: 'secondary',
|
101
|
+
}
|
102
|
+
|
103
|
+
export const Tertiary = Template.bind({})
|
104
|
+
Tertiary.args = {
|
105
|
+
...Default.args,
|
106
|
+
type: 'tertiary',
|
107
|
+
}
|
108
|
+
|
109
|
+
export const Cancel = Template.bind({})
|
110
|
+
Cancel.args = {
|
111
|
+
...Default.args,
|
112
|
+
variant: 'cancel',
|
113
|
+
}
|
114
|
+
|
115
|
+
export const Danger = Template.bind({})
|
116
|
+
Danger.args = {
|
117
|
+
...Default.args,
|
118
|
+
variant: 'danger',
|
119
|
+
}
|
120
|
+
|
121
|
+
export const Disabled = Template.bind({})
|
122
|
+
Disabled.args = {
|
123
|
+
...Default.args,
|
124
|
+
isDisabled: true,
|
125
|
+
}
|
126
|
+
|
127
|
+
export const Active = Template.bind({})
|
128
|
+
Active.args = {
|
129
|
+
...Default.args,
|
130
|
+
isActive: true,
|
131
|
+
}
|
132
|
+
|
133
|
+
export const Small = Template.bind({})
|
134
|
+
Small.args = {
|
135
|
+
...Default.args,
|
136
|
+
buttonSize: 'small',
|
137
|
+
}
|
138
|
+
|
139
|
+
export const Large = Template.bind({})
|
140
|
+
Large.args = {
|
141
|
+
...Default.args,
|
142
|
+
buttonSize: 'large',
|
143
|
+
}
|
144
|
+
|
145
|
+
export const CustomColor = Template.bind({})
|
146
|
+
CustomColor.args = {
|
147
|
+
...Default.args,
|
148
|
+
customColor: '#FF5733',
|
149
|
+
}
|
150
|
+
|
151
|
+
export const CustomIconColor = Template.bind({})
|
152
|
+
CustomIconColor.args = {
|
153
|
+
...Default.args,
|
154
|
+
iconColor: '#FFFFFF',
|
155
|
+
}
|
156
|
+
|
157
|
+
export const DarkTheme = Template.bind({})
|
158
|
+
DarkTheme.args = {
|
159
|
+
...Default.args,
|
160
|
+
appTheme: 'dark',
|
161
|
+
}
|
162
|
+
|
163
|
+
export const StrokeIcon = Template.bind({})
|
164
|
+
StrokeIcon.args = {
|
165
|
+
...Default.args,
|
166
|
+
fillType: 'stroke',
|
167
|
+
}
|
@@ -22,6 +22,7 @@
|
|
22
22
|
theme.mainButton[appTheme][type][variant].default.textColor
|
23
23
|
"
|
24
24
|
:disable-hover="disableIconHover"
|
25
|
+
:fill-type="fillType"
|
25
26
|
:hovered-color="
|
26
27
|
iconColor ||
|
27
28
|
theme.mainButton[appTheme][type][variant].default.textColor
|
@@ -33,6 +34,9 @@
|
|
33
34
|
<ButtonContainer :button-size="buttonSize">
|
34
35
|
{{ text }}
|
35
36
|
</ButtonContainer>
|
37
|
+
<NumberContainer v-if="numberCount">
|
38
|
+
<NumberText>{{ numberCount }}</NumberText>
|
39
|
+
</NumberContainer>
|
36
40
|
</ButtonWrapper>
|
37
41
|
</PageContainer>
|
38
42
|
</template>
|
@@ -67,17 +71,16 @@
|
|
67
71
|
}
|
68
72
|
const ButtonWrapper = styled('div', ButtonAttrs)`
|
69
73
|
display: grid;
|
70
|
-
grid-template-columns: auto 1fr;
|
74
|
+
grid-template-columns: auto 1fr auto;
|
71
75
|
font-size: ${(props) =>
|
72
76
|
props.theme?.mainButton?.size?.[props.buttonSize]?.fontSize};
|
73
|
-
color: ${(props) =>
|
74
|
-
props.isDisabled
|
77
|
+
color: ${(props) => {
|
78
|
+
return props.isDisabled
|
75
79
|
? props.theme.mainButton[props.appTheme][props.type][props.variant]
|
76
80
|
.disabled.textColor
|
77
|
-
: props.customColor
|
78
|
-
? props.theme.colors.white
|
79
81
|
: props.theme.mainButton[props.appTheme][props.type][props.variant]
|
80
|
-
.default.textColor
|
82
|
+
.default.textColor
|
83
|
+
}};
|
81
84
|
background-color: ${(props) =>
|
82
85
|
props.isDisabled
|
83
86
|
? props.theme.mainButton[props.appTheme][props.type][props.variant]
|
@@ -159,6 +162,25 @@
|
|
159
162
|
}};
|
160
163
|
`
|
161
164
|
|
165
|
+
const NumberContainer = styled.div`
|
166
|
+
display: flex;
|
167
|
+
align-items: center;
|
168
|
+
justify-content: center;
|
169
|
+
margin-right: 10px;
|
170
|
+
`
|
171
|
+
|
172
|
+
const NumberText = styled.div`
|
173
|
+
display: flex;
|
174
|
+
align-items: center;
|
175
|
+
justify-content: center;
|
176
|
+
font-size: 12px;
|
177
|
+
font-weight: 400;
|
178
|
+
color: ${(props) => props.theme.semanticColors.purple[500]};
|
179
|
+
padding: 3px 8px;
|
180
|
+
border-radius: 8px;
|
181
|
+
background-color: ${(props) => props.theme.semanticColors.purple[50]};
|
182
|
+
`
|
183
|
+
|
162
184
|
export default {
|
163
185
|
name: 'ButtonIcon',
|
164
186
|
components: {
|
@@ -167,6 +189,8 @@
|
|
167
189
|
ButtonWrapper,
|
168
190
|
IconContainer,
|
169
191
|
Icon,
|
192
|
+
NumberContainer,
|
193
|
+
NumberText,
|
170
194
|
},
|
171
195
|
props: {
|
172
196
|
type: {
|
@@ -232,10 +256,20 @@
|
|
232
256
|
default: false,
|
233
257
|
type: Boolean,
|
234
258
|
},
|
259
|
+
fillType: {
|
260
|
+
required: false,
|
261
|
+
default: 'fill',
|
262
|
+
type: String,
|
263
|
+
},
|
235
264
|
disableIconHover: {
|
236
265
|
type: Boolean,
|
237
266
|
default: false,
|
238
267
|
},
|
268
|
+
numberCount: {
|
269
|
+
type: Number,
|
270
|
+
required: false,
|
271
|
+
default: null,
|
272
|
+
},
|
239
273
|
},
|
240
274
|
data() {
|
241
275
|
return {
|