-
Notifications
You must be signed in to change notification settings - Fork 224
/
ExampleComponent.vue
83 lines (80 loc) · 2.1 KB
/
ExampleComponent.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<template>
<component :is="type" :class="['example', variation]">
<div data-testid="Example-container"><slot /></div>
</component>
</template>
<script>
/**
* Example component is used to visually communicate core parts of the product
* and available actions.
*/
export default {
/**
* Component names should be short, pronounceable and Capitalized.
*/
name: "Example",
/**
* Components in the system are labelled with status labels that reflect their
* state of completion. See example below. All available statuses are:
*
* STATUS: COLOR: DESCRIPTION:
*
* deprecated Red Component is deprecated
* prototype Blue Prototype, do not implement!
* under-review Yellow Component is currently being reviewed
* ready Green Ready to be used
*/
status: "prototype",
/**
* Release indicates when this component was added into the system.
* (in which design system version)
*/
release: "1.0.0",
/**
* Prop definitions should be as detailed as possible, specifying at least
* type(s). See examples below:
*/
props: {
/**
* The html element name used for the container of Example component.
*/
type: {
type: String,
default: "div",
},
/**
* Style variation to give additional meaning.
* `default, strong, positive, negative`
*/
variation: {
type: String,
default: "default",
validator: value => {
return value.match(/(default|strong|positive|negative)/)
},
},
},
}
</script>
<style lang="scss" scoped>
/**
* Styles in a top-level App component and in layout components may be global,
* but all other components should always be scoped (using either scoped
* attribute or class based scoping).
*/
.example {
@include reset;
@include stack-space($space-m);
color: set-text-color($color-rich-black, $color-white);
@media #{$media-query-m} {
@include stack-space($space-xl);
}
}
</style>
<docs>
```jsx
<Example>
Docs section should have an example that is shown in the documentation.
</Example>
```
</docs>