@policystudio/policy-studio-ui-vue 1.0.12 → 1.0.13

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@policystudio/policy-studio-ui-vue",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Policy Studio UI",
5
5
  "main": "src/index.js",
6
6
  "author": "Policy Studio Team",
@@ -6,15 +6,14 @@
6
6
  >
7
7
  <i
8
8
  v-if="icon"
9
- class="psui-my-auto material-icons psui-mr-2"
10
- :class="{ 'psui-text-sm': size === 'small' }"
9
+ :class="['psui-mr-2', iconClasses]"
11
10
  >
12
11
  {{ icon }}
13
12
  </i>
14
13
  <div class="psui-flex-grow psui-text-left">{{ label }}</div>
15
14
  <i
16
- v-if="iconRight" class="psui-my-auto material-icons psui-ml-2"
17
- :class="{ 'psui-text-sm': size === 'small' }"
15
+ v-if="iconRight"
16
+ :class="['psui-ml-2', iconClasses]"
18
17
  >
19
18
  {{ iconRight }}
20
19
  </i>
@@ -59,16 +58,21 @@ export default {
59
58
  type: String,
60
59
  default: ''
61
60
  },
61
+ 'icon-color': {
62
+ type: String,
63
+ default: ''
64
+ },
62
65
  color: {
63
66
  type: String,
64
67
  default: ''
65
68
  }
66
69
  },
67
- data () {
68
- return {
69
- }
70
- },
71
70
  computed: {
71
+ iconClasses() {
72
+ const size = this.sizes === 'small' ? 'psui-text-sm' : ''
73
+ const color = this.iconColor.length > 0 ? `psui-text-${this.iconColor}` : ''
74
+ return `psui-my-auto material-icons ${size} ${color}`
75
+ },
72
76
  classes() {
73
77
  let sizeCss = 'psui-px-4 psui-py-2'
74
78
  if (this.size === 'medium') sizeCss = 'psui-px-4 psui-py-1'
@@ -76,7 +80,16 @@ export default {
76
80
  if (this.outline) return `${sizeCss} psui-bg-white psui-border ${this.disabled ? 'psui-border-gray-40 psui-text-gray-40' : 'psui-border-blue-60 psui-text-blue-60'}`
77
81
  if (this.ghost) return `${sizeCss} ${this.disabled ? 'psui-bg-gray-20 psui-text-gray-40' : 'psui-bg-blue-20 psui-text-blue-60 active:psui-shadow-inner'}`
78
82
  if (this.textOnly) {
79
- const textCss = this.disabled ? 'psui-text-gray-40' : this.textColor.length > 0 ? `psui-text-${this.textColor}` : 'psui-text-blue-50 hover:psui-text-blue-60'
83
+ const hasTextColor = this.textColor.length > 0
84
+ const color = hasTextColor ? this.textColor.split('hover:')[0] : ''
85
+ const hover = hasTextColor ? this.textColor.split('hover:')[1] : ''
86
+
87
+ let textCss = 'psui-text-blue-50 hover:psui-text-blue-60'
88
+ if (this.disabled) textCss = 'psui-text-gray-40'
89
+
90
+ if (hasTextColor) textCss = `psui-text-${color}`
91
+ if (hover) textCss += `hover:psui-text-${hover}`
92
+
80
93
  return `${sizeCss} ${textCss}`
81
94
  }
82
95
  if (this.disabled) return `${sizeCss} psui-bg-gray-20 psui-text-gray-40`