@policystudio/policy-studio-ui-vue 1.1.89 → 1.1.90-access.1

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 (171) hide show
  1. package/.eslintignore +1 -0
  2. package/.eslintrc.js +75 -67
  3. package/.github/workflows/deploy-storybook.yml +5 -5
  4. package/.nvmrc +1 -0
  5. package/dist/css/psui_styles_output.css +6638 -0
  6. package/dist/index.d.ts +51 -0
  7. package/dist/index.js +106 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/util/GeneralFunctions.d.ts +3 -0
  10. package/dist/util/GeneralFunctions.js +35 -0
  11. package/dist/util/GeneralFunctions.js.map +1 -0
  12. package/dist/util/directives.d.ts +1 -0
  13. package/dist/util/directives.js +22 -0
  14. package/dist/util/directives.js.map +1 -0
  15. package/dist/util/imageLoader.d.ts +6 -0
  16. package/dist/util/imageLoader.js +52 -0
  17. package/dist/util/imageLoader.js.map +1 -0
  18. package/doc/.nvmrc +1 -0
  19. package/doc/.storybook/PolicyStudio.ts +11 -0
  20. package/doc/.storybook/main.ts +27 -0
  21. package/doc/.storybook/manager.ts +7 -0
  22. package/{.storybook/preview.js → doc/.storybook/preview.ts} +2 -3
  23. package/doc/package-lock.json +22653 -0
  24. package/doc/package.json +71 -0
  25. package/doc/shims-vue.d.ts +6 -0
  26. package/{src/stories/Accordion.stories.js → doc/src/stories/Accordion.stories.ts} +4 -5
  27. package/{src/stories/BadgeWithIcon.stories.js → doc/src/stories/BadgeWithIcon.stories.ts} +2 -2
  28. package/{src/stories/BarChart.stories.js → doc/src/stories/BarChart.stories.ts} +2 -2
  29. package/{src/stories/Breadcrumb.stories.js → doc/src/stories/Breadcrumb.stories.ts} +2 -5
  30. package/{src/stories/Button.stories.js → doc/src/stories/Button.stories.ts} +130 -130
  31. package/{src/stories/CardInfos.stories.js → doc/src/stories/CardInfos.stories.ts} +2 -3
  32. package/{src/stories/ChartLegend.stories.js → doc/src/stories/ChartLegend.stories.ts} +2 -3
  33. package/{src/stories/Checkbox.stories.js → doc/src/stories/Checkbox.stories.ts} +2 -2
  34. package/{src/stories/CheckboxSimple.stories.js → doc/src/stories/CheckboxSimple.stories.ts} +2 -2
  35. package/{src/stories/Chips.stories.js → doc/src/stories/Chips.stories.ts} +22 -23
  36. package/{src/stories/ClimateZoneBadge.stories.js → doc/src/stories/ClimateZoneBadge.stories.ts} +3 -2
  37. package/doc/src/stories/Collapse.stories.ts +46 -0
  38. package/{src/stories/CostEffectBar.stories.js → doc/src/stories/CostEffectBar.stories.ts} +3 -2
  39. package/{src/stories/Datatable.stories.js → doc/src/stories/Datatable.stories.ts} +7 -4
  40. package/{src/stories/DateCardInfo.stories.js → doc/src/stories/DateCardInfo.stories.ts} +2 -6
  41. package/{src/stories/Dialog.stories.js → doc/src/stories/Dialog.stories.ts} +2 -2
  42. package/{src/stories/Draggable.stories.js → doc/src/stories/Draggable.stories.ts} +3 -2
  43. package/{src/stories/Dropdown.stories.js → doc/src/stories/Dropdown.stories.ts} +4 -3
  44. package/{src/stories/DropdownList.stories.js → doc/src/stories/DropdownList.stories.ts} +4 -2
  45. package/{src/stories/ElevationSystem.stories.mdx → doc/src/stories/ElevationSystem.mdx} +1 -1
  46. package/{src/stories/HighlightRippleDot.stories.js → doc/src/stories/HighlightRippleDot.stories.ts} +3 -2
  47. package/{src/stories/Icon.stories.js → doc/src/stories/Icon.stories.ts} +3 -1
  48. package/{src/stories/InlineSelector.stories.js → doc/src/stories/InlineSelector.stories.ts} +2 -2
  49. package/{src/stories/Input.stories.js → doc/src/stories/Input.stories.ts} +7 -4
  50. package/{src/stories/InputSelect.stories.js → doc/src/stories/InputSelect.stories.ts} +3 -2
  51. package/{src/stories/InputTextArea.stories.js → doc/src/stories/InputTextArea.stories.ts} +2 -2
  52. package/{src/stories/Introduction.stories.mdx → doc/src/stories/Introduction.mdx} +101 -101
  53. package/{src/stories/MiniTag.stories.js → doc/src/stories/MiniTag.stories.ts} +9 -2
  54. package/{src/stories/ProgressBar.stories.js → doc/src/stories/ProgressBar.stories.ts} +3 -2
  55. package/{src/stories/RadioButton.stories.js → doc/src/stories/RadioButton.stories.ts} +2 -2
  56. package/{src/stories/RadioButtonSimple.stories.js → doc/src/stories/RadioButtonSimple.stories.ts} +2 -2
  57. package/{src/stories/SimpleAlert.stories.js → doc/src/stories/SimpleAlert.stories.ts} +3 -2
  58. package/{src/stories/Slider.stories.js → doc/src/stories/Slider.stories.ts} +6 -2
  59. package/{src/stories/Switch.stories.js → doc/src/stories/Switch.stories.ts} +2 -2
  60. package/{src/stories/TabHeader.stories.js → doc/src/stories/TabHeader.stories.ts} +6 -1
  61. package/{src/stories/TableResults.stories.js → doc/src/stories/TableResults.stories.ts} +11 -7
  62. package/{src/stories/TagScope.stories.js → doc/src/stories/TagScope.stories.ts} +3 -2
  63. package/{src/stories/TestimonialCard.stories.js → doc/src/stories/TestimonialCard.stories.ts} +3 -3
  64. package/{src/stories/Toast.stories.js → doc/src/stories/Toast.stories.ts} +2 -2
  65. package/{src/stories/Toggle.stories.js → doc/src/stories/Toggle.stories.ts} +7 -4
  66. package/{src/stories/Tooltip.stories.js → doc/src/stories/Tooltip.stories.ts} +6 -6
  67. package/{src/stories/Typography.stories.mdx → doc/src/stories/Typography.mdx} +107 -105
  68. package/doc/tsconfig.json +17 -0
  69. package/package.json +43 -39
  70. package/scripts/gulp.js +11 -0
  71. package/scripts/kill-port.sh +12 -0
  72. package/src/App.vue +30 -0
  73. package/src/assets/scss/base.scss +3 -30
  74. package/src/assets/scss/components/PsAccordion.scss +12 -2
  75. package/src/assets/scss/components/PsButton.scss +7 -1
  76. package/src/assets/scss/components/PsChips.scss +12 -7
  77. package/src/assets/scss/components/PsCollapse.scss +71 -0
  78. package/src/assets/scss/components/PsCostEffectBar.scss +4 -4
  79. package/src/assets/scss/components/PsDataTable.scss +1 -1
  80. package/src/assets/scss/components/PsDateCardInfo.scss +4 -5
  81. package/src/assets/scss/components/PsDialog.scss +7 -0
  82. package/src/assets/scss/components/PsDropdownList.scss +1 -1
  83. package/src/assets/scss/components/PsInput.scss +10 -0
  84. package/src/assets/scss/components/PsProgressBar.scss +4 -4
  85. package/src/assets/scss/components/PsSwitch.scss +10 -0
  86. package/src/assets/scss/components/PsTabHeader.scss +64 -2
  87. package/src/assets/scss/components/PsTableResults.scss +51 -82
  88. package/src/assets/scss/components/PsTestimonialCard.scss +1 -1
  89. package/src/assets/scss/components/PsTooltip.scss +149 -145
  90. package/src/components/accordion/PsAccordion.vue +20 -21
  91. package/src/components/accordion/PsAccordionItem.vue +122 -81
  92. package/src/components/badges-and-tags/PsBadgeWithIcon.vue +37 -36
  93. package/src/components/badges-and-tags/PsCardInfos.vue +40 -40
  94. package/src/components/badges-and-tags/PsChartLegend.vue +50 -41
  95. package/src/components/badges-and-tags/PsClimateZoneBadge.vue +13 -19
  96. package/src/components/badges-and-tags/PsCostEffectBar.vue +28 -61
  97. package/src/components/badges-and-tags/PsDateCardInfo.vue +17 -18
  98. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +4 -3
  99. package/src/components/badges-and-tags/PsMiniTag.vue +39 -41
  100. package/src/components/badges-and-tags/PsProgressBar.vue +72 -68
  101. package/src/components/badges-and-tags/PsTagScope.vue +17 -22
  102. package/src/components/badges-and-tags/PsTestimonialCard.vue +25 -30
  103. package/src/components/buttons/PsButton.vue +90 -98
  104. package/src/components/chips/PsChips.vue +118 -103
  105. package/src/components/collapse/PsCollapse.vue +124 -0
  106. package/src/components/controls/PsCheckbox.vue +86 -83
  107. package/src/components/controls/PsCheckboxSimple.vue +97 -97
  108. package/src/components/controls/PsDraggable.vue +100 -99
  109. package/src/components/controls/PsInlineSelector.vue +111 -113
  110. package/src/components/controls/PsRadioButton.vue +72 -60
  111. package/src/components/controls/PsRadioButtonSimple.vue +81 -77
  112. package/src/components/controls/PsSlider.vue +190 -181
  113. package/src/components/controls/PsSwitch.vue +64 -54
  114. package/src/components/controls/PsToggle.vue +62 -57
  115. package/src/components/data-graphics/PsBarChart.vue +22 -23
  116. package/src/components/datatable/PsDataTable.vue +70 -65
  117. package/src/components/datatable/PsDataTableItem.vue +30 -32
  118. package/src/components/forms/PsDropdown.vue +173 -166
  119. package/src/components/forms/PsDropdownList.vue +133 -130
  120. package/src/components/forms/PsInput.vue +163 -146
  121. package/src/components/forms/PsInputSelect.vue +121 -100
  122. package/src/components/forms/PsInputTextArea.vue +84 -74
  123. package/src/components/navigations/PsBreadcrumb.vue +25 -34
  124. package/src/components/notifications/PsDialog.vue +67 -60
  125. package/src/components/notifications/PsSimpleAlert.vue +47 -37
  126. package/src/components/notifications/PsToast.vue +48 -42
  127. package/src/components/table-results/PsTableResults.vue +527 -504
  128. package/src/components/table-results/PsTableResultsBody.vue +69 -68
  129. package/src/components/table-results/PsTableResultsHead.vue +108 -69
  130. package/src/components/table-results/PsTableResultsHeadComparison.vue +88 -69
  131. package/src/components/table-results/PsTableResultsHeadFlexible.vue +112 -72
  132. package/src/components/table-results/PsTableResultsRow.vue +61 -58
  133. package/src/components/tabs/PsTabHeader.vue +138 -116
  134. package/src/components/tooltip/PsDialogTooltip.vue +112 -107
  135. package/src/components/tooltip/PsRichTooltip.vue +46 -43
  136. package/src/components/tooltip/PsTooltip.vue +126 -122
  137. package/src/components/ui/PsDotLoader.vue +6 -10
  138. package/src/components/ui/PsIcon.vue +149 -134
  139. package/src/index.ts +159 -0
  140. package/src/tsconfig.json +12 -0
  141. package/src/types/index.d.ts +6 -0
  142. package/src/util/GeneralFunctions.js +16 -7
  143. package/src/util/directives.ts +24 -0
  144. package/src/util/imageLoader.js +14 -7
  145. package/tailwind.config.js +12 -3
  146. package/tsconfig.json +47 -0
  147. package/.storybook/PolicyStudio.js +0 -10
  148. package/.storybook/eventBus.js +0 -3
  149. package/.storybook/main.js +0 -25
  150. package/.storybook/manager.js +0 -6
  151. package/babel.config.js +0 -3
  152. package/backup-package-lock.json +0 -37194
  153. package/dist/css/psui_styles.css +0 -110965
  154. package/postcss.config.js +0 -8
  155. package/src/components/playground/PsScrollBar.vue +0 -248
  156. package/src/index.js +0 -167
  157. package/src/stories/Playground.stories.js +0 -16
  158. /package/{src → doc/src}/assets/images/multifamily-units.svg +0 -0
  159. /package/{src → doc/src}/assets/images/policy-studio.svg +0 -0
  160. /package/{src/contents/ComparisonData.js → doc/src/contents/ComparisonData.ts} +0 -0
  161. /package/{src/contents/FlexibleData.js → doc/src/contents/FlexibleData.ts} +0 -0
  162. /package/{src/contents/ResultsData.js → doc/src/contents/ResultsData.ts} +0 -0
  163. /package/{src/stories/Colors.stories.mdx → doc/src/stories/Colors.mdx} +0 -0
  164. /package/{src → doc/src}/stories/assets/code-brackets.svg +0 -0
  165. /package/{src → doc/src}/stories/assets/colors.svg +0 -0
  166. /package/{src → doc/src}/stories/assets/comments.svg +0 -0
  167. /package/{src → doc/src}/stories/assets/direction.svg +0 -0
  168. /package/{src → doc/src}/stories/assets/flow.svg +0 -0
  169. /package/{src → doc/src}/stories/assets/plugin.svg +0 -0
  170. /package/{src → doc/src}/stories/assets/repo.svg +0 -0
  171. /package/{src → doc/src}/stories/assets/stackalt.svg +0 -0
