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

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.1.90-beta.0",
3
+ "version": "1.1.90-beta.3",
4
4
  "description": "Policy Studio UI",
5
5
  "main": "src/index.js",
6
6
  "author": "Policy Studio Team",
@@ -59,7 +59,7 @@
59
59
  "react": "^18.2.0",
60
60
  "react-dom": "^18.2.0",
61
61
  "storybook": "^7.6.7",
62
- "tailwindcss": "^1.9.6",
62
+ "tailwindcss": "^3.4.1",
63
63
  "vue-eslint-parser": "^9.3.2",
64
64
  "vue-loader": "^17.4.2",
65
65
  "watch": "^1.0.2"
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
  },
@@ -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 {
@@ -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>
41
+ import { 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: {
52
+ layout:{
53
53
  type: String,
54
54
  default: 'solid',
55
55
  validator: (value) => ['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
64
  validator: (value) => ['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) => ['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(!this.disabled){
99
+ isHover.value = true
100
+ }
101
+ }
102
+
103
+ const onMouseLeave = () => {
104
+ if(!this.disabled){
105
+ isHover.value = false
128
106
  }
129
107
  }
130
- }
108
+
131
109
  </script>
132
110
 
@@ -1,7 +1,16 @@
1
+ /** @type {import('tailwindcss').Config} */
2
+
1
3
  module.exports = {
2
4
  prefix: 'psui-',
3
- purge: ['./index.html', './src/**/*.vue,js,ts,jsx,tsx}'],
4
- darkMode: false, // or 'media' or 'class'
5
+ content: [
6
+ './index.html',
7
+ './src/**/*.vue',
8
+ './src/**/*.js',
9
+ './src/**/*.ts',
10
+ './src/**/*.jsx',
11
+ './src/**/*.tsx',
12
+ ],
13
+ darkMode: 'media', // or 'media' or 'class'
5
14
  theme: {
6
15
  colors: {
7
16
  'white': '#ffffff ',