@policystudio/policy-studio-ui-vue 1.0.27 → 1.0.28

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.
Files changed (66) hide show
  1. package/dist/css/psui_styles.css +4752 -586
  2. package/package.json +1 -1
  3. package/src/assets/scss/base.scss +38 -3
  4. package/src/assets/scss/components/PsButton.scss +114 -120
  5. package/src/assets/scss/components/PsCardInfos.scss +26 -0
  6. package/src/assets/scss/components/PsChartLegend.scss +25 -0
  7. package/src/assets/scss/components/PsCheckbox.scss +96 -0
  8. package/src/assets/scss/components/PsChips.scss +155 -0
  9. package/src/assets/scss/components/PsClimateZoneBadge.scss +26 -0
  10. package/src/assets/scss/components/PsCostEffectBar.scss +31 -0
  11. package/src/assets/scss/components/PsDataTable.scss +50 -0
  12. package/src/assets/scss/components/PsDropdown.scss +44 -0
  13. package/src/assets/scss/components/PsHighlightRippleDot.scss +48 -0
  14. package/src/assets/scss/components/PsInlineSelector.scss +5 -0
  15. package/src/assets/scss/components/PsInputSelect.scss +62 -0
  16. package/src/assets/scss/components/PsInputTextArea.scss +49 -0
  17. package/src/assets/scss/components/PsProgressBar.scss +24 -0
  18. package/src/assets/scss/components/PsRadioButton.scss +78 -0
  19. package/src/assets/scss/components/PsSlider.scss +11 -0
  20. package/src/assets/scss/components/PsSwitch.scss +66 -0
  21. package/src/assets/scss/components/PsTabHeader.scss +10 -3
  22. package/src/assets/scss/components/PsToast.scss +52 -0
  23. package/src/assets/scss/components/PsToggle.scss +23 -0
  24. package/src/assets/scss/components/PsTooltip.scss +118 -0
  25. package/src/components/badges-and-tags/PsCardInfos.vue +14 -7
  26. package/src/components/badges-and-tags/PsChartLegend.vue +7 -13
  27. package/src/components/badges-and-tags/PsClimateZoneBadge.vue +15 -6
  28. package/src/components/badges-and-tags/PsCostEffectBar.Copy.vue +72 -0
  29. package/src/components/badges-and-tags/PsCostEffectBar.vue +33 -70
  30. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +3 -69
  31. package/src/components/badges-and-tags/PsProgressBar.vue +42 -0
  32. package/src/components/buttons/PsButton.vue +74 -78
  33. package/src/components/chips/PsChips.vue +46 -87
  34. package/src/components/controls/PsCheckbox.vue +58 -134
  35. package/src/components/controls/PsInlineSelector.vue +15 -0
  36. package/src/components/controls/PsRadioButton.vue +33 -88
  37. package/src/components/controls/PsSlider.vue +4 -5
  38. package/src/components/controls/PsSwitch.vue +29 -81
  39. package/src/components/controls/PsToggle.vue +45 -39
  40. package/src/components/datatable/PsDataTable.vue +3 -15
  41. package/src/components/forms/PsDropdown.vue +27 -11
  42. package/src/components/forms/PsInputSelect.vue +80 -0
  43. package/src/components/forms/PsInputTextArea.vue +80 -0
  44. package/src/components/notifications/PsDialog.vue +3 -0
  45. package/src/components/notifications/PsToast.vue +13 -28
  46. package/src/components/tabs/PsTabHeader.vue +30 -12
  47. package/src/components/tooltip/PsDialogTooltip.vue +6 -31
  48. package/src/components/tooltip/PsRichTooltip.vue +37 -44
  49. package/src/components/tooltip/PsTooltip.vue +18 -28
  50. package/src/components/ui/PsIcon.vue +9 -9
  51. package/src/index.js +9 -0
  52. package/src/stories/Button.stories.js +102 -112
  53. package/src/stories/Checkbox.stories.js +34 -37
  54. package/src/stories/Chips.stories.js +43 -54
  55. package/src/stories/ClimateZoneBadge.stories.js +0 -7
  56. package/src/stories/InlineSelector.stories.js +16 -0
  57. package/src/stories/InputSelect.stories.js +22 -0
  58. package/src/stories/InputTextArea.stories.js +25 -0
  59. package/src/stories/RadioButton.stories.js +32 -29
  60. package/src/stories/Switch.stories.js +33 -0
  61. package/src/stories/Toast.stories.js +40 -46
  62. package/src/stories/Tooltip.stories.js +86 -86
  63. package/tailwind.config.js +7 -1
  64. package/src/assets/images/check-checkbox-button.svg +0 -1
  65. package/src/assets/images/radio-checked-button.svg +0 -1
  66. package/src/stories/Swith.stories.js +0 -38
