@skyservice-developers/vue-dev-kit 1.5.6 → 1.5.7

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": "@skyservice-developers/vue-dev-kit",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "description": "Vue 2 and Vue 3 developer toolkit - components and helpers",
5
5
  "type": "module",
6
6
  "main": "./dist/vue3/vue-dev-kit.cjs",
@@ -55,3 +55,17 @@ export interface DialogEmits {
55
55
  }
56
56
 
57
57
  export declare const Dialog: DefineComponent<DialogProps>
58
+
59
+ // Button component
60
+ export interface ButtonProps {
61
+ variant?: 'primary' | 'danger' | 'secondary' | 'outline'
62
+ loading?: boolean
63
+ disabled?: boolean
64
+ block?: boolean
65
+ }
66
+
67
+ export interface ButtonSlots {
68
+ 'default'?: () => any
69
+ }
70
+
71
+ export declare const Button: DefineComponent<ButtonProps>
@@ -0,0 +1,128 @@
1
+ <template>
2
+ <button
3
+ class="sky-btn"
4
+ :class="[`sky-btn-${variant}`, { 'sky-btn-block': block, 'sky-btn-loading': loading }]"
5
+ :disabled="disabled || loading"
6
+ v-bind="$attrs"
7
+ >
8
+ <span v-if="loading" class="sky-btn-spinner"></span>
9
+ <slot></slot>
10
+ </button>
11
+ </template>
12
+
13
+ <script>
14
+ export default {
15
+ name: 'Button',
16
+ inheritAttrs: false,
17
+ props: {
18
+ variant: {
19
+ type: String,
20
+ default: 'primary',
21
+ validator: (v) => ['primary', 'danger', 'secondary', 'outline'].includes(v)
22
+ },
23
+ loading: {
24
+ type: Boolean,
25
+ default: false
26
+ },
27
+ disabled: {
28
+ type: Boolean,
29
+ default: false
30
+ },
31
+ block: {
32
+ type: Boolean,
33
+ default: false
34
+ }
35
+ }
36
+ }
37
+ </script>
38
+
39
+ <style scoped>
40
+ .sky-btn {
41
+ display: inline-flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ gap: 8px;
45
+ padding: var(--sky-btn-padding, 16px 20px);
46
+ border: var(--sky-btn-border, none);
47
+ border-radius: var(--sky-btn-radius, 6px);
48
+ font-size: var(--sky-btn-font-size, 14px);
49
+ font-weight: var(--sky-btn-font-weight, 500);
50
+ line-height: 1;
51
+ cursor: pointer;
52
+ white-space: nowrap;
53
+ user-select: none;
54
+ }
55
+
56
+ .sky-btn-block {
57
+ width: 100%;
58
+ }
59
+
60
+ .sky-btn:disabled {
61
+ opacity: 0.6;
62
+ cursor: not-allowed;
63
+ }
64
+
65
+ /* Primary */
66
+ .sky-btn-primary {
67
+ background: var(--sky-btn-primary-bg, #24973f);
68
+ color: var(--sky-btn-primary-color, #fff);
69
+ }
70
+ .sky-btn-primary:hover:not(:disabled) {
71
+ background: var(--sky-btn-primary-hover-bg, #1e7a33);
72
+ }
73
+ .sky-btn-primary:active:not(:disabled) {
74
+ background: var(--sky-btn-primary-active-bg, #196b2c);
75
+ }
76
+
77
+ /* Danger */
78
+ .sky-btn-danger {
79
+ background: var(--sky-btn-danger-bg, #dc2626);
80
+ color: var(--sky-btn-danger-color, #fff);
81
+ }
82
+ .sky-btn-danger:hover:not(:disabled) {
83
+ background: var(--sky-btn-danger-hover-bg, #b91c1c);
84
+ }
85
+ .sky-btn-danger:active:not(:disabled) {
86
+ background: var(--sky-btn-danger-active-bg, #991b1b);
87
+ }
88
+
89
+ /* Secondary */
90
+ .sky-btn-secondary {
91
+ background: var(--sky-btn-secondary-bg, #f3f4f6);
92
+ color: var(--sky-btn-secondary-color, #374151);
93
+ }
94
+ .sky-btn-secondary:hover:not(:disabled) {
95
+ background: var(--sky-btn-secondary-hover-bg, #e5e7eb);
96
+ }
97
+ .sky-btn-secondary:active:not(:disabled) {
98
+ background: var(--sky-btn-secondary-active-bg, #d1d5db);
99
+ }
100
+
101
+ /* Outline */
102
+ .sky-btn-outline {
103
+ background: var(--sky-btn-outline-bg, transparent);
104
+ color: var(--sky-btn-outline-color, #374151);
105
+ border: var(--sky-btn-border, 1px solid #d1d5db);
106
+ }
107
+ .sky-btn-outline:hover:not(:disabled) {
108
+ background: var(--sky-btn-outline-hover-bg, #f3f4f6);
109
+ }
110
+ .sky-btn-outline:active:not(:disabled) {
111
+ background: var(--sky-btn-outline-active-bg, #e5e7eb);
112
+ }
113
+
114
+ /* Loading spinner */
115
+ .sky-btn-spinner {
116
+ width: 14px;
117
+ height: 14px;
118
+ border: 2px solid currentColor;
119
+ border-top-color: transparent;
120
+ border-radius: 50%;
121
+ animation: sky-btn-spin 0.6s linear infinite;
122
+ flex-shrink: 0;
123
+ }
124
+
125
+ @keyframes sky-btn-spin {
126
+ to { transform: rotate(360deg); }
127
+ }
128
+ </style>
@@ -1,5 +1,5 @@
1
1
  export { default as Header } from './Header.vue'
2
2
  export { default as Modal } from './Modal.vue'
3
3
  export { default as Dialog } from './Dialog.vue'
4
-
5
- export {default as BaseTeleport} from './BaseTeleport.vue'
4
+ export { default as Button } from './Button.vue'
5
+ export { default as BaseTeleport } from './BaseTeleport.vue'
@@ -0,0 +1,124 @@
1
+ <template>
2
+ <button
3
+ class="sky-btn"
4
+ :class="[`sky-btn-${variant}`, { 'sky-btn-block': block, 'sky-btn-loading': loading }]"
5
+ :disabled="disabled || loading"
6
+ v-bind="$attrs"
7
+ >
8
+ <span v-if="loading" class="sky-btn-spinner"></span>
9
+ <slot></slot>
10
+ </button>
11
+ </template>
12
+
13
+ <script setup>
14
+ defineProps({
15
+ variant: {
16
+ type: String,
17
+ default: 'primary',
18
+ validator: (v) => ['primary', 'danger', 'secondary', 'outline'].includes(v)
19
+ },
20
+ loading: {
21
+ type: Boolean,
22
+ default: false
23
+ },
24
+ disabled: {
25
+ type: Boolean,
26
+ default: false
27
+ },
28
+ block: {
29
+ type: Boolean,
30
+ default: false
31
+ }
32
+ })
33
+ </script>
34
+
35
+ <style scoped>
36
+ .sky-btn {
37
+ display: inline-flex;
38
+ align-items: center;
39
+ justify-content: center;
40
+ gap: 8px;
41
+ padding: var(--sky-btn-padding, 16px 20px);
42
+ border: var(--sky-btn-border, none);
43
+ border-radius: var(--sky-btn-radius, 6px);
44
+ font-size: var(--sky-btn-font-size, 14px);
45
+ font-weight: var(--sky-btn-font-weight, 500);
46
+ line-height: 1;
47
+ cursor: pointer;
48
+ white-space: nowrap;
49
+ user-select: none;
50
+ }
51
+
52
+ .sky-btn-block {
53
+ width: 100%;
54
+ }
55
+
56
+ .sky-btn:disabled {
57
+ opacity: 0.6;
58
+ cursor: not-allowed;
59
+ }
60
+
61
+ /* Primary */
62
+ .sky-btn-primary {
63
+ background: var(--sky-btn-primary-bg, #24973f);
64
+ color: var(--sky-btn-primary-color, #fff);
65
+ }
66
+ .sky-btn-primary:hover:not(:disabled) {
67
+ background: var(--sky-btn-primary-hover-bg, #1e7a33);
68
+ }
69
+ .sky-btn-primary:active:not(:disabled) {
70
+ background: var(--sky-btn-primary-active-bg, #196b2c);
71
+ }
72
+
73
+ /* Danger */
74
+ .sky-btn-danger {
75
+ background: var(--sky-btn-danger-bg, #dc2626);
76
+ color: var(--sky-btn-danger-color, #fff);
77
+ }
78
+ .sky-btn-danger:hover:not(:disabled) {
79
+ background: var(--sky-btn-danger-hover-bg, #b91c1c);
80
+ }
81
+ .sky-btn-danger:active:not(:disabled) {
82
+ background: var(--sky-btn-danger-active-bg, #991b1b);
83
+ }
84
+
85
+ /* Secondary */
86
+ .sky-btn-secondary {
87
+ background: var(--sky-btn-secondary-bg, #f3f4f6);
88
+ color: var(--sky-btn-secondary-color, #374151);
89
+ }
90
+ .sky-btn-secondary:hover:not(:disabled) {
91
+ background: var(--sky-btn-secondary-hover-bg, #e5e7eb);
92
+ }
93
+ .sky-btn-secondary:active:not(:disabled) {
94
+ background: var(--sky-btn-secondary-active-bg, #d1d5db);
95
+ }
96
+
97
+ /* Outline */
98
+ .sky-btn-outline {
99
+ background: var(--sky-btn-outline-bg, transparent);
100
+ color: var(--sky-btn-outline-color, #374151);
101
+ border: var(--sky-btn-border, 1px solid #d1d5db);
102
+ }
103
+ .sky-btn-outline:hover:not(:disabled) {
104
+ background: var(--sky-btn-outline-hover-bg, #f3f4f6);
105
+ }
106
+ .sky-btn-outline:active:not(:disabled) {
107
+ background: var(--sky-btn-outline-active-bg, #e5e7eb);
108
+ }
109
+
110
+ /* Loading spinner */
111
+ .sky-btn-spinner {
112
+ width: 14px;
113
+ height: 14px;
114
+ border: 2px solid currentColor;
115
+ border-top-color: transparent;
116
+ border-radius: 50%;
117
+ animation: sky-btn-spin 0.6s linear infinite;
118
+ flex-shrink: 0;
119
+ }
120
+
121
+ @keyframes sky-btn-spin {
122
+ to { transform: rotate(360deg); }
123
+ }
124
+ </style>
@@ -1,8 +1,7 @@
1
1
  export { default as Header } from './Header.vue'
2
2
  export { default as Dialog } from './Dialog.vue'
3
-
4
3
  export { default as Modal } from './Modal.vue'
5
-
6
- export {default as BaseTeleport} from './BaseTeleport.vue'
4
+ export { default as Button } from './Button.vue'
5
+ export { default as BaseTeleport } from './BaseTeleport.vue'
7
6
 
8
7