classcard-ui 0.2.989 → 0.2.990

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 (188) hide show
  1. package/README.md +24 -24
  2. package/dist/classcard-ui.common.js +59 -58
  3. package/dist/classcard-ui.common.js.map +1 -1
  4. package/dist/classcard-ui.umd.js +59 -58
  5. package/dist/classcard-ui.umd.js.map +1 -1
  6. package/dist/classcard-ui.umd.min.js +1 -1
  7. package/dist/classcard-ui.umd.min.js.map +1 -1
  8. package/package.json +82 -82
  9. package/src/App.vue +16 -16
  10. package/src/components/CAlerts/CAlerts.vue +70 -70
  11. package/src/components/CAlerts/index.js +2 -2
  12. package/src/components/CAnchorTabs/CAnchorTabs.vue +96 -96
  13. package/src/components/CAnchorTabs/index.js +2 -2
  14. package/src/components/CAnchorTag/CAnchorTag.vue +62 -62
  15. package/src/components/CAnchorTag/index.js +2 -2
  16. package/src/components/CAvatar/CAvatar.vue +136 -136
  17. package/src/components/CAvatar/index.js +2 -2
  18. package/src/components/CAvatarGroup/CAvatarGroup.vue +145 -145
  19. package/src/components/CAvatarGroup/index.js +2 -2
  20. package/src/components/CBasicTable/CBasicTable.vue +184 -184
  21. package/src/components/CBasicTable/index.js +2 -2
  22. package/src/components/CBreadcrumbs/CBreadcrumbs.vue +38 -38
  23. package/src/components/CBreadcrumbs/index.js +2 -2
  24. package/src/components/CButton/CButton.vue +152 -152
  25. package/src/components/CButton/index.js +2 -2
  26. package/src/components/CButtonGroup/CButtonGroup.vue +118 -118
  27. package/src/components/CButtonGroup/index.js +2 -2
  28. package/src/components/CButtonIcon/CButtonIcon.vue +117 -117
  29. package/src/components/CButtonIcon/index.js +2 -2
  30. package/src/components/CButtonLink/CButtonLink.vue +39 -39
  31. package/src/components/CButtonLink/index.js +2 -2
  32. package/src/components/CButtonSelect/CButtonSelect.vue +124 -124
  33. package/src/components/CButtonSelect/index.js +2 -2
  34. package/src/components/CButtonSelectBorder/CButtonSelectBorder.vue +135 -135
  35. package/src/components/CButtonSelectBorder/index.js +3 -3
  36. package/src/components/CButtonWithDropdown/CButtonWithDropdown.vue +135 -135
  37. package/src/components/CButtonWithDropdown/index.js +2 -2
  38. package/src/components/CCalendar/CCalendar.vue +410 -410
  39. package/src/components/CCalendar/index.js +3 -3
  40. package/src/components/CCard/CCard.vue +49 -49
  41. package/src/components/CCard/index.js +2 -2
  42. package/src/components/CCheckbox/CCheckbox.vue +85 -85
  43. package/src/components/CCheckbox/index.js +2 -2
  44. package/src/components/CCircularButton/CCircularButton.vue +52 -52
  45. package/src/components/CCircularButton/index.js +2 -2
  46. package/src/components/CCollapsibleSection/CCollapsibleSection.vue +101 -101
  47. package/src/components/CCollapsibleSection/index.js +2 -2
  48. package/src/components/CColorDots/CColorDots.vue +46 -46
  49. package/src/components/CColorDots/index.js +3 -3
  50. package/src/components/CConfirmActionModal/CConfirmActionModal.vue +171 -171
  51. package/src/components/CConfirmActionModal/index.js +3 -3
  52. package/src/components/CDatepicker/CDatepicker.vue +158 -158
  53. package/src/components/CDatepicker/index.js +2 -2
  54. package/src/components/CDualSelect/CDualSelect.vue +193 -193
  55. package/src/components/CDualSelect/index.js +2 -2
  56. package/src/components/CEditor/CEditor.vue +98 -98
  57. package/src/components/CEditor/index.js +2 -2
  58. package/src/components/CFormSectionHeading/CFormSectionHeading.vue +53 -53
  59. package/src/components/CFormSectionHeading/index.js +2 -2
  60. package/src/components/CGroupedSelect/CGroupedSelect.vue +245 -245
  61. package/src/components/CGroupedSelect/index.js +3 -3
  62. package/src/components/CIcon/CIcon.vue +77 -77
  63. package/src/components/CIcon/index.js +2 -2
  64. package/src/components/CIconDropdown/CIconDropdown.vue +146 -146
  65. package/src/components/CIconDropdown/index.js +2 -2
  66. package/src/components/CInput/CInput.vue +134 -134
  67. package/src/components/CInput/index.js +2 -2
  68. package/src/components/CInputAddon/CInputAddon.vue +228 -228
  69. package/src/components/CInputAddon/index.js +2 -2
  70. package/src/components/CInputEmail/CInputEmail.vue +93 -93
  71. package/src/components/CInputEmail/index.js +2 -2
  72. package/src/components/CInsetTabs/CInsetTabs.vue +88 -88
  73. package/src/components/CInsetTabs/index.js +3 -3
  74. package/src/components/CModalHeading/CModalHeading.vue +22 -22
  75. package/src/components/CModalHeading/index.js +2 -2
  76. package/src/components/CModuleHelpLinks/CModuleHelpLinks.vue +70 -70
  77. package/src/components/CModuleHelpLinks/index.js +3 -3
  78. package/src/components/CMultiselect/CMultiselect.vue +485 -479
  79. package/src/components/CMultiselect/index.js +2 -2
  80. package/src/components/CMultiselectr/CMultiselectr.vue +44 -44
  81. package/src/components/CMultiselectr/index.js +2 -2
  82. package/src/components/CPageHeading/CPageHeading.vue +56 -56
  83. package/src/components/CPageHeading/index.js +2 -2
  84. package/src/components/CPagination/CPagination.vue +233 -233
  85. package/src/components/CPagination/index.js +2 -2
  86. package/src/components/CPhoneNumber/CPhoneNumber.vue +114 -114
  87. package/src/components/CPhoneNumber/index.js +2 -2
  88. package/src/components/CRadio/CRadio.vue +124 -124
  89. package/src/components/CRadio/index.js +2 -2
  90. package/src/components/CRangeSlider/CRangeSlider.vue +55 -55
  91. package/src/components/CRangeSlider/index.js +2 -2
  92. package/src/components/CReorderableStackedList/CReorderableStackedList.vue +94 -94
  93. package/src/components/CReorderableStackedList/index.js +2 -2
  94. package/src/components/CSelect/CSelect.vue +417 -417
  95. package/src/components/CSelect/index.js +2 -2
  96. package/src/components/CSmallTimeline/CSmallTimeline.vue +40 -40
  97. package/src/components/CSmallTimeline/index.js +2 -2
  98. package/src/components/CStackedList/CStackedList.vue +150 -150
  99. package/src/components/CStackedList/index.js +2 -2
  100. package/src/components/CStats/CStats.vue +116 -116
  101. package/src/components/CStats/index.js +2 -2
  102. package/src/components/CSwitch/CSwitch.vue +171 -171
  103. package/src/components/CSwitch/index.js +2 -2
  104. package/src/components/CTabLazy/CTabLazy.vue +58 -58
  105. package/src/components/CTabLazy/index.js +2 -2
  106. package/src/components/CTable/CTable.vue +671 -671
  107. package/src/components/CTable/index.js +2 -2
  108. package/src/components/CTabs/CTabs.vue +125 -125
  109. package/src/components/CTabs/index.js +2 -2
  110. package/src/components/CTag/CTag.vue +59 -59
  111. package/src/components/CTag/index.js +2 -2
  112. package/src/components/CTextarea/CTextarea.vue +107 -107
  113. package/src/components/CTextarea/index.js +2 -2
  114. package/src/components/CTimeline/CTimeline.vue +237 -237
  115. package/src/components/CTimeline/index.js +2 -2
  116. package/src/components/CUpload/CUpload.vue +267 -267
  117. package/src/components/CUpload/index.js +2 -2
  118. package/src/components/index.js +52 -52
  119. package/src/icons.js +364 -364
  120. package/src/main.js +22 -22
  121. package/src/stories/CAlerts.stories.js +37 -37
  122. package/src/stories/CAnchorTabs.stories.js +29 -29
  123. package/src/stories/CAnchorTag.stories.js +36 -36
  124. package/src/stories/CAvatar.stories.js +38 -38
  125. package/src/stories/CAvatarGroup.stories.js +100 -100
  126. package/src/stories/CBasicTable.stories.js +316 -316
  127. package/src/stories/CBreadcrumbs.stories.js +24 -24
  128. package/src/stories/CButton.stories.js +47 -47
  129. package/src/stories/CButtonGroup.stories.js +33 -33
  130. package/src/stories/CButtonIcon.stories.js +27 -27
  131. package/src/stories/CButtonLink.stories.js +24 -24
  132. package/src/stories/CButtonSelect.stories.js +41 -41
  133. package/src/stories/CButtonSelectBorder.stories.js +48 -48
  134. package/src/stories/CButtonWithDropdown.stories.js +41 -41
  135. package/src/stories/CCalendar.stories.js +16 -16
  136. package/src/stories/CCard.stories.js +30 -30
  137. package/src/stories/CCheckbox.stories.js +29 -29
  138. package/src/stories/CCircularButton.stories.js +29 -29
  139. package/src/stories/CCollapsibleSection.stories.js +28 -28
  140. package/src/stories/CColorDots.stories.js +28 -28
  141. package/src/stories/CConfirmActionModal.stories.js +59 -59
  142. package/src/stories/CDatepicker.stories.js +30 -30
  143. package/src/stories/CDualSelect.stories.js +29 -29
  144. package/src/stories/CEditor.stories.js +30 -30
  145. package/src/stories/CFormSectionHeading.stories.js +34 -34
  146. package/src/stories/CGroupedSelect.stories.js +71 -71
  147. package/src/stories/CIcon.stories.js +26 -26
  148. package/src/stories/CIconDropdown.stories.js +45 -45
  149. package/src/stories/CInput.stories.js +36 -36
  150. package/src/stories/CInputAddon.stories.js +37 -37
  151. package/src/stories/CInputEmail.stories.js +27 -27
  152. package/src/stories/CInsetTabs.stories.js +38 -38
  153. package/src/stories/CModalHeading.stories.js +25 -25
  154. package/src/stories/CModuleHelpLinks.stories.js +25 -25
  155. package/src/stories/CMultiselect.stories.js +157 -157
  156. package/src/stories/CMultiselectr.stories.js +23 -23
  157. package/src/stories/CPageHeading.stories.js +32 -32
  158. package/src/stories/CPagination.stories.js +30 -30
  159. package/src/stories/CPhoneNumber.stories.js +29 -29
  160. package/src/stories/CRadio.stories.js +36 -36
  161. package/src/stories/CRangeSlider.stories.js +23 -23
  162. package/src/stories/CReorderableStackedList.stories.js +23 -23
  163. package/src/stories/CSelect.stories.js +96 -96
  164. package/src/stories/CSmallTimeline.stories.js +26 -26
  165. package/src/stories/CStackedList.stories.js +37 -37
  166. package/src/stories/CStats.stories.js +33 -33
  167. package/src/stories/CSwitch.stories.js +28 -28
  168. package/src/stories/CTabLazy.stories.js +24 -24
  169. package/src/stories/CTable.stories.js +169 -169
  170. package/src/stories/CTabs.stories.js +33 -33
  171. package/src/stories/CTag.stories.js +34 -34
  172. package/src/stories/CTextarea.stories.js +32 -32
  173. package/src/stories/CTimeline.stories.js +26 -26
  174. package/src/stories/CUpload.stories.js +36 -36
  175. package/src/stories/Introduction.stories.mdx +207 -207
  176. package/src/stories/Page.vue +88 -88
  177. package/src/stories/assets/code-brackets.svg +0 -0
  178. package/src/stories/assets/colors.svg +0 -0
  179. package/src/stories/assets/comments.svg +0 -0
  180. package/src/stories/assets/direction.svg +0 -0
  181. package/src/stories/assets/flow.svg +0 -0
  182. package/src/stories/assets/plugin.svg +0 -0
  183. package/src/stories/assets/repo.svg +0 -0
  184. package/src/stories/assets/stackalt.svg +0 -0
  185. package/src/stories/header.css +26 -26
  186. package/src/stories/page.css +69 -69
  187. package/src/stories/utils.css +17 -17
  188. package/src/.DS_Store +0 -0
