@policystudio/policy-studio-ui-vue 1.1.4 → 1.1.6
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/css/psui_styles.css +42 -0
- package/package.json +1 -1
- package/src/assets/scss/base.scss +1 -0
- package/src/assets/scss/components/PsSimpleAlert.scss +15 -0
- package/src/components/forms/PsDropdown.vue +4 -16
- package/src/components/notifications/PsSimpleAlert.vue +43 -0
- package/src/components/table-results/PsTableResults.vue +0 -1
- package/src/index.js +4 -1
- package/src/stories/SimpleAlert.stories.js +21 -0
- package/src/stories/TableResults.stories.js +0 -16
package/dist/css/psui_styles.css
CHANGED
|
@@ -4003,6 +4003,48 @@ video {
|
|
|
4003
4003
|
background-color: #8AC6D9;
|
|
4004
4004
|
}
|
|
4005
4005
|
|
|
4006
|
+
.psui-el-simple-alert {
|
|
4007
|
+
display: flex;
|
|
4008
|
+
align-items: center;
|
|
4009
|
+
grid-gap: 0.25rem;
|
|
4010
|
+
gap: 0.25rem;
|
|
4011
|
+
padding: 0.25rem;
|
|
4012
|
+
cursor: pointer;
|
|
4013
|
+
width: 100%;
|
|
4014
|
+
border-radius: 0.375rem;
|
|
4015
|
+
word-break:normal ;
|
|
4016
|
+
}
|
|
4017
|
+
|
|
4018
|
+
.psui-el-simple-alert-message {
|
|
4019
|
+
font-size: 12px;
|
|
4020
|
+
line-height: 130%;
|
|
4021
|
+
letter-spacing: 0.6px;
|
|
4022
|
+
margin-left: auto;
|
|
4023
|
+
margin-right: auto;
|
|
4024
|
+
font-weight: 700;
|
|
4025
|
+
}
|
|
4026
|
+
|
|
4027
|
+
.psui-el-simple-alert-button{
|
|
4028
|
+
font-family: 'Material Icons Round';
|
|
4029
|
+
font-weight: normal;
|
|
4030
|
+
font-style: normal;
|
|
4031
|
+
font-size: 24px;
|
|
4032
|
+
line-height: 1;
|
|
4033
|
+
letter-spacing: normal;
|
|
4034
|
+
text-transform: none;
|
|
4035
|
+
display: inline-block;
|
|
4036
|
+
white-space: nowrap;
|
|
4037
|
+
word-wrap: normal;
|
|
4038
|
+
direction: ltr;
|
|
4039
|
+
-webkit-font-feature-settings: 'liga';
|
|
4040
|
+
-webkit-font-smoothing: antialiased;
|
|
4041
|
+
}
|
|
4042
|
+
|
|
4043
|
+
.psui-el-simple-alert-button:focus{
|
|
4044
|
+
outline: 2px solid transparent;
|
|
4045
|
+
outline-offset: 2px;
|
|
4046
|
+
}
|
|
4047
|
+
|
|
4006
4048
|
.psui-space-y-0 > :not(template) ~ :not(template){
|
|
4007
4049
|
--space-y-reverse: 0;
|
|
4008
4050
|
margin-top: calc(0px * calc(1 - var(--space-y-reverse)));
|
package/package.json
CHANGED
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
@import './components/PsDateCardInfo.scss';
|
|
34
34
|
@import './components/PsTagScope.scss';
|
|
35
35
|
@import './components/PsBarChart.scss';
|
|
36
|
+
@import './components/PsSimpleAlert.scss';
|
|
36
37
|
@import "tailwindcss/base";
|
|
37
38
|
@import "tailwindcss/components";
|
|
38
39
|
@import "tailwindcss/utilities";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.psui-el-simple-alert {
|
|
3
|
+
@apply psui-flex psui-items-center psui-gap-1 psui-p-1 psui-cursor-pointer psui-w-full psui-rounded-md;
|
|
4
|
+
word-break:normal ;
|
|
5
|
+
&-message {
|
|
6
|
+
@apply psui-text-accentSmall psui-mx-auto psui-font-bold;
|
|
7
|
+
}
|
|
8
|
+
&-button{
|
|
9
|
+
@apply psui-icon;
|
|
10
|
+
&:focus{
|
|
11
|
+
@apply psui-outline-none;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -78,18 +78,11 @@ export default {
|
|
|
78
78
|
default: false,
|
|
79
79
|
},
|
|
80
80
|
/**
|
|
81
|
-
* It sets the vertical position.
|
|
81
|
+
* It sets the vertical and horizontal position.
|
|
82
82
|
*/
|
|
83
83
|
position: {
|
|
84
84
|
type: String,
|
|
85
|
-
validator: (value)=> ['
|
|
86
|
-
},
|
|
87
|
-
/**
|
|
88
|
-
* It sets the custom positions.
|
|
89
|
-
*/
|
|
90
|
-
customPosition: {
|
|
91
|
-
type: String,
|
|
92
|
-
default: '',
|
|
85
|
+
validator: (value)=> ['custom'].includes(value)
|
|
93
86
|
},
|
|
94
87
|
},
|
|
95
88
|
data() {
|
|
@@ -153,14 +146,9 @@ export default {
|
|
|
153
146
|
PSDropdownDialog.style.left = `${rectTrigger.x}px`
|
|
154
147
|
}
|
|
155
148
|
|
|
156
|
-
if(this.position == 'top') {
|
|
157
|
-
PSDropdownDialog.style.top = `${(rectTrigger.y - rectDialog.height) - 10}px`
|
|
158
|
-
}
|
|
159
|
-
|
|
160
149
|
if(this.position == 'custom') {
|
|
161
|
-
PSDropdownDialog.style =
|
|
162
|
-
PSDropdownDialog.style.
|
|
163
|
-
PSDropdownDialog.style.position = 'absolute'
|
|
150
|
+
PSDropdownDialog.style.top = `${rectTrigger.y}px`
|
|
151
|
+
PSDropdownDialog.style.left = `${rectTrigger.x + 80}px`
|
|
164
152
|
}
|
|
165
153
|
|
|
166
154
|
if (rectTrigger.top < 10) {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template >
|
|
2
|
+
<div class="psui-el-simple-alert" v-bind="$attrs" @click.stop="$emit('click')">
|
|
3
|
+
<PsIcon
|
|
4
|
+
:icon="icon"
|
|
5
|
+
:icon-classes="iconClass"
|
|
6
|
+
:size="iconSize"
|
|
7
|
+
/>
|
|
8
|
+
<p class="psui-el-simple-alert-message">{{ message }}</p>
|
|
9
|
+
<button class="psui-el-simple-alert-button" :class="buttonClass" @click.stop="$emit('close')">close</button>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import PsIcon from '../ui/PsIcon.vue'
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
name: 'PsSimpleAlert',
|
|
19
|
+
components: { PsIcon },
|
|
20
|
+
props: {
|
|
21
|
+
message: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: ''
|
|
24
|
+
},
|
|
25
|
+
icon: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: 'info'
|
|
28
|
+
},
|
|
29
|
+
iconClass:{
|
|
30
|
+
type:String,
|
|
31
|
+
default: ''
|
|
32
|
+
},
|
|
33
|
+
buttonClass:{
|
|
34
|
+
type:String,
|
|
35
|
+
default: ''
|
|
36
|
+
},
|
|
37
|
+
iconSize:{
|
|
38
|
+
type: [Number, String],
|
|
39
|
+
default: 24
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
</script>
|
package/src/index.js
CHANGED
|
@@ -44,6 +44,7 @@ import PsTestimonialCard from './components/badges-and-tags/PsTestimonialCard.vu
|
|
|
44
44
|
import PsDateCardInfo from './components/badges-and-tags/PsDateCardInfo.vue'
|
|
45
45
|
import PsTagScope from './components/badges-and-tags/PsTagScope.vue'
|
|
46
46
|
import PsBarChart from './components/data-graphics/PsBarChart.vue'
|
|
47
|
+
import PsSimpleAlert from './components/notifications/PsSimpleAlert.vue'
|
|
47
48
|
|
|
48
49
|
export default {
|
|
49
50
|
install(Vue) {
|
|
@@ -88,6 +89,7 @@ export default {
|
|
|
88
89
|
Vue.component('PsDateCardInfo',PsDateCardInfo)
|
|
89
90
|
Vue.component('PsTagScope',PsTagScope)
|
|
90
91
|
Vue.component('PsBarChart',PsBarChart)
|
|
92
|
+
Vue.component('PsSimpleAlert',PsSimpleAlert)
|
|
91
93
|
|
|
92
94
|
Vue.directive('click-outside', {
|
|
93
95
|
bind: function (el, binding, vnode) {
|
|
@@ -148,6 +150,7 @@ export {
|
|
|
148
150
|
PsTestimonialCard,
|
|
149
151
|
PsDateCardInfo,
|
|
150
152
|
PsTagScope,
|
|
151
|
-
PsBarChart
|
|
153
|
+
PsBarChart,
|
|
154
|
+
PsSimpleAlert
|
|
152
155
|
}
|
|
153
156
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import PsSimpleAlert from '../components/notifications/PsSimpleAlert.vue'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Notifications/Simple Alert',
|
|
5
|
+
component: PsSimpleAlert,
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const TemplateDefault = (args, { argTypes }) => ({
|
|
9
|
+
props: Object.keys(argTypes),
|
|
10
|
+
components: { PsSimpleAlert },
|
|
11
|
+
template: `
|
|
12
|
+
<div style="width:300px;">
|
|
13
|
+
<PsSimpleAlert v-bind="$props" class="psui-text-blue-60 psui-bg-blue-20"/>
|
|
14
|
+
</div>
|
|
15
|
+
`,
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
export const Default = TemplateDefault.bind({})
|
|
19
|
+
Default.args = {
|
|
20
|
+
message:'lorem'
|
|
21
|
+
}
|
|
@@ -295,22 +295,6 @@ Simple.args = {
|
|
|
295
295
|
],
|
|
296
296
|
summaryData: [
|
|
297
297
|
{
|
|
298
|
-
actions: [
|
|
299
|
-
{
|
|
300
|
-
icon: 'delete_outline',
|
|
301
|
-
text: 'Remove prototype from your policy',
|
|
302
|
-
callback: () => {}
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
icon: 'add_circle_outline',
|
|
306
|
-
text: 'Add requirements',
|
|
307
|
-
callback: () => {}
|
|
308
|
-
},
|
|
309
|
-
{
|
|
310
|
-
icon: 'more_horiz',
|
|
311
|
-
callback: () => {}
|
|
312
|
-
},
|
|
313
|
-
],
|
|
314
298
|
'data': {
|
|
315
299
|
'forecast_units_affected': 337.5,
|
|
316
300
|
'forecast_emissions_savings': -1470.2228427746163,
|