@a-vision-software/vue-input-components 1.1.30 → 1.1.31

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/dist/index.d.ts CHANGED
@@ -1,58 +1,96 @@
1
1
  import { ComponentOptionsMixin } from 'vue';
2
2
  import { ComponentProvideOptions } from 'vue';
3
3
  import { DefineComponent } from 'vue';
4
+ import { ExtractPropTypes } from 'vue';
5
+ import { PropType } from 'vue';
4
6
  import { PublicProps } from 'vue';
5
7
 
6
- declare type __VLS_Props = {
7
- modelValue: string;
8
- label?: string;
9
- type?: string;
10
- icon?: string;
11
- placeholder?: string;
12
- required?: boolean;
13
- disabled?: boolean;
14
- error?: string;
15
- success?: string;
16
- labelPosition?: 'top' | 'left';
17
- labelAlign?: 'left' | 'right' | 'center';
18
- totalWidth?: string;
19
- inputWidth?: string;
20
- labelWidth?: string;
21
- autosave?: (value: string) => Promise<void>;
22
- isTextarea?: boolean;
23
- maxHeight?: string;
24
- height?: string;
8
+ declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
9
+
10
+ declare type __VLS_NonUndefinedable_2<T> = T extends undefined ? never : T;
11
+
12
+ declare type __VLS_TypePropsToRuntimeProps<T> = {
13
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
14
+ type: PropType<__VLS_NonUndefinedable<T[K]>>;
15
+ } : {
16
+ type: PropType<T[K]>;
17
+ required: true;
18
+ };
25
19
  };
26
20
 
27
- declare type __VLS_Props_2 = {
28
- icon?: string;
29
- uploadUrl?: string;
21
+ declare type __VLS_TypePropsToRuntimeProps_2<T> = {
22
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
23
+ type: PropType<__VLS_NonUndefinedable_2<T[K]>>;
24
+ } : {
25
+ type: PropType<T[K]>;
26
+ required: true;
27
+ };
30
28
  };
31
29
 
32
- export declare const FileUpload: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
33
- "upload-complete": (files: File[]) => any;
34
- "upload-error": (error: string) => any;
35
- "files-selected": (files: File[]) => any;
36
- "start-upload": (files: File[]) => any;
37
- }, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{
30
+ export declare const FileUpload: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_2<{
31
+ icon?: string | undefined;
32
+ uploadUrl?: string | undefined;
33
+ }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
34
+ "upload-complete": (files: File[]) => void;
35
+ "upload-error": (error: string) => void;
36
+ "files-selected": (files: File[]) => void;
37
+ "start-upload": (files: File[]) => void;
38
+ }, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_2<{
39
+ icon?: string | undefined;
40
+ uploadUrl?: string | undefined;
41
+ }>>> & Readonly<{
38
42
  "onUpload-complete"?: ((files: File[]) => any) | undefined;
39
43
  "onUpload-error"?: ((error: string) => any) | undefined;
40
44
  "onFiles-selected"?: ((files: File[]) => any) | undefined;
41
45
  "onStart-upload"?: ((files: File[]) => any) | undefined;
42
- }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
43
- fileInput: HTMLInputElement;
44
- }, HTMLDivElement>;
46
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
45
47
 
