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 CCalendar from "./CCalendar.vue";
2
-
3
- export default CCalendar;
1
+ import CCalendar from "./CCalendar.vue";
2
+
3
+ export default CCalendar;
@@ -1,49 +1,49 @@
1
- <template>
2
- <div
3
- class="relative rounded-lg border border-gray-300 bg-white px-6 py-5 shadow-sm flex items-center space-x-3 hover:border-gray-400 focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-indigo-500"
4
- >
5
- <div class="flex-shrink-0 p-2 rounded-md bg-gray-100">
6
- <c-avatar
7
- :image="image.image"
8
- :rounded="image.rounded"
9
- :size="image.size"
10
- imageClasses="object-contain"
11
- ></c-avatar>
12
- </div>
13
- <div class="flex-1 min-w-0">
14
- <a href="#" class="focus:outline-none">
15
- <span class="absolute inset-0" aria-hidden="true"></span>
16
- <div class="flex">
17
- <p class="text-sm text-gray-900">
18
- {{ name }}
19
- </p>
20
- <slot></slot>
21
- </div>
22
- <p class="text-sm text-gray-500 truncate">
23
- {{ description }}
24
- </p>
25
- </a>
26
- </div>
27
- </div>
28
- </template>
29
-
30
- <script>
31
- import CAvatar from "../CAvatar/CAvatar.vue";
32
- export default {
33
- name: "CCard",
34
- components: { CAvatar },
35
- props: {
36
- image: {
37
- type: Object,
38
- },
39
- name: {
40
- type: String,
41
- },
42
- description: {
43
- type: String,
44
- },
45
- },
46
- };
47
- </script>
48
-
49
- <style></style>
1
+ <template>
2
+ <div
3
+ class="relative rounded-lg border border-gray-300 bg-white px-6 py-5 shadow-sm flex items-center space-x-3 hover:border-gray-400 focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-indigo-500"
4
+ >
5
+ <div class="flex-shrink-0 p-2 rounded-md bg-gray-100">
6
+ <c-avatar
7
+ :image="image.image"
8
+ :rounded="image.rounded"
9
+ :size="image.size"
10
+ imageClasses="object-contain"
11
+ ></c-avatar>
12
+ </div>
13
+ <div class="flex-1 min-w-0">
14
+ <a href="#" class="focus:outline-none">
15
+ <span class="absolute inset-0" aria-hidden="true"></span>
16
+ <div class="flex">
17
+ <p class="text-sm text-gray-900">
18
+ {{ name }}
19
+ </p>
20
+ <slot></slot>
21
+ </div>
22
+ <p class="text-sm text-gray-500 truncate">
23
+ {{ description }}
24
+ </p>
25
+ </a>
26
+ </div>
27
+ </div>
28
+ </template>
29
+
30
+ <script>
31
+ import CAvatar from "../CAvatar/CAvatar.vue";
32
+ export default {
33
+ name: "CCard",
34
+ components: { CAvatar },
35
+ props: {
36
+ image: {
37
+ type: Object,
38
+ },
39
+ name: {
40
+ type: String,
41
+ },
42
+ description: {
43
+ type: String,
44
+ },
45
+ },
46
+ };
47
+ </script>
48
+
49
+ <style></style>
@@ -1,3 +1,3 @@
1
- import CCard from './CCard.vue'
2
-
1
+ import CCard from './CCard.vue'
2
+
3
3
  export default CCard
