@redseed/redseed-ui-vue3 5.1.3 → 5.2.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
package/package.json
CHANGED
|
@@ -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>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { ref, computed } from 'vue'
|
|
2
|
+
import { ref, computed, watch } from 'vue'
|
|
3
3
|
import { ArrowUpIcon, ChevronUpDownIcon } from '@heroicons/vue/24/outline'
|
|
4
4
|
|
|
5
5
|
const props = defineProps({
|
|
@@ -18,9 +18,13 @@ const props = defineProps({
|
|
|
18
18
|
const sortable = computed(() => props.sort !== false)
|
|
19
19
|
|
|
20
20
|
const isAsc = ref(props.sort === 'asc')
|
|
21
|
-
|
|
22
21
|
const isDesc = ref(props.sort === 'desc')
|
|
23
22
|
|
|
23
|
+
watch(() => props.sort, () => {
|
|
24
|
+
isAsc.value = props.sort === 'asc'
|
|
25
|
+
isDesc.value = props.sort === 'desc'
|
|
26
|
+
})
|
|
27
|
+
|
|
24
28
|
const emit = defineEmits(['sort'])
|
|
25
29
|
|
|
26
30
|
function handleSort() {
|