@policystudio/policy-studio-ui-vue 1.1.90-beta.10 → 1.1.90-beta.17

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 (132) hide show
  1. package/.eslintrc.js +2 -1
  2. package/.github/workflows/deploy-storybook.yml +4 -4
  3. package/.nvmrc +1 -0
  4. package/dist/css/psui_styles_output.css +6986 -0
  5. package/package.json +9 -23
  6. package/src/assets/scss/components/PsDataTable.scss +1 -1
  7. package/src/components/accordion/PsAccordionItem.vue +75 -75
  8. package/src/components/badges-and-tags/PsBadgeWithIcon.vue +31 -34
  9. package/src/components/badges-and-tags/PsCardInfos.vue +40 -41
  10. package/src/components/badges-and-tags/PsChartLegend.vue +47 -51
  11. package/src/components/badges-and-tags/PsClimateZoneBadge.vue +14 -19
  12. package/src/components/badges-and-tags/PsCostEffectBar.vue +24 -56
  13. package/src/components/badges-and-tags/PsDateCardInfo.vue +17 -18
  14. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +3 -2
  15. package/src/components/badges-and-tags/PsMiniTag.vue +39 -41
  16. package/src/components/badges-and-tags/PsProgressBar.vue +72 -68
  17. package/src/components/badges-and-tags/PsTagScope.vue +17 -22
  18. package/src/components/badges-and-tags/PsTestimonialCard.vue +20 -26
  19. package/src/components/buttons/PsButton.vue +61 -62
  20. package/src/components/chips/PsChips.vue +98 -101
  21. package/src/components/controls/PsCheckbox.vue +84 -84
  22. package/src/components/controls/PsCheckboxSimple.vue +95 -95
  23. package/src/components/controls/PsDraggable.vue +53 -55
  24. package/src/components/controls/PsInlineSelector.vue +99 -99
  25. package/src/components/controls/PsRadioButton.vue +59 -58
  26. package/src/components/controls/PsRadioButtonSimple.vue +79 -75
  27. package/src/components/controls/PsSlider.vue +185 -176
  28. package/src/components/controls/PsSwitch.vue +51 -52
  29. package/src/components/controls/PsToggle.vue +53 -50
  30. package/src/components/data-graphics/PsBarChart.vue +19 -21
  31. package/src/components/datatable/PsDataTable.vue +56 -60
  32. package/src/components/datatable/PsDataTableItem.vue +14 -28
  33. package/src/components/forms/PsDropdown.vue +164 -162
  34. package/src/components/forms/PsDropdownList.vue +132 -129
  35. package/src/components/forms/PsInput.vue +155 -153
  36. package/src/components/forms/PsInputSelect.vue +91 -92
  37. package/src/components/forms/PsInputTextArea.vue +71 -71
  38. package/src/components/navigations/PsBreadcrumb.vue +26 -34
  39. package/src/components/notifications/PsDialog.vue +57 -56
  40. package/src/components/notifications/PsSimpleAlert.vue +28 -29
  41. package/src/components/notifications/PsToast.vue +40 -39
  42. package/src/components/table-results/PsTableResults.vue +452 -458
  43. package/src/components/table-results/PsTableResultsBody.vue +66 -67
  44. package/src/components/table-results/PsTableResultsHead.vue +62 -56
  45. package/src/components/table-results/PsTableResultsHeadComparison.vue +62 -56
  46. package/src/components/table-results/PsTableResultsHeadFlexible.vue +63 -56
  47. package/src/components/table-results/PsTableResultsRow.vue +55 -56
  48. package/src/components/tabs/PsTabHeader.vue +106 -100
  49. package/src/components/tooltip/PsDialogTooltip.vue +96 -101
  50. package/src/components/tooltip/PsRichTooltip.vue +42 -45
  51. package/src/components/tooltip/PsTooltip.vue +111 -116
  52. package/src/components/ui/PsDotLoader.vue +1 -5
  53. package/src/components/ui/PsIcon.vue +126 -129
  54. package/src/index.ts +56 -66
  55. package/src/tsconfig.json +12 -0
  56. package/src/{shims-vue.d.ts → types/index.d.ts} +0 -5
  57. package/src/util/{GeneralFunctions.ts → GeneralFunctions.js} +3 -5
  58. package/src/util/directives.ts +24 -0
  59. package/src/util/eventBus.js +10 -0
  60. package/src/util/{imageLoader.ts → imageLoader.js} +9 -8
  61. package/tailwind.config.js +1 -1
  62. package/tsconfig.json +16 -18
  63. package/.storybook/PolicyStudio.ts +0 -11
  64. package/.storybook/eventBus.ts +0 -26
  65. package/.storybook/main.ts +0 -21
  66. package/.storybook/manager.ts +0 -7
  67. package/.storybook/preview.ts +0 -17
  68. package/dist/css/psui_styles.css +0 -4647
  69. package/postcss.config.js +0 -8
  70. package/src/assets/images/multifamily-units.svg +0 -10
  71. package/src/assets/images/policy-studio.svg +0 -15
  72. package/src/components/playground/PsScrollBar.vue +0 -320
  73. package/src/contents/ComparisonData.ts +0 -378
  74. package/src/contents/FlexibleData.ts +0 -502
  75. package/src/contents/ResultsData.ts +0 -531
  76. package/src/stories/Accordion.stories.ts +0 -59
  77. package/src/stories/BadgeWithIcon.stories.ts +0 -31
  78. package/src/stories/BarChart.stories.ts +0 -17
  79. package/src/stories/Breadcrumb.stories.ts +0 -22
  80. package/src/stories/Button.stories.ts +0 -48
  81. package/src/stories/Button.vue +0 -59
  82. package/src/stories/CardInfos.stories.ts +0 -15
  83. package/src/stories/ChartLegend.stories.ts +0 -15
  84. package/src/stories/Checkbox.stories.ts +0 -45
  85. package/src/stories/CheckboxSimple.stories.ts +0 -49
  86. package/src/stories/Chips.stories.ts +0 -33
  87. package/src/stories/ClimateZoneBadge.stories.ts +0 -28
  88. package/src/stories/Colors.mdx +0 -70
  89. package/src/stories/CostEffectBar.stories.ts +0 -26
  90. package/src/stories/Datatable.stories.ts +0 -53
  91. package/src/stories/DateCardInfo.stories.ts +0 -20
  92. package/src/stories/Dialog.stories.ts +0 -131
  93. package/src/stories/Draggable.stories.ts +0 -32
  94. package/src/stories/Dropdown.stories.ts +0 -89
  95. package/src/stories/DropdownList.stories.ts +0 -213
  96. package/src/stories/ElevationSystem.mdx +0 -41
  97. package/src/stories/Header.stories.ts +0 -42
  98. package/src/stories/Header.vue +0 -77
  99. package/src/stories/HighlightRippleDot.stories.ts +0 -16
  100. package/src/stories/Icon.stories.ts +0 -22
  101. package/src/stories/InlineSelector.stories.ts +0 -18
  102. package/src/stories/Input.stories.ts +0 -244
  103. package/src/stories/InputSelect.stories.ts +0 -31
  104. package/src/stories/InputTextArea.stories.ts +0 -25
  105. package/src/stories/Introduction.mdx +0 -211
  106. package/src/stories/MiniTag.stories.ts +0 -59
  107. package/src/stories/Playground.stories.ts +0 -16
  108. package/src/stories/ProgressBar.stories.ts +0 -24
  109. package/src/stories/RadioButton.stories.ts +0 -41
  110. package/src/stories/RadioButtonSimple.stories.ts +0 -43
  111. package/src/stories/SimpleAlert.stories.ts +0 -22
  112. package/src/stories/Slider.stories.ts +0 -79
  113. package/src/stories/Switch.stories.ts +0 -39
  114. package/src/stories/TabHeader.stories.ts +0 -56
  115. package/src/stories/TableResults.stories.ts +0 -728
  116. package/src/stories/TagScope.stories.ts +0 -17
  117. package/src/stories/TestimonialCard.stories.ts +0 -27
  118. package/src/stories/Toast.stories.ts +0 -52
  119. package/src/stories/Toggle.stories.ts +0 -48
  120. package/src/stories/Tooltip.stories.ts +0 -114
  121. package/src/stories/Typography.mdx +0 -212
  122. package/src/stories/assets/code-brackets.svg +0 -1
  123. package/src/stories/assets/colors.svg +0 -1
  124. package/src/stories/assets/comments.svg +0 -1
  125. package/src/stories/assets/direction.svg +0 -1
  126. package/src/stories/assets/flow.svg +0 -1
  127. package/src/stories/assets/plugin.svg +0 -1
  128. package/src/stories/assets/repo.svg +0 -1
  129. package/src/stories/assets/stackalt.svg +0 -1
  130. package/src/stories/button.css +0 -30
  131. package/src/stories/header.css +0 -32
  132. package/webpack.config.js +0 -36
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
3
  class="psui-el-switch"