46
- export declare const TextInput: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
47
- "update:modelValue": (value: string) => any;
48
- changed: () => any;
49
- saved: () => any;
50
- }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
48
+ export declare const TextInput: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
49
+ modelValue: string;
50
+ label?: string | undefined;
51
+ type?: string | undefined;
52
+ icon?: string | undefined;
53
+ placeholder?: string | undefined;
54
+ required?: boolean | undefined;
55
+ disabled?: boolean | undefined;
56
+ error?: string | undefined;
57
+ success?: string | undefined;
58
+ labelPosition?: "top" | "left" | undefined;
59
+ labelAlign?: "left" | "right" | "center" | undefined;
60
+ totalWidth?: string | undefined;
61
+ inputWidth?: string | undefined;
62
+ labelWidth?: string | undefined;
63
+ autosave?: ((value: string) => Promise<void>) | undefined;
64
+ isTextarea?: boolean | undefined;
65
+ maxHeight?: string | undefined;
66
+ height?: string | undefined;
67
+ }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
68
+ "update:modelValue": (value: string) => void;
69
+ changed: () => void;
70
+ saved: () => void;
71
+ }, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
72
+ modelValue: string;
73
+ label?: string | undefined;
74
+ type?: string | undefined;
75
+ icon?: string | undefined;
76
+ placeholder?: string | undefined;
77
+ required?: boolean | undefined;
78
+ disabled?: boolean | undefined;
79
+ error?: string | undefined;
80
+ success?: string | undefined;
81
+ labelPosition?: "top" | "left" | undefined;
82
+ labelAlign?: "left" | "right" | "center" | undefined;
83
+ totalWidth?: string | undefined;
84
+ inputWidth?: string | undefined;
85
+ labelWidth?: string | undefined;
86
+ autosave?: ((value: string) => Promise<void>) | undefined;
87
+ isTextarea?: boolean | undefined;
88
+ maxHeight?: string | undefined;
89
+ height?: string | undefined;
90
+ }>>> & Readonly<{
51
91
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
52
92
  onChanged?: (() => any) | undefined;
53
93
  onSaved?: (() => any) | undefined;
54
- }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
55
- inputRef: HTMLTextAreaElement;
56
- }, HTMLDivElement>;
94
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
57
95
 
58
96
  export { }
package/package.json CHANGED
@@ -1,10 +1,32 @@
1
1
  {
2
2
  "name": "@a-vision-software/vue-input-components",
3
- "version": "1.1.30",
3
+ "version": "1.1.31",
4
4
  "description": "A collection of reusable Vue 3 input components with TypeScript support",
5
+ "author": "A-Vision Software",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/a-vision-software/vue-input-components"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/a-vision-software/vue-input-components/issues"
13
+ },
14
+ "homepage": "https://github.com/a-vision-software/vue-input-components#readme",
15
+ "keywords": [
16
+ "vue",
17
+ "vue3",
18
+ "components",
19
+ "input",
20
+ "form",
21
+ "typescript",
22
+ "file-upload",
23
+ "text-input",
24
+ "textarea"
25
+ ],
5
26
  "type": "module",
6
27
  "files": [
7
- "dist"
28
+ "dist",
29
+ "src"
8
30
  ],
9
31
  "main": "./dist/vue-input-components.umd.js",
10
32
  "module": "./dist/vue-input-components.es.js",
@@ -23,50 +45,46 @@
23
45
  ],
24
46
  "scripts": {
25
47
  "dev": "vite",
26
- "build": "run-p type-check \"build-only {@}\" --",
27
- "preview": "vite preview",
48
+ "build": "npm run type-check && npm run build-only",
28
49
  "build-only": "vite build",
29
50
  "type-check": "vue-tsc --noEmit",
30
- "lint": "eslint . --fix",
31
- "format": "prettier --write src/"
32
- },
33
- "keywords": [
34
- "vue",
35
- "vue3",
36
- "components",
37
- "input",
38
- "form",
39
- "typescript"
40
- ],
41
- "author": "",
42
- "license": "MIT",
43
- "dependencies": {
44
- "@fortawesome/fontawesome-svg-core": "^6.7.2",
45
- "@fortawesome/free-regular-svg-icons": "^6.7.2",
46
- "@fortawesome/free-solid-svg-icons": "^6.7.2",
47
- "@fortawesome/vue-fontawesome": "^3.0.8",
48
- "vue": "^3.5.13"
51
+ "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix",
52
+ "format": "prettier --write \"src/**/*.{ts,tsx,vue,css}\"",
53
+ "test": "vitest",
54
+ "prepublishOnly": "npm run build"
49
55
  },
