@appscode/design-system 2.2.66 → 2.2.67

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "2.2.66",
3
+ "version": "2.2.67",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -1,28 +1,39 @@
1
1
  <script setup lang="ts">
2
- import { defineAsyncComponent } from "vue";
2
+ import { ref } from "vue";
3
+ import { useClipboard } from "@vueuse/core";
4
+ import AcButton from "../button/Button.vue";
3
5
 
4
6
  interface Props {
5
7
  spacing?: string;
6
8
  downloadBtn?: boolean;
9
+ code?: string;
7
10
  copyBtn?: boolean;
8
11
  }
9
12
 
10
- withDefaults(defineProps<Props>(), {
13
+ const props = withDefaults(defineProps<Props>(), {
11
14
  spacing: "pr-48",
12
15
  downloadBtn: false,
16
+ code: "",
13
17
  copyBtn: true,
14
18
  });
15
19
 
16
- const AcButton = defineAsyncComponent(() => import("@/components/vue-components/v3/button/Button.vue"));
20
+ const source = ref(props.code);
21
+
22
+ const { copy, copied } = useClipboard({ source, legacy: true });
17
23
  </script>
18
24
  <template>
19
25
  <div class="code-container p-0">
20
26
  <pre class="ac-hscrollbar" :class="spacing">
21
- <slot name="code"/>
27
+ {{ code }}
22
28
  </pre>
23
29
  <div class="buttons">
24
30
  <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" />
31
+ <ac-button
32
+ v-if="copyBtn"
33
+ :modifier-classes="'is-primary small-button'"
34
+ :icon-class="copied ? 'check' : 'copy'"
35
+ @click="copy()"
36
+ />
26
37
  </div>
27
38
  </div>
28
39
  </template>
@@ -1,32 +1,37 @@
1
1
  <script setup lang="ts">
2
- import { defineAsyncComponent } from "vue";
2
+ import { ref } from "vue";
3
+ import { useClipboard } from "@vueuse/core";
4
+ import AcButton from "../button/Button.vue";
3
5
 
4
6
  interface Props {
5
7
  spacing?: string;
6
8
  copyBtn?: boolean;
9
+ code?: string;
7
10
  }
8
11
 
9
- withDefaults(defineProps<Props>(), {
12
+ const props = withDefaults(defineProps<Props>(), {
10
13
  spacing: "pr-48",
11
14
  copyBtn: true,
15
+ code: "",
12
16
  });
13
-
14
- const AcButton = defineAsyncComponent(() => import("@/components/vue-components/v3/button/Button.vue"));
17
+ const source = ref(props.code);
18
+ const { copy, copied } = useClipboard({ source, legacy: true });
15
19
  </script>
16
20
  <template>
17
21
  <div class="code-container p-0 b-1 is-rounded-4">
18
22
  <div class="head is-flex is-justify-content-space-between is-align-items-center pt-7 px-4 b-b-1">
19
23
  <div><slot name="left" /></div>
20
24
  <ac-button
21
- title="Copy"
25
+ :title="copied ? '' : 'Copy'"
22
26
  v-if="copyBtn"
23
27
  data-testid="kubeconfig-copy-button"
24
- modifier-classes="is-outlined small-button mb-6"
25
- icon-class="copy"
28
+ :modifier-classes="`is-outlined small-button mb-6 `"
29
+ :icon-class="copied ? 'check' : 'copy'"
30
+ @click="copy()"
26
31
  />
27
32
  </div>
28
33
  <pre class="ac-hscrollbar is-border-none">
29
- <slot name="code"/>
34
+ {{ code }}
30
35
  </pre>
31
36
  </div>
32
37
  </template>