@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
@@ -1,8 +1,76 @@
1
+ <script setup lang="ts">
2
+ import { defineAsyncComponent, ref, watch } from "vue";
3
+ import type { SelectedClusterType } from "../../types/cluster";
4
+
5
+ const Multiselect = defineAsyncComponent(() => import("vue-multiselect"));
6
+
7
+ interface Props {
8
+ sidebarCollapsed?: boolean;
9
+ mouseHover?: boolean;
10
+ clusterOptions?: Array<SelectedClusterType>;
11
+ modelValue?: string;
12
+ }
13
+
14
+ const props = withDefaults(defineProps<Props>(), {
15
+ sidebarCollapsed: false,
16
+ mouseHover: false,
17
+ clusterOptions: () => [],
18
+ modelValue: "",
19
+ });
20
+
21
+ const emit = defineEmits(["update:modelValue"]);
22
+
23
+ const selectedCluster = ref<SelectedClusterType | null>(null);
24
+ const selectedClusterName = ref<null | string>(null);
25
+
26
+ const getProviderIcon = (provider: string) => {
27
+ return `https://cdn.appscode.com/images/cloud-provider-icons/${provider}.png`;
28
+ };
29
+
30
+ watch(
31
+ () => props.modelValue,
32
+ (n) => {
33
+ selectedClusterName.value = n;
34
+ },
35
+ { immediate: true }
36
+ );
37
+
38
+ watch(selectedCluster, (n) => {
39
+ if (n) {
40
+ if (selectedClusterName.value !== n.name) {
41
+ selectedClusterName.value = n.name;
42
+ }
43
+ } else selectedCluster.value = null;
44
+ });
45
+
46
+ watch(selectedClusterName, (n) => {
47
+ if (n !== selectedCluster.value?.name) {
48
+ props.clusterOptions.forEach((item) => {
49
+ if (selectedClusterName.value === item.name) {
50
+ selectedCluster.value = item;
51
+ }
52
+ });
53
+ }
54
+ emit("update:modelValue", n);
55
+ });
56
+
57
+ watch(
58
+ () => props.clusterOptions,
59
+ async (list) => {
60
+ selectedCluster.value =
61
+ list.find((item) => {
62
+ return selectedClusterName.value === item.name;
63
+ }) || null;
64
+ },
65
+ { immediate: true, deep: true }
66
+ );
67
+ </script>
68
+
1
69
  <template>
2
70
  <div v-if="sidebarCollapsed" class="is-cluster-logo">
3
71
  <img
4
72
  width="40"
5
- :src="getProviderIcon(selectedCluster && selectedCluster.provider)"
73
+ :src="getProviderIcon(selectedCluster?.provider || '')"
6
74
  onerror="this.onerror=null;this.src='https://cdn.appscode.com/images/cloud-provider-icons/Generic.png';"
7
75
  alt="provider-icon"
8
76
  />
@@ -25,6 +93,7 @@
25
93
  :src="getProviderIcon(props.option.provider)"
26
94
  onerror="this.onerror=null;this.src='https://cdn.appscode.com/images/cloud-provider-icons/Generic.png';"
27
95
  alt="No cluster selected"
96
+ class="height-22 mr-8"
28
97
  /><span
29
98
  ><span>{{ props.option.displayName }}</span></span
30
99
  >
@@ -46,88 +115,4 @@
46
115
  </template>
47
116
  </multiselect>
48
117
  </template>
