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

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 (77) 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/css/psui_styles.css +4035 -110277
  5. package/package.json +25 -22
  6. package/postcss.config.js +1 -1
  7. package/src/App.vue +30 -0
  8. package/src/assets/scss/base.scss +27 -23
  9. package/src/assets/scss/components/PsAccordion.scss +1 -1
  10. package/src/assets/scss/components/PsChips.scss +3 -3
  11. package/src/assets/scss/components/PsCostEffectBar.scss +4 -4
  12. package/src/assets/scss/components/PsProgressBar.scss +4 -4
  13. package/src/assets/scss/components/PsTabHeader.scss +1 -1
  14. package/src/assets/scss/components/PsTableResults.scss +1 -1
  15. package/src/assets/scss/components/PsTestimonialCard.scss +1 -1
  16. package/src/components/badges-and-tags/PsBadgeWithIcon.vue +2 -1
  17. package/src/components/badges-and-tags/PsProgressBar.vue +1 -1
  18. package/src/components/buttons/PsButton.vue +74 -96
  19. package/src/{index.js → index.ts} +4 -4
  20. package/src/shims-vue.d.ts +11 -0
  21. package/src/stories/{Accordion.stories.js → Accordion.stories.ts} +2 -2
  22. package/src/stories/{BadgeWithIcon.stories.js → BadgeWithIcon.stories.ts} +1 -1
  23. package/src/stories/{BarChart.stories.js → BarChart.stories.ts} +1 -1
  24. package/src/stories/{Breadcrumb.stories.js → Breadcrumb.stories.ts} +1 -4
  25. package/src/stories/{CardInfos.stories.js → CardInfos.stories.ts} +1 -2
  26. package/src/stories/{ChartLegend.stories.js → ChartLegend.stories.ts} +1 -2
  27. package/src/stories/{Checkbox.stories.js → Checkbox.stories.ts} +1 -1
  28. package/src/stories/{CheckboxSimple.stories.js → CheckboxSimple.stories.ts} +1 -1
  29. package/src/stories/{Chips.stories.js → Chips.stories.ts} +24 -22
  30. package/src/stories/ClimateZoneBadge.stories.ts +28 -0
  31. package/src/stories/CostEffectBar.stories.ts +26 -0
  32. package/src/stories/{Datatable.stories.js → Datatable.stories.ts} +5 -2
  33. package/src/stories/{DateCardInfo.stories.js → DateCardInfo.stories.ts} +1 -5
  34. package/src/stories/{Dialog.stories.js → Dialog.stories.ts} +1 -1
  35. package/src/stories/Draggable.stories.ts +32 -0
  36. package/src/stories/{Dropdown.stories.js → Dropdown.stories.ts} +1 -11
  37. package/src/stories/{DropdownList.stories.js → DropdownList.stories.ts} +3 -1
  38. package/src/stories/{Header.stories.js → Header.stories.ts} +1 -0
  39. package/src/stories/{HighlightRippleDot.stories.js → HighlightRippleDot.stories.ts} +2 -1
  40. package/src/stories/{Icon.stories.js → Icon.stories.ts} +2 -1
  41. package/src/stories/{InlineSelector.stories.js → InlineSelector.stories.ts} +1 -1
  42. package/src/stories/{Input.stories.js → Input.stories.ts} +6 -2
  43. package/src/stories/{InputSelect.stories.js → InputSelect.stories.ts} +2 -1
  44. package/src/stories/{InputTextArea.stories.js → InputTextArea.stories.ts} +1 -1
  45. package/src/stories/{MiniTag.stories.js → MiniTag.stories.ts} +8 -1
  46. package/src/stories/{Playground.stories.js → Playground.stories.ts} +1 -1
  47. package/src/stories/{ProgressBar.stories.js → ProgressBar.stories.ts} +2 -1
  48. package/src/stories/{RadioButton.stories.js → RadioButton.stories.ts} +1 -0
  49. package/src/stories/{RadioButtonSimple.stories.js → RadioButtonSimple.stories.ts} +1 -1
  50. package/src/stories/{SimpleAlert.stories.js → SimpleAlert.stories.ts} +2 -1
  51. package/src/stories/{Slider.stories.js → Slider.stories.ts} +5 -1
  52. package/src/stories/{Switch.stories.js → Switch.stories.ts} +1 -1
  53. package/src/stories/{TabHeader.stories.js → TabHeader.stories.ts} +4 -0
  54. package/src/stories/{TableResults.stories.js → TableResults.stories.ts} +5 -1
  55. package/src/stories/{TagScope.stories.js → TagScope.stories.ts} +1 -1
  56. package/src/stories/{TestimonialCard.stories.js → TestimonialCard.stories.ts} +2 -2
  57. package/src/stories/{Toast.stories.js → Toast.stories.ts} +1 -1
  58. package/src/stories/{Toggle.stories.js → Toggle.stories.ts} +6 -3
  59. package/src/stories/{Tooltip.stories.js → Tooltip.stories.ts} +3 -3
  60. package/src/util/{GeneralFunctions.js → GeneralFunctions.ts} +7 -7
  61. package/src/util/{imageLoader.js → imageLoader.ts} +15 -9
  62. package/tailwind.config.js +11 -2
  63. package/tsconfig.json +47 -0
  64. package/webpack.config.js +17 -3
  65. package/.storybook/PolicyStudio.js +0 -10
  66. package/.storybook/manager.js +0 -6
  67. package/babel.config.js +0 -17
  68. package/src/stories/ClimateZoneBadge.stories.js +0 -17
  69. package/src/stories/CostEffectBar.stories.js +0 -23
  70. package/src/stories/Draggable.stories.js +0 -22
  71. /package/.storybook/{eventBus.js → eventBus.ts} +0 -0
  72. /package/.storybook/{main.js → main.ts} +0 -0
  73. /package/.storybook/{preview.js → preview.ts} +0 -0
  74. /package/src/contents/{ComparisonData.js → ComparisonData.ts} +0 -0
  75. /package/src/contents/{FlexibleData.js → FlexibleData.ts} +0 -0
  76. /package/src/contents/{ResultsData.js → ResultsData.ts} +0 -0
  77. /package/src/stories/{Button.stories.js → Button.stories.ts} +0 -0