@@ -1,3 +1,3 @@
1
- import CAnchorTag from './CAnchorTag.vue'
2
-
1
+ import CAnchorTag from './CAnchorTag.vue'
2
+
3
3
  export default CAnchorTag
@@ -1,136 +1,136 @@
1
- <template>
2
- <div>
3
- <div :class="description ? 'items-start' : 'items-center'" class="flex">
4
- <div v-if="image">
5
- <img
6
- @error="$emit('error', $event)"
7
- :class="[
8
- classes,
9
- imageClasses,
10
- hasRing ? `p-0.5 ring-2 ${getRingColor}` : '',
11
- ]"
12
- class="inline-block object-cover"
13
- :src="image"
14
- alt=""
15
- />
16
- </div>
17
- <div
18
- v-else
19
- :class="
20
- hasRing
21
- ? `${getRingColor} flex h-12 w-12 items-center justify-center
22
- justify-items-center rounded-full p-0.5 ring-2`
23
- : ''
24
- "
25
- >
26
- <div
27
- :class="[
28
- 'flex-none text-center font-medium ',
29
- hasRing ? 'h-11 w-11 rounded-full text-sm' : nameInitialsClasses,
30
- `border-${isDynamicallyColored ? customColor : 'red'}-300`,
31
- `bg-${isDynamicallyColored ? customColor : 'red'}-100`,
32
- `text-${isDynamicallyColored ? customColor : 'red'}-600`,
33
- ]"
34
- :style="[
35
- size == 'medium' ? { 'line-height': '3rem' } : '',
36
- size == 'large' ? { 'line-height': '3.5rem' } : '',
37
- size == 'very large' ? { 'line-height': '6rem' } : '',
38
- size == 'extraextrasmall' ? { 'font-size': '0.5rem' } : '',
39
- size == 'extrasmall' ? { 'font-size': '0.7rem' } : '',
40
- ]"
41
- >
42
- {{ nameInitials }}
43
- </div>
44
- </div>
45
- <div class="ml-3 text-left" v-if="name">
46
- <p v-if="name" class="text-sm text-gray-900">
47
- {{ name }}
48
- </p>
49
- <p
50
- v-if="description"
51
- class="text-xs text-gray-500 group-hover:text-gray-700"
52
- >
53
- {{ description }}
54
- </p>
55
- <slot></slot>
56
- </div>
57
- </div>
58
- </div>
59
- </template>
60
- <script>
61
- export default {
62
- name: "CAvatar",
63
- props: {
64
- size: {
65
- type: String,
66
- required: true,
67
- default: "medium",
68
- },
69
- image: {
70
- type: String,
71
- },
72
- nameInitials: {
73
- type: String,
74
- },
75
- rounded: { type: Boolean },
76
- name: { type: String },
77
- description: { type: String },
78
- imageClasses: { type: String },
79
- isDynamicallyColored: { type: Boolean, default: false },
80
- hasRing: { type: Boolean, default: false },
81
- ringColor: { type: String, default: "gray" },
82
- },
83
- data() {
84
- return {
85
- colors: ["gray", "red", "yellow", "indigo", "pink", "purple", "green"],
86
- customColor: null,
87
- };
88
- },
89
- computed: {
90
- classes() {
91
- return {
92
- "h-6 w-6": this.size == "extraextrasmall",
93
- "h-8 w-8": this.size == "extrasmall",
94
- "h-10 w-10": this.size == "small",
95
- "h-12 w-12": this.size == "medium",
96
- "h-14 w-14": this.size == "large",
97
- "h-24 w-24": this.size == "very large",
98
- "rounded-full": this.rounded == true,
99
- "rounded-md": this.rounded == false,
100
- };
101
- },
102
-
103
- nameInitialsClasses() {
104
- return {
105
- "h-6 w-6 leading-6": this.size == "extraextrasmall",
106
- "h-8 w-8 leading-8": this.size == "extrasmall",
107
- "h-10 w-10 leading-10 text-xs": this.size == "small",
108
- "h-12 w-12 text-sm": this.size == "medium",
109
- "h-14 w-14 text-base": this.size == "large",
110
- "h-24 w-24 text-2xl": this.size == "very large",
111
- "rounded-full": this.rounded == true,
112
- "rounded-md": this.rounded == false,
113
- };
114
- },
115
- getRingColor() {
116
- if (this.ringColor == "yellow") {
117
- return "ring-[#fef08a]";
118
- } else if (this.ringColor == "indigo") {
119
- return "ring-indigo-200";
120
- } else {
121
- return "ring-gray-200";
122
- }
123
- },
124
- },
125
- methods: {
126
- setColors() {
127
- this.colors = this.colors.sort(() => Math.random() - 0.5);
128
- let show = this.colors[Math.floor(Math.random() * this.colors.length)];
129
- this.customColor = show;
130
- },
131
- },
132
- mounted() {
133
- this.setColors();
134
- },
135
- };
136
- </script>
1
+ <template>
2
+ <div>
3
+ <div :class="description ? 'items-start' : 'items-center'" class="flex">
4
+ <div v-if="image">
5
+ <img
6
+ @error="$emit('error', $event)"
7
+ :class="[
8
+ classes,
9
+ imageClasses,
10
+ hasRing ? `p-0.5 ring-2 ${getRingColor}` : '',
11
+ ]"
12
+ class="inline-block object-cover"
13
+ :src="image"
14
+ alt=""
15
+ />
16
+ </div>
17
+ <div
18
+ v-else
19
+ :class="
20
+ hasRing
21
+ ? `${getRingColor} flex h-12 w-12 items-center justify-center
22
+ justify-items-center rounded-full p-0.5 ring-2`
23
+ : ''
24
+ "
25
+ >
26
+ <div
27
+ :class="[
28
+ 'flex-none text-center font-medium ',
29
+ hasRing ? 'h-11 w-11 rounded-full text-sm' : nameInitialsClasses,
30
+ `border-${isDynamicallyColored ? customColor : 'red'}-300`,
31
+ `bg-${isDynamicallyColored ? customColor : 'red'}-100`,
32
+ `text-${isDynamicallyColored ? customColor : 'red'}-600`,
33
+ ]"
34
+ :style="[
35
+ size == 'medium' ? { 'line-height': '3rem' } : '',
36
+ size == 'large' ? { 'line-height': '3.5rem' } : '',
37
+ size == 'very large' ? { 'line-height': '6rem' } : '',
38
+ size == 'extraextrasmall' ? { 'font-size': '0.5rem' } : '',
39
+ size == 'extrasmall' ? { 'font-size': '0.7rem' } : '',
40
+ ]"
41
+ >
42
+ {{ nameInitials }}
43
+ </div>
44
+ </div>
45
+ <div class="ml-3 text-left" v-if="name">
46
+ <p v-if="name" class="text-sm text-gray-900">
47
+ {{ name }}
48
+ </p>
49
+ <p
50
+ v-if="description"
51
+ class="text-xs text-gray-500 group-hover:text-gray-700"
52
+ >
53
+ {{ description }}
54
+ </p>
55
+ <slot></slot>
56
+ </div>
57
+ </div>
58
+ </div>
59
+ </template>
60
+ <script>
61
+ export default {
62
+ name: "CAvatar",
63
+ props: {
64
+ size: {
65
+ type: String,
66
+ required: true,
67
+ default: "medium",
68
+ },
69
+ image: {
70
+ type: String,
71
+ },
72
+ nameInitials: {
73
+ type: String,
74
+ },
75
+ rounded: { type: Boolean },
76
+ name: { type: String },
77
+ description: { type: String },
78
+ imageClasses: { type: String },
79
+ isDynamicallyColored: { type: Boolean, default: false },
80
+ hasRing: { type: Boolean, default: false },
81
+ ringColor: { type: String, default: "gray" },
82
+ },
83
+ data() {
84
+ return {
85
+ colors: ["gray", "red", "yellow", "indigo", "pink", "purple", "green"],
86
+ customColor: null,
87
+ };
88
+ },
89
+ computed: {
90
+ classes() {
91
+ return {
92
+ "h-6 w-6": this.size == "extraextrasmall",
93
+ "h-8 w-8": this.size == "extrasmall",
94
+ "h-10 w-10": this.size == "small",
95
+ "h-12 w-12": this.size == "medium",
96
+ "h-14 w-14": this.size == "large",
97
+ "h-24 w-24": this.size == "very large",
98
+ "rounded-full": this.rounded == true,
99
+ "rounded-md": this.rounded == false,
100
+ };
101
+ },
102
+
103
+ nameInitialsClasses() {
104
+ return {
105
+ "h-6 w-6 leading-6": this.size == "extraextrasmall",
106
+ "h-8 w-8 leading-8": this.size == "extrasmall",
107
+ "h-10 w-10 leading-10 text-xs": this.size == "small",
108
+ "h-12 w-12 text-sm": this.size == "medium",
109
+ "h-14 w-14 text-base": this.size == "large",
110
+ "h-24 w-24 text-2xl": this.size == "very large",
111
+ "rounded-full": this.rounded == true,
112
+ "rounded-md": this.rounded == false,
113
+ };
114
+ },
115
+ getRingColor() {
116
+ if (this.ringColor == "yellow") {
117
+ return "ring-[#fef08a]";
118
+ } else if (this.ringColor == "indigo") {
119
+ return "ring-indigo-200";
120
+ } else {
121
+ return "ring-gray-200";
122
+ }
123
+ },
124
+ },
125
+ methods: {
126
+ setColors() {
127
+ this.colors = this.colors.sort(() => Math.random() - 0.5);
128
+ let show = this.colors[Math.floor(Math.random() * this.colors.length)];
129
+ this.customColor = show;
130
+ },
131
+ },
132
+ mounted() {
133
+ this.setColors();
134
+ },
135
+ };
136
+ </script>
@@ -1,3 +1,3 @@
1
- import CAvatar from './CAvatar.vue'
2
-
1
+ import CAvatar from './CAvatar.vue'
2
+
3
3
  export default CAvatar
