@appscode/design-system 1.1.0 → 2.0.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.
Files changed (215) hide show
  1. package/base/_video-player.scss +65 -0
  2. package/base/utilities/_all.scss +7 -5
  3. package/base/utilities/_colors.scss +377 -0
  4. package/base/utilities/_customize-bulma.scss +23 -27
  5. package/base/utilities/_extended.scss +39 -0
  6. package/base/utilities/{_default.scss → _global.scss} +192 -333
  7. package/base/utilities/_layouts.scss +19 -0
  8. package/base/utilities/_mixin.scss +11 -11
  9. package/base/utilities/_spacing.scss +96 -0
  10. package/base/utilities/_typography.scss +56 -24
  11. package/components/_ac-alert-box.scss +205 -263
  12. package/components/_ac-calendar.scss +4 -4
  13. package/components/_ac-code-highlight.scss +13 -16
  14. package/components/_ac-content-layout.scss +165 -165
  15. package/components/_ac-drag.scss +13 -13
  16. package/components/_ac-modal.scss +212 -212
  17. package/components/_ac-options.scss +122 -123
  18. package/components/_ac-select-box.scss +10 -10
  19. package/components/_ac-table.scss +503 -502
  20. package/components/_ac-tabs.scss +65 -61
  21. package/components/_ac-tags.scss +116 -116
  22. package/components/_accordion.scss +117 -0
  23. package/components/_add-card.scss +3 -3
  24. package/components/_all.scss +35 -28
  25. package/components/_app-drawer.scss +0 -134
  26. package/components/_breadcumb.scss +0 -71
  27. package/components/_buttons.scss +779 -779
  28. package/components/_card-body-wrapper.scss +5 -5
  29. package/components/_dashboard-header.scss +0 -115
  30. package/components/_direct-deploy.scss +8 -8
  31. package/components/_getkeeper.scss +110 -0
  32. package/components/_go-to-top.scss +1 -1
  33. package/components/_graph.scss +10 -10
  34. package/components/_image-upload.scss +9 -9
  35. package/components/_input-card.scss +232 -0
  36. package/components/_input.scss +573 -0
  37. package/components/_left-sidebar-menu.scss +452 -587
  38. package/components/_monaco-editor.scss +2 -2
  39. package/components/{_ac-multi-select.scss → _multi-select.scss} +89 -251
  40. package/components/_navbar.scss +786 -752
  41. package/components/_nested-list.scss +3 -3
  42. package/components/_overview-info.scss +10 -10
  43. package/components/_overview-page.scss +4 -4
  44. package/components/_pagination.scss +106 -124
  45. package/components/_payment-card.scss +21 -21
  46. package/components/_preloader.scss +1 -1
  47. package/components/_preview-modal.scss +18 -18
  48. package/components/_pricing-table.scss +14 -14
  49. package/components/_progress-bar.scss +73 -86
  50. package/components/_subscription-card.scss +22 -24
  51. package/components/_table-of-content.scss +8 -8
  52. package/components/{_ac-terminal.scss → _terminal.scss} +114 -81
  53. package/components/_tfa.scss +9 -9
  54. package/components/_transitions.scss +35 -0
  55. package/components/_widget-menu.scss +252 -257
  56. package/components/_wizard.scss +518 -793
  57. package/components/ac-toaster/_ac-toasted.scss +11 -16
  58. package/components/bbum/_activities-header.scss +1 -1
  59. package/components/bbum/_card-team.scss +12 -12
  60. package/components/bbum/_information-center.scss +21 -23
  61. package/components/bbum/_left-sidebar.scss +8 -8
  62. package/components/bbum/_mobile-desktop.scss +16 -21
  63. package/components/bbum/_post.scss +5 -5
  64. package/components/bbum/_sign-up-notification.scss +10 -10
  65. package/components/bbum/_single-post-preview.scss +29 -29
  66. package/components/bbum/_user-profile.scss +10 -10
  67. package/components/ui-builder/_ui-builder.scss +221 -31
  68. package/components/ui-builder/_vue-open-api.scss +565 -7
  69. package/icons/close-icon.svg +3 -0
  70. package/layouts/_code-preview.scss +17 -18
  71. package/main.scss +26 -10
  72. package/package.json +1 -1
  73. package/plugins/theme.js +11 -9
  74. package/plugins/vue-toaster.js +1 -1
  75. package/vue-components/images/icons/cluster-icon.svg +10 -0
  76. package/vue-components/images/icons/org-icon.svg +10 -0
  77. package/vue-components/plugins/time-convert.js +49 -0
  78. package/vue-components/types/cluster.ts +6 -0
  79. package/vue-components/types/importFlow.ts +16 -0
  80. package/vue-components/types/notification.ts +6 -0
  81. package/vue-components/types/previewYaml.ts +8 -0
  82. package/vue-components/types/table.ts +55 -0
  83. package/vue-components/types/theme.ts +10 -0
  84. package/vue-components/types/user.ts +22 -0
  85. package/vue-components/v2/banner/Banner.vue +1 -1
  86. package/vue-components/v2/button/Buttons.vue +1 -1
  87. package/vue-components/v2/card/Card.vue +1 -1
  88. package/vue-components/v2/card/OverviewCards.vue +17 -2
  89. package/vue-components/v2/content/ContentTable.vue +14 -9
  90. package/vue-components/v2/editor/FilteredFileEditor.vue +2 -2
  91. package/vue-components/v2/editor/ResourceKeyValueEditor.vue +21 -21
  92. package/vue-components/v2/icons/Ellipsis.vue +2 -1
  93. package/vue-components/v2/modal/Modal.vue +2 -6
  94. package/vue-components/v2/navbar/Appdrawer.vue +37 -12
  95. package/vue-components/v2/navbar/Navbar.vue +3 -3
  96. package/vue-components/v2/navbar/NavbarItem.vue +3 -1
  97. package/vue-components/v2/navbar/NavbarItemContent.vue +1 -1
  98. package/vue-components/v2/navbar/User.vue +5 -22
  99. package/vue-components/v2/pagination/Pagination.vue +66 -0
  100. package/vue-components/v2/sidebar/SidebarItem.vue +10 -7
  101. package/{components/_ac-accordion.scss → vue-components/v3/accordion/Accordion.vue} +40 -6
  102. package/vue-components/v3/alert/Alert.vue +238 -0
  103. package/vue-components/v3/alert/Toast.vue +79 -0
  104. package/vue-components/v3/banner/Banner.vue +10 -0
  105. package/vue-components/v3/breadcrumbs/Breadcrumb.vue +166 -0
  106. package/vue-components/v3/button/Button.vue +110 -57
  107. package/vue-components/v3/button/Buttons.vue +22 -0
  108. package/vue-components/v3/button/DownloadBtn.vue +31 -0
  109. package/vue-components/v3/cards/Card.vue +32 -0
  110. package/vue-components/v3/cards/CardContent.vue +7 -0
  111. package/vue-components/v3/cards/CardHeader.vue +14 -0
  112. package/vue-components/v3/cards/Cards.vue +7 -0
  113. package/vue-components/v3/cards/Cluster.vue +159 -0
  114. package/vue-components/v3/cards/Counter.vue +39 -0
  115. package/vue-components/v3/cards/FeatureCard.vue +67 -0
  116. package/vue-components/v3/cards/FeatureCards.vue +6 -0
  117. package/vue-components/v3/cards/InfoCard.vue +242 -0
  118. package/vue-components/v3/cards/Monitoring.vue +90 -0
  119. package/vue-components/v3/cards/OrgClusterCard.vue +86 -0
  120. package/vue-components/v3/cards/OverviewCard.vue +28 -0
  121. package/vue-components/v3/cards/OverviewCards.vue +39 -0
  122. package/vue-components/v3/cards/Payment.vue +62 -0
  123. package/vue-components/v3/cards/Vendor.vue +89 -0
  124. package/vue-components/v3/content/ContentHeader.vue +39 -30
  125. package/vue-components/v3/content/ContentLayout.vue +20 -0
  126. package/vue-components/v3/content/ContentTable.vue +44 -58
  127. package/vue-components/v3/dropdown/DropdownAction.vue +95 -0
  128. package/vue-components/v3/dropdown/DropdownDivider.vue +2 -0
  129. package/vue-components/v3/dropdown/DropdownItem.vue +2 -0
  130. package/vue-components/v3/dropdown/DropdownMenu.vue +85 -91
  131. package/vue-components/v3/editor/Editor.vue +117 -115
  132. package/vue-components/v3/editor/FilteredFileEditor.vue +325 -128
  133. package/vue-components/v3/editor/ResourceKeyValueEditor.vue +73 -94
  134. package/vue-components/v3/footer/FooterArea.vue +40 -0
  135. package/vue-components/v3/footer/FooterItem.vue +32 -0
  136. package/vue-components/v3/footer/FooterItems.vue +15 -0
  137. package/vue-components/v3/footer/Info.vue +25 -0
  138. package/vue-components/v3/footer/Status.vue +43 -0
  139. package/vue-components/v3/footer/Usage.vue +34 -0
  140. package/vue-components/v3/form/Form.vue +24 -36
  141. package/vue-components/v3/form/FormFooter.vue +24 -0
  142. package/vue-components/v3/form/FormFooterControl.vue +7 -0
  143. package/vue-components/v3/form/FormFooterControls.vue +7 -0
  144. package/vue-components/v3/form-fields/AcSingleInput.vue +21 -0
  145. package/vue-components/v3/form-fields/FileUpload.vue +89 -0
  146. package/vue-components/v3/form-fields/Input.vue +19 -15
  147. package/vue-components/v3/header/Header.vue +120 -26
  148. package/vue-components/v3/header/HeaderItem.vue +18 -0
  149. package/vue-components/v3/header/HeaderItems.vue +4 -0
  150. package/vue-components/v3/icons/Ellipsis.vue +2 -0
  151. package/vue-components/v3/loaders/ClusterSwitcherLoader.vue +13 -0
  152. package/vue-components/v3/loaders/InfoCardLoader.vue +19 -0
  153. package/vue-components/v3/loaders/ResourceLoader.vue +4 -12
  154. package/vue-components/v3/loaders/SidebarLoader.vue +4 -12
  155. package/vue-components/v3/loaders/SingleInfoCardLoader.vue +24 -0
  156. package/vue-components/v3/modal/Modal.vue +294 -95
  157. package/vue-components/v3/modals/DeleteConfirmationModal.vue +37 -50
  158. package/vue-components/v3/modals/JsonShowModal.vue +63 -68
  159. package/vue-components/v3/navbar/Appdrawer.vue +198 -51
  160. package/vue-components/v3/navbar/Navbar.vue +139 -0
  161. package/vue-components/v3/navbar/NavbarItem.vue +103 -0
  162. package/vue-components/v3/navbar/NavbarItemContent.vue +282 -0
  163. package/vue-components/v3/navbar/Notification.vue +207 -0
  164. package/vue-components/v3/navbar/ThemeMode.vue +128 -112
  165. package/vue-components/v3/navbar/User.vue +394 -267
  166. package/vue-components/v3/notification/AlertBox.vue +266 -39
  167. package/vue-components/v3/notification/Notification.vue +50 -44
  168. package/vue-components/v3/notification/NotificationItem.vue +51 -19
  169. package/vue-components/v3/option-dots/Options.vue +197 -0
  170. package/vue-components/v3/pagination/Pagination.vue +216 -102
  171. package/vue-components/v3/preloader/Preloader.vue +23 -0
  172. package/vue-components/v3/searchbars/SearchBar.vue +50 -34
  173. package/vue-components/v3/sidebar/AccentColorPicker.vue +97 -0
  174. package/vue-components/v3/sidebar/ClusterSwitcher.vue +71 -86
  175. package/vue-components/v3/sidebar/Sidebar.vue +239 -0
  176. package/vue-components/v3/sidebar/SidebarBody.vue +14 -0
  177. package/vue-components/v3/sidebar/SidebarFooter.vue +89 -0
  178. package/vue-components/v3/sidebar/SidebarHeader.vue +131 -0
  179. package/vue-components/v3/sidebar/SidebarItem.vue +62 -0
  180. package/vue-components/v3/sidebar/SidebarItemWithDropDown.vue +101 -104
  181. package/vue-components/v3/sidebar/SidebarMenuList.vue +9 -0
  182. package/vue-components/v3/sidebar/Steps.vue +152 -0
  183. package/vue-components/v3/sidebar/sidebar-tabs/SidebarTabs.vue +204 -0
  184. package/vue-components/v3/sidebar/sidebar-tabs/SidebarTabsLayout.vue +44 -0
  185. package/vue-components/v3/sidebar/sidebar-tabs/TabsContent.vue +99 -0
  186. package/vue-components/v3/tab/TabItem.vue +10 -12
  187. package/vue-components/v3/tab/Tabs.vue +36 -0
  188. package/vue-components/v3/tab/TabsBody.vue +7 -0
  189. package/vue-components/v3/table/EmptyTableInfo.vue +8 -0
  190. package/vue-components/v3/table/FakeTableCell.vue +22 -31
  191. package/vue-components/v3/table/InfoTable.vue +89 -61
  192. package/vue-components/v3/table/MultiInfoTable.vue +72 -95
  193. package/vue-components/v3/table/Table.vue +596 -157
  194. package/vue-components/v3/table/TableCell.vue +13 -24
  195. package/vue-components/v3/table/TableContainer.vue +50 -28
  196. package/vue-components/v3/table/TableRow.vue +65 -87
  197. package/vue-components/v3/table/table-cell/ArrayCell.vue +94 -103
  198. package/vue-components/v3/table/table-cell/CellValue.vue +74 -106
  199. package/vue-components/v3/table/table-cell/GenericCell.vue +43 -42
  200. package/vue-components/v3/table/table-cell/ObjectCell.vue +91 -101
  201. package/vue-components/v3/table/table-cell/ValueWithModal.vue +22 -31
  202. package/vue-components/v3/tabs/EditorTabs.vue +18 -24
  203. package/vue-components/v3/tag/Tag.vue +16 -12
  204. package/vue-components/v3/tag/Tags.vue +7 -0
  205. package/base/utilities/_derived-variables.scss +0 -25
  206. package/base/utilities/_initial-variables.scss +0 -215
  207. package/base/utilities/dark-theme.scss +0 -26
  208. package/components/_ac-card.scss +0 -597
  209. package/components/_ac-input.scss +0 -876
  210. package/mixins/stickyContent.js +0 -141
  211. package/plugins/caching.ts +0 -243
  212. package/vue-components/v3/long-running-tasks/LongRunningTaskItem.vue +0 -92
  213. package/vue-components/v3/modals/LongRunningTasksModal.vue +0 -400
  214. package/vue-components/v3/terminal/LongRunningTaskTerminal.vue +0 -148
  215. /package/components/{_ac-report.scss → _report.scss} +0 -0
