@appscode/design-system 2.17.78 → 2.17.80

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.17.78",
3
+ "version": "2.17.80",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -11,6 +11,11 @@
11
11
  background-color: $primary-light-gray;
12
12
  }
13
13
  }
14
+ &.is-ghost {
15
+ &:focus {
16
+ box-shadow: none;
17
+ }
18
+ }
14
19
  &.is-primary {
15
20
  background-color: $ac-primary;
16
21
  &:hover {
@@ -6,6 +6,7 @@ interface Props {
6
6
  value: unknown;
7
7
  label: string;
8
8
  description?: string;
9
+ disabled?: boolean;
9
10
  }>;
10
11
  name: string;
11
12
  modifierClasses?: string;
@@ -26,8 +27,9 @@ const props = withDefaults(defineProps<Props>(), {
26
27
  const includeSelectedClass = (optionValue: unknown) => {
27
28
  return props.hasDescription && JSON.stringify(model.value) === JSON.stringify(optionValue);
28
29
  };
29
- const handleClick = (optionValue: unknown) => {
30
- model.value = optionValue;
30
+ const handleClick = (option: Props["options"][number]) => {
31
+ if (option.disabled) return;
32
+ model.value = option.value;
31
33
  };
32
34
  const model = defineModel();
33
35
 
@@ -46,11 +48,13 @@ const bodyClass = computed(() => {
46
48
  v-for="option in options"
47
49
  :key="name + option.label"
48
50
  :class="{
49
- 'card-select is-clickable': hasDescription,
51
+ 'card-select': hasDescription,
52
+ 'is-clickable': hasDescription && !option.disabled,
50
53
  'is-selected': includeSelectedClass(option.value),
54
+ 'is-disabled': option.disabled,
51
55
  }"
52
56
  data-testid="check-radio-option"
53
- @click.prevent="handleClick(option.value)"
57
+ @click.prevent="handleClick(option)"
54
58
  >
55
59
  <input
56
60
  v-model="model"
@@ -59,6 +63,7 @@ const bodyClass = computed(() => {
59
63
  type="radio"
60
64
  :name="name"
61
65
  :value="option.value"
66
+ :disabled="option.disabled"
62
67
  />
63
68
  <label :for="name + option.label">{{ option.label }}</label>
64
69
  <p v-show="errorMsg" class="has-text-danger">
@@ -27,8 +27,9 @@ withDefaults(defineProps<Props>(), {
27
27
  <div v-if="custom">
28
28
  <slot name="custom" />
29
29
  </div>
30
- <div v-else>
30
+ <div v-else class="is-flex is-align-items-center gap-4">
31
31
  <h4 :key="title">{{ title }}</h4>
32
+ <slot name="additional-content" />
32
33
  </div>
33
34
  </header-item>
34
35
  <slot name="header-left-controls" />