@policystudio/policy-studio-ui-vue 1.1.90-beta.2 → 1.1.90-beta.21

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 (146) hide show
  1. package/.eslintrc.js +13 -8
  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/dist/index.d.ts +50 -0
  6. package/dist/index.js +104 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/util/GeneralFunctions.d.ts +3 -0
  9. package/dist/util/GeneralFunctions.js +29 -0
  10. package/dist/util/GeneralFunctions.js.map +1 -0
  11. package/dist/util/directives.d.ts +1 -0
  12. package/dist/util/directives.js +22 -0
  13. package/dist/util/directives.js.map +1 -0
  14. package/dist/util/imageLoader.d.ts +6 -0
  15. package/dist/util/imageLoader.js +52 -0
  16. package/dist/util/imageLoader.js.map +1 -0
  17. package/package.json +24 -37
  18. package/src/App.vue +30 -0
  19. package/src/assets/scss/components/PsDataTable.scss +1 -1
  20. package/src/components/accordion/PsAccordionItem.vue +75 -75
  21. package/src/components/badges-and-tags/PsBadgeWithIcon.vue +31 -33
  22. package/src/components/badges-and-tags/PsCardInfos.vue +39 -41
  23. package/src/components/badges-and-tags/PsChartLegend.vue +46 -51
  24. package/src/components/badges-and-tags/PsClimateZoneBadge.vue +13 -19
  25. package/src/components/badges-and-tags/PsCostEffectBar.vue +24 -56
  26. package/src/components/badges-and-tags/PsDateCardInfo.vue +17 -18
  27. package/src/components/badges-and-tags/PsHighlightRippleDot.vue +3 -2
  28. package/src/components/badges-and-tags/PsMiniTag.vue +39 -41
  29. package/src/components/badges-and-tags/PsProgressBar.vue +72 -68
  30. package/src/components/badges-and-tags/PsTagScope.vue +17 -22
  31. package/src/components/badges-and-tags/PsTestimonialCard.vue +19 -26
  32. package/src/components/buttons/PsButton.vue +88 -111
  33. package/src/components/chips/PsChips.vue +98 -101
  34. package/src/components/controls/PsCheckbox.vue +84 -84
  35. package/src/components/controls/PsCheckboxSimple.vue +95 -95
  36. package/src/components/controls/PsDraggable.vue +53 -55
  37. package/src/components/controls/PsInlineSelector.vue +98 -99
  38. package/src/components/controls/PsRadioButton.vue +59 -58
  39. package/src/components/controls/PsRadioButtonSimple.vue +79 -75
  40. package/src/components/controls/PsSlider.vue +185 -176
  41. package/src/components/controls/PsSwitch.vue +51 -52
  42. package/src/components/controls/PsToggle.vue +52 -50
  43. package/src/components/data-graphics/PsBarChart.vue +18 -21
  44. package/src/components/datatable/PsDataTable.vue +56 -60
  45. package/src/components/datatable/PsDataTableItem.vue +13 -28
  46. package/src/components/forms/PsDropdown.vue +164 -162
  47. package/src/components/forms/PsDropdownList.vue +133 -130
  48. package/src/components/forms/PsInput.vue +154 -153
  49. package/src/components/forms/PsInputSelect.vue +91 -92
  50. package/src/components/forms/PsInputTextArea.vue +71 -71
  51. package/src/components/navigations/PsBreadcrumb.vue +25 -34
  52. package/src/components/notifications/PsDialog.vue +57 -56
  53. package/src/components/notifications/PsSimpleAlert.vue +27 -29
  54. package/src/components/notifications/PsToast.vue +40 -39
  55. package/src/components/table-results/PsTableResults.vue +449 -458
  56. package/src/components/table-results/PsTableResultsBody.vue +66 -67
  57. package/src/components/table-results/PsTableResultsHead.vue +62 -56
  58. package/src/components/table-results/PsTableResultsHeadComparison.vue +62 -56
  59. package/src/components/table-results/PsTableResultsHeadFlexible.vue +63 -56
  60. package/src/components/table-results/PsTableResultsRow.vue +55 -56
  61. package/src/components/tabs/PsTabHeader.vue +106 -100
  62. package/src/components/tooltip/PsDialogTooltip.vue +96 -101
  63. package/src/components/tooltip/PsRichTooltip.vue +41 -45
  64. package/src/components/tooltip/PsTooltip.vue +111 -116
  65. package/src/components/ui/PsDotLoader.vue +1 -5
  66. package/src/components/ui/PsIcon.vue +126 -129
  67. package/src/index.ts +156 -0
  68. package/src/tsconfig.json +12 -0
  69. package/src/types/index.d.ts +6 -0
  70. package/src/util/GeneralFunctions.js +4 -6
  71. package/src/util/directives.ts +24 -0
  72. package/src/util/imageLoader.js +14 -7
  73. package/tailwind.config.js +1 -1
  74. package/tsconfig.json +47 -0
  75. package/.storybook/PolicyStudio.js +0 -10
  76. package/.storybook/eventBus.js +0 -26
  77. package/.storybook/main.js +0 -21
  78. package/.storybook/manager.js +0 -6
  79. package/.storybook/preview.js +0 -17
  80. package/babel.config.js +0 -17
  81. package/dist/css/psui_styles.css +0 -4647
  82. package/postcss.config.js +0 -8
  83. package/src/assets/images/multifamily-units.svg +0 -10
  84. package/src/assets/images/policy-studio.svg +0 -15
  85. package/src/components/playground/PsScrollBar.vue +0 -320
  86. package/src/contents/ComparisonData.js +0 -378
  87. package/src/contents/FlexibleData.js +0 -502
  88. package/src/contents/ResultsData.js +0 -531
  89. package/src/index.js +0 -166
  90. package/src/stories/Accordion.stories.js +0 -59
  91. package/src/stories/BadgeWithIcon.stories.js +0 -31
  92. package/src/stories/BarChart.stories.js +0 -17
  93. package/src/stories/Breadcrumb.stories.js +0 -25
  94. package/src/stories/Button.stories.js +0 -48
  95. package/src/stories/Button.vue +0 -59
  96. package/src/stories/CardInfos.stories.js +0 -16
  97. package/src/stories/ChartLegend.stories.js +0 -16
  98. package/src/stories/Checkbox.stories.js +0 -45
  99. package/src/stories/CheckboxSimple.stories.js +0 -49
  100. package/src/stories/Chips.stories.js +0 -31
  101. package/src/stories/ClimateZoneBadge.stories.js +0 -17
  102. package/src/stories/Colors.mdx +0 -70
  103. package/src/stories/CostEffectBar.stories.js +0 -23
  104. package/src/stories/Datatable.stories.js +0 -50
  105. package/src/stories/DateCardInfo.stories.js +0 -24
  106. package/src/stories/Dialog.stories.js +0 -131
  107. package/src/stories/Draggable.stories.js +0 -22
  108. package/src/stories/Dropdown.stories.js +0 -99
  109. package/src/stories/DropdownList.stories.js +0 -211
  110. package/src/stories/ElevationSystem.mdx +0 -41
  111. package/src/stories/Header.stories.js +0 -41
  112. package/src/stories/Header.vue +0 -77
  113. package/src/stories/HighlightRippleDot.stories.js +0 -15
  114. package/src/stories/Icon.stories.js +0 -21
  115. package/src/stories/InlineSelector.stories.js +0 -18
  116. package/src/stories/Input.stories.js +0 -240
  117. package/src/stories/InputSelect.stories.js +0 -30
  118. package/src/stories/InputTextArea.stories.js +0 -25
  119. package/src/stories/Introduction.mdx +0 -211
  120. package/src/stories/MiniTag.stories.js +0 -52
  121. package/src/stories/Playground.stories.js +0 -16
  122. package/src/stories/ProgressBar.stories.js +0 -23
  123. package/src/stories/RadioButton.stories.js +0 -40
  124. package/src/stories/RadioButtonSimple.stories.js +0 -43
  125. package/src/stories/SimpleAlert.stories.js +0 -21
  126. package/src/stories/Slider.stories.js +0 -75
  127. package/src/stories/Switch.stories.js +0 -39
  128. package/src/stories/TabHeader.stories.js +0 -52
  129. package/src/stories/TableResults.stories.js +0 -724
  130. package/src/stories/TagScope.stories.js +0 -17
  131. package/src/stories/TestimonialCard.stories.js +0 -27
  132. package/src/stories/Toast.stories.js +0 -52
  133. package/src/stories/Toggle.stories.js +0 -45
  134. package/src/stories/Tooltip.stories.js +0 -114
  135. package/src/stories/Typography.mdx +0 -212
  136. package/src/stories/assets/code-brackets.svg +0 -1
  137. package/src/stories/assets/colors.svg +0 -1
  138. package/src/stories/assets/comments.svg +0 -1
  139. package/src/stories/assets/direction.svg +0 -1
  140. package/src/stories/assets/flow.svg +0 -1
  141. package/src/stories/assets/plugin.svg +0 -1
  142. package/src/stories/assets/repo.svg +0 -1
  143. package/src/stories/assets/stackalt.svg +0 -1
  144. package/src/stories/button.css +0 -30
  145. package/src/stories/header.css +0 -32
  146. package/webpack.config.js +0 -22
