@appscode/design-system 2.4.27 → 2.4.28

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.4.27",
3
+ "version": "2.4.28",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -6,13 +6,12 @@
6
6
  // gap: 48px;
7
7
  &.is-column {
8
8
  flex-direction: column;
9
- align-items: self-start;
10
9
  li {
11
10
  --line: 2px;
12
11
  flex-direction: row;
13
12
  gap: 8px;
14
13
  text-align: left;
15
- align-items: baseline;
14
+ align-items: flex-start;
16
15
  padding-bottom: 24px;
17
16
  .step-header {
18
17
  margin: 0;
@@ -44,6 +43,17 @@
44
43
  }
45
44
  }
46
45
  }
46
+ &.is-row {
47
+ li {
48
+ &.is-active {
49
+ &:not(&:first-child) {
50
+ &::before {
51
+ background-color: $ac-primary;
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
47
57
  li {
48
58
  display: flex;
49
59
  flex: 1 1 0%;
@@ -99,9 +99,9 @@ const onSelect = (selectedOption: unknown, id: string) => emit("select", selecte
99
99
  :class="[
100
100
  wrapperDivCustomClass,
101
101
  {
102
- 'has-refresh-button': hasRefreshBtn,
102
+ 'has-refresh-button': !disabled && (hasRefreshBtn || isLoaderActive),
103
103
  'is-disable': disabled || isLoaderActive,
104
- 'has-clear-button': allowEmpty && model,
104
+ 'has-clear-button': !disabled && allowEmpty && model,
105
105
  },
106
106
  ]"
107
107
  data-testid="cluster-status-select-header"
@@ -115,13 +115,17 @@ const onSelect = (selectedOption: unknown, id: string) => emit("select", selecte
115
115
  {{ isLabelHoisted ? label : `Select ${label}` }}
116
116
  <span v-if="showStar" class="is-required has-text-danger"> * </span>
117
117
  </label>
118
- <button v-if="allowEmpty && model" class="button ac-button is-clear is-transparent" @click.prevent="model = ''">
118
+ <button
119
+ v-if="!disabled && allowEmpty && model"
120
+ class="button ac-button is-clear is-transparent"
121
+ @click.prevent="model = ''"
122
+ >
119
123
  <span class="icon width-16">
120
124
  <CrossIcon />
121
125
  </span>
122
126
  </button>
123
127
  <button
124
- v-if="hasRefreshBtn"
128
+ v-if="!disabled && (hasRefreshBtn || isLoaderActive)"
125
129
  class="button ac-button is-primary is-refresh is-transparent"
126
130
  :class="{ spin: isLoaderActive }"
127
131
  @click.prevent="$emit('refresh-btn-click')"
@@ -1,22 +1,16 @@
1
1
  <script setup lang="ts">
2
- import { defineAsyncComponent } from "vue";
3
- const CheckIcon = defineAsyncComponent(() => import("../icons/CheckIcon.vue"));
2
+ import CheckIcon from "../icons/CheckIcon.vue";
3
+
4
4
  interface Props {
5
5
  direction?: string;
6
- active?: boolean;
7
- complete?: boolean;
8
- title?: string;
9
- description?: string;
10
- count?: string;
6
+ active?: number;
7
+ options?: { title: string; description: string; id: number }[];
11
8
  }
12
9
 
13
10
  withDefaults(defineProps<Props>(), {
14
11
  direction: "is-row",
15
- active: false,
16
- complete: false,
17
- title: "Title",
18
- description: "Description",
19
- count: "1",
12
+ active: 0,
13
+ options: () => [],
20
14
  });
21
15
  </script>
22
16
 
@@ -24,14 +18,19 @@ withDefaults(defineProps<Props>(), {
24
18
  <div class="steps-wrapper">
25
19
  <ol class="steps" :class="direction">
26
20
  <!-- 'is-active': if active, 'is-complete': if complete -->
27
- <li class="step" :class="{ 'is-active': active, 'is-complete': complete }" v-for="i in 4" :key="i">
21
+ <li
22
+ v-for="op in options"
23
+ class="step"
24
+ :key="op.id"
25
+ :class="{ 'is-active': active === op.id, 'is-complete is-active': active > op.id }"
26
+ >
28
27
  <div class="step-header">
29
- <span class="icon" v-if="complete"><CheckIcon /></span>
30
- <span v-else>{{ count }}</span>
28
+ <span class="icon" v-if="active > op.id"><CheckIcon /></span>
29
+ <span v-else>{{ op.id }}</span>
31
30
  </div>
32
31
  <div class="is-flex is-flex-direction-column">
33
- <h5>{{ title }}</h5>
34
- <p>{{ description }}</p>
32
+ <h5>{{ op.title }}</h5>
33
+ <p>{{ op.description }}</p>
35
34
  </div>
36
35
  </li>
37
36
  </ol>