@appscode/design-system 2.2.62 → 2.2.64

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.
package/main.scss CHANGED
@@ -20,6 +20,7 @@
20
20
  // @import "@/components/vue-components/styles/components/all";
21
21
  @import "@/components/vue-components/styles/components/button";
22
22
  @import "@/components/vue-components/styles/components/terminal";
23
+ @import "@/components/vue-components/styles/components/code-preview/all";
23
24
  @import "@/components/vue-components/styles/components/form-fields/input";
24
25
  @import "@/components/vue-components/styles/components/ui-builder/vue-open-api";
25
26
  @import "@/components/vue-components/styles/components/ui-builder/ui-builder";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "2.2.62",
3
+ "version": "2.2.64",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -2,6 +2,7 @@
2
2
  @import "alert/all";
3
3
  @import "cards/all";
4
4
  @import "content/all";
5
+ @import "code-preview/all";
5
6
  @import "editor/all";
6
7
  @import "form-fields/all";
7
8
  @import "header/all";
@@ -0,0 +1 @@
1
+ @import "./_code-preview.scss";
@@ -0,0 +1,42 @@
1
+ .code-container {
2
+ position: relative;
3
+ z-index: 1;
4
+ &:has(.head) {
5
+ &::after {
6
+ display: none;
7
+ }
8
+ pre {
9
+ border-radius: 0px;
10
+ }
11
+ }
12
+
13
+ pre {
14
+ border-radius: 4px;
15
+ border: 1px solid $color-border;
16
+ font-size: 12px;
17
+ white-space: normal;
18
+ }
19
+
20
+ .buttons {
21
+ position: relative;
22
+
23
+ &:not(.head .buttons) {
24
+ position: absolute;
25
+ content: "";
26
+ right: 8px;
27
+ top: 8px;
28
+ z-index: 3;
29
+ &:after {
30
+ position: absolute;
31
+ content: "";
32
+ right: -7px;
33
+ top: -7px;
34
+ width: 100%;
35
+ height: 40px;
36
+ border-radius: 4px;
37
+ background-color: #f5f5f5;
38
+ z-index: -1;
39
+ }
40
+ }
41
+ }
42
+ }
@@ -3,5 +3,5 @@
3
3
  border-bottom: 1px solid $color-border;
4
4
  position: sticky;
5
5
  background: $white-100;
6
- z-index: 99;
6
+ z-index: 999;
7
7
  }
@@ -0,0 +1,28 @@
1
+ <script setup lang="ts">
2
+ import { defineAsyncComponent } from "vue";
3
+
4
+ interface Props {
5
+ spacing?: string;
6
+ downloadBtn?: boolean;
7
+ copyBtn?: boolean;
8
+ }
9
+
10
+ withDefaults(defineProps<Props>(), {
11
+ spacing: "pr-48",
12
+ downloadBtn: false,
13
+ copyBtn: true,
14
+ });
15
+
16
+ const AcButton = defineAsyncComponent(() => import("@/components/vue-components/v3/button/Button.vue"));
17
+ </script>
18
+ <template>
19
+ <div class="code-container p-0">
20
+ <pre class="ac-hscrollbar" :class="spacing">
21
+ <slot name="code"/>
22
+ </pre>
23
+ <div class="buttons">
24
+ <ac-button v-if="downloadBtn" modifier-classes="is-primary small-button" icon-class="download" />
25
+ <ac-button v-if="copyBtn" modifier-classes="is-primary small-button" icon-class="copy" />
26
+ </div>
27
+ </div>
28
+ </template>
@@ -0,0 +1,32 @@
1
+ <script setup lang="ts">
2
+ import { defineAsyncComponent } from "vue";
3
+
4
+ interface Props {
5
+ spacing?: string;
6
+ copyBtn?: boolean;
7
+ }
8
+
9
+ withDefaults(defineProps<Props>(), {
10
+ spacing: "pr-48",
11
+ copyBtn: true,
12
+ });
13
+
14
+ const AcButton = defineAsyncComponent(() => import("@/components/vue-components/v3/button/Button.vue"));
15
+ </script>
16
+ <template>
17
+ <div class="code-container p-0 b-1 is-rounded-4">
18
+ <div class="head is-flex is-justify-content-space-between is-align-items-center pt-7 px-4 b-b-1">
19
+ <div><slot name="left" /></div>
20
+ <ac-button
21
+ title="Copy"
22
+ v-if="copyBtn"
23
+ data-testid="kubeconfig-copy-button"
24
+ modifier-classes="is-outlined small-button mb-6"
25
+ icon-class="copy"
26
+ />
27
+ </div>
28
+ <pre class="ac-hscrollbar is-border-none">
29
+ <slot name="code"/>
30
+ </pre>
31
+ </div>
32
+ </template>
@@ -1,5 +1,6 @@
1
1
  <script setup lang="ts">
2
- import { defineAsyncComponent } from "vue";
2
+ import DialogModal from "./DialogModal.vue";
3
+ import AcButton from "./../button/Button.vue";
3
4
 