@@ -1,7 +1,13 @@
1
1
  <template>
2
- <div class="psui-el-input-textarea" :class="[{'disabled':disabled}]">
2
+ <div
3
+ class="psui-el-input-textarea"
4
+ :class="[{ disabled: disabled }]"
5
+ >
3
6
  <div class="psui-el-input-textarea-wrapper">
4
- <label :for="label" v-if="label">{{label}}</label>
7
+ <label
8
+ :for="label"
9
+ v-if="label"
10
+ >{{ label }}</label>
5
11
  <textarea
6
12
  :id="label"
7
13
  :autocapitalize="autocapitalize"
@@ -9,85 +15,89 @@
9
15
  :value="value"
10
16
  @focus="onInputFocus"
11
17
  @blur="onInputBlur"
12
- @input="$emit('input', $event)"
13
- @change="$emit('change', $event)"
18
+ @input="emit('input', $event)"
19
+ @change="emit('change', $event)"
14
20
  :rows="rows"
15
21
  :placeholder="placeholder"
16
- :readonly='disabled'
22
+ :readonly="disabled"
17
23
  />
18
24
  </div>
19
- <p class="psui-el-input-textarea-message" v-if="optionalLabel && !disabled">{{optionalLabel}}</p>
25
+ <p
26
+ class="psui-el-input-textarea-message"
27
+ v-if="optionalLabel && !disabled"
28
+ >
29
+ {{ optionalLabel }}
30
+ </p>
20
31
  </div>