@@ -1,10 +1,13 @@
1
1
  <template>
2
- <div class="psui-border psui-border-gray-20 psui-rounded-md psui-flex psui-flex-col psui-items-center psui-justify-center psui-px-3 psui-py-2 psui-space-y-2">
3
- <h5 class="psui-text-xsmall psui-font-bold psui-text-gray-40">
4
- <span class="psui-text-gray-60">{{ title }} </span>{{ subtitle }}
2
+ <div
3
+ class="psui-el-card-infos"
4
+ @click="onClick()"
5
+ >
6
+ <h5 class="psui-el-card-infos-title">
7
+ <span class="psui-text-gray-60 psui-mr-1">{{ title }}</span>{{ subtitle }}
5
8
  </h5>
6
- <div class="psui-w-full psui-flex psui-justify-center psui-items-center psui-space-x-2 psui-text-p">
7
- <span class="psui-text-blue-50 material-icons-round">{{ icon }}</span>
9
+ <div class="psui-el-card-infos-content">
10
+ <span class="psui-el-card-infos-icon material-icons-round">{{ icon }}</span>
8
11
  <h5 class="psui-text-gray-80">{{ total }}</h5>
9
12
  </div>
10
13
  </div>
@@ -30,9 +33,13 @@ export default {
30
33
  type: String,
31
34
  default: '',
32
35
  },
36
+ },
37
+ methods: {
38
+ onClick() {
39
+ this.$emit('click')
40
+ }
33
41
  }
34
42
  }
35
43
  </script>
36
44
 
37
- <style scoped>
38
- </style>
45
+ <style> /* Please, use the file src/assets/scss/components/PsCardInfos.scss */</style>
@@ -1,12 +1,12 @@
1
1
  <template>
2
- <div class="psui-flex psui-p-2 psui-rounded">
2
+ <div class="psui-el-chart-legend">
3
3
  <div class="psui-flex psui-flex-shrink-0">
4
- <div class="dot psui-rounded-full" :style="dotColor"></div>
4
+ <div class="psui-el-chart-legend-dot" :style="dotColor"></div>
5
5
  </div>
6
6
  <div class="psui-flex-grow-1">
7
- <div class="psui-text-xsmall psui-text-gray-50 psui-font-bold psui-mb-1">{{ text }}</div>
8
- <span v-if="this.total" class="psui-text-p psui-text-gray-80">{{ total }}</span>
9
- <span class="psui-text-gray-50" v-if="percentage"><span class="psui-text-gray-30" v-if="total && percentage"> | </span>{{ percentage }}%</span>
7
+ <div class="psui-el-chart-legend-text">{{ text }}</div>
8
+ <span v-if="this.total" class="psui-el-chart-legend-total">{{ total }}</span>
9
+ <span class="psui-el-chart-legend-percentage" v-if="percentage"><span class="psui-text-gray-30" v-if="total && percentage"> | </span>{{ percentage }}%</span>
10
10
  </div>
11
11
  </div>
12
12
  </template>