package/package.json CHANGED
@@ -1,28 +1,23 @@
1
1
  {
2
2
  "name": "@policystudio/policy-studio-ui-vue",
3
- "version": "1.1.90-beta.0",
3
+ "version": "1.1.90-beta.10",
4
4
  "description": "Policy Studio UI",
5
- "main": "src/index.js",
6
5
  "author": "Policy Studio Team",
7
- "url": "https://github.com/Policy-Studio/policy-studio-ui-vue",
8
- "license": "MIT",
9
- "keywords": [
10
- "vue",
11
- "ui"
12
- ],
13
6
  "scripts": {
7
+ "serve": "concurrently --kill-others \"npm run watch-storybook\" \"npm run watch-tailwind\"",
14
8
  "lint": "vue-cli-service lint",
15
9
  "build-storybook": "storybook build",
10
+ "build-ts":"tsc",
16
11
  "build-tailwind": "postcss src/assets/scss/base.scss -o dist/css/psui_styles.css",
17
12
  "build-temp-tailwind": "postcss src/assets/scss/base.scss -o temp/css/psui_styles.css",
18
- "full-publish": "npm run lint && npm run build-tailwind && npm run build-storybook && npm publish --tag beta",
19
- "serve": "concurrently --kill-others \"npm run watch-storybook\" \"npm run watch-tailwind\"",
13
+ "full-publish": "npm run lint && npm run build-ts && npm run build-tailwind && npm run build-storybook && npm publish --tag beta",
14
+ "kill-port": "sh ./scripts/kill-port.sh",
20
15
  "serve-prod": "concurrently --kill-others \"npm run watch-storybook\" \"npm run watch-prod-tailwind\"",
16
+ "storybook": "concurrently \"npm run kill-port\" \"npm run watch-prod-tailwind\" \"storybook dev -p 6006\"",
21
17
  "watch-prod-tailwind": "watch 'npm run build-tailwind' ./src/assets",
22
- "watch-tailwind": "watch 'npm run build-temp-tailwind' ./src/assets",
23
- "kill-port": "sh ./scripts/kill-port.sh",
24
- "storybook": "concurrently \"npm run kill-port\" \"npm run watch-prod-tailwind\" \"storybook dev -p 6006\""
18
+ "watch-tailwind": "watch 'npm run build-temp-tailwind' ./src/assets"
25
19
  },
20
+ "main": "dist/index.js",
26
21
  "dependencies": {
27
22
  "@vue/compat": "^3.4.5",
28
23
  "core-js": "^3.6.5",
@@ -30,10 +25,6 @@
30
25
  "vue": "^3.4.5"
31
26
  },
32
27
  "devDependencies": {
33
- "@babel/cli": "^7.23.4",
34
- "@babel/core": "^7.23.7",
35
- "@babel/eslint-parser": "^7.23.3",
36
- "@babel/preset-env": "^7.23.7",
37
28
  "@storybook/addon-essentials": "^7.6.7",
38
29
  "@storybook/addon-interactions": "^7.6.7",
39
30
  "@storybook/addon-links": "^7.6.7",
@@ -41,16 +32,19 @@
41
32
  "@storybook/test": "^7.6.7",
42
33
  "@storybook/vue3": "^7.6.7",
43
34
  "@storybook/vue3-webpack5": "^7.6.7",
35
+ "@typescript-eslint/eslint-plugin": "^5.4.0",
36
+ "@typescript-eslint/parser": "^5.4.0",
44
37
  "@vue/cli-plugin-eslint": "^5.0.8",
38
+ "@vue/cli-plugin-typescript": "~5.0.0",
45
39
  "@vue/cli-service": "~5.0.8",
46
40
  "@vue/compiler-sfc": "^3.4.5",
47
41
  "@vue/eslint-config-prettier": "^9.0.0",
48
- "babel-eslint": "^10.1.0",
42
+ "@vue/eslint-config-typescript": "^9.1.0",
49
43
  "concurrently": "^7.0.0",
50
44
  "eslint": "^8.56.0",
51
45
  "eslint-plugin-prettier": "^5.1.2",
52
46
  "eslint-plugin-storybook": "^0.6.15",
53
- "eslint-plugin-vue": "^9.19.2",
47
+ "eslint-plugin-vue": "^8.7.1",
54
48
  "postcss": "^8.3.11",
55
49
  "postcss-cli": "^9.0.2",
56
50
  "postcss-import": "^14.0.2",
@@ -59,12 +53,21 @@
59
53
  "react": "^18.2.0",
60
54
  "react-dom": "^18.2.0",
61
55
  "storybook": "^7.6.7",
62
- "tailwindcss": "^1.9.6",
56
+ "tailwindcss": "^3.4.1",
57
+ "ts-loader": "^9.5.1",
58
+ "typescript": "~4.5.5",
63
59
  "vue-eslint-parser": "^9.3.2",
64
60
  "vue-loader": "^17.4.2",
65
- "watch": "^1.0.2"
61
+ "watch": "^1.0.2",
62
+ "webpack": "^5.89.0"
66
63
  },
67
64
  "engines": {
68
65
  "node": "18.19.0"
69
- }
66
+ },
67
+ "keywords": [
68
+ "vue",
69
+ "ui"
70
+ ],
71
+ "license": "MIT",
72
+ "url": "https://github.com/Policy-Studio/policy-studio-ui-vue"
70
73
  }