21
32
  </template>
22
33
 
23
- <script>
24
- export default {
25
- name: 'PsInputTextArea',
26
- props: {
27
- /**
28
- * It sets the placeholder of the textarea input.
29
- */
30
- placeholder: {
31
- type: String,
32
- default: ''
33
- },
34
- /**
35
- * It sets the value selected of the textarea input.
36
- */
37
- value: {
38
- required: true,
39
- },
40
- /**
41
- * It sets the label of the textarea input.
42
- */
43
- label: {
44
- type: String,
45
- },
46
- /**
47
- * It sets a optional label if needed.
48
- */
49
- optionalLabel:{
50
- type: String,
51
- },
52
- /**
53
- * It sets aria-required property. eg: true or false.
54
- */
55
- required:{
56
- type: Boolean,
57
- default:true
58
- },
59
- /**
60
- * It sets the type of autocapitalize. See mdn web-doc for full information. default: sentences.
61
- */
62
- autocapitalize: {
63
- type: String,
64
- default: 'sentences'
65
- },
66
- /**
67
- * It sets the size of the textarea input.
68
- */
69
- rows: {
70
- type: Number,
71
- default: 5
72
- },
73
- /**
74
- * It disabled the textarea input. All mouse events are disabled.
75
- */
76
- disabled: {
77
- type: Boolean,
78
- default: false,
79
- }
34
+ <script setup>
35
+
36
+ defineProps({
37
+ /**
38
+ * It sets the placeholder of the textarea input.
39
+ */
40
+ placeholder: {
41
+ type: String,
42
+ default: '',
43
+ },
44
+ /**
45
+ * It sets the value selected of the textarea input.
46
+ */
47
+ value: {
48
+ required: true,
49
+ },
50
+ /**
51
+ * It sets the label of the textarea input.
52
+ */
53
+ label: {
54
+ type: String,
55
+ default: '',
56
+ },
57
+ /**
58
+ * It sets a optional label if needed.
59
+ */
60
+ optionalLabel: {
61
+ type: String,
62
+ default: '',
63
+ },
64
+ /**
65
+ * It sets aria-required property. eg: true or false.
66
+ */
67
+ required: {
68
+ type: Boolean,
69
+ default: true,
70
+ },
71
+ /**
72
+ * It sets the type of autocapitalize. See mdn web-doc for full information. default: sentences.
73
+ */
74
+ autocapitalize: {
75
+ type: String,
76
+ default: 'sentences',
77
+ },
78
+ /**
79
+ * It sets the size of the textarea input.
80
+ */
81
+ rows: {
82
+ type: Number,
83
+ default: 5,
80
84
  },
81
- methods: {
82
- onInputFocus($event) {
83
- this.isFocus = true
84
- this.$emit('focus', $event)
85
- },
86
- onInputBlur($event) {
87
- this.isFocus = false
88
- this.$emit('blur', $event)
89
- }
90
- }
85
+ /**
86
+ * It disabled the textarea input. All mouse events are disabled.
87
+ */
88
+ disabled: {
89
+ type: Boolean,
90
+ default: false,
91
+ },
92
+ })
93
+
94
+ const emit = defineEmits(['focus', 'blur', 'input', 'change'])
95
+
96
+ const onInputFocus = ($event) => {
97
+ emit('focus', $event)
91
98
  }
92
- </script>
93
99
 
100
+ const onInputBlur = ($event) => {
101
+ emit('blur', $event)
102
+ }
103
+ </script>
@@ -1,4 +1,4 @@
1
- <template>
1
+ <template>
2
2
  <nav
3
3
  v-if="items.length > 0"
4
4
  aria-label="breadcrumb"
@@ -13,7 +13,6 @@
13
13
  <router-link
14
14
  v-if="item.route && !item.isReset"
15
15
  :to="item.route"
16
- @click.native="onNavigate(item)"
17
16
  >
18
17
  {{ item.title }}
19
18
  </router-link>
@@ -21,7 +20,7 @@
21
20
  <span
22
21
  v-else-if="item.isReset"
23
22
  class="psui-flex psui-items-center psui-cursor-pointer psui-text-blue-60 psui-font-bold"
24
- @click="$emit('reset-state', item)"
23
+ @click="emit('reset-state', item)"
25
24
  >
26
25
  <PsIcon
27
26
  size="18"
@@ -32,8 +31,8 @@
32
31
  {{ item.title }}
33
32
  </span>
34
33
 
35
- <span
36
- v-else
34
+ <span
35
+ v-else
37
36
  :title="item.title"
38
37
  >
39
38
  {{ item.title }}
@@ -43,36 +42,28 @@
43
42
  </nav>
44
43
  </template>
45
44
 
46
- <script>
45
+ <script setup>
47
46
  import PsIcon from '../ui/PsIcon.vue'
48
- export default {
49
- name: 'PsBreadcrumb',
50
- components: { PsIcon },
51
- props: {
52
- /**
53
- * It sets the items which will be rendered.
54
- */
55
- items: {
56
- type: [Array, Boolean],
57
- },
58
- /**
59
- * It sets the li style.
60
- */
61
- liClass: {
62
- type: String,
63
- default: 'psui-text-small psui-text-gray-60'
64
- }
47
+
48
+ defineProps({
49
+ /**
50
+ * It sets the items which will be rendered.
51
+ */
52
+ items: {
53
+ type: [Array, Boolean],
54
+ default: () => [],
65
55
  },
66
- methods: {
67
- onNavigate(item) {
68
- if (item.route === this.$route.path) {
69
- this.$parent.closeDrawer()
70
- }
71
- },
72
- }
73
- }
74
- </script>
56
+ /**
57
+ * It sets the li style.
58
+ */
59
+ liClass: {
60
+ type: String,
61
+ default: 'psui-text-small psui-text-gray-60',
62
+ },
63
+ })
64
+
65
+ const emit = defineEmits(['reset-state'])
75
66
 
76
- <style>
67
+ </script>
77
68
 
78
- </style>
69
+ <style></style>
@@ -1,82 +1,89 @@
1
1
  <template>
2
- <div class="psui-el-dialog" :class="getComponentClass">
2
+ <div
3
+ class="psui-el-dialog"
4
+ :class="getComponentClass"
5
+ >
3
6
  <div class="psui-el-dialog-icon">
4
- <i class="material-icons-round">{{icon}}</i>
7
+ <i class="material-icons-round">{{ icon }}</i>
5
8
  </div>
6
- <div class="psui-el-dialog-wrapper">
9
+ <div class="psui-el-dialog-wrapper">
7
10
  <div class="psui-el-dialog-default">
8
11
  <slot>
9
- <p class="psui-el-dialog-message">{{ message }}</p>
12
+ <p class="psui-el-dialog-message">
13
+ {{ message }}
14
+ </p>
10
15
  </slot>
11
16
  </div>
12
17
  <div class="psui-el-dialog-action">
13
- <slot name="action"></slot>
18
+ <slot name="action" />
14
19
  </div>
15
20
  </div>
16
21
  <button
17
- class="psui-el-dialog-close"
18
- v-if="hasClose"
19
- @click="onClose">
22
+ class="psui-el-dialog-close"
23
+ v-if="hasClose"
24
+ @click="onClose"
25
+ >
20
26
  <i class="material-icons-round">close</i>
21
27
  </button>
22
28
  </div>
23
29
  </template>
24
30
 
25
- <script>
31
+ <script setup>
26
32
  // Figma - 3. Inline Dialog https://www.figma.com/file/Tto8hrNlSfuPcwd1pfqogF/%E2%9A%A1%EF%B8%8F-Design-System?node-id=3694%3A55841
27
- export default {
28
- name: 'PsDialog',
29
- props: {
30
- /**
31
- * It sets the theme of the dialog. eg: informative, success and alert.
32
- */
33
- theme: {
34
- type: String,
35
- default: 'informative',
36
- validator: (value) => ['informative', 'success', 'alert'].includes(value)
37
- },
38
- /**
39
- * It set the which will be displayed when component is rendered.
40
- */
41
- message: {
42
- type: String,
43
- },
44
- /**
45
- * It sets the direction of the items within the dialog. See Figma Notifications for full information.
46
- */
47
- layout:{
48
- type: String,
49
- default: 'horizontal',
50
- validator: (value) => ['horizontal', 'vertical'].includes(value)
51
- },
52
- /**
53
- * It sets a close button if needed.
54
- */
55
- hasClose: {
56
- type: Boolean,
57
- default: true
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
- */
62
- icon: {
63
- type: String,
64
- default: 'info'
65
- }
33
+
34
+ import { computed } from 'vue'
35
+
36
+ const props = defineProps({
37
+ /**
38
+ * It sets the theme of the dialog. eg: informative, success and alert.
39
+ */
40
+ theme: {
41
+ type: String,
42
+ default: 'informative',
43
+ validator: (value) => ['informative', 'success', 'alert', 'gray', 'disabled'].includes(value),
44
+ },
45
+ /**
46
+ * It set the which will be displayed when component is rendered.
47
+ */
48
+ message: {
49
+ type: String,
50
+ default: '',
51
+ },
52
+ /**
53
+ * It sets the direction of the items within the dialog. See Figma Notifications for full information.
54
+ */
55
+ layout: {
56
+ type: String,
57
+ default: 'horizontal',
58
+ validator: (value) => ['horizontal', 'vertical'].includes(value),
59
+ },
60
+ /**
61
+ * It sets a close button if needed.
62
+ */
63
+ hasClose: {
64
+ type: Boolean,
65
+ default: true,
66
66
  },
67
- emits:['close'],
68
- computed: {
69
- getComponentClass() {
70
- return [`layout-${this.layout}`, `theme-${this.theme}`, `close-${this.hasClose ? 'on' : 'off'}` ]
71
- }
67
+ /**
68
+ * 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/.
69
+ */
70
+ icon: {
71
+ type: String,
72
+ default: 'info',
72
73
  },
73
- methods:{
74
- onClose(){
75
- this.$emit('close')
76
- }
77
- }
74
+ })
75
+
76
+ const emit = defineEmits(['close'])
77
+
78
+ const getComponentClass = computed(() => {
79
+ return [`layout-${props.layout}`, `theme-${props.theme}`, `close-${props.hasClose ? 'on' : 'off'}`]
80
+ })
81
+
82
+ const onClose = () => {
83
+ emit('close')
78
84
  }
79
85
  </script>
80
86
 
81
- <style> /* Please, use the file src/assets/scss/components/PsDialog.scss */</style>
82
-
87
+ <style>
88
+ /* Please, use the file src/assets/scss/components/PsDialog.scss */
89
+ </style>
@@ -1,43 +1,53 @@
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>
1
+ <template>
2
+ <div
3
+ class="psui-el-simple-alert"
4
+ v-bind="$attrs"
5
+ @click.stop="emit('click')"
6
+ >
7
+ <PsIcon
8
+ :icon="icon"
9
+ :icon-classes="iconClass"
10
+ :size="iconSize"
11
+ />
12
+ <p class="psui-el-simple-alert-message">
13
+ {{ message }}
14
+ </p>
15
+ <button
16
+ class="psui-el-simple-alert-button"
17
+ :class="buttonClass"
18
+ @click.stop="emit('close')"
19
+ >
20
+ close
21
+ </button>
22
+ </div>
11
23
  </template>
12
24
 
13
- <script>
25
+ <script setup>
14
26
  import PsIcon from '../ui/PsIcon.vue'
15
27
 
28
+ defineProps({
29
+ message: {
30
+ type: String,
31
+ default: '',
32
+ },
33
+ icon: {
34
+ type: String,
35
+ default: 'info',
36
+ },
37
+ iconClass: {
38
+ type: String,
39
+ default: '',
40
+ },
41
+ buttonClass: {
42
+ type: String,
43
+ default: '',
44
+ },
45
+ iconSize: {
46
+ type: [Number, String],
47
+ default: 24,
48
+ },
49
+ })
50
+
51
+ const emit = defineEmits(['click', 'close'])
16
52
 
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
53
  </script>
@@ -1,53 +1,59 @@
1
1
  <template>
2
- <div class='psui-el-toast' :class="getComponentClass">
2
+ <div
3
+ class="psui-el-toast"
4
+ :class="getComponentClass"
5
+ >
3
6
  <i class="material-icons-round psui-el-toast-icon">{{ icon }}</i>
4
- <p class="psui-el-toast-message">{{ message }}</p>
7
+ <p class="psui-el-toast-message">
8
+ {{ message }}
9
+ </p>
5
10
  <div class="psui-el-toast-actions">
6
- <slot></slot>
11
+ <slot />
7
12
  </div>
8
13
  </div>
9
14
  </template>
10
15
 
11
- <script>
12
- export default {
13
- name: 'PsToast',
14
- props: {
15
- /**
16
- * It sets the layout of the toast. eg: info, success, warning and error.
17
- */
18
- layout: {
19
- type: String,
20
- default: 'info',
21
- validator: (value) => ['info', 'success', 'warning', 'error'].includes(value)
22
- },
23
- /**
24
- * It sets a supportive layout. eg: soft and intese. See Figma - Notification for full information.
25
- */
26
- fill: {
27
- type: String,
28
- default: 'intense',
29
- validator: (value) => ['soft', 'intense'].includes(value)
30
- },
31
- /**
32
- * It sets the message which will be displayed when component is rendered.
33
- */
34
- message: {
35
- type: String,
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
- */
40
- icon:{
41
- type: String,
42
- }
16
+ <script setup>
17
+ import { computed } from 'vue'
18
+
19
+ const props = defineProps({
20
+ /**
21
+ * It sets the layout of the toast. eg: info, success, warning and error.
22
+ */
23
+ layout: {
24
+ type: String,
25
+ default: 'info',
26
+ validator: (value) => ['info', 'success', 'warning', 'error'].includes(value),
43
27
  },
44
- computed: {
45
- getComponentClass(){
46
- return `layout-${this.layout} fill-${this.fill}`
47
- }
28
+ /**
29
+ * It sets a supportive layout. eg: soft and intese. See Figma - Notification for full information.
30
+ */
31
+ fill: {
32
+ type: String,
33
+ default: 'intense',
34
+ validator: (value) => ['soft', 'intense'].includes(value),
48
35
  },
49
- }
50
- </script>
36
+ /**
37
+ * It sets the message which will be displayed when component is rendered.
38
+ */
39
+ message: {
40
+ type: String,
41
+ default: '',
42
+ },
43
+ /**
44
+ * 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/.
45
+ */
46
+ icon: {
47
+ type: String,
48
+ default: '',
49
+ },
50
+ })
51
51
 
52
- <style> /* Please, use the file src/assets/scss/components/PsToast.scss */ </style>
52
+ const getComponentClass = computed(() => {
53
+ return `layout-${props.layout} fill-${props.fill}`
54
+ })
55
+ </script>
53
56
 
57
+ <style>
58
+ /* Please, use the file src/assets/scss/components/PsToast.scss */
59
+ </style>