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

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 (84) hide show
  1. package/.eslintrc.js +36 -35
  2. package/.storybook/preview.js +7 -1
  3. package/README.md +6 -2
  4. package/babel.config.js +1 -1
  5. package/dist/css/psui_styles.css +1580 -185
  6. package/package.json +16 -5
  7. package/postcss.config.js +1 -1
  8. package/src/assets/scss/base.scss +3 -0
  9. package/src/assets/scss/components/PsAccordion.scss +28 -11
  10. package/src/assets/scss/components/PsButton.scss +39 -18
  11. package/src/assets/scss/components/PsCardInfos.scss +1 -1
  12. package/src/assets/scss/components/PsCheckbox.scss +4 -5
  13. package/src/assets/scss/components/PsChips.scss +13 -8
  14. package/src/assets/scss/components/PsClimateZoneBadge.scss +1 -1
  15. package/src/assets/scss/components/PsCostEffectBar.scss +22 -27
  16. package/src/assets/scss/components/PsDataTable.scss +17 -0
  17. package/src/assets/scss/components/PsDialog.scss +5 -2
  18. package/src/assets/scss/components/PsDotLoader.scss +45 -0
  19. package/src/assets/scss/components/PsDraggable.scss +64 -0
  20. package/src/assets/scss/components/PsDropdown.scss +9 -24
  21. package/src/assets/scss/components/PsDropdownList.scss +19 -0
  22. package/src/assets/scss/components/PsInlineSelector.scss +40 -25
  23. package/src/assets/scss/components/PsInput.scss +8 -3
  24. package/src/assets/scss/components/PsInputSelect.scss +6 -3
  25. package/src/assets/scss/components/PsInputTextArea.scss +5 -2
  26. package/src/assets/scss/components/PsMiniTag.scss +3 -3
  27. package/src/assets/scss/components/PsRadioButton.scss +5 -5
  28. package/src/assets/scss/components/PsSwitch.scss +4 -4
  29. package/src/assets/scss/components/PsTabHeader.scss +14 -0
  30. package/src/assets/scss/components/PsToast.scss +3 -3
  31. package/src/assets/scss/components/PsToggle.scss +6 -2
  32. package/src/assets/scss/components/PsTooltip.scss +50 -18
  33. package/src/components/accordion/PsAccordion.vue +7 -23
  34. package/src/components/accordion/PsAccordionItem.vue +42 -26
  35. package/src/components/badges-and-tags/PsCardInfos.vue +12 -0
  36. package/src/components/badges-and-tags/PsChartLegend.vue +13 -0
  37. package/src/components/badges-and-tags/PsClimateZoneBadge.vue +7 -0
  38. package/src/components/badges-and-tags/PsCostEffectBar.vue +6 -0
  39. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +3 -1
  40. package/src/components/badges-and-tags/PsMiniTag.vue +6 -0
  41. package/src/components/badges-and-tags/PsProgressBar.vue +17 -9
  42. package/src/components/buttons/PsButton.vue +27 -2
  43. package/src/components/chips/PsChips.vue +33 -13
  44. package/src/components/controls/PsCheckbox.vue +32 -16
  45. package/src/components/controls/PsDraggable.vue +39 -150
  46. package/src/components/controls/PsInlineSelector.vue +34 -16
  47. package/src/components/controls/PsRadioButton.vue +28 -15
  48. package/src/components/controls/PsSlider.vue +1 -1
  49. package/src/components/controls/PsSwitch.vue +20 -11
  50. package/src/components/controls/PsToggle.vue +33 -12
  51. package/src/components/datatable/PsDataTable.vue +21 -1
  52. package/src/components/datatable/PsDataTableItem.vue +1 -1
  53. package/src/components/forms/PsDropdown.vue +73 -101
  54. package/src/components/forms/PsDropdownList.vue +82 -0
  55. package/src/components/forms/PsInput.vue +28 -1
  56. package/src/components/forms/PsInputSelect.vue +21 -0
  57. package/src/components/forms/PsInputTextArea.vue +54 -41
  58. package/src/components/notifications/PsDialog.vue +15 -0
  59. package/src/components/notifications/PsToast.vue +12 -0
  60. package/src/components/playground/PsScrollBar.vue +54 -0
  61. package/src/components/tabs/PsTabHeader.vue +31 -5
  62. package/src/components/tooltip/PsDialogTooltip.vue +107 -24
  63. package/src/components/tooltip/PsRichTooltip.vue +12 -9
  64. package/src/components/tooltip/PsTooltip.vue +27 -11
  65. package/src/components/ui/PsDotLoader.vue +15 -0
  66. package/src/components/ui/PsIcon.vue +30 -0
  67. package/src/index.js +39 -7
  68. package/src/stories/Accordion.stories.js +12 -48
  69. package/src/stories/Button.stories.js +30 -7
  70. package/src/stories/Chips.stories.js +16 -4
  71. package/src/stories/Colors.stories.mdx +1 -0
  72. package/src/stories/Dropdown.stories.js +81 -14
  73. package/src/stories/InlineSelector.stories.js +1 -1
  74. package/src/stories/Playground.stories.js +16 -0
  75. package/src/stories/Switch.stories.js +8 -2
  76. package/src/stories/Toast.stories.js +16 -16
  77. package/src/stories/Tooltip.stories.js +6 -6
  78. package/src/stories/Typography.stories.mdx +22 -18
  79. package/src/util/GeneralFunctions.js +8 -0
  80. package/src/util/imageLoader.js +1 -1
  81. package/tailwind.config.js +8 -3
  82. package/vetur/attributes.json +1376 -0
  83. package/vetur/tags.json +632 -0
  84. package/src/components/forms/PsDropdownCopy.vue +0 -212
