@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redseed/redseed-ui-vue3",
3
- "version": "6.4.0",
3
+ "version": "6.4.2",
4
4
  "description": "RedSeed UI Vue 3 components",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/redseedtraining/redseed-ui",
@@ -0,0 +1,10 @@
1
+ <script setup>
2
+ import Badge from './Badge.vue'
3
+ </script>
4
+ <template>
5
+ <Badge error>
6
+ <slot></slot>
7
+ </Badge>
8
+ </template>
9
+ <style lang="scss" scoped>
10
+ </style>
@@ -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
- <div v-if="clickable"
44
- class="rsui-card__action-layer"
45
- :title="$attrs.title"
46
- @click="onClick"
47
- ></div>
48
-
49
- <div v-if="$slots.image"
50
- class="rsui-card__image"
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
- <div v-if="$slots.header"
56
- class="rsui-card__header"
57
- :title="$attrs.title"
58
- >
59
- <slot name="header"></slot>
60
-
61
- </div>
62
- <div v-if="$slots.default || $slots.meta" :class="[
63
- 'rsui-card__content',
64
- { 'rsui-card__content--padded': padded },
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 sm:grid-cols-2 gap-x-6 gap-y-2 lg:flex lg:space-x-8;
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>
@@ -7,6 +7,6 @@
7
7
  </template>
8
8
  <style lang="scss">
9
9
  .rsui-single-column-layout {
10
- @apply mx-auto w-full max-w-3xl;
10
+ @apply w-full max-w-3xl;
11
11
  }
12
12
  </style>