50
56
  "peerDependencies": {
51
- "vue": "^3.5.13"
57
+ "vue": "^3.5.0"
58
+ },
59
+ "dependencies": {
60
+ "@fortawesome/fontawesome-svg-core": "^6.7.0",
61
+ "@fortawesome/free-regular-svg-icons": "^6.7.0",
62
+ "@fortawesome/free-solid-svg-icons": "^6.7.0",
63
+ "@fortawesome/vue-fontawesome": "^3.0.0"
52
64
  },
53
65
  "devDependencies": {
54
- "@tsconfig/node22": "^22.0.1",
55
- "@types/node": "^22.14.0",
56
- "@vitejs/plugin-vue": "^5.2.3",
57
- "@vue/eslint-config-prettier": "^10.2.0",
58
- "@vue/eslint-config-typescript": "^14.5.0",
59
- "@vue/tsconfig": "^0.7.0",
60
- "eslint": "^9.22.0",
61
- "eslint-plugin-vue": "~10.0.0",
62
- "jiti": "^2.4.2",
63
- "npm-run-all2": "^7.0.2",
64
- "prettier": "3.5.3",
65
- "typescript": "~5.8.0",
66
- "vite": "^6.2.4",
67
- "vite-plugin-dts": "^4.5.3",
68
- "vite-plugin-vue-devtools": "^7.7.2",
69
- "vue-router": "^4.5.0",
70
- "vue-tsc": "^2.2.8"
66
+ "@tsconfig/node20": "^20.1.2",
67
+ "@types/node": "^20.11.0",
68
+ "@vitejs/plugin-vue": "^5.0.0",
69
+ "@vue/eslint-config-prettier": "^9.0.0",
70
+ "@vue/eslint-config-typescript": "^12.0.0",
71
+ "@vue/test-utils": "^2.4.0",
72
+ "@vue/tsconfig": "^0.5.1",
73
+ "eslint": "^8.56.0",
74
+ "eslint-plugin-vue": "^9.21.0",
75
+ "npm-run-all": "^4.1.5",
76
+ "prettier": "^3.2.0",
77
+ "typescript": "~5.3.0",
78
+ "vite": "^5.0.0",
79
+ "vite-plugin-dts": "^3.7.0",
80
+ "vitest": "^1.2.0",
81
+ "vue-router": "^4.2.0",
82
+ "vue-tsc": "^1.8.0"
83
+ },
84
+ "engines": {
85
+ "node": ">=18.0.0"
86
+ },
87
+ "publishConfig": {
88
+ "access": "public"
71
89
  }
72
90
  }
