@appscode/design-system 2.4.3 → 2.4.4-alpha

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
@@ -4,8 +4,8 @@
4
4
 
5
5
  // Third party CSS
6
6
  @import "../node_modules/bulma/bulma.sass";
7
- @import "bulma-checkradio";
8
- @import "bulma-switch";
7
+ // @import "bulma-checkradio";
8
+ // @import "bulma-switch";
9
9
  @import "bulma-tooltip";
10
10
  @import "font-awesome/css/font-awesome.min.css";
11
11
  @import "vue-multiselect/dist/vue-multiselect.css";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "2.4.3",
3
+ "version": "2.4.4-alpha",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -1,47 +1,47 @@
1
- .is-checkradio.is-primary[type="checkbox"].is-primary:checked.has-background-color + label::before,
2
- .is-checkradio.is-primary[type="checkbox"].is-primary:checked.has-background-color + label:before,
3
- .is-checkradio.is-primary[type="checkbox"].is-primary:checked.has-background-color + label::after,
4
- .is-checkradio.is-primary[type="checkbox"].is-primary:checked.has-background-color + label:after {
5
- background-color: $ac-primary !important;
6
- }
7
-
8
- .is-checkradio[type="checkbox"] + label::after,
9
- .is-checkradio[type="checkbox"] + label:after {
10
- border-color: $ac-primary;
11
- }
12
-
13
- .is-checkradio[type="checkbox"]:checked + label::before,
14
- .is-checkradio[type="checkbox"]:checked + label:before {
15
- border: 1px solid $ac-primary;
16
- }
17
-
18
- .is-checkradio.is-primary[type="radio"] + label::after,
19
- .is-checkradio.is-primary[type="radio"] + label:after {
20
- background: $ac-primary !important;
21
- }
22
-
23
- .is-checkradio.is-primary[type="checkbox"]:checked + label::before,
24
- .is-checkradio.is-primary[type="checkbox"]:checked + label:before,
25
- .is-checkradio.is-primary[type="radio"]:checked + label::before,
26
- .is-checkradio.is-primary[type="radio"]:checked + label:before {
27
- border-color: $ac-primary;
28
- }
29
-
30
- .is-checkradio[type="radio"].is-primary:checked + label::after,
31
- .is-checkradio[type="radio"].is-primary:checked + label:after {
32
- background-color: $ac-primary !important;
33
- border-color: $ac-primary;
34
- }
35
-
36
- .switch[type="checkbox"].is-primary:checked + label::before,
37
- .switch[type="checkbox"].is-primary:checked + label:before {
38
- background-color: $ac-primary;
39
- }
40
-
41
- .is-checkradio[type="radio"] + label::after,
42
- .is-checkradio[type="radio"] + label:after {
43
- background-color: $ac-primary;
44
- }
1
+ // .is-checkradio.is-primary[type="checkbox"].is-primary:checked.has-background-color + label::before,
2
+ // .is-checkradio.is-primary[type="checkbox"].is-primary:checked.has-background-color + label:before,
3
+ // .is-checkradio.is-primary[type="checkbox"].is-primary:checked.has-background-color + label::after,
4
+ // .is-checkradio.is-primary[type="checkbox"].is-primary:checked.has-background-color + label:after {
5
+ // background-color: $ac-primary !important;
6
+ // }
7
+
8
+ // .is-checkradio[type="checkbox"] + label::after,
9
+ // .is-checkradio[type="checkbox"] + label:after {
10
+ // border-color: $ac-primary;
11
+ // }
12
+
13
+ // .is-checkradio[type="checkbox"]:checked + label::before,
14
+ // .is-checkradio[type="checkbox"]:checked + label:before {
15
+ // border: 1px solid $ac-primary;
16
+ // }
17
+
18
+ // .is-checkradio.is-primary[type="radio"] + label::after,
19
+ // .is-checkradio.is-primary[type="radio"] + label:after {
20
+ // background: $ac-primary !important;
21
+ // }
22
+
23
+ // .is-checkradio.is-primary[type="checkbox"]:checked + label::before,
24
+ // .is-checkradio.is-primary[type="checkbox"]:checked + label:before,
25
+ // .is-checkradio.is-primary[type="radio"]:checked + label::before,
26
+ // .is-checkradio.is-primary[type="radio"]:checked + label:before {
27
+ // border-color: $ac-primary;
28
+ // }
29
+
30
+ // .is-checkradio[type="radio"].is-primary:checked + label::after,
31
+ // .is-checkradio[type="radio"].is-primary:checked + label:after {
32
+ // background-color: $ac-primary !important;
33
+ // border-color: $ac-primary;
34
+ // }
35
+
36
+ // .switch[type="checkbox"].is-primary:checked + label::before,
37
+ // .switch[type="checkbox"].is-primary:checked + label:before {
38
+ // background-color: $ac-primary;
39
+ // }
40
+
41
+ // .is-checkradio[type="radio"] + label::after,
42
+ // .is-checkradio[type="radio"] + label:after {
43
+ // background-color: $ac-primary;
44
+ // }
45
45
 