@@ -0,0 +1,238 @@
1
+ <script setup lang="ts">
2
+ interface Props {
3
+ modifierClasses?: string;
4
+ }
5
+
6
+ withDefaults(defineProps<Props>(), {
7
+ modifierClasses: "",
8
+ });
9
+ </script>
10
+
11
+ <template>
12
+ <div :class="modifierClasses" class="ac-notification">
13
+ <p>
14
+ <slot />
15
+ </p>
16
+ </div>
17
+ </template>
18
+
19
+ <style lang="scss" scoped>
20
+ // for alert message
21
+ .ac-notification {
22
+ background-color: #dee7f5;
23
+ font-size: 13px;
24
+ color: $primary;
25
+ min-height: 36px;
26
+ display: flex;
27
+ align-items: center;
28
+ padding: 8px 16px;
29
+ overflow: hidden;
30
+ border: 1px solid $primary;
31
+ border-radius: 4px;
32
+ justify-content: flex-start;
33
+ position: relative;
34
+ z-index: 1;
35
+ min-width: 280px;
36
+
37
+ p {
38
+ color: $primary;
39
+
40
+ .close-icon {
41
+ padding-right: 10px;
42
+ font-size: 15px;
43
+ }
44
+
45
+ a {
46
+ text-decoration: underline;
47
+ color: $primary;
48
+
49
+ &:hover {
50
+ color: hsla(
51
+ var(--hsl-hue),
52
+ var(--hsl-saturation),
53
+ calc(var(--hsl-lightness) - 10%),
54
+ 1
55
+ );
56
+ }
57
+ }
58
+ }
59
+
60
+ button.close {
61
+ background-color: transparent;
62
+ cursor: pointer;
63
+ right: 0px;
64
+ position: absolute;
65
+ box-shadow: none;
66
+ border: none;
67
+ font-size: 14px;
68
+ color: $danger;
69
+ width: 40px;
70
+ height: 100%;
71
+ display: flex;
72
+ align-items: center;
73
+ justify-content: center;
74
+ }
75
+ }
76
+
77
+ // mixin for .ac-notification
78
+ @mixin acNotification($colorName) {
79
+ background-color: scale-color($color: $colorName, $lightness: 80%);
80
+ color: $white-100;
81
+ border-color: $colorName;
82
+
83
+ p {
84
+ color: $colorName;
85
+
86
+ a {
87
+ color: $colorName;
88
+
89
+ &:hover {
90
+ color: $colorName;
91
+ opacity: 0.8;
92
+ }
93
+ }
94
+ }
95
+ }
96
+ @mixin acPrimaryNotification() {
97
+ background-color: hsla(
98
+ var(--hsl-hue),
99
+ var(--hsl-saturation),
100
+ var(--hsl-lightness),
101
+ 0.2
102
+ );
103
+ color: $white-100;
104
+ border-color: $primary;
105
+
106
+ p {
107
+ color: $primary;
108
+
109
+ a {
110
+ color: $primary;
111
+
112
+ &:hover {
113
+ color: $primary;
114
+ opacity: 0.8;
115
+ }
116
+ }
117
+ }
118
+ }
119
+
120
+ // is-primary
121
+ .ac-notification.is-primary {
122
+ @include acPrimaryNotification();
123
+ }
124
+
125
+ // is.info
126
+ .ac-notification.is-info {
127
+ @include acNotification($info);
128
+ }
129
+
130
+ // is.success
131
+ .ac-notification.is-success {
132
+ @include acNotification($success);
133
+ }
134
+
135
+ // is-danger
136
+ .ac-notification.is-danger {
137
+ @include acNotification($danger);
138
+ }
139
+
140
+ // is-warning
141
+ .ac-notification.is-warning {
142
+ @include acNotification($warning);
143
+ }
144
+
145
+ /*====================================
146
+ AC Toast
147
+ =====================================*/
148
+
149
+ .ac-toast {
150
+ width: 350px;
151
+ display: flex;
152
+ align-items: center;
153
+ justify-content: space-between;
154
+ font-size: 13px;
155
+ border-radius: 4px;
156
+ position: relative;
157
+ padding-right: 30px;
158
+ margin-bottom: 10px;
159
+
160
+ * {
161
+ color: $white-100;
162
+ }
163
+
164
+ p {
165
+ padding-left: 16px;
166
+
167
+ i.fa {
168
+ padding-right: 0 !important;
169
+ margin-right: 4px;
170
+ }
171
+ }
172
+
173
+ a {
174
+ font-weight: 500;
175
+ text-decoration: underline;
176
+ padding: 0 15px;
177
+
178
+ &:hover {
179
+ color: $black-70;
180
+ }
181
+ }
182
+
183
+ button.close-button {
184
+ border-radius: 0px;
185
+ background-color: transparent;
186
+ border: none;
187
+ color: $white-100;
188
+ position: absolute;
189
+ right: 0;
190
+ top: 0;
191
+ padding: 5px;
192
+ height: 100%;
193
+ width: 30px;
194
+ z-index: 1;
195
+ cursor: pointer;
196
+ border-left: 1px solid #dddddd;
197
+ }
198
+ }
199
+
200
+ // mixin for .ac-toast
201
+ @mixin acToast($colorName) {
202
+ background-color: $colorName;
203
+ color: $white-100;
204
+ border-color: $colorName;
205
+ }
206
+
207
+ // is-primary
208
+ .ac-toast.is-primary {
209
+ @include acToast($primary);
210
+ }
211
+
212
+ // is-info
213
+ .ac-toast.is-info {
214
+ @include acToast($info);
215
+ }
216
+
217
+ // is.success
218
+ .ac-toast.is-success {
219
+ @include acToast($success);
220
+ }
221
+
222
+ // is-danger
223
+ .ac-toast.is-danger {
224
+ @include acToast($danger);
225
+ }
226
+
227
+ // is-warning
228
+ .ac-toast.is-warning {
229
+ @include acToast($warning);
230
+ }
231
+
232
+ // dark theme start
233
+ // .is-dark-theme {
234
+ // .ac-notification.is-danger {
235
+ // background-color: $black-80;
236
+ // }
237
+ // }
238
+ </style>
@@ -0,0 +1,79 @@
1
+ <script setup lang="ts">
2
+ interface Props {
3
+ modifierClasses?: string;
4
+ }
5
+
6
+ withDefaults(defineProps<Props>(), {
7
+ modifierClasses: "",
8
+ });
9
+ </script>
10
+
11
+ <template>
12
+ <div class="toast" :class="modifierClasses">
13
+ <div class="toast-header is-flex is-align-items-center">
14
+ <h6 class="mr-auto">Toast Header</h6>
15
+ <small>2 hours ago</small>
16
+ <button
17
+ type="button"
18
+ class="button ac-button is-transparent w-18 h-18 flex ml-8"
19
+ >
20
+ <span class="material-icons close-icon is-size-5">close</span>
21
+ </button>
22
+ </div>
23
+ <div class="toast-body">
24
+ <slot />
25
+ </div>
26
+ </div>
27
+ </template>
28
+ <style lang="scss" scoped>
29
+ .ac-toast {
30
+ width: 350px;
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: space-between;
34
+ font-size: 13px;
35
+ border-radius: 4px;
36
+ position: relative;
37
+ padding-right: 30px;
38
+ margin-bottom: 10px;
39
+
40
+ * {
41
+ color: $white-100;
42
+ }
43
+
44
+ p {
45
+ padding-left: 16px;
46
+
47
+ i.fa {
48
+ padding-right: 0 !important;
49
+ margin-right: 4px;
50
+ }
51
+ }
52
+
53
+ a {
54
+ font-weight: 500;
55
+ text-decoration: underline;
56
+ padding: 0 15px;
57
+
58
+ &:hover {
59
+ color: $black-90;
60
+ }
61
+ }
62
+
63
+ button.close-button {
64
+ border-radius: 0px;
65
+ background-color: transparent;
66
+ border: none;
67
+ color: $white-100;
68
+ position: absolute;
69
+ right: 0;
70
+ top: 0;
71
+ padding: 5px;
72
+ height: 100%;
73
+ width: 30px;
74
+ z-index: 1;
75
+ cursor: pointer;
76
+ border-left: 1px solid #dddddd;
77
+ }
78
+ }
79
+ </style>
@@ -0,0 +1,10 @@
1
+ <script setup lang="ts"></script>
2
+
3
+ <template>
4
+ <div class="sign-up-notification mb-20">
5
+ <div class="has-text-centered">
6
+ <h3 class="has-text-danger"><slot name="banner-title">Error!</slot></h3>
7
+ <slot><p>Oops!! There was an error while loading!</p></slot>
8
+ </div>
9
+ </div>
10
+ </template>
@@ -0,0 +1,166 @@
1
+ <script setup lang="ts">
2
+ import { watch, ref } from "vue";
3
+ import { useRoute } from "vue-router";
4
+
5
+ interface BreadCrumbType {
6
+ name: string;
7
+ path: string;
8
+ }
9
+
10
+ const list = ref<Array<BreadCrumbType>>([]);
11
+
12
+ const route = useRoute();
13
+
14
+ const pathReplaceWithParam = (path: string) => {
15
+ //Split the path and remove the first and last empty block
16
+ let splitPath = path.split("/").filter((element) => element !== "");
17
+
18
+ //Replace all element with query params where the element start with ":"
19
+ // Then again add them wthi "/" and return the path value
20
+ return splitPath.reduce((pval, cval) => {
21
+ if (cval[0] === ":") {
22
+ const cutIndex =
23
+ cval.indexOf("?") !== -1 ? cval.indexOf("?") : cval.length;
24
+ return (pval += route.params[cval.slice(1, cutIndex)] + "/");
25
+ } else return (pval += cval + "/");
26
+ }, "/");
27
+ };
28
+
29
+ const createVal = (startIdx: number, paths: Array<string>) => {
30
+ return paths.reduce((prev, curr, idx) => {
31
+ if (idx >= startIdx) {
32
+ if (idx + 1 === paths.length) return (prev += curr);
33
+ else return (prev += curr + " / ");
34
+ } else return prev + "";
35
+ }, "");
36
+ };
37
+
38
+ const createList = (paths: Array<string>) => {
39
+ //Split all the path and remove all empty block
40
+ let spath = paths.map((element) => {
41
+ return element.split("/").filter((word) => word !== "");
42
+ });
43
+
44
+ // Convert all the path arry in one arry where each element is the different fo previous element
45
+ return spath.reduce((prev, curr, currentIdx) => {
46
+ if (currentIdx === 0) return prev.concat([createVal(0, curr)]);
47
+ else return prev.concat([createVal(spath[currentIdx - 1].length, curr)]);
48
+ }, []);
49
+ };
50
+
51
+ const createBreadcrumbs = () => {
52
+ //Adding dynamic path to the route
53
+ const listPaths = route.matched.map((element) =>
54
+ pathReplaceWithParam(element.path)
55
+ );
56
+
57
+ // If there is duplicate value in arrays last element remove it
58
+ const length = listPaths.length;
59
+ if (length > 1 && listPaths[length - 1] === listPaths[length - 2])
60
+ listPaths.pop();
61
+
62
+ //Createing the breadcrumb name
63
+ const listName = createList(listPaths);
64
+
65
+ //Set the new breadcrumb name and path value to list
66
+ list.value = listName.map((element, index) => {
67
+ return {
68
+ name: element,
69
+ path: listPaths[index],
70
+ };
71
+ });
72
+ };
73
+
74
+ watch(
75
+ () => route.path,
76
+ () => {
77
+ createBreadcrumbs();
78
+ },
79
+ {
80
+ immediate: true,
81
+ deep: true,
82
+ }
83
+ );
84
+ </script>
85
+
86
+ <template>
87
+ <div class="ac-breadcrumb">
88
+ <nav aria-label="breadcrumbs" class="breadcrumb">
89
+ <ul>
90
+ <li
91
+ v-for="(item, idx) in list"
92
+ :key="idx"
93
+ :class="{ 'is-active': idx === list.length - 1 }"
94
+ >
95
+ <router-link
96
+ class="router-link-active"
97
+ :class="{ 'is-active': idx === list.length - 1 }"
98
+ :to="item.path"
99
+ >
100
+ <span v-if="idx === 0" class="icon is-flex-start p-0 m-0">
101
+ <svg
102
+ width="12"
103
+ height="12"
104
+ viewBox="0 0 12 12"
105
+ fill="none"
106
+ xmlns="http://www.w3.org/2000/svg"
107
+ >
108
+ <path
109
+ d="M1 4.5L5.5 1L10 4.5V10C10 10.2652 9.89464 10.5196 9.70711 10.7071C9.51957 10.8946 9.26522 11 9 11H2C1.73478 11 1.48043 10.8946 1.29289 10.7071C1.10536 10.5196 1 10.2652 1 10V4.5Z"
110
+ stroke="#666666"
111
+ stroke-width="1.5"
112
+ stroke-linecap="round"
113
+ stroke-linejoin="round"
114
+ />
115
+ <path
116
+ d="M4 11V6H7V11"
117
+ stroke="#666666"
118
+ stroke-width="1.5"
119
+ stroke-linecap="round"
120
+ stroke-linejoin="round"
121
+ />
122
+ </svg>
123
+ </span>
124
+ {{ item.name }}
125
+ </router-link>
126
+ </li>
127
+ </ul>
128
+ </nav>
129
+ </div>
130
+ </template>
131
+
132
+ <style lang="scss" scoped>
133
+ /* breadcumb style */
134
+ .ac-breadcrumb {
135
+ padding: 8px 20px;
136
+ border-bottom: 1px solid $primary-95;
137
+ position: sticky;
138
+ top: 50px;
139
+ height: auto;
140
+ background-color: $white-100;
141
+ z-index: 998;
142
+ display: flex;
143
+ align-items: center;
144
+ }
145
+
146
+ .breadcrumb {
147
+ a {
148
+ color: $primary-20;
149
+ font-size: 13px;
150
+ padding: 0 3px;
151
+ font-weight: 500;
152
+ font-style: normal;
153
+
154
+ &:hover {
155
+ color: $primary-10;
156
+ }
157
+ }
158
+
159
+ li.is-active {
160
+ a {
161
+ color: $primary-10;
162
+ font-weight: 500;
163
+ }
164
+ }
165
+ }
166
+ </style>
@@ -1,78 +1,131 @@
1
+ <script setup lang="ts">
2
+ import { computed } from "vue";
3
+
4
+ interface Props {
5
+ title?: string;
6
+ tooltip?: string;
7
+ isLoaderActive?: boolean;
8
+ disabled?: boolean;
9
+ iconClass?: string;
10
+ iconImage?: string;
11
+ iconImageWidth?: number;
12
+ modifierClasses?: string;
13
+ titleModifierClass?: string;
14
+ }
15
+
16
+ const props = withDefaults(defineProps<Props>(), {
17
+ title: "",
18
+ tooltip: undefined,
19
+ isLoaderActive: false,
20
+ disabled: false,
21
+ iconClass: "",
22
+ iconImage: "",
23
+
24
+ iconImageWidth: undefined,
25
+ modifierClasses: "is-primary",
26
+ titleModifierClass: "",
27
+ });
28
+
29
+ const emit = defineEmits(["click"]);
30
+
31
+ const handleClick = (e: Event) => {
32
+ if (!props.disabled) emit("click", e);
33
+ };
34
+
35
+ const showUnpluginIcon = computed(() => {
36
+ if (props.iconClass.includes("unplugin")) return true;
37
+ else return false;
38
+ });
39
+ </script>
40
+
1
41
  <template>