4
- :class="[getComponentClass, {'disabled':disabled}]"
4
+ :class="[getComponentClass, { disabled: disabled }]"
5
5
  @click="change()"
6
6
  >
7
7
  <input
@@ -15,59 +15,58 @@
15
15
  </div>
16
16
  </template>
17
17
 
18
- <script>
18
+ <script setup>
19
19
  //FIGMA CONTROLS & SELECTORS https://www.figma.com/file/Tto8hrNlSfuPcwd1pfqogF/%E2%9A%A1%EF%B8%8F-Design-System?node-id=1768%3A64852
20
+ import { defineProps, defineEmits } from 'vue'
20
21
 
21
- export default {
22
- name: 'PsSwitch',
23
- props: {
24
- /**
25
- * It sets the label of the switch button.
26
- */
27
- label:{
28
- type: String,
29
- },
30
- /**
31
- * It sets the value of the switch button.
32
- */
33
- value:{
34
- type: Boolean,
35
- },
36
- backgroundColor: {
37
- type: String,
38
- default:'psui-bg-green-20'
39
- },
40
- /**
41
- * It sets disabling mode.
42
- */
43
- disabled:{
44
- type: Boolean,
45
- default: false
46
- },
47
- /**
48
- * It sets the size of the switch button. eg: small and big.
49
- */
50
- size:{
51
- type: String,
52
- default: 'big',
53
- validator: (value)=> ['small', 'big'].includes(value)
54
- }
22
+ const emit = defineEmits('change', 'update:value')
23
+
24
+ const props = defineProps({
25
+ /**
26
+ * It sets the label of the switch button.
27
+ */
28
+ label: {
29
+ type: String,
30
+ default: '',
55
31
  },
56
- computed:{
57
- getToggleClass(){
58
- if(this.disabled) return 'toggle-false'
59
- return this.value ? `toggle-true ${this.backgroundColor}` : 'toggle-false psui-bg-gray-40'
60
- },
61
- getComponentClass(){
62
- return `size-${this.size}`
63
- }
32
+ /**
33
+ * It sets the value of the switch button.
34
+ */
35
+ value: {
36
+ type: Boolean,
64
37
  },
65
- methods: {
66
- change() {
67
- this.$emit('update:value', !this.value)
68
- this.$emit('change', !this.value)
69
- }
70
- }
71
- }
72
- </script>
38
+ backgroundColor: {
39
+ type: String,
40
+ default: 'psui-bg-green-20',
41
+ },
42
+ /**
43
+ * It sets disabling mode.
44
+ */
45
+ disabled: {
46
+ type: Boolean,
47
+ default: false,
48
+ },
49
+ /**
50
+ * It sets the size of the switch button. eg: small and big.
51
+ */
52
+ size: {
53
+ type: String,
54
+ default: 'big',
55
+ validator: (value) => ['small', 'big'].includes(value),
56
+ },
57
+ })
58
+
59
+ const getToggleClass = () => {
60
+ if (props.disabled) return 'toggle-false'
61
+ return props.value ? `toggle-true ${props.backgroundColor}` : 'toggle-false psui-bg-gray-40'
62
+ }
73
63
 
64
+ const getComponentClass = () => {
65
+ return `size-${props.size}`
66
+ }
67
+
68
+ const change = () => {
69
+ emit('update:value', !props.value)
70
+ emit('change', !props.value)
71
+ }
72
+ </script>
@@ -1,9 +1,9 @@
1
1
  <template>
2
- <div
3
- class="psui-el-toggle"
4
- role="group"
2
+ <div
3
+ class="psui-el-toggle"
4
+ role="group"
5
5
  >
6
- <button
6
+ <button
7
7
  type="button"
8
8
  v-for="(item, index) in items"
9
9
  :key="getKeyValue(item) + index"
@@ -15,55 +15,58 @@
15
15
  </div>
16
16
  </template>
17
17
 
18
- <script>
18
+ <script setup>
19
19
  //FIGMA CONTROLS & SELECTORS https://www.figma.com/file/Tto8hrNlSfuPcwd1pfqogF/%E2%9A%A1%EF%B8%8F-Design-System?node-id=1768%3A64852
20
+ import { defineProps, defineEmits } from 'vue'
20
21
 
21
- export default {
22
- name: 'PsToggle',
23
- props: {
24
- /**
25
- * It sets the items which will be used to create the toggle tab. See Figma - Controls & Selector for more information.
26
- */
27
- items: {
28
- type: Array,
29
- required: true
30
- },
31
- /**
32
- * It sets the value selected.
33
- */
34
- selected: {},
35
- /**
36
- * It sets the key label of your items if needed.
37
- */
38
- keyLabel: {
39
- type: [String, Function],
40
- default: 'label'
41
- },
42
- /**
43
- * It sets the key value of your items if needed.
44
- */
45
- keyValue: {
46
- type: [String, Function],
47
- default: 'value'
48
- }
22
+ const emit = defineEmits(['change', 'update:selected'])
23
+
24
+ const props = defineProps({
25
+ /**
26
+ * It sets the items which will be used to create the toggle tab. See Figma - Controls & Selector for more information.
27
+ */
28
+ items: {
29
+ type: Array,
30
+ required: true,
31
+ },
32
+ /**
33
+ * It sets the value selected.
34
+ */
35
+ selected: {},
36
+ /**
37
+ * It sets the key label of your items if needed.
38
+ */
39
+ keyLabel: {
40
+ type: [String, Function],
41
+ default: 'label',
49
42
  },
50
- methods: {
51
- selectOption(item) {
52
- this.$emit('update:selected', item)
53
- this.$emit('change', item)
54
- },
55
- getKeyLabel(item) {
56
- if(typeof this.keyLabel == 'function') return this.keyLabel(item)
57
- if(typeof item === 'object') return item[this.keyLabel]
58
- return item
59
- },
60
- getKeyValue(item) {
61
- if(typeof this.keyValue == 'function') return this.keyValue(item)
62
- if(typeof item === 'object') return item[this.keyLabel]
63
- return item
64
- },
65
- }
43
+ /**
44
+ * It sets the key value of your items if needed.
45
+ */
46
+ keyValue: {
47
+ type: [String, Function],
48
+ default: 'value',
49
+ },
50
+ })
51
+
52
+ const selectOption = (item) => {
53
+ emit('update:selected', item)
54
+ emit('change', item)
55
+ }
56
+
57
+ const getKeyLabel = (item) => {
58
+ if (typeof props.keyLabel == 'function') return props.keyLabel(item)
59
+ if (typeof item === 'object') return item[props.keyLabel]
60
+ return item
61
+ }
62
+
63
+ const getKeyValue = (item) => {
64
+ if (typeof props.keyValue == 'function') return props.keyValue(item)
65
+ if (typeof item === 'object') return item[props.keyLabel]
66
+ return item
66
67
  }
67
68
  </script>
68
69
 
69
- <style> /* Please, use the file src/assets/scss/components/PsToggle.scss */</style>
70
+ <style>
71
+ /* Please, use the file src/assets/scss/components/PsToggle.scss */
72
+ </style>
@@ -1,36 +1,34 @@
1
1
  <template>
2
2
  <div class="psui-el-bar-chart">
3
- <p
3
+ <p
4
4
  v-if="showNumber"
5
5
  class="psui-el-bar-chart-total"
6
6
  >
7
7
  {{ total }}
8
8
  </p>
9
9
 
10
- <div
10
+ <div
11
11
  class="psui-el-bar-chart-bar"
12
- :style="{width: `${fillWidth}%`}"
12
+ :style="{ width: `${fillWidth}%` }"
13
13
  />
14
14
  </div>
15
15
  </template>
16
16
 
17
- <script>
18
- export default {
19
- name: 'PsBarChart',
20
- props: {
21
- showNumber: {
22
- type: Boolean,
23
- default: true
24
- },
25
- total: {
26
- type: [String, Number],
27
- default: '5,0',
28
- },
29
- fillWidth: {
30
- type: Number,
31
- default: 50
32
- },
17
+ <script setup>
18
+ import { defineProps } from 'vue'
19
+
20
+ defineProps({
21
+ showNumber: {
22
+ type: Boolean,
23
+ default: true,
24
+ },
25
+ total: {
26
+ type: [String, Number],
27
+ default: '5,0',
28
+ },
29
+ fillWidth: {
30
+ type: Number,
31
+ default: 50,
33
32
  },
34
- computed: {}
35
- }
33
+ })
36
34
  </script>
@@ -37,70 +37,66 @@
37
37
  </table>
38
38
  </template>
39
39
 
40
- <script>
41
- export const type = ['simple', 'rich']
42
- export const alignment = ['center', 'right', 'left']
40
+ <script setup>
41
+ import { defineProps, computed } from 'vue'
43
42
 
44
- export default {
45
- name: 'PsDataTable',
46
- props: {
47
- /**
48
- * It sets the type of the data table. eg: simple or rich.
49
- */
50
- type: {
51
- type: String,
52
- required: true,
53
- validator: (value) => {
54
- return ['simple', 'rich'].indexOf(value) !== -1
55
- },
43
+ const props = defineProps({
44
+ type: {
45
+ type: String,
46
+ required: true,
47
+ validator: (value) => {
48
+ return ['simple', 'rich'].indexOf(value) !== -1
56
49
  },
57
- /**
58
- * It sets the values which will be use to render the header.
59
- */
60
- header: {
61
- type: Array,
62
- required: true,
63
- },
64
- /**
65
- * It sets the values which will be use to render the body.
66
- */
67
- data: {
68
- type: Array,
69
- default() {
70
- return []
71
- }
72
- },
73
- /**
74
- * It sets the values which will be use to render the footer.
75
- */
76
- footer: {
77
- type: Array,
78
- },
79
- /**
80
- * It sets the alignment of the whole context.
81
- */
82
- align: {
83
- type: String,
84
- default: 'left',
85
- validator: (value) => {
86
- return ['center', 'right', 'left'].indexOf(value) !== -1
87
- }
50
+ },
51
+ /**
52
+ * It sets the values which will be use to render the header.
53
+ */
54
+ header: {
55
+ type: Array,
56
+ required: true,
57
+ },
58
+ /**
59
+ * It sets the values which will be use to render the body.
60
+ */
61
+ data: {
62
+ type: Array,
63
+ default() {
64
+ return []
88
65
  },
89
- /**
90
- * It sets additional styling if needed.
91
- */
92
- cssStyle: {
93
- type: String,
94
- default: 'psui-text-gray-60'
95
- }
96
66
  },
97
- computed: {
98
- cssAlign() {
99
- if (this.align === 'right') return `psui-text-right ${this.cssStyle}`
100
- if (this.align === 'center') return `psui-text-center ${this.cssStyle}`
101
- return `psui-text-left ${this.cssStyle}`
67
+ /**
68
+ * It sets the values which will be use to render the footer.
69
+ */
70
+ footer: {
71
+ type: Array,
72
+ default: () => [],
73
+ },
74
+ /**
75
+ * It sets the alignment of the whole context.
76
+ */
77
+ align: {
78
+ type: String,
79
+ default: 'left',
80
+ validator: (value) => {
81
+ return ['center', 'right', 'left'].indexOf(value) !== -1
102
82
  },
103
83
  },
104
- }
84
+ /**
85
+ * It sets additional styling if needed.
86
+ */
87
+ cssStyle: {
88
+ type: String,
89
+ default: 'psui-text-gray-60',
90
+ },
91
+ })
92
+
93
+ const cssAlign = computed(() => {
94
+ if (props.align === 'right') return `psui-text-right ${props.cssStyle}`
95
+ if (props.align === 'center') return `psui-text-center ${props.cssStyle}`
96
+ return `psui-text-left ${props.cssStyle}`
97
+ })
105
98
  </script>
106
- <style> /* Please, use the file src/assets/scss/components/PsDataTable.scss */</style>
99
+
100
+ <style>
101
+ /* Please, use the file src/assets/scss/components/PsDataTable.scss */
102
+ </style>
@@ -15,11 +15,7 @@
15
15
  </span>
16
16
  <div
17
17
  class="psui-flex psui-items-center"
18
- :class="
19
- el[Object.keys(el)[1]] >= 0
20
- ? 'psui-text-green-70'
21
- : 'psui-text-red-70'
22
- "
18
+ :class="el[Object.keys(el)[1]] >= 0 ? 'psui-text-green-70' : 'psui-text-red-70'"
23
19
  >
24
20
  <i
25
21
  v-if="el[Object.keys(el)[1]] >= 0"
@@ -29,37 +25,27 @@
29
25
  v-else
30
26
  class="material-icons"
31
27
  >arrow_downward</i>
32
- <span>
33
- {{
34
- (
35
- (el[Object.keys(el)[1]] / el[Object.keys(el)[0]]) *
36
- 100
37
- ).toFixed(2)
38
- }}%
39
- </span>
28
+ <span> {{ ((el[Object.keys(el)[1]] / el[Object.keys(el)[0]]) * 100).toFixed(2) }}% </span>
40
29
  </div>
41
30
  </div>
42
- <span class="psui-text-gray-50">{{
43
- el[Object.keys(el)[0]].toFixed(6)
44
- }}</span>
31
+ <span class="psui-text-gray-50">{{ el[Object.keys(el)[0]].toFixed(6) }}</span>
45
32
  </td>
46
33
  </tr>
47
34
  </tbody>
48
35
  </template>
49
36
 
50
- <script>
51
- export default {
52
- name: 'PsDataTableItem',
53
- props: {
54
- data: {
55
- type: Array,
56
- required: true,
57
- default: () => {
58
- return []
59
- },
37
+ <script setup>
38
+ import { defineProps } from 'vue'
39
+
40
+ defineProps({
41
+ data: {
42
+ type: Array,
43
+ required: true,
44
+ default: () => {
45
+ return []
60
46
  },
61
47
  },
62
- }
48
+ })
63
49
  </script>
64
50
 
65
51
  <style scoped>
@@ -67,4 +53,4 @@ export default {
67
53
  font-size: 15px;
68
54
  margin-bottom: 2px;
69
55
  }
70
- </style>
56
+ </style>