46
46
  // 2024 AppsCode Custom Checkbox, Radio, Switch style
47
47
  // checkbox
@@ -98,6 +98,11 @@
98
98
  transition: all 0.2s ease;
99
99
  }
100
100
  }
101
+ &:hover {
102
+ .checkmark {
103
+ border: 1px solid $ac-primary;
104
+ }
105
+ }
101
106
  }
102
107
 
103
108
  // radio button
@@ -131,6 +136,7 @@
131
136
  border: 1px solid $color-border-dark;
132
137
  border-radius: 50%; // Full circle
133
138
  background: #fff;
139
+ transition: 0.2s ease-in-out;
134
140
  }
135
141
 
136
142
  // Inner dot for selected radio button
@@ -156,6 +162,16 @@
156
162
  opacity: 1;
157
163
  transform: scale(1);
158
164
  }
165
+ [type="radio"]:checked + label::before {
166
+ border: 1px solid $ac-primary;
167
+ }
168
+ &:hover {
169
+ [type="radio"] + label {
170
+ &::before {
171
+ border: 1px solid $ac-primary;
172
+ }
173
+ }
174
+ }
159
175
  }
160
176
 
161
177
  .ac-switch {
@@ -208,7 +224,7 @@
208
224
  }
209
225
 
210
226
  input:checked + .slider {
211
- background-color: hsl(var(--primary-hue), var(--primary-saturation), var(--primary-light));
227
+ background-color: $ac-primary;
212
228
  }
213
229
 
214
230
  input:checked + .slider:before {
@@ -216,7 +232,7 @@
216
232
  }
217
233
 
218
234
  input:focus-visible + .slider {
219
- box-shadow: 0 0 3px hsl(var(--primary-hue), var(--primary-saturation), var(--primary-light));
235
+ box-shadow: 0 0 3px $ac-primary;
220
236
  }
221
237
  }
222
238
  }
@@ -2,40 +2,11 @@
2
2
  position: relative;
3
3
  z-index: 9;
4
4
 
5
- &.is-disabled {
6
- pointer-events: none;
7
- }
8
-
9
5
  input[type="text"] {
10
6
  padding-right: 32px;
11
7
  }
12
8
 