@@ -1,80 +1,74 @@
1
1
  <template>
2
- <div class="background-temporary">
3
- <div
4
- class="psui-el-dropdown-menu"
5
- ref="PSDropdown"
6
- >
7
-
8
- <div class="psui-bg-red" ref="PSDropdownTrigger" v-if="$slots.dropdownTrigger" @click="show && !toggleWhenActive ? '' : toggle()" >
9
- <slot name="dropdownTrigger" ></slot>
2
+ <div class="psui-el-dropdown-menu" ref="PSDropdown" v-click-outside="close">
3
+ <div
4
+ ref="PSDropdownTrigger"
5
+ v-if="$slots.dropdownTrigger"
6
+ @click="show && !toggleWhenActive ? '' : toggle()"
7
+ >
8
+ <slot name="dropdownTrigger"></slot>
10
9
  </div>
11
10
 
12
11
  <button
13
12
  v-else
14
- @click="show && !toggleWhenActive ? '' : toggle()"
15
- type="button"
16
- class="psui-el-dropdown-menu-button"
17
- :class="[buttonClasses]"
13
+ @click="show && !toggleWhenActive ? '' : toggle()"
14
+ type="button"
18
15
  :id="id"
19
- aria-haspopup="true"
16
+ aria-haspopup="true"
20
17
  aria-expanded="true"
21
18
  ref="PSDropdownTrigger"
22
19
  >
23
- <slot v-if="show && $slots.buttonLabelOnShow" name="buttonLabelOnShow"></slot>
20
+ <slot
21
+ v-if="show && $slots.buttonLabelOnShow"
22
+ name="buttonLabelOnShow"
23
+ ></slot>
24
24
  <slot v-else name="buttonLabel"></slot>
25
25
  </button>
26
-
27
- <div
26
+ <div
28
27
  ref="PSDropdownDialog"
29
- role="menu"
30
- class="psui-el-dropdown-menu-dialog"
31
- aria-orientation="vertical"
28
+ role="menu"
29
+ class="psui-el-dropdown-menu-dialog-wrapper psui-duration-300"
30
+ aria-orientation="vertical"
32
31
  :aria-labelledby="id"
