@policystudio/policy-studio-ui-vue 1.0.1 → 1.0.5

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.
@@ -0,0 +1,82 @@
1
+ <template>
2
+ <button
3
+ class="psui-font-bold psui-align-middle psui-flex psui-rounded-md"
4
+ :class="classes"
5
+ @click="onClick()"
6
+ >
7
+ <i
8
+ v-if="icon"
9
+ class="psui-my-auto material-icons psui-mr-2"
10
+ :class="{ 'psui-text-sm': size === 'small' }"
11
+ >
12
+ {{ icon }}
13
+ </i>
14
+ <div class="psui-flex-grow psui-text-left">{{ label }}</div>
15
+ <i
16
+ v-if="iconRight" class="psui-my-auto material-icons psui-ml-2"
17
+ :class="{ 'psui-text-sm': size === 'small' }"
18
+ >
19
+ {{ iconRight }}
20
+ </i>
21
+ </button>
22
+ </template>
23
+
24
+ <script>
25
+ export const sizes = ['big', 'medium', 'small']
26
+ export default {
27
+ props: {
28
+ label: {
29
+ type: String,
30
+ required: true
31
+ },
32
+ outline: {
33
+ type: Boolean,
34
+ default: false
35
+ },
36
+ ghost: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ textOnly: {
41
+ type: Boolean,
42
+ default: false
43
+ },
44
+ icon: {
45
+ type: String,
46
+ },
47
+ iconRight: {
48
+ type: String,
49
+ },
50
+ size: {
51
+ type: String,
52
+ default: 'big',
53
+ validator: (value) => sizes.indexOf(value) !== -1
54
+ },
55
+ disabled: {
56
+ type: [Boolean, String]
57
+ }
58
+ },
59
+ data () {
60
+ return {
61
+ }
62
+ },
63
+ computed: {
64
+ classes() {
65
+ let sizeCss = 'psui-px-4 psui-py-2'
66
+ if (this.size === 'medium') sizeCss = 'psui-px-4 psui-py-1'
67
+ if (this.size === 'small') sizeCss = 'psui-px-2 psui-py-psui-px psui-text-sm'
68
+ 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'}`
69
+ 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'}`
70
+ if (this.textOnly) return `${sizeCss} ${this.disabled ? 'psui-text-gray-40' : 'psui-text-blue-60'}`
71
+ if (this.disabled) return `${sizeCss} psui-bg-gray-20 psui-text-gray-40`
72
+ return `${sizeCss} psui-bg-blue-60 hover:psui-bg-blue-50 psui-text-white active:psui-shadow-inner`
73
+ }
74
+ },
75
+ methods: {
76
+ onClick() {
77
+ if (this.disabled) return false
78
+ this.$emit('click');
79
+ }
80
+ }
81
+ }
82
+ </script>
@@ -8,7 +8,7 @@
8
8
 
9
9
  <script>
