@everchron/ec-shards 1.0.2 → 1.0.3
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 +125 -57
- package/dist/ec-shards.common.js.map +1 -1
- package/dist/ec-shards.css +1 -1
- package/dist/ec-shards.umd.js +125 -57
- 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/button/button.vue +85 -10
- package/src/components/button-group/button-group.vue +14 -0
- package/src/components/index.js +2 -0
- package/src/components/tab-button/tab-button.vue +1 -1
- package/src/stories/Changelog.stories.mdx +14 -3
- package/src/stories/alert/alert.stories.js +1 -1
- package/src/stories/button/button.stories.js +52 -2
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<a v-if="href" :href="href" :target="target"
|
|
2
|
+
<a v-if="href && !addon" :href="href" :target="target"
|
|
3
3
|
class="ecs-button"
|
|
4
4
|
:class="[
|
|
5
5
|
typeClass,
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<slot></slot>
|
|
18
18
|
</a>
|
|
19
19
|
|
|
20
|
-
<button v-else
|
|
20
|
+
<button v-else-if="!addon"
|
|
21
21
|
class="ecs-button"
|
|
22
22
|
:class="[
|
|
23
23
|
typeClass,
|
|
@@ -34,6 +34,18 @@
|
|
|
34
34
|
<ecs-icon v-if="icon || loading" :type="iconType" :width="iconSize" :height="iconSize" />
|
|
35
35
|
<slot></slot>
|
|
36
36
|
</button>
|
|
37
|
+
|
|
38
|
+
<button v-else
|
|
39
|
+
class="ecs-button ecs-button-addon"
|
|
40
|
+
:class="[
|
|
41
|
+
typeClass,
|
|
42
|
+
sizeClass,
|
|
43
|
+
active ? `active` : '',]"
|
|
44
|
+
@click="$emit('click', $event)">
|
|
45
|
+
<svg width="8" height="6" viewBox="0 0 8 6" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
46
|
+
<path d="M1 1.5L4 4.5L7 1.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
47
|
+
</svg>
|
|
48
|
+
</button>
|
|
37
49
|
</template>
|
|
38
50
|
|
|
39
51
|
<script>
|
|
@@ -73,7 +85,9 @@
|
|
|
73
85
|
/** If the button should act as a link, you can set the href with this prop. */
|
|
74
86
|
href: String,
|
|
75
87
|
/** If the button should act as a link, this allows you to modify the target attribute. */
|
|
76
|
-
target: String
|
|
88
|
+
target: String,
|
|
89
|
+
/** Renders a small dropdown add-on button variant, which should only be used in combination with a regular button, and within an `EcsButtonGroup`. */
|
|
90
|
+
addon: Boolean
|
|
77
91
|
},
|
|
78
92
|
|
|
79
93
|
computed: {
|
|
@@ -219,7 +233,7 @@
|
|
|
219
233
|
}
|
|
220
234
|
|
|
221
235
|
&:focus{
|
|
222
|
-
box-shadow: 0 0 0 2px $color-blue-
|
|
236
|
+
box-shadow: 0 0 0 2px rgba($color-blue-8, .1);
|
|
223
237
|
}
|
|
224
238
|
|
|
225
239
|
&:active,
|
|
@@ -247,7 +261,7 @@
|
|
|
247
261
|
}
|
|
248
262
|
|
|
249
263
|
&:focus{
|
|
250
|
-
box-shadow: 0 0 0 2px $color-gray-
|
|
264
|
+
box-shadow: 0 0 0 2px rgba($color-gray-8, .1);
|
|
251
265
|
}
|
|
252
266
|
|
|
253
267
|
&:active,
|
|
@@ -275,7 +289,7 @@
|
|
|
275
289
|
}
|
|
276
290
|
|
|
277
291
|
&:focus{
|
|
278
|
-
box-shadow: 0 0 0 2px $color-red-
|
|
292
|
+
box-shadow: 0 0 0 2px rgba($color-red-8, .1);
|
|
279
293
|
color: $color-red-9;
|
|
280
294
|
}
|
|
281
295
|
|
|
@@ -299,7 +313,7 @@
|
|
|
299
313
|
}
|
|
300
314
|
|
|
301
315
|
&:focus{
|
|
302
|
-
box-shadow: 0 0 0 2px $color-red-
|
|
316
|
+
box-shadow: 0 0 0 2px rgba($color-red-8, .1);
|
|
303
317
|
color: $color-red-9;
|
|
304
318
|
}
|
|
305
319
|
|
|
@@ -323,7 +337,7 @@
|
|
|
323
337
|
}
|
|
324
338
|
|
|
325
339
|
&:focus{
|
|
326
|
-
box-shadow: 0 0 0 2px $color-yellow-
|
|
340
|
+
box-shadow: 0 0 0 2px rgba($color-yellow-7, .2);
|
|
327
341
|
}
|
|
328
342
|
|
|
329
343
|
&:active,
|
|
@@ -348,7 +362,7 @@
|
|
|
348
362
|
}
|
|
349
363
|
|
|
350
364
|
&:focus{
|
|
351
|
-
box-shadow: 0 0 0 3px $color-green-
|
|
365
|
+
box-shadow: 0 0 0 3px rgba($color-green-10, .1);
|
|
352
366
|
}
|
|
353
367
|
|
|
354
368
|
&:active,
|
|
@@ -367,7 +381,7 @@
|
|
|
367
381
|
}
|
|
368
382
|
|
|
369
383
|
&:focus{
|
|
370
|
-
box-shadow: 0 0 0 3px $color-blue-
|
|
384
|
+
box-shadow: 0 0 0 3px rgba($color-blue-10, .1);
|
|
371
385
|
}
|
|
372
386
|
|
|
373
387
|
&:active,
|
|
@@ -400,4 +414,65 @@
|
|
|
400
414
|
}
|
|
401
415
|
}
|
|
402
416
|
}
|
|
417
|
+
|
|
418
|
+
.ecs-button-addon{
|
|
419
|
+
&.ecs-button-sml{
|
|
420
|
+
padding: 0 $spacing-5;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
&.ecs-button-md{
|
|
424
|
+
padding: 0 6px;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
&.ecs-button-lg{
|
|
428
|
+
padding: 0 $spacing-10;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
&.ecs-button-primary,
|
|
432
|
+
&.ecs-button-secondary,
|
|
433
|
+
&.ecs-button-danger,
|
|
434
|
+
&.ecs-button-danger-vibrant,
|
|
435
|
+
&.ecs-button-warning{
|
|
436
|
+
&:before{
|
|
437
|
+
content: "";
|
|
438
|
+
background: rgba($color-gray-12, .1);
|
|
439
|
+
width: 1px;
|
|
440
|
+
height: 60%;
|
|
441
|
+
border-radius: 1px;
|
|
442
|
+
position: absolute;
|
|
443
|
+
left: -1px;
|
|
444
|
+
top: 20%;
|
|
445
|
+
transition: .5s;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
&:hover:before{
|
|
449
|
+
opacity: 0;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.ecs-button-group{
|
|
455
|
+
.ecs-button-create,
|
|
456
|
+
.ecs-button-vibrant{
|
|
457
|
+
border-radius: 0;
|
|
458
|
+
border-right: 1px solid;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.ecs-button-create{
|
|
462
|
+
border-color: $color-green-10;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.ecs-button-create:first-child,
|
|
466
|
+
.ecs-button-vibrant:first-child{
|
|
467
|
+
border-top-left-radius: $border-radius-small;
|
|
468
|
+
border-bottom-left-radius: $border-radius-small;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
.ecs-button-create:last-child,
|
|
472
|
+
.ecs-button-vibrant:last-child{
|
|
473
|
+
border-top-right-radius: $border-radius-small;
|
|
474
|
+
border-bottom-right-radius: $border-radius-small;
|
|
475
|
+
border-right: none;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
403
478
|
</style>
|
package/src/components/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import EcsBreadcrumb from "./breadcrumb/breadcrumb.vue"
|
|
|
10
10
|
import EcsBreadcrumbButton from "./breadcrumb-button/breadcrumb-button.vue"
|
|
11
11
|
import EcsBreadcrumbTitle from "./breadcrumb-title/breadcrumb-title.vue"
|
|
12
12
|
import EcsButton from "./button/button.vue"
|
|
13
|
+
import EcsButtonGroup from "./button-group/button-group.vue"
|
|
13
14
|
import EcsButtonCollapse from "./button-collapse/button-collapse.vue"
|
|
14
15
|
import EcsButtonContext from "./button-context/button-context.vue"
|
|
15
16
|
import EcsButtonContextGroup from "./button-context-group/button-context-group.vue"
|
|
@@ -128,6 +129,7 @@ const Components = {
|
|
|
128
129
|
EcsBreadcrumbButton,
|
|
129
130
|
EcsBreadcrumbTitle,
|
|
130
131
|
EcsButton,
|
|
132
|
+
EcsButtonGroup,
|
|
131
133
|
EcsButtonCollapse,
|
|
132
134
|
EcsButtonContext,
|
|
133
135
|
EcsButtonContextGroup,
|
|
@@ -6,7 +6,18 @@ import { Meta } from '@storybook/addon-docs/blocks';
|
|
|
6
6
|
Changelog
|
|
7
7
|
</h1>
|
|
8
8
|
|
|
9
|
-
## Version 1.0.
|
|
9
|
+
## Version 1.0.3 (21 August 2022)
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- Added new `addon` prop for EcsButton, which renders a small dropdown addition.
|
|
14
|
+
- Added new EcsButtonGroup component to create groups of regular Buttons, as well as dropdown addons.
|
|
15
|
+
|
|
16
|
+
### Fixes
|
|
17
|
+
|
|
18
|
+
- Fixed positioning of stickers on column EcsTabButton variant
|
|
19
|
+
|
|
20
|
+
## Version 1.0.2 (16 August 2022)
|
|
10
21
|
|
|
11
22
|
### Fixes
|
|
12
23
|
|
|
@@ -14,13 +25,13 @@ import { Meta } from '@storybook/addon-docs/blocks';
|
|
|
14
25
|
- Replaced old add icon with new add icon
|
|
15
26
|
- EcsButton type `create` icons are now white instead of dark green
|
|
16
27
|
|
|
17
|
-
## Version 1.0.1 (
|
|
28
|
+
## Version 1.0.1 (19 August 2022)
|
|
18
29
|
|
|
19
30
|
### Fixes
|
|
20
31
|
|
|
21
32
|
- Changed standard EcsTabButton font scale to 3.
|
|
22
33
|
|
|
23
|
-
## Version 1.0.0 (
|
|
34
|
+
## Version 1.0.0 (16 August 2022)
|
|
24
35
|
|
|
25
36
|
### Features
|
|
26
37
|
|
|
@@ -28,7 +28,7 @@ export const headline = () => ({
|
|
|
28
28
|
|
|
29
29
|
export const actions = () => ({
|
|
30
30
|
components: { EcsAlert },
|
|
31
|
-
template: `<ecs-alert type="warning" dismissable action="Review" @action="">
|
|
31
|
+
template: `<ecs-alert type="warning" dismissable action-label="Review" @action="">
|
|
32
32
|
<p>This is a warning alert with a primary action — check it out!</p>
|
|
33
33
|
<ul>
|
|
34
34
|
<li>This is the first bullet point</li>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import EcsButton from '@components/button/button';
|
|
2
|
+
import EcsButtonGroup from '@components/button-group/button-group';
|
|
2
3
|
import { action } from '@storybook/addon-actions';
|
|
3
4
|
|
|
4
5
|
export default {
|
|
@@ -33,13 +34,31 @@ export const sizes = () => ({
|
|
|
33
34
|
export const withIcon = () => ({
|
|
34
35
|
components: { EcsButton },
|
|
35
36
|
methods: { action: action('clicked') },
|
|
36
|
-
template: `<
|
|
37
|
+
template: `<main>
|
|
38
|
+
<ecs-button @click="action" icon="add-plus" type="primary">Create</ecs-button>
|
|
39
|
+
<ecs-button @click="action" icon="add-plus" type="secondary">Create</ecs-button>
|
|
40
|
+
<ecs-button @click="action" icon="add-plus" type="danger">Create</ecs-button>
|
|
41
|
+
<ecs-button @click="action" icon="add-plus" type="danger-vibrant">Create</ecs-button>
|
|
42
|
+
<ecs-button @click="action" icon="add-plus" type="warning">Create</ecs-button>
|
|
43
|
+
<ecs-button @click="action" icon="add-plus" type="create">Create</ecs-button>
|
|
44
|
+
<ecs-button @click="action" icon="add-plus" type="vibrant">Create</ecs-button>
|
|
45
|
+
</main>`,
|
|
37
46
|
});
|
|
38
47
|
|
|
39
48
|
export const iconOnly = () => ({
|
|
40
49
|
components: { EcsButton },
|
|
41
50
|
methods: { action: action('clicked') },
|
|
42
|
-
template:
|
|
51
|
+
template: `
|
|
52
|
+
<main>
|
|
53
|
+
<ecs-button @click="action" icon-only icon="add-plus" type="primary"></ecs-button>
|
|
54
|
+
<ecs-button @click="action" icon-only icon="add-plus" type="secondary"></ecs-button>
|
|
55
|
+
<ecs-button @click="action" icon-only icon="add-plus" type="danger"></ecs-button>
|
|
56
|
+
<ecs-button @click="action" icon-only icon="add-plus" type="danger-vibrant"></ecs-button>
|
|
57
|
+
<ecs-button @click="action" icon-only icon="add-plus" type="warning"></ecs-button>
|
|
58
|
+
<ecs-button @click="action" icon-only icon="add-plus" type="create"></ecs-button>
|
|
59
|
+
<ecs-button @click="action" icon-only icon="add-plus" type="vibrant"></ecs-button>
|
|
60
|
+
</main>
|
|
61
|
+
`,
|
|
43
62
|
});
|
|
44
63
|
|
|
45
64
|
export const active = () => ({
|
|
@@ -58,3 +77,34 @@ export const fullWidth = () => ({
|
|
|
58
77
|
methods: { action: action('clicked') },
|
|
59
78
|
template: `<ecs-button @click="action" full-width type="vibrant">Block button</ecs-button>`,
|
|
60
79
|
});
|
|
80
|
+
|
|
81
|
+
export const grouped = () => ({
|
|
82
|
+
components: { EcsButton, EcsButtonGroup },
|
|
83
|
+
methods: { action: action('clicked') },
|
|
84
|
+
template: `<ecs-button-group>
|
|
85
|
+
<ecs-button @click="action" type="create">First</ecs-button>
|
|
86
|
+
<ecs-button @click="action" type="create">Middle</ecs-button>
|
|
87
|
+
<ecs-button @click="action" type="create">Last</ecs-button>
|
|
88
|
+
</ecs-button-group>`,
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
export const addons = () => ({
|
|
92
|
+
components: { EcsButton, EcsButtonGroup },
|
|
93
|
+
methods: { action: action('clicked') },
|
|
94
|
+
template: `
|
|
95
|
+
<main>
|
|
96
|
+
<ecs-button-group>
|
|
97
|
+
<ecs-button @click="action" type="create" size="sml">Small</ecs-button>
|
|
98
|
+
<ecs-button @click="action" type="create" size="sml" addon />
|
|
99
|
+
</ecs-button-group>
|
|
100
|
+
<ecs-button-group>
|
|
101
|
+
<ecs-button @click="action" type="create">Medium</ecs-button>
|
|
102
|
+
<ecs-button @click="action" type="create" addon />
|
|
103
|
+
</ecs-button-group>
|
|
104
|
+
<ecs-button-group>
|
|
105
|
+
<ecs-button @click="action" type="create" size="lg">Large</ecs-button>
|
|
106
|
+
<ecs-button @click="action" type="create" size="lg" addon />
|
|
107
|
+
</ecs-button-group>
|
|
108
|
+
</main>
|
|
109
|
+
`,
|
|
110
|
+
});
|