@redseed/redseed-ui-vue3 5.1.4 → 5.3.0

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/index.js CHANGED
@@ -4,6 +4,7 @@ window._ = _
4
4
  import lottie from 'lottie-web'
5
5
  window.lottie = lottie
6
6
 
7
+ export * from './src/components/ActivityFeeds'
7
8
  export * from './src/components/Avatar'
8
9
  export * from './src/components/Badge'
9
10
  export * from './src/components/Breadcrumbs'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redseed/redseed-ui-vue3",
3
- "version": "5.1.4",
3
+ "version": "5.3.0",
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,32 @@
1
+ <script setup>
2
+ const props = defineProps({
3
+ divider: {
4
+ type: [String, Boolean],
5
+ default: 'line',
6
+ validator: value => ['line', 'connector', false].includes(value),
7
+ },
8
+ })
9
+ </script>
10
+
11
+ <template>
12
+ <div :class="[
13
+ 'rsui-activity-feed',
14
+ {
15
+ 'rsui-activity-feed--line': divider === 'line',
16
+ }
17
+ ]">
18
+ <slot></slot>
19
+ </div>
20
+ </template>
21
+
22
+ <style lang="scss" scoped>
23
+ .rsui-activity-feed {
24
+ @apply flex flex-col gap-8 max-w-xs;
25
+
26
+ &--line {
27
+ & > *:not(:last-child) {
28
+ @apply after:absolute after:inset-x-0 after:-bottom-4 after:border-t after:border-rsui-grey-400;
29
+ }
30
+ }
31
+ }
32
+ </style>
@@ -0,0 +1,178 @@
1
+ <script setup>
2
+ import { UserIcon } from '@heroicons/vue/24/outline'
3
+
4
+ const props = defineProps({
5
+ clickable: {
6
+ type: Boolean,
7
+ default: false,
8
+ },
9
+ status: {
10
+ type: [String, Boolean],
11
+ default: false,
12
+ validator: value => [false, true, 'online', 'busy'].includes(value),
13
+ },
14
+ padded: {
15
+ type: Boolean,
16
+ default: false,
17
+ },
18
+ showDot: {
19
+ type: Boolean,
20
+ default: false,
21
+ },
22
+ })
23
+
24
+ const emit = defineEmits(['click'])
25
+
26
+ function handleClick() {
27
+ if (!props.clickable) return
28
+
29
+ emit('click')
30
+ }
31
+ </script>
32
+
33
+ <template>
34
+ <div
35
+ :class="[
36
+ 'rsui-feed-item',
37
+ {
38
+ 'rsui-feed-item--clickable': clickable,
39
+ 'rsui-feed-item--padded': padded,
40
+ }
41
+ ]"
42
+ @click="handleClick"
43
+ >
44
+
45
+ <div class="rsui-feed-item__avatar">
46
+
47
+ <slot name="avatar">
48
+ <UserIcon />
49
+ </slot>
50
+
51
+ <div v-if="status !== false"
52
+ class="rsui-feed-item__avatar-indicator"
53
+ >
54
+ <slot name="avatar-indicator"
55
+ :status="status"
56
+ >
57
+ <div :class="[
58
+ 'rsui-feed-item__avatar-indicator-dot',
59
+ {
60
+ 'rsui-feed-item__avatar-indicator-dot--online': status === 'online',
61
+ 'rsui-feed-item__avatar-indicator-dot--busy': status === 'busy',
62
+ }
63
+ ]"></div>
64
+ </slot>
65
+ </div>
66
+
67
+ </div>
68
+
69
+ <div class="rsui-feed-item__body">
70
+
71
+ <div class="rsui-feed-item__header">
72
+
73
+ <div class="rsui-feed-item__heading">
74
+
75
+ <div class="rsui-feed-item__heading-text">
76
+ <slot name="heading"></slot>
77
+ </div>
78
+
79
+ <div v-if="$slots.subheading"
80
+ class="rsui-feed-item__heading-subtext"
81
+ >
82
+ <slot name="subheading"></slot>
83
+ </div>
84
+
85
+ </div>
86
+
87
+ <div v-if="$slots['supporting-text']"
88
+ class="rsui-feed-item__supporting-text"
89
+ >
90
+ <slot name="supporting-text"></slot>
91
+ </div>
92
+
93
+ </div>
94
+
95
+ <div v-if="$slots.content"
96
+ class="rsui-feed-item__content"
97
+ >
98
+ <slot name="content"></slot>
99
+ </div>
100
+
101
+ </div>
102
+
103
+ <div v-if="showDot && $slots.dot"
104
+ class="rsui-feed-item__dot"
105
+ >
106
+ <slot name="dot"></slot>
107
+ </div>
108
+
109
+ </div>
110
+ </template>
111
+
112
+ <style lang="scss" scoped>
113
+ .rsui-feed-item {
114
+ @apply relative flex flex-nowrap gap-3 border border-transparent rounded-lg;
115
+
116
+ &--clickable {
117
+ @apply cursor-pointer;
118
+ }
119
+
120
+ &--padded {
121
+ @apply p-2;
122
+ }
123
+
124
+ &__avatar {
125
+ @apply relative shrink-0 size-12 rounded-full flex items-center justify-center;
126
+ @apply bg-rsui-grey-100 border border-rsui-grey-200;
127
+
128
+ :deep(> svg) {
129
+ @apply size-7 text-rsui-grey-500;
130
+ }
131
+ }
132
+
133
+ &__avatar-indicator {
134
+ @apply absolute -bottom-0.5 -right-0.5;
135
+ @apply flex items-center justify-center size-4;
136
+ }
137
+
138
+ &__avatar-indicator-dot {
139
+ @apply size-4 rounded-full bg-rsui-grey-300 border-2 border-white;
140
+
141
+ &--online {
142
+ @apply bg-rsui-success-500;
143
+ }
144
+
145
+ &--busy {
146
+ @apply bg-rsui-error-500;
147
+ }
148
+ }
149
+
150
+ &__body {
151
+ @apply flex-1 flex flex-col gap-3;
152
+ }
153
+
154
+ &__header {
155
+ @apply flex flex-col;
156
+ }
157
+
158
+ &__heading {
159
+ @apply flex flex-wrap items-center gap-x-2;
160
+ }
161
+
162
+ &__heading-text {
163
+ @apply shrink-0 text-sm font-medium text-rsui-grey-800;
164
+ }
165
+
166
+ &__heading-subtext {
167
+ @apply text-xs text-rsui-grey-700;
168
+ }
169
+
170
+ &__supporting-text {
171
+ @apply text-sm font-medium text-rsui-grey-700;
172
+ }
173
+
174
+ &__dot {
175
+ @apply relative shrink-0;
176
+ }
177
+ }
178
+ </style>
@@ -0,0 +1,7 @@
1
+ import ActivityFeed from './ActivityFeed.vue'
2
+ import FeedItem from './FeedItem.vue'
3
+
4
+ export {
5
+ ActivityFeed,
6
+ FeedItem,
7
+ }
@@ -0,0 +1,65 @@
1
+ <script setup>
2
+ import Card from './Card.vue'
3
+
4
+ const emit = defineEmits(['click:icon'])
5
+
6
+ function handleIconClick() {
7
+ emit('click:icon')
8
+ }
9
+ </script>
10
+
11
+ <template>
12
+ <Card class="rsui-metric-card">
13
+ <div class="rsui-metric-card__container">
14
+ <div class="rsui-metric-card__header">
15
+ <div class="rsui-metric-card__avatar">
16
+ <slot name="avatar"></slot>
17
+ </div>
18
+ <div class="rsui-metric-card__icon"
19
+ @click="handleIconClick"
20
+ >
21
+ <slot name="icon"></slot>
22
+ </div>
23
+ </div>
24
+
25
+ <div class="rsui-metric-card__content">
26
+ <div class="rsui-metric-card__title" v-if="$slots.title">
27
+ <slot name="title"></slot>
28
+ </div>
29
+ <div class="rsui-metric-card__value" v-if="$slots.value">
30
+ <slot name="value"></slot>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ </Card>
35
+ </template>
36
+
37
+ <style lang="scss" scoped>
38
+ .rsui-metric-card {
39
+ @apply w-64 sm:w-96;
40
+
41
+ &__header {
42
+ @apply flex items-center justify-between;
43
+ }
44
+
45
+ &__avatar {
46
+ @apply size-14 rounded-full overflow-hidden flex items-center justify-center pointer-events-auto;
47
+ }
48
+
49
+ &__icon {
50
+ @apply text-rsui-grey-800 transition-transform pointer-events-auto cursor-pointer size-6;
51
+ }
52
+
53
+ &__content {
54
+ @apply flex flex-col gap-2;
55
+ }
56
+
57
+ &__title {
58
+ @apply text-sm font-normal text-rsui-grey-700 mt-4;
59
+ }
60
+
61
+ &__value {
62
+ @apply text-3xl font-semibold text-rsui-grey-900 leading-9;
63
+ }
64
+ }
65
+ </style>
@@ -3,11 +3,12 @@ import Card from './Card.vue'
3
3
  import CardHeader from './CardHeader.vue'
4
4
  import CardResource from './CardResource.vue'
5
5
  import RadioCard from './RadioCard.vue'
6
-
6
+ import MetricCard from './MetricCard.vue'
7
7
  export {
8
8
  ButtonCard,
9
9
  Card,
10
10
  CardHeader,
11
11
  CardResource,
12
12
  RadioCard,
13
+ MetricCard,
13
14
  }