49
-
50
- <script>
51
- import { defineComponent, defineAsyncComponent } from 'vue'
52
- export default defineComponent({
53
- components: {
54
- Multiselect: defineAsyncComponent(() =>
55
- import('vue-multiselect').then((module) => module.default)
56
- ),
57
- },
58
- props: {
59
- sidebarCollapsed: {
60
- type: Boolean,
61
- default: false,
62
- },
63
- mouseHover: {
64
- type: Boolean,
65
- default: false,
66
- },
67
- clusterOptions: {
68
- type: Array,
69
- default: () => [],
70
- },
71
- modelValue: {
72
- type: String,
73
- default: '',
74
- },
75
- },
76
-
77
- emits: ['update:modelValue'],
78
-
79
- data() {
80
- return {
81
- selectedCluster: null,
82
- selectedClusterName: null,
83
- }
84
- },
85
-
86
- watch: {
87
- modelValue: {
88
- immediate: true,
89
- handler(n) {
90
- this.selectedClusterName = n
91
- },
92
- },
93
- selectedCluster: {
94
- deep: true,
95
- handler(n) {
96
- if (this.selectedClusterName !== n.name) {
97
- this.selectedClusterName = n.name
98
- }
99
- },
100
- },
101
- selectedClusterName(n) {
102
- if (n !== this.selectedCluster.name) {
103
- this.clusterOptions.forEach((item) => {
104
- if (this.selectedClusterName === item.name) {
105
- this.selectedCluster = item
106
- }
107
- })
108
- }
109
-
110
- this.$emit('update:modelValue', n)
111
- },
112
- clusterOptions: {
113
- deep: true,
114
- immediate: true,
115
- async handler(list) {
116
- if (list) {
117
- list.forEach((item) => {
118
- if (this.selectedClusterName === item.name) {
119
- this.selectedCluster = item
120
- }
121
- })
122
- }
123
- },
124
- },
125
- },
126
-
127
- methods: {
128
- getProviderIcon(provider) {
129
- return `https://cdn.appscode.com/images/cloud-provider-icons/${provider}.png`
130
- },
131
- },
132
- })
133
- </script>
118
+ <style lang="scss"></style>
@@ -0,0 +1,239 @@
1
+ <script setup lang="ts">
2
+ interface Props {
3
+ type?: string;
4
+ isCollapsible?: boolean;
5
+ }
6
+
7
+ withDefaults(defineProps<Props>(), {
8
+ type: "cluster-main",
9
+ });
10
+ </script>
11
+
12
+ <template>
13
+ <div class="ac-system-left-sidebar">
14
+ <!-- is-collapsed -->
15
+ <div class="ac-left-sidebar-wrapper">
16
+ <div class="ac-left-sidebar-inner">
17
+ <aside class="ac-left-sidebar">
18
+ <!-- sidebar header start -->
19
+ <slot name="sidebar-header" />
20
+ <!-- sidebar header end -->
21
+
22
+ <!-- sidebar components start -->
23
+ <slot name="sidebar-body" />
24
+ <!-- sidebar components end -->
25
+
26
+ <!-- sidebar footer -->
27
+ <slot name="sidebar-footer" />
28
+ <!-- sidebar footer -->
29
+ </aside>
30
+ <!-- sidebar top end -->
31
+ </div>
32
+ <!-- left-sidebar menu end -->
33
+ </div>
34
+ </div>
35
+ </template>
36
+
37
+ <style lang="scss">
38
+ .ac-left-sidebar-wrapper {
39
+ position: fixed;
40
+ top: 0px;
41
+ z-index: 9999;
42
+ background-color: $primary-20;
43
+ width: 250px;
44
+ transition: 0.3s ease-in-out;
45
+ }
46
+
47
+ .ac-left-sidebar {
48
+ .menu-list {
49
+ &.ac-menu-list {
50
+ height: calc(100vh - 80px);
51
+ overflow-y: auto;
52
+ padding-top: 4px;
53
+ scrollbar-color: $white-100 transparent;
54
+
55
+ /* width */
56
+ &::-webkit-scrollbar {
57
+ display: none;
58
+ }
59
+
60
+ &::-webkit-scrollbar {
61
+ display: none;
62
+ }
63
+
64
+ li {
65
+ &.is-open {
66
+ a {
67
+ &.ac-dropdown-button {
68
+ .ac-arrow-down {
69
+ transform: rotate(-180deg);
70
+ transform-origin: 5px;
71
+ }
72
+ }
73
+ }
74
+
75
+ ul {
76
+ li {
77
+ a {
78
+ strong {
79
+ font-weight: 500;
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+
86
+ a {
87
+ font-style: normal;
88
+ font-weight: 500;
89
+ font-size: 13px;
90
+ line-height: 16px;
91
+ color: $primary-97;
92
+ position: relative;
93
+ z-index: 1;
94
+ padding: 10px 15px 10px 24px;
95
+ transition: 0.3s ease-in-out;
96
+ display: flex;
97
+ align-items: center;
98
+
99
+ &:after {
100
+ position: absolute;
101
+ content: "";
102
+ left: 10px;
103
+ top: 0;
104
+ width: calc(100% - 20px);
105
+ height: 100%;
106
+ background: $primary;
107
+ border-radius: 4px;
108
+ z-index: -1;
109
+ transition: 0.3s ease-in-out;
110
+ opacity: 0;
111
+ visibility: hidden;
112
+ }
113
+
114
+ strong {
115
+ max-width: calc(100% - 65px);
116
+ // line-break: anywhere;
117
+ white-space: break-spaces;
118
+ display: flex;
119
+ align-items: center;
120
+ overflow: hidden;
121
+ font-weight: 500;
122
+ transition: 0.3s ease-in-out;
123
+ }
124
+
125
+ &.ac-dropdown-button {
126
+ user-select: none;
127
+
128
+ .ac-arrow-down {
129
+ position: absolute;
130
+ margin-right: 0;
131
+ right: 20px;
132
+ transition: transform 0.3s;
133
+ transform-origin: 4px;
134
+ color: $black-70;
135
+ }
136
+ }
137
+
138
+ &:hover {
139
+ background-color: transparent;
140
+
141
+ &:after {
142
+ color: $primary;
143
+ opacity: 0.2;
144
+ visibility: visible;
145
+ }
146
+
147
+ span {
148
+ color: $primary-97;
149
+
150
+ img {
151
+ filter: brightness(10);
152
+ }
153
+ }
154
+ }
155
+
156
+ span {
157
+ margin-right: 12px;
158
+ width: 16px;
159
+ height: 16px;
160
+ color: $black-30;
161
+ font-size: 16px;
162
+
163
+ img {
164
+ width: 100%;
165
+ filter: brightness(10);
166
+ transition: 0.3s ease-in-out;
167
+ }
168
+ }
169
+ }
170
+
171
+ ul {
172
+ max-height: 0;
173
+ transition: max-height 0.2s ease-out;
174
+ margin: 0;
175
+ padding: 0;
176
+ border-left: none;
177
+ overflow: hidden;
178
+
179
+ li {
180
+ a {
181
+ padding-left: 52px;
182
+ font-size: 12px;
183
+ padding-top: 10px;
184
+ padding-bottom: 10px;
185
+ }
186
+ }
187
+ }
188
+ }
189
+ }
190
+ a {
191
+ &.is-active {
192
+ background-color: transparent;
193
+ &::after {
194
+ opacity: 1 !important;
195
+ visibility: visible !important;
196
+ }
197
+ }
198
+ }
199
+ }
200
+ }
201
+
202
+ .sidebar-collapsed:not(.is-hoverable) {
203
+ .ac-left-sidebar-wrapper {
204
+ width: 60px;
205
+ .ac-left-sidebar {
206
+ .menu-list {
207
+ &.ac-menu-list {
208
+ li {
209
+ a {
210
+ padding: 10px 15px;
211
+ display: flex;
212
+ align-items: center;
213
+ justify-content: center;
214
+
215
+ span {
216
+ margin: 0;
217
+ }
218
+ strong {
219
+ opacity: 0;
220
+ visibility: hidden;
221
+ }
222
+ }
223
+ ul {
224
+ li {
225
+ a {
226
+ padding-left: 15px;
227
+ display: flex;
228
+ justify-content: center;
229
+ align-items: center;
230
+ }
231
+ }
232
+ }
233
+ }
234
+ }
235
+ }
236
+ }
237
+ }
238
+ }
239
+ </style>
@@ -0,0 +1,14 @@
1
+ <script setup lang="ts">
2
+ defineEmits(["hover"]);
3
+ </script>
4
+
5
+ <template>
6
+ <ul
7
+ class="menu-list ac-menu-list"
8
+ data-testid="cluster-sidebar-menu-list"
9
+ @mouseenter="$emit('hover', true)"
10
+ @mouseleave="$emit('hover', false)"
11
+ >
12
+ <slot />
13
+ </ul>
14
+ </template>
@@ -0,0 +1,89 @@
1
+ <script setup lang="ts">
2
+ import { defineAsyncComponent } from "vue";
3
+ interface Props {
4
+ isColorpickerEnabled?: boolean;
5
+ hideBorder?: boolean;
6
+ }
7
+
8
+ withDefaults(defineProps<Props>(), {
9
+ isColorpickerEnabled: false,
10
+ hideBorder: false,
11
+ });
12
+ defineEmits(["toggleSidebar"]);
13
+ const AccentColorPicker = defineAsyncComponent(
14
+ () => import("./AccentColorPicker.vue")
15
+ );
16
+ </script>
17
+
18
+ <template>
19
+ <div class="sidebar-footer" :class="{ 'b-t-n': hideBorder }">
20
+ <!-- back button -->
21
+ <button
22
+ class="back-button is-transparent"
23
+ data-testid="sidebar-footer-back-button"
24
+ @click="$emit('toggleSidebar')"
25
+ >
26
+ <svg
27
+ width="18"
28
+ height="18"
29
+ viewBox="0 0 18 18"
30
+ fill="none"
31
+ xmlns="http://www.w3.org/2000/svg"
32
+ >
33
+ <path
34
+ d="M11.25 13.5L6.75 9L11.25 4.5"
35
+ stroke="white"
36
+ stroke-width="2"
37
+ stroke-linecap="round"
38
+ stroke-linejoin="round"
39
+ />
40
+ <path
41
+ d="M16 14V4"
42
+ stroke="white"
43
+ stroke-width="2"
44
+ stroke-linecap="round"
45
+ stroke-linejoin="round"
46
+ />
47
+ </svg>
48
+ </button>
49
+ <!-- back button -->
50
+
51
+ <!-- color control -->
52
+ <div v-if="isColorpickerEnabled" class="accent-color-picker">
53
+ <accent-color-picker />
54
+ </div>
55
+ <!-- color control -->
56
+ </div>
57
+ </template>
58
+
59
+ <style lang="scss" scoped>
60
+ .sidebar-footer {
61
+ display: flex;
62
+ align-items: center;
63
+ justify-content: space-between;
64
+ height: 30px;
65
+ border-top: 1px solid #3d5e7c;
66
+
67
+ .back-button {
68
+ display: flex;
69
+ padding: 5px 16px;
70
+ cursor: pointer;
71
+ justify-content: flex-start;
72
+ width: 50%;
73
+ &:hover {
74
+ background-color: rgba(255, 255, 255, 0.1);
75
+ }
76
+ }
77
+ }
78
+ .sidebar-collapsed .ac-left-sidebar-wrapper {
79
+ .accent-color-picker {
80
+ display: none;
81
+ }
82
+ .sidebar-footer {
83
+ .back-button {
84
+ width: 100%;
85
+ transform: rotate(180deg);
86
+ }
87
+ }
88
+ }
89
+ </style>
@@ -0,0 +1,131 @@
1
+ <script setup lang="ts">
2
+ defineEmits(["toggleSidebar"]);
3
+
4
+ interface Props {
5
+ brandLogo?: string;
6
+ brandLogoAlt?: string;
7
+ url?: string;
8
+ modifierClasses?: string;
9
+ hideCollapseButton?: boolean;
10
+ }
11
+
12
+ withDefaults(defineProps<Props>(), {
13
+ brandLogo: "https://via.placeholder.com/150x35/dddddd/808080",
14
+ brandLogoAlt: "",
15
+ url: "/",
16
+ modifierClasses: "",
17
+ hideCollapseButton: false,
18
+ });
19
+ </script>
20
+ <template>
21
+ <div class="sidebar-header">
22
+ <!-- hamburger icon -->
23
+ <div
24
+ v-if="!hideCollapseButton"
25
+ class="icon hamburger-icon mr-16"
26
+ data-testid="sidebar-menu-button"
27
+ @click="$emit('toggleSidebar')"
28
+ >
29
+ <svg
30
+ width="18"
31
+ height="18"
32
+ viewBox="0 0 18 18"
33
+ fill="none"
34
+ xmlns="http://www.w3.org/2000/svg"
35
+ >
36
+ <path
37
+ d="M3 13.5L10.5 13.5"
38
+ stroke="white"
39
+ stroke-width="2"
40
+ stroke-linecap="round"
41
+ stroke-linejoin="round"
42
+ />
43
+ <path
44
+ d="M3 9L15 9"
45
+ stroke="white"
46
+ stroke-width="2"
47
+ stroke-linecap="round"
48
+ stroke-linejoin="round"
49
+ />
50
+ <path
51
+ d="M3 4.5L7.5 4.5"
52
+ stroke="white"
53
+ stroke-width="2"
54
+ stroke-linecap="round"
55
+ stroke-linejoin="round"
56
+ />
57
+ </svg>
58
+ </div>
59
+ <!-- hamburger icon -->
60
+
61
+ <!-- brand logo -->
62
+ <router-link class="is-flex brand-logo" :to="url">
63
+ <img :src="brandLogo" alt="brand-logo" :class="modifierClasses" />
64
+ </router-link>
65
+ <!-- brand logo -->
66
+ </div>
67
+ </template>
68
+
69
+ <style lang="scss" scoped>
70
+ .sidebar-collapsed:not(.is-hoverable) .ac-left-sidebar-wrapper {
71
+ .brand-logo {
72
+ display: none !important;
73
+ }
74
+ .sidebar-header {
75
+ justify-content: center;
76
+ padding: 10px;
77
+ .hamburger-icon {
78
+ margin-right: 0 !important;
79
+ }
80
+ }
81
+ }
82
+
83
+ .sidebar-header {
84
+ background-color: transparent;
85
+ border-bottom: 1px solid #2f5473;
86
+ height: 50px;
87
+ display: flex;
88
+ // justify-content: space-between;
89
+ padding: 8px 20px;
90
+ align-items: center;
91
+
92
+ .hamburger-icon {
93
+ cursor: pointer;
94
+ position: relative;
95
+ z-index: 1;
96
+ width: 32px;
97
+ height: 32px;
98
+ display: flex;
99
+ align-items: center;
100
+ justify-content: center;
101
+ border-radius: 50%;
102
+ &::after {
103
+ position: absolute;
104
+ content: "";
105
+ left: 0;
106
+ top: 0;
107
+ width: 100%;
108
+ height: 100%;
109
+ border-radius: 50%;
110
+ background-color: rgba(255, 255, 255, 0.1);
111
+ opacity: 0;
112
+ visibility: hidden;
113
+ transition: 0.3s ease-in-out;
114
+ }
115
+
116
+ &:hover {
117
+ &::after {
118
+ opacity: 1;
119
+ visibility: visible;
120
+ }
121
+ }
122
+ }
123
+ .brand-logo {
124
+ display: flex;
125
+ align-items: center;
126
+ img {
127
+ height: 30px;
128
+ }
129
+ }
130
+ }
131
+ </style>
@@ -0,0 +1,62 @@
1
+ <script setup lang="ts">
2
+ import { nextTick, watch, ref } from "vue";
3
+
4
+ interface Props {
5
+ id?: string;
6
+ title?: string;
7
+ url?: string;
8
+ isActive?: boolean;
9
+ icon?: string;
10
+ }
11
+
12
+ const props = withDefaults(defineProps<Props>(), {
13
+ id: "sidebar-id",
14
+ title: "sidebar-title",
15
+ url: "/",
16
+ isActive: false,
17
+ icon: "@/assets/images/icons/basic.svg",
18
+ });
19
+
20
+ const sidebarItem = ref<HTMLElement | null>(null);
21
+
22
+ watch(
23
+ () => props.isActive,
24
+ (n) => {
25
+ if (n) {
26
+ nextTick(() => {
27
+ setTimeout(() => {
28
+ const top =
29
+ (sidebarItem.value &&
30
+ sidebarItem.value.getBoundingClientRect().top) ||
31
+ 0;
32
+ // preventing scroll to options that are already visible
33
+ if (top > window.innerHeight - 200) {
34
+ // scroll to selected option item
35
+ sidebarItem.value?.scrollIntoView({
36
+ behavior: "smooth",
37
+ block: "center",
38
+ });
39
+ }
40
+ }, 500);
41
+ });
42
+ }
43
+ },
44
+ { immediate: true }
45
+ );
46
+ </script>
47
+
48
+ <template>
49
+ <li ref="sidebarItem">
50
+ <router-link
51
+ :id="id"
52
+ :title="title"
53
+ :to="url"
54
+ :class="{ 'is-active': isActive }"
55
+ >
56
+ <span>
57
+ <img :src="icon" alt="icon" />
58
+ </span>
59
+ <strong>{{ title }}</strong>
60
+ </router-link>
61
+ </li>
62
+ </template>