sprintify-ui 0.0.26 → 0.0.28
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/sprintify-ui.es.js +2204 -2121
- package/dist/types/src/components/BaseBadge.vue.d.ts +46 -8
- package/dist/types/src/components/BaseInput.vue.d.ts +66 -1
- package/dist/types/src/components/BaseInputPercent.vue.d.ts +133 -0
- package/package.json +1 -1
- package/src/components/BaseBadge.stories.js +52 -7
- package/src/components/BaseBadge.vue +51 -0
- package/src/components/BaseInput.stories.js +41 -1
- package/src/components/BaseInput.vue +104 -15
- package/src/components/BaseInputPercent.stories.js +43 -0
- package/src/components/BaseInputPercent.vue +116 -0
- package/src/components/BaseModalCenter.stories.js +4 -2
- package/src/components/BaseModalCenter.vue +1 -1
- package/src/components/BaseModalSide.stories.js +4 -2
|
@@ -4,18 +4,28 @@ declare const _default: {
|
|
|
4
4
|
$: import("vue").ComponentInternalInstance;
|
|
5
5
|
$data: {};
|
|
6
6
|
$props: Partial<{
|
|
7
|
-
color: "gray" | "red" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink";
|
|
7
|
+
color: "gray" | "red" | "orange" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink";
|
|
8
|
+
icon: string | undefined;
|
|
8
9
|
size: "base" | "lg";
|
|
10
|
+
contrast: "low" | "high";
|
|
9
11
|
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
|
12
|
+
contrast: {
|
|
13
|
+
default: string;
|
|
14
|
+
type: PropType<"low" | "high">;
|
|
15
|
+
};
|
|
10
16
|
color: {
|
|
11
17
|
default: string;
|
|
12
|
-
type: PropType<"gray" | "red" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink">;
|
|
18
|
+
type: PropType<"gray" | "red" | "orange" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink">;
|
|
13
19
|
};
|
|
14
20
|
size: {
|
|
15
21
|
default: string;
|
|
16
22
|
type: PropType<"base" | "lg">;
|
|
17
23
|
};
|
|
18
|
-
|
|
24
|
+
icon: {
|
|
25
|
+
default: undefined;
|
|
26
|
+
type: PropType<string | undefined>;
|
|
27
|
+
};
|
|
28
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "color" | "icon" | "size" | "contrast">;
|
|
19
29
|
$attrs: {
|
|
20
30
|
[x: string]: unknown;
|
|
21
31
|
};
|
|
@@ -30,17 +40,27 @@ declare const _default: {
|
|
|
30
40
|
$emit: (event: string, ...args: any[]) => void;
|
|
31
41
|
$el: any;
|
|
32
42
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
43
|
+
contrast: {
|
|
44
|
+
default: string;
|
|
45
|
+
type: PropType<"low" | "high">;
|
|
46
|
+
};
|
|
33
47
|
color: {
|
|
34
48
|
default: string;
|
|
35
|
-
type: PropType<"gray" | "red" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink">;
|
|
49
|
+
type: PropType<"gray" | "red" | "orange" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink">;
|
|
36
50
|
};
|
|
37
51
|
size: {
|
|
38
52
|
default: string;
|
|
39
53
|
type: PropType<"base" | "lg">;
|
|
40
54
|
};
|
|
55
|
+
icon: {
|
|
56
|
+
default: undefined;
|
|
57
|
+
type: PropType<string | undefined>;
|
|
58
|
+
};
|
|
41
59
|
}>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
42
|
-
color: "gray" | "red" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink";
|
|
60
|
+
color: "gray" | "red" | "orange" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink";
|
|
61
|
+
icon: string | undefined;
|
|
43
62
|
size: "base" | "lg";
|
|
63
|
+
contrast: "low" | "high";
|
|
44
64
|
}, {}, string> & {
|
|
45
65
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
46
66
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -62,30 +82,48 @@ declare const _default: {
|
|
|
62
82
|
$nextTick: typeof import("vue").nextTick;
|
|
63
83
|
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
64
84
|
} & Readonly<import("vue").ExtractPropTypes<{
|
|
85
|
+
contrast: {
|
|
86
|
+
default: string;
|
|
87
|
+
type: PropType<"low" | "high">;
|
|
88
|
+
};
|
|
65
89
|
color: {
|
|
66
90
|
default: string;
|
|
67
|
-
type: PropType<"gray" | "red" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink">;
|
|
91
|
+
type: PropType<"gray" | "red" | "orange" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink">;
|
|
68
92
|
};
|
|
69
93
|
size: {
|
|
70
94
|
default: string;
|
|
71
95
|
type: PropType<"base" | "lg">;
|
|
72
96
|
};
|
|
97
|
+
icon: {
|
|
98
|
+
default: undefined;
|
|
99
|
+
type: PropType<string | undefined>;
|
|
100
|
+
};
|
|
73
101
|
}>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {};
|
|
74
102
|
__isFragment?: undefined;
|
|
75
103
|
__isTeleport?: undefined;
|
|
76
104
|
__isSuspense?: undefined;
|
|
77
105
|
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
106
|
+
contrast: {
|
|
107
|
+
default: string;
|
|
108
|
+
type: PropType<"low" | "high">;
|
|
109
|
+
};
|
|
78
110
|
color: {
|
|
79
111
|
default: string;
|
|
80
|
-
type: PropType<"gray" | "red" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink">;
|
|
112
|
+
type: PropType<"gray" | "red" | "orange" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink">;
|
|
81
113
|
};
|
|
82
114
|
size: {
|
|
83
115
|
default: string;
|
|
84
116
|
type: PropType<"base" | "lg">;
|
|
85
117
|
};
|
|
118
|
+
icon: {
|
|
119
|
+
default: undefined;
|
|
120
|
+
type: PropType<string | undefined>;
|
|
121
|
+
};
|
|
86
122
|
}>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
87
|
-
color: "gray" | "red" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink";
|
|
123
|
+
color: "gray" | "red" | "orange" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink";
|
|
124
|
+
icon: string | undefined;
|
|
88
125
|
size: "base" | "lg";
|
|
126
|
+
contrast: "low" | "high";
|
|
89
127
|
}, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
90
128
|
$slots: {
|
|
91
129
|
default: (_: {}) => any;
|
|
@@ -39,7 +39,35 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
39
39
|
default: boolean;
|
|
40
40
|
type: BooleanConstructor;
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
iconLeft: {
|
|
43
|
+
default: undefined;
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
};
|
|
46
|
+
iconRight: {
|
|
47
|
+
default: undefined;
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
};
|
|
50
|
+
prefix: {
|
|
51
|
+
default: undefined;
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
};
|
|
54
|
+
suffix: {
|
|
55
|
+
default: undefined;
|
|
56
|
+
type: StringConstructor;
|
|
57
|
+
};
|
|
58
|
+
hasError: {
|
|
59
|
+
default: boolean;
|
|
60
|
+
type: BooleanConstructor;
|
|
61
|
+
};
|
|
62
|
+
min: {
|
|
63
|
+
default: undefined;
|
|
64
|
+
type: NumberConstructor;
|
|
65
|
+
};
|
|
66
|
+
max: {
|
|
67
|
+
default: undefined;
|
|
68
|
+
type: NumberConstructor;
|
|
69
|
+
};
|
|
70
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "focus" | "blur")[], "update:modelValue" | "focus" | "blur", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
43
71
|
modelValue: {
|
|
44
72
|
default: string;
|
|
45
73
|
type: PropType<string | number | null>;
|
|
@@ -79,7 +107,37 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
79
107
|
default: boolean;
|
|
80
108
|
type: BooleanConstructor;
|
|
81
109
|
};
|
|
110
|
+
iconLeft: {
|
|
111
|
+
default: undefined;
|
|
112
|
+
type: StringConstructor;
|
|
113
|
+
};
|
|
114
|
+
iconRight: {
|
|
115
|
+
default: undefined;
|
|
116
|
+
type: StringConstructor;
|
|
117
|
+
};
|
|
118
|
+
prefix: {
|
|
119
|
+
default: undefined;
|
|
120
|
+
type: StringConstructor;
|
|
121
|
+
};
|
|
122
|
+
suffix: {
|
|
123
|
+
default: undefined;
|
|
124
|
+
type: StringConstructor;
|
|
125
|
+
};
|
|
126
|
+
hasError: {
|
|
127
|
+
default: boolean;
|
|
128
|
+
type: BooleanConstructor;
|
|
129
|
+
};
|
|
130
|
+
min: {
|
|
131
|
+
default: undefined;
|
|
132
|
+
type: NumberConstructor;
|
|
133
|
+
};
|
|
134
|
+
max: {
|
|
135
|
+
default: undefined;
|
|
136
|
+
type: NumberConstructor;
|
|
137
|
+
};
|
|
82
138
|
}>> & {
|
|
139
|
+
onFocus?: ((...args: any[]) => any) | undefined;
|
|
140
|
+
onBlur?: ((...args: any[]) => any) | undefined;
|
|
83
141
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
84
142
|
}, {
|
|
85
143
|
required: boolean;
|
|
@@ -89,7 +147,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
89
147
|
modelValue: string | number | null;
|
|
90
148
|
placeholder: string;
|
|
91
149
|
disabled: boolean;
|
|
150
|
+
min: number;
|
|
151
|
+
max: number;
|
|
92
152
|
autocomplete: boolean;
|
|
93
153
|
preventSubmit: boolean;
|
|
154
|
+
iconLeft: string;
|
|
155
|
+
iconRight: string;
|
|
156
|
+
prefix: string;
|
|
157
|
+
suffix: string;
|
|
158
|
+
hasError: boolean;
|
|
94
159
|
}>;
|
|
95
160
|
export default _default;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
/**
|
|
4
|
+
* The value of the input. Can be a number or null.
|
|
5
|
+
* 0.1 = 10%
|
|
6
|
+
* 0.5 = 50%
|
|
7
|
+
* 1 = 100%
|
|
8
|
+
*/
|
|
9
|
+
modelValue: {
|
|
10
|
+
default: undefined;
|
|
11
|
+
type: PropType<string | number | null>;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The step of the input. Can be a number or null.
|
|
15
|
+
*/
|
|
16
|
+
step: {
|
|
17
|
+
default: number;
|
|
18
|
+
type: NumberConstructor;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Prevents submit when pressing 'Enter' while the input is focused.
|
|
22
|
+
*/
|
|
23
|
+
preventSubmit: {
|
|
24
|
+
default: boolean;
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
};
|
|
27
|
+
name: {
|
|
28
|
+
default: undefined;
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
};
|
|
31
|
+
placeholder: {
|
|
32
|
+
default: string;
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
};
|
|
35
|
+
disabled: {
|
|
36
|
+
default: boolean;
|
|
37
|
+
type: BooleanConstructor;
|
|
38
|
+
};
|
|
39
|
+
required: {
|
|
40
|
+
default: boolean;
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
};
|
|
43
|
+
icon: {
|
|
44
|
+
default: undefined;
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
};
|
|
47
|
+
hasError: {
|
|
48
|
+
default: boolean;
|
|
49
|
+
type: BooleanConstructor;
|
|
50
|
+
};
|
|
51
|
+
min: {
|
|
52
|
+
default: undefined;
|
|
53
|
+
type: NumberConstructor;
|
|
54
|
+
};
|
|
55
|
+
max: {
|
|
56
|
+
default: undefined;
|
|
57
|
+
type: NumberConstructor;
|
|
58
|
+
};
|
|
59
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "focus" | "blur")[], "update:modelValue" | "focus" | "blur", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
60
|
+
/**
|
|
61
|
+
* The value of the input. Can be a number or null.
|
|
62
|
+
* 0.1 = 10%
|
|
63
|
+
* 0.5 = 50%
|
|
64
|
+
* 1 = 100%
|
|
65
|
+
*/
|
|
66
|
+
modelValue: {
|
|
67
|
+
default: undefined;
|
|
68
|
+
type: PropType<string | number | null>;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* The step of the input. Can be a number or null.
|
|
72
|
+
*/
|
|
73
|
+
step: {
|
|
74
|
+
default: number;
|
|
75
|
+
type: NumberConstructor;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Prevents submit when pressing 'Enter' while the input is focused.
|
|
79
|
+
*/
|
|
80
|
+
preventSubmit: {
|
|
81
|
+
default: boolean;
|
|
82
|
+
type: BooleanConstructor;
|
|
83
|
+
};
|
|
84
|
+
name: {
|
|
85
|
+
default: undefined;
|
|
86
|
+
type: StringConstructor;
|
|
87
|
+
};
|
|
88
|
+
placeholder: {
|
|
89
|
+
default: string;
|
|
90
|
+
type: StringConstructor;
|
|
91
|
+
};
|
|
92
|
+
disabled: {
|
|
93
|
+
default: boolean;
|
|
94
|
+
type: BooleanConstructor;
|
|
95
|
+
};
|
|
96
|
+
required: {
|
|
97
|
+
default: boolean;
|
|
98
|
+
type: BooleanConstructor;
|
|
99
|
+
};
|
|
100
|
+
icon: {
|
|
101
|
+
default: undefined;
|
|
102
|
+
type: StringConstructor;
|
|
103
|
+
};
|
|
104
|
+
hasError: {
|
|
105
|
+
default: boolean;
|
|
106
|
+
type: BooleanConstructor;
|
|
107
|
+
};
|
|
108
|
+
min: {
|
|
109
|
+
default: undefined;
|
|
110
|
+
type: NumberConstructor;
|
|
111
|
+
};
|
|
112
|
+
max: {
|
|
113
|
+
default: undefined;
|
|
114
|
+
type: NumberConstructor;
|
|
115
|
+
};
|
|
116
|
+
}>> & {
|
|
117
|
+
onFocus?: ((...args: any[]) => any) | undefined;
|
|
118
|
+
onBlur?: ((...args: any[]) => any) | undefined;
|
|
119
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
120
|
+
}, {
|
|
121
|
+
required: boolean;
|
|
122
|
+
name: string;
|
|
123
|
+
step: number;
|
|
124
|
+
icon: string;
|
|
125
|
+
modelValue: string | number | null;
|
|
126
|
+
placeholder: string;
|
|
127
|
+
disabled: boolean;
|
|
128
|
+
min: number;
|
|
129
|
+
max: number;
|
|
130
|
+
preventSubmit: boolean;
|
|
131
|
+
hasError: boolean;
|
|
132
|
+
}>;
|
|
133
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@ import BaseBadge from './BaseBadge.vue';
|
|
|
3
3
|
const colors = [
|
|
4
4
|
'gray',
|
|
5
5
|
'red',
|
|
6
|
+
'orange',
|
|
6
7
|
'yellow',
|
|
7
8
|
'green',
|
|
8
9
|
'blue',
|
|
@@ -25,6 +26,10 @@ export default {
|
|
|
25
26
|
control: { type: 'select' },
|
|
26
27
|
options: sizes,
|
|
27
28
|
},
|
|
29
|
+
contrast: {
|
|
30
|
+
control: { type: 'select' },
|
|
31
|
+
options: ['low', 'high'],
|
|
32
|
+
},
|
|
28
33
|
},
|
|
29
34
|
};
|
|
30
35
|
|
|
@@ -35,27 +40,67 @@ const Template = (args) => ({
|
|
|
35
40
|
},
|
|
36
41
|
template: `
|
|
37
42
|
<BaseBadge v-bind="args">
|
|
38
|
-
|
|
43
|
+
Urgent
|
|
39
44
|
</BaseBadge>
|
|
40
45
|
`,
|
|
41
46
|
});
|
|
42
47
|
|
|
43
48
|
export const Demo = Template.bind({});
|
|
44
|
-
Demo.args = {
|
|
49
|
+
Demo.args = {
|
|
50
|
+
color: 'red',
|
|
51
|
+
icon: 'heroicons:exclamation-triangle-20-solid',
|
|
52
|
+
contrast: 'high',
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const Colors = (args) => ({
|
|
56
|
+
components: { BaseBadge },
|
|
57
|
+
setup() {
|
|
58
|
+
return { args, colors, sizes };
|
|
59
|
+
},
|
|
60
|
+
template: `
|
|
61
|
+
<div v-for="color in colors" :key="color">
|
|
62
|
+
<p class="text-xs text-slate-600 leading-tight mb-1">{{ color }}</p>
|
|
63
|
+
<BaseBadge v-bind="args" :color="color" icon="heroicons:beaker-20-solid">
|
|
64
|
+
Administrator
|
|
65
|
+
</BaseBadge>
|
|
66
|
+
</div>
|
|
67
|
+
`,
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
Colors.args = {
|
|
71
|
+
contrast: 'high',
|
|
72
|
+
};
|
|
45
73
|
|
|
46
|
-
export const
|
|
74
|
+
export const Contrast = (args) => ({
|
|
47
75
|
components: { BaseBadge },
|
|
48
76
|
setup() {
|
|
49
77
|
return { args, colors, sizes };
|
|
50
78
|
},
|
|
51
79
|
template: `
|
|
52
|
-
|
|
80
|
+
<div v-for="color in colors" :key="color">
|
|
81
|
+
<p class="text-xs text-slate-600 leading-tight mb-1">{{ color }}</p>
|
|
82
|
+
<BaseBadge v-bind="args" :color="color" icon="heroicons:beaker-20-solid">
|
|
53
83
|
Administrator
|
|
54
84
|
</BaseBadge>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
85
|
+
</div>
|
|
86
|
+
`,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
Contrast.args = {
|
|
90
|
+
contrast: 'low',
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export const Sizes = (args) => ({
|
|
94
|
+
components: { BaseBadge },
|
|
95
|
+
setup() {
|
|
96
|
+
return { args, colors, sizes };
|
|
97
|
+
},
|
|
98
|
+
template: `
|
|
99
|
+
<div v-for="size in sizes" :key="size">
|
|
100
|
+
<p class="text-xs text-slate-600 leading-tight mb-1">{{ size }}</p>
|
|
101
|
+
<BaseBadge v-bind="args" :size="size" icon="heroicons:beaker-20-solid">
|
|
58
102
|
Administrator
|
|
59
103
|
</BaseBadge>
|
|
104
|
+
</div>
|
|
60
105
|
`,
|
|
61
106
|
});
|
|
@@ -3,19 +3,26 @@
|
|
|
3
3
|
class="inline-flex items-center rounded-full font-medium"
|
|
4
4
|
:class="[colorClasses, sizeClasses]"
|
|
5
5
|
>
|
|
6
|
+
<BaseIcon v-if="icon" :icon="icon" :class="iconSizeClasses"> </BaseIcon>
|
|
6
7
|
<slot />
|
|
7
8
|
</span>
|
|
8
9
|
</template>
|
|
9
10
|
|
|
10
11
|
<script lang="ts" setup>
|
|
11
12
|
import { PropType } from 'vue';
|
|
13
|
+
import { BaseIcon } from '.';
|
|
12
14
|
|
|
13
15
|
const props = defineProps({
|
|
16
|
+
contrast: {
|
|
17
|
+
default: 'low',
|
|
18
|
+
type: String as PropType<'low' | 'high'>,
|
|
19
|
+
},
|
|
14
20
|
color: {
|
|
15
21
|
default: 'gray',
|
|
16
22
|
type: String as PropType<
|
|
17
23
|
| 'gray'
|
|
18
24
|
| 'red'
|
|
25
|
+
| 'orange'
|
|
19
26
|
| 'yellow'
|
|
20
27
|
| 'green'
|
|
21
28
|
| 'blue'
|
|
@@ -28,31 +35,65 @@ const props = defineProps({
|
|
|
28
35
|
default: 'base',
|
|
29
36
|
type: String as PropType<'base' | 'lg'>,
|
|
30
37
|
},
|
|
38
|
+
icon: {
|
|
39
|
+
default: undefined,
|
|
40
|
+
type: String as PropType<string | undefined>,
|
|
41
|
+
},
|
|
31
42
|
});
|
|
32
43
|
|
|
33
44
|
const colorClasses = computed(() => {
|
|
34
45
|
if (props.color == 'gray') {
|
|
46
|
+
if (props.contrast == 'high') {
|
|
47
|
+
return 'bg-slate-600 text-white';
|
|
48
|
+
}
|
|
35
49
|
return 'bg-slate-100 text-slate-800';
|
|
36
50
|
}
|
|
37
51
|
if (props.color == 'red') {
|
|
52
|
+
if (props.contrast == 'high') {
|
|
53
|
+
return 'bg-red-600 text-white';
|
|
54
|
+
}
|
|
38
55
|
return 'bg-red-100 text-red-900';
|
|
39
56
|
}
|
|
57
|
+
if (props.color == 'orange') {
|
|
58
|
+
if (props.contrast == 'high') {
|
|
59
|
+
return 'bg-orange-500 text-white';
|
|
60
|
+
}
|
|
61
|
+
return 'bg-orange-100 text-yellow-900';
|
|
62
|
+
}
|
|
40
63
|
if (props.color == 'yellow') {
|
|
64
|
+
if (props.contrast == 'high') {
|
|
65
|
+
return 'bg-yellow-500 text-white';
|
|
66
|
+
}
|
|
41
67
|
return 'bg-yellow-100 text-yellow-900';
|
|
42
68
|
}
|
|
43
69
|
if (props.color == 'green') {
|
|
70
|
+
if (props.contrast == 'high') {
|
|
71
|
+
return 'bg-green-600 text-white';
|
|
72
|
+
}
|
|
44
73
|
return 'bg-green-100 text-green-900';
|
|
45
74
|
}
|
|
46
75
|
if (props.color == 'blue') {
|
|
76
|
+
if (props.contrast == 'high') {
|
|
77
|
+
return 'bg-blue-600 text-white';
|
|
78
|
+
}
|
|
47
79
|
return 'bg-blue-100 text-blue-900';
|
|
48
80
|
}
|
|
49
81
|
if (props.color == 'indigo') {
|
|
82
|
+
if (props.contrast == 'high') {
|
|
83
|
+
return 'bg-indigo-600 text-white';
|
|
84
|
+
}
|
|
50
85
|
return 'bg-indigo-100 text-indigo-900';
|
|
51
86
|
}
|
|
52
87
|
if (props.color == 'purple') {
|
|
88
|
+
if (props.contrast == 'high') {
|
|
89
|
+
return 'bg-purple-600 text-white';
|
|
90
|
+
}
|
|
53
91
|
return 'bg-purple-100 text-purple-900';
|
|
54
92
|
}
|
|
55
93
|
if (props.color == 'pink') {
|
|
94
|
+
if (props.contrast == 'high') {
|
|
95
|
+
return 'bg-pink-600 text-white';
|
|
96
|
+
}
|
|
56
97
|
return 'bg-pink-100 text-pink-900';
|
|
57
98
|
}
|
|
58
99
|
return 'bg-slate-100 text-slate-900';
|
|
@@ -67,4 +108,14 @@ const sizeClasses = computed(() => {
|
|
|
67
108
|
}
|
|
68
109
|
return 'px-2.5 py-0.5 text-xs';
|
|
69
110
|
});
|
|
111
|
+
|
|
112
|
+
const iconSizeClasses = computed(() => {
|
|
113
|
+
if (props.size == 'base') {
|
|
114
|
+
return 'h-3 w-3 mr-1 -ml-0.5';
|
|
115
|
+
}
|
|
116
|
+
if (props.size == 'lg') {
|
|
117
|
+
return 'h-4 w-4 mr-1 -ml-0.5';
|
|
118
|
+
}
|
|
119
|
+
return 'h-3 w-3 mr-1 -ml-0.5';
|
|
120
|
+
});
|
|
70
121
|
</script>
|
|
@@ -7,7 +7,6 @@ export default {
|
|
|
7
7
|
required: true,
|
|
8
8
|
type: 'text',
|
|
9
9
|
name: 'name',
|
|
10
|
-
class: 'w-full',
|
|
11
10
|
},
|
|
12
11
|
};
|
|
13
12
|
|
|
@@ -31,6 +30,39 @@ Demo.args = {
|
|
|
31
30
|
placeholder: 'Enter your name',
|
|
32
31
|
};
|
|
33
32
|
|
|
33
|
+
export const IconLeft = Template.bind({});
|
|
34
|
+
IconLeft.args = {
|
|
35
|
+
iconLeft: 'heroicons:phone-20-solid',
|
|
36
|
+
placeholder: 'Enter your phone',
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const IconRight = Template.bind({});
|
|
40
|
+
IconRight.args = {
|
|
41
|
+
iconRight: 'mdi:email-outline',
|
|
42
|
+
placeholder: 'Enter your email',
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const Prefix = Template.bind({});
|
|
46
|
+
Prefix.args = {
|
|
47
|
+
prefix: 'https://',
|
|
48
|
+
placeholder: 'website URL',
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const Suffix = Template.bind({});
|
|
52
|
+
Suffix.args = {
|
|
53
|
+
suffix: '%',
|
|
54
|
+
placeholder: 'Percentage',
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const All = Template.bind({});
|
|
58
|
+
All.args = {
|
|
59
|
+
iconLeft: 'heroicons:currency-dollar-20-solid',
|
|
60
|
+
prefix: 'Price',
|
|
61
|
+
iconRight: 'heroicons:document-magnifying-glass',
|
|
62
|
+
suffix: '$',
|
|
63
|
+
placeholder: 'Item price',
|
|
64
|
+
};
|
|
65
|
+
|
|
34
66
|
export const Number = Template.bind({});
|
|
35
67
|
Number.args = {
|
|
36
68
|
type: 'number',
|
|
@@ -44,3 +76,11 @@ Disabled.args = {
|
|
|
44
76
|
disabled: true,
|
|
45
77
|
placeholder: 'Enter your name',
|
|
46
78
|
};
|
|
79
|
+
|
|
80
|
+
export const Error = Template.bind({});
|
|
81
|
+
Error.args = {
|
|
82
|
+
hasError: true,
|
|
83
|
+
prefix: 'Price',
|
|
84
|
+
iconRight: 'heroicons:currency-dollar',
|
|
85
|
+
placeholder: 'Enter your name',
|
|
86
|
+
};
|