@eturnity/eturnity_reusable_components 8.19.2 → 8.19.4

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.
Files changed (35) hide show
  1. package/package.json +1 -1
  2. package/src/assets/svgIcons/download.svg +3 -3
  3. package/src/assets/svgIcons/filter.svg +3 -0
  4. package/src/assets/svgIcons/kanban_view.svg +6 -0
  5. package/src/assets/svgIcons/plus_button.svg +3 -3
  6. package/src/assets/svgIcons/table_view.svg +3 -0
  7. package/src/assets/theme.js +53 -5
  8. package/src/components/banner/banner/Banner.stories.js +99 -43
  9. package/src/components/banner/infoBanner/InfoBanner.stories.js +72 -30
  10. package/src/components/buttons/buttonIcon/ButtonIcon.stories.js +167 -0
  11. package/src/components/buttons/buttonIcon/index.vue +40 -6
  12. package/src/components/buttons/mainButton/MainButton.stories.js +115 -34
  13. package/src/components/draggableCard/draggableCard.stories.js +110 -54
  14. package/src/components/filter/filterSettings.vue +1 -1
  15. package/src/components/filterComponent/viewFilter.vue +605 -0
  16. package/src/components/filterComponent/viewSettings.vue +281 -0
  17. package/src/components/filterComponent/viewSort.vue +330 -0
  18. package/src/components/icon/Icon.stories.js +220 -0
  19. package/src/components/icon/index.vue +8 -1
  20. package/src/components/infoCard/index.vue +7 -3
  21. package/src/components/inputs/searchInput/index.vue +1 -1
  22. package/src/components/inputs/select/index.vue +6 -5
  23. package/src/components/inputs/select/option/index.vue +5 -0
  24. package/src/components/projectMarker/ProjectMarker.stories.js +130 -0
  25. package/src/components/selectedOptions/index.vue +13 -2
  26. package/src/components/selectedOptions/selectedOptions.stories.js +135 -37
  27. package/src/components/spinner/Spinner.stories.js +70 -18
  28. package/src/components/spinnerGif/SpinnerGif.stories.js +86 -0
  29. package/src/components/tableDropdown/TableDropdown.stories.js +192 -0
  30. package/src/components/tables/mainTable/MainTable.stories.js +151 -0
  31. package/src/components/tabsHeader/TabsHeader.stories.js +142 -0
  32. package/src/components/tabsHeader/index.vue +33 -9
  33. package/src/components/videoThumbnail/videoThumbnail.stories.js +90 -17
  34. package/src/helpers/translateLang.js +95 -24
  35. package/src/components/icon/Icons.stories.js +0 -31
@@ -8,11 +8,24 @@
8
8
  :is-active="activeTab === item.id"
9
9
  @click="onTabClick({ id: item.id })"
10
10
  >
11
- <NameContainer>
12
- <div>{{ item.text }}</div>
13
- <DotIcon v-if="item.subText" :is-active="activeTab === item.id" />
11
+ <RCIcon
12
+ v-if="item.icon"
13
+ :color="
14
+ activeTab === item.id
15
+ ? theme.semanticColors.purple[500]
16
+ : theme.semanticColors.teal[800]
17
+ "
18
+ :hovered-color="
19
+ activeTab === item.id
20
+ ? theme.semanticColors.purple[500]
21
+ : theme.semanticColors.teal[800]
22
+ "
23
+ :name="item.icon"
24
+ size="14px"
25
+ />
26
+ <div>{{ item.text }}</div>
27
+ <DotIcon v-if="item.subText" :is-active="activeTab === item.id" />
14
28
  <SubText v-if="item.subText">{{ item.subText }}</SubText>
15
- </NameContainer>
16
29
  <RCIcon v-if="item.hasError" name="warning" size="14px" />
17
30
  </TabItem>
18
31
  </TabsContainer>
@@ -39,6 +52,7 @@
39
52
  // />
40
53
  import styled from 'vue3-styled-components'
41
54
  import RCIcon from '../icon'
55
+ import theme from '@/assets/theme'
42
56
 