@@ -1,145 +1,145 @@
1
- <template>
2
- <div :class="description ? 'items-start' : 'items-center'" class="flex">
3
- <div class="flex -space-x-1" v-if="images && images.length <= 3">
4
- <img
5
- v-for="(image, index) in images"
6
- :key="index"
7
- :class="classes"
8
- class="inline-block ring-2 ring-white"
9
- :src="image.image"
10
- alt=""
11
- />
12
- </div>
13
- <div class="flex -space-x-1" v-if="images && images.length > 3">
14
- <img
15
- v-for="(image, index) in images.slice(0, 4)"
16
- :key="index"
17
- :class="classes"
18
- class="inline-block ring-2 ring-white"
19
- :src="image.image"
20
- alt=""
21
- />
22
- </div>
23
- <div class="flex -space-x-1" v-if="nameInitials && nameInitialsWithColors.length > 4">
24
- <div
25
- v-for="(name, index) in nameInitialsWithColors.slice(0, 4)"
26
- :key="index"
27
- :class="[
28
- 'inline-block text-center font-medium ring-2 ring-white',
29
- nameInitialsClasses,
30
- 'bg-' + name.color + '-100',
31
- 'border-' + name.color + '-300',
32
- ,
33
- 'text-' + name.color + '-600',
34
- ]"
35
- :style="[
36
- size == 'medium' ? { 'line-height': '3rem' } : '',
37
- size == 'large' ? { 'line-height': '3.5rem' } : '',
38
- size == 'very large' ? { 'line-height': '6rem' } : '',
39
- size == 'extraextrasmall' ? { 'font-size': '0.5rem' } : '',
40
- size == 'extrasmall' ? { 'font-size': '0.7rem' } : '',
41
- ]"
42
- >
43
- {{ name.initials }}
44
- </div>
45
- </div>
46
- <div class="flex -space-x-1" v-if="nameInitials && nameInitialsWithColors.length <= 4">
47
- <div
48
- v-for="(name, index) in nameInitialsWithColors"
49
- :key="index"
50
- :class="[
51
- 'inline-block text-center font-medium ring-2 ring-white',
52
- nameInitialsClasses,
53
- 'bg-' + name.color + '-100',
54
- 'border-' + name.color + '-300',
55
- ,
56
- 'text-' + name.color + '-600',
57
- ]"
58
- :style="[
59
- size == 'medium' ? { 'line-height': '3rem' } : '',
60
- size == 'large' ? { 'line-height': '3.5rem' } : '',
61
- size == 'very large' ? { 'line-height': '6rem' } : '',
62
- size == 'extraextrasmall' ? { 'font-size': '0.5rem' } : '',
63
- size == 'extrasmall' ? { 'font-size': '0.7rem' } : '',
64
- ]"
65
- >
66
- {{ name.initials }}
67
- </div>
68
- </div>
69
- <div class="ml-3 text-left" v-if="name">
70
- <p v-if="name" class="text-sm text-gray-500">
71
- {{ name }}
72
- </p>
73
- <p v-if="description" class="text-xs text-gray-500 group-hover:text-gray-700">
74
- {{ description }}
75
- </p>
76
- <slot></slot>
77
- </div>
78
- </div>
79
- </template>
80
- <script>
81
- export default {
82
- name: "CAvatarGroup",
83
- props: {
84
- size: {
85
- type: String,
86
- required: true,
87
- default: "medium",
88
- },
89
- images: {
90
- type: Array,
91
- },
92
- nameInitials: {
93
- type: Array,
94
- },
95
- rounded: { type: Boolean },
96
- name: { type: String },
97
- description: { type: String },
98
- },
99
- data() {
100
- return {
101
- colors: ["gray", "red", "yellow", "indigo", "pink", "purple", "green"],
102
- };
103
- },
104
- computed: {
105
- classes() {
106
- return {
107
- "h-6 w-6": this.size == "extraextrasmall",
108
- "h-8 w-8": this.size == "extrasmall",
109
- "h-10 w-10": this.size == "small",
110
- "h-12 w-12": this.size == "medium",
111
- "h-14 w-14": this.size == "large",
112
- "h-24 w-24": this.size == "very large",
113
- "rounded-full": this.rounded == true,
114
- "rounded-md": this.rounded == false,
115
- };
116
- },
117
- nameInitialsClasses() {
118
- return {
119
- "h-6 w-6 leading-6": this.size == "extraextrasmall",
120
- "h-8 w-8 leading-8": this.size == "extrasmall",
121
- "h-10 w-10 leading-10 text-xs": this.size == "small",
122
- "h-12 w-12 text-sm": this.size == "medium",
123
- "h-14 w-14 text-base": this.size == "large",
124
- "h-24 w-24 text-2xl": this.size == "very large",
125
- "rounded-full": this.rounded == true,
126
- "rounded-md": this.rounded == false,
127
- };
128
- },
129
- nameInitialsWithColors() {
130
- let nameWithColors = this.nameInitials;
131
- nameWithColors.map((name) => {
132
- name.color = this.setColors();
133
- });
134
- return nameWithColors;
135
- },
136
- },
137
- methods: {
138
- setColors() {
139
- this.colors = this.colors.sort(() => Math.random() - 0.5);
140
- let show = this.colors[Math.floor(Math.random() * this.colors.length)];
141
- return show;
142
- },
143
- },
144
- };
145
- </script>
1
+ <template>
2
+ <div :class="description ? 'items-start' : 'items-center'" class="flex">
3
+ <div class="flex -space-x-1" v-if="images && images.length <= 3">
4
+ <img
5
+ v-for="(image, index) in images"
6
+ :key="index"
7
+ :class="classes"
8
+ class="inline-block ring-2 ring-white"
9
+ :src="image.image"
10
+ alt=""
11
+ />
12
+ </div>
13
+ <div class="flex -space-x-1" v-if="images && images.length > 3">
14
+ <img
15
+ v-for="(image, index) in images.slice(0, 4)"
16
+ :key="index"
17
+ :class="classes"
18
+ class="inline-block ring-2 ring-white"
19
+ :src="image.image"
20
+ alt=""
21
+ />
22
+ </div>
23
+ <div class="flex -space-x-1" v-if="nameInitials && nameInitialsWithColors.length > 4">
24
+ <div
25
+ v-for="(name, index) in nameInitialsWithColors.slice(0, 4)"
26
+ :key="index"
27
+ :class="[
28
+ 'inline-block text-center font-medium ring-2 ring-white',
29
+ nameInitialsClasses,
30
+ 'bg-' + name.color + '-100',
31
+ 'border-' + name.color + '-300',
32
+ ,
33
+ 'text-' + name.color + '-600',
34
+ ]"
35
+ :style="[
36
+ size == 'medium' ? { 'line-height': '3rem' } : '',
37
+ size == 'large' ? { 'line-height': '3.5rem' } : '',
38
+ size == 'very large' ? { 'line-height': '6rem' } : '',
39
+ size == 'extraextrasmall' ? { 'font-size': '0.5rem' } : '',
40
+ size == 'extrasmall' ? { 'font-size': '0.7rem' } : '',
41
+ ]"
42
+ >
43
+ {{ name.initials }}
44
+ </div>
45
+ </div>
46
+ <div class="flex -space-x-1" v-if="nameInitials && nameInitialsWithColors.length <= 4">
47
+ <div
48
+ v-for="(name, index) in nameInitialsWithColors"
49
+ :key="index"
50
+ :class="[
51
+ 'inline-block text-center font-medium ring-2 ring-white',
52
+ nameInitialsClasses,
53
+ 'bg-' + name.color + '-100',
54
+ 'border-' + name.color + '-300',
55
+ ,
56
+ 'text-' + name.color + '-600',
57
+ ]"
58
+ :style="[
59
+ size == 'medium' ? { 'line-height': '3rem' } : '',
60
+ size == 'large' ? { 'line-height': '3.5rem' } : '',
61
+ size == 'very large' ? { 'line-height': '6rem' } : '',
62
+ size == 'extraextrasmall' ? { 'font-size': '0.5rem' } : '',
63
+ size == 'extrasmall' ? { 'font-size': '0.7rem' } : '',
64
+ ]"
65
+ >
66
+ {{ name.initials }}
67
+ </div>
68
+ </div>
69
+ <div class="ml-3 text-left" v-if="name">
70
+ <p v-if="name" class="text-sm text-gray-500">
71
+ {{ name }}
72
+ </p>
73
+ <p v-if="description" class="text-xs text-gray-500 group-hover:text-gray-700">
74
+ {{ description }}
75
+ </p>
76
+ <slot></slot>
77
+ </div>
78
+ </div>
79
+ </template>
80
+ <script>
81
+ export default {
82
+ name: "CAvatarGroup",
83
+ props: {
84
+ size: {
85
+ type: String,
86
+ required: true,
87
+ default: "medium",
88
+ },
89
+ images: {
90
+ type: Array,
91
+ },
92
+ nameInitials: {
93
+ type: Array,
94
+ },
95
+ rounded: { type: Boolean },
96
+ name: { type: String },
97
+ description: { type: String },
98
+ },
99
+ data() {
100
+ return {
101
+ colors: ["gray", "red", "yellow", "indigo", "pink", "purple", "green"],
102
+ };
103
+ },
104
+ computed: {
105
+ classes() {
106
+ return {
107
+ "h-6 w-6": this.size == "extraextrasmall",
108
+ "h-8 w-8": this.size == "extrasmall",
109
+ "h-10 w-10": this.size == "small",
110
+ "h-12 w-12": this.size == "medium",
111
+ "h-14 w-14": this.size == "large",
112
+ "h-24 w-24": this.size == "very large",
113
+ "rounded-full": this.rounded == true,
114
+ "rounded-md": this.rounded == false,
115
+ };
116
+ },
117
+ nameInitialsClasses() {
118
+ return {
119
+ "h-6 w-6 leading-6": this.size == "extraextrasmall",
120
+ "h-8 w-8 leading-8": this.size == "extrasmall",
121
+ "h-10 w-10 leading-10 text-xs": this.size == "small",
122
+ "h-12 w-12 text-sm": this.size == "medium",
123
+ "h-14 w-14 text-base": this.size == "large",
124
+ "h-24 w-24 text-2xl": this.size == "very large",
125
+ "rounded-full": this.rounded == true,
126
+ "rounded-md": this.rounded == false,
127
+ };
128
+ },
129
+ nameInitialsWithColors() {
130
+ let nameWithColors = this.nameInitials;
131
+ nameWithColors.map((name) => {
132
+ name.color = this.setColors();
133
+ });
134
+ return nameWithColors;
135
+ },
136
+ },
137
+ methods: {
138
+ setColors() {
139
+ this.colors = this.colors.sort(() => Math.random() - 0.5);
140
+ let show = this.colors[Math.floor(Math.random() * this.colors.length)];
141
+ return show;
142
+ },
143
+ },
144
+ };
145
+ </script>
@@ -1,3 +1,3 @@
1
- import CAvatarGroup from './CAvatarGroup.vue'
2
-
1
+ import CAvatarGroup from './CAvatarGroup.vue'
2
+
3
3
  export default CAvatarGroup