@policystudio/policy-studio-ui-vue 1.1.90-beta.0 → 1.1.90-beta.12

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 (166) hide show
  1. package/.eslintrc.js +12 -8
  2. package/.storybook/PolicyStudio.ts +11 -0
  3. package/.storybook/manager.ts +7 -0
  4. package/dist/contents/ComparisonData.js +376 -0
  5. package/dist/contents/ComparisonData.js.map +1 -0
  6. package/dist/contents/FlexibleData.js +501 -0
  7. package/dist/contents/FlexibleData.js.map +1 -0
  8. package/dist/contents/ResultsData.js +530 -0
  9. package/dist/contents/ResultsData.js.map +1 -0
  10. package/dist/css/psui_styles.css +4035 -110277
  11. package/dist/index.js +114 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/stories/Accordion.stories.js +56 -0
  14. package/dist/stories/Accordion.stories.js.map +1 -0
  15. package/dist/stories/BadgeWithIcon.stories.js +28 -0
  16. package/dist/stories/BadgeWithIcon.stories.js.map +1 -0
  17. package/dist/stories/BarChart.stories.js +16 -0
  18. package/dist/stories/BarChart.stories.js.map +1 -0
  19. package/dist/stories/Breadcrumb.stories.js +21 -0
  20. package/dist/stories/Breadcrumb.stories.js.map +1 -0
  21. package/dist/stories/Button.stories.js +44 -0
  22. package/dist/stories/Button.stories.js.map +1 -0
  23. package/dist/stories/CardInfos.stories.js +13 -0
  24. package/dist/stories/CardInfos.stories.js.map +1 -0
  25. package/dist/stories/ChartLegend.stories.js +13 -0
  26. package/dist/stories/ChartLegend.stories.js.map +1 -0
  27. package/dist/stories/Checkbox.stories.js +44 -0
  28. package/dist/stories/Checkbox.stories.js.map +1 -0
  29. package/dist/stories/CheckboxSimple.stories.js +48 -0
  30. package/dist/stories/CheckboxSimple.stories.js.map +1 -0
  31. package/dist/stories/Chips.stories.js +27 -0
  32. package/dist/stories/Chips.stories.js.map +1 -0
  33. package/dist/stories/ClimateZoneBadge.stories.js +15 -0
  34. package/dist/stories/ClimateZoneBadge.stories.js.map +1 -0
  35. package/dist/stories/CostEffectBar.stories.js +21 -0
  36. package/dist/stories/CostEffectBar.stories.js.map +1 -0
  37. package/dist/stories/Datatable.stories.js +45 -0
  38. package/dist/stories/Datatable.stories.js.map +1 -0
  39. package/dist/stories/DateCardInfo.stories.js +18 -0
  40. package/dist/stories/DateCardInfo.stories.js.map +1 -0
  41. package/dist/stories/Dialog.stories.js +127 -0
  42. package/dist/stories/Dialog.stories.js.map +1 -0
  43. package/dist/stories/Draggable.stories.js +20 -0
  44. package/dist/stories/Draggable.stories.js.map +1 -0
  45. package/dist/stories/Dropdown.stories.js +98 -0
  46. package/dist/stories/Dropdown.stories.js.map +1 -0
  47. package/dist/stories/DropdownList.stories.js +208 -0
  48. package/dist/stories/DropdownList.stories.js.map +1 -0
  49. package/dist/stories/Header.stories.js +39 -0
  50. package/dist/stories/Header.stories.js.map +1 -0
  51. package/dist/stories/HighlightRippleDot.stories.js +13 -0
  52. package/dist/stories/HighlightRippleDot.stories.js.map +1 -0
  53. package/dist/stories/Icon.stories.js +19 -0
  54. package/dist/stories/Icon.stories.js.map +1 -0
  55. package/dist/stories/InlineSelector.stories.js +16 -0
  56. package/dist/stories/InlineSelector.stories.js.map +1 -0
  57. package/dist/stories/Input.stories.js +235 -0
  58. package/dist/stories/Input.stories.js.map +1 -0
  59. package/dist/stories/InputSelect.stories.js +28 -0
  60. package/dist/stories/InputSelect.stories.js.map +1 -0
  61. package/dist/stories/InputTextArea.stories.js +23 -0
  62. package/dist/stories/InputTextArea.stories.js.map +1 -0
  63. package/dist/stories/MiniTag.stories.js +44 -0
  64. package/dist/stories/MiniTag.stories.js.map +1 -0
  65. package/dist/stories/Playground.stories.js +14 -0
  66. package/dist/stories/Playground.stories.js.map +1 -0
  67. package/dist/stories/ProgressBar.stories.js +21 -0
  68. package/dist/stories/ProgressBar.stories.js.map +1 -0
  69. package/dist/stories/RadioButton.stories.js +36 -0
  70. package/dist/stories/RadioButton.stories.js.map +1 -0
  71. package/dist/stories/RadioButtonSimple.stories.js +40 -0
  72. package/dist/stories/RadioButtonSimple.stories.js.map +1 -0
  73. package/dist/stories/SimpleAlert.stories.js +19 -0
  74. package/dist/stories/SimpleAlert.stories.js.map +1 -0
  75. package/dist/stories/Slider.stories.js +70 -0
  76. package/dist/stories/Slider.stories.js.map +1 -0
  77. package/dist/stories/Switch.stories.js +35 -0
  78. package/dist/stories/Switch.stories.js.map +1 -0
  79. package/dist/stories/TabHeader.stories.js +48 -0
  80. package/dist/stories/TabHeader.stories.js.map +1 -0
  81. package/dist/stories/TableResults.stories.js +717 -0
  82. package/dist/stories/TableResults.stories.js.map +1 -0
  83. package/dist/stories/TagScope.stories.js +16 -0
  84. package/dist/stories/TagScope.stories.js.map +1 -0
  85. package/dist/stories/TestimonialCard.stories.js +24 -0
  86. package/dist/stories/TestimonialCard.stories.js.map +1 -0
  87. package/dist/stories/Toast.stories.js +51 -0
  88. package/dist/stories/Toast.stories.js.map +1 -0
  89. package/dist/stories/Toggle.stories.js +42 -0
  90. package/dist/stories/Toggle.stories.js.map +1 -0
  91. package/dist/stories/Tooltip.stories.js +108 -0
  92. package/dist/stories/Tooltip.stories.js.map +1 -0
  93. package/dist/util/GeneralFunctions.js +29 -0
  94. package/dist/util/GeneralFunctions.js.map +1 -0
  95. package/dist/util/imageLoader.js +52 -0
  96. package/dist/util/imageLoader.js.map +1 -0
  97. package/package.json +25 -22
  98. package/postcss.config.js +1 -1
  99. package/src/App.vue +30 -0
  100. package/src/assets/scss/base.scss +27 -23
  101. package/src/assets/scss/components/PsAccordion.scss +1 -1
  102. package/src/assets/scss/components/PsChips.scss +3 -3
  103. package/src/assets/scss/components/PsCostEffectBar.scss +4 -4
  104. package/src/assets/scss/components/PsProgressBar.scss +4 -4
  105. package/src/assets/scss/components/PsTabHeader.scss +1 -1
  106. package/src/assets/scss/components/PsTableResults.scss +1 -1
  107. package/src/assets/scss/components/PsTestimonialCard.scss +1 -1
  108. package/src/components/badges-and-tags/PsBadgeWithIcon.vue +2 -1
  109. package/src/components/badges-and-tags/PsProgressBar.vue +1 -1
  110. package/src/components/buttons/PsButton.vue +74 -96
  111. package/src/{index.js → index.ts} +4 -0
  112. package/src/shims-vue.d.ts +11 -0
  113. package/src/stories/{Accordion.stories.js → Accordion.stories.ts} +2 -2
  114. package/src/stories/{BadgeWithIcon.stories.js → BadgeWithIcon.stories.ts} +1 -1
  115. package/src/stories/{BarChart.stories.js → BarChart.stories.ts} +1 -1
  116. package/src/stories/{Breadcrumb.stories.js → Breadcrumb.stories.ts} +1 -4
  117. package/src/stories/{CardInfos.stories.js → CardInfos.stories.ts} +1 -2
  118. package/src/stories/{ChartLegend.stories.js → ChartLegend.stories.ts} +1 -2
  119. package/src/stories/{Checkbox.stories.js → Checkbox.stories.ts} +1 -1
  120. package/src/stories/{CheckboxSimple.stories.js → CheckboxSimple.stories.ts} +1 -1
  121. package/src/stories/{Chips.stories.js → Chips.stories.ts} +24 -22
  122. package/src/stories/{ClimateZoneBadge.stories.js → ClimateZoneBadge.stories.ts} +2 -1
  123. package/src/stories/{CostEffectBar.stories.js → CostEffectBar.stories.ts} +2 -1
  124. package/src/stories/{Datatable.stories.js → Datatable.stories.ts} +5 -2
  125. package/src/stories/{DateCardInfo.stories.js → DateCardInfo.stories.ts} +1 -5
  126. package/src/stories/{Dialog.stories.js → Dialog.stories.ts} +1 -1
  127. package/src/stories/{Draggable.stories.js → Draggable.stories.ts} +2 -1
  128. package/src/stories/{Dropdown.stories.js → Dropdown.stories.ts} +2 -1
  129. package/src/stories/{DropdownList.stories.js → DropdownList.stories.ts} +3 -1
  130. package/src/stories/{Header.stories.js → Header.stories.ts} +1 -0
  131. package/src/stories/{HighlightRippleDot.stories.js → HighlightRippleDot.stories.ts} +2 -1
  132. package/src/stories/{Icon.stories.js → Icon.stories.ts} +2 -0
  133. package/src/stories/{InlineSelector.stories.js → InlineSelector.stories.ts} +1 -1
  134. package/src/stories/{Input.stories.js → Input.stories.ts} +6 -3
  135. package/src/stories/{InputSelect.stories.js → InputSelect.stories.ts} +2 -1
  136. package/src/stories/{InputTextArea.stories.js → InputTextArea.stories.ts} +1 -1
  137. package/src/stories/{MiniTag.stories.js → MiniTag.stories.ts} +8 -1
  138. package/src/stories/{Playground.stories.js → Playground.stories.ts} +1 -1
  139. package/src/stories/{ProgressBar.stories.js → ProgressBar.stories.ts} +2 -1
  140. package/src/stories/{RadioButton.stories.js → RadioButton.stories.ts} +1 -1
  141. package/src/stories/{RadioButtonSimple.stories.js → RadioButtonSimple.stories.ts} +1 -1
  142. package/src/stories/{SimpleAlert.stories.js → SimpleAlert.stories.ts} +2 -1
  143. package/src/stories/{Slider.stories.js → Slider.stories.ts} +5 -1
  144. package/src/stories/{Switch.stories.js → Switch.stories.ts} +1 -1
  145. package/src/stories/{TabHeader.stories.js → TabHeader.stories.ts} +5 -0
  146. package/src/stories/{TableResults.stories.js → TableResults.stories.ts} +5 -1
  147. package/src/stories/{TagScope.stories.js → TagScope.stories.ts} +1 -1
  148. package/src/stories/{TestimonialCard.stories.js → TestimonialCard.stories.ts} +2 -2
  149. package/src/stories/{Toast.stories.js → Toast.stories.ts} +1 -1
  150. package/src/stories/{Toggle.stories.js → Toggle.stories.ts} +6 -3
  151. package/src/stories/{Tooltip.stories.js → Tooltip.stories.ts} +3 -3
  152. package/src/util/{GeneralFunctions.js → GeneralFunctions.ts} +7 -6
  153. package/src/util/{imageLoader.js → imageLoader.ts} +15 -7
  154. package/tailwind.config.js +11 -2
  155. package/tsconfig.json +47 -0
  156. package/webpack.config.js +17 -3
  157. package/.storybook/PolicyStudio.js +0 -10
  158. package/.storybook/manager.js +0 -6
  159. package/babel.config.js +0 -17
  160. /package/.storybook/{eventBus.js → eventBus.ts} +0 -0
  161. /package/.storybook/{main.js → main.ts} +0 -0
  162. /package/.storybook/{preview.js → preview.ts} +0 -0
  163. /package/src/contents/{ComparisonData.js → ComparisonData.ts} +0 -0
  164. /package/src/contents/{FlexibleData.js → FlexibleData.ts} +0 -0
  165. /package/src/contents/{ResultsData.js → ResultsData.ts} +0 -0
  166. /package/src/stories/{Button.stories.js → Button.stories.ts} +0 -0