43
57
  const NameContainer = styled.div`
44
58
  display: flex;
@@ -79,12 +93,17 @@
79
93
  gap: 8px;
80
94
  padding: 10px 25px;
81
95
  font-size: 14px;
82
- font-weight: 400;
96
+ font-weight: ${(props) => (props.isActive ? '500' : '400')};
83
97
  color: ${(props) =>
84
- props.isActive ? props.theme.colors.purple6 : props.theme.colors.black};
85
- border-bottom: ${(props) =>
86
- props.isActive ? '1px solid' + props.theme.colors.purple6 : 'unset'};
98
+ props.isActive
99
+ ? props.theme.semanticColors.purple[500]
100
+ : props.theme.semanticColors.teal[800]};
87
101
  flex-grow: ${(props) => (props.fullSize ? 1 : 0)};
102
+ background-color: ${(props) => props.theme.colors.white};
103
+ border-bottom: ${(props) =>
104
+ props.isActive
105
+ ? '1px solid' + props.theme.semanticColors.purple[400]
106
+ : '1px solid' + props.theme.semanticColors.grey[400]};
88
107
  `
89
108
 
90
109
  export default {
@@ -105,7 +124,7 @@
105
124
  },
106
125
  activeTab: {
107
126
  required: true,
108
- type: Number,
127
+ type: [Number, String],
109
128
  },
110
129
  fullSize: {
111
130
  type: Boolean,
@@ -113,6 +132,11 @@
113
132
  },
114
133
  },
115
134
  emits: ['on-tab-change'],
