@policystudio/policy-studio-ui-vue 1.1.89 → 1.1.90-beta.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/.eslintignore +1 -0
- package/.eslintrc.js +70 -67
- package/.github/workflows/deploy-storybook.yml +1 -1
- package/.storybook/eventBus.js +25 -2
- package/.storybook/main.js +17 -21
- package/babel.config.js +17 -3
- package/dist/css/psui_styles.css +0 -76
- package/package.json +36 -23
- package/scripts/kill-port.sh +12 -0
- package/src/assets/scss/components/PsTableResults.scss +1 -62
- package/src/components/accordion/PsAccordion.vue +20 -21
- package/src/components/accordion/PsAccordionItem.vue +30 -8
- package/src/components/badges-and-tags/PsBadgeWithIcon.vue +6 -3
- package/src/components/badges-and-tags/PsCardInfos.vue +3 -1
- package/src/components/badges-and-tags/PsChartLegend.vue +19 -5
- package/src/components/badges-and-tags/PsCostEffectBar.vue +4 -5
- package/src/components/badges-and-tags/PsHighlightRippleDot.vue +1 -1
- package/src/components/badges-and-tags/PsTestimonialCard.vue +6 -4
- package/src/components/buttons/PsButton.vue +30 -11
- package/src/components/chips/PsChips.vue +5 -2
- package/src/components/controls/PsCheckbox.vue +5 -2
- package/src/components/controls/PsCheckboxSimple.vue +4 -4
- package/src/components/controls/PsDraggable.vue +70 -67
- package/src/components/controls/PsInlineSelector.vue +13 -14
- package/src/components/controls/PsRadioButton.vue +10 -5
- package/src/components/controls/PsRadioButtonSimple.vue +3 -3
- package/src/components/controls/PsSlider.vue +6 -6
- package/src/components/controls/PsSwitch.vue +13 -3
- package/src/components/controls/PsToggle.vue +14 -11
- package/src/components/data-graphics/PsBarChart.vue +4 -2
- package/src/components/datatable/PsDataTable.vue +14 -5
- package/src/components/datatable/PsDataTableItem.vue +17 -4
- package/src/components/forms/PsDropdown.vue +8 -5
- package/src/components/forms/PsDropdownList.vue +1 -1
- package/src/components/forms/PsInput.vue +30 -14
- package/src/components/forms/PsInputSelect.vue +33 -11
- package/src/components/forms/PsInputTextArea.vue +15 -4
- package/src/components/navigations/PsBreadcrumb.vue +1 -1
- package/src/components/notifications/PsDialog.vue +11 -5
- package/src/components/notifications/PsSimpleAlert.vue +22 -10
- package/src/components/notifications/PsToast.vue +8 -3
- package/src/components/playground/PsScrollBar.vue +122 -50
- package/src/components/table-results/PsTableResults.vue +67 -51
- package/src/components/table-results/PsTableResultsBody.vue +3 -1
- package/src/components/table-results/PsTableResultsHead.vue +27 -8
- package/src/components/table-results/PsTableResultsHeadComparison.vue +24 -8
- package/src/components/table-results/PsTableResultsHeadFlexible.vue +18 -6
- package/src/components/table-results/PsTableResultsRow.vue +6 -2
- package/src/components/tabs/PsTabHeader.vue +19 -16
- package/src/components/tooltip/PsDialogTooltip.vue +18 -8
- package/src/components/tooltip/PsRichTooltip.vue +12 -5
- package/src/components/tooltip/PsTooltip.vue +17 -9
- package/src/components/ui/PsDotLoader.vue +5 -5
- package/src/components/ui/PsIcon.vue +6 -2
- package/src/index.js +0 -1
- package/src/stories/Button.stories.js +48 -130
- package/src/stories/Button.vue +59 -0
- package/src/stories/{ElevationSystem.stories.mdx → ElevationSystem.mdx} +1 -1
- package/src/stories/Header.stories.js +41 -0
- package/src/stories/Header.vue +77 -0
- package/src/stories/{Introduction.stories.mdx → Introduction.mdx} +101 -101
- package/src/stories/{Typography.stories.mdx → Typography.mdx} +107 -105
- package/src/stories/button.css +30 -0
- package/src/stories/header.css +32 -0
- package/webpack.config.js +22 -0
- package/backup-package-lock.json +0 -37194
- /package/src/stories/{Colors.stories.mdx → Colors.mdx} +0 -0
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
ref="tooltip"
|
|
4
|
-
class=
|
|
4
|
+
class="psui-el-tooltip"
|
|
5
5
|
@mouseenter="open"
|
|
6
6
|
@mouseleave="close"
|
|
7
7
|
>
|
|
8
|
-
<div
|
|
9
|
-
|
|
8
|
+
<div
|
|
9
|
+
ref="tooltiptrigger"
|
|
10
|
+
class="psui-el-tooltip-trigger"
|
|
11
|
+
>
|
|
12
|
+
<slot name="trigger" />
|
|
10
13
|
</div>
|
|
11
14
|
|
|
12
15
|
<div
|
|
13
|
-
class=
|
|
16
|
+
class="psui-el-tooltip-wrapper"
|
|
14
17
|
>
|
|
15
18
|
<div
|
|
16
19
|
role="menu"
|
|
17
20
|
ref="dialog"
|
|
18
|
-
class=
|
|
21
|
+
class="psui-el-tooltip-dialog"
|
|
19
22
|
:class="cssClass"
|
|
20
23
|
>
|
|
21
24
|
<div
|
|
@@ -23,9 +26,14 @@
|
|
|
23
26
|
aria-orientation="vertical"
|
|
24
27
|
:class="getComponentClass"
|
|
25
28
|
>
|
|
26
|
-
<h2 v-if="title">
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
<h2 v-if="title">
|
|
30
|
+
{{ title }}
|
|
31
|
+
</h2>
|
|
32
|
+
<div
|
|
33
|
+
v-else
|
|
34
|
+
class="psui-el-tooltip-content-wrapper"
|
|
35
|
+
>
|
|
36
|
+
<slot name="content" />
|
|
29
37
|
</div>
|
|
30
38
|
</div>
|
|
31
39
|
</div>
|
|
@@ -94,7 +102,7 @@ export default {
|
|
|
94
102
|
mounted() {
|
|
95
103
|
document.addEventListener('resize', this.updatePosition)
|
|
96
104
|
},
|
|
97
|
-
|
|
105
|
+
beforeUnmount() {
|
|
98
106
|
document.removeEventListener('resize', this.updatePosition)
|
|
99
107
|
},
|
|
100
108
|
methods: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="psui-el-dotloader">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
<div class="psui-el-dotloader-wrapper">
|
|
4
|
+
<span />
|
|
5
|
+
<span />
|
|
6
|
+
<span />
|
|
7
|
+
</div>
|
|
8
8
|
</div>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
>
|
|
9
9
|
{{ getIcon }}
|
|
10
10
|
</span>
|
|
11
|
-
<img
|
|
11
|
+
<img
|
|
12
|
+
v-else-if="getIconType === 'url'"
|
|
13
|
+
:src="icon"
|
|
14
|
+
:class="[iconClasses]"
|
|
15
|
+
>
|
|
12
16
|
<inline-svg
|
|
13
17
|
v-else
|
|
14
18
|
:src="icon"
|
|
@@ -16,7 +20,7 @@
|
|
|
16
20
|
:height="size"
|
|
17
21
|
:stroke="getColor"
|
|
18
22
|
:fill="getColor"
|
|
19
|
-
|
|
23
|
+
/>
|
|
20
24
|
</div>
|
|
21
25
|
</template>
|
|
22
26
|
|
package/src/index.js
CHANGED
|
@@ -1,130 +1,48 @@
|
|
|
1
|
-
import
|
|
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
|
-
<PsButton label='Text Only' layout='onlytext'/>
|
|
50
|
-
<PsButton label='Disabled' layout='onlytext' icon='verified' iconPosition='left' disabled/>
|
|
51
|
-
<PsButton label='Loading Only-Text' layout='onlytext' icon='verified' iconPosition='left' loading />
|
|
52
|
-
</div>
|
|
53
|
-
<div style="display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
|
|
54
|
-
<span style="text-align: center; color: red;">Caution Button</span>
|
|
55
|
-
<PsButton label='Left Icon' layout='caution' icon='verified' iconPosition='left'/>
|
|
56
|
-
<PsButton label='Right Icon' layout='caution' icon='verified' iconPosition='right'/>
|
|
57
|
-
<PsButton label='Text Only' layout='caution' />
|
|
58
|
-
<PsButton label='Disabled' layout='caution' icon='verified' iconPosition='left' disabled/>
|
|
59
|
-
<PsButton label='Loading Caution' layout='caution' icon='verified' iconPosition='left' loading />
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
</div>
|
|
64
|
-
<p>Size: Medium</p>
|
|
65
|
-
<div style="display: flex; flex-direction: column; gap: 10px;">
|
|
66
|
-
<div style="display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
|
|
67
|
-
<span style="text-align: center; color: black;">Solid Style</span>
|
|
68
|
-
<PsButton label='Left Icon' layout='solid' icon='verified' iconPosition='left' size='medium'/>
|
|
69
|
-
<PsButton label='Right Icon' layout='solid' icon='verified' iconPosition='right' size='medium'/>
|
|
70
|
-
<PsButton label='Text Only' layout='solid' size='medium'/>
|
|
71
|
-
<PsButton label='Disabled' layout='solid' icon='verified' iconPosition='left' disabled size='medium'/>
|
|
72
|
-
</div>
|
|
73
|
-
<div style="display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
|
|
74
|
-
<span style="text-align: center; color: blue;">Outline Style</span>
|
|
75
|
-
<PsButton label='Left Icon' layout='outline' icon='verified' iconPosition='left' size='medium'/>
|
|
76
|
-
<PsButton label='Right Icon' layout='outline' icon='verified' iconPosition='right' size='medium'/>
|
|
77
|
-
<PsButton label='Text Only' layout='outline' size='medium'/>
|
|
78
|
-
<PsButton label='Disabled' layout='outline' icon='verified' iconPosition='left' disabled size='medium'/>
|
|
79
|
-
</div>
|
|
80
|
-
<div style="display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
|
|
81
|
-
<span style="text-align: center; color: brown;">Ghost Style</span>
|
|
82
|
-
<PsButton label='Left Icon' layout='ghost' icon='verified' iconPosition='left' size='medium'/>
|
|
83
|
-
<PsButton label='Right Icon' layout='ghost' icon='verified' iconPosition='right' size='medium'/>
|
|
84
|
-
<PsButton label='Text Only' layout='ghost' size='medium'/>
|
|
85
|
-
<PsButton label='Disabled' layout='ghost' icon='verified' iconPosition='left' disabled size='medium'/>
|
|
86
|
-
</div>
|
|
87
|
-
<div style="display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
|
|
88
|
-
<span style="text-align: center; color: green;">Only-Text Style</span>
|
|
89
|
-
<PsButton label='Left Icon' layout='onlytext' icon='verified' iconPosition='left' size='medium'/>
|
|
90
|
-
<PsButton label='Right Icon' layout='onlytext' icon='verified' iconPosition='right' size='medium'/>
|
|
91
|
-
<PsButton label='Text Only' layout='onlytext' size='medium'/>
|
|
92
|
-
<PsButton label='Disabled' layout='onlytext' disabled icon='verified' iconPosition='left' size='medium'/>
|
|
93
|
-
</div>
|
|
94
|
-
<div style="display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
|
|
95
|
-
<span style="text-align: center; color: red;">Caution Button</span>
|
|
96
|
-
<PsButton label='Left Icon' layout='caution' icon='verified' iconPosition='left' size='medium'/>
|
|
97
|
-
<PsButton label='Right Icon' layout='caution' icon='verified' iconPosition='right' size='medium'/>
|
|
98
|
-
<PsButton label='Text Only' layout='caution' size='medium'/>
|
|
99
|
-
<PsButton label='Disabled' layout='caution' icon='verified' iconPosition='left' disabled size='medium'/>
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
102
|
-
<p>Size: Small</p>
|
|
103
|
-
<div style="display: flex; flex-direction: column; gap: 10px;">
|
|
104
|
-
<div style="display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
|
|
105
|
-
<span style="text-align: center; color: black;">Solid Style</span>
|
|
106
|
-
<PsButton label='Left Icon' layout='solid' icon='verified' iconPosition='left' size='small'/>
|
|
107
|
-
<PsButton label='Right Icon' layout='solid' icon='verified' iconPosition='right' size='small'/>
|
|
108
|
-
<PsButton label='Text Only' layout='solid' size='small'/>
|
|
109
|
-
<PsButton label='Disabled' layout='solid' icon='verified' iconPosition='left' disabled size='small'/>
|
|
110
|
-
</div>
|
|
111
|
-
<div style="display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
|
|
112
|
-
<span style="text-align: center; color: green;">Only-Text Style</span>
|
|
113
|
-
<PsButton label='Left Icon' layout='onlytext' icon='verified' iconPosition='left' size='small'/>
|
|
114
|
-
<PsButton label='Right Icon' layout='onlytext' icon='verified' iconPosition='right' size='small'/>
|
|
115
|
-
<PsButton label='Text Only' layout='onlytext' size='small'/>
|
|
116
|
-
<PsButton label='Disabled' layout='onlytext' disabled icon='verified' iconPosition='left' size='small'/>
|
|
117
|
-
</div>
|
|
118
|
-
<div style="display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.5rem; justify-items: center; align-items: center;" >
|
|
119
|
-
<span style="text-align: center; color: red;">Caution Button</span>
|
|
120
|
-
<PsButton label='Left Icon' layout='caution' icon='verified' iconPosition='left' size='small'/>
|
|
121
|
-
<PsButton label='Right Icon' layout='caution' icon='verified' iconPosition='right' size='small'/>
|
|
122
|
-
<PsButton label='Text Only' layout='caution' size='small'/>
|
|
123
|
-
<PsButton label='Disabled' layout='caution' disabled icon='verified' iconPosition='left' size='small'/>
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
</div>
|
|
127
|
-
`,
|
|
128
|
-
})
|
|
129
|
-
|
|
130
|
-
export const Default = TemplateDefault.bind({})
|
|
1
|
+
import MyButton from './Button.vue'
|
|
2
|
+
|
|
3
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Example/Button',
|
|
6
|
+
component: MyButton,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
argTypes: {
|
|
9
|
+
backgroundColor: {
|
|
10
|
+
control: 'color',
|
|
11
|
+
},
|
|
12
|
+
onClick: {},
|
|
13
|
+
size: {
|
|
14
|
+
control: {
|
|
15
|
+
type: 'select',
|
|
16
|
+
},
|
|
17
|
+
options: ['small', 'medium', 'large'],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
23
|
+
export const Primary = {
|
|
24
|
+
args: {
|
|
25
|
+
primary: true,
|
|
26
|
+
label: 'Button',
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const Secondary = {
|
|
31
|
+
args: {
|
|
32
|
+
label: 'Button',
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const Large = {
|
|
37
|
+
args: {
|
|
38
|
+
size: 'large',
|
|
39
|
+
label: 'Button',
|
|
40
|
+
},
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const Small = {
|
|
44
|
+
args: {
|
|
45
|
+
size: 'small',
|
|
46
|
+
label: 'Button',
|
|
47
|
+
},
|
|
48
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
type="button"
|
|
4
|
+
:class="classes"
|
|
5
|
+
@click="onClick"
|
|
6
|
+
:style="style"
|
|
7
|
+
>
|
|
8
|
+
{{ label }}
|
|
9
|
+
</button>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import './button.css'
|
|
14
|
+
import { reactive, computed } from 'vue'
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
name: 'MyButton',
|
|
18
|
+
|
|
19
|
+
props: {
|
|
20
|
+
label: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
primary: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
type: String,
|
|
30
|
+
validator: function (value) {
|
|
31
|
+
return ['small', 'medium', 'large'].indexOf(value) !== -1
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
backgroundColor: {
|
|
35
|
+
type: String,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
emits: ['click'],
|
|
40
|
+
|
|
41
|
+
setup(props, { emit }) {
|
|
42
|
+
props = reactive(props)
|
|
43
|
+
return {
|
|
44
|
+
classes: computed(() => ({
|
|
45
|
+
'storybook-button': true,
|
|
46
|
+
'storybook-button--primary': props.primary,
|
|
47
|
+
'storybook-button--secondary': !props.primary,
|
|
48
|
+
[`storybook-button--${props.size || 'medium'}`]: true,
|
|
49
|
+
})),
|
|
50
|
+
style: computed(() => ({
|
|
51
|
+
backgroundColor: props.backgroundColor,
|
|
52
|
+
})),
|
|
53
|
+
onClick() {
|
|
54
|
+
emit('click')
|
|
55
|
+
},
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
}
|
|
59
|
+
</script>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import MyHeader from './Header.vue'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Example/Header',
|
|
5
|
+
component: MyHeader,
|
|
6
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
render: (args) => ({
|
|
9
|
+
// Components used in your story `template` are defined in the `components` object
|
|
10
|
+
components: {
|
|
11
|
+
MyHeader,
|
|
12
|
+
},
|
|
13
|
+
// The story's `args` need to be mapped into the template through the `setup()` method
|
|
14
|
+
setup() {
|
|
15
|
+
// Story args can be spread into the returned object
|
|
16
|
+
return {
|
|
17
|
+
...args,
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
// Then, the spread values can be accessed directly in the template
|
|
21
|
+
template: '<my-header :user="user" />',
|
|
22
|
+
}),
|
|
23
|
+
parameters: {
|
|
24
|
+
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
25
|
+
layout: 'fullscreen',
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const LoggedIn = {
|
|
30
|
+
args: {
|
|
31
|
+
user: {
|
|
32
|
+
name: 'Jane Doe',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const LoggedOut = {
|
|
38
|
+
args: {
|
|
39
|
+
user: null,
|
|
40
|
+
},
|
|
41
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<header>
|
|
3
|
+
<div class="storybook-header">
|
|
4
|
+
<div>
|
|
5
|
+
<svg
|
|
6
|
+
width="32"
|
|
7
|
+
height="32"
|
|
8
|
+
viewBox="0 0 32 32"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
>
|
|
11
|
+
<g
|
|
12
|
+
fill="none"
|
|
13
|
+
fill-rule="evenodd"
|
|
14
|
+
>
|
|
15
|
+
<path
|
|
16
|
+
d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
|
|
17
|
+
fill="#FFF"
|
|
18
|
+
/>
|
|
19
|
+
<path
|
|
20
|
+
d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
|
|
21
|
+
fill="#555AB9"
|
|
22
|
+
/>
|
|
23
|
+
<path
|
|
24
|
+
d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z"
|
|
25
|
+
fill="#91BAF8"
|
|
26
|
+
/>
|
|
27
|
+
</g>
|
|
28
|
+
</svg>
|
|
29
|
+
<h1>Acme</h1>
|
|
30
|
+
</div>
|
|
31
|
+
<div>
|
|
32
|
+
<span
|
|
33
|
+
class="welcome"
|
|
34
|
+
v-if="user"
|
|
35
|
+
>Welcome, aa<b>{{ user.name }}</b>!</span>
|
|
36
|
+
<my-button
|
|
37
|
+
size="small"
|
|
38
|
+
@click="$emit('logout')"
|
|
39
|
+
label="Log out"
|
|
40
|
+
v-if="user"
|
|
41
|
+
/>
|
|
42
|
+
<my-button
|
|
43
|
+
size="small"
|
|
44
|
+
@click="$emit('login')"
|
|
45
|
+
label="Log in"
|
|
46
|
+
v-if="!user"
|
|
47
|
+
/>
|
|
48
|
+
<my-button
|
|
49
|
+
primary
|
|
50
|
+
size="small"
|
|
51
|
+
@click="$emit('createAccount')"
|
|
52
|
+
label="Sign up"
|
|
53
|
+
v-if="!user"
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</header>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script>
|
|
61
|
+
import './header.css'
|
|
62
|
+
import MyButton from './Button.vue'
|
|
63
|
+
|
|
64
|
+
export default {
|
|
65
|
+
name: 'MyHeader',
|
|
66
|
+
|
|
67
|
+
components: { MyButton },
|
|
68
|
+
|
|
69
|
+
props: {
|
|
70
|
+
user: {
|
|
71
|
+
type: Object,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
emits: ['login', 'logout', 'createAccount'],
|
|
76
|
+
}
|
|
77
|
+
</script>
|