package/postcss.config.js CHANGED
@@ -1,7 +1,7 @@
1
1
  module.exports = {
2
2
  plugins: {
3
- 'postcss-nested': {},
4
3
  'postcss-import': {},
4
+ 'tailwindcss/nesting': {},
5
5
  tailwindcss: {},
6
6
  autoprefixer: {},
7
7
  },
package/src/App.vue ADDED
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <img
3
+ alt="Vue logo"
4
+ src="./assets/logo.png"
5
+ >
6
+ <HelloWorld msg="Welcome to Your Vue.js + TypeScript App" />
7
+ </template>
8
+
9
+ <script lang="ts">
10
+ import { defineComponent } from 'vue'
11
+ import HelloWorld from './components/HelloWorld.vue'
12
+
13
+ export default defineComponent({
14
+ name: 'App',
15
+ components: {
16
+ HelloWorld
17
+ }
18
+ })
19
+ </script>
20
+
21
+ <style>
22
+ #app {
23
+ font-family: Avenir, Helvetica, Arial, sans-serif;
24
+ -webkit-font-smoothing: antialiased;
25
+ -moz-osx-font-smoothing: grayscale;
26
+ text-align: center;
27
+ color: #2c3e50;
28
+ margin-top: 60px;
29
+ }
30
+ </style>
@@ -67,35 +67,39 @@ html {
67
67
  -webkit-font-smoothing: antialiased;
68
68
  }
69
69
 