@@ -1,13 +1,13 @@
1
- <template>
1
+ <template>
2
2
  <div
3
3
  class="psui-el-progress-bar"
4
- :style="{width: `${width}px`}"
5
- :class="{ 'is-breakeven' : getIsBreakEven }"
4
+ :style="{ width: `${width}px` }"
5
+ :class="{ 'is-breakeven': getIsBreakEven }"
6
6
  >
7
7
  <div class="psui-el-progress-bar-bg" />
8
8
  <div
9
- class="psui-el-progress-bar-value"
10
- :class="[getBg, {'rounded-tr-full rounded-br-full': getProgressWidth === '100%'}]"
9
+ class="psui-el-progress-bar-value"
10
+ :class="[getBg, { 'rounded-tr-full rounded-br-full': getProgressWidth === '100%' }]"
11
11
  :style="{ width: getProgressWidth }"
12
12
  />
13
13
  <div
@@ -17,69 +17,73 @@
17
17
  </div>
18
18
  </template>
19
19
 
20
- <script>
21
- export default {
22
- name: 'PsProgressBar',
23
- props: {
24
- width: {
25
- type: [String, Number],
26
- default: 100
27
- },
28
- min: {
29
- type: Number,
30
- default: 0
31
- },
32
- max: {
33
- type: Number,
34
- default: 5
35
- },
36
- breakEven: {
37
- type: Number,
38
- default: 1
39
- },
40
- forceBreakEven: {
41
- Boolean,
42
- default: false
43
- },
44
- value: {
45
- type: [String, Number],
46
- default: null
47
- },
48
- positiveBg: {
49
- type: String,
50
- default: 'psui-bg-blue-60'
51
- },
52
- negativeBg: {
53
- type: String,
54
- default: 'psui-bg-red-20'
55
- }
20
+ <script setup>
21
+ import { computed } from 'vue'
22
+
23
+ const props = defineProps({
24
+ width: {
25
+ type: [String, Number],
26
+ default: 100,
56
27
  },
57
- computed: {
58
- getVolume(){
59
- return (this.max - this.min)
60
- },
61
- getProgress() {
62
- if(this.value == 9876543210) return 100
63
- const progress = (100 / this.getVolume) * this.value
64
- return progress > 100 ? 100 : progress
65
- },
66
- getProgressWidth() {
67
- return `${this.getProgress}%`
68
- },
69
- getIsBreakEven() {
70
- if ( this.forceBreakEven ) return true
71
- return this.value >= this.breakEven ? true : false
72
- },
73
- getBreakEvenLeft() {
74
- return `${(100 / this.getVolume) * this.breakEven}%`
75
- },
76
- getBg() {
77
- if ( this.forceBreakEven ) return this.positiveBg
78
- return this.getIsBreakEven ? this.positiveBg : this.negativeBg
79
- }
80
- }
81
- }
82
- </script>
28
+ min: {
29
+ type: Number,
30
+ default: 0,
31
+ },
32
+ max: {
33
+ type: Number,
34
+ default: 5,
35
+ },
36
+ breakEven: {
37
+ type: Number,
38
+ default: 1,
39
+ },
40
+ forceBreakEven: {
41
+ type: Boolean,
42
+ default: false,
43
+ },
44
+ value: {
45
+ type: [String, Number],
46
+ default: null,
47
+ },
48
+ positiveBg: {
49
+ type: String,
50
+ default: 'psui-bg-blue-60',
51
+ },
52
+ negativeBg: {
53
+ type: String,
54
+ default: 'psui-bg-red-20',
55
+ },
56
+ })
57
+
58
+ const getVolume = computed(() => {
59
+ return props.max - props.min
60
+ })
61
+
62
+ const getProgress = computed(() => {
63
+ if (props.value == 9876543210) return 100
64
+ const progress = (100 / getVolume.value) * props.value
65
+ return progress > 100 ? 100 : progress
66
+ })
67
+
68
+ const getProgressWidth = computed(() => {
69
+ return `${getProgress.value}%`
70
+ })
83
71
 
84
- <style> /* Please, use the file src/assets/scss/components/PsProgressBar.scss */ </style>
72
+ const getIsBreakEven = computed(() => {
73
+ if (props.forceBreakEven) return true
74
+ return props.value >= props.breakEven ? true : false
75
+ })
76
+
77
+ const getBreakEvenLeft = computed(() => {
78
+ return `${(100 / getVolume.value) * props.breakEven}%`
79
+ })
80
+
81
+ const getBg = computed(() => {
82
+ if (props.forceBreakEven) return props.positiveBg
83
+ return getIsBreakEven.value ? props.positiveBg : props.negativeBg
84
+ })
85
+ </script>
85
86
 
87
+ <style>
88
+ /* Please, use the file src/assets/scss/components/PsProgressBar.scss */
89
+ </style>
@@ -1,31 +1,26 @@
1
1
  <template>
2
- <div
3
- class="psui-el-tag-scope"
2
+ <div
3
+ class="psui-el-tag-scope"
4
4
  :class="getComponentClass"
5
5
  >
6
6
  <span class="psui-el-tag-scope-icon">{{ getComponentIcon }}</span>
7
7
  </div>
8
8
  </template>
9
9
 
10
- <script>
11
- export default {
12
- name: 'PsTagScope',
13
- props: {
14
- included: {
15
- type: Boolean,
16
- default: true
17
- },
18
- },
19
- computed: {
20
- getComponentClass() {
21
- return `psui-el-tag-scope-${this.included}`
22
- },
23
- getComponentIcon() {
24
- return this.included ? 'check' : 'remove'
25
- }
26
- },
27
- }
28
- </script>
10
+ <script setup>
11
+ import { computed } from 'vue'
12
+
13
+ const props = defineProps({})
29
14
 
30
- <style> /* Please, use the file src/assets/scss/components/PsTagScope.scss */ </style>
15
+ const getComponentClass = computed(() => {
16
+ return `psui-el-tag-scope-${props.included}`
17
+ })
18
+
19
+ const getComponentIcon = computed(() => {
20
+ return props.included ? 'check' : 'remove'
21
+ })
22
+ </script>
31
23
 
24
+ <style>
25
+ /* Please, use the file src/assets/scss/components/PsTagScope.scss */
26
+ </style>
@@ -19,32 +19,25 @@
19
19
  </div>
20
20
  </template>
21
21
 
22
- <script>
22
+ <script setup>
23
23
  import PsIcon from '../ui/PsIcon.vue'
24
24
 
25
- export default {
26
- name: 'PsTestimonialCard',
27
- components:{
28
- PsIcon
29
- },
30
- props:{
31
- description:{
32
- type: String,
33
- default: '',
34
- },
35
- user:{
36
- type: String,
37
- default: '',
38
- },
39
- position:{
40
- type: String,
41
- default: '',
42
- },
43
- jurisdiction:{
44
- type: String,
45
- default: '',
46
- },
47
- }
48
- }
25
+ defineProps({
26
+ description: {
27
+ type: String,
28
+ default: '',
29
+ },
30
+ user: {
31
+ type: String,
32
+ default: '',
33
+ },
34
+ position: {
35
+ type: String,
36
+ default: '',
37
+ },
38
+ jurisdiction: {
39
+ type: String,
40
+ default: '',
41
+ },
42
+ })
49
43
  </script>
50
-
@@ -1,132 +1,109 @@
1
1
  <template>
2
2
  <button
3
- @click="onClick()"
3
+ @click="onClick()"
4
4
  @mouseenter="onMouseEnter"
5
- @mouseleave="onMouseLeave"
6
- class="psui-el-button"
7
- :class="[getComponentClass, {'hover': isHover}, {'disabled': disabled || loading }]"
5
+ @mouseleave="onMouseLeave"
6
+ class="psui-el-button"
7
+ :class="[getComponentClass, { hover: isHover }, { disabled: disabled || loading }]"
8
8
  >
9
- <svg
10
- v-if="loading"
9
+ <svg
10
+ v-if="loading"
11
11
  class="psui-animate-spin psui-mr-3 psui-h-5 psui-w-5 psui-text-black"
12
12
  :class="`${iconPosition == 'left' ? 'psui-mr-3' : 'psui-ml-3 psui--mr-1'}`"
13
- xmlns="http://www.w3.org/2000/svg"
14
- fill="none"
15
- viewBox="0 0 24 24"
13
+ xmlns="http://www.w3.org/2000/svg"
14
+ fill="none"
15
+ viewBox="0 0 24 24"
16
16
  >
17
- <circle
18
- class="psui-opacity-25"
19
- cx="12"
20
- cy="12"
21
- r="10"
22
- stroke="currentColor"
23
- stroke-width="4"
17
+ <circle
18
+ class="psui-opacity-25"
19
+ cx="12"
20
+ cy="12"
21
+ r="10"
22
+ stroke="currentColor"
23
+ stroke-width="4"
24
24
  />
25
- <path
26
- class="psui-opacity-75"
27
- fill="currentColor"
28
- d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
25
+ <path
26
+ class="psui-opacity-75"
27
+ fill="currentColor"
28
+ d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
29
29
  />
30
30
  </svg>
31
- <i
32
- v-else-if="icon"
33
- :class="iconClass"
34
- class="material-icons-round"
31
+ <i
32
+ v-else-if="icon"
33
+ :class="iconClass"
34
+ class="material-icons-round"
35
35
  >{{ icon }}</i>
36
36
  <span v-if="label">{{ label }}</span>
37
37
  </button>
38
38
  </template>
39
39
 
40
- <script>
41
- export default {
42
- props: {
43
- /**
44
- * It set de label of the button when component is rendered.
45
- */
46
- label: {
47
- type: String,
48
- },
49
- /**
50
- * It set the layout of the button. eg: solid, outline, ghost, onlytext and caution.
51
- */
52
- layout: {
53
- type: String,
54
- default: 'solid',
55
- validator: (value) => ['solid','outline','ghost','onlytext','caution'].includes(value)
56
- },
57
- /**
58
- * 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/.
59
- */
60
- icon: {
61
- type: String,
62
- },
63
- /**
64
- * It sets the position of the icon. eg: left or right.
65
- */
66
- iconPosition:{
67
- type: String,
68
- default: 'left',
69
- validator: (value) => ['left','right'].includes(value)
70
- },
71
- /**
72
- * It sets the size of the icon. eg: small, medium and big.
73
- */
74
- size: {
75
- type: String,
76
- default: 'big',
77
- validator: (value) => ['small','medium','big'].includes(value)
78
- },
79
- /**
80
- * It disable the button. All mouse event are disabled.
81
- */
82
- disabled: {
83
- type: Boolean,
84
- default: false
85
- },
86
- /**
87
- * It disable and add a spin icon to the button. All mouse event are disabled.
88
- */
89
- loading: {
90
- type: Boolean,
91
- default: false
92
- },
93
- /**
94
- * It set any further css style that might be needed.
95
- */
96
- iconClass:{
97
- type: String
98
- }
40
+ <script setup>
41
+ import { computed, ref, } from 'vue'
42
+
43
+ const isHover = ref(false)
44
+
45
+ const emit = defineEmits(['click'])
46
+
47
+ const props = defineProps({
48
+ label: {
49
+ type: String,
50
+ default: '',
51
+ },
52
+ layout: {
53
+ type: String,
54
+ default: 'solid',
55
+ validator: (value) => ['solid', 'outline', 'ghost', 'onlytext', 'caution'].includes(value),
56
+ },
57
+ icon: {
58
+ type: String,
59
+ default: '',
99
60
  },
100
- data(){
101
- return {
102
- isHover: false,
103
- }
61
+ iconPosition: {
62
+ type: String,
63
+ default: 'left',
64
+ validator: (value) => ['left', 'right'].includes(value),
104
65
  },
105
- computed: {
106
- getComponentClass(){
107
- if(this.icon){
108
- return `layout-${this.layout} size-${this.size} icon-${this.iconPosition}`
109
- } else {
110
- return `layout-${this.layout} size-${this.size}`
111
- }
112
- },
66
+ size: {
67
+ type: String,
68
+ default: 'big',
69
+ validator: (value) => ['small', 'medium', 'big'].includes(value),
113
70
  },
114
- methods: {
115
- onClick() {
116
- if (this.disabled) return
117
- this.$emit('click')
118
- },
119
- onMouseEnter(){
120
- if(!this.disabled){
121
- this.isHover = true
122
- }
123
- },
124
- onMouseLeave(){
125
- if(!this.disabled){
126
- this.isHover = false
127
- }
128
- }
71
+ disabled: {
72
+ type: Boolean,
73
+ default: false,
74
+ },
75
+ loading: {
76
+ type: Boolean,
77
+ default: false,
78
+ },
79
+ iconClass: {
80
+ type: String,
81
+ default: '',
82
+ },
83
+ })
84
+
85
+ const getComponentClass = computed(() => {
86
+ if (props.icon) {
87
+ return `layout-${props.layout} size-${props.size} icon-${props.iconPosition}`
88
+ } else {
89
+ return `layout-${props.layout} size-${props.size}`
90
+ }
91
+ })
92
+
93
+ const onClick = () => {
94
+ if (props.disabled) return
95
+ emit('click')
96
+ }
97
+
98
+ const onMouseEnter = () => {
99
+ if (!props.disabled) {
100
+ isHover.value = true
129
101
  }
130
102
  }
131
- </script>
132
103
 
104
+ const onMouseLeave = () => {
105
+ if (!props.disabled) {
106
+ isHover.value = false
107
+ }
108
+ }
109
+ </script>