@everchron/ec-shards 4.0.2 → 4.1.1
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/dist/ec-shards.common.js +147 -27
- package/dist/ec-shards.common.js.map +1 -1
- package/dist/ec-shards.css +1 -1
- package/dist/ec-shards.umd.js +147 -27
- package/dist/ec-shards.umd.js.map +1 -1
- package/dist/ec-shards.umd.min.js +2 -2
- package/dist/ec-shards.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/data-list-item/data-list-item.vue +3 -3
- package/src/components/entry-link/entry-link.vue +156 -0
- package/src/components/index.js +2 -0
- package/src/stories/entry-link/entry-link.stories.js +38 -0
package/package.json
CHANGED
|
@@ -147,11 +147,11 @@
|
|
|
147
147
|
|
|
148
148
|
.ecs-data-list-data{
|
|
149
149
|
a:not(.ecs-button){
|
|
150
|
-
color: $color-blue-
|
|
150
|
+
color: $color-blue-9;
|
|
151
151
|
cursor: pointer;
|
|
152
152
|
|
|
153
153
|
&:hover{
|
|
154
|
-
color: $color-blue-
|
|
154
|
+
color: $color-blue-10;
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
.subtle{
|
|
163
|
-
color: $color-gray-
|
|
163
|
+
color: $color-gray-9;
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
li{
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ecs-entry-link" @click.stop="handleClick">
|
|
3
|
+
<ecs-icon v-if="icon" :type="icon" size="20" class="entry-icon" />
|
|
4
|
+
<div v-if="$slots.prepender" class="prepend">
|
|
5
|
+
<!-- @slot Slot for additional prepended content that should preceed the title. Use with care. -->
|
|
6
|
+
<slot name="prepender"></slot>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="ecs-entry-link-label" :class="emphasized ? 'emphasized' : ''">{{ label }}</div>
|
|
9
|
+
<div v-if="$slots.appender" class="append">
|
|
10
|
+
<!-- @slot Slot for additional appended content that should follow the title. Use with care. -->
|
|
11
|
+
<slot name="appender"></slot>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<ecs-button-more v-if="moreButton" @click.stop="handleMoreButtonClick" type="ellipsis" :title="moreButtonTitle" />
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
import EcsIcon from '../icon/icon'
|
|
20
|
+
import EcsButtonMore from '../button-more/button-more'
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
components: {
|
|
24
|
+
EcsIcon,
|
|
25
|
+
EcsButtonMore
|
|
26
|
+
},
|
|
27
|
+
props: {
|
|
28
|
+
/** If set, an icon will be added to the left of the button. The list of available icon names can be found [here](https://github.com/everchron/ec-shards/tree/main/src/assets/icons). */
|
|
29
|
+
icon: {
|
|
30
|
+
type: String
|
|
31
|
+
},
|
|
32
|
+
/** The text content of the link. */
|
|
33
|
+
label: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: true
|
|
36
|
+
},
|
|
37
|
+
/** Determines if the (...) more button will be shown. */
|
|
38
|
+
moreButton: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
/** Sets the title of the (...) more button. */
|
|
43
|
+
moreButtonTitle: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: "Show Details"
|
|
46
|
+
},
|
|
47
|
+
/** Sets the font-weight of the label to bold. */
|
|
48
|
+
emphasized: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
computed: {
|
|
55
|
+
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
methods: {
|
|
59
|
+
handleClick(e){
|
|
60
|
+
/** Emitted when the link itself is clicked. */
|
|
61
|
+
this.$emit('linkClick', e)
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
handleMoreButtonClick(e){
|
|
65
|
+
/** Emitted when the more (...) button is clicked. */
|
|
66
|
+
this.$emit('moreClick', e)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<style lang="scss" scoped>
|
|
73
|
+
@import "../../tokens/build/scss/tokens.scss";
|
|
74
|
+
|
|
75
|
+
.ecs-entry-link{
|
|
76
|
+
display: inline-flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
user-select: none;
|
|
79
|
+
font-size: $type-scale-3-font-size;
|
|
80
|
+
line-height: $type-scale-3-line-height;
|
|
81
|
+
border-radius: $border-radius-small;
|
|
82
|
+
padding: 0 $spacing-5;
|
|
83
|
+
position: relative;
|
|
84
|
+
transition: .2s color, .2s background, .2s box-shadow, .2s opacity;
|
|
85
|
+
white-space: nowrap;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
z-index: 0;
|
|
88
|
+
flex-shrink: 0;
|
|
89
|
+
max-width: 100%;
|
|
90
|
+
color: $color-gray-15;
|
|
91
|
+
|
|
92
|
+
&:after{
|
|
93
|
+
content: "";
|
|
94
|
+
background: rgba($color-gray-8, .07);
|
|
95
|
+
position: absolute;
|
|
96
|
+
inset: 0;
|
|
97
|
+
opacity: 0;
|
|
98
|
+
transform: scale(.8);
|
|
99
|
+
transition: opacity .15s ease-in-out, transform .3s cubic-bezier(0.3, 0.76, 0.27, 1);
|
|
100
|
+
border-radius: $border-radius-small;
|
|
101
|
+
z-index: -1;
|
|
102
|
+
pointer-events: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&:hover{
|
|
106
|
+
&:after{
|
|
107
|
+
opacity: 1;
|
|
108
|
+
transform: scale(1);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.entry-icon{
|
|
112
|
+
color: $color-gray-7;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&:disabled{
|
|
117
|
+
opacity: .5;
|
|
118
|
+
cursor: default;
|
|
119
|
+
filter: saturate(0);
|
|
120
|
+
|
|
121
|
+
&:after{
|
|
122
|
+
opacity: 0;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.entry-icon{
|
|
127
|
+
color: $color-gray-6;
|
|
128
|
+
margin: 0 $spacing-5 0 -2px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&-label{
|
|
132
|
+
flex: 1;
|
|
133
|
+
min-width: 0;
|
|
134
|
+
text-overflow: ellipsis;
|
|
135
|
+
white-space: nowrap;
|
|
136
|
+
overflow: hidden;
|
|
137
|
+
|
|
138
|
+
&.emphasized{
|
|
139
|
+
font-weight: $font-weight-medium;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.ecs-button-more-ellipsis{
|
|
144
|
+
margin: 0 $spacing-5 0 $spacing-10;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.prepend{
|
|
148
|
+
color: $color-gray-11;
|
|
149
|
+
margin: 0 $spacing-10 0 0;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.append{
|
|
153
|
+
margin: 0 0 0 $spacing-10;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
</style>
|
package/src/components/index.js
CHANGED
|
@@ -44,6 +44,7 @@ import EcsDocumentState from "./document-state/document-state.vue"
|
|
|
44
44
|
import EcsDropdown from "./dropdown/dropdown.vue"
|
|
45
45
|
import EcsDropzone from "./dropzone/dropzone.vue"
|
|
46
46
|
import EcsEmptyState from "./empty-state/empty-state.vue"
|
|
47
|
+
import EcsEntryLink from "./entry-link/entry-link.vue"
|
|
47
48
|
import EcsExcerptSnippet from "./excerpt-snippet/excerpt-snippet.vue"
|
|
48
49
|
import EcsFavicon from "./favicon/favicon.vue"
|
|
49
50
|
import EcsFileIcon from "./file-icon/file-icon.vue"
|
|
@@ -172,6 +173,7 @@ const Components = {
|
|
|
172
173
|
EcsDropdown,
|
|
173
174
|
EcsDropzone,
|
|
174
175
|
EcsEmptyState,
|
|
176
|
+
EcsEntryLink,
|
|
175
177
|
EcsExcerptSnippet,
|
|
176
178
|
EcsFavicon,
|
|
177
179
|
EcsFileIcon,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import EcsEntryLink from '@components/entry-link/entry-link';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Action/Entry Link',
|
|
5
|
+
component: EcsEntryLink
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const entryLink = () => ({
|
|
9
|
+
components: { EcsEntryLink },
|
|
10
|
+
template: `<ecs-entry-link icon="transcript" label="Entry Link Headline" />`,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const entryLinkEmphasized = () => ({
|
|
14
|
+
components: { EcsEntryLink },
|
|
15
|
+
template: `<ecs-entry-link icon="transcript" emphasized label="Entry Link Headline" />`,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const entryLinkMoreButton = () => ({
|
|
19
|
+
components: { EcsEntryLink },
|
|
20
|
+
template: `<ecs-entry-link icon="transcript" emphasized label="Entry Link Headline" more-button />`,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const entryLinkEscaping = () => ({
|
|
24
|
+
components: { EcsEntryLink },
|
|
25
|
+
template: `<div style="width:500px">
|
|
26
|
+
<ecs-entry-link icon="transcript" label="Entry Link Headline does automatically escape while appender and prepender stay visible"></ecs-entry-link>
|
|
27
|
+
</div>`,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const entryLinkAppendingPrepending = () => ({
|
|
31
|
+
components: { EcsEntryLink },
|
|
32
|
+
template: `<div style="width:500px">
|
|
33
|
+
<ecs-entry-link icon="transcript" label="Entry Link Headline" emphasized>
|
|
34
|
+
<template slot="prepender">01/01/2023</template>
|
|
35
|
+
<template slot="appender">Vol. II</template>
|
|
36
|
+
</ecs-entry-link>
|
|
37
|
+
</div>`,
|
|
38
|
+
});
|