sprintify-ui 0.0.35 → 0.0.36
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 +2623 -2394
- package/dist/types/src/components/BaseShortcut.vue.d.ts +67 -0
- package/dist/types/src/components/BaseStatistic.vue.d.ts +56 -0
- package/dist/types/src/components/BaseTimeline.vue.d.ts +14 -0
- package/dist/types/src/components/BaseTimelineItem.vue.d.ts +14 -0
- package/dist/types/src/components/index.d.ts +5 -1
- package/dist/types/src/types/Colors.d.ts +9 -0
- package/dist/types/src/types/TimelineItem.d.ts +8 -0
- package/package.json +1 -1
- package/src/components/BaseShortcut.stories.js +92 -0
- package/src/components/BaseShortcut.vue +153 -0
- package/src/components/BaseStatistic.stories.js +51 -0
- package/src/components/BaseStatistic.vue +98 -0
- package/src/components/BaseTimeline.stories.js +53 -0
- package/src/components/BaseTimeline.vue +29 -0
- package/src/components/BaseTimelineItem.stories.js +78 -0
- package/src/components/BaseTimelineItem.vue +79 -0
- package/src/components/index.ts +8 -0
- package/src/types/Colors.ts +9 -0
- package/src/types/TimelineItem.ts +8 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { RouteLocationRaw } from 'vue-router';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
to: {
|
|
5
|
+
required: true;
|
|
6
|
+
type: PropType<RouteLocationRaw>;
|
|
7
|
+
};
|
|
8
|
+
title: {
|
|
9
|
+
required: true;
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
};
|
|
12
|
+
description: {
|
|
13
|
+
default: null;
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
};
|
|
16
|
+
linkText: {
|
|
17
|
+
default: null;
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
};
|
|
20
|
+
color: {
|
|
21
|
+
default: string;
|
|
22
|
+
type: PropType<"gray" | "red" | "orange" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink">;
|
|
23
|
+
};
|
|
24
|
+
icon: {
|
|
25
|
+
required: true;
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
};
|
|
28
|
+
contrast: {
|
|
29
|
+
default: string;
|
|
30
|
+
type: PropType<"high" | "low">;
|
|
31
|
+
};
|
|
32
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
33
|
+
to: {
|
|
34
|
+
required: true;
|
|
35
|
+
type: PropType<RouteLocationRaw>;
|
|
36
|
+
};
|
|
37
|
+
title: {
|
|
38
|
+
required: true;
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
};
|
|
41
|
+
description: {
|
|
42
|
+
default: null;
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
};
|
|
45
|
+
linkText: {
|
|
46
|
+
default: null;
|
|
47
|
+
type: StringConstructor;
|
|
48
|
+
};
|
|
49
|
+
color: {
|
|
50
|
+
default: string;
|
|
51
|
+
type: PropType<"gray" | "red" | "orange" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink">;
|
|
52
|
+
};
|
|
53
|
+
icon: {
|
|
54
|
+
required: true;
|
|
55
|
+
type: StringConstructor;
|
|
56
|
+
};
|
|
57
|
+
contrast: {
|
|
58
|
+
default: string;
|
|
59
|
+
type: PropType<"high" | "low">;
|
|
60
|
+
};
|
|
61
|
+
}>>, {
|
|
62
|
+
color: "gray" | "red" | "orange" | "yellow" | "green" | "blue" | "indigo" | "purple" | "pink";
|
|
63
|
+
description: string;
|
|
64
|
+
contrast: "high" | "low";
|
|
65
|
+
linkText: string;
|
|
66
|
+
}>;
|
|
67
|
+
export default _default;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
label: {
|
|
4
|
+
default: null;
|
|
5
|
+
type: PropType<string | null>;
|
|
6
|
+
};
|
|
7
|
+
primaryValue: {
|
|
8
|
+
required: true;
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
};
|
|
11
|
+
secondaryValue: {
|
|
12
|
+
default: null;
|
|
13
|
+
type: PropType<string | null>;
|
|
14
|
+
};
|
|
15
|
+
trend: {
|
|
16
|
+
default: null;
|
|
17
|
+
type: PropType<"up" | "down" | null>;
|
|
18
|
+
};
|
|
19
|
+
caption: {
|
|
20
|
+
default: null;
|
|
21
|
+
type: PropType<string | null>;
|
|
22
|
+
};
|
|
23
|
+
}, unknown, unknown, {
|
|
24
|
+
backgroundClass(): string;
|
|
25
|
+
textClass(): string;
|
|
26
|
+
iconClass(): string;
|
|
27
|
+
icon(): string;
|
|
28
|
+
centerClass(): string;
|
|
29
|
+
}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
30
|
+
label: {
|
|
31
|
+
default: null;
|
|
32
|
+
type: PropType<string | null>;
|
|
33
|
+
};
|
|
34
|
+
primaryValue: {
|
|
35
|
+
required: true;
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
};
|
|
38
|
+
secondaryValue: {
|
|
39
|
+
default: null;
|
|
40
|
+
type: PropType<string | null>;
|
|
41
|
+
};
|
|
42
|
+
trend: {
|
|
43
|
+
default: null;
|
|
44
|
+
type: PropType<"up" | "down" | null>;
|
|
45
|
+
};
|
|
46
|
+
caption: {
|
|
47
|
+
default: null;
|
|
48
|
+
type: PropType<string | null>;
|
|
49
|
+
};
|
|
50
|
+
}>>, {
|
|
51
|
+
caption: string | null;
|
|
52
|
+
label: string | null;
|
|
53
|
+
secondaryValue: string | null;
|
|
54
|
+
trend: "up" | "down" | null;
|
|
55
|
+
}>;
|
|
56
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TimelineItem } from '../types/TimelineItem';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
items: {
|
|
5
|
+
required: true;
|
|
6
|
+
type: PropType<TimelineItem[]>;
|
|
7
|
+
};
|
|
8
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
items: {
|
|
10
|
+
required: true;
|
|
11
|
+
type: PropType<TimelineItem[]>;
|
|
12
|
+
};
|
|
13
|
+
}>>, {}>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TimelineItem } from '../types/TimelineItem';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
item: {
|
|
5
|
+
required: true;
|
|
6
|
+
type: PropType<TimelineItem>;
|
|
7
|
+
};
|
|
8
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
item: {
|
|
10
|
+
required: true;
|
|
11
|
+
type: PropType<TimelineItem>;
|
|
12
|
+
};
|
|
13
|
+
}>>, {}>;
|
|
14
|
+
export default _default;
|
|
@@ -49,9 +49,11 @@ import BaseProgressCircle from './BaseProgressCircle.vue';
|
|
|
49
49
|
import BaseRadioGroup from './BaseRadioGroup.vue';
|
|
50
50
|
import BaseReadMore from './BaseReadMore.vue';
|
|
51
51
|
import BaseSelect from './BaseSelect.vue';
|
|
52
|
+
import BaseShortcut from './BaseShortcut.vue';
|
|
52
53
|
import BaseSideNavigation from './BaseSideNavigation.vue';
|
|
53
54
|
import BaseSideNavigationItem from './BaseSideNavigationItem.vue';
|
|
54
55
|
import BaseSkeleton from './BaseSkeleton.vue';
|
|
56
|
+
import BaseStatistic from './BaseStatistic.vue';
|
|
55
57
|
import BaseSwitch from './BaseSwitch.vue';
|
|
56
58
|
import BaseSystemAlert from './BaseSystemAlert.vue';
|
|
57
59
|
import BaseTabs from './BaseTabs.vue';
|
|
@@ -62,8 +64,10 @@ import BaseTable from './BaseTable.vue';
|
|
|
62
64
|
import BaseTableColumn from './BaseTableColumn.vue';
|
|
63
65
|
import BaseTextarea from './BaseTextarea.vue';
|
|
64
66
|
import BaseTextareaAutoresize from './BaseTextareaAutoresize.vue';
|
|
67
|
+
import BaseTimeline from './BaseTimeline.vue';
|
|
68
|
+
import BaseTimelineItem from './BaseTimelineItem.vue';
|
|
65
69
|
import BaseLayoutStacked from './BaseLayoutStacked.vue';
|
|
66
70
|
import BaseLayoutStackedConfigurable from './BaseLayoutStackedConfigurable.vue';
|
|
67
71
|
import BaseLayoutSidebar from './BaseLayoutSidebar.vue';
|
|
68
72
|
import BaseLayoutSidebarConfigurable from './BaseLayoutSidebarConfigurable.vue';
|
|
69
|
-
export { BaseActionItem, BaseAlert, BaseApp, BaseAppDialogs, BaseAppNotifications, BaseAutocomplete, BaseAutocompleteFetch, BaseAvatar, BaseBadge, BaseBelongsTo, BaseBoolean, BaseBreadcrumbs, BaseButton, BaseButtonGroup, BaseCard, BaseCardRow, BaseCharacterCounter, BaseClipboard, BaseContainer, BaseCounter, BaseDataIterator, BaseDataTable, BaseDatePicker, BaseDateSelect, BaseDescriptionList, BaseDescriptionListItem, BaseDialog, BaseFilePicker, BaseFileUploader, BaseHasMany, BaseIcon, BaseInput, BaseInputLabel, BaseLoadingCover, BaseMediaItem, BaseMediaLibrary, BaseMediaPreview, BaseMenu, BaseMenuItem, BaseModalCenter, BaseModalSide, BaseNavbar, BaseNavbarItem, BaseNavbarItemContent, BasePagination, BasePanel, BasePassword, BaseProgressCircle, BaseRadioGroup, BaseReadMore, BaseSelect, BaseSideNavigation, BaseSideNavigationItem, BaseSkeleton, BaseSwitch, BaseSystemAlert, BaseTabs, BaseTabItem, BaseTagAutocomplete, BaseTagAutocompleteFetch, BaseTable, BaseTableColumn, BaseTextarea, BaseTextareaAutoresize, BaseLayoutStacked, BaseLayoutStackedConfigurable, BaseLayoutSidebar, BaseLayoutSidebarConfigurable, };
|
|
73
|
+
export { BaseActionItem, BaseAlert, BaseApp, BaseAppDialogs, BaseAppNotifications, BaseAutocomplete, BaseAutocompleteFetch, BaseAvatar, BaseBadge, BaseBelongsTo, BaseBoolean, BaseBreadcrumbs, BaseButton, BaseButtonGroup, BaseCard, BaseCardRow, BaseCharacterCounter, BaseClipboard, BaseContainer, BaseCounter, BaseDataIterator, BaseDataTable, BaseDatePicker, BaseDateSelect, BaseDescriptionList, BaseDescriptionListItem, BaseDialog, BaseFilePicker, BaseFileUploader, BaseHasMany, BaseIcon, BaseInput, BaseInputLabel, BaseLoadingCover, BaseMediaItem, BaseMediaLibrary, BaseMediaPreview, BaseMenu, BaseMenuItem, BaseModalCenter, BaseModalSide, BaseNavbar, BaseNavbarItem, BaseNavbarItemContent, BasePagination, BasePanel, BasePassword, BaseProgressCircle, BaseRadioGroup, BaseReadMore, BaseSelect, BaseShortcut, BaseSideNavigation, BaseSideNavigationItem, BaseSkeleton, BaseStatistic, BaseSwitch, BaseSystemAlert, BaseTabs, BaseTabItem, BaseTagAutocomplete, BaseTagAutocompleteFetch, BaseTable, BaseTableColumn, BaseTextarea, BaseTextareaAutoresize, BaseTimeline, BaseTimelineItem, BaseLayoutStacked, BaseLayoutStackedConfigurable, BaseLayoutSidebar, BaseLayoutSidebarConfigurable, };
|
package/package.json
CHANGED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import BaseShortcut from './BaseShortcut.vue';
|
|
2
|
+
|
|
3
|
+
const colors = [
|
|
4
|
+
'gray',
|
|
5
|
+
'red',
|
|
6
|
+
'orange',
|
|
7
|
+
'yellow',
|
|
8
|
+
'green',
|
|
9
|
+
'blue',
|
|
10
|
+
'indigo',
|
|
11
|
+
'purple',
|
|
12
|
+
'pink',
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
const sizes = ['base', 'lg'];
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
title: 'Components/BaseShortcut',
|
|
19
|
+
component: BaseShortcut,
|
|
20
|
+
argTypes: {
|
|
21
|
+
color: {
|
|
22
|
+
control: { type: 'select' },
|
|
23
|
+
options: colors,
|
|
24
|
+
},
|
|
25
|
+
contrast: {
|
|
26
|
+
control: { type: 'select' },
|
|
27
|
+
options: ['low', 'high'],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const Template = (args) => ({
|
|
33
|
+
components: { BaseShortcut },
|
|
34
|
+
setup() {
|
|
35
|
+
return { args };
|
|
36
|
+
},
|
|
37
|
+
template: `
|
|
38
|
+
<BaseShortcut v-bind="args">
|
|
39
|
+
</BaseShortcut>
|
|
40
|
+
`,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const Basic = Template.bind({});
|
|
44
|
+
Basic.args = {
|
|
45
|
+
to: '/restaurants',
|
|
46
|
+
title: 'Basic shortcut',
|
|
47
|
+
icon: 'heroicons:user',
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const Colors = (args) => ({
|
|
51
|
+
components: { BaseShortcut },
|
|
52
|
+
setup() {
|
|
53
|
+
return { args, colors, sizes };
|
|
54
|
+
},
|
|
55
|
+
template: `
|
|
56
|
+
<div v-for="color in colors" :key="color">
|
|
57
|
+
<p class="text-xs text-slate-600 leading-tight my-2">{{ color }}</p>
|
|
58
|
+
<BaseShortcut v-bind="args" :color="color" icon="heroicons:beaker-20-solid"></BaseShortcut>
|
|
59
|
+
</div>
|
|
60
|
+
`,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
Colors.args = {
|
|
64
|
+
contrast: 'high',
|
|
65
|
+
to: '/restaurants',
|
|
66
|
+
title: 'Contrast example',
|
|
67
|
+
description:
|
|
68
|
+
'Le lorem ipsum est, en imprimerie, une suite de mots sans signification utilisée à titre provisoire pour calibrer une mise en page',
|
|
69
|
+
linkText: 'Open app',
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const Contrast = (args) => ({
|
|
73
|
+
components: { BaseShortcut },
|
|
74
|
+
setup() {
|
|
75
|
+
return { args, colors, sizes };
|
|
76
|
+
},
|
|
77
|
+
template: `
|
|
78
|
+
<div v-for="color in colors" :key="color">
|
|
79
|
+
<p class="text-xs text-slate-600 leading-tight my-2">{{ color }}</p>
|
|
80
|
+
<BaseShortcut v-bind="args" :color="color" icon="heroicons:beaker-20-solid"></BaseShortcut>
|
|
81
|
+
</div>
|
|
82
|
+
`,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
Contrast.args = {
|
|
86
|
+
contrast: 'low',
|
|
87
|
+
to: '/restaurants',
|
|
88
|
+
title: 'Contrast example',
|
|
89
|
+
description:
|
|
90
|
+
'Le lorem ipsum est, en imprimerie, une suite de mots sans signification utilisée à titre provisoire pour calibrer une mise en page',
|
|
91
|
+
linkText: 'Open app',
|
|
92
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<BaseCard class="inline-flex max-w-sm duration-200 hover:bg-slate-50">
|
|
3
|
+
<router-link :to="to">
|
|
4
|
+
<section class="whitespace-pre-line p-4">
|
|
5
|
+
<!-- Icon -->
|
|
6
|
+
<div
|
|
7
|
+
class="mb-2.5 inline-flex items-center rounded p-2"
|
|
8
|
+
:class="[colorClasses]"
|
|
9
|
+
>
|
|
10
|
+
<BaseIcon
|
|
11
|
+
v-if="icon"
|
|
12
|
+
:icon="icon"
|
|
13
|
+
:class="iconSizeClasses"
|
|
14
|
+
></BaseIcon>
|
|
15
|
+
</div>
|
|
16
|
+
<!-- Title -->
|
|
17
|
+
<div class="text-md font-semibold">
|
|
18
|
+
{{ title }}
|
|
19
|
+
</div>
|
|
20
|
+
<!-- Description -->
|
|
21
|
+
<div
|
|
22
|
+
v-if="description"
|
|
23
|
+
class="mt-1 mb-3 whitespace-pre-line text-sm text-slate-500 line-clamp-2"
|
|
24
|
+
>
|
|
25
|
+
{{ description }}
|
|
26
|
+
</div>
|
|
27
|
+
<!-- Text link -->
|
|
28
|
+
<div
|
|
29
|
+
v-if="linkText"
|
|
30
|
+
class="flex items-center justify-start text-sm font-medium"
|
|
31
|
+
>
|
|
32
|
+
<div class="mr-1 leading-none">{{ linkText }}</div>
|
|
33
|
+
<div>
|
|
34
|
+
<BaseIcon
|
|
35
|
+
icon="heroicons:arrow-right-20-solid"
|
|
36
|
+
class="mt-px h-4 w-4"
|
|
37
|
+
></BaseIcon>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</section>
|
|
41
|
+
</router-link>
|
|
42
|
+
</BaseCard>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script lang="ts" setup>
|
|
46
|
+
import { PropType } from 'vue';
|
|
47
|
+
import { BaseIcon } from '.';
|
|
48
|
+
import BaseCard from './BaseCard.vue';
|
|
49
|
+
import { RouteLocationRaw } from 'vue-router';
|
|
50
|
+
|
|
51
|
+
const props = defineProps({
|
|
52
|
+
to: {
|
|
53
|
+
required: true,
|
|
54
|
+
type: [String, Object] as PropType<RouteLocationRaw>,
|
|
55
|
+
},
|
|
56
|
+
title: {
|
|
57
|
+
required: true,
|
|
58
|
+
type: String,
|
|
59
|
+
},
|
|
60
|
+
description: {
|
|
61
|
+
default: null,
|
|
62
|
+
type: String,
|
|
63
|
+
},
|
|
64
|
+
linkText: {
|
|
65
|
+
default: null,
|
|
66
|
+
type: String,
|
|
67
|
+
},
|
|
68
|
+
color: {
|
|
69
|
+
default: 'gray',
|
|
70
|
+
type: String as PropType<
|
|
71
|
+
| 'gray'
|
|
72
|
+
| 'red'
|
|
73
|
+
| 'orange'
|
|
74
|
+
| 'yellow'
|
|
75
|
+
| 'green'
|
|
76
|
+
| 'blue'
|
|
77
|
+
| 'indigo'
|
|
78
|
+
| 'purple'
|
|
79
|
+
| 'pink'
|
|
80
|
+
>,
|
|
81
|
+
},
|
|
82
|
+
icon: {
|
|
83
|
+
required: true,
|
|
84
|
+
type: String,
|
|
85
|
+
},
|
|
86
|
+
contrast: {
|
|
87
|
+
default: 'low',
|
|
88
|
+
type: String as PropType<'low' | 'high'>,
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const colorClasses = computed(() => {
|
|
93
|
+
if (props.color == 'gray') {
|
|
94
|
+
if (props.contrast == 'high') {
|
|
95
|
+
return 'bg-slate-600 text-white';
|
|
96
|
+
}
|
|
97
|
+
return 'bg-slate-100 text-slate-800 border border-slate-300';
|
|
98
|
+
}
|
|
99
|
+
if (props.color == 'red') {
|
|
100
|
+
if (props.contrast == 'high') {
|
|
101
|
+
return 'bg-red-600 text-white';
|
|
102
|
+
}
|
|
103
|
+
return 'bg-red-100 text-red-700 border border-red-300';
|
|
104
|
+
}
|
|
105
|
+
if (props.color == 'orange') {
|
|
106
|
+
if (props.contrast == 'high') {
|
|
107
|
+
return 'bg-orange-500 text-white';
|
|
108
|
+
}
|
|
109
|
+
return 'bg-orange-100 text-yellow-700 border border-orange-300';
|
|
110
|
+
}
|
|
111
|
+
if (props.color == 'yellow') {
|
|
112
|
+
if (props.contrast == 'high') {
|
|
113
|
+
return 'bg-yellow-500 text-white';
|
|
114
|
+
}
|
|
115
|
+
return 'bg-yellow-100 text-yellow-700 border border-yellow-300';
|
|
116
|
+
}
|
|
117
|
+
if (props.color == 'green') {
|
|
118
|
+
if (props.contrast == 'high') {
|
|
119
|
+
return 'bg-green-600 text-white';
|
|
120
|
+
}
|
|
121
|
+
return 'bg-green-100 text-green-700 border border-green-300';
|
|
122
|
+
}
|
|
123
|
+
if (props.color == 'blue') {
|
|
124
|
+
if (props.contrast == 'high') {
|
|
125
|
+
return 'bg-blue-600 text-white';
|
|
126
|
+
}
|
|
127
|
+
return 'bg-blue-100 text-blue-700 border border-blue-300';
|
|
128
|
+
}
|
|
129
|
+
if (props.color == 'indigo') {
|
|
130
|
+
if (props.contrast == 'high') {
|
|
131
|
+
return 'bg-indigo-600 text-white';
|
|
132
|
+
}
|
|
133
|
+
return 'bg-indigo-100 text-indigo-700 border border-indigo-300';
|
|
134
|
+
}
|
|
135
|
+
if (props.color == 'purple') {
|
|
136
|
+
if (props.contrast == 'high') {
|
|
137
|
+
return 'bg-purple-600 text-white';
|
|
138
|
+
}
|
|
139
|
+
return 'bg-purple-100 text-purple-700 border border-purple-300';
|
|
140
|
+
}
|
|
141
|
+
if (props.color == 'pink') {
|
|
142
|
+
if (props.contrast == 'high') {
|
|
143
|
+
return 'bg-pink-600 text-white';
|
|
144
|
+
}
|
|
145
|
+
return 'bg-pink-100 text-pink-700 border border-pink-300';
|
|
146
|
+
}
|
|
147
|
+
return 'bg-slate-100 text-slate-700 border border-slate-300';
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
const iconSizeClasses = computed(() => {
|
|
151
|
+
return 'h-4 w-4';
|
|
152
|
+
});
|
|
153
|
+
</script>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import BaseStatistic from './BaseStatistic.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/BaseStatistic',
|
|
5
|
+
component: BaseStatistic,
|
|
6
|
+
argTypes: {
|
|
7
|
+
trend: {
|
|
8
|
+
control: { type: 'select' },
|
|
9
|
+
options: ['up', 'down', null],
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const Template = (args) => ({
|
|
15
|
+
components: { BaseStatistic },
|
|
16
|
+
setup() {
|
|
17
|
+
return { args };
|
|
18
|
+
},
|
|
19
|
+
template: `
|
|
20
|
+
<BaseStatistic v-bind="args">
|
|
21
|
+
</BaseStatistic>
|
|
22
|
+
`,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const Simple = Template.bind({});
|
|
26
|
+
Simple.args = {
|
|
27
|
+
primaryValue: '$7,552.90',
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const TrendUp = Template.bind({});
|
|
31
|
+
TrendUp.args = {
|
|
32
|
+
primaryValue: '$15,289.63',
|
|
33
|
+
secondaryValue: '15%',
|
|
34
|
+
trend: 'up',
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const TrendDown = Template.bind({});
|
|
38
|
+
TrendDown.args = {
|
|
39
|
+
primaryValue: '$10,123.25',
|
|
40
|
+
secondaryValue: '-22%',
|
|
41
|
+
trend: 'down',
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const Complex = Template.bind({});
|
|
45
|
+
Complex.args = {
|
|
46
|
+
label: 'Complex example',
|
|
47
|
+
primaryValue: '$10,123.25',
|
|
48
|
+
secondaryValue: '-22%',
|
|
49
|
+
trend: 'down',
|
|
50
|
+
caption: 'Since last week',
|
|
51
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="inline-flex rounded-xl p-4" :class="[centerClass]">
|
|
3
|
+
<section>
|
|
4
|
+
<!-- Label -->
|
|
5
|
+
<header class="mb-0.5 text-base font-medium">
|
|
6
|
+
{{ label }}
|
|
7
|
+
</header>
|
|
8
|
+
<!-- Content -->
|
|
9
|
+
<div class="flex" :class="[centerClass]">
|
|
10
|
+
<div class="text-3xl font-bold leading-tight">
|
|
11
|
+
{{ primaryValue }}
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div
|
|
15
|
+
v-if="secondaryValue"
|
|
16
|
+
class="ml-1 flex rounded-md px-1 text-lg font-bold"
|
|
17
|
+
:class="[backgroundClass, textClass, centerClass]"
|
|
18
|
+
>
|
|
19
|
+
<!-- Icon trend -->
|
|
20
|
+
<div v-if="trend">
|
|
21
|
+
<BaseIcon :icon="icon" :class="iconClass" />
|
|
22
|
+
</div>
|
|
23
|
+
<div class="text-lg">{{ secondaryValue }}</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
<!-- Caption -->
|
|
27
|
+
<footer class="text-base text-slate-500">
|
|
28
|
+
{{ caption }}
|
|
29
|
+
</footer>
|
|
30
|
+
</section>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script lang="ts">
|
|
35
|
+
import { defineComponent, PropType } from 'vue';
|
|
36
|
+
import { BaseIcon } from '.';
|
|
37
|
+
|
|
38
|
+
export default defineComponent({
|
|
39
|
+
components: { BaseIcon },
|
|
40
|
+
props: {
|
|
41
|
+
label: {
|
|
42
|
+
default: null,
|
|
43
|
+
type: String as PropType<string | null>,
|
|
44
|
+
},
|
|
45
|
+
primaryValue: {
|
|
46
|
+
required: true,
|
|
47
|
+
type: String,
|
|
48
|
+
},
|
|
49
|
+
secondaryValue: {
|
|
50
|
+
default: null,
|
|
51
|
+
type: String as PropType<string | null>,
|
|
52
|
+
},
|
|
53
|
+
trend: {
|
|
54
|
+
default: null,
|
|
55
|
+
type: String as PropType<'up' | 'down' | null>,
|
|
56
|
+
},
|
|
57
|
+
caption: {
|
|
58
|
+
default: null,
|
|
59
|
+
type: String as PropType<string | null>,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
computed: {
|
|
63
|
+
backgroundClass(): string {
|
|
64
|
+
if (this.trend == 'up') {
|
|
65
|
+
return 'bg-green-50';
|
|
66
|
+
}
|
|
67
|
+
if (this.trend == 'down') {
|
|
68
|
+
return 'bg-red-50';
|
|
69
|
+
}
|
|
70
|
+
return '';
|
|
71
|
+
},
|
|
72
|
+
textClass(): string {
|
|
73
|
+
if (this.trend == 'up') {
|
|
74
|
+
return 'text-green-700';
|
|
75
|
+
}
|
|
76
|
+
if (this.trend == 'down') {
|
|
77
|
+
return 'text-red-700';
|
|
78
|
+
}
|
|
79
|
+
return 'text-slate-400';
|
|
80
|
+
},
|
|
81
|
+
iconClass(): string {
|
|
82
|
+
return 'w-5 h-5';
|
|
83
|
+
},
|
|
84
|
+
icon(): string {
|
|
85
|
+
if (this.trend == 'up') {
|
|
86
|
+
return 'heroicons-solid:chevron-up';
|
|
87
|
+
}
|
|
88
|
+
if (this.trend == 'down') {
|
|
89
|
+
return 'heroicons-solid:chevron-down';
|
|
90
|
+
}
|
|
91
|
+
return '';
|
|
92
|
+
},
|
|
93
|
+
centerClass(): string {
|
|
94
|
+
return 'items-center justify-center';
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
</script>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import BaseTimeline from './BaseTimeline.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/BaseTimeline',
|
|
5
|
+
component: BaseTimeline,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = (args) => ({
|
|
9
|
+
components: { BaseTimeline },
|
|
10
|
+
setup() {
|
|
11
|
+
return { args };
|
|
12
|
+
},
|
|
13
|
+
template: `<div class="max-w-md"><BaseTimeline v-bind="args"/></div>`,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const items = [
|
|
17
|
+
{
|
|
18
|
+
title: 'Advanced to phone screening by Bethany Blake',
|
|
19
|
+
icon: 'heroicons:shield-check-20-solid',
|
|
20
|
+
description:
|
|
21
|
+
'Lorem nostrud quis aute elit ea Lorem magna eiusmod ipsum. Eu ipsum eiusmod ad minim adipisicing irure. Fugiat ut adipisicing consequat dolor.',
|
|
22
|
+
color: null,
|
|
23
|
+
date: '15 Jan',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
title: 'Advanced to phone screening by Bethany Blake',
|
|
27
|
+
icon: 'heroicons:shield-check-20-solid',
|
|
28
|
+
description:
|
|
29
|
+
'Lorem nostrud quis aute elit ea Lorem magna eiusmod ipsum. Eu ipsum eiusmod ad minim adipisicing irure. Fugiat ut adipisicing consequat dolor.',
|
|
30
|
+
color: 'danger',
|
|
31
|
+
date: null,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
title: 'Advanced to phone screening by Bethany Blake',
|
|
35
|
+
icon: 'heroicons:shield-check-20-solid',
|
|
36
|
+
description:
|
|
37
|
+
'Lorem nostrud quis aute elit ea Lorem magna eiusmod ipsum. Eu ipsum eiusmod ad minim adipisicing irure. Fugiat ut adipisicing consequat dolor.',
|
|
38
|
+
color: 'success',
|
|
39
|
+
date: '15 Jan',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
title: 'Advanced to phone screening by Bethany Blake',
|
|
43
|
+
icon: 'heroicons:shield-check-20-solid',
|
|
44
|
+
description: '',
|
|
45
|
+
color: 'info',
|
|
46
|
+
date: '15 Jan',
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
export const Demo = Template.bind({});
|
|
51
|
+
Demo.args = {
|
|
52
|
+
items: items,
|
|
53
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flow-root">
|
|
3
|
+
<ul role="list" class="-mb-8">
|
|
4
|
+
<li v-for="(item, index) in items" :key="index">
|
|
5
|
+
<div class="relative pb-8">
|
|
6
|
+
<span
|
|
7
|
+
v-if="index != items.length - 1"
|
|
8
|
+
class="absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200"
|
|
9
|
+
aria-hidden="true"
|
|
10
|
+
/>
|
|
11
|
+
<BaseTimelineItem :item="item" />
|
|
12
|
+
</div>
|
|
13
|
+
</li>
|
|
14
|
+
</ul>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script lang="ts" setup>
|
|
19
|
+
import { TimelineItem } from '../types/TimelineItem';
|
|
20
|
+
import { PropType } from 'vue';
|
|
21
|
+
import BaseTimelineItem from './BaseTimelineItem.vue';
|
|
22
|
+
|
|
23
|
+
defineProps({
|
|
24
|
+
items: {
|
|
25
|
+
required: true,
|
|
26
|
+
type: Array as PropType<TimelineItem[]>,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
</script>
|