@redseed/redseed-ui-vue3 6.4.0 → 6.4.2
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 +1 -1
- package/src/components/Badge/BadgeError.vue +10 -0
- package/src/components/Badge/index.js +5 -1
- package/src/components/Card/Card.vue +83 -35
- package/src/components/Layouts/SingleColumnLayout.vue +1 -1
- /package/src/components/Badge/{BadgeNeutral.vue → BadgeSecondary.vue} +0 -0
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import Badge from './Badge.vue'
|
|
2
2
|
import BadgeInfo from './BadgeInfo.vue'
|
|
3
|
-
import BadgeNeutral from './BadgeNeutral.vue'
|
|
4
3
|
import BadgeSuccess from './BadgeSuccess.vue'
|
|
5
4
|
import BadgeWarning from './BadgeWarning.vue'
|
|
6
5
|
import BadgeGroup from './BadgeGroup.vue'
|
|
6
|
+
import BadgeSecondary from './BadgeSecondary.vue'
|
|
7
|
+
import BadgeNeutral from './BadgeSecondary.vue'
|
|
8
|
+
import BadgeError from './BadgeError.vue'
|
|
7
9
|
|
|
8
10
|
export {
|
|
9
11
|
Badge,
|
|
@@ -12,4 +14,6 @@ export {
|
|
|
12
14
|
BadgeSuccess,
|
|
13
15
|
BadgeWarning,
|
|
14
16
|
BadgeGroup,
|
|
17
|
+
BadgeSecondary,
|
|
18
|
+
BadgeError
|
|
15
19
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed } from 'vue'
|
|
2
|
+
import { computed, ref } from 'vue'
|
|
3
|
+
import { useResponsiveWidth } from '../../helpers'
|
|
3
4
|
|
|
4
5
|
const props = defineProps({
|
|
5
6
|
clickable: {
|
|
@@ -22,14 +23,23 @@ const props = defineProps({
|
|
|
22
23
|
|
|
23
24
|
const emit = defineEmits(['click'])
|
|
24
25
|
|
|
26
|
+
const cardElement = ref(null)
|
|
27
|
+
const { responsiveWidth } = useResponsiveWidth(cardElement)
|
|
28
|
+
|
|
25
29
|
const cardClass = computed(() => [
|
|
26
30
|
'rsui-card',
|
|
27
31
|
{
|
|
28
32
|
'rsui-card--hoverable': props.hoverable,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
33
|
'rsui-card--clickable': props.clickable && !props.disabled,
|
|
32
|
-
|
|
34
|
+
'rsui-card--2xs': responsiveWidth.value['2xs'],
|
|
35
|
+
'rsui-card--xs': responsiveWidth.value['xs'],
|
|
36
|
+
'rsui-card--sm': responsiveWidth.value['sm'],
|
|
37
|
+
'rsui-card--md': responsiveWidth.value['md'],
|
|
38
|
+
'rsui-card--lg': responsiveWidth.value['lg'],
|
|
39
|
+
'rsui-card--xl': responsiveWidth.value['xl'],
|
|
40
|
+
'rsui-card--2xl': responsiveWidth.value['2xl'],
|
|
41
|
+
'rsui-card--3xl': responsiveWidth.value['3xl'],
|
|
42
|
+
}
|
|
33
43
|
])
|
|
34
44
|
|
|
35
45
|
function onClick() {
|
|
@@ -39,39 +49,28 @@ function onClick() {
|
|
|
39
49
|
}
|
|
40
50
|
</script>
|
|
41
51
|
<template>
|
|
42
|
-
<div :class="cardClass" data-testid="card">
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
>
|
|
52
|
-
<slot name="image"></slot>
|
|
53
|
-
</div>
|
|
52
|
+
<div ref="cardElement" :class="cardClass" data-testid="card">
|
|
53
|
+
<div v-if="clickable" class="rsui-card__action-layer" :title="$attrs.title" @click="onClick"></div>
|
|
54
|
+
|
|
55
|
+
<div v-if="$slots.image" class="rsui-card__image">
|
|
56
|
+
<slot name="image"></slot>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div v-if="$slots.header" class="rsui-card__header" :title="$attrs.title">
|
|
60
|
+
<slot name="header"></slot>
|
|
54
61
|
|
|
55
|
-
|
|
56
|
-
class="
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
]">
|
|
66
|
-
<slot></slot>
|
|
67
|
-
|
|
68
|
-
<div v-if="$slots.meta"
|
|
69
|
-
class="rsui-card__meta"
|
|
70
|
-
>
|
|
71
|
-
<slot name="meta"></slot>
|
|
62
|
+
</div>
|
|
63
|
+
<div v-if="$slots.default || $slots.meta" :class="[
|
|
64
|
+
'rsui-card__content',
|
|
65
|
+
{ 'rsui-card__content--padded': padded },
|
|
66
|
+
]">
|
|
67
|
+
<slot></slot>
|
|
68
|
+
|
|
69
|
+
<div v-if="$slots.meta" class="rsui-card__meta">
|
|
70
|
+
<slot name="meta"></slot>
|
|
71
|
+
</div>
|
|
72
72
|
</div>
|
|
73
73
|
</div>
|
|
74
|
-
</div>
|
|
75
74
|
</template>
|
|
76
75
|
<style lang="scss" scoped>
|
|
77
76
|
.rsui-card {
|
|
@@ -85,9 +84,11 @@ function onClick() {
|
|
|
85
84
|
|
|
86
85
|
&--clickable {
|
|
87
86
|
@apply cursor-pointer;
|
|
87
|
+
|
|
88
88
|
.rsui-card__image {
|
|
89
89
|
@apply pointer-events-none;
|
|
90
90
|
}
|
|
91
|
+
|
|
91
92
|
.rsui-card__content {
|
|
92
93
|
@apply pointer-events-none;
|
|
93
94
|
}
|
|
@@ -110,7 +111,54 @@ function onClick() {
|
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
&__meta {
|
|
113
|
-
@apply max-w-full overflow-x-auto grid grid-cols-1
|
|
114
|
+
@apply max-w-full overflow-x-auto grid grid-cols-1 gap-x-6 gap-y-2 ;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&--2xs {
|
|
118
|
+
.rsui-card__meta {
|
|
119
|
+
@apply grid-cols-2;
|
|
120
|
+
// @apply max-w-full overflow-x-auto grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-x-6 gap-y-2 lg:flex lg:space-x-8;
|
|
121
|
+
// @apply max-w-full overflow-x-auto grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-x-6 gap-y-2 lg:flex lg:space-x-8;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&--xs {
|
|
126
|
+
.rsui-card__meta {
|
|
127
|
+
@apply grid-cols-2;
|
|
128
|
+
// @apply max-w-full overflow-x-auto grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-x-6 gap-y-2 lg:flex lg:space-x-8;
|
|
129
|
+
}
|
|
114
130
|
}
|
|
131
|
+
|
|
132
|
+
&--sm {
|
|
133
|
+
.rsui-card__meta {
|
|
134
|
+
@apply grid-cols-2;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
&--md {
|
|
140
|
+
.rsui-card__meta {
|
|
141
|
+
@apply grid-cols-3;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&--lg {
|
|
146
|
+
.rsui-card__meta {
|
|
147
|
+
@apply flex space-x-8;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&--xl {
|
|
152
|
+
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&--2xl {
|
|
156
|
+
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&--3xl {
|
|
160
|
+
|
|
161
|
+
}
|
|
162
|
+
|
|
115
163
|
}
|
|
116
164
|
</style>
|
|
File without changes
|