@@ -15,7 +15,7 @@
15
15
  export default {
16
16
  props: {
17
17
  text: {
18
- type: String,
18
+ type: [String, Number],
19
19
  default: 'Climate Zone 10',
20
20
  },
21
21
  total: {
@@ -34,10 +34,4 @@ export default {
34
34
  }
35
35
  </script>
36
36
 
37
- <style scoped>
38
- .dot {
39
- width: 14px; height: 14px;
40
- background-color: #43cec2;
41
- margin-right: 6px;
42
- }
43
- </style>
37
+ <style> /* Please, use the file src/assets/scss/components/PsChartLegend.scss */</style>
@@ -1,10 +1,10 @@
1
1
  <template>
2
- <button
3
- class="psui-flex psui-p-3 psui-bg-gray-10 psui-text-gray-50 hover:psui-text-blue-60 hover:psui-bg-blue-20 psui-transition-all psui-duration-300 psui-ease-out psui-shadow-lg psui-rounded"
4
- >
5
- <i v-if="icon" class="material-icons psui-text-base"> {{ icon }} </i>
6
- <p class="psui-text-sm">10</p>
7
- </button>
2
+ <div class="psui-el-climate-zone-badge">
3
+ <i v-if="icon"> {{ icon }} </i>
4
+ <span>
5
+ {{ content }}
6
+ </span>
7
+ </div>
8
8
  </template>
9
9
 
10
10
  <script>
@@ -12,7 +12,16 @@ export default {
12
12
  props: {
13
13
  icon: {
14
14
  type: String,
15
+ default: 'area_chart',
16
+ },
17
+ content: {
18
+ type: Number,
19
+ default: 10,
15
20
  },
16
21
  },
17
22
  }
18
23
  </script>
24
+
25
+ <style>
26
+ /* Please, use the file src/assets/scss/components/PsClimateZoneBadge.scss */
27
+ </style>
@@ -0,0 +1,72 @@
1
+ <template>
2
+ <div class="psui-el-cost-effect-bar">
3
+
4
+ <div
5
+ :class="{
6
+ 'psui-bg-blue-20': value >= breakEven,
7
+ 'psui-bg-red-10': value < breakEven,
8
+ }"
9
+ >
10
+
11
+ <span :style="breakEvenPosition"> </span>
12
+
13
+ <div class="psui-overflow-hidden">
14
+
15
+ <input
16
+ type="number"
17
+ :style="{ width: `${value}px` }"
18
+ :class="{
19
+ 'psui-bg-blue-60': value >= breakEven,
20
+ 'psui-bg-red-20': value < breakEven,
21
+ }"
22
+ />
23
+ </div>
24
+
25
+ </div>
26
+ </div>
27
+ </template>
28
+
29
+ <script>
30
+ export default {
31
+ name: 'PsCostEffectBar',
32
+
33
+ props: {
34
+ value: {
35
+ type: Number,
36
+ required: true,
37
+ default: 0,
38
+ },
39
+ breakEven: {
40
+ type: Number,
41
+ required: true,
42
+ default: 1,
43
+ },
44
+ },
45
+ data() {
46
+ return {
47
+ errors: [],
48
+ }
49
+ },
50
+
51
+ computed: {
52
+ valueBar() {
53
+ if (this.value > 100) return 100
54
+ else if (this.value < 0) return 0
55
+ else return this.value
56
+ },
57
+
58
+ breakEvenPosition() {
59
+ return `left: ${this.breakEven}px`
60
+ },
61
+
62
+ getIsBreakEven() {
63
+ if (this.breakEven < 0) return 0
64
+ else if (this.breakEven > 100) return 100
65
+ else return this.breakEven
66
+ },
67
+ },
68
+ }
69
+ </script>
70
+
71
+ <style> /* Please, use the file src/assets/scss/components/PsCostEffectBar.scss */</style>
72
+
@@ -1,33 +1,26 @@
1
1
  <template>
2
- <div>
3
- <div class="container">
4
- <div
5
- class="loading-bar"
6
- :class="{
7
- 'psui-bg-blue-20': value >= breakEven,
8
- 'psui-bg-red-10': value < breakEven,
9
- }"
10
- >
11
- <span class="breakEven" :style="breakEvenPosition"> </span>
2
+ <div class="psui-el-cost-effect-bar">
3
+ <div>
4
+ <span :style="breakEvenPosition"> </span>
12
5
 
