@appscode/design-system 2.2.62 → 2.2.63

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.63",
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
+ }
@@ -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>