33
- :class="[dialogClasses]"
34
- :style="{ minWidth: minWidthDropdown, marginLeft: marginLeft }"
32
+ :style="{ minWidth: minWidthDropDown }"
35
33
  >
36
-
37
- <div class="psui-el-dropdown-menu-dialog-category-divider">
38
- <h2 class="ts--accent--1" v-if="title">{{ title }}</h2>
34
+ <div class="psui-el-dropdown-menu-dialog">
39
35
  <slot name="items"></slot>
40
36
  </div>
41
-
42
37
  </div>
43
38
  </div>
44
- </div>
45
39
  </template>
46
40
 
47
41
  <script>
48
- import { randomString, getParentScrollableEl } from '../../util/GeneralFunctions'
42
+ // Figma - 2.3 Dropdown with category divider https://www.figma.com/file/Tto8hrNlSfuPcwd1pfqogF/%E2%9A%A1%EF%B8%8F-Design-System?node-id=1768%3A64886
43
+
44
+ import {
45
+ randomString,
46
+ getParentScrollableEl,
47
+ } from '../../util/GeneralFunctions'
49
48
 
50
49
  export default {
51
50
  name: 'PsDropdown',
52
51
  props: {
53
- buttonClasses: {
52
+ /**
53
+ * It sets a minimun width for the dropdown menu.
54
+ */
55
+ minWidthDropDown: {
54
56
  type: String,
55
- default: 'psui-bg-white psui-border psui-border-blue'
56
- },
57
- title: {
58
- type: String,
59
- },
60
- dialogClasses: {
61
- type: String,
62
- default: 'psui-p-6 psui-left-0 psui-bg-white'
63
- },
64
- minWidthDropdown: {
65
- type: [String, Number],
66
- },
67
- maxWidthDropDown: {
68
- type: String,
69
- default: '340px'
57
+ default: '240px',
70
58
  },
59
+ /**
60
+ * It's a boolean responsible for showing a slot within the html tag button.
61
+ */
71
62
  buttonLabelOnShow: {
72
63
  type: Boolean,
73
- default: false
64
+ default: false,
74
65
  },
66
+ /**
67
+ * It's a property responsible for toggling the dropdown menu. default: true.
68
+ */
75
69
  toggleWhenActive: {
76
70
  type: Boolean,
77
- default: true
71
+ default: true,
78
72
  },
79
73
  },
80
74
  data() {
@@ -82,14 +76,14 @@ export default {
82
76
  show: false,
83
77
  id: randomString(8),
84
78
  marginLeft: '-0px',
85
- scrollableParentEl : null
79
+ scrollableParentEl: null,
86
80
  }
87
81
  },
88
82
  computed: {
89
83
  getMaxWidth() {
90
84
  let bounds = this.$refs.PSDropdown.getBoundingClientRect()
91
- return (document.documentElement.clientWidth - bounds['left']) -30
92
- }
85
+ return document.documentElement.clientWidth - bounds['left'] - 30
86
+ },
93
87
  },
94
88
  beforeDestroy() {
95
89
  this.unwatchParentScrolling()
@@ -110,36 +104,41 @@ export default {
110
104
  },
111
105
  unwatchParentScrolling() {
112
106
  if (this.scrollableParentEl) {
113
- this.scrollableParentEl.removeEventListener('scroll', this.updatePosition)
107
+ this.scrollableParentEl.removeEventListener(
108
+ 'scroll',
109
+ this.updatePosition
110
+ )
114
111
  }
115
112
  },
116
113
  updatePosition() {
117
-
118
114
  const PSDropdownDialog = this.$refs.PSDropdownDialog
119
115
  const PSDropdownTrigger = this.$refs.PSDropdownTrigger
120
- if (!PSDropdownDialog || !PSDropdownTrigger) return
116
+ if (!PSDropdownDialog || !PSDropdownTrigger) return
121
117
 
122
118
  const rectTrigger = PSDropdownTrigger.getBoundingClientRect()
123
119
  const rectDialog = PSDropdownDialog.getBoundingClientRect()
124
120
  const windowWidth = document.documentElement.clientWidth
125
121
 
126
122
  PSDropdownDialog.style.position = 'fixed'
127
- PSDropdownDialog.style.top = `${rectTrigger.y + rectTrigger.height }px`
128
-
129
- if (( rectTrigger.x + rectDialog.width + 20 ) > windowWidth ) {
130
- PSDropdownDialog.style.left = `${windowWidth - rectDialog.width - 30}px`
131
- } else {
123
+ PSDropdownDialog.style.top = `${rectTrigger.y + rectTrigger.height}px`
124
+
125
+ if (rectTrigger.x + rectDialog.width + 20 > windowWidth) {
126
+ PSDropdownDialog.style.left = `${
127
+ windowWidth - rectDialog.width - 30
128
+ }px`
129
+ } else {
132
130
  PSDropdownDialog.style.left = `${rectTrigger.x}px`
133
131
  }
134
132
 
135
- if(rectTrigger.top < 10) {
133
+ if (rectTrigger.top < 10) {
136
134
  this.close()
137
135
  console.warn('The dropdown are too close from the top of the page')
138
136
  return
139
137
  }
140
138
 
141
- setTimeout(() => { PSDropdownDialog.style.opacity = 1 }, 10)
142
-
139
+ setTimeout(() => {
140
+ PSDropdownDialog.style.opacity = 1
141
+ }, 10)
143
142
  },
144
143
  open() {
145
144
  this.$emit('open')
@@ -149,9 +148,9 @@ export default {
149
148
  setTimeout(() => {
150
149
  this.updatePosition()
151
150
  this.watchParentScrolling()
152
- document.addEventListener("keyup", this.handleEsc)
153
- window.addEventListener("resize", this.updatePosition)
154
- window.addEventListener("click", this.clickOutside)
151
+ document.addEventListener('keyup', this.handleEsc)
152
+ window.addEventListener('resize', this.updatePosition)
153
+ window.addEventListener('click', this.clickOutside)
155
154
  }, 10)
156
155
  },
157
156
  close() {
@@ -162,51 +161,24 @@ export default {
162
161
  this.show = false
163
162
  this.unwatchParentScrolling()
164
163
  }
165
- document.removeEventListener("keyup", this.handleEsc)
166
- document.removeEventListener("resize", this.updatePosition)
167
- document.removeEventListener("click", this.clickOutside)
164
+ document.removeEventListener('keyup', this.handleEsc)
165
+ document.removeEventListener('resize', this.updatePosition)
166
+ document.removeEventListener('click', this.clickOutside)
168
167
  },
169
168
  handleEsc(evt) {
170
169
  if (this.show && evt.keyCode === 27) this.close()
171
170
  },
172
171
  clickOutside(event) {
173
- if(!this.show) return
174
- if (!(this.$refs.PSDropdown == event.target || this.$refs.PSDropdown.contains(event.target))) {
172
+ if (!this.show) return
173
+ if (
174
+ !(
175
+ this.$refs.PSDropdown == event.target ||
176
+ this.$refs.PSDropdown.contains(event.target)
177
+ )
178
+ ) {
175
179
  this.close()
176
180
  }
177
- }
178
- }
181
+ },
182
+ },
179
183
  }
180
184
  </script>
181
-
182
- <style>
183
-
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 {
198
- background-color: transparent;
199
- padding-top: 2.5px;
200
- padding-bottom: 2.5px;
201
- min-height: 27px;
202
- } */
203
-
204
- /* .dropdown-button:focus {
205
- outline: none;
206
- } */
207
-
208
- /* .psui-dropdown-dialog {
209
- transition: opacity 150ms ease-in-out;
210
- } */
211
-
212
- </style>
@@ -0,0 +1,82 @@
1
+ <template>
2
+ <ul class="psui-el-dropdown-menu-list">
3
+ <li
4
+ v-for="item in getItems"
5
+ :key="getKeyValue(item)"
6
+ @click="selectItem(item)"
7
+ >
8
+ <span>{{ getKeyLabel(item) }}</span>
9
+ </li>
10
+ </ul>
11
+ </template>
12
+
13
+ <script>
14
+ export default {
15
+ name: 'PsDropdownSimple',
16
+ props: {
17
+ /**
18
+ * It sets the text key which will retrieve a icon from Google Fonts. Make sure to get the correct description of your icon on https://fonts.google.com/.
19
+ */
20
+ icon:{
21
+ type: String,
22
+ },
23
+ /**
24
+ * It sets the items which will be displayed on the dropdown menu.
25
+ */
26
+ items: {
27
+ type: Array,
28
+ required: true
29
+ },
30
+ /**
31
+ * It sets the item selected on the dropdown menu.
32
+ */
33
+ selected: {},
34
+ /**
35
+ * It sets the key label of your items if needed.
36
+ */
37
+ keyLabel: {
38
+ type: [String, Function],
39
+ default: 'label'
40
+ },
41
+ /**
42
+ * It sets the key value of your items if needed.
43
+ */
44
+ keyValue: {
45
+ type: [String, Function],
46
+ default: 'value'
47
+ }
48
+ },
49
+ computed: {
50
+ getSelected() {
51
+ if (this.selected) {
52
+ if (typeof this.selected === 'object' && this.selected[this.keyValue] ) {
53
+ return this.selected[this.keyValue]
54
+ } else {
55
+ return this.selected
56
+ }
57
+ } else {
58
+ return false
59
+ }
60
+ },
61
+ getItems() {
62
+ return this.items
63
+ },
64
+ },
65
+ methods: {
66
+ selectItem(item) {
67
+ this.$emit('update:selected', this.getKeyValue(item) )
68
+ this.$emit('change', item )
69
+ },
70
+ getKeyLabel(item) {
71
+ if(typeof this.keyLabel == 'function') return this.keyLabel(item)
72
+ if(typeof item === 'string') return item
73
+ return item[this.keyLabel]
74
+ },
75
+ getKeyValue(item) {
76
+ if(typeof this.keyValue == 'function') return this.keyValue(item)
77
+ if(typeof item === 'string') return item
78
+ return item[this.keyValue]
79
+ },
80
+ }
81
+ }
82
+ </script>
@@ -46,35 +46,62 @@
46
46
  export default {
47
47
  name: 'PsInput',
48
48
  props: {
49
+ /**
50
+ * It sets the type of your button. default: text.
51
+ */
49
52
  type: {
50
53
  type: String,
51
54
  default: 'text'
52
55
  },
56
+ /**
57
+ * It sets a placeholder for your button if needed.
58
+ */
53
59
  placeholder: {
54
60
  type: String
55
61
  },
62
+ /**
63
+ * It sets the label of the input if needed.
64
+ */
56
65
  label: {
57
66
  type: String
58
67
  },
68
+ /**
69
+ * It sets a text below the input. See Figma Text fileds & Forms.
70
+ */
59
71
  hint: {
60
72
  type: String
61
- },
73
+ },
74
+ /**
75
+ * It sets the layout of your button. eg: mini and default.
76
+ */
62
77
  layout: {
63
78
  type: String,
64
79
  default: 'default',
65
80
  validator: (value) => ['default', 'mini'].includes(value)
66
81
  },
82
+ /**
83
+ * It sets the value of the button.
84
+ */
67
85
  value: {
68
86
  required: true,
69
87
  },
88
+ /**
89
+ * It disables the input. All mouse events are disabled.
90
+ */
70
91
  disabled: {
71
92
  type: Boolean,
72
93
  default: false
73
94
  },
95
+ /**
96
+ * It sets if the input found any error.
97
+ */
74
98
  hasError: {
75
99
  type: [String, Boolean],
76
100
  default: false
77
101
  },
102
+ /**
103
+ * It sets a active css class based on a boolean property.
104
+ */
78
105
  active: {
79
106
  type: Boolean,
80
107
  default: false
@@ -18,6 +18,9 @@
18
18
  export default {
19
19
  name: 'PsSelectInput',
20
20
  props: {
21
+ /**
22
+ * It sets the items which will be rendered within the select input.
23
+ */
21
24
  items: {
22
25
  required: true
23
26
  },
@@ -25,22 +28,40 @@ export default {
25
28
  default: '',
26
29
  required: true
27
30
  },
31
+ /**
32
+ * It sets the value label of the select input if needed.
33
+ */
28
34
  label: {
29
35
  default: ''
30
36
  },
37
+ /**
38
+ * It sets a o optional label below the select input.
39
+ */
31
40
  optionalLabel:{
32
41
  default:''
33
42
  },
43
+ /**
44
+ * It sets the key label of your items if needed.
45
+ */
34
46
  keyLabel: {
35
47
  default: 'label'
36
48
  },
49
+ /**
50
+ * It sets the key value of yout items if needed.
51
+ */
37
52
  keyValue: {
38
53
  default: 'value'
39
54
  },
55
+ /**
56
+ * It disables the select input. All mouse events are disabled.
57
+ */
40
58
  disabled: {
41
59
  type: Boolean,
42
60
  default: false
43
61
  },
62
+ /**
63
+ * It sets the layout of the select input. eg: default and mini.
64
+ */
44
65
  layout:{
45
66
  type: String,
46
67
  default: 'default',
@@ -21,50 +21,63 @@
21
21
 
22
22
  <script>
23
23
  export default {
24
- name: "PsInputTextArea",
24
+ name: 'PsInputTextArea',
25
25
  props: {
26
- placeholder: {
27
- type: String,
28
- default: ''
29
- },
30
- value: {
31
- required: true,
32
- },
33
- label: {
34
- type: String,
35
- },
36
- optionalLabel:{
37
- type: String,
38
- },
39
- action: {
40
- type: Function,
41
- required: false
42
- },
43
- required:{
44
- type: Boolean,
45
- default:true
46
- },
47
- autocapitalize: {
48
- type: String,
49
- default: 'sentences'
50
- },
51
- autocomplete: {
52
- type: Boolean,
53
- default: true
54
- },
55
- rows: {
56
- type: Number,
57
- default: 5
58
- },
59
- disabled: {
60
- type: Boolean,
61
- default: false,
62
- }
26
+ /**
27
+ * It sets the placeholder of the textarea input.
28
+ */
29
+ placeholder: {
30
+ type: String,
31
+ default: ''
63
32
  },
64
- methods: {
65
- makeAction() {
66
- if(this.action && typeof(this.action) == 'function') this.action()
33
+ /**
34
+ * It sets the value selected of the textarea input.
35
+ */
36
+ value: {
37
+ required: true,
38
+ },
39
+ /**
40
+ * It sets the label of the textarea input.
41
+ */
42
+ label: {
43
+ type: String,
44
+ },
45
+ /**
46
+ * It sets a optional label if needed.
47
+ */
48
+ optionalLabel:{
49
+ type: String,
50
+ },
51
+ /**
52
+ * It sets aria-required property. eg: true or false.
53
+ */
54
+ required:{
55
+ type: Boolean,
56
+ default:true
57
+ },
58
+ /**
59
+ * It sets the type of autocapitalize. See mdn web-doc for full information. default: sentences.
60
+ */
61
+ autocapitalize: {
62
+ type: String,
63
+ default: 'sentences'
67
64
  },
65
+ /**
66
+ * It sets the size of the textarea input.
67
+ */
68
+ rows: {
69
+ type: Number,
70
+ default: 5
71
+ },
72
+ /**
73
+ * It disabled the textarea input. All mouse events are disabled.
74
+ */
75
+ disabled: {
76
+ type: Boolean,
77
+ default: false,
78
+ }
79
+ },
80
+ methods: {
68
81
  onBlur(){
69
82
  this.$emit('blur', this.$event)
70
83
  },
@@ -27,23 +27,38 @@
27
27
  export default {
28
28
  name: 'PsDialog',
29
29
  props: {
30
+ /**
31
+ * It sets the theme of the dialog. eg: informative, success and alert.
32
+ */
30
33
  theme: {
31
34
  type: String,
32
35
  default: 'informative',
33
36
  validator: (value) => ['informative', 'success', 'alert'].includes(value)
34
37
  },
38
+ /**
39
+ * It set the which will be displayed when component is rendered.
40
+ */
35
41
  message: {
36
42
  type: String,
37
43
  },
44
+ /**
45
+ * It sets the direction of the items within the dialog. See Figma Notifications for full information.
46
+ */
38
47
  layout:{
39
48
  type: String,
40
49
  default: 'horizontal',
41
50
  validator: (value) => ['horizontal', 'vertical'].includes(value)
42
51
  },
52
+ /**
53
+ * It sets a close button if needed.
54
+ */
43
55
  hasClose: {
44
56
  type: Boolean,
45
57
  default: true
46
58
  },
59
+ /**
60
+ * It sets the text key to get the svg icon in Google Fonts. Make sure to get the correct description of your icon on https://fonts.google.com/.
61
+ */
47
62
  icon: {
48
63
  type: String,
49
64
  default: 'info'
@@ -12,19 +12,31 @@
12
12
  export default {
13
13
  name: 'PsToast',
14
14
  props: {
15
+ /**
16
+ * It sets the layout of the toast. eg: info, success, warning and error.
17
+ */
15
18
  layout: {
16
19
  type: String,
17
20
  default: 'info',
18
21
  validator: (value) => ['info', 'success', 'warning', 'error'].includes(value)
19
22
  },
23
+ /**
24
+ * It sets a supportive layout. eg: soft and intese. See Figma - Notification for full information.
25
+ */
20
26
  fill: {
21
27
  type: String,
22
28
  default: 'intense',
23
29
  validator: (value) => ['soft', 'intense'].includes(value)
24
30
  },
31
+ /**
32
+ * It sets the message which will be displayed when component is rendered.
33
+ */
25
34
  message: {
26
35
  type: String,
27
36
  },
37
+ /**
38
+ * It sets the text key to get the svg icon in Google Fonts. Make sure to get the correct description of your icon on https://fonts.google.com/.
39
+ */
28
40
  icon:{
29
41
  type: String,
30
42
  }
@@ -0,0 +1,54 @@
1
+ <template>
2
+ <div
3
+ class="psui-flex psui-flex-col psui-h-56 psui-w-2/6 psui-overflow-y-scroll"
4
+ :style="getComponentClass"
5
+ >
6
+ <h2 class="psui-font-bold ">Scrollbar Playground</h2>
7
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
8
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
9
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
10
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
11
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
12
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
13
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
14
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
15
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
16
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
17
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
18
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
19
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
20
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
21
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
22
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
23
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
24
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
25
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
26
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
27
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
28
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
29
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
30
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
31
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorem, id.</p>
32
+ </div>
33
+ </template>
34
+
35
+ <script>
36
+ export default {
37
+ name: 'PsScrollBar',
38
+ props:{
39
+ thumbColor:{
40
+ type: String,
41
+ }
42
+ },
43
+ computed:{
44
+ getComponentClass(){
45
+ return `scrollbarColor: ${this.thumbColor}`
46
+ }
47
+ }
48
+ }
49
+
50
+ </script>
51
+
52
+ <style>
53
+
54
+ </style>