@@ -1,85 +1,85 @@
1
- <template>
2
- <div>
3
- <div class="relative flex items-start">
4
- <div class="flex h-5 items-center">
5
- <input
6
- type="checkbox"
7
- v-model="checkedValue"
8
- class="h-4 w-4 cursor-pointer rounded border-gray-300 text-indigo-600 focus:ring-indigo-500 disabled:opacity-50"
9
- @click="changeValue"
10
- :disabled="isDisabled"
11
- />
12
- </div>
13
- <div
14
- class="ml-3 cursor-pointer text-sm"
15
- :class="isDisabled ? 'pointer-events-none' : ''"
16
- @click="changeValue"
17
- >
18
- <label
19
- :class="`cursor-pointer font-medium text-gray-900 ${
20
- isDisabled ? 'opacity-50' : ''
21
- } ${tag ? 'flex' : ''}`"
22
- >{{ label }}
23
- <c-tag
24
- v-if="tag && Object.keys(tag).length !== 0"
25
- :label="tag.label"
26
- :color="tag.color"
27
- :class="tag.class"
28
- class="ml-2"
29
- />
30
- </label>
31
- <p
32
- :class="`mt-0.5 cursor-pointer text-gray-500 ${
33
- isDisabled ? 'opacity-50' : ''
34
- }`"
35
- >
36
- {{ description }}
37
- </p>
38
- </div>
39
- </div>
40
- </div>
41
- </template>
42
- <script>
43
- import CTag from "../CTag/CTag.vue";
44
- export default {
45
- components: { CTag },
46
- name: "CCheckbox",
47
- props: {
48
- label: { type: String },
49
- description: { type: String },
50
- value: [Boolean, Number],
51
- isDisabled: {
52
- type: Boolean,
53
- },
54
- tag: {
55
- type: Object,
56
- },
57
- },
58
- data() {
59
- return {
60
- checkedValue: this.value == 0 ? false : true,
61
- };
62
- },
63
- methods: {
64
- changeValue() {
65
- let selectedValue = 0;
66
- if (this.checkedValue) {
67
- this.checkedValue = false;
68
- selectedValue = 0;
69
- } else if (!this.checkedValue) {
70
- this.checkedValue = true;
71
- selectedValue = 1;
72
- }
73
- this.$emit("onChange", selectedValue);
74
- },
75
- },
76
- watch: {
77
- value() {
78
- this.checkedValue = this.value;
79
- },
80
- },
81
- mounted() {
82
- this.checkedValue = this.value == 0 ? false : true;
83
- },
84
- };
85
- </script>
1
+ <template>
2
+ <div>
3
+ <div class="relative flex items-start">
4
+ <div class="flex h-5 items-center">
5
+ <input
6
+ type="checkbox"
7
+ v-model="checkedValue"
8
+ class="h-4 w-4 cursor-pointer rounded border-gray-300 text-indigo-600 focus:ring-indigo-500 disabled:opacity-50"
9
+ @click="changeValue"
10
+ :disabled="isDisabled"
11
+ />
12
+ </div>
13
+ <div
14
+ class="ml-3 cursor-pointer text-sm"
15
+ :class="isDisabled ? 'pointer-events-none' : ''"
16
+ @click="changeValue"
17
+ >
18
+ <label
19
+ :class="`cursor-pointer font-medium text-gray-900 ${
20
+ isDisabled ? 'opacity-50' : ''
21
+ } ${tag ? 'flex' : ''}`"
22
+ >{{ label }}
23
+ <c-tag
24
+ v-if="tag && Object.keys(tag).length !== 0"
25
+ :label="tag.label"
26
+ :color="tag.color"
27
+ :class="tag.class"
28
+ class="ml-2"
29
+ />
30
+ </label>
31
+ <p
32
+ :class="`mt-0.5 cursor-pointer text-gray-500 ${
33
+ isDisabled ? 'opacity-50' : ''
34
+ }`"
35
+ >
36
+ {{ description }}
37
+ </p>
38
+ </div>
39
+ </div>
40
+ </div>
41
+ </template>
42
+ <script>
43
+ import CTag from "../CTag/CTag.vue";
44
+ export default {
45
+ components: { CTag },
46
+ name: "CCheckbox",
47
+ props: {
48
+ label: { type: String },
49
+ description: { type: String },
50
+ value: [Boolean, Number],
51
+ isDisabled: {
52
+ type: Boolean,
53
+ },
54
+ tag: {
55
+ type: Object,
56
+ },
57
+ },
58
+ data() {
59
+ return {
60
+ checkedValue: this.value == 0 ? false : true,
61
+ };
62
+ },
63
+ methods: {
64
+ changeValue() {
65
+ let selectedValue = 0;
66
+ if (this.checkedValue) {
67
+ this.checkedValue = false;
68
+ selectedValue = 0;
69
+ } else if (!this.checkedValue) {
70
+ this.checkedValue = true;
71
+ selectedValue = 1;
72
+ }
73
+ this.$emit("onChange", selectedValue);
74
+ },
75
+ },
76
+ watch: {
77
+ value() {
78
+ this.checkedValue = this.value;
79
+ },
80
+ },
81
+ mounted() {
82
+ this.checkedValue = this.value == 0 ? false : true;
83
+ },
84
+ };
85
+ </script>
@@ -1,3 +1,3 @@
1
- import CCheckbox from './CCheckbox.vue'
2
-
1
+ import CCheckbox from './CCheckbox.vue'
2
+
3
3
  export default CCheckbox
@@ -1,52 +1,52 @@
1
- <template>
2
- <button
3
- type="button"
4
- :disabled="disabled"
5
- class="focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 rounded-full p-1 text-white shadow-sm disabled:opacity-50"
6
- :class="classes"
7
- @click="$emit('action')"
8
- >
9
- <c-icon
10
- :type="icon.type"
11
- :name="icon.name"
12
- :viewBox="icon.viewBox"
13
- :class="icon.class"
14
- />
15
- </button>
16
- </template>
17
-
18
- <script>
19
- import CIcon from "../CIcon/CIcon.vue";
20
- export default {
21
- components: { CIcon },
22
- name: "CCircularButton",
23
- props: {
24
- type: {
25
- type: String,
26
- default: "black",
27
- },
28
- icon: {
29
- type: Object,
30
- },
31
- disabled: {
32
- type: Boolean,
33
- default: false,
34
- },
35
- },
36
- computed: {
37
- classes() {
38
- const classNames = {
39
- "text-white hover:bg-indigo-800 bg-indigo-700 focus:ring-indigo-600":
40
- this.type == "primary",
41
- "text-white hover:bg-green-800 bg-green-700 focus:ring-green-600 ":
42
- this.type == "success",
43
- "text-white bg-gray-900 hover:bg-gray-800 focus:ring-gray-600 ":
44
- this.type == "black",
45
- "text-white hover:bg-red-800 bg-red-700 focus:ring-red-600 ":
46
- this.type == "danger",
47
- };
48
- return classNames;
49
- },
50
- },
51
- };
52
- </script>
1
+ <template>
2
+ <button
3
+ type="button"
4
+ :disabled="disabled"
5
+ class="focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 rounded-full p-1 text-white shadow-sm disabled:opacity-50"
6
+ :class="classes"
7
+ @click="$emit('action')"
8
+ >
9
+ <c-icon
10
+ :type="icon.type"
11
+ :name="icon.name"
12
+ :viewBox="icon.viewBox"
13
+ :class="icon.class"
14
+ />
15
+ </button>
16
+ </template>
17
+
18
+ <script>
19
+ import CIcon from "../CIcon/CIcon.vue";
20
+ export default {
21
+ components: { CIcon },
22
+ name: "CCircularButton",
23
+ props: {
24
+ type: {
25
+ type: String,
26
+ default: "black",
27
+ },
28
+ icon: {
29
+ type: Object,
30
+ },
31
+ disabled: {
32
+ type: Boolean,
33
+ default: false,
34
+ },
35
+ },
36
+ computed: {
37
+ classes() {
38
+ const classNames = {
39
+ "text-white hover:bg-indigo-800 bg-indigo-700 focus:ring-indigo-600":
40
+ this.type == "primary",
41
+ "text-white hover:bg-green-800 bg-green-700 focus:ring-green-600 ":
42
+ this.type == "success",
43
+ "text-white bg-gray-900 hover:bg-gray-800 focus:ring-gray-600 ":
44
+ this.type == "black",
45
+ "text-white hover:bg-red-800 bg-red-700 focus:ring-red-600 ":
46
+ this.type == "danger",
47
+ };
48
+ return classNames;
49
+ },
50
+ },
51
+ };
52
+ </script>
@@ -1,2 +1,2 @@
1
- import CCircularButton from "./CCircularButton.vue";
2
- export default CCircularButton;
1
+ import CCircularButton from "./CCircularButton.vue";
2
+ export default CCircularButton;
@@ -1,101 +1,101 @@
1
- <template>
2
- <div>
3
- <div
4
- :class="divider || showSection ? 'border-b border-gray-200 pb-2' : ''"
5
- class="flex cursor-pointer flex-row items-center justify-between"
6
- @click.self="collapse"
7
- >
8
- <!-- left and right arrow icon as per opening and closing of collapsible -->
9
- <div class="flex flex-row items-center" @click="collapse">
10
- <c-icon
11
- :name="showSection ? 'chevron-down' : 'chevron-right'"
12
- class="h-5 w-5 text-gray-900"
13
- type="solid"
14
- ></c-icon>
15
- <!-- label of the collapsible section -->
16
- <div
17
- :class="{ 'py-2': tabAction }"
18
- class="ml-1 whitespace-nowrap border-transparent text-base font-semibold text-gray-900 hover:border-gray-300 hover:text-gray-700"
19
- >
20
- {{ label }}
21
- </div>
22
- <p v-if="isRequired" class="ml-1 text-red-600">*</p>
23
- </div>
24
- <!-- tertiary button to render on right side of collapsible section -->
25
- <c-button
26
- v-if="tabAction && showSection"
27
- type="tertiary"
28
- :label="buttonLabel"
29
- @action="action"
30
- ></c-button>
31
- <!-- anchor tag to render on right side of collapsible section -->
32
- <c-anchor-tag
33
- v-if="tabLink && showSection"
34
- :label="tabLink.label"
35
- :action="action"
36
- ></c-anchor-tag>
37
- </div>
38
- <!-- content to render in collapsible section -->
39
- <div class="mt-5 text-sm text-gray-500" v-if="showSection">
40
- <slot></slot>
41
- </div>
42
- </div>
43
- </template>
44
-
45
- <script>
46
- import CIcon from "../CIcon/CIcon.vue";
47
- import CButton from "../CButton/CButton.vue";
48
- import CAnchorTag from "../CAnchorTag/CAnchorTag.vue";
49
- export default {
50
- name: "CCollapsibleSection",
51
- components: { CIcon, CButton, CAnchorTag },
52
- props: {
53
- // label of section
54
- label: {
55
- type: String,
56
- },
57
- // text to render on tertiary button
58
- buttonLabel: {
59
- type: String,
60
- },
61
- // whether to show the divider below section heading
62
- divider: {
63
- type: Boolean,
64
- },
65
- isCollapsed: {
66
- type: Boolean,
67
- default: true,
68
- },
69
- // to render button on right side of section heading
70
- tabAction: { type: Boolean },
71
- // link to render on right side of section
72
- tabLink: { type: Object },
73
- // action to emit on click of link/button
74
- action: {
75
- type: Function,
76
- },
77
- isRequired: {
78
- type: Boolean,
79
- default: false,
80
- },
81
- },
82
- data() {
83
- return {
84
- showSection: this.isCollapsed,
85
- };
86
- },
87
- methods: {
88
- collapse() {
89
- console.log("collapsing");
90
- this.showSection = !this.showSection;
91
- },
92
- },
93
- watch: {
94
- isCollapsed() {
95
- this.showSection = this.isCollapsed;
96
- },
97
- },
98
- };
99
- </script>
100
-
101
- <style></style>
1
+ <template>
2
+ <div>
3
+ <div
4
+ :class="divider || showSection ? 'border-b border-gray-200 pb-2' : ''"
5
+ class="flex cursor-pointer flex-row items-center justify-between"
6
+ @click.self="collapse"
7
+ >
8
+ <!-- left and right arrow icon as per opening and closing of collapsible -->
9
+ <div class="flex flex-row items-center" @click="collapse">
10
+ <c-icon
11
+ :name="showSection ? 'chevron-down' : 'chevron-right'"
12
+ class="h-5 w-5 text-gray-900"
13
+ type="solid"
14
+ ></c-icon>
15
+ <!-- label of the collapsible section -->
16
+ <div
17
+ :class="{ 'py-2': tabAction }"
18
+ class="ml-1 whitespace-nowrap border-transparent text-base font-semibold text-gray-900 hover:border-gray-300 hover:text-gray-700"
19
+ >
20
+ {{ label }}
21
+ </div>
22
+ <p v-if="isRequired" class="ml-1 text-red-600">*</p>
23
+ </div>
24
+ <!-- tertiary button to render on right side of collapsible section -->
25
+ <c-button
26
+ v-if="tabAction && showSection"
27
+ type="tertiary"
28
+ :label="buttonLabel"
29
+ @action="action"
30
+ ></c-button>
31
+ <!-- anchor tag to render on right side of collapsible section -->
32
+ <c-anchor-tag
33
+ v-if="tabLink && showSection"
34
+ :label="tabLink.label"
35
+ :action="action"
36
+ ></c-anchor-tag>
37
+ </div>
38
+ <!-- content to render in collapsible section -->
39
+ <div class="mt-5 text-sm text-gray-500" v-if="showSection">
40
+ <slot></slot>
41
+ </div>
42
+ </div>
43
+ </template>
44
+
45
+ <script>
46
+ import CIcon from "../CIcon/CIcon.vue";
47
+ import CButton from "../CButton/CButton.vue";
48
+ import CAnchorTag from "../CAnchorTag/CAnchorTag.vue";
49
+ export default {
50
+ name: "CCollapsibleSection",
51
+ components: { CIcon, CButton, CAnchorTag },
52
+ props: {
53
+ // label of section
54
+ label: {
55
+ type: String,
56
+ },
57
+ // text to render on tertiary button
58
+ buttonLabel: {
59
+ type: String,
60
+ },
61
+ // whether to show the divider below section heading
62
+ divider: {
63
+ type: Boolean,
64
+ },
65
+ isCollapsed: {
66
+ type: Boolean,
67
+ default: true,
68
+ },
69
+ // to render button on right side of section heading
70
+ tabAction: { type: Boolean },
71
+ // link to render on right side of section
72
+ tabLink: { type: Object },
73
+ // action to emit on click of link/button
74
+ action: {
75
+ type: Function,
76
+ },
77
+ isRequired: {
78
+ type: Boolean,
79
+ default: false,
80
+ },
81
+ },
82
+ data() {
83
+ return {
84
+ showSection: this.isCollapsed,
85
+ };
86
+ },
87
+ methods: {
88
+ collapse() {
89
+ console.log("collapsing");
90
+ this.showSection = !this.showSection;
91
+ },
92
+ },
93
+ watch: {
94
+ isCollapsed() {
95
+ this.showSection = this.isCollapsed;
96
+ },
97
+ },
98
+ };
99
+ </script>
100
+
101
+ <style></style>
@@ -1,3 +1,3 @@
1
- import CCollapsibleSection from './CCollapsibleSection.vue'
2
-
1
+ import CCollapsibleSection from './CCollapsibleSection.vue'
2
+
3
3
  export default CCollapsibleSection