4
5
  interface Props {
5
6
  title?: string;
@@ -23,24 +24,25 @@ withDefaults(defineProps<Props>(), {
23
24
  hideActionFooter: false,
24
25
  });
25
26
 
26
- defineEmits(["onDelete"]);
27
+ const emit = defineEmits(["onDelete", "onCloseModal"]);
27
28
 
28
29
  const open = defineModel({ type: Boolean });
29
30
 
30
- const Modal = defineAsyncComponent(() => import("./DialogModal.vue"));
31
- const AcButton = defineAsyncComponent(() => import("./../button/Button.vue"));
31
+ function onClose() {
32
+ open.value = false;
33
+ emit("onCloseModal");
34
+ }
32
35
  </script>
33
36
 
34
37
  <template>
35
- <!-- modal start -->
36
-
37
- <modal
38
+ <dialog-modal
38
39
  v-model="open"
39
40
  :title="title"
40
41
  :class="modifierClasses"
41
42
  :hide-action-footer="hideActionFooter"
42
43
  :disable-modal-close="disableModalClose"
43
44
  :ignore-outside-click="ignoreOutsideClick"
45
+ @onCloseModal="$emit('onCloseModal')"
44
46
  >
45
47
  <!-- freedom content start -->
46
48
  <div class="action-message pt-35 pb-35 has-text-centered">
@@ -54,20 +56,19 @@ const AcButton = defineAsyncComponent(() => import("./../button/Button.vue"));
54
56
  <!-- modal footer start -->
55
57
  <template #modal-footer-controls>
56
58
  <ac-button
57
- @click.stop="open = false"
58
59
  title="Cancel"
59
60
  modifier-classes="is-outlined"
60
- :disabled="isDeleteActive || disableModalClose"
61
61
  data-testid="delete-confirmation-modal-close-button"
62
+ :disabled="isDeleteActive || disableModalClose"
63
+ @click.stop="onClose"
62
64
  />
63
65
  <ac-button
64
66
  title="Yes"
65
67
  modifier-classes="is-danger"
68
+ data-testid="delete-confirmation-modal-confirm-button"
66
69
  :is-loader-active="isDeleteActive"
67
70
  @click.stop="$emit('onDelete', itemName)"
68
- data-testid="delete-confirmation-modal-confirm-button"
69
71
  />
70
72
  </template>
71
- </modal>
72
- <!-- modal end -->
73
+ </dialog-modal>
73
74
  </template>
@@ -21,6 +21,8 @@ const dialogModal = ref<HTMLDialogElement | null>(null);
21
21
 
22
22
  const model = defineModel({ type: Boolean });
23
23
 
24
+ const emit = defineEmits(["onCloseModal"]);
25
+
24
26
  const onKeyDown = (e: KeyboardEvent) => {
25
27
  if (model.value && e.keyCode === 27) {
26
28
  destroyModal();
@@ -36,6 +38,7 @@ const destroyModal = () => {
36
38
  if (props.disableModalClose) return;
37
39
  model.value = false;
38
40
  document.removeEventListener("keydown", onKeyDown);
41
+ emit("onCloseModal");
39
42
  };
40
43
 
41
44
  watch(
@@ -1,7 +1,12 @@
1
1
  <script setup lang="ts">
2
- import { defineAsyncComponent, ref, watch } from "vue";
2
+ import { ref, watch } from "vue";
3
3
  import { onClickOutside } from "@vueuse/core";
4
4
 
5
+ import HeaderItems from "./../header/HeaderItems.vue";
6
+ import HeaderItem from "./../header/HeaderItem.vue";
7
+ import AcButton from "./../button/Button.vue";
8
+ import AcButtons from "./../button/Buttons.vue";
9
+
5
10
  interface Props {
6
11
  open?: boolean;
7
12
  title?: string;
@@ -22,11 +27,6 @@ const props = withDefaults(defineProps<Props>(), {
22
27
 
23
28
  const emit = defineEmits(["closemodal"]);
24
29
 
25
- const HeaderItems = defineAsyncComponent(() => import("./../header/HeaderItems.vue"));
26
- const HeaderItem = defineAsyncComponent(() => import("./../header/HeaderItem.vue"));
27
- const Buttons = defineAsyncComponent(() => import("./../button/Buttons.vue"));
28
- const AcButton = defineAsyncComponent(() => import("./../button/Button.vue"));
29
-
30
30
  //TODO: need to update not a currect way to import the file
31
31
  const modalCloseIcon = import.meta.glob("../../../icons/close-icon.svg", {
32
32
  eager: true,
@@ -72,14 +72,12 @@ watch(
72
72
  destroyModal();
73
73
  }
74
74
  },
75
- { immediate: true }
75
+ { immediate: true },
76
76
  );
77
77
  </script>
78
78
 
79
79
  <template>
80
80
  <teleport to="#modals">
81
- <!-- for transition https://github.com/adamwathan/vue-tailwind-examples/blob/master/src/components/Modal.vue -->
82
- <!-- modal start -->
83
81
  <div v-if="showModal" class="ac-modal is-middle-alignment" :class="modifierClasses">
84
82
  <div ref="modal" class="ac-modal-inner">
85
83
  <!-- modal header start -->
@@ -118,9 +116,9 @@ watch(
118
116
  <div>
119
117
  <slot name="modal-footer-left" />
120
118
  </div>
121
- <buttons class="has-text-right is-block">
119
+ <ac-buttons class="has-text-right is-block">
122
120
  <slot name="modal-footer-controls" />
123
- </buttons>
121
+ </ac-buttons>
124
122
  <!-- modal footer end -->
125
123
  </div>
126
124
  </div>