@magicgol/polyjuice 0.39.3 → 0.40.0
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/components/{components → badge}/badge/Badge.stories.js +1 -1
- package/src/components/{components → badge}/badge/Badge.vue +0 -0
- package/src/components/badge/counter/CounterBadge.stories.js +30 -0
- package/src/components/badge/counter/CounterBadge.vue +50 -0
- package/src/components/{components/icon-badge → badge/icon}/IconBadge.stories.js +1 -1
- package/src/components/{components/icon-badge → badge/icon}/IconBadge.vue +0 -0
- package/src/components/components/label/Label.stories.js +1 -2
- package/src/components/context/club/IconBadge.stories.js +1 -1
package/package.json
CHANGED
@@ -2,7 +2,7 @@ import MgBadge from './Badge.vue';
|
|
2
2
|
|
3
3
|
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
4
4
|
export default {
|
5
|
-
title: '
|
5
|
+
title: 'Badge/Badge',
|
6
6
|
component: MgBadge,
|
7
7
|
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
8
8
|
argTypes: {},
|
File without changes
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import MgCounterBadge from './CounterBadge.vue';
|
2
|
+
|
3
|
+
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
4
|
+
export default {
|
5
|
+
title: 'Badge/Counter',
|
6
|
+
component: MgCounterBadge,
|
7
|
+
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
8
|
+
argTypes: {},
|
9
|
+
};
|
10
|
+
|
11
|
+
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
|
12
|
+
const Template = (args, { argTypes }) => ({
|
13
|
+
props: Object.keys(argTypes),
|
14
|
+
components: { MgCounterBadge },
|
15
|
+
template: `<mg-counter-badge v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-counter-badge>`,
|
16
|
+
});
|
17
|
+
|
18
|
+
export const Default = Template.bind({});
|
19
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
20
|
+
Default.args = {
|
21
|
+
count: 1
|
22
|
+
};
|
23
|
+
|
24
|
+
export const Many = Template.bind({});
|
25
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
26
|
+
Many.args = {
|
27
|
+
count: 10
|
28
|
+
};
|
29
|
+
|
30
|
+
|
@@ -0,0 +1,50 @@
|
|
1
|
+
<template>
|
2
|
+
<div
|
3
|
+
class="d-inline-flex align-items-center rounded-circle justify-content-center"
|
4
|
+
:class="classes"
|
5
|
+
v-if="visible"
|
6
|
+
>
|
7
|
+
<span>{{ count >= 9 ? '9+' : count }}</span>
|
8
|
+
</div>
|
9
|
+
</template>
|
10
|
+
|
11
|
+
<script>
|
12
|
+
export default {
|
13
|
+
name: 'mg-counter-badge',
|
14
|
+
|
15
|
+
props: {
|
16
|
+
count: {
|
17
|
+
type: Number,
|
18
|
+
default: 0
|
19
|
+
}
|
20
|
+
},
|
21
|
+
|
22
|
+
computed: {
|
23
|
+
classes() {
|
24
|
+
return {
|
25
|
+
'mg-counter-badge': true,
|
26
|
+
};
|
27
|
+
},
|
28
|
+
|
29
|
+
visible () {
|
30
|
+
return this.count > 0;
|
31
|
+
}
|
32
|
+
},
|
33
|
+
};
|
34
|
+
</script>
|
35
|
+
|
36
|
+
<style lang="scss">
|
37
|
+
@import '../../../assets/palette';
|
38
|
+
|
39
|
+
.mg-counter-badge {
|
40
|
+
background-color: map-get($palette, 'brand');
|
41
|
+
color: #fff;
|
42
|
+
font-family: 'Ubuntu', sans-serif;
|
43
|
+
font-size: 0.75rem;
|
44
|
+
font-weight: 600;
|
45
|
+
height: 1.125rem;
|
46
|
+
min-height: 1.125rem;
|
47
|
+
min-width: 1.125rem;
|
48
|
+
width: 1.125rem;
|
49
|
+
}
|
50
|
+
</style>
|
@@ -2,7 +2,7 @@ import MgIconBadge from './IconBadge.vue';
|
|
2
2
|
|
3
3
|
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
4
4
|
export default {
|
5
|
-
title: '
|
5
|
+
title: 'Badge/Icon',
|
6
6
|
component: MgIconBadge,
|
7
7
|
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
8
8
|
argTypes: {
|
File without changes
|