13
- .custom-select-placeholder {
14
- border: 1px solid $color-border-dark;
15
- padding: 8px 15px;
16
- border-radius: 4px;
17
- line-height: 1;
18
- // cursor: pointer;
19
- display: flex;
20
- align-items: center;
21
- height: 36px;
22
-
23
- &:hover {
24
- border: 1px solid $ac-primary;
25
- }
26
- }
27
-
28
9
  &.is-extra-small {
29
- height: 32px;
30
-
31
- .custom-select-placeholder {
32
- height: 32px;
33
- }
34
-
35
- .ac-field {
36
- top: 5px;
37
- }
38
-
39
10
  .buttons {
40
11
  .button {
41
12
  height: 28px;
@@ -63,7 +34,6 @@
63
34
  right: 2px;
64
35
  top: 2px;
65
36
  margin: 0;
66
- z-index: 9;
67
37
 
68
38
  .button {
69
39
  margin: 0 !important;
@@ -84,7 +54,7 @@
84
54
  width: 100%;
85
55
  max-height: 500px;
86
56
  overflow-y: auto;
87
- // transition: 0.2s ease-in-out;
57
+ transition: 0.3s ease-in-out;
88
58
  opacity: 0;
89
59
  visibility: hidden;
90
60
 
@@ -105,7 +75,7 @@
105
75
  li {
106
76
  display: flex;
107
77
 
108
- &:hover:not(.is-active, .is-disabled) {
78
+ &:hover:not(.is-active) {
109
79
  background-color: $primary-light-gray;
110
80
  color: $color-heading;
111
81
 
@@ -133,7 +103,7 @@
133
103
  cursor: pointer;
134
104
  }
135
105
 
136
- &:hover:not(.group li, .is-active, .is-disabled) {
106
+ &:hover:not(.group li, .is-active) {
137
107
  background-color: $primary-light-gray;
138
108
  color: $color-heading;
139
109
 
@@ -159,9 +129,6 @@
159
129
  &.is-disabled {
160
130
  opacity: 0.6;
161
131
  cursor: not-allowed;
162
- label {
163
- cursor: not-allowed;
164
- }
165
132
  }
166
133
  }
167
134
  }
@@ -284,7 +284,7 @@
284
284
  color: $color-heading;
285
285
  position: absolute;
286
286
  z-index: 2;
287
- transition: 0.1s ease-in-out;
287
+ transition: 0.3s ease-in-out;
288
288
 
289
289
  .is-required {
290
290
  color: $danger;
@@ -19,18 +19,14 @@ const model = defineModel({ type: Array });
19
19
  </script>
20
20
 
21
21
  <template>
22
- <div v-for="option in options" :key="name + option.label" class="field">
23
- <input
24
- class="is-checkradio has-background-color"
25
- :class="modifierClasses"
26
- :id="name + option.label"
27
- :value="option.value"
28
- type="checkbox"
29
- v-model="model"
30
- />
31
- <label :for="name + option.label">{{ option.label }}</label>
22
+ <div v-for="option in options" :key="name + option.label" class="mb-8">
23
+ <label class="ac-checkbox" :for="name + option.label">
24
+ <input :class="modifierClasses" :id="name + option.label" :value="option.value" type="checkbox" v-model="model" />
25
+ <span class="checkmark"></span>
26
+ <span>{{ option.label }}</span>
27
+ </label>
32
28
  </div>
33
- <p v-show="errorMsg" class="is-danger">
29
+ <p v-show="errorMsg" class="is-danger mb-16">
34
30
  {{ errorMsg }}
35
31
  </p>
36
32
  </template>
@@ -18,10 +18,9 @@ const model = defineModel();
18
18
  </script>
19
19
 
20
20
  <template>
21
- <div v-for="option in options" :key="name + option.label" class="field">
21
+ <div class="ac-radio" v-for="option in options" :key="name + option.label">
22
22
  <input
23
23
  v-model="model"
24
- class="is-checkradio"
25
24
  :class="modifierClasses"
26
25
  :id="name + option.label"
27
26
  type="radio"
@@ -34,7 +33,7 @@ const model = defineModel();
34
33
  <slot name="message" />
35
34
  </p>
36
35
  </div>
37
- <p v-show="errorMsg" class="is-danger">
36
+ <p v-show="errorMsg" class="is-danger mb-16">
38
37
  {{ errorMsg }}
39
38
  </p>
40
39
  </template>
@@ -27,13 +27,7 @@ const CloseIcon = defineAsyncComponent(() => import("../icons/CloseIcon.vue"));
27
27
  <div class="ac-single-input is-small is-selectbox" :class="[isOpen ? 'is-open' : '']" style="z-index: 2">
28
28
  <!-- add 'show-label' class for move top -->
29
29
  <label for="custom-select" class="ac-label show-label">Select Option</label>
30
-
31
- <!-- <input type="text" value="Select" /> -->
32
- <p class="custom-select-placeholder">
33
- <span class="is-ellipsis-1">
34
- Select Value Select ValueSelect ValueSelect ValueSelect ValueSelect ValueSelect Value
35
- </span>
36
- </p>
30
+ <input type="text" value="Select" />
37
31
 
38
32
  <div v-if="multiselect" class="ac-field field is-grouped is-clipped">
39
33
  <div class="control">
@@ -18,17 +18,21 @@ const model = defineModel({ type: Boolean });
18
18
  </script>
19
19
 
20
20
  <template>
21
- <div class="field">
22
- <input
23
- v-model="model"
24
- :id="name"
25
- type="checkbox"
26
- :name="name"
27
- class="switch is-rounded is-primary"
28
- :class="modifierClasses"
29
- :data-testid="dataTestId"
30
- />
21
+ <div class="ac-switch is-flex is-align-items-center gap-8">
31
22
  <label :for="name">{{ label }}</label>
23
+ <label class="switch">
24
+ <input
25
+ v-model="model"
26
+ :id="name"
27
+ type="checkbox"
28
+ :name="name"
29
+ class="switch is-rounded is-primary"
30
+ :class="modifierClasses"
31
+ :data-testid="dataTestId"
32
+ />
33
+ <span class="slider round"></span>
34
+ </label>
35
+
32
36
  <p v-show="errorMsg" class="is-danger">
33
37
  {{ errorMsg }}
34
38
  </p>
@@ -1,9 +1,3 @@
1
- <script setup lang="ts">
2
- withDefaults(defineProps<{ direction?: "up" | "down" }>(), {
3
- direction: "up",
4
- });
5
- </script>
6
-
7
1
  <template>
8
2
  <svg
9
3
  xmlns="http://www.w3.org/2000/svg"
@@ -14,7 +8,6 @@ withDefaults(defineProps<{ direction?: "up" | "down" }>(), {
14
8
  stroke-width="1.5"
15
9
  stroke="currentColor"
16
10
  class="size-6"
17
- :style="direction === 'up' ? 'transform: rotate(0deg)' : 'transform: rotate(-180deg)'"
18
11
  >
19
12
  <path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
20
13
  </svg>
@@ -1,9 +1,3 @@
1
- <script setup lang="ts">
2
- withDefaults(defineProps<{ direction?: "up" | "down" }>(), {
3
- direction: "up",
4
- });
5
- </script>
6
-
7
1
  <template>
8
2
  <svg
9
3
  xmlns="http://www.w3.org/2000/svg"
@@ -14,7 +8,6 @@ withDefaults(defineProps<{ direction?: "up" | "down" }>(), {
14
8
  stroke-width="1.5"
15
9
  stroke="currentColor"
16
10
  class="size-6"
17
- :style="direction === 'up' ? 'transform: rotate(0deg)' : 'transform: rotate(-180deg)'"
18
11
  >
19
12
  <path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
20
13
  </svg>
@@ -1,134 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, defineAsyncComponent, ref, watch } from "vue";
3
- import { onClickOutside, useFocus } from "@vueuse/core";
4
-
5
- import AcButton from "../button/Button.vue";
6
- import AcButtons from "../button/Buttons.vue";
7
-
8
- const ArrowDownIcon = defineAsyncComponent(() => import("../icons/ArrowDownIcon.vue"));
9
- const RefreshIcon = defineAsyncComponent(() => import("../icons/RefreshIcon.vue"));
10
- const CloseIcon = defineAsyncComponent(() => import("../icons/CloseIcon.vue"));
11
-
12
- type Option = { text: string; value: string };
13
- interface prop {
14
- custom?: boolean;
15
- options?: Array<Option>;
16
- isLoading?: boolean;
17
- optionType?: "simple" | "custom";
18
- }
19
-
20
- const props = withDefaults(defineProps<prop>(), {
21
- custom: false,
22
- options: () => [],
23
- isLoading: false,
24
- optionType: "simple",
25
- });
26
-
27
- defineEmits(["onRefreshClick"]);
28
-
29
- const selectedValue = ref<Option>();
30
- const labelHoisted = ref(false);
31
- const searchText = ref("");
32
- const isOpen = ref(false);
33
-
34
- // handle outside box
35
- const selectBox = ref(null);
36
- onClickOutside(selectBox, () => (isOpen.value = false));
37
-
38
- // handle input click
39
- const searchInput = ref(null);
40
- const { focused } = useFocus(searchInput, { initialValue: true });
41
-
42
- // filter options based on search text
43
- const filteredOptions = computed(() => {
44
- if (searchText.value) {
45
- return props.options.filter((op) => op.text.includes(searchText.value));
46
- } else return props.options || [];
47
- });
48
-
49
- // handle selection
50
- const onLabelClick = (op: Option) => {
51
- selectedValue.value = op;
52
- isOpen.value = false;
53
- };
54
-
55
- // handle label click
56
- const selectClick = () => {
57
- isOpen.value = true;
58
- focused.value = true;
59
- };
60
-
61
- // handle clear btn
62
- const handleClear = () => {
63
- selectedValue.value = undefined;
64
- searchText.value = "";
65
- };
66
-
67
- // handle depend on selected data
68
- watch(selectedValue, (n) => {
69
- if (n) labelHoisted.value = true;
70
- else labelHoisted.value = false;
71
- });
72
-
73
- watch(isOpen, (n) => {
74
- if (n) searchText.value = "";
75
- else {
76
- if (!selectedValue.value?.value) labelHoisted.value = false;
77
- }
78
- });
79
- </script>
80
-
81
- <template>
82
- <div
83
- ref="selectBox"
84
- class="ac-single-input is-small is-selectbox"
85
- :class="{ 'is-open': isOpen, 'is-disabled': isLoading }"
86
- :style="[isOpen ? { 'z-index': 2 } : '']"
87
- >
88
- <label for="custom-select" class="ac-label" :class="{ 'show-label': labelHoisted || isOpen }" @click="selectClick">
89
- Select Option
90
- </label>
91
-
92
- <input
93
- v-if="isOpen"
94
- v-model="searchText"
95
- type="text"
96
- ref="searchInput"
97
- placeholder="Select One"
98
- @click="selectClick"
99
- />
100
-
101
- <p v-else class="custom-select-placeholder" @click="selectClick">
102
- <span class="is-ellipsis-1">{{ selectedValue?.text }}</span>
103
- </p>
104
-
105
- <ac-buttons>
106
- <button class="button ac-button is-white" @click="handleClear">
107
- <ArrowDownIcon />
108
- </button>
109
-
110
- <ac-button modifier-classes="is-white" @click="$emit('onRefreshClick')">
111
- <RefreshIcon :class="{ 'is-spin': isLoading }" />
112
- </ac-button>
113
-
114
- <ac-button modifier-classes="is-white" @click="isOpen = !isOpen">
115
- <CloseIcon :direction="isOpen ? 'down' : 'up'" />
116
- </ac-button>
117
- </ac-buttons>
118
-
119
- <div v-if="optionType === 'custom'" class="custom-select options">
120
- <slot />
121
- </div>
122
-
123
- <ul v-else class="options">
124
- <template v-for="op in filteredOptions" :key="op.value">
125
- <li @click="onLabelClick(op)" :class="{ 'is-active': selectedValue?.value === op.value }">
126
- <label for="opt-one">{{ op.text }}</label>
127
- </li>
128
- </template>
129
- <li v-if="filteredOptions.length <= 0" class="is-disabled">
130
- <label>No element found. Consider changing the search text</label>
131
- </li>
132
- </ul>
133
- </div>
134
- </template>