2
42
  <button
3
- class="button ac-button is-extra-small"
43
+ class="button ac-button"
4
44
  :class="`${modifierClasses}${isLoaderActive ? ' is-loading' : ''}`"
5
- :disabled="disabled ? true : null"
45
+ :disabled="disabled ? true : undefined"
6
46
  @click="handleClick"
7
47
  :title="tooltip"
8
48
  >
9
- <span v-if="iconClass || iconImage" class="icon is-small">
49
+ <span
50
+ v-if="iconClass || iconImage"
51
+ class="icon is-small"
52
+ :class="showUnpluginIcon ? iconClass : ''"
53
+ >
10
54
  <img
11
55
  v-if="iconImage"
12
56
  :src="iconImage"
13
57
  alt="icon"
14
58
  :width="iconImageWidth"
15
59
  />
60
+
61
+ <slot name="icon" v-else-if="showUnpluginIcon" />
62
+
16
63
  <i v-else :class="`fa fa-${iconClass}`" aria-hidden="true" />
17
64
  </span>
65
+
18
66
  <span v-if="title" :class="titleModifierClass">{{ title }}</span>
19
67
  <slot />
20
68
  </button>
21
69
  </template>
22
70
 
23
- <script>
24
- import { defineComponent } from "vue";
25
- export default defineComponent({
26
- props: {
27
- // button title
28
- title: {
29
- type: String,
30
- default: "",
31
- },
32
- tooltip: {
33
- type: String,
34
- defualt: undefined
35
- },
36
- // for loader
37
- isLoaderActive: {
38
- type: Boolean,
39
- default: false,
40
- },
41
- // for disability
42
- disabled: {
43
- type: Boolean,
44
- default: false,
45
- },
46
- // for icon
47
- iconClass: {
48
- type: String,
49
- default: "",
50
- },
51
- iconImage: {
52
- type: String,
53
- default: "",
54
- },
55
- iconImageWidth: {
56
- type: Number,
57
- default: undefined,
58
- },
59
- // modifier class
60
- modifierClasses: {
61
- type: String,
62
- default: "is-primary",
63
- },
64
- titleModifierClass: {
65
- type: String,
66
- default: "",
67
- },
68
- },
71
+ <style lang="scss" scoped>
72
+ .button {
73
+ &.ac-button {
74
+ padding: 8px 16px;
75
+ font-weight: 500;
76
+ line-height: 1;
69
77
 
70
- emits: ["click"],
78
+ &.is-primary {
79
+ &.is-light {
80
+ color: $primary;
81
+ &:focus:not(:hover) {
82
+ color: inherit;
83
+ }
84
+ }
85
+ }
86
+ &.is-warning {
87
+ &.is-light {
88
+ color: $yellow-30;
89
+ &:focus:not(:hover) {
90
+ color: inherit;
91
+ }
92
+ }
93
+ }
71
94
 
72
- methods: {
73
- handleClick(e) {
74
- if (!this.disabled) this.$emit("click", e);
75
- },
76
- },
77
- });
78
- </script>
95
+ &.is-success {
96
+ &.is-light {
97
+ color: $green-30;
98
+ &:focus:not(:hover) {
99
+ color: inherit;
100
+ }
101
+ }
102
+ }
103
+ &.is-light {
104
+ &.is-loading {
105
+ &::after {
106
+ border-color: transparent transparent #1c1c1c #1c1c1c !important;
107
+ }
108
+ }
109
+ &.is-outlined {
110
+ &:hover {
111
+ border-color: inherit;
112
+ }
113
+ }
114
+ }
115
+
116
+ &.is-small {
117
+ padding: 4px 12px;
118
+ &:not(.is-rounded) {
119
+ border-radius: 4px;
120
+ }
121
+ }
122
+ &.is-medium {
123
+ font-size: 1rem;
124
+ height: 36px;
125
+ }
126
+ }
127
+ }
128
+ button.is-primary {
129
+ background-color: $primary;
130
+ }
131
+ </style>
@@ -0,0 +1,22 @@
1
+ <script setup lang="ts">
2
+ withDefaults(
3
+ defineProps<{
4
+ isMaxWidth?: boolean;
5
+ }>(),
6
+ { isMaxWidth: false }
7
+ );
8
+ </script>
9
+ <template>
10
+ <div v-if="isMaxWidth" :style="{ width: 'max-content' }" class="buttons">
11
+ <slot />
12
+ </div>
13
+ <div v-else class="buttons"><slot /></div>
14
+ </template>
15
+
16
+ <!-- <style lang="scss">
17
+ .buttons {
18
+ .button {
19
+ margin-bottom: 16px;
20
+ }
21
+ }
22
+ </style> -->