@policystudio/policy-studio-ui-vue 1.0.0 → 1.0.4
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/README.md +4 -4
- package/package.json +1 -1
- package/src/assets/scss/tailwind.css +13842 -13842
- package/src/components/buttons/PsButton.vue +82 -0
- package/src/components/controls/PsCheckbox.vue +128 -0
- package/src/components/controls/PsRadioButton.vue +103 -0
- package/src/components/notifications/{Dialog.vue → PsDialog.vue} +5 -5
- package/src/components/notifications/{Toast.vue → PsToast.vue} +5 -5
- package/src/components/tabs/{Tabs.vue → PsTabHeader.vue} +10 -10
- package/src/index.js +19 -7
- package/src/stories/Button.stories.js +4 -4
- package/src/stories/Checkbox.stories.js +23 -0
- package/src/stories/Colors.stories.mdx +8 -8
- package/src/stories/Dialog.stories.js +4 -4
- package/src/stories/ElevationSystem.stories.mdx +17 -17
- package/src/stories/RadioButton.stories.js +21 -0
- package/src/stories/{Tabs.stories.js → TabHeader.stories.js} +9 -9
- package/src/stories/Toast.stories.js +7 -7
- package/tailwind.config.js +3 -1
- package/src/components/buttons/Button.vue +0 -82
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
class="psui-font-bold psui-align-middle psui-flex psui-rounded-md"
|
|
4
|
+
:class="classes"
|
|
5
|
+
@click="onClick()"
|
|
6
|
+
>
|
|
7
|
+
<i
|
|
8
|
+
v-if="icon"
|
|
9
|
+
class="psui-my-auto material-icons psui-mr-2"
|
|
10
|
+
:class="{ 'psui-text-sm': size === 'small' }"
|
|
11
|
+
>
|
|
12
|
+
{{ icon }}
|
|
13
|
+
</i>
|
|
14
|
+
<div class="psui-flex-grow psui-text-left">{{ label }}</div>
|
|
15
|
+
<i
|
|
16
|
+
v-if="iconRight" class="psui-my-auto material-icons psui-ml-2"
|
|
17
|
+
:class="{ 'psui-text-sm': size === 'small' }"
|
|
18
|
+
>
|
|
19
|
+
{{ iconRight }}
|
|
20
|
+
</i>
|
|
21
|
+
</button>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
export const sizes = ['big', 'medium', 'small']
|
|
26
|
+
export default {
|
|
27
|
+
props: {
|
|
28
|
+
label: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: true
|
|
31
|
+
},
|
|
32
|
+
outline: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false
|
|
35
|
+
},
|
|
36
|
+
ghost: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
39
|
+
},
|
|
40
|
+
textOnly: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
icon: {
|
|
45
|
+
type: String,
|
|
46
|
+
},
|
|
47
|
+
iconRight: {
|
|
48
|
+
type: String,
|
|
49
|
+
},
|
|
50
|
+
size: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: 'big',
|
|
53
|
+
validator: (value) => sizes.indexOf(value) !== -1
|
|
54
|
+
},
|
|
55
|
+
disabled: {
|
|
56
|
+
type: [Boolean, String]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
data () {
|
|
60
|
+
return {
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
computed: {
|
|
64
|
+
classes() {
|
|
65
|
+
let sizeCss = 'psui-px-4 psui-py-2'
|
|
66
|
+
if (this.size === 'medium') sizeCss = 'psui-px-4 psui-py-1'
|
|
67
|
+
if (this.size === 'small') sizeCss = 'psui-px-2 psui-py-psui-px psui-text-sm'
|
|
68
|
+
if (this.outline) return `${sizeCss} psui-bg-white psui-border ${this.disabled ? 'psui-border-gray-40 psui-text-gray-40' : 'psui-border-blue-60 psui-text-blue-60'}`
|
|
69
|
+
if (this.ghost) return `${sizeCss} ${this.disabled ? 'psui-bg-gray-20 psui-text-gray-40' : 'psui-bg-blue-20 psui-text-blue-60 active:psui-shadow-inner'}`
|
|
70
|
+
if (this.textOnly) return `${sizeCss} ${this.disabled ? 'psui-text-gray-40' : 'psui-text-blue-60'}`
|
|
71
|
+
if (this.disabled) return `${sizeCss} psui-bg-gray-20 psui-text-gray-40`
|
|
72
|
+
return `${sizeCss} psui-bg-blue-60 hover:psui-bg-blue-50 psui-text-white active:psui-shadow-inner`
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
methods: {
|
|
76
|
+
onClick() {
|
|
77
|
+
if (this.disabled) return false
|
|
78
|
+
this.$emit('click');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
</script>
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<label class="container">
|
|
3
|
+
{{ label }}
|
|
4
|
+
<input type="checkbox">
|
|
5
|
+
<span class="checkmark"></span>
|
|
6
|
+
</label>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
export default {
|
|
11
|
+
name: 'PsCheckbox',
|
|
12
|
+
props: {
|
|
13
|
+
value: {
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
label: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ''
|
|
19
|
+
},
|
|
20
|
+
bg: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: 'blue-20'
|
|
23
|
+
},
|
|
24
|
+
type: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: 'checkbox'
|
|
27
|
+
},
|
|
28
|
+
checkboxClasses: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: 'mb-2'
|
|
31
|
+
},
|
|
32
|
+
labelClasses: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: 'text-gray04'
|
|
35
|
+
},
|
|
36
|
+
disabled: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
39
|
+
},
|
|
40
|
+
tooltip: {
|
|
41
|
+
type: [Object, Boolean, String, Promise],
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
prevent: {
|
|
45
|
+
default: false
|
|
46
|
+
},
|
|
47
|
+
size: {
|
|
48
|
+
default: 16
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
computed: {
|
|
52
|
+
childValue: {
|
|
53
|
+
get () {
|
|
54
|
+
return this.value
|
|
55
|
+
},
|
|
56
|
+
set (newValue) {
|
|
57
|
+
if(this.prevent) return
|
|
58
|
+
this.$emit('input', newValue)
|
|
59
|
+
this.$emit('change', newValue)
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
getSize() {
|
|
63
|
+
return { width: this.size + 'px', height: this.size + 'px'}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<style>
|
|
70
|
+
.container {
|
|
71
|
+
display: block;
|
|
72
|
+
position: relative;
|
|
73
|
+
padding-left: 35px;
|
|
74
|
+
margin-bottom: 12px;
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
-webkit-user-select: none;
|
|
77
|
+
-moz-user-select: none;
|
|
78
|
+
-ms-user-select: none;
|
|
79
|
+
user-select: none;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.container input {
|
|
83
|
+
position: absolute;
|
|
84
|
+
opacity: 0;
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
height: 0;
|
|
87
|
+
width: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.checkmark {
|
|
91
|
+
position: absolute;
|
|
92
|
+
top: 0;
|
|
93
|
+
left: 0;
|
|
94
|
+
height: 18px;
|
|
95
|
+
width: 18px;
|
|
96
|
+
background-color: #fff;
|
|
97
|
+
border: solid 2px #A2ACB7;
|
|
98
|
+
border-radius: 2px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.container input:checked ~ .checkmark {
|
|
102
|
+
background-color: #64B5CE;
|
|
103
|
+
border: none;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.checkmark:after {
|
|
107
|
+
content: "";
|
|
108
|
+
position: absolute;
|
|
109
|
+
display: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.container input:checked ~ .checkmark:after {
|
|
113
|
+
display: block;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.container .checkmark:after {
|
|
117
|
+
left: 5px;
|
|
118
|
+
top: 1px;
|
|
119
|
+
width: 7px;
|
|
120
|
+
height: 13px;
|
|
121
|
+
border: solid white;
|
|
122
|
+
border-radius: 1px;
|
|
123
|
+
border-width: 0 2px 2px 0;
|
|
124
|
+
-webkit-transform: rotate(45deg);
|
|
125
|
+
-ms-transform: rotate(45deg);
|
|
126
|
+
transform: rotate(45deg);
|
|
127
|
+
}
|
|
128
|
+
</style>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="w-full">
|
|
3
|
+
<label class="form-control" :for="id">
|
|
4
|
+
{{ label }}
|
|
5
|
+
<input
|
|
6
|
+
type="radio"
|
|
7
|
+
name="radio"
|
|
8
|
+
:id="id"
|
|
9
|
+
@change="$emit('change')"
|
|
10
|
+
v-model="childValue"
|
|
11
|
+
/>
|
|
12
|
+
<span class="radio-button"></span>
|
|
13
|
+
</label>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
export default {
|
|
19
|
+
name: 'PsRadioButton',
|
|
20
|
+
props: {
|
|
21
|
+
label: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: true
|
|
24
|
+
},
|
|
25
|
+
value: {
|
|
26
|
+
required: true
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
data() {
|
|
30
|
+
return {
|
|
31
|
+
id: ''
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
computed: {
|
|
35
|
+
childValue: {
|
|
36
|
+
get () {
|
|
37
|
+
return this.value
|
|
38
|
+
},
|
|
39
|
+
set (newValue) {
|
|
40
|
+
this.$emit('input', newValue )
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
mounted() {
|
|
45
|
+
this.id = 'teste'
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<style scoped>
|
|
51
|
+
.form-control {
|
|
52
|
+
display: block;
|
|
53
|
+
position: relative;
|
|
54
|
+
padding-left: 35px;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
-webkit-user-select: none;
|
|
57
|
+
-moz-user-select: none;
|
|
58
|
+
-ms-user-select: none;
|
|
59
|
+
user-select: none;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.form-control input {
|
|
63
|
+
position: absolute;
|
|
64
|
+
opacity: 0;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.radio-button {
|
|
69
|
+
position: absolute;
|
|
70
|
+
top: 0;
|
|
71
|
+
left: 0;
|
|
72
|
+
height: 20px;
|
|
73
|
+
width: 20px;
|
|
74
|
+
background-color: #FFF;
|
|
75
|
+
border: 2px solid #A2ACB7;
|
|
76
|
+
border-radius: 50%;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.form-control input:checked ~ .radio-button {
|
|
80
|
+
background-color: #FFF;
|
|
81
|
+
border: 2px solid #64B5CE;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.radio-button:after {
|
|
85
|
+
content: "";
|
|
86
|
+
position: absolute;
|
|
87
|
+
display: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.form-control input:checked ~ .radio-button:after {
|
|
91
|
+
display: block;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.form-control .radio-button:after {
|
|
95
|
+
top: 3px;
|
|
96
|
+
left: 3px;
|
|
97
|
+
width: 10px;
|
|
98
|
+
height: 10px;
|
|
99
|
+
border-radius: 50%;
|
|
100
|
+
background-color: #64B5CE;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
</style>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="cssClass">
|
|
3
|
-
<div class="material-icons my-auto">info</div>
|
|
4
|
-
<div class="w-full">{{ message }}</div>
|
|
5
|
-
<div class="cursor-pointer font-bold my-auto pr-4">OK</div>
|
|
3
|
+
<div class="material-icons psui-my-auto">info</div>
|
|
4
|
+
<div class="psui-w-full">{{ message }}</div>
|
|
5
|
+
<div class="psui-cursor-pointer psui-font-bold psui-my-auto psui-pr-4">OK</div>
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script>
|
|
10
10
|
export const typeOptions = ['informative', 'success', 'alert']
|
|
11
11
|
export default {
|
|
12
|
-
name: '
|
|
12
|
+
name: 'PsDialog',
|
|
13
13
|
props: {
|
|
14
14
|
type: {
|
|
15
15
|
type: String,
|
|
@@ -32,7 +32,7 @@ export default {
|
|
|
32
32
|
},
|
|
33
33
|
computed: {
|
|
34
34
|
cssClass() {
|
|
35
|
-
return `flex space-x-4 font-small rounded-md py-2 px-4 align-middle flex bg-${this.colors[this.type].background} text-${this.colors[this.type].color}`
|
|
35
|
+
return `psui-flex psui-space-x-4 psui-font-small psui-rounded-md psui-py-2 psui-px-4 psui-align-middle psui-flex psui-bg-${this.colors[this.type].background} psui-text-${this.colors[this.type].color}`
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="cssClass">
|
|
3
|
-
<span class="material-icons mr-4">{{ icon }}</span>
|
|
4
|
-
<div class="w-full">{{ message }}</div>
|
|
5
|
-
<div class="flex space-x-4">
|
|
3
|
+
<span class="material-icons psui-mr-4">{{ icon }}</span>
|
|
4
|
+
<div class="psui-w-full">{{ message }}</div>
|
|
5
|
+
<div class="psui-flex psui-space-x-4">
|
|
6
6
|
<slot></slot>
|
|
7
7
|
</div>
|
|
8
8
|
</div>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
export const typeOptions = ['info', 'success', 'warning', 'error']
|
|
13
13
|
export const fillOptions = ['soft', 'intense']
|
|
14
14
|
export default {
|
|
15
|
-
name: '
|
|
15
|
+
name: 'PsToast',
|
|
16
16
|
props: {
|
|
17
17
|
type: {
|
|
18
18
|
type: String,
|
|
@@ -46,7 +46,7 @@ export default {
|
|
|
46
46
|
const textColor = this.fill === 'intense' ? 'white': colors[this.type]
|
|
47
47
|
const background = this.fill === 'soft'? `${colors[this.type].split('-', 1)}-10` : colors[this.type]
|
|
48
48
|
|
|
49
|
-
return `font-bold shadow-md rounded-md p-3 h-12 flex bg-${background} text-${textColor}`
|
|
49
|
+
return `psui-font-bold psui-shadow-md psui-rounded-md psui-p-3 psui-h-12 psui-flex psui-bg-${background} psui-text-${textColor}`
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
@click="selectTab(item)"
|
|
8
8
|
:class="[
|
|
9
9
|
classes,
|
|
10
|
-
{ 'bg-blue-60 text-white': getSelected === item[keyValue] && theme === 'standard' },
|
|
11
|
-
{ 'border-b-2 border-blue-60 text-blue-60 font-bold': getSelected === item[keyValue] && theme === 'underline' },
|
|
12
|
-
{ 'text-blue-60 font-bold bg-white hover:text-blue-60': getSelected === item[keyValue] && theme === 'folder' }
|
|
10
|
+
{ 'psui-bg-blue-60 psui-text-white': getSelected === item[keyValue] && theme === 'standard' },
|
|
11
|
+
{ 'psui-border-b-2 psui-border-blue-60 psui-text-blue-60 psui-font-bold': getSelected === item[keyValue] && theme === 'underline' },
|
|
12
|
+
{ 'psui-text-blue-60 psui-font-bold psui-bg-white hover:psui-text-blue-60': getSelected === item[keyValue] && theme === 'folder' }
|
|
13
13
|
]"
|
|
14
14
|
>
|
|
15
15
|
{{ item[keyLabel] }}
|
|
@@ -20,25 +20,25 @@
|
|
|
20
20
|
<script>
|
|
21
21
|
export const themeOptions = ['standard', 'underline', 'folder']
|
|
22
22
|
export default {
|
|
23
|
-
name: '
|
|
23
|
+
name: 'PsTabHeader',
|
|
24
24
|
computed: {
|
|
25
25
|
wrapperClasses() {
|
|
26
26
|
if (this.theme === 'underline') {
|
|
27
|
-
return 'flex space-x-4 border-b border-gray-20'
|
|
27
|
+
return 'psui-flex psui-space-x-4 psui-border-b psui-border-gray-20'
|
|
28
28
|
}
|
|
29
29
|
if (this.theme === 'folder') {
|
|
30
|
-
return 'flex space-x-1'
|
|
30
|
+
return 'psui-flex psui-space-x-1'
|
|
31
31
|
}
|
|
32
|
-
return 'inline-flex rounded-md flex gap-x-px'
|
|
32
|
+
return 'psui-inline-flex psui-rounded-md psui-flex psui-gap-x-px'
|
|
33
33
|
},
|
|
34
34
|
classes() {
|
|
35
35
|
if (this.theme === 'underline') {
|
|
36
|
-
return 'text-gray-60 pb-3 hover:text-blue-60'
|
|
36
|
+
return 'psui-text-gray-60 psui-pb-3 hover:psui-text-blue-60'
|
|
37
37
|
}
|
|
38
38
|
if (this.theme === 'folder') {
|
|
39
|
-
return 'bg-gray-10 text-gray-50 py-2 px-4 rounded-t-lg hover:text-gray-60 active:text-blue-60'
|
|
39
|
+
return 'psui-bg-gray-10 psui-text-gray-50 psui-py-2 psui-px-4 psui-rounded-t-lg hover:psui-text-gray-60 active:psui-text-blue-60'
|
|
40
40
|
}
|
|
41
|
-
return 'bg-gray-10 px-4 py-2 text-gray-60 hover:text-blue-60 last:rounded-r-lg first:rounded-l-lg active:text-white active:bg-blue-60'
|
|
41
|
+
return 'psui-bg-gray-10 psui-px-4 psui-py-2 psui-text-gray-60 hover:psui-text-blue-60 last:psui-rounded-r-lg first:psui-rounded-l-lg active:psui-text-white active:psui-bg-blue-60'
|
|
42
42
|
},
|
|
43
43
|
getIsObject() {
|
|
44
44
|
return typeof this.selected === 'object'
|
package/src/index.js
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import PsButton from './components/buttons/PsButton.vue';
|
|
2
|
+
import PsCheckbox from './components/controls/PsCheckbox.vue';
|
|
3
|
+
import PsDialog from './components/notifications/PsDialog.vue';
|
|
4
|
+
import PsToast from './components/notifications/PsToast.vue';
|
|
5
|
+
import PsTabHeader from './components/tabs/PsTabHeader.vue';
|
|
6
|
+
import PsRadioButton from './components/controls/PsRadioButton.vue';
|
|
3
7
|
|
|
4
8
|
export default {
|
|
5
9
|
install(Vue) {
|
|
6
|
-
Vue.component('
|
|
7
|
-
Vue.component('
|
|
8
|
-
|
|
10
|
+
Vue.component(' PsButton', PsButton);
|
|
11
|
+
Vue.component(' PsCheckbox', PsCheckbox);
|
|
12
|
+
Vue.component(' PsDialog', PsDialog);
|
|
13
|
+
Vue.component(' PsToast', PsToast);
|
|
14
|
+
Vue.component(' PsTabHeader', PsTabHeader);
|
|
15
|
+
Vue.component(' PsRadioButton', PsRadioButton);
|
|
16
|
+
}
|
|
9
17
|
};
|
|
10
18
|
|
|
11
19
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
20
|
+
PsButton,
|
|
21
|
+
PsCheckbox,
|
|
22
|
+
PsDialog,
|
|
23
|
+
PsToast,
|
|
24
|
+
PsTabHeader,
|
|
25
|
+
PsRadioButton
|
|
14
26
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import PsButton, { sizes } from '../components/buttons/PsButton.vue';
|
|
2
2
|
const icons = ['add_circle', 'delete', 'done', 'info', 'send']
|
|
3
3
|
export default {
|
|
4
4
|
title: 'Components/Button',
|
|
5
|
-
component:
|
|
5
|
+
component: PsButton,
|
|
6
6
|
argTypes: {
|
|
7
7
|
size: { control: { type: 'select', options: sizes } },
|
|
8
8
|
disabled: { control: 'boolean' },
|
|
@@ -13,9 +13,9 @@ export default {
|
|
|
13
13
|
|
|
14
14
|
const Template = (args, { argTypes }) => ({
|
|
15
15
|
props: Object.keys(argTypes),
|
|
16
|
-
components: {
|
|
16
|
+
components: { PsButton },
|
|
17
17
|
template: `
|
|
18
|
-
<
|
|
18
|
+
<PsButton v-bind="$props" />
|
|
19
19
|
`
|
|
20
20
|
});
|
|
21
21
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import PsCheckbox, { sizes } from '../components/controls/PsCheckbox.vue';
|
|
2
|
+
const icons = ['add_circle', 'delete', 'done', 'info', 'send']
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/Checkbox',
|
|
5
|
+
component: PsCheckbox,
|
|
6
|
+
argTypes: {
|
|
7
|
+
disabled: { control: 'boolean' },
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const Template = (args, { argTypes }) => ({
|
|
12
|
+
props: Object.keys(argTypes),
|
|
13
|
+
components: { PsCheckbox },
|
|
14
|
+
template: `
|
|
15
|
+
<PsCheckbox v-bind="$props" />
|
|
16
|
+
`
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const Default = Template.bind({});
|
|
20
|
+
Default.args = {
|
|
21
|
+
label: 'Label',
|
|
22
|
+
size: 16
|
|
23
|
+
};
|
|
@@ -11,12 +11,12 @@ Out colors are designed to be harmonious, ensure accessible text, and distinguis
|
|
|
11
11
|
|
|
12
12
|
## Blue
|
|
13
13
|
|
|
14
|
-
<div class="grid grid-flow-col">
|
|
15
|
-
<div class="p-2 h-20 text-white bg-blue-80">Blue 80</div>
|
|
16
|
-
<div class="p-2 h-20 text-white bg-blue-70">Blue 70</div>
|
|
17
|
-
<div class="p-2 h-20 text-white bg-blue-60">Blue 60</div>
|
|
18
|
-
<div class="p-2 h-20 text-white bg-blue-50">Blue 50</div>
|
|
19
|
-
<div class="p-2 h-20 text-blue-70 bg-blue-20">Blue 20</div>
|
|
20
|
-
<div class="p-2 h-20 text-blue-70 bg-blue-10">Blue 10</div>
|
|
21
|
-
<div class="p-2 h-20 text-blue-70 bg-white ">White</div>
|
|
14
|
+
<div class="psui-grid psui-grid-flow-col">
|
|
15
|
+
<div class="psui-p-2 psui-h-20 psui-text-white psui-bg-blue-80">Blue 80</div>
|
|
16
|
+
<div class="psui-p-2 psui-h-20 psui-text-white psui-bg-blue-70">Blue 70</div>
|
|
17
|
+
<div class="psui-p-2 psui-h-20 psui-text-white psui-bg-blue-60">Blue 60</div>
|
|
18
|
+
<div class="psui-p-2 psui-h-20 psui-text-white psui-bg-blue-50">Blue 50</div>
|
|
19
|
+
<div class="psui-p-2 psui-h-20 psui-text-blue-70 psui-bg-blue-20">Blue 20</div>
|
|
20
|
+
<div class="psui-p-2 psui-h-20 psui-text-blue-70 psui-bg-blue-10">Blue 10</div>
|
|
21
|
+
<div class="psui-p-2 psui-h-20 psui-text-blue-70 psui-bg-white ">White</div>
|
|
22
22
|
</div>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import PsDialog from '../components/notifications/PsDialog.vue';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
title: 'Components/Dialog',
|
|
5
|
-
component:
|
|
5
|
+
component: PsDialog,
|
|
6
6
|
argTypes: {
|
|
7
7
|
type: { control: { type: 'select', options: ['informative', 'success', 'alert'] } },
|
|
8
8
|
},
|
|
@@ -10,8 +10,8 @@ export default {
|
|
|
10
10
|
|
|
11
11
|
const Template = (args, { argTypes }) => ({
|
|
12
12
|
props: Object.keys(argTypes),
|
|
13
|
-
components: {
|
|
14
|
-
template: '<
|
|
13
|
+
components: { PsDialog },
|
|
14
|
+
template: '<PsDialog v-bind="$props" />',
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
export const Informative = Template.bind({});
|
|
@@ -14,28 +14,28 @@ Elevation is evidenced by the use of shadows. It's another way to establish a vi
|
|
|
14
14
|
|
|
15
15
|
### 1.1. Shadow and light
|
|
16
16
|
The shadows in our elements are projected by these two light sources: main light and ambient light.
|
|
17
|
-
<div class="grid grid-cols-3 gap-4">
|
|
18
|
-
<div class="bg-gray-20 pt-8">
|
|
19
|
-
<div class="bg-white w-48 h-48 rounded-md shadow mx-auto"></div>
|
|
20
|
-
<p class="text-center">Shadow cast by main light</p>
|
|
17
|
+
<div class="psui-grid psui-grid-cols-3 psui-gap-4">
|
|
18
|
+
<div class="psui-bg-gray-20 psui-pt-8">
|
|
19
|
+
<div class="psui-bg-white psui-w-48 psui-h-48 psui-rounded-md psui-shadow mx-auto"></div>
|
|
20
|
+
<p class="psui-text-center">Shadow cast by main light</p>
|
|
21
21
|
</div>
|
|
22
|
-
<div class="bg-gray-20 pt-8">
|
|
23
|
-
<div class="bg-white w-48 h-48 rounded-md shadow-sm mx-auto"></div>
|
|
24
|
-
<p class="text-center">Shadow cast by ambient light</p>
|
|
22
|
+
<div class="psui-bg-gray-20 psui-pt-8">
|
|
23
|
+
<div class="psui-bg-white psui-w-48 psui-h-48 psui-rounded-md psui-shadow-sm mx-auto"></div>
|
|
24
|
+
<p class="psui-text-center">Shadow cast by ambient light</p>
|
|
25
25
|
</div>
|
|
26
|
-
<div class="bg-gray-20 pt-8">
|
|
27
|
-
<div class="bg-white w-48 h-48 rounded-md shadow-md mx-auto"></div>
|
|
28
|
-
<p class="text-center">Combined shadow from main and ambient lights</p>
|
|
26
|
+
<div class="psui-bg-gray-20 psui-pt-8">
|
|
27
|
+
<div class="psui-bg-white psui-w-48 psui-h-48 psui-rounded-md psui-shadow-md mx-auto"></div>
|
|
28
|
+
<p class="psui-text-center">Combined shadow from main and ambient lights</p>
|
|
29
29
|
</div>
|
|
30
30
|
</div>
|
|
31
31
|
|
|
32
32
|
## 2. Elevation system
|
|
33
33
|
Shadows provide cues about depth, direction of movement, and surface edges. A surface’s shadow is determined by its elevation and relationship to other surfaces.
|
|
34
|
-
<div class="grid grid-cols-2 gap-6 p-6 bg-gray-20">
|
|
35
|
-
<div class="rounded-md p-8 h-20 shadow-inner">Elevation -5</div>
|
|
36
|
-
<div class="rounded-md p-8 h-20 bg-white shadow-sm">Elevation 5</div>
|
|
37
|
-
<div class="rounded-md p-8 h-20 bg-white shadow">Elevation 10</div>
|
|
38
|
-
<div class="rounded-md p-8 h-20 bg-white shadow-md">Elevation 20</div>
|
|
39
|
-
<div class="rounded-md p-8 h-20 bg-white shadow-lg">Elevation 30</div>
|
|
40
|
-
<div class="rounded-md p-8 h-20 bg-white shadow-xl">Elevation 40</div>
|
|
34
|
+
<div class="psui-grid grid-cols-2 psui-gap-6 psui-p-6 psui-bg-gray-20">
|
|
35
|
+
<div class="psui-rounded-md psui-p-8 psui-h-20 psui-shadow-inner">Elevation -5</div>
|
|
36
|
+
<div class="psui-rounded-md psui-p-8 psui-h-20 psui-bg-white psui-shadow-sm">Elevation 5</div>
|
|
37
|
+
<div class="psui-rounded-md psui-p-8 psui-h-20 psui-bg-white psui-shadow">Elevation 10</div>
|
|
38
|
+
<div class="psui-rounded-md psui-p-8 psui-h-20 psui-bg-white psui-shadow-md">Elevation 20</div>
|
|
39
|
+
<div class="psui-rounded-md psui-p-8 psui-h-20 psui-bg-white psui-shadow-lg">Elevation 30</div>
|
|
40
|
+
<div class="psui-rounded-md psui-p-8 psui-h-20 psui-bg-white psui-shadow-xl">Elevation 40</div>
|
|
41
41
|
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import PsRadioButton from '../components/controls/PsRadioButton.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/Radio Button',
|
|
5
|
+
component: PsRadioButton,
|
|
6
|
+
argTypes: {},
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const Template = (args, { argTypes }) => ({
|
|
10
|
+
props: Object.keys(argTypes),
|
|
11
|
+
components: { PsRadioButton },
|
|
12
|
+
template: `
|
|
13
|
+
<PsRadioButton v-bind="$props" />
|
|
14
|
+
`
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const Default = Template.bind({});
|
|
18
|
+
Default.args = {
|
|
19
|
+
label: 'Label'
|
|
20
|
+
};
|
|
21
|
+
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import
|
|
1
|
+
import PsTabHeader from '../components/tabs/PsTabHeader.vue';
|
|
2
2
|
const items = ['Existing Buildings', 'New Constructions', 'Other tab']
|
|
3
3
|
const item = items[0]
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
|
-
title: 'Components/
|
|
7
|
-
component:
|
|
6
|
+
title: 'Components/Tab Header',
|
|
7
|
+
component: PsTabHeader,
|
|
8
8
|
argTypes: {}
|
|
9
9
|
};
|
|
10
10
|
const Template = (args, { argTypes }) => ({
|
|
11
11
|
props: Object.keys(argTypes),
|
|
12
|
-
components: {
|
|
12
|
+
components: { PsTabHeader },
|
|
13
13
|
data: () => {
|
|
14
14
|
return {
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
template: `
|
|
18
|
-
<div class="bg-gray-20 p-8">
|
|
19
|
-
<
|
|
20
|
-
<div v-if="$props['selected'] === 'Existing Buildings'" class="bg-white p-4" :class="{ 'mt-4' : $props['theme'] === 'standard'}">
|
|
18
|
+
<div class="psui-bg-gray-20 psui-p-8">
|
|
19
|
+
<PsTabHeader :selected.sync=selected v-bind="$props"/>
|
|
20
|
+
<div v-if="$props['selected'] === 'Existing Buildings'" class="psui-bg-white psui-p-4" :class="{ 'psui-mt-4' : $props['theme'] === 'standard'}">
|
|
21
21
|
<p v-for="i of 4">Tab Existing Buildings Selected</p>
|
|
22
22
|
</div>
|
|
23
|
-
<div v-if="$props['selected'] === 'New Constructions'" class="bg-white p-4" :class="{ 'mt-4' : $props['theme'] === 'standard'}">
|
|
23
|
+
<div v-if="$props['selected'] === 'New Constructions'" class="psui-bg-white psui-p-4" :class="{ 'psui-mt-4' : $props['theme'] === 'standard'}">
|
|
24
24
|
<p v-for="i of 4">Tab New Constructions Selected</p>
|
|
25
25
|
</div>
|
|
26
|
-
<div v-if="$props['selected'] === 'Other tab'" class="bg-white p-4" :class="{ 'mt-4' : $props['theme'] === 'standard'}">
|
|
26
|
+
<div v-if="$props['selected'] === 'Other tab'" class="psui-bg-white psui-p-4" :class="{ 'psui-mt-4' : $props['theme'] === 'standard'}">
|
|
27
27
|
<p v-for="i of 4">Other tab Selected</p>
|
|
28
28
|
</div>
|
|
29
29
|
</div>
|