@policystudio/policy-studio-ui-vue 1.0.25 → 1.0.29

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 (71) hide show
  1. package/dist/css/psui_styles.css +5030 -573
  2. package/package.json +1 -1
  3. package/src/assets/scss/base.scss +39 -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/PsDialog.scss +10 -1
  13. package/src/assets/scss/components/PsDropdown.scss +44 -0
  14. package/src/assets/scss/components/PsHighlightRippleDot.scss +48 -0
  15. package/src/assets/scss/components/PsInlineSelector.scss +81 -0
  16. package/src/assets/scss/components/PsInputSelect.scss +104 -0
  17. package/src/assets/scss/components/PsInputTextArea.scss +49 -0
  18. package/src/assets/scss/components/PsMiniTag.scss +36 -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 +10 -3
  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/badges-and-tags/PsCardInfos.vue +14 -7
  28. package/src/components/badges-and-tags/PsChartLegend.vue +7 -13
  29. package/src/components/badges-and-tags/PsClimateZoneBadge.vue +15 -6
  30. package/src/components/badges-and-tags/PsCostEffectBar.vue +32 -70
  31. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +3 -69
  32. package/src/components/badges-and-tags/PsMiniTag.vue +15 -24
  33. package/src/components/badges-and-tags/PsProgressBar.vue +42 -0
  34. package/src/components/buttons/PsButton.vue +74 -78
  35. package/src/components/chips/PsChips.vue +46 -87
  36. package/src/components/controls/PsCheckbox.vue +58 -134
  37. package/src/components/controls/PsInlineSelector.vue +135 -0
  38. package/src/components/controls/PsRadioButton.vue +33 -88
  39. package/src/components/controls/PsSlider.vue +4 -5
  40. package/src/components/controls/PsSwitch.vue +29 -81
  41. package/src/components/controls/PsToggle.vue +45 -39
  42. package/src/components/datatable/PsDataTable.vue +3 -15
  43. package/src/components/forms/PsDropdown.vue +27 -11
  44. package/src/components/forms/PsDropdownCopy.vue +212 -0
  45. package/src/components/forms/PsInputSelect.vue +88 -0
  46. package/src/components/forms/PsInputTextArea.vue +80 -0
  47. package/src/components/notifications/PsDialog.vue +3 -0
  48. package/src/components/notifications/PsToast.vue +16 -28
  49. package/src/components/tabs/PsTabHeader.vue +30 -12
  50. package/src/components/tooltip/PsDialogTooltip.vue +6 -31
  51. package/src/components/tooltip/PsRichTooltip.vue +37 -44
  52. package/src/components/tooltip/PsTooltip.vue +18 -28
  53. package/src/components/ui/PsIcon.vue +9 -9
  54. package/src/index.js +9 -0
  55. package/src/stories/Button.stories.js +102 -112
  56. package/src/stories/Checkbox.stories.js +34 -37
  57. package/src/stories/Chips.stories.js +43 -54
  58. package/src/stories/ClimateZoneBadge.stories.js +0 -7
  59. package/src/stories/Dialog.stories.js +1 -1
  60. package/src/stories/InlineSelector.stories.js +18 -0
  61. package/src/stories/InputSelect.stories.js +30 -0
  62. package/src/stories/InputTextArea.stories.js +25 -0
  63. package/src/stories/MiniTag.stories.js +12 -6
  64. package/src/stories/RadioButton.stories.js +32 -29
  65. package/src/stories/Switch.stories.js +33 -0
  66. package/src/stories/Toast.stories.js +40 -46
  67. package/src/stories/Tooltip.stories.js +86 -86
  68. package/tailwind.config.js +7 -1
  69. package/src/assets/images/check-checkbox-button.svg +0 -1
  70. package/src/assets/images/radio-checked-button.svg +0 -1
  71. package/src/stories/Swith.stories.js +0 -38
@@ -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"
@@ -1,97 +1,45 @@
1
1
  <template>
2
- <div class="switch-button-control">
3
- <div
4
- :class="{ enabled: active, 'switch-button': !small, 'switch-button-small': small }"
5
- @click="toggle"
6
- :style="{'--color': color}"
7
- >
8
- <div class="button"></div>
9
- </div>
10
- <div class="switch-button-label">
11
- <slot></slot>
12
- </div>
2
+ <div class='psui-el-switch' :class="getComponentClass">
3
+ <input type="checkbox" :id='label' @change="onChange">
4
+ <transition>
5
+ <label :for="label" class='psui-el-switch-button' :class="getToggleClass" />
6
+ </transition>
13
7
  </div>
14
8
  </template>
15
9
 
16
10
  <script>
