@policystudio/policy-studio-ui-vue 1.0.0 → 1.0.4

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.
@@ -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="cursor-pointer" @click="teste('Callback Action 1')">ACTION1</span>
56
- <span class="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,4 +1,5 @@
1
1
  module.exports = {
2
+ prefix: 'psui-',
2
3
  purge: ['./index.html', './src/**/*.vue,js,ts,jsx,tsx}'],
3
4
  darkMode: false, // or 'media' or 'class'
4
5
  theme: {
@@ -56,5 +57,6 @@ module.exports = {
56
57
  extend: {
57
58
  },
58
59
  },
59
- plugins: [],
60
+ plugins: [
61
+ ],
60
62
  }
@@ -1,82 +0,0 @@
1
- <template>
2
- <button
3
- class="font-bold align-middle flex rounded-md"
4
- :class="classes"
5
- @click="onClick()"
6
- >
7
- <i
8
- v-if="icon"
9
- class="my-auto material-icons mr-2"
10
- :class="{ 'text-sm': size === 'small' }"
11
- >
12
- {{ icon }}
13
- </i>
14
- <div class="flex-grow text-left">{{ label }}</div>
15
- <i
16
- v-if="iconRight" class="my-auto material-icons ml-2"
17
- :class="{ '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 = 'px-4 py-2'
66
- if (this.size === 'medium') sizeCss = 'px-4 py-1'
67
- if (this.size === 'small') sizeCss = 'px-2 py-px text-sm'
68
- if (this.outline) return `${sizeCss} bg-white border ${this.disabled ? 'border-gray-40 text-gray-40' : 'border-blue-60 text-blue-60'}`
69
- if (this.ghost) return `${sizeCss} ${this.disabled ? 'bg-gray-20 text-gray-40' : 'bg-blue-20 text-blue-60 active:shadow-inner'}`
70
- if (this.textOnly) return `${sizeCss} ${this.disabled ? 'text-gray-40' : 'text-blue-60'}`
71
- if (this.disabled) return `${sizeCss} bg-gray-20 text-gray-40`
72
- return `${sizeCss} bg-blue-60 hover:bg-blue-50 text-white active:shadow-inner`
73
- }
74
- },
75
- methods: {
76
- onClick() {
77
- if (this.disabled) return false
78
- this.$emit('click');
79
- }
80
- }
81
- }
82
- </script>