@appscode/design-system 1.0.43-alpha.149 → 1.0.43-alpha.151

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.
@@ -714,6 +714,14 @@ input#captcha {
714
714
  }
715
715
  }
716
716
 
717
+ .ac-single-switch.is-small .switch[type="checkbox"] + label,
718
+ .buttons.are-small
719
+ .ac-single-switch.button.ac-button
720
+ .switch[type="checkbox"]
721
+ + label {
722
+ height: 20px;
723
+ }
724
+
717
725
  // transparent input
718
726
  .transparent-input {
719
727
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "1.0.43-alpha.149",
3
+ "version": "1.0.43-alpha.151",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -3,7 +3,7 @@
3
3
  </template>
4
4
 
5
5
  <script>
6
- const monaco = require("monaco-editor");
6
+ import * as monaco from "monaco-editor";
7
7
 
8
8
  export default {
9
9
  name: "MonacoEditor",
@@ -0,0 +1,83 @@
1
+ <template>
2
+ <!-- modal start -->
3
+ <modal
4
+ :title="title"
5
+ modifier-classes="is-normal"
6
+ :open="open"
7
+ @closemodal="closeModal"
8
+ >
9
+ <!-- freedom content start -->
10
+ <div class="action-message pt-35 pb-35 has-text-centered">
11
+ <h5 class="is-message">{{ message }} {{ itemName ? "" : "?" }}</h5>
12
+ <p class="is-description">{{ itemName }} {{ itemName ? "?" : "" }}</p>
13
+ </div>
14
+
15
+ <!-- freedom content end -->
16
+
17
+ <!-- modal footer start -->
18
+ <template #modal-footer-controls>
19
+ <ac-button
20
+ @click.stop="closeModal"
21
+ title="Cancel"
22
+ modifier-classes="is-outlined"
23
+ />
24
+ <ac-button
25
+ modifier-classes="is-danger"
26
+ :is-loader-active="isDeleteActive"
27
+ title="Yes"
28
+ @click.stop="confirm(true)"
29
+ />
30
+ </template>
31
+ </modal>
32
+ <!-- modal end -->
33
+ </template>
34
+
35
+ <script>
36
+ import { defineComponent, defineAsyncComponent } from "vue";
37
+ export default defineComponent({
38
+ components: {
39
+ Modal: defineAsyncComponent(() =>
40
+ import("../modal/Modal.vue").then((module) => module.default)
41
+ ),
42
+ AcButton: defineAsyncComponent(() =>
43
+ import("../button/Button.vue").then((module) => module.default)
44
+ ),
45
+ },
46
+ props: {
47
+ open: {
48
+ type: Boolean,
49
+ default: false,
50
+ },
51
+ title: {
52
+ type: String,
53
+ default: "",
54
+ },
55
+ message: {
56
+ type: String,
57
+ default: "",
58
+ },
59
+ itemName: {
60
+ type: String,
61
+ default: "",
62
+ },
63
+ isLoading: {
64
+ type: Boolean,
65
+ default: false,
66
+ },
67
+ isDeleteActive: {
68
+ type: Boolean,
69
+ default: false,
70
+ },
71
+ },
72
+ emits: ["closemodal", "delete-confirmation-modal$confirm"],
73
+ methods: {
74
+ confirm(response) {
75
+ this.$emit("delete-confirmation-modal$confirm", response);
76
+ },
77
+ closeModal() {
78
+ this.confirm(false);
79
+ this.$emit("closemodal", true);
80
+ },
81
+ },
82
+ });
83
+ </script>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div>
3
- <button
4
- v-if="themeMode"
3
+ <button
4
+ v-if="themeMode"
5
5
  class="button ac-nav-button"
6
6
  @click="toggleTheme"
7
7
  :title="themeModes[themeMode].displayName"
@@ -10,11 +10,11 @@
10
10
  </button>
11
11
  <div class="ac-menu-content theme-choice">
12
12
  <ul class="is-flex is-flex-direction-row is-justify-content-space-around">
13
- <li
13
+ <li
14
14
  v-for="theme of Object.keys(themeModes)"
15
15
  :title="themeModes[theme].displayName"
16
16
  @click="themeMode = theme"
17
- :class="{'is-active': themeMode === theme}"
17
+ :class="{ 'is-active': themeMode === theme }"
18
18
  :key="theme"
19
19
  >
20
20
  <i :class="['fa', themeModes[theme].iconClass]" />
@@ -42,19 +42,19 @@ export default defineComponent({
42
42
  dark: {
43
43
  displayName: "Dark Theme",
44
44
  iconClass: "fa-moon-o",
45
- }
46
- }
45
+ },
46
+ },
47
47
  };