13
- <input
14
- type="number"
15
- min="0"
16
- max="100"
17
- class="percentage"
18
- :style="{ width: `${value}px` }"
19
- :class="{
20
- 'psui-bg-blue-60': value >= breakEven,
21
- 'psui-bg-red-20': value < breakEven,
22
- }"
23
- />
24
- </div>
6
+ <PsProgressBar
7
+ :value="value"
8
+ :percentageColor="percentageColor"
9
+ :bgColor="bgColor"
10
+ >
11
+ </PsProgressBar>
25
12
  </div>
26
13
  </div>
27
14
  </template>
28
15
 
29
16
  <script>
17
+ import PsProgressBar from './PsProgressBar.vue'
30
18
  export default {
19
+ name: 'PsCostEffectBar',
20
+ components: {
21
+ PsProgressBar,
22
+ },
23
+
31
24
  props: {
32
25
  value: {
33
26
  type: Number,
@@ -37,7 +30,7 @@ export default {
37
30
  breakEven: {
38
31
  type: Number,
39
32
  required: true,
40
- default: 1,
33
+ default: 0,
41
34
  },
42
35
  },
43
36
  data() {
@@ -54,61 +47,31 @@ export default {
54
47
  },
55
48
 
56
49
  breakEvenPosition() {
57
- return `left: ${this.breakEven}px`
50
+ return `left: ${this.breakEven >= 98 ? 98 : this.breakEven}px`
58
51
  },
52
+
59
53
  getIsBreakEven() {
60
54
  if (this.breakEven < 0) return 0
61
55
  else if (this.breakEven > 100) return 100
62
56
  else return this.breakEven
63
- // else return true;
64
- // return this.value > this.breakEven ? true : false;
65
57
  },
66
- },
67
- }
68
- </script>
69
58
 
70
- <style scoped>
71
- .container {
72
- overflow: visible;
73
- }
74
-
75
- .loading-bar {
76
- position: relative;
77
- width: 100px;
78
- height: 8px;
79
- border-radius: 15px;
80
- }
81
-
82
- .loading-bar .percentage {
83
- position: absolute;
84
- display: block;
85
- max-width: 100px;
86
- height: 100%;
87
- border-radius: 15px;
88
- overflow: visible;
89
- background-size: 30px 30px;
90
- animation: animate-stripes 3s linear infinite;
91
- }
59
+ percentageColor() {
60
+ return this.value >= this.breakEven
61
+ ? 'psui-bg-blue-60'
62
+ : 'psui-bg-red-20'
63
+ },
92
64
 
93
- .breakEven {
94
- position: absolute;
95
- background-color: #d6dde5;
96
- width: 2px;
97
- height: 14px;
98
- /* max-width: 100px; */
99
- border-radius: 2px;
100
- top: -3px;
101
- z-index: 1;
102
- /* left: 2px; */
103
- /* right: -2px; */
65
+ bgColor() {
66
+ // console.log(this.value >= this.breakEven ? 'psui-bg-blue-20' : 'psui-bg-red-10')
67
+ return this.value >= this.breakEven
68
+ ? 'psui-bg-blue-20'
69
+ : 'psui-bg-red-10'
70
+ },
71
+ },
104
72
  }
73
+ </script>
105
74
 
106
- @keyframes animate-stripes {
107
- 0% {
108
- background-position: 0 0;
109
- }
110
- 100% {
111
- background-position: 60px 0;
112
- }
113
- }
75
+ <style>
76
+ /* Please, use the file src/assets/scss/components/PsCostEffectBar.scss */
114
77
  </style>
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <div class="example">
3
- <div class="dot"></div>
2
+ <div class="psui-el-highlight-ripple-icon">
3
+ <div class="psui-el-icon"></div>
4
4
  </div>
5
5
  </template>
6
6
 
@@ -8,71 +8,5 @@
8
8
  export default {}
9
9
  </script>
10
10
 
11
- <style scoped>
12
- .example {
13
- position: static;
14
- /* margin: 0px 32px; */
15
- /* width: 275px;
16
- height: 229px; */
17
- /* left: 0px;
18
- top: 0px; */
19
- /* border: 1.5px dashed #9b51e0; */
20
- /* background: #f3f6f9; */
21
- box-sizing: border-box;
22
- }
23
- .dot {
24
- background: #5db883;
25
- /* border: solid 1px #2bb24c; */
26
- border-radius: 50%;
27
- /* box-shadow: 0px 0 2px #2bb24c; */
28
- width: 8px;
29
- height: 8px;
30
- /* left: 6px;
31
- top: 6px; */
32
- margin: 100px auto;
33
- position: relative;
34
- }
11
+ <style> /* Please, use the file src/assets/scss/components/PsHighlightRippleDot.scss */</style>
35
12
 
36
- .dot::before,
37
- .dot::after {
38
- background: #def8e8;
39
- border: solid 0px #2bb24c;
40
- border-radius: 50%;
41
- content: '';
42
- width: 36px;
43
- height: 36px;
44
- left: -8px;
45
- top: -8px;
46
- position: absolute;
47
- transform-origin: center center;
48
- transform: scale(1) translate(-1px, -1px);
49
- }
50
- .dot::before {
51
- animation: ripple 1s infinite;
52
- }
53
- .dot::after {
54
- animation: ripple 1s infinite;
55
- /* animation-delay: 0.4s; */
56
- }
57
-
58
- @keyframes ripple {
59
- 0% {
60
- /* transform: scale(1) translate(-1px, -1px);
61
- opacity: 0.75; */
62
- left: 5px;
63
- top: 5px;
64
- opacity: 0.95;
65
- width: 0;
66
- height: 0;
67
- }
68
- 100% {
69
- /* transform: scale(2) translate(-1px, -1px);
70
- opacity: 0; */
71
- left: -13px;
72
- top: -13px;
73
- opacity: 0;
74
- width: 36px;
75
- height: 36px;
76
- }
77
- }
78
- </style>
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <div
3
+ class="psui-el-simple-progress-bar"
4
+ :class="bgColor"
5
+ >
6
+ <div
7
+ class="psui-el-simple-progress-bar-percentage"
8
+ :style="{ width: `${value}px` }"
9
+ :class="percentageColor"
10
+ ></div>
11
+ </div>
12
+ </template>
13
+
14
+ <script>
15
+ export default {
16
+ props: {
17
+ value: {
18
+ type: Number,
19
+ required: true,
20
+ default: 0,
21
+ validator: (value) => {
22
+ return value >= 0 && value <= 100
23
+ },
24
+ },
25
+ percentageColor: {
26
+ type: String,
27
+ default: 'psui-bg-blue-60'
28
+ // required: true,
29
+
30
+ },
31
+ bgColor: {
32
+ type: String,
33
+ default: 'psui-bg-blue-20'
34
+ // required: true,
35
+ },
36
+
37
+ },
38
+ }
39
+ </script>
40
+
41
+ <style> /* Please, use the file src/assets/scss/components/PsProgressBar.scss */ </style>
42
+
@@ -1,78 +1,74 @@
1
- <template>
2
- <button
3
- @click="onClick()"
4
- @mouseenter="onMouseEnter"
5
- @mouseleave="onMouseLeave"
6
- class='psui-el-button'
7
- :class="[getComponentClass, {'hover': isHover}, {'disabled': disabled}]"
8
- >
9
- <i v-if="icon" :class='iconClass' class='material-icons-round'>{{icon}}</i>
10
- <span v-if="label">{{ label }}</span>
11
- </button>
12
- </template>
13
-
14
- <script>
15
- export default {
16
- props: {
17
- label: {
18
- type: String,
19
- },
20
- layout: {
21
- type: String,
22
- default: 'solid',
23
- validator: (value) => ['solid','outline','ghost','onlytext'].includes(value)
24
- },
25
- icon: {
26
- type: String,
27
- },
28
- iconPosition:{
29
- type: String,
30
- default: 'left',
31
- validator: (value) => ['left','right'].includes(value)
32
- },
33
- size: {
34
- type: String,
35
- default: 'big',
36
- validator: (value) => ['small','medium','big','custom'].includes(value)
37
- },
38
- disabled: {
39
- type: Boolean,
40
- default: false
41
- },
42
- iconClass:{
43
- type: String
44
- }
45
- },
46
- data(){
47
- return {
48
- isHover: false,
49
- }
50
- },
51
- computed: {
52
- getComponentClass(){
53
- if (this.size != 'custom') {
54
- return `layout-${this.layout} size-${this.size} icon-${this.iconPosition}`
55
- } else {
56
- return `layout-${this.layout} icon-${this.iconPosition}`
57
- }
58
- }
59
- },
60
- methods: {
61
- onClick() {
62
- if (this.disabled) return
63
- this.$emit('click')
64
- },
65
- onMouseEnter(){
66
- if(!this.disabled){
67
- this.isHover = true
68
- }
69
- },
70
- onMouseLeave(){
71
- if(!this.disabled){
72
- this.isHover = false
73
- }
74
- }
75
- }
76
- }
77
- </script>
78
-
1
+ <template>
2
+ <button
3
+ @click="onClick()"
4
+ @mouseenter="onMouseEnter"
5
+ @mouseleave="onMouseLeave"
6
+ class='psui-el-button'
7
+ :class="[getComponentClass, {'hover': isHover}, {'disabled': disabled}]"
8
+ >
9
+ <i v-if="icon" :class='iconClass' class='material-icons-round'>{{icon}}</i>
10
+ <span v-if="label">{{ label }}</span>
11
+ </button>
12
+ </template>
13
+
14
+ <script>
15
+ export default {
16
+ props: {
17
+ label: {
18
+ type: String,
19
+ },
20
+ layout: {
21
+ type: String,
22
+ default: 'solid',
23
+ validator: (value) => ['solid','outline','ghost','onlytext'].includes(value)
24
+ },
25
+ icon: {
26
+ type: String,
27
+ },
28
+ iconPosition:{
29
+ type: String,
30
+ default: 'left',
31
+ validator: (value) => ['left','right'].includes(value)
32
+ },
33
+ size: {
34
+ type: String,
35
+ default: 'big',
36
+ validator: (value) => ['small','medium','big'].includes(value)
37
+ },
38
+ disabled: {
39
+ type: Boolean,
40
+ default: false
41
+ },
42
+ iconClass:{
43
+ type: String
44
+ }
45
+ },
46
+ data(){
47
+ return {
48
+ isHover: false,
49
+ }
50
+ },
51
+ computed: {
52
+ getComponentClass(){
53
+ return `layout-${this.layout} size-${this.size} icon-${this.iconPosition}`
54
+ }
55
+ },
56
+ methods: {
57
+ onClick() {
58
+ if (this.disabled) return
59
+ this.$emit('click')
60
+ },
61
+ onMouseEnter(){
62
+ if(!this.disabled){
63
+ this.isHover = true
64
+ }
65
+ },
66
+ onMouseLeave(){
67
+ if(!this.disabled){
68
+ this.isHover = false
69
+ }
70
+ }
71
+ }
72
+ }
73
+ </script>
74
+