@redseed/redseed-ui-vue3 2.15.3 → 2.17.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 +3 -1
- package/package.json +1 -1
- package/src/components/LinkedList/LinkedList.vue +21 -0
- package/src/components/LinkedList/LinkedListCard.vue +51 -0
- package/src/components/LinkedList/index.js +7 -0
- package/src/components/Switcher/Switcher.vue +58 -0
- package/src/components/Switcher/SwitcherItem.vue +36 -0
- package/src/components/Switcher/index.js +7 -0
package/index.js
CHANGED
|
@@ -11,6 +11,7 @@ export * from './src/components/Form'
|
|
|
11
11
|
export * from './src/components/FormField'
|
|
12
12
|
export * from './src/components/Image'
|
|
13
13
|
export * from './src/components/Link'
|
|
14
|
+
export * from './src/components/LinkedList'
|
|
14
15
|
export * from './src/components/List'
|
|
15
16
|
export * from './src/components/Loader'
|
|
16
17
|
export * from './src/components/Logo'
|
|
@@ -23,5 +24,6 @@ export * from './src/components/Progress'
|
|
|
23
24
|
export * from './src/components/SectionHeading'
|
|
24
25
|
export * from './src/components/Social'
|
|
25
26
|
export * from './src/components/Sorting'
|
|
27
|
+
export * from './src/components/Switcher'
|
|
26
28
|
export * from './src/components/Toggle'
|
|
27
|
-
export * from './src/components/TwoColumnLayout'
|
|
29
|
+
export * from './src/components/TwoColumnLayout'
|
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<template>
|
|
5
|
+
<ul class="rsui-linked-list">
|
|
6
|
+
<slot></slot>
|
|
7
|
+
</ul>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<style lang="scss" scoped>
|
|
11
|
+
.rsui-linked-list {
|
|
12
|
+
list-style-type: none;
|
|
13
|
+
padding: 0;
|
|
14
|
+
margin: 0;
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
status: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: 'default',
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const statusClass = computed(() => `rsui-linked-list-item__status--${props.status}`);
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<li class="rsui-linked-list-item">
|
|
16
|
+
<div class="rsui-linked-list-item__line"></div>
|
|
17
|
+
<div class="rsui-linked-list-item__status" :class="statusClass"></div>
|
|
18
|
+
<div class="rsui-linked-list-item__content">
|
|
19
|
+
<div class="rsui-linked-list-item__title">
|
|
20
|
+
<slot name="title"></slot>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="rsui-linked-list-item__body">
|
|
23
|
+
<slot name="body"></slot>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</li>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<style lang="scss" scoped>
|
|
30
|
+
.rsui-linked-list-item {
|
|
31
|
+
@apply pl-[30px] pb-[30px] relative;
|
|
32
|
+
&__line {
|
|
33
|
+
@apply absolute top-[10px] left-[4px] bg-[#eee] w-[2px] h-[calc(100%-10px)];
|
|
34
|
+
}
|
|
35
|
+
&__status {
|
|
36
|
+
@apply absolute top-[6.5px] left-0 z-[1] w-[10px] h-[10px] bg-[#eee] rounded-full border-white;
|
|
37
|
+
}
|
|
38
|
+
&:last-child {
|
|
39
|
+
@apply pb-0;
|
|
40
|
+
.rsui-linked-list-item__line {
|
|
41
|
+
@apply h-[calc(100%-10px)];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
&__title {
|
|
45
|
+
@apply font-bold mb-[5px];
|
|
46
|
+
}
|
|
47
|
+
&__body {
|
|
48
|
+
@apply font-normal;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</style>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import SwitcherItem from './SwitcherItem.vue'
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
items: {
|
|
7
|
+
type: Array,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
full: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: false,
|
|
13
|
+
},
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const emit = defineEmits(['change'])
|
|
17
|
+
|
|
18
|
+
const activeItem = ref(props.items.find(item => item.active) || props.items[0])
|
|
19
|
+
|
|
20
|
+
function setActiveItem(item) {
|
|
21
|
+
if (activeItem.value == item) return
|
|
22
|
+
activeItem.value = item
|
|
23
|
+
emit('change', item)
|
|
24
|
+
}
|
|
25
|
+
</script>
|
|
26
|
+
<template>
|
|
27
|
+
<div class="rsui-switcher"
|
|
28
|
+
:class="{
|
|
29
|
+
'rsui-switcher--full': props.full,
|
|
30
|
+
}"
|
|
31
|
+
>
|
|
32
|
+
<SwitcherItem v-for="item in items"
|
|
33
|
+
:key="item.id"
|
|
34
|
+
:active="activeItem.id == item.id"
|
|
35
|
+
@click="setActiveItem(item)"
|
|
36
|
+
>
|
|
37
|
+
<component v-if="item.icon"
|
|
38
|
+
:is="item.icon"
|
|
39
|
+
></component>
|
|
40
|
+
{{ item.label }}
|
|
41
|
+
</SwitcherItem>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
<style lang="scss" scoped>
|
|
45
|
+
.rsui-switcher {
|
|
46
|
+
@apply w-fit flex flex-col sm:flex-row sm:items-center overflow-hidden;
|
|
47
|
+
@apply bg-rsui-grey-150 p-1 rounded-lg;
|
|
48
|
+
&--full {
|
|
49
|
+
@apply w-full;
|
|
50
|
+
:deep(.rsui-switcher-item) {
|
|
51
|
+
@apply flex-1;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
:deep(.rsui-switcher-item) {
|
|
55
|
+
@apply w-full sm:w-fit;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
</style>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
active: {
|
|
4
|
+
type: Boolean,
|
|
5
|
+
default: false,
|
|
6
|
+
}
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
defineEmits(['click'])
|
|
10
|
+
</script>
|
|
11
|
+
<template>
|
|
12
|
+
<div class="rsui-switcher-item"
|
|
13
|
+
:class="{
|
|
14
|
+
'rsui-switcher-item--active': props.active,
|
|
15
|
+
}"
|
|
16
|
+
@click="$emit('click')"
|
|
17
|
+
>
|
|
18
|
+
<slot></slot>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
<style lang="scss" scoped>
|
|
22
|
+
.rsui-switcher-item {
|
|
23
|
+
// default control
|
|
24
|
+
@apply h-fit inline-flex shrink-0 items-center justify-center select-none outline-none whitespace-nowrap will-change-transform cursor-pointer;
|
|
25
|
+
// default shape
|
|
26
|
+
@apply font-semibold gap-2 rounded-md border border-transparent transition;
|
|
27
|
+
// default size
|
|
28
|
+
@apply text-base px-3 py-2;
|
|
29
|
+
&--active {
|
|
30
|
+
@apply bg-white text-rsui-default border-rsui-grey-200;
|
|
31
|
+
}
|
|
32
|
+
:deep(svg) {
|
|
33
|
+
@apply size-6;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
</style>
|