48
48
  },
49
49
 
50
- emits: ['set:theme'],
50
+ emits: ["set:theme"],
51
51
 
52
52
  mounted() {
53
53
  // get theme mode from localStorage or set default one
54
54
  this.themeMode = localStorage.getItem("themeMode") || "light";
55
55
  },
56
56
 
57
- destroyed() {
57
+ unmounted() {
58
58
  this.removeColorSchemeEventListener();
59
59
  },
60
60
 
@@ -62,19 +62,16 @@ export default defineComponent({
62
62
  themeMode: {
63
63
  handler(n) {
64
64
  this.onThemeModeChange(n);
65
- }
66
- }
65
+ },
66
+ },
67
67
  },
68
68
 
69
69
  methods: {
70
70
  // handle theme mode button click
71
71
  toggleTheme() {
72
- if(this.themeMode === "light")
73
- this.themeMode = "dark";
74
- else if(this.themeMode === "dark")
75
- this.themeMode = "system";
76
- else if(this.themeMode === "system")
77
- this.themeMode = "light";
72
+ if (this.themeMode === "light") this.themeMode = "dark";
73
+ else if (this.themeMode === "dark") this.themeMode = "system";
74
+ else if (this.themeMode === "system") this.themeMode = "light";
78
75
  },
79
76
 
80
77
  // triggered when theme mode is updated
@@ -82,8 +79,10 @@ export default defineComponent({
82
79
  localStorage.setItem("themeMode", n);
83
80
 
84
81
  let theme = n;
85
- if(n === "system") {
86
- const isDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
82
+ if (n === "system") {
83
+ const isDarkMode =
84
+ window.matchMedia &&
85
+ window.matchMedia("(prefers-color-scheme: dark)").matches;
87
86
  this.addColorSchemeEventListener();
88
87
  theme = isDarkMode ? "dark" : "light";
89
88
  } else {
@@ -95,7 +94,7 @@ export default defineComponent({
95
94
 
96
95
  // add proper css class to update the ui theme
97
96
  handleDarkThemeClass(currentTheme) {
98
- if(currentTheme === "light") {
97
+ if (currentTheme === "light") {
99
98
  document.documentElement.classList.remove("is-dark-theme");
100
99
  } else {
101
100
  document.documentElement.classList.add("is-dark-theme");
@@ -106,23 +105,19 @@ export default defineComponent({
106
105
  addColorSchemeEventListener() {
107
106
  window
108
107
  .matchMedia("(prefers-color-scheme: dark)")
109
- .addEventListener(
110
- "change", this.handleSystemThemeChange
111
- );
108
+ .addEventListener("change", this.handleSystemThemeChange);
112
109
  },
113
110
 
114
111
  // remove system theme listener event
115
112
  removeColorSchemeEventListener() {
116
113
  window
117
114
  .matchMedia("(prefers-color-scheme: dark)")
118
- .removeEventListener(
119
- "change", this.handleSystemThemeChange
120
- );
115
+ .removeEventListener("change", this.handleSystemThemeChange);
121
116
  },
122
117
 
123
118
  handleSystemThemeChange() {
124
119
  this.onThemeModeChange(this.themeMode);
125
120
  },
126
- }
121
+ },
127
122
  });
128
123
  </script>