package/src/App.vue ADDED
@@ -0,0 +1,48 @@
1
+ <script setup lang="ts">
2
+ import { RouterView } from 'vue-router'
3
+ </script>
4
+
5
+ <template>
6
+ <div id="app">
7
+ <router-view />
8
+ </div>
9
+ </template>
10
+
11
+ <style>
12
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
13
+
14
+ *,
15
+ *::before,
16
+ *::after {
17
+ box-sizing: border-box;
18
+ }
19
+
20
+ html,
21
+ body {
22
+ padding: 0;
23
+ margin: 0;
24
+ font-family:
25
+ 'Inter',
26
+ -apple-system,
27
+ BlinkMacSystemFont,
28
+ 'Segoe UI',
29
+ Roboto,
30
+ Oxygen,
31
+ Ubuntu,
32
+ Cantarell,
33
+ 'Fira Sans',
34
+ 'Droid Sans',
35
+ 'Helvetica Neue',
36
+ sans-serif;
37
+ -webkit-font-smoothing: antialiased;
38
+ -moz-osx-font-smoothing: grayscale;
39
+ }
40
+
41
+ #app {
42
+ min-height: 100vh;
43
+ width: 100vw;
44
+ display: grid;
45
+ grid-template-rows: 1fr;
46
+ grid-template-columns: 1fr;
47
+ }
48
+ </style>
@@ -0,0 +1,67 @@
1
+ :root {
2
+ /* Base colors */
3
+ --primary-color: #3498db;
4
+ --primary-color-light: rgba(52, 152, 219, 0.2);
5
+ --secondary-color: #2ecc71;
6
+
7
+ /* Text colors */
8
+ --text-color: #2c3e50;
9
+ --text-color-light: #7f8c8d;
10
+
11
+ /* UI colors */
12
+ --border-color: #dcdfe6;
13
+ --icon-color: #95a5a6;
14
+
15
+ /* State colors */
16
+ --error-color: #e74c3c;
17
+ --error-color-light: rgba(231, 76, 60, 0.2);
18
+ --success-color: #2ecc71;
19
+ --success-color-light: rgba(46, 204, 113, 0.2);
20
+ --warning-color: #f1c40f;
21
+ --warning-color-light: rgba(241, 196, 15, 0.2);
22
+
23
+ /* Background colors */
24
+ --disabled-color: #bdc3c7;
25
+ --disabled-background: #f5f7fa;
26
+ --card-bg: #ffffff;
27
+ --background-color: #f8f9fa;
28
+
29
+ /* Input colors */
30
+ --input-bg-color: rgba(255, 255, 255, 0.8);
31
+ --input-bg-hover: rgba(0, 0, 0, 0.05);
32
+ --input-bg-disabled: rgba(0, 0, 0, 0.05);
33
+
34
+ /* Text Colors */
35
+ --text-muted: #6c757d;
36
+
37
+ /* Border Colors */
38
+ --input-bg: #ffffff;
39
+ --input-bg-disabled: #e9ecef;
40
+
41
+ /* Status Colors */
42
+ --danger-color: #dc3545;
43
+ --success-color: #28a745;
44
+ --warning-color: #ffc107;
45
+
46
+ /* Shadow Colors */
47
+ --shadow-color: rgba(74, 108, 247, 0.25);
48
+
49
+ /* Typography */
50
+ --line-height: 20px;
51
+
52
+ /* File Upload Colors */
53
+ --upload-border-color: var(--border-color);
54
+ --upload-bg-color: var(--background-color);
55
+ --upload-dragging-border-color: var(--primary-color);
56
+ --upload-dragging-bg-color: var(--primary-color-light);
57
+ --upload-has-files-border-color: var(--success-color);
58
+ --upload-has-files-bg-color: var(--success-color-light);
59
+ --upload-icon-color: var(--icon-color);
60
+ --upload-text-color: var(--text-color-light);
61
+ --progress-bg-color: var(--disabled-background);
62
+ --progress-color: var(--primary-color);
63
+ --success-bg-color: var(--success-color-light);
64
+ --success-text-color: var(--success-color);
65
+ --error-bg-color: var(--error-color-light);
66
+ --error-text-color: var(--error-color);
67
+ }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 261.76 226.69"><path d="M161.096.001l-30.225 52.351L100.647.001H-.005l130.877 226.688L261.749.001z" fill="#41b883"/><path d="M161.096.001l-30.225 52.351L100.647.001H52.346l78.526 136.01L209.398.001z" fill="#34495e"/></svg>
@@ -0,0 +1,160 @@
1
+ :root {
2
+ /* Typography */
3
+ --font-family:
4
+ -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
5
+ --font-size-xs: 0.75rem;
6
+ --font-size-sm: 0.875rem;
7
+ --font-size-base: 1rem;
8
+ --font-size-lg: 1.125rem;
9
+ --font-size-xl: 1.25rem;
10
+ --font-weight-normal: 400;
11
+ --font-weight-medium: 500;
12
+ --font-weight-bold: 600;
13
+ --line-height-tight: 1.25;
14
+ --line-height-base: 1.5;
15
+ --line-height-loose: 1.75;
16
+
17
+ /* Spacing */
18
+ --spacing-xs: 0.25rem;
19
+ --spacing-sm: 0.5rem;
20
+ --spacing-md: 1rem;
21
+ --spacing-lg: 1.5rem;
22
+ --spacing-xl: 2rem;
23
+
24
+ /* Borders */
25
+ --border-radius-sm: 0.25rem;
26
+ --border-radius-md: 0.375rem;
27
+ --border-radius-lg: 0.5rem;
28
+ --border-width: 1px;
29
+ --border-width-thick: 2px;
30
+
31
+ /* Shadows */
32
+ --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
33
+ --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1);
34
+ --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
35
+
36
+ /* Transitions */
37
+ --transition-fast: 150ms;
38
+ --transition-base: 200ms;
39
+ --transition-slow: 300ms;
40
+ --transition-timing: ease-in-out;
41
+ }
42
+
43
+ /* Base styles */
44
+ html {
45
+ box-sizing: border-box;
46
+ font-size: 16px;
47
+ }
48
+
49
+ *,
50
+ *:before,
51
+ *:after {
52
+ box-sizing: inherit;
53
+ }
54
+
55
+ body {
56
+ margin: 0;
57
+ padding: 0;
58
+ font-family: var(--font-family);
59
+ font-size: var(--font-size-base);
60
+ line-height: var(--line-height-base);
61
+ color: var(--text-color);
62
+ background-color: var(--background-color);
63
+ -webkit-font-smoothing: antialiased;
64
+ -moz-osx-font-smoothing: grayscale;
65
+ }
66
+
67
+ h1,
68
+ h2,
69
+ h3,
70
+ h4,
71
+ h5,
72
+ h6 {
73
+ margin: 0;
74
+ font-weight: var(--font-weight-bold);
75
+ line-height: var(--line-height-tight);
76
+ color: var(--text-color);
77
+ }
78
+
79
+ p {
80
+ margin: 0 0 var(--spacing-md) 0;
81
+ }
82
+
83
+ a {
84
+ color: var(--primary-color);
85
+ text-decoration: none;
86
+ transition: color var(--transition-base) var(--transition-timing);
87
+ }
88
+
89
+ a:hover {
90
+ color: var(--primary-color-light);
91
+ }
92
+
93
+ /* Utility classes */
94
+ .text-error {
95
+ color: var(--error-color);
96
+ }
97
+
98
+ .text-success {
99
+ color: var(--success-color);
100
+ }
101
+
102
+ .text-warning {
103
+ color: var(--warning-color);
104
+ }
105
+
106
+ .text-disabled {
107
+ color: var(--disabled-color);
108
+ }
109
+
110
+ .bg-card {
111
+ background-color: var(--card-bg);
112
+ }
113
+
114
+ .shadow-sm {
115
+ box-shadow: var(--shadow-sm);
116
+ }
117
+
118
+ .shadow-md {
119
+ box-shadow: var(--shadow-md);
120
+ }
121
+
122
+ .shadow-lg {
123
+ box-shadow: var(--shadow-lg);
124
+ }
125
+
126
+ .rounded-sm {
127
+ border-radius: var(--border-radius-sm);
128
+ }
129
+
130
+ .rounded-md {
131
+ border-radius: var(--border-radius-md);
132
+ }
133
+
134
+ .rounded-lg {
135
+ border-radius: var(--border-radius-lg);
136
+ }
137
+
138
+ /* Responsive breakpoints */
139
+ @media (max-width: 640px) {
140
+ html {
141
+ font-size: 14px;
142
+ }
143
+ }
144
+
145
+ @media (min-width: 1200px) {
146
+ html {
147
+ font-size: 16px;
148
+ }
149
+ }
150
+
151
+ /* Print styles */
152
+ @media print {
153
+ body {
154
+ background: white;
155
+ }
156
+
157
+ @page {
158
+ margin: 2cm;
159
+ }
160
+ }