@appscode/design-system 2.4.30 → 2.5.1

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.30",
3
+ "version": "2.5.1",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -0,0 +1 @@
1
+ export * from "./v3";
@@ -237,3 +237,9 @@
237
237
  }
238
238
  }
239
239
  }
240
+
241
+ .details-with-checkradio-wrapper {
242
+ display: grid;
243
+ gap: 16px;
244
+ grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
245
+ }
@@ -1,7 +1,7 @@
1
1
  // card select
2
2
  .card-select {
3
- height: 94px;
4
- padding: 10px;
3
+ min-height: 98px;
4
+ padding: 16px;
5
5
  background-color: $white-100;
6
6
  border: 1px solid $color-border;
7
7
  box-sizing: border-box;
@@ -9,7 +9,9 @@
9
9
  transition: 0.3s ease-in-out;
10
10
  position: relative;
11
11
  z-index: 1;
12
- // width: 250px;
12
+ min-width: 200px;
13
+ max-width: 250px;
14
+ margin-bottom: 0 !important;
13
15
 
14
16
  &.is-active-require-field {
15
17
  &:after {
@@ -199,10 +201,6 @@
199
201
  .ac-single-checkbox {
200
202
  margin-bottom: 10px;
201
203
 
202
- &:last-child {
203
- margin-bottom: 0;
204
- }
205
-
206
204
  label {
207
205
  font-family: $font-heading;
208
206
  font-style: normal;
@@ -1,27 +1,55 @@
1
1
  <script setup lang="ts">
2
+ import { computed } from "vue";
3
+
2
4
  interface Props {
3
5
  options: Array<{
4
6
  value: unknown;
5
7
  label: string;
8
+ description?: string;
6
9
  }>;
7
10
  name: string;
8
11
  modifierClasses?: string;
9
12
  errorMsg?: string;
10
13
  isRow?: boolean;
14
+ hasDescription?: boolean;
11
15
  }
12
16
 
13
- withDefaults(defineProps<Props>(), {
17
+ const props = withDefaults(defineProps<Props>(), {
14
18
  modifierClasses: "",
15
19
  name: "radio",
16
20
  errorMsg: "",
17
21
  isRow: false,
22
+ hasDescription: false,
18
23
  });
24
+ const includeSelectedClass = (optionValue: unknown) => {
25
+ return props.hasDescription && JSON.stringify(model.value) === JSON.stringify(optionValue);
26
+ };
27
+ const handleClick = (optionValue: unknown) => {
28
+ model.value = optionValue;
29
+ };
19
30
  const model = defineModel();
31
+
32
+ const bodyClass = computed(() => {
33
+ if (props.hasDescription && props.isRow) return "is-flex is-flex-wrap-wrap gap-16";
34
+ else if (props.hasDescription) return "is-flex is-flex-direction-column gap-16";
35
+ else if (!props.isRow) return "is-flex is-flex-wrap-wrap is-flex-direction-column";
36
+ else return "is-flex is-flex-wrap-wrap gap-24";
37
+ });
20
38
  </script>
21
39
 
22
40
  <template>
23
- <div class="is-flex" :class="!isRow ? 'is-flex-direction-column' : 'gap-8'" data-testid="check-radio-element">
24
- <div class="ac-radio mr-16" v-for="option in options" :key="name + option.label" data-testid="check-radio-option">
41
+ <div :class="bodyClass" data-testid="check-radio-element">
42
+ <div
43
+ class="ac-radio"
44
+ v-for="option in options"
45
+ :key="name + option.label"
46
+ :class="{
47
+ 'card-select is-clickable': hasDescription,
48
+ 'is-selected': includeSelectedClass(option.value),
49
+ }"
50
+ data-testid="check-radio-option"
51
+ @click.prevent="handleClick(option.value)"
52
+ >
25
53
  <input
26
54
  v-model="model"
27
55
  :class="modifierClasses"
@@ -34,6 +62,9 @@ const model = defineModel();
34
62
  <p v-show="errorMsg" class="has-text-danger">
35
63
  <slot name="message" />
36
64
  </p>
65
+ <p v-if="hasDescription" class="is-ellipsis-2 mt-8" :title="option.description">
66
+ {{ option.description }}
67
+ </p>
37
68
  <p v-show="errorMsg" class="has-text-danger mb-16">
38
69
  {{ errorMsg }}
39
70
  </p>
@@ -0,0 +1,9 @@
1
+ import AcAccordion from "./accordion/Accordion.vue";
2
+ import AcAlert from "./alert/Alert.vue";
3
+ import AcAlertMessage from "./alert/AlertMessage.vue";
4
+ import AcToast from "./alert/Toast.vue";
5
+ import AcAvatar from "./avatar/Avatar.vue";
6
+ import AcBadge from "./badge-tags/Badge.vue";
7
+ import AcTag from "./badge-tags/Tag.vue";
8
+
9
+ export { AcAccordion, AcAlert, AcAlertMessage, AcToast, AcAvatar, AcBadge, AcTag };