135
+ data() {
136
+ return {
137
+ theme,
138
+ }
139
+ },
116
140
  methods: {
117
141
  onTabClick({ id }) {
118
142
  if (id === this.activeTab) {
@@ -1,33 +1,106 @@
1
1
  import VideoThumbnail from './index.vue'
2
+ import theme from '@/assets/theme'
2
3
 
3
4
  export default {
4
5
  title: 'VideoThumbnail',
5
6
  component: VideoThumbnail,
6
- // argTypes: {},
7
+ tags: ['autodocs'],
8
+ argTypes: {
9
+ src: {
10
+ control: 'text',
11
+ description: 'URL of the thumbnail image',
12
+ },
13
+ fit: {
14
+ control: 'select',
15
+ options: ['cover', 'contain', 'fill', 'none', 'scale-down'],
16
+ description: 'How the image should fit within its container',
17
+ },
18
+ width: {
19
+ control: 'text',
20
+ description: 'Width of the thumbnail (e.g., "300px")',
21
+ },
22
+ height: {
23
+ control: 'text',
24
+ description: 'Height of the thumbnail (e.g., "200px")',
25
+ },
26
+ playIconSize: {
27
+ control: 'text',
28
+ description: 'Size of the play icon (e.g., "50px")',
29
+ },
30
+ playIconColor: {
31
+ control: 'color',
32
+ description: 'Color of the play icon',
33
+ },
34
+ },
7
35
  }
8
36
 
9
- const Template = (args, { argTypes }) => ({
10
- // Components used in your story `template` are defined in the `components` object
37
+ const Template = (args) => ({
11
38
  components: { VideoThumbnail },
12
- // The story's `args` need to be mapped into the template through the `setup()` method
13
- props: Object.keys(argTypes),
14
- template: `<VideoThumbnail v-bind="$props"/>`,
15
- // import VideoThumbnail from "@eturnity/eturnity_reusable_components/src/components/videoThumbnail"
16
- // How to use:
17
- //<videoThumbnail src="https://musicart.xboxlive.com/6/cfaf1e9d-0000-0000-0000-000000000009/504/image.jpg?w=1920&h=1080"
18
- // playIconColor="red"
19
- // playIconSize="20px"
20
- // width="400px"
21
- // height="600px"
22
- // />
39
+ setup() {
40
+ return { args }
41
+ },
42
+ template: '<VideoThumbnail v-bind="args" />',
43
+ provide: {
44
+ theme,
45
+ },
23
46
  })
24
47
 
25
48
  export const Default = Template.bind({})
26
49
  Default.args = {
27
- src: 'https://musicart.xboxlive.com/6/cfaf1e9d-0000-0000-0000-000000000009/504/image.jpg?w=1920&h=1080',
50
+ src: 'https://images.unsplash.com/photo-1574717024653-61fd2cf4d44d?w=400&h=300&fit=crop',
51
+ fit: 'cover',
52
+ width: '300px',
53
+ height: '200px',
54
+ playIconSize: '50px',
55
+ playIconColor: 'blue',
56
+ }
57
+
58
+ export const Small = Template.bind({})
59
+ Small.args = {
60
+ src: 'https://images.unsplash.com/photo-1574717024653-61fd2cf4d44d?w=200&h=150&fit=crop',
61
+ fit: 'cover',
62
+ width: '200px',
63
+ height: '150px',
64
+ playIconSize: '30px',
65
+ playIconColor: 'blue',
66
+ }
67
+
68
+ export const Large = Template.bind({})
69
+ Large.args = {
70
+ src: 'https://images.unsplash.com/photo-1574717024653-61fd2cf4d44d?w=800&h=600&fit=crop',
71
+ fit: 'cover',
72
+ width: '600px',
73
+ height: '400px',
74
+ playIconSize: '80px',
75
+ playIconColor: 'blue',
76
+ }
77
+
78
+ export const CustomFit = Template.bind({})
79
+ CustomFit.args = {
80
+ src: 'https://images.unsplash.com/photo-1574717024653-61fd2cf4d44d?w=400&h=300&fit=crop',
81
+ fit: 'contain',
82
+ width: '300px',
83
+ height: '200px',
84
+ playIconSize: '50px',
85
+ playIconColor: 'blue',
86
+ }
87
+
88
+ export const CustomIconColor = Template.bind({})
89
+ CustomIconColor.args = {
90
+ src: 'https://images.unsplash.com/photo-1574717024653-61fd2cf4d44d?w=400&h=300&fit=crop',
91
+ fit: 'cover',
92
+ width: '300px',
93
+ height: '200px',
28
94
  playIconSize: '50px',
29
95
  playIconColor: 'red',
30
- width: '400px',
31
- height: '300px',
96
+ }
97
+
98
+ export const Square = Template.bind({})
99
+ Square.args = {
100
+ src: 'https://images.unsplash.com/photo-1574717024653-61fd2cf4d44d?w=400&h=400&fit=crop',
32
101
  fit: 'cover',
102
+ width: '300px',
103
+ height: '300px',
104
+ playIconSize: '50px',
105
+ playIconColor: 'blue',
33
106
  }
@@ -1,3 +1,21 @@
1
+ import {
2
+ enUS,
3
+ enGB,
4
+ de,
5
+ fr,
6
+ it,
7
+ es,
8
+ da,
9
+ pl,
10
+ sv,
11
+ nb,
12
+ nl,
13
+ cs,
14
+ fi,
15
+ pt,
16
+ ca,
17
+ } from 'date-fns/locale'
18
+
1
19
  export const translateLang = (lang) => {
2
20
  // this is needed so that we use the correct keys for Phrase
3
21
  if (lang === 'en') {
@@ -55,30 +73,83 @@ export const translateLang = (lang) => {
55
73
  }
56
74
  }
57
75
 
76
+ export const getDateFormat = (lang) => {
77
+ const formatMap = {
78
+ 'en-us': 'MM/dd/yyyy',
79
+ 'en-gb': 'dd/MM/yyyy',
80
+ en: 'MM/dd/yyyy',
81
+ 'de-de': 'dd.MM.yyyy',
82
+ 'de-at': 'dd.MM.yyyy',
83
+ 'de-ch': 'dd.MM.yyyy',
84
+ 'de-lu': 'dd.MM.yyyy',
85
+ 'de-be': 'dd.MM.yyyy',
86
+ de: 'dd.MM.yyyy',
87
+ 'fr-fr': 'dd/MM/yyyy',
88
+ 'fr-be': 'dd/MM/yyyy',
89
+ 'fr-lu': 'dd/MM/yyyy',
90
+ 'fr-ch': 'dd/MM/yyyy',
91
+ fr: 'dd/MM/yyyy',
92
+ 'it-it': 'dd/MM/yyyy',
93
+ 'it-ch': 'dd/MM/yyyy',
94
+ it: 'dd/MM/yyyy',
95
+ 'da-dk': 'dd.MM.yyyy',
96
+ 'pl-pl': 'dd.MM.yyyy',
97
+ 'sv-se': 'yyyy-MM-dd',
98
+ 'no-no': 'dd.MM.yyyy',
99
+ 'nb-no': 'dd.MM.yyyy',
100
+ 'nl-nl': 'dd-MM-yyyy',
101
+ 'nl-be': 'dd-MM-yyyy',
102
+ cs: 'dd.MM.yyyy',
103
+ 'fi-fi': 'dd.MM.yyyy',
104
+ 'pt-pt': 'dd/MM/yyyy',
105
+ 'es-es': 'dd/MM/yyyy',
106
+ 'ca-es': 'dd/MM/yyyy',
107
+ }
108
+
109
+ return formatMap[lang.toLowerCase()] || 'MM/dd/yyyy' // Fallback to en-US format
110
+ }
111
+
58
112
  export const datePickerLang = (lang) => {
59
- if (
60
- lang === 'de-de' ||
61
- lang === 'de-ch' ||
62
- lang === 'de-lu' ||
63
- lang === 'de-be'
64
- ) {
65
- return 'de'
66
- } else if (
67
- lang === 'fr-fr' ||
68
- lang === 'fr-ch' ||
69
- lang === 'fr-lu' ||
70
- lang === 'fr-be'
71
- ) {
72
- return 'fr'
73
- } else if (lang === 'it-it' || lang === 'it-ch') {
74
- return 'it'
75
- } else if (lang === 'en-us' || lang === 'en-gb') {
76
- return 'en'
77
- } else if (lang === 'es-es' || lang === 'ca-es' || lang === 'pt-pt') {
78
- return 'es'
79
- } else {
80
- return lang
113
+ const localeMap = {
114
+ 'en-us': enUS,
115
+ 'en-gb': enGB,
116
+ en: enUS,
117
+ 'de-de': de,
118
+ 'de-at': de,
119
+ 'de-ch': de,
120
+ 'de-lu': de,
121
+ 'de-be': de,
122
+ de: de,
123
+ 'fr-fr': fr,
124
+ 'fr-be': fr,
125
+ 'fr-lu': fr,
126
+ 'fr-ch': fr,
127
+ fr: fr,
128
+ 'it-it': it,
129
+ 'it-ch': it,
130
+ it: it,
131
+ 'da-dk': da,
132
+ 'pl-pl': pl,
133
+ 'sv-se': sv,
134
+ 'no-no': nb,
135
+ 'nb-no': nb,
136
+ 'nl-nl': nl,
137
+ 'nl-be': nl,
138
+ cs: cs,
139
+ 'fi-fi': fi,
140
+ 'pt-pt': pt,
141
+ 'es-es': es,
142
+ 'ca-es': ca,
143
+ }
144
+
145
+ const normalizedLang = lang ? lang.toLowerCase() : 'en-us'
146
+ const locale = localeMap[normalizedLang] || enUS
147
+ if (!localeMap[normalizedLang]) {
148
+ console.warn(
149
+ `Unsupported language for datePickerLang: ${lang}, falling back to enUS`
150
+ )
81
151
  }
152
+ return locale
82
153
  }
83
154
 
84
155
  export const tinyLanguage = (lang) => {
@@ -123,6 +194,6 @@ export const langForLocaleString = () => {
123
194
  : localStorage.getItem('lang') === 'ca-es'
124
195
  ? 'es-es'
125
196
  : localStorage.getItem('lang')
126
- : 'en-US'
127
- return selectedLang !== 'null' ? selectedLang : 'en-US'
197
+ : 'en-us'
198
+ return selectedLang !== 'null' ? selectedLang : 'en-us'
128
199
  }
@@ -1,31 +0,0 @@
1
- import IconCollection from './iconCollection.vue'
2
-
3
- export default {
4
- title: 'icon',
5
- component: IconCollection,
6
- }
7
-
8
- const Template = (args) => ({
9
- components: { IconCollection },
10
- setup() {
11
- return { args }
12
- },
13
- template: '<IconCollection v-bind="args" />',
14
- })
15
-
16
- export const Default = Template.bind({})
17
- Default.args = {
18
- size: '30px',
19
- }
20
-
21
- export const WithColor = Template.bind({})
22
- WithColor.args = {
23
- size: '30px',
24
- color: 'red',
25
- hoveredColor: 'crimson',
26
- }
27
-
28
- export const Large = Template.bind({})
29
- Large.args = {
30
- size: '60px',
31
- }