70
- .psui-card {
71
- @apply .psui-w-full .psui-bg-white .psui-rounded-lg .psui-px-6 .psui-py-4 .psui-shadow-elevation-5;
72
70
 
73
- &-header {
74
- @apply .psui-flex .psui-items-center .psui-justify-between .psui-mb-4;
75
-
76
- h4 {
77
- @apply .psui-text-h6 .psui-font-bold .psui-text-gray-80;
71
+ @layer components {
72
+ .psui-card {
73
+ @apply .psui-w-full .psui-bg-white .psui-rounded-lg .psui-px-6 .psui-py-4 .psui-shadow-elevation-5;
74
+
75
+ &-header {
76
+ @apply .psui-flex .psui-items-center .psui-justify-between .psui-mb-4;
77
+
78
+ h4 {
79
+ @apply .psui-text-h6 .psui-font-bold .psui-text-gray-80;
80
+ }
78
81
  }
79
82
  }
80
- }
81
83
 
82
- .psui-show-childrens-on-hover {
83
- &:hover {
84
- * {
85
- opacity: 1 !important;
84
+ .psui-show-childrens-on-hover {
85
+ &:hover {
86
+ * {
87
+ opacity: 1 !important;
88
+ }
86
89
  }
87
- }
88
-
89
- &.absolute-childrens {
90
- @apply psui-relative;
91
-
92
- .helper {
93
- @apply psui-absolute psui-top-0;
94
- right: -18px;
90
+
91
+ &.absolute-childrens {
92
+ @apply psui-relative;
93
+
94
+ .helper {
95
+ @apply psui-absolute psui-top-0;
96
+ right: -18px;
97
+ }
95
98
  }
96
99
  }
100
+
101
+ .psui-transition {
102
+ @apply psui-transition-all psui-ease-in-out psui-duration-150;
103
+ }
97
104
  }
98
105
 
99
- .psui-transition {
100
- @apply psui-transition-all psui-ease-in-out psui-duration-150;
101
- }
@@ -8,7 +8,7 @@
8
8
  &.disabled {
9
9
  .psui-el-accordion-item-header {
10
10
  .psui-el-accordion-item-header-wrapper {
11
- @apply psui-text-gray-50 pointer-events-none;
11
+ @apply psui-text-gray-50 psui-pointer-events-none;
12
12
 
13
13
  }
14
14
  }
@@ -1,4 +1,4 @@
1
- @layer components{
1
+ @layer components {
2
2
 
3
3
  .psui-el-chips {
4
4
  @apply psui-inline-flex psui-relative;
@@ -126,7 +126,7 @@
126
126
 
127
127
  &,
128
128
  .psui-el-chips-close {
129
- @apply .psui-text-gray-50;
129
+ @apply psui-text-gray-50;
130
130
  }
131
131
 
132
132
  .psui-el-chips-icon-prepend {
@@ -140,7 +140,7 @@
140
140
 
141
141
  &,
142
142
  .psui-el-chips-close {
143
- @apply .psui-text-blue-60;
143
+ @apply psui-text-blue-60;
144
144
  }
145
145
 
146
146
  .psui-el-chips-icon-prepend {
@@ -1,13 +1,13 @@
1
1
  @layer components {
2
2
  .psui-el-cost-effect-bar {
3
- @apply .psui-overflow-visible;
3
+ @apply psui-overflow-visible;
4
4
 
5
5
  div {
6
- @apply .psui-relative .psui-h-2 .psui-rounded-2xl;
6
+ @apply psui-relative psui-h-2 psui-rounded-2xl;
7
7
  width: 100px;
8
8
 
9
9
  span {
10
- @apply .psui-absolute .psui-rounded-sm .psui-z-10;
10
+ @apply psui-absolute psui-rounded-sm psui-z-10;
11
11
  background-color: #d6dde5;
12
12
  width: 2px;
13
13
  height: 14px;
@@ -15,7 +15,7 @@
15
15
  }
16
16
 
17
17
  .psui-el-simple-progress-bar {
18
- @apply .psui-overflow-hidden;
18
+ @apply psui-overflow-hidden;
19
19
 
20
20
  &-percentage {
21
21
  border-radius: unset;
@@ -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,7 +50,7 @@ import PsBreadcrumb from './components/navigations/PsBreadcrumb.vue'
50
50
 
51
51
 
52
52
  export default {
53
- install(Vue) {
53
+ install(Vue:any) {
54
54
  Vue.component('PsButton', PsButton)
55
55
  Vue.component('PsCheckbox', PsCheckbox)
56
56
  Vue.component('PsDialog', PsDialog)
@@ -99,8 +99,8 @@ export default {
99
99
 
100
100
 
101
101
  Vue.directive('click-outside', {
102
- bind: function (el, binding, vnode) {
103
- el.clickOutsideEvent = function (event) {
102
+ bind: function (el:any, binding:any, vnode:any) {
103
+ el.clickOutsideEvent = function (event:any) {
104
104
  // here I check that click was outside the el and his children
105
105
  if (!(el == event.target || el.contains(event.target))) {
106
106
  // and if it did, call method provided in attribute value
@@ -109,7 +109,7 @@ export default {
109
109
  }
110
110
  document.body.addEventListener('click', el.clickOutsideEvent)
111
111
  },
112
- unbind: function (el) {
112
+ unbind: function (el:any) {
113
113
  document.body.removeEventListener('click', el.clickOutsideEvent)
114
114
  },
115
115
  })
@@ -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: `