sprintify-ui 0.0.27 → 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 +378 -365
- package/dist/types/src/components/BaseBadge.vue.d.ts +46 -8
- package/package.json +1 -1
- package/src/components/BaseBadge.stories.js +52 -7
- package/src/components/BaseBadge.vue +51 -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;
|
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>
|
|
@@ -32,9 +32,11 @@ const Template = (args) => ({
|
|
|
32
32
|
<BaseModalCenter v-model="show" v-bind="args">
|
|
33
33
|
<template #default="{close}">
|
|
34
34
|
<div class="p-8">
|
|
35
|
-
<
|
|
35
|
+
<h2 class="font-semibold text-lg mb-6">This is a center modal</h2>
|
|
36
36
|
|
|
37
|
-
<
|
|
37
|
+
<p v-for="i in 10" :key="i" class="mb-3 text-slate-600">Ipsum magna irure aliquip aute adipisicing Lorem non commodo amet. Est labore dolor laboris sint est magna quis fugiat id cillum deserunt cupidatat veniam. Exercitation dolore consequat labore deserunt laboris id. In laborum ea irure amet esse commodo et deserunt do officia et. Nulla incididunt est laboris pariatur ad duis ad reprehenderit voluptate. Tempor consectetur magna eiusmod incididunt.</p>
|
|
38
|
+
|
|
39
|
+
<button @click="close" class="btn mt-4">Close</button>
|
|
38
40
|
</div>
|
|
39
41
|
</template>
|
|
40
42
|
</BaseModalCenter>
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
|
|
63
63
|
<button
|
|
64
|
-
class="right
|
|
64
|
+
class="right fixed top-2 right-2 flex h-16 w-16 items-center justify-center rounded-full hover:bg-black hover:bg-opacity-20"
|
|
65
65
|
type="button"
|
|
66
66
|
@click="modal.close()"
|
|
67
67
|
>
|
|
@@ -26,9 +26,11 @@ const Template = (args) => ({
|
|
|
26
26
|
<BaseModalSide v-model="show" v-bind="args">
|
|
27
27
|
<template #default="{close}">
|
|
28
28
|
<div class="p-8">
|
|
29
|
-
<
|
|
29
|
+
<h2 class="font-semibold text-lg mb-6">This is a center modal</h2>
|
|
30
30
|
|
|
31
|
-
<
|
|
31
|
+
<p v-for="i in 10" :key="i" class="mb-3 text-slate-600">Ipsum magna irure aliquip aute adipisicing Lorem non commodo amet. Est labore dolor laboris sint est magna quis fugiat id cillum deserunt cupidatat veniam. Exercitation dolore consequat labore deserunt laboris id. In laborum ea irure amet esse commodo et deserunt do officia et. Nulla incididunt est laboris pariatur ad duis ad reprehenderit voluptate. Tempor consectetur magna eiusmod incididunt.</p>
|
|
32
|
+
|
|
33
|
+
<button @click="close" class="btn mt-4">Close</button>
|
|
32
34
|
</div>
|
|
33
35
|
</template>
|
|
34
36
|
</BaseModalSide>
|