11
+ //FIGMA CONTROLS & SELECTORS https://www.figma.com/file/Tto8hrNlSfuPcwd1pfqogF/%E2%9A%A1%EF%B8%8F-Design-System?node-id=1768%3A64852
12
+
17
13
  export default {
18
14
  name: 'PsSwitch',
19
15
  props: {
20
- small: Boolean,
21
- active: Boolean,
22
- color: {
16
+ label:{
17
+ type: String,
18
+ },
19
+ value:{
20
+ type: Boolean,
21
+ required: true,
22
+ },
23
+ size:{
23
24
  type: String,
24
- required: false,
25
- default: '#5DB883'
25
+ default: 'big',
26
+ validator: (value)=> ['small', 'big'].includes(value)
26
27
  }
27
28
  },
28
- model: {
29
- prop: "active",
30
- event: "toggle"
29
+ computed:{
30
+ getToggleClass(){
31
+ return `toggle-${this.value.toString()}`
32
+ },
33
+ getComponentClass(){
34
+ return `size-${this.size}`
35
+ }
31
36
  },
32
- methods: {
33
- toggle: function() {
34
- this.$emit('toggle', !this.active)
37
+ methods:{
38
+ onChange(event){
39
+ this.value = event.target.checked
40
+ this.$emit('update:value', event.target.value)
35
41
  }
36
42
  }
37
- }
43
+ }
38
44
  </script>
39
45
 
40
- <style scoped>
41
- .switch-button-control {
42
- display: flex;
43
- flex-direction: row;
44
- align-items: center;
45
- }
46
- .switch-button-control .switch-button {
47
- height: 24px;
48
- width: calc(24px * 2);
49
- background-color: #A2ACB7;
50
- border: 2px solid #A2ACB7;
51
- border-radius: 24px;
52
- transition: all 0.3s ease-in-out;
53
- cursor: pointer;
54
- }
55
- .switch-button-control .switch-button-small {
56
- height: 16px;
57
- width: calc(16px * 2);
58
- background-color: #A2ACB7;
59
- border: 2px solid #A2ACB7;
60
- border-radius: 16px;
61
- transition: all 0.3s ease-in-out;
62
- cursor: pointer;
63
- }
64
- .switch-button-control .switch-button .button {
65
- height: calc(24px - (2 * 2px));
66
- width: calc(24px - (2 * 2px));
67
- border-radius: calc(24px - (2 * 2px));
68
- background:#F3F6F9;
69
- transition: all 0.3s ease-in-out;
70
- }
71
- .switch-button-control .switch-button-small .button {
72
- height: calc(16px - (2 * 2px));
73
- width: calc(16px - (2 * 2px));
74
- border-radius: calc(16px - (2 * 2px));
75
- background:#F3F6F9;
76
- transition: all 0.3s ease-in-out;
77
- }
78
- .switch-button-control .switch-button.enabled {
79
- background-color: var(--color);
80
- border: 2px solid var(--color);
81
- }
82
- .switch-button-control .switch-button-small.enabled {
83
- background-color: var(--color);
84
- border: 2px solid var(--color);
85
- }
86
- .switch-button-control .switch-button.enabled .button {
87
- background: white;
88
- transform: translateX(calc(calc(24px - (2 * 2px)) + (2 *2px)));
89
- }
90
- .switch-button-control .switch-button-small.enabled .button {
91
- background: white;
92
- transform: translateX(calc(calc(16px - (2 * 2px)) + (2 *2px)));
93
- }
94
- .switch-button-control .switch-button-label {
95
- margin-left: 10px;
96
- }
97
- </style>
@@ -1,39 +1,45 @@
1
- <template>
2
- <div class="psui-rounded-sm psui-inline-flex psui-bg-gray-10 wrapper psui-gap-x-px" role="group">
3
- <button
4
- v-for="(item, index) in items"
5
- :key="index"
6
- @click="selectOption(item)"
7
- type="button"
8
- class="psui-inline-flex psui-rounded-sm psui-text-small psui-text-blue-60 psui-px-2"
9
- :class="{'psui-bg-blue-60 psui-text-white psui-font-bold': selected === item}"
10
- >
11
- {{ item }}
12
- </button>
13
- </div>
14
- </template>
15
-
16
- <script>
17
- export default {
18
- name: 'PsSlider',
19
- props: {
20
- items: {
21
- type: Array,
22
- required: true
23
- },
24
- selected: {},
25
- },
26
- methods: {
27
- selectOption(item) {
28
- this.$emit('update:selected', item)
29
- this.$emit('change', item)
30
- }
31
- }
32
- }
33
- </script>
34
-
35
- <style scoped>
36
- .wrapper {
37
- padding: 2px;
38
- }
39
- </style>
1
+ <template>
2
+ <div class="psui-el-toggle" role="group">
3
+ <button
4
+ type="button"
5
+ v-for="(item, index) in items"
6
+ :key="index"
7
+ @click="selectOption(item)"
8
+ :class="{ 'status-active': getSelected === item }"
9
+ >
10
+ {{ item }}
11
+ </button>
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: 'PsToggle',
20
+ props: {
21
+ items: {
22
+ type: Array,
23
+ required: true
24
+ },
25
+ selected: {},
26
+ },
27
+ computed: {
28
+ getSelected() {
29
+ if (this.selected) {
30
+ return this.selected
31
+ } else {
32
+ return false
33
+ }
34
+ },
35
+ },
36
+ methods: {
37
+ selectOption(item) {
38
+ this.$emit('update:selected', item)
39
+ this.$emit('change', item)
40
+ }
41
+ }
42
+ }
43
+ </script>
44
+
45
+ <style> /* Please, use the file src/assets/scss/components/PsToggle.scss */</style>
@@ -1,10 +1,9 @@
1
1
  <template>
2
- <table :class='cssAlign' class='table psui-w-full psui-border-2 psui-border-gray-10' >
2
+ <table :class='cssAlign' class="psui-el-table psui-table">
3
3
  <thead v-if="header">
4
4
  <th
5
5
  v-for="head in header"
6
6
  :key="head"
7
- class='psui-bg-gray-10 psui-text-gray-80 psui-capitalize psui-font-bold'
8
7
  >
9
8
  {{ head }}
10
9
  </th>
@@ -21,7 +20,7 @@
21
20
  <th
22
21
  v-for="ft in footer"
23
22
  :key="ft"
24
- class='psui-bg-gray-10 psui-text-gray-80'
23
+ class='psui-bg-gray-10 psui-text-gray-80 psui-font-normal'
25
24
  >
26
25
  {{ ft }}
27
26
  </th>
@@ -75,15 +74,4 @@ export default {
75
74
  },
76
75
  }
77
76
  </script>
78
-
79
- <style scoped>
80
-
81
- .table th,
82
- .table td,
83
- .table tr {
84
- height: 40px;
85
- border: 1px solid #e6ecf2;
86
- padding: 11px 16px;
87
- }
88
-
89
- </style>
77
+ <style> /* Please, use the file src/assets/scss/components/PsDataTable.scss */</style>
@@ -1,6 +1,7 @@
1
1
  <template>
2
+ <div class="background-temporary">
2
3
  <div
3
- class="psui-relative psui-inline-block psui-text-left"
4
+ class="psui-el-dropdown-menu"
4
5
  ref="PSDropdown"
5
6
  >
6
7
 
@@ -12,7 +13,7 @@
12
13
  v-else
13
14
  @click="show && !toggleWhenActive ? '' : toggle()"
14
15
  type="button"
15
- class="psui-inline-flex psui-justify-center psui-items-center psui-w-full psui-font-medium psui-focus:shadow-outline-blue psui-dropdown-button psui-text-sm psui-leading-none"
16
+ class="psui-el-dropdown-menu-button"
16
17
  :class="[buttonClasses]"
17
18
  :id="id"
18
19
  aria-haspopup="true"
@@ -26,19 +27,21 @@
26
27
  <div
27
28
  ref="PSDropdownDialog"
28
29
  role="menu"
29
- class="psui-dropdown-dialog psui-hidden psui-origin-top-right psui-fixed psui-mt-2 psui-w-auto psui-rounded psui-shadow-lg psui-border psui-border-blue05 psui-z-50 psui-opacity-0"
30
+ class="psui-el-dropdown-menu-dialog"
30
31
  aria-orientation="vertical"
31
32
  :aria-labelledby="id"
32
33
  :class="[dialogClasses]"
33
34
  :style="{ minWidth: minWidthDropdown, marginLeft: marginLeft }"
34
35
  >
35
- <div class="w-full">
36
- <h2 class="psui-text-gray02 psui-font-bold psui-whitespace-no-wrap psui-mb-4 ts--accent--1" v-if="title">{{ title }}</h2>
36
+
37
+ <div class="psui-el-dropdown-menu-dialog-category-divider">
38
+ <h2 class="ts--accent--1" v-if="title">{{ title }}</h2>
37
39
  <slot name="items"></slot>
38
40
  </div>
39
41
 
40
42
  </div>
41
43
  </div>
44
+ </div>
42
45
  </template>
43
46
 
44
47
  <script>
@@ -178,19 +181,32 @@ export default {
178
181
 
179
182
  <style>
180
183
 
181
- .dropdown-button {
184
+ .background-temporary {
185
+ width: 300px;
186
+ height: 200px;
187
+ left: 0;
188
+ top: 8px;
189
+
190
+ background-color: #e6ecf2;
191
+ border: 1.5px dashed #7b61ff;
192
+ display: flex;
193
+ align-items: center;
194
+ justify-content: center;
195
+ }
196
+
197
+ /* .dropdown-button {
182
198
  background-color: transparent;
183
199
  padding-top: 2.5px;
184
200
  padding-bottom: 2.5px;
185
201
  min-height: 27px;
186
- }
202
+ } */
187
203
 
188
- .dropdown-button:focus {
204
+ /* .dropdown-button:focus {
189
205
  outline: none;
190
- }
206
+ } */
191
207
 
192
- .psui-dropdown-dialog {
208
+ /* .psui-dropdown-dialog {
193
209
  transition: opacity 150ms ease-in-out;
194
- }
210
+ } */
195
211
 
196
212
  </style>