10
10
  export default {
11
- name: 'Checkbox',
11
+ name: 'PsCheckbox',
12
12
  props: {
13
13
  value: {
14
14
  required: true
@@ -16,7 +16,7 @@
16
16
 
17
17
  <script>
18
18
  export default {
19
- name: 'RadioButton',
19
+ name: 'PsRadioButton',
20
20
  props: {
21
21
  label: {
22
22
  type: String,
@@ -1,15 +1,15 @@
1
1
  <template>
2
2
  <div :class="cssClass">
3
- <div class="material-icons ui-my-auto">info</div>
4
- <div class="ui-w-full">{{ message }}</div>
5
- <div class="ui-cursor-pointer ui-font-bold ui-my-auto ui-pr-4">OK</div>
3
+ <div class="material-icons psui-my-auto">info</div>
4
+ <div class="psui-w-full">{{ message }}</div>
5
+ <div class="psui-cursor-pointer psui-font-bold psui-my-auto psui-pr-4">OK</div>
6
6
  </div>
7
7
  </template>
8
8
 
9
9
  <script>
10
10
  export const typeOptions = ['informative', 'success', 'alert']
11
11
  export default {
12
- name: 'Dialog',
12
+ name: 'PsDialog',
13
13
  props: {
14
14
  type: {
15
15
  type: String,
@@ -32,7 +32,7 @@ export default {
32
32
  },
33
33
  computed: {
34
34
  cssClass() {
35
- return `ui-flex ui-space-x-4 ui-font-small ui-rounded-md ui-py-2 ui-px-4 ui-align-middle ui-flex ui-bg-${this.colors[this.type].background} ui-text-${this.colors[this.type].color}`
35
+ return `psui-flex psui-space-x-4 psui-font-small psui-rounded-md psui-py-2 psui-px-4 psui-align-middle psui-flex psui-bg-${this.colors[this.type].background} psui-text-${this.colors[this.type].color}`
36
36
  }
37
37
  }
38
38
  }
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div :class="cssClass">
3
- <span class="material-icons ui-mr-4">{{ icon }}</span>
4
- <div class="ui-w-full">{{ message }}</div>
5
- <div class="ui-flex ui-space-x-4">
3
+ <span class="material-icons psui-mr-4">{{ icon }}</span>
4
+ <div class="psui-w-full">{{ message }}</div>
5
+ <div class="psui-flex psui-space-x-4">
6
6
  <slot></slot>
7
7
  </div>
8
8
  </div>
@@ -12,7 +12,7 @@
12
12
  export const typeOptions = ['info', 'success', 'warning', 'error']
13
13
  export const fillOptions = ['soft', 'intense']
14
14
  export default {
15
- name: 'Toast',
15
+ name: 'PsToast',
16
16
  props: {
17
17
  type: {
18
18
  type: String,
@@ -46,7 +46,7 @@ export default {
46
46
  const textColor = this.fill === 'intense' ? 'white': colors[this.type]
47
47
  const background = this.fill === 'soft'? `${colors[this.type].split('-', 1)}-10` : colors[this.type]
48
48
 
49
- return `ui-font-bold ui-shadow-md ui-rounded-md ui-p-3 ui-h-12 ui-flex ui-bg-${background} ui-text-${textColor}`
49
+ return `psui-font-bold psui-shadow-md psui-rounded-md psui-p-3 psui-h-12 psui-flex psui-bg-${background} psui-text-${textColor}`
50
50
  }
51
51
  }
52
52
  }
@@ -7,9 +7,9 @@
7
7
  @click="selectTab(item)"
8
8
  :class="[
9
9
  classes,
10
- { 'ui-bg-blue-60 ui-text-white': getSelected === item[keyValue] && theme === 'standard' },
11
- { 'ui-border-b-2 ui-border-blue-60 ui-text-blue-60 ui-font-bold': getSelected === item[keyValue] && theme === 'underline' },
12
- { 'ui-text-blue-60 ui-font-bold ui-bg-white hover:ui-text-blue-60': getSelected === item[keyValue] && theme === 'folder' }
10
+ { 'psui-bg-blue-60 psui-text-white': getSelected === item[keyValue] && theme === 'standard' },
11
+ { 'psui-border-b-2 psui-border-blue-60 psui-text-blue-60 psui-font-bold': getSelected === item[keyValue] && theme === 'underline' },
12
+ { 'psui-text-blue-60 psui-font-bold psui-bg-white hover:psui-text-blue-60': getSelected === item[keyValue] && theme === 'folder' }
13
13
  ]"
14
14
  >
15
15
  {{ item[keyLabel] }}
@@ -20,25 +20,25 @@
20
20
  <script>
21
21
  export const themeOptions = ['standard', 'underline', 'folder']
22
22
  export default {
23
- name: 'TabHeader',
23
+ name: 'PsTabHeader',
24
24
  computed: {
25
25
  wrapperClasses() {
26
26
  if (this.theme === 'underline') {
27
- return 'ui-flex ui-space-x-4 ui-border-b ui-border-gray-20'
27
+ return 'psui-flex psui-space-x-4 psui-border-b psui-border-gray-20'
28
28
  }
29
29
  if (this.theme === 'folder') {
30
- return 'ui-flex ui-space-x-1'
30
+ return 'psui-flex psui-space-x-1'
31
31
  }
32
- return 'ui-inline-flex ui-rounded-md ui-flex ui-gap-x-px'
32
+ return 'psui-inline-flex psui-rounded-md psui-flex psui-gap-x-px'
33
33
  },
34
34
  classes() {
35
35
  if (this.theme === 'underline') {
36
- return 'ui-text-gray-60 ui-pb-3 hover:ui-text-blue-60'
36
+ return 'psui-text-gray-60 psui-pb-3 hover:psui-text-blue-60'
37
37
  }
38
38
  if (this.theme === 'folder') {
39
- return 'ui-bg-gray-10 ui-text-gray-50 ui-py-2 ui-px-4 ui-rounded-t-lg hover:ui-text-gray-60 active:ui-text-blue-60'
39
+ return 'psui-bg-gray-10 psui-text-gray-50 psui-py-2 psui-px-4 psui-rounded-t-lg hover:psui-text-gray-60 active:psui-text-blue-60'
40
40
  }
41
- return 'ui-bg-gray-10 ui-px-4 ui-py-2 ui-text-gray-60 hover:ui-text-blue-60 last:ui-rounded-r-lg first:ui-rounded-l-lg active:ui-text-white active:ui-bg-blue-60'
41
+ return 'psui-bg-gray-10 psui-px-4 psui-py-2 psui-text-gray-60 hover:psui-text-blue-60 last:psui-rounded-r-lg first:psui-rounded-l-lg active:psui-text-white active:psui-bg-blue-60'
42
42
  },
43
43
  getIsObject() {
44
44
  return typeof this.selected === 'object'
package/src/index.js CHANGED
@@ -1,14 +1,26 @@
1
- import Toast from './components/notifications/Toast.vue';
2
- import Dialog from './components/notifications/Dialog.vue';
1
+ import PsButton from './components/buttons/PsButton.vue';
2
+ import PsCheckbox from './components/controls/PsCheckbox.vue';
3
+ import PsDialog from './components/notifications/PsDialog.vue';
4
+ import PsToast from './components/notifications/PsToast.vue';
5
+ import PsTabHeader from './components/tabs/PsTabHeader.vue';
6
+ import PsRadioButton from './components/controls/PsRadioButton.vue';
3
7
 
4
8
  export default {
5
9
  install(Vue) {
6
- Vue.component('Toast', Toast);
7
- Vue.component('Dialog', Dialog);
8
- },
10
+ Vue.component('PsButton', PsButton);
11
+ Vue.component('PsCheckbox', PsCheckbox);
12
+ Vue.component('PsDialog', PsDialog);
13
+ Vue.component('PsToast', PsToast);
14
+ Vue.component('PsTabHeader', PsTabHeader);
15
+ Vue.component('PsRadioButton', PsRadioButton);
16
+ }
9
17
  };
10
18
 
11
19
  export {
12
- Toast,
13
- Dialog
20
+ PsButton,
21
+ PsCheckbox,
22
+ PsDialog,
23
+ PsToast,
24
+ PsTabHeader,
25
+ PsRadioButton
14
26
  }
@@ -1,8 +1,8 @@
1
- import Button, { sizes } from '../components/buttons/Button.vue';
1
+ import PsButton, { sizes } from '../components/buttons/PsButton.vue';
2
2
  const icons = ['add_circle', 'delete', 'done', 'info', 'send']
3
3
  export default {
4
4
  title: 'Components/Button',
5
- component: Button,
5
+ component: PsButton,
6
6
  argTypes: {
7
7
  size: { control: { type: 'select', options: sizes } },
8
8
  disabled: { control: 'boolean' },
@@ -13,9 +13,9 @@ export default {
13
13
 
14
14
  const Template = (args, { argTypes }) => ({
15
15
  props: Object.keys(argTypes),
16
- components: { Button },
16
+ components: { PsButton },
17
17
  template: `
18
- <Button v-bind="$props" />
18
+ <PsButton v-bind="$props" />
19
19
  `
20
20
  });
21
21
 
@@ -1,8 +1,8 @@
1
- import Checkbox, { sizes } from '../components/controls/Checkbox.vue';
1
+ import PsCheckbox, { sizes } from '../components/controls/PsCheckbox.vue';
2
2
  const icons = ['add_circle', 'delete', 'done', 'info', 'send']
3
3
  export default {
4
4
  title: 'Components/Checkbox',
5
- component: Checkbox,
5
+ component: PsCheckbox,
6
6
  argTypes: {
7
7
  disabled: { control: 'boolean' },
8
8
  },
@@ -10,9 +10,9 @@ export default {
10
10
 
11
11
  const Template = (args, { argTypes }) => ({
12
12
  props: Object.keys(argTypes),
13
- components: { Checkbox },
13
+ components: { PsCheckbox },
14
14
  template: `
15
- <Checkbox v-bind="$props" />
15
+ <PsCheckbox v-bind="$props" />
16
16
  `
17
17
  });
18
18
 
@@ -11,12 +11,12 @@ Out colors are designed to be harmonious, ensure accessible text, and distinguis
11
11
 
12
12
  ## Blue
13
13
 
14
- <div class="ui-grid ui-grid-flow-col">
15
- <div class="ui-p-2 ui-h-20 ui-text-white ui-bg-blue-80">Blue 80</div>
16
- <div class="ui-p-2 ui-h-20 ui-text-white ui-bg-blue-70">Blue 70</div>
17
- <div class="ui-p-2 ui-h-20 ui-text-white ui-bg-blue-60">Blue 60</div>
18
- <div class="ui-p-2 ui-h-20 ui-text-white ui-bg-blue-50">Blue 50</div>
19
- <div class="ui-p-2 ui-h-20 ui-text-blue-70 ui-bg-blue-20">Blue 20</div>
20
- <div class="ui-p-2 ui-h-20 ui-text-blue-70 ui-bg-blue-10">Blue 10</div>
21
- <div class="ui-p-2 ui-h-20 ui-text-blue-70 ui-bg-white ">White</div>
14
+ <div class="psui-grid psui-grid-flow-col">
15
+ <div class="psui-p-2 psui-h-20 psui-text-white psui-bg-blue-80">Blue 80</div>
16
+ <div class="psui-p-2 psui-h-20 psui-text-white psui-bg-blue-70">Blue 70</div>
17
+ <div class="psui-p-2 psui-h-20 psui-text-white psui-bg-blue-60">Blue 60</div>
18
+ <div class="psui-p-2 psui-h-20 psui-text-white psui-bg-blue-50">Blue 50</div>
19
+ <div class="psui-p-2 psui-h-20 psui-text-blue-70 psui-bg-blue-20">Blue 20</div>
20
+ <div class="psui-p-2 psui-h-20 psui-text-blue-70 psui-bg-blue-10">Blue 10</div>
21
+ <div class="psui-p-2 psui-h-20 psui-text-blue-70 psui-bg-white ">White</div>
22
22
  </div>
@@ -1,8 +1,8 @@
1
- import Dialog from '../components/notifications/Dialog.vue';
1
+ import PsDialog from '../components/notifications/PsDialog.vue';
2
2
 
3
3
  export default {
4
4
  title: 'Components/Dialog',
5
- component: Dialog,
5
+ component: PsDialog,
6
6
  argTypes: {
7
7
  type: { control: { type: 'select', options: ['informative', 'success', 'alert'] } },
8
8
  },
@@ -10,8 +10,8 @@ export default {
10
10
 
11
11
  const Template = (args, { argTypes }) => ({
12
12
  props: Object.keys(argTypes),
13
- components: { Dialog },
14
- template: '<Dialog v-bind="$props" />',
13
+ components: { PsDialog },
14
+ template: '<PsDialog v-bind="$props" />',
15
15
  });
16
16
 
17
17
  export const Informative = Template.bind({});
@@ -14,28 +14,28 @@ Elevation is evidenced by the use of shadows. It's another way to establish a vi
14
14
 
15
15
  ### 1.1. Shadow and light
16
16
  The shadows in our elements are projected by these two light sources: main light and ambient light.
17
- <div class="ui-grid ui-grid-cols-3 ui-gap-4">
18
- <div class="ui-bg-gray-20 ui-pt-8">
19
- <div class="ui-bg-white ui-w-48 ui-h-48 ui-rounded-md ui-shadow mx-auto"></div>
20
- <p class="ui-text-center">Shadow cast by main light</p>
17
+ <div class="psui-grid psui-grid-cols-3 psui-gap-4">
18
+ <div class="psui-bg-gray-20 psui-pt-8">
19
+ <div class="psui-bg-white psui-w-48 psui-h-48 psui-rounded-md psui-shadow mx-auto"></div>
20
+ <p class="psui-text-center">Shadow cast by main light</p>
21
21
  </div>
22
- <div class="ui-bg-gray-20 ui-pt-8">
23
- <div class="ui-bg-white ui-w-48 ui-h-48 ui-rounded-md ui-shadow-sm mx-auto"></div>
24
- <p class="ui-text-center">Shadow cast by ambient light</p>
22
+ <div class="psui-bg-gray-20 psui-pt-8">
23
+ <div class="psui-bg-white psui-w-48 psui-h-48 psui-rounded-md psui-shadow-sm mx-auto"></div>
24
+ <p class="psui-text-center">Shadow cast by ambient light</p>
25
25
  </div>
26
- <div class="ui-bg-gray-20 ui-pt-8">
27
- <div class="ui-bg-white ui-w-48 ui-h-48 ui-rounded-md ui-shadow-md mx-auto"></div>
28
- <p class="ui-text-center">Combined shadow from main and ambient lights</p>
26
+ <div class="psui-bg-gray-20 psui-pt-8">
27
+ <div class="psui-bg-white psui-w-48 psui-h-48 psui-rounded-md psui-shadow-md mx-auto"></div>
28
+ <p class="psui-text-center">Combined shadow from main and ambient lights</p>
29
29
  </div>
30
30
  </div>
31
31
 
32
32
  ## 2. Elevation system
33
33
  Shadows provide cues about depth, direction of movement, and surface edges. A surface’s shadow is determined by its elevation and relationship to other surfaces.
34
- <div class="ui-grid grid-cols-2 ui-gap-6 ui-p-6 ui-bg-gray-20">
35
- <div class="ui-rounded-md ui-p-8 ui-h-20 ui-shadow-inner">Elevation -5</div>
36
- <div class="ui-rounded-md ui-p-8 ui-h-20 ui-bg-white ui-shadow-sm">Elevation 5</div>
37
- <div class="ui-rounded-md ui-p-8 ui-h-20 ui-bg-white ui-shadow">Elevation 10</div>
38
- <div class="ui-rounded-md ui-p-8 ui-h-20 ui-bg-white ui-shadow-md">Elevation 20</div>
39
- <div class="ui-rounded-md ui-p-8 ui-h-20 ui-bg-white ui-shadow-lg">Elevation 30</div>
40
- <div class="ui-rounded-md ui-p-8 ui-h-20 ui-bg-white ui-shadow-xl">Elevation 40</div>
34
+ <div class="psui-grid grid-cols-2 psui-gap-6 psui-p-6 psui-bg-gray-20">
35
+ <div class="psui-rounded-md psui-p-8 psui-h-20 psui-shadow-inner">Elevation -5</div>
36
+ <div class="psui-rounded-md psui-p-8 psui-h-20 psui-bg-white psui-shadow-sm">Elevation 5</div>
37
+ <div class="psui-rounded-md psui-p-8 psui-h-20 psui-bg-white psui-shadow">Elevation 10</div>
38
+ <div class="psui-rounded-md psui-p-8 psui-h-20 psui-bg-white psui-shadow-md">Elevation 20</div>
39
+ <div class="psui-rounded-md psui-p-8 psui-h-20 psui-bg-white psui-shadow-lg">Elevation 30</div>
40
+ <div class="psui-rounded-md psui-p-8 psui-h-20 psui-bg-white psui-shadow-xl">Elevation 40</div>
41
41
  </div>
@@ -1,16 +1,16 @@
1
- import RadioButton from '../components/controls/RadioButton.vue';
1
+ import PsRadioButton from '../components/controls/PsRadioButton.vue';
2
2
 
3
3
  export default {
4
- title: 'Components/RadioButton',
5
- component: RadioButton,
4
+ title: 'Components/Radio Button',
5
+ component: PsRadioButton,
6
6
  argTypes: {},
7
7
  };
8
8
 
9
9
  const Template = (args, { argTypes }) => ({
10
10
  props: Object.keys(argTypes),
11
- components: { RadioButton },
11
+ components: { PsRadioButton },
12
12
  template: `
13
- <RadioButton v-bind="$props" />
13
+ <PsRadioButton v-bind="$props" />
14
14
  `
15
15
  });
16
16
 
@@ -1,29 +1,29 @@
1
- import TabHeader from '../components/tabs/TabHeader.vue';
1
+ import PsTabHeader from '../components/tabs/PsTabHeader.vue';
2
2
  const items = ['Existing Buildings', 'New Constructions', 'Other tab']
3
3
  const item = items[0]
4
4
 
5
5
  export default {
6
- title: 'Components/Tabs',
7
- component: TabHeader,
6
+ title: 'Components/Tab Header',
7
+ component: PsTabHeader,
8
8
  argTypes: {}
9
9
  };
10
10
  const Template = (args, { argTypes }) => ({
11
11
  props: Object.keys(argTypes),
12
- components: { TabHeader },
12
+ components: { PsTabHeader },
13
13
  data: () => {
14
14
  return {
15
15
  }
16
16
  },
17
17
  template: `
18
- <div class="ui-bg-gray-20 ui-p-8">
19
- <TabHeader :selected.sync=selected v-bind="$props"/>
20
- <div v-if="$props['selected'] === 'Existing Buildings'" class="ui-bg-white ui-p-4" :class="{ 'ui-mt-4' : $props['theme'] === 'standard'}">
18
+ <div class="psui-bg-gray-20 psui-p-8">
19
+ <PsTabHeader :selected.sync=selected v-bind="$props"/>
20
+ <div v-if="$props['selected'] === 'Existing Buildings'" class="psui-bg-white psui-p-4" :class="{ 'psui-mt-4' : $props['theme'] === 'standard'}">
21
21
  <p v-for="i of 4">Tab Existing Buildings Selected</p>
22
22
  </div>
23
- <div v-if="$props['selected'] === 'New Constructions'" class="ui-bg-white ui-p-4" :class="{ 'ui-mt-4' : $props['theme'] === 'standard'}">
23
+ <div v-if="$props['selected'] === 'New Constructions'" class="psui-bg-white psui-p-4" :class="{ 'psui-mt-4' : $props['theme'] === 'standard'}">
24
24
  <p v-for="i of 4">Tab New Constructions Selected</p>
25
25
  </div>
26
- <div v-if="$props['selected'] === 'Other tab'" class="ui-bg-white ui-p-4" :class="{ 'ui-mt-4' : $props['theme'] === 'standard'}">
26
+ <div v-if="$props['selected'] === 'Other tab'" class="psui-bg-white psui-p-4" :class="{ 'psui-mt-4' : $props['theme'] === 'standard'}">
27
27
  <p v-for="i of 4">Other tab Selected</p>
28
28
  </div>
29
29
  </div>
@@ -1,7 +1,7 @@
1
- import Toast, { typeOptions, fillOptions } from '../components/notifications/Toast.vue';
1
+ import PsToast, { typeOptions, fillOptions } from '../components/notifications/PsToast.vue';
2
2
  export default {
3
3
  title: 'Components/Toast',
4
- component: Toast,
4
+ component: PsToast,
5
5
  argTypes: {
6
6
  type: { control: { type: 'select', options: typeOptions } },
7
7
  fill: { control: { type: 'select', options: fillOptions } }
@@ -10,16 +10,16 @@ export default {
10
10
 
11
11
  const Template = (args, { argTypes }) => ({
12
12
  props: Object.keys(argTypes),
13
- components: { Toast },
13
+ components: { PsToast },
14
14
  methods: {
15
15
  teste(message) {
16
16
  alert(message)
17
17
  }
18
18
  },
19
19
  template: `
20
- <Toast v-bind="$props">
20
+ <PsToast v-bind="$props">
21
21
  <template v-if="${'default' in args}" v-slot>${args.default}</template>
22
- </Toast>
22
+ </PsToast>
23
23
  `
24
24
  });
25
25
 
@@ -52,7 +52,7 @@ Actions.args = {
52
52
  type: 'info',
53
53
  message: 'This is an info alert with actions',
54
54
  default: `
55
- <span class="ui-cursor-pointer" @click="teste('Callback Action 1')">ACTION1</span>
56
- <span class="ui-cursor-pointer" @click="teste('Callback Action 2')">ACTION2</span>
55
+ <span class="psui-cursor-pointer" @click="teste('Callback Action 1')">ACTION1</span>
56
+ <span class="psui-cursor-pointer" @click="teste('Callback Action 2')">ACTION2</span>
57
57
  `
58
58
  };
@@ -1,5 +1,5 @@
1
1
  module.exports = {
2
- prefix: 'ui-',
2
+ prefix: 'psui-',
3
3
  purge: ['./index.html', './src/**/*.vue,js,ts,jsx,tsx}'],
4
4
  darkMode: false, // or 'media' or 'class'
5
5
  theme: {
@@ -1,82 +0,0 @@
1
- <template>
2
- <button
3
- class="ui-font-bold ui-align-middle ui-flex ui-rounded-md"
4
- :class="classes"
5
- @click="onClick()"
6
- >
7
- <i
8
- v-if="icon"
9
- class="ui-my-auto material-icons ui-mr-2"
10
- :class="{ 'ui-text-sm': size === 'small' }"
11
- >
12
- {{ icon }}
13
- </i>
14
- <div class="ui-flex-grow ui-text-left">{{ label }}</div>
15
- <i
16
- v-if="iconRight" class="ui-my-auto material-icons ui-ml-2"
17
- :class="{ 'ui-text-sm': size === 'small' }"
18
- >
19
- {{ iconRight }}
20
- </i>
21
- </button>
22
- </template>
23
-
24
- <script>
25
- export const sizes = ['big', 'medium', 'small']
26
- export default {
27
- props: {
28
- label: {
29
- type: String,
30
- required: true
31
- },
32
- outline: {
33
- type: Boolean,
34
- default: false
35
- },
36
- ghost: {
37
- type: Boolean,
38
- default: false
39
- },
40
- textOnly: {
41
- type: Boolean,
42
- default: false
43
- },
44
- icon: {
45
- type: String,
46
- },
47
- iconRight: {
48
- type: String,
49
- },
50
- size: {
51
- type: String,
52
- default: 'big',
53
- validator: (value) => sizes.indexOf(value) !== -1
54
- },
55
- disabled: {
56
- type: [Boolean, String]
57
- }
58
- },
59
- data () {
60
- return {
61
- }
62
- },
63
- computed: {
64
- classes() {
65
- let sizeCss = 'ui-px-4 ui-py-2'
66
- if (this.size === 'medium') sizeCss = 'ui-px-4 ui-py-1'
67
- if (this.size === 'small') sizeCss = 'ui-px-2 ui-py-ui-px ui-text-sm'
68
- if (this.outline) return `${sizeCss} ui-bg-white ui-border ${this.disabled ? 'ui-border-gray-40 ui-text-gray-40' : 'ui-border-blue-60 ui-text-blue-60'}`
69
- if (this.ghost) return `${sizeCss} ${this.disabled ? 'ui-bg-gray-20 ui-text-gray-40' : 'ui-bg-blue-20 ui-text-blue-60 active:ui-shadow-inner'}`
70
- if (this.textOnly) return `${sizeCss} ${this.disabled ? 'ui-text-gray-40' : 'ui-text-blue-60'}`
71
- if (this.disabled) return `${sizeCss} ui-bg-gray-20 ui-text-gray-40`
72
- return `${sizeCss} ui-bg-blue-60 hover:ui-bg-blue-50 ui-text-white active:ui-shadow-inner`
73
- }
74
- },
75
- methods: {
76
- onClick() {
77
- if (this.disabled) return false
78
- this.$emit('click');
79
- }
80
- }
81
- }
82
- </script>