@@ -1,10 +1,10 @@
1
1
  @layer components {
2
2
  .psui-el-progress-bar {
3
- @apply .psui-relative .psui-h-2 .psui-rounded-full .psui-bg-red-10;
3
+ @apply psui-relative psui-h-2 psui-rounded-full psui-bg-red-10;
4
4
  width: 100px;
5
5
 
6
6
  &.is-breakeven {
7
- @apply .psui-bg-blue-20;
7
+ @apply psui-bg-blue-20;
8
8
  }
9
9
 
10
10
  &-percentage {
@@ -16,13 +16,13 @@
16
16
  }
17
17
 
18
18
  &-divider {
19
- @apply .psui-absolute .psui-rounded-full .psui-z-auto .psui-bg-gray-30;
19
+ @apply psui-absolute psui-rounded-full psui-z-auto psui-bg-gray-30;
20
20
  width: 2px; height: 14px;
21
21
  top: -3px;
22
22
  }
23
23
 
24
24
  &-value {
25
- @apply .psui-h-2 .psui-rounded-tl-full .psui-rounded-bl-full;
25
+ @apply psui-h-2 psui-rounded-tl-full psui-rounded-bl-full;
26
26
  }
27
27
 
28
28
  @keyframes animate-stripes {
@@ -6,7 +6,7 @@
6
6
  button {
7
7
  @apply transition-default psui-text-small;
8
8
  &.status-disabled {
9
- @apply cursor-not-allowed;
9
+ @apply psui-cursor-not-allowed;
10
10
  }
11
11
 
12
12
  &:focus {
@@ -1,6 +1,6 @@
1
1
  @layer components{
2
2
  .psui-el-table-results-wrapper {
3
- @apply psui-w-full psui-whitespace-no-wrap psui-flex psui-overflow-auto;
3
+ @apply psui-w-full psui-whitespace-nowrap psui-flex psui-overflow-auto;
4
4
 
5
5
  &.table-flexible {
6
6
  @apply psui-pr-4;
@@ -1,6 +1,6 @@
1
1
  @layer components {
2
2
  .psui-el-testimonial {
3
- @apply psui-relative psui-bg-white psui-shadow-elevation-5 psui-flex psui-flex-col psui-rounded-lg w-full;
3
+ @apply psui-relative psui-bg-white psui-shadow-elevation-5 psui-flex psui-flex-col psui-rounded-lg psui-w-full;
4
4
  padding: 56px 42px 40px 32px;
5
5
 
6
6
  &-icon {
@@ -24,7 +24,8 @@
24
24
  * It set any further css style that might be needed.
25
25
  */
26
26
  iconClass: {
27
- type: String
27
+ type: String,
28
+ default:''
28
29
  },
29
30
  message: {
30
31
  type: String,
@@ -38,7 +38,7 @@ export default {
38
38
  default: 1
39
39
  },
40
40
  forceBreakEven: {
41
- Boolean,
41
+ type: Boolean,
42
42
  default: false
43
43
  },
44
44
  value: {
@@ -6,127 +6,105 @@
6
6
  class="psui-el-button"
7
7
  :class="[getComponentClass, {'hover': isHover}, {'disabled': disabled || loading }]"
8
8
  >
9
- <svg
9
+ <svg
10
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
- */
40
+ <script setup lang="ts">
41
+ import { PropType, computed, ref } from 'vue'
42
+
43
+ const isHover = ref(false)
44
+
45
+ const emit = defineEmits(['click'])
46
+
47
+ const props = defineProps({
46
48
  label: {
47
49
  type: String,
50
+ default: ''
48
51
  },
49
- /**
50
- * It set the layout of the button. eg: solid, outline, ghost, onlytext and caution.
51
- */
52
- layout: {
53
- type: String,
52
+ layout:{
53
+ type: String as PropType<'solid' | 'outline' | 'ghost' | 'onlytext' | 'caution'>,
54
54
  default: 'solid',
55
- validator: (value) => ['solid','outline','ghost','onlytext','caution'].includes(value)
55
+ validator: (value:string) => ['solid','outline','ghost','onlytext','caution'].includes(value)
56
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
57
  icon: {
61
58
  type: String,
59
+ default: ''
62
60
  },
63
- /**
64
- * It sets the position of the icon. eg: left or right.
65
- */
66
- iconPosition:{
61
+ iconPosition: {
67
62
  type: String,
68
63
  default: 'left',
69
- validator: (value) => ['left','right'].includes(value)
64
+ validator: (value:string) => ['left','right'].includes(value)
70
65
  },
71
- /**
72
- * It sets the size of the icon. eg: small, medium and big.
73
- */
74
66
  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
- }
99
- },
100
- data(){
101
- return {
102
- isHover: false,
103
- }
104
- },
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
- },
113
- },
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
- }
67
+ type: String,
68
+ default: 'big',
69
+ validator: (value:string) => ['small','medium','big'].includes(value)
70
+ },
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
+ const onMouseEnter = () => {
98
+ if(!props.disabled){
99
+ isHover.value = true
100
+ }
101
+ }
102
+
103
+ const onMouseLeave = () => {
104
+ if(!props.disabled){
105
+ isHover.value = false
128
106
  }
129
107
  }
130
- }
108
+
131
109
  </script>
132
110
 
@@ -50,6 +50,7 @@ import PsBreadcrumb from './components/navigations/PsBreadcrumb.vue'
50
50
 
51
51
 
52
52
  export default {
53
+ // @ts-ignore
53
54
  install(Vue) {
54
55
  Vue.component('PsButton', PsButton)
55
56
  Vue.component('PsCheckbox', PsCheckbox)
@@ -99,7 +100,9 @@ export default {
99
100
 
100
101
 
101
102
  Vue.directive('click-outside', {
103
+ // @ts-ignore
102
104
  bind: function (el, binding, vnode) {
105
+ // @ts-ignore
103
106
  el.clickOutsideEvent = function (event) {
104
107
  // here I check that click was outside the el and his children
105
108
  if (!(el == event.target || el.contains(event.target))) {
@@ -109,6 +112,7 @@ export default {
109
112
  }
110
113
  document.body.addEventListener('click', el.clickOutsideEvent)
111
114
  },
115
+ // @ts-ignore
112
116
  unbind: function (el) {
113
117
  document.body.removeEventListener('click', el.clickOutsideEvent)
114
118
  },
@@ -0,0 +1,11 @@
1
+ /* eslint-disable */
2
+ declare module '*.vue' {
3
+ import type { DefineComponent } from 'vue'
4
+ const component: DefineComponent<{}, {}, any>
5
+ export default component
6
+ }
7
+
8
+ declare module '*.svg' {
9
+ const content: string;
10
+ export default content;
11
+ }
@@ -8,8 +8,8 @@ export default {
8
8
  }
9
9
 
10
10
 
11
- export const Index = (args, { argTypes }) => ({
12
- props: Object.keys(argTypes, args),
11
+ export const Index = (args:any, { argTypes }: { argTypes:any }) => ({
12
+ props: Object.keys({argTypes, args}),
13
13
  components: { PsAccordion, PsAccordionItem },
14
14
  template:
15
15
  `
@@ -7,7 +7,7 @@ export default {
7
7
  },
8
8
  }
9
9
 
10
- const TemplateDefault = (args, {argTypes})=>({
10
+ const TemplateDefault = (args:any, {argTypes}:{argTypes:any})=>({
11
11
  props: Object.keys(argTypes),
12
12
  components:{PsBadgeWithIcon},
13
13
  template: `
@@ -4,7 +4,7 @@ export default {
4
4
  component: PsBarChart,
5
5
  }
6
6
 
7
- const defaultTemplate = (args, {argTypes}) => ({
7
+ const defaultTemplate = (args:any, {argTypes}:{argTypes:any}) => ({
8
8
  props: Object.keys(argTypes),
9
9
  components: { PsBarChart },
10
10
  template: `
@@ -11,7 +11,7 @@ const items = [
11
11
  { title: '4th level', route: '' },
12
12
  ]
13
13
 
14
- const Template = (args, { argTypes }) => ({
14
+ const Template = (args:any, { argTypes }:{argTypes:any}) => ({
15
15
  props: Object.keys(argTypes),
16
16
  components: { PsBreadcrumb },
17
17
  template: `
@@ -20,6 +20,3 @@ const Template = (args, { argTypes }) => ({
20
20
  })
21
21
 
22
22
  export const Default = Template.bind({})
23
- Default.args = {
24
- items: items,
25
- }
@@ -6,11 +6,10 @@ export default {
6
6
  argTypes: {},
7
7
  }
8
8
 
9
- const Template = (args, { argTypes }) => ({
9
+ const Template = (args:any, { argTypes }:{ argTypes:any }) => ({
10
10
  props: Object.keys(argTypes),
11
11
  components: { PsCardInfos },
12
12
  template: '<PsCardInfos v-bind="$props" />',
13
13
  })
14
14
 
15
15
  export const CardInfos = Template.bind({})
16
- CardInfos.args = {}
@@ -6,11 +6,10 @@ export default {
6
6
  argTypes: {},
7
7
  }
8
8
 
9
- const Template = (args, { argTypes }) => ({
9
+ const Template = (args:any, { argTypes } : { argTypes:any }) => ({
10
10
  props: Object.keys(argTypes),
11
11
  components: { PsChartLegend },
12
12
  template: '<PsChartLegend v-bind="$props" />',
13
13
  })
14
14
 
15
15
  export const ChartLegend = Template.bind({})
16
- ChartLegend.args = {}
@@ -5,7 +5,7 @@ export default {
5
5
  component: PsCheckbox,
6
6
  }
7
7
 
8
- const defaultTemplate = (args, {argTypes}) => ({
8
+ const defaultTemplate = (args:any, {argTypes}:{argTypes:any}) => ({
9
9
  props: Object.keys(argTypes),
10
10
  components: { PsCheckbox},
11
11
  template: `
@@ -5,7 +5,7 @@ export default {
5
5
  component: PsCheckboxSimple,
6
6
  }
7
7
 
8
- const defaultTemplate = (args, {argTypes}) => ({
8
+ const defaultTemplate = (args:any, {argTypes}:{argTypes:any}) => ({
9
9
  props: Object.keys(argTypes),
10
10
  components: { PsCheckboxSimple },
11
11
  data: () => ({
@@ -1,31 +1,33 @@
1
1
  import PsChips from '../components/chips/PsChips.vue'
2
+ import type { Meta, StoryObj } from '@storybook/vue3'
2
3
 
3
- export default {
4
- title: 'Components/Chips',
5
- component: PsChips,
4
+ import * as HeaderStories from '../stories/Header.stories'
5
+
6
+ const meta: Meta<typeof PsChips> = {
7
+ component: PsChips
6
8
  }
7
9
 
8
- const Template = (args, { argTypes }) => ({
9
- props: Object.keys(argTypes),
10
- components: { PsChips },
11
- data: ()=>{
12
- return{
13
- isChecked: true,
14
- isCheckedTwo: null,
15
- }
16
- },
17
- template: `<div style="display:flex; gap: 10px;">
18
- <PsChips v-bind='$props' type="button" @update:checked='isChecked = $event' :checked='isChecked'/>
10
+ export default meta
11
+
12
+ type Story = StoryObj<typeof PsChips>
13
+
14
+ export const Primary: Story = {
15
+ render: (args) => ({
16
+ components: { PsChips },
17
+ setup(){
18
+ return { args }
19
+ },
20
+ template: `<div style="display:flex; gap: 10px;">
19
21
  <PsChips v-bind='$props' label="Simple chips with icons" type="button" layout="with-icon" icon="home" @update:checked='isChecked = $event' :checked='isChecked'/>
20
22
  <PsChips v-bind='$props' label="Radio chips" type="radio" @update:checked='isChecked = $event' :checked='isChecked'/>
21
23
  <PsChips v-bind='$props' label="Checkbox chips" type="checkbox" @update:checked='isCheckedTwo = $event' :checked='isCheckedTwo'/>
22
24
  <PsChips v-bind='$props' label="Rich chips" type="button" layout="rich" icon="text_snippet" @update:checked='isChecked = $event' :checked='isChecked'/>
23
25
  </div>
24
- `
25
- })
26
-
27
- export const Default = Template.bind({})
28
- Default.args = {
29
- label: 'Simple Chip',
30
- icon:'',
31
- }
26
+ `,
27
+ args:{
28
+ label: 'Simple Chip',
29
+ icon:'',
30
+ ...HeaderStories.LoggedIn.args
31
+ }
32
+ })
33
+ }
@@ -5,13 +5,14 @@ export default {
5
5
  component: PsClimateZoneBadge,
6
6
  }
7
7
 
8
- const Template = (args, { argTypes }) => ({
8
+ const Template = (args:any, { argTypes }:{ argTypes:any }) => ({
9
9
  props: Object.keys(argTypes),
10
10
  components: { PsClimateZoneBadge },
11
11
  template: '<PsClimateZoneBadge v-bind="$props" />',
12
12
  })
13
13
 
14
14
  export const ClimateZoneBadge = Template.bind({})
15
+ // @ts-ignore
15
16
  ClimateZoneBadge.args = {
16
17
  icon: 'area_chart',
17
18
  }
@@ -13,11 +13,12 @@ export default {
13
13
  },
14
14
  }
15
15
 
16
- const Template = (args, { argTypes }) => ({
16
+ const Template = (args:any, { argTypes }:{ argTypes:any }) => ({
17
17
  props: Object.keys(argTypes),
18
18
  components: { PsCostEffectBar },
19
19
  template: '<PsCostEffectBar v-bind="$props" />',
20
20
  })
21
21
 
22
22
  export const SimpleProgressBar = Template.bind({})
23
+ // @ts-ignore
23
24
  SimpleProgressBar.args = {}
@@ -1,3 +1,4 @@
1
+ // @ts-ignore
1
2
  import PsDataTable, { alignment } from '../components/datatable/PsDataTable.vue'
2
3
  import PsDataTableItem from '../components/datatable/PsDataTableItem.vue'
3
4
 
@@ -10,7 +11,7 @@ export default {
10
11
  }
11
12
  }
12
13
 
13
- const Template = (args, { argTypes }) => ({
14
+ const Template = (args:any, { argTypes }:{ argTypes:any }) => ({
14
15
  props: Object.keys(argTypes),
15
16
  components: {PsDataTable},
16
17
  template: `
@@ -20,7 +21,7 @@ const Template = (args, { argTypes }) => ({
20
21
  `
21
22
  })
22
23
 
23
- const RichTemplate = (args, { argTypes } ) => ({
24
+ const RichTemplate = (args:any, { argTypes }:{ argTypes:any } ) => ({
24
25
  props: Object.keys(argTypes),
25
26
  components: {PsDataTable, PsDataTableItem},
26
27
  template: `
@@ -34,6 +35,7 @@ const RichTemplate = (args, { argTypes } ) => ({
34
35
 
35
36
 
36
37
  export const Simple = Template.bind({})
38
+ // @ts-ignore
37
39
  Simple.args = {
38
40
  header: ['year', 'month', 'sale'],
39
41
  data: [{ year: '1992', month: '12', sale: '1000.00' }, { year: '1989', month: '02', sale: '1200.00' }],
@@ -42,6 +44,7 @@ Simple.args = {
42
44
  }
43
45
 
44
46
  export const Rich = RichTemplate.bind({})
47
+ // @ts-ignore
45
48
  Rich.args = {
46
49
  header: ['header 1', 'header 2', 'header 3'],
47
50
  data:[[ [ 20, -3], [ 20, 2], [ 20, 2] ], { header4: { value: 20, delta: 2}, header5: { value: 20, delta: 2}, header6: { value: 20, delta: 2} }],
@@ -5,7 +5,7 @@ export default {
5
5
  component: PsDateCardInfo,
6
6
  }
7
7
 
8
- const Template = (args,{argTypes}) => ({
8
+ const Template = (args:any, {argTypes}:{argTypes:any}) => ({
9
9
  props: Object.keys(argTypes),
10
10
  components:{PsDateCardInfo},
11
11
  template: `
@@ -18,7 +18,3 @@ export default {
18
18
  })
19
19
 
20
20
  export const Default = Template.bind({})
21
-
22
- Default.args = {
23
- date: '2021/02/23'
24
- }
@@ -4,7 +4,7 @@ export default {
4
4
  title: 'Notifications/Dialog',
5
5
  component: PsDialog,
6
6
  }
7
-
7
+ // @ts-ignore
8
8
  const TemplateExamples = (args, { argTypes }) => ({
9
9
  props: Object.keys(argTypes),
10
10
  components: { PsDialog },
@@ -4,7 +4,7 @@ export default {
4
4
  title: 'Controls & Selectors/Draggable',
5
5
  component: PsDraggable
6
6
  }
7
-
7
+ // @ts-ignore
8
8
  const Template = (args, {argTypes}) => ({
9
9
  props: Object.keys(argTypes),
10
10
  components: { PsDraggable },
@@ -16,6 +16,7 @@ const Template = (args, {argTypes}) => ({
16
16
  })
17
17
 
18
18
  export const Component = Template.bind({})
19
+ // @ts-ignore
19
20
  Component.args = {
20
21
  getColumns: {columnGroups:[{title: 'COST EFFECTIVENESS', columns: [ 'Item 1' , 'Item 2' , 'Item 3', 'Item 4']}, {title: 'PER HOME RESULTS', columns: [ 'Item 1' , 'Item 2' , 'Item 3', 'Item 4']}]},
21
22
  module: 'comparison'
@@ -4,7 +4,7 @@ export default {
4
4
  title: 'Components/Dropdown',
5
5
  component: { PsDropdown, PsDropdownList },
6
6
  }
7
-
7
+ // @ts-ignore
8
8
  const Template = (args, { argTypes }) => ({
9
9
  props: Object.keys(argTypes),
10
10
  components: { PsDropdown, PsDropdownList },
@@ -87,6 +87,7 @@ const Template = (args, { argTypes }) => ({
87
87
  })
88
88
 
89
89
  export const DropdownMenu = Template.bind({})
90
+ // @ts-ignore
90
91
  DropdownMenu.args = {
91
92
  items: [
92
93
  'Selectable option 01',
@@ -1,3 +1,4 @@
1
+ // @ts-ignore
1
2
  import PsDropdownList, { itemStyle } from '../components/forms/PsDropdownList.vue'
2
3
  export default {
3
4
  title: 'Components/Dropdown/Dropdown List',
@@ -17,7 +18,7 @@ export default {
17
18
  }
18
19
  }
19
20
  }
20
-
21
+ // @ts-ignore
21
22
  const Template = (args, { argTypes }) => ({
22
23
  props: Object.keys(argTypes),
23
24
  components: { PsDropdownList },
@@ -205,6 +206,7 @@ const studyData = {
205
206
  }
206
207
 
207
208
  export const DropdownList = Template.bind({})
209
+ // @ts-ignore
208
210
  DropdownList.args = {
209
211
  items: onlyTextItems,
210
212
  study_data: studyData,
@@ -5,6 +5,7 @@ export default {
5
5
  component: MyHeader,
6
6
  // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
7
7
  tags: ['autodocs'],
8
+ // @ts-ignore
8
9
  render: (args) => ({
9
10
  // Components used in your story `template` are defined in the `components` object
10
11
  components: {
@@ -4,7 +4,7 @@ export default {
4
4
  title: 'Badges & Tags/Badges/HighlightRippleDot',
5
5
  component: PsHighlightRippleDot,
6
6
  }
7
-
7
+ // @ts-ignore
8
8
  const Template = (args, { argTypes }) => ({
9
9
  props: Object.keys(argTypes),
10
10
  components: { PsHighlightRippleDot },
@@ -12,4 +12,5 @@ const Template = (args, { argTypes }) => ({
12
12
  })
13
13
 
14
14
  export const HighlightRippleDot = Template.bind({})
15
+ // @ts-ignore
15
16
  HighlightRippleDot.args = {}