@policystudio/policy-studio-ui-vue 1.0.24 → 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 (72) hide show
  1. package/dist/css/psui_styles.css +4822 -383
  2. package/package.json +1 -1
  3. package/src/assets/scss/base.scss +39 -2
  4. package/src/assets/scss/components/PsAccordion.scss +6 -2
  5. package/src/assets/scss/components/PsButton.scss +114 -118
  6. package/src/assets/scss/components/PsCardInfos.scss +26 -0
  7. package/src/assets/scss/components/PsChartLegend.scss +25 -0
  8. package/src/assets/scss/components/PsCheckbox.scss +96 -0
  9. package/src/assets/scss/components/PsChips.scss +155 -0
  10. package/src/assets/scss/components/PsClimateZoneBadge.scss +26 -0
  11. package/src/assets/scss/components/PsCostEffectBar.scss +31 -0
  12. package/src/assets/scss/components/PsDataTable.scss +50 -0
  13. package/src/assets/scss/components/PsDialog.scss +80 -0
  14. package/src/assets/scss/components/PsDropdown.scss +44 -0
  15. package/src/assets/scss/components/PsHighlightRippleDot.scss +48 -0
  16. package/src/assets/scss/components/PsInlineSelector.scss +5 -0
  17. package/src/assets/scss/components/PsInputSelect.scss +62 -0
  18. package/src/assets/scss/components/PsInputTextArea.scss +49 -0
  19. package/src/assets/scss/components/PsProgressBar.scss +24 -0
  20. package/src/assets/scss/components/PsRadioButton.scss +78 -0
  21. package/src/assets/scss/components/PsSlider.scss +11 -0
  22. package/src/assets/scss/components/PsSwitch.scss +66 -0
  23. package/src/assets/scss/components/PsTabHeader.scss +105 -0
  24. package/src/assets/scss/components/PsToast.scss +52 -0
  25. package/src/assets/scss/components/PsToggle.scss +23 -0
  26. package/src/assets/scss/components/PsTooltip.scss +118 -0
  27. package/src/components/accordion/PsAccordion.vue +0 -1
  28. package/src/components/accordion/PsAccordionItem.vue +9 -2
  29. package/src/components/badges-and-tags/PsCardInfos.vue +14 -7
  30. package/src/components/badges-and-tags/PsChartLegend.vue +12 -18
  31. package/src/components/badges-and-tags/PsClimateZoneBadge.vue +15 -6
  32. package/src/components/badges-and-tags/PsCostEffectBar.Copy.vue +72 -0
  33. package/src/components/badges-and-tags/PsCostEffectBar.vue +33 -70
  34. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +3 -69
  35. package/src/components/badges-and-tags/PsProgressBar.vue +42 -0
  36. package/src/components/buttons/PsButton.vue +74 -77
  37. package/src/components/chips/PsChips.vue +46 -87
  38. package/src/components/controls/PsCheckbox.vue +58 -134
  39. package/src/components/controls/PsInlineSelector.vue +15 -0
  40. package/src/components/controls/PsRadioButton.vue +33 -88
  41. package/src/components/controls/PsSlider.vue +4 -5
  42. package/src/components/controls/PsSwitch.vue +29 -81
  43. package/src/components/controls/PsToggle.vue +45 -39
  44. package/src/components/datatable/PsDataTable.vue +3 -15
  45. package/src/components/forms/PsDropdown.vue +27 -11
  46. package/src/components/forms/PsInputSelect.vue +80 -0
  47. package/src/components/forms/PsInputTextArea.vue +80 -0
  48. package/src/components/notifications/PsDialog.vue +32 -23
  49. package/src/components/notifications/PsToast.vue +13 -28
  50. package/src/components/tabs/PsTabHeader.vue +53 -41
  51. package/src/components/tooltip/PsDialogTooltip.vue +6 -31
  52. package/src/components/tooltip/PsRichTooltip.vue +37 -44
  53. package/src/components/tooltip/PsTooltip.vue +18 -28
  54. package/src/components/ui/PsIcon.vue +9 -9
  55. package/src/index.js +12 -3
  56. package/src/stories/Button.stories.js +102 -102
  57. package/src/stories/Checkbox.stories.js +34 -37
  58. package/src/stories/Chips.stories.js +43 -54
  59. package/src/stories/ClimateZoneBadge.stories.js +0 -7
  60. package/src/stories/Dialog.stories.js +15 -51
  61. package/src/stories/InlineSelector.stories.js +16 -0
  62. package/src/stories/InputSelect.stories.js +22 -0
  63. package/src/stories/InputTextArea.stories.js +25 -0
  64. package/src/stories/RadioButton.stories.js +32 -29
  65. package/src/stories/Switch.stories.js +33 -0
  66. package/src/stories/TabHeader.stories.js +6 -6
  67. package/src/stories/Toast.stories.js +40 -46
  68. package/src/stories/Tooltip.stories.js +86 -86
  69. package/tailwind.config.js +7 -1
  70. package/src/assets/images/check-checkbox-button.svg +0 -1
  71. package/src/assets/images/radio-checked-button.svg +0 -1
  72. package/src/stories/Swith.stories.js +0 -38
@@ -1,77 +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}, {'active': isActive}, {'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
- required: true,
23
- default: 'solid',
24
- validator: (value) => ['solid','outline','ghost','onlytext'].includes(value)
25
- },
26
- icon: {
27
- type: String,
28
- },
29
- iconPosition:{
30
- type: String,
31
- default: 'right',
32
- validator: (value) => ['left','right'].includes(value)
33
- },
34
- size: {
35
- type: String,
36
- default: 'big',
37
- validator: (value) => ['small','medium','big'].includes(value)
38
- },
39
- disabled: {
40
- type: Boolean,
41
- default: false
42
- },
43
- iconClass:{
44
- type: String
45
- }
46
- },
47
- data(){
48
- return {
49
- isHover: false,
50
- isActive: false,
51
- }
52
- },
53
- computed: {
54
- getComponentClass(){
55
- return `layout-${this.layout} ${this.size} ${this.iconPosition}`
56
- }
57
- },
58
- methods: {
59
- onClick() {
60
- if (this.disabled) return
61
- this.isActive = true,
62
- this.$emit('click')
63
- },
64
- onMouseEnter(){
65
- if(!this.disabled){
66
- this.isHover = true
67
- }
68
- },
69
- onMouseLeave(){
70
- if(!this.disabled){
71
- this.isHover = false
72
- }
73
- }
74
- }
75
- }
76
- </script>
77
-
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
+
@@ -1,58 +1,68 @@
1
1
  <template>
2
- <label
3
- @click="onClick"
4
- :for="title"
5
- :class="getCssClass"
6
- class="
7
- psui-flex
8
- psui-gap-2
9
- psui-bg-gray-10
10
- psui-text-gray-50
11
- psui-px-2
12
- psui-py-1
13
- psui-rounded-md
14
- psui-items-center
15
- "
2
+ <div
3
+ class="psui-el-chips"
4
+ :class="[getComponentClass, `layout-${layout}`, `type-${type}`]"
16
5
  >
17
6
  <input
18
7
  @change="onChange"
19
- v-if="type !== 'text'"
8
+ v-if="type != 'button'"
20
9
  :type="type"
21
- :id="title"
10
+ :id="label"
22
11
  :checked="checked"
23
12
  />
24
- <i v-if="icon" class="material-icons">{{ icon }}</i>
25
- {{ title }}
26
- <button @click="onClose" v-if="rich" class="psui-flex psui-items-center">
27
- <i class="material-icons">close</i>
28
- </button>
29
- </label>
13
+ <label
14
+ @click="onClick"
15
+ :for="label"
16
+ :class="getCssClass"
17
+ >
18
+ <i v-if="icon" class="psui-el-chips-icon psui-el-chips-icon-prepend">{{ icon }}</i>
19
+ {{ label }}
20
+ {{ layout }}
21
+ <button
22
+ @click="onClose"
23
+ v-if="layout === 'rich'"
24
+ class="psui-el-chips-close"
25
+ >
26
+ <span class="psui-el-chips-icon">close</span>
27
+ </button>
28
+ </label>
29
+ </div>
30
30
  </template>
31
31
 
32
32
  <script>
33
- export const type = ["text", "radio", "checkbox", "button"]
33
+ export const type = ["radio", "checkbox", "button"]
34
34
 
35
35
  export default {
36
36
  name: "PsChips",
37
37
  props: {
38
- title: {
38
+ label: {
39
39
  type: String,
40
40
  default: "",
41
41
  },
42
42
  type: {
43
43
  type: String,
44
44
  required: true,
45
- validator: (type) => ["text", "radio", "checkbox", "button"].includes(type)
45
+ default: 'button',
46
+ validator: (type) => ["radio", "checkbox", "button"].includes(type)
47
+ },
48
+ layout: {
49
+ type: String,
50
+ default: 'simple',
51
+ validator: (value) => ['simple', 'with-icon', 'rich'].includes(value)
46
52
  },
47
53
  icon: {
48
54
  type: String,
49
55
  default: "",
50
56
  },
51
- rich: {
57
+ checked: {
52
58
  type: Boolean,
53
- default: false,
59
+ default: false
54
60
  },
55
- checked: {
61
+ disabled: {
62
+ type: Boolean,
63
+ default: false
64
+ },
65
+ active: {
56
66
  type: Boolean,
57
67
  default: false
58
68
  },
@@ -64,6 +74,13 @@ export default {
64
74
  }
65
75
  },
66
76
  computed: {
77
+ getComponentClass() {
78
+ if (this.disabled) {
79
+ return 'status-disabled'
80
+ } else {
81
+ return 'status-resting'
82
+ }
83
+ },
67
84
  getCssClass() {
68
85
  let cssClass = ''
69
86
 
@@ -93,62 +110,4 @@ export default {
93
110
  }
94
111
  </script>
95
112
 
96
- <style scoped>
97
- input[type="radio"] {
98
- -webkit-appearance: none;
99
- -moz-appearance: none;
100
- appearance: none;
101
-
102
- display: inline-block;
103
- width: 16px;
104
- height: 16px;
105
- border-radius: 50%;
106
- border: 1px solid #d6dde5;
107
- cursor: pointer;
108
- }
109
-
110
- input[type="checkbox"] {
111
- -webkit-appearance: none;
112
- -moz-appearance: none;
113
- appearance: none;
114
-
115
- display: inline-block;
116
- width: 16px;
117
- height: 16px;
118
- border-radius: 25%;
119
- border: 1px solid #d6dde5;
120
- cursor: pointer;
121
- }
122
-
123
- input[type="radio"]:hover,
124
- input[type="checkbox"]:hover {
125
- border-color: #64b5ce;
126
- }
127
-
128
- input[type="radio"]:checked {
129
- border-color: #64b5ce;
130
- background: url("../../assets/images/radio-checked-button.svg") #ffffff
131
- no-repeat center;
132
- }
133
-
134
- input[type="checkbox"]:checked {
135
- border-color: #64b5ce;
136
- background: url("../../assets/images/check-checkbox-button.svg") #64b5ce
137
- no-repeat center;
138
- }
139
-
140
- label {
141
- width: fit-content;
142
- cursor: pointer;
143
- }
144
-
145
- label:hover {
146
- color: #64b5ce;
147
- background: #ffffff;
148
- }
149
-
150
- button {
151
- outline: none;
152
- }
153
- </style>
154
-
113
+ <style> /* Please, use the file src/assets/scss/components/PsChips.scss */</style>
@@ -1,134 +1,58 @@
1
- <template>
2
- <label
3
- class="container psui-pl-6"
4
- :class="[
5
- { 'psui-text-gray-40': disabled },
6
- { 'psui-text-gray-50': !disabled },
7
- labelClasses,
8
- ]"
9
- >
10
- {{ label }}
11
- <input
12
- type="checkbox"
13
- v-model="model"
14
- :disabled="disabled"
15
- :value="inputValue"
16
- />
17
- <span
18
- class="checkmark psui-border-2"
19
- :class="classes"
20
- :style="getSize"
21
- ></span>
22
- </label>
23
- </template>
24
-
25
- <script>
26
- export default {
27
- name: 'PsCheckbox',
28
- props: {
29
- value: {
30
- required: true,
31
- },
32
- inputValue: String,
33
- label: {
34
- type: String,
35
- default: '',
36
- },
37
- checkboxClasses: {
38
- type: String,
39
- default: '',
40
- },
41
- labelClasses: {
42
- type: String,
43
- default: '',
44
- },
45
- disabled: {
46
- type: Boolean,
47
- default: false,
48
- },
49
- size: {
50
- default: 18,
51
- },
52
- },
53
- computed: {
54
- model: {
55
- get() {
56
- return this.value
57
- },
58
- set(newValue) {
59
- this.$emit('input', newValue)
60
- this.$emit('change', newValue)
61
- },
62
- },
63
- classes() {
64
- return `${
65
- this.disabled ? 'psui-border-gray-40' : 'psui-border-gray-50'
66
- } ${this.checkboxClasses}`
67
- },
68
- getSize() {
69
- return {
70
- width: `${this.size}px`,
71
- height: `${this.size}px`,
72
- }
73
- },
74
- },
75
- }
76
- </script>
77
-
78
- <style scoped>
79
- .container {
80
- display: block;
81
- position: relative;
82
- cursor: pointer;
83
- -webkit-user-select: none;
84
- -moz-user-select: none;
85
- -ms-user-select: none;
86
- user-select: none;
87
- }
88
-
89
- .container input {
90
- position: absolute;
91
- opacity: 0;
92
- cursor: pointer;
93
- height: 0;
94
- width: 0;
95
- }
96
-
97
- .checkmark {
98
- position: absolute;
99
- top: 0;
100
- left: 0;
101
- height: 18px;
102
- width: 18px;
103
- background-color: #fff;
104
- border-radius: 2px;
105
- }
106
-
107
- .container input:checked ~ .checkmark {
108
- background-color: #64b5ce;
109
- border: none;
110
- }
111
-
112
- .checkmark:after {
113
- content: '';
114
- position: absolute;
115
- display: none;
116
- }
117
-
118
- .container input:checked ~ .checkmark:after {
119
- display: block;
120
- }
121
-
122
- .container .checkmark:after {
123
- left: 35%;
124
- top: 8%;
125
- width: 35%;
126
- height: 65%;
127
- border: solid white;
128
- border-radius: 1px;
129
- border-width: 0 2px 2px 0;
130
- -webkit-transform: rotate(45deg);
131
- -ms-transform: rotate(45deg);
132
- transform: rotate(45deg);
133
- }
134
- </style>
1
+ <template>
2
+ <div class='psui-el-checkbox' :class="[getComponentClass, {'disabled':disabled}]" >
3
+ <input
4
+ :id="label"
5
+ type="checkbox"
6
+ :value="label"
7
+ @change="onChange"
8
+ :checked="checked"
9
+ :disabled='disabled'
10
+ />
11
+ <label :for="label" class="psui-el-checkmark"><span>{{ label }}</span></label>
12
+ </div>
13
+ </template>
14
+
15
+ <script>
16
+ //FIGMA CONTROLS & SELECTORS https://www.figma.com/file/Tto8hrNlSfuPcwd1pfqogF/%E2%9A%A1%EF%B8%8F-Design-System?node-id=1768%3A64852
17
+
18
+ export default {
19
+ name: 'PsCheckbox',
20
+ props: {
21
+ label: {
22
+ type: String,
23
+ default: '',
24
+ },
25
+ disabled: {
26
+ type: Boolean,
27
+ default: false,
28
+ },
29
+ size: {
30
+ type: String,
31
+ default: 'big',
32
+ validator: (value)=> ['big', 'small'].includes(value)
33
+ },
34
+ checked:{
35
+ type: Boolean,
36
+ },
37
+ layout:{
38
+ type: String,
39
+ default: 'default',
40
+ validator: (value)=> ['default','mixed'].includes(value)
41
+ }
42
+ },
43
+ emits:['@update:checked', 'value'],
44
+ computed:{
45
+ getComponentClass(){
46
+ return `size-${this.size} layout-${this.layout}`
47
+ }
48
+ },
49
+ methods:{
50
+ onChange(event){
51
+ if(!this.disabled){
52
+ this.$emit('value', event.target.value)
53
+ this.$emit('update:checked', event.target.checked)
54
+ }
55
+ }
56
+ },
57
+ }
58
+ </script>
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <div class="psui-el-inline-selector">
3
+ <input type="text">
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+
10
+ }
11
+ </script>
12
+
13
+ <style>
14
+
15
+ </style>
@@ -1,110 +1,55 @@
1
1
  <template>
2
- <label class="wrapper flex items-center">
3
- {{ label }}
4
- <input
5
- class="checkbox"
6
- type="radio"
7
- :checked="isChecked"
8
- :value="value"
9
- @change="$emit('change', $event.target.value)"
2
+ <div class='psui-el-radio' :class="[getComponentClass, {'disabled':disabled}]" >
3
+ <input
4
+ :id="label"
5
+ type="radio"
6
+ :value="label"
7
+ @change="onChange"
8
+ :checked="checked"
9
+ :disabled='disabled'
10
10
  />
11
- <span class="checkmark" :class="{ 'checkmark-small': small }"></span>
12
- </label>
11
+ <label :for="label" class="psui-el-checkmark"><span>{{ label }}</span></label>
12
+ </div>
13
+
13
14
  </template>
14
15
 
15
16
  <script>
17
+ //FIGMA CONTROLS & SELECTORS https://www.figma.com/file/Tto8hrNlSfuPcwd1pfqogF/%E2%9A%A1%EF%B8%8F-Design-System?node-id=1768%3A64852
18
+
16
19
  export default {
17
20
  name: 'PsRadioButton',
18
21
  props: {
19
22
  label: {
20
23
  type: String,
21
24
  default: '',
22
- required: true,
23
25
  },
24
- modelValue: {
25
- default: '',
26
+ disabled: {
27
+ type: Boolean,
28
+ default: false
26
29
  },
27
- value: {
30
+ size: {
28
31
  type: String,
29
- default: undefined,
32
+ default: 'big',
33
+ validator: (value) => ['big', 'small'].includes(value)
30
34
  },
31
- small: {
35
+ checked:{
32
36
  type: Boolean,
33
- default: false,
34
- },
35
- },
36
- model: {
37
- prop: 'modelValue',
38
- event: 'change',
37
+ }
39
38
  },
39
+ emits:['@update:checked', 'value'],
40
40
  computed: {
41
- isChecked() {
42
- return this.modelValue == this.value
43
- },
41
+ getComponentClass(){
42
+ return `size-${this.size}`
43
+ }
44
44
  },
45
+ methods:{
46
+ onChange(event){
47
+ if(!this.disabled){
48
+ this.$emit('value', event.target.value)
49
+ this.$emit('update:checked', event.target.checked)
50
+ }
51
+ }
52
+ }
45
53
  }
46
54
  </script>
47
55
 
48
- <style scoped>
49
- .wrapper {
50
- display: block;
51
- position: relative;
52
- padding-left: 32px;
53
- cursor: pointer;
54
- -webkit-user-select: none;
55
- -moz-user-select: none;
56
- -ms-user-select: none;
57
- user-select: none;
58
- }
59
- .wrapper input {
60
- position: absolute;
61
- opacity: 0;
62
- cursor: pointer;
63
- height: 0;
64
- width: 0;
65
- }
66
- .checkmark {
67
- position: absolute;
68
- top: 0;
69
- left: 0;
70
- height: 24px;
71
- width: 24px;
72
- border-radius: 50%;
73
- background-color: white;
74
- border: 2px solid #a2acb7;
75
- }
76
- .checkmark-small {
77
- top: 3px;
78
- height: 18px !important;
79
- width: 18px !important;
80
- }
81
- .wrapper input:checked ~ .checkmark {
82
- background-color: white;
83
- border-color: #64b5ce;
84
- border-width: 2px;
85
- }
86
- .checkmark:after {
87
- content: '';
88
- position: absolute;
89
- display: none;
90
- }
91
- .wrapper input:checked ~ .checkmark:after {
92
- display: block;
93
- }
94
- .wrapper .checkmark:after {
95
- top: 4px;
96
- left: 4px;
97
- width: 12px;
98
- height: 12px;
99
- border-radius: 50%;
100
- background: #64b5ce;
101
- }
102
- .wrapper .checkmark-small:after {
103
- top: 3px;
104
- left: 3px;
105
- width: 8px;
106
- height: 8px;
107
- border-radius: 50%;
108
- background: #64b5ce;
109
- }
110
- </style>
@@ -1,10 +1,9 @@
1
1
  <template>
2
- <div>
3
- <div v-if="label" class="psui-mb-2">
4
- <div class="psui-float-right">{{ value }}</div>
5
- <div>{{ label }}</div>
2
+ <div class="psui-el-slider">
3
+ <div v-if="label" class="psui-el-slider-label">
4
+ <span>{{label}}</span>
6
5
  </div>
7
- <div class="" :class="{'psui-flex psui-items-center': !label && !bubble }">
6
+ <div :class="{'psui-flex psui-items-center': !label && !bubble }">
8
7
  <div
9
8
  v-if="bubble"
10
9
  class="psui-relative psui-bg-gray-40 psui-text-gray-20 psui-rounded-md psui-text-white psui-font-bold psui-w-10 psui-text-center range-value"