sprintify-ui 0.0.34 → 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.
@@ -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>
@@ -0,0 +1,78 @@
1
+ import BaseTimelineItem from './BaseTimelineItem.vue';
2
+
3
+ const colors = [
4
+ 'primary',
5
+ 'success',
6
+ 'danger',
7
+ 'warning',
8
+ 'info',
9
+ 'grey',
10
+ 'black',
11
+ ];
12
+
13
+ export default {
14
+ title: 'Components/BaseTimelineItem',
15
+ component: BaseTimelineItem,
16
+ };
17
+
18
+ const Template = (args) => ({
19
+ components: { BaseTimelineItem },
20
+ setup() {
21
+ return { args };
22
+ },
23
+ template: `<div class="max-w-md"><BaseTimelineItem v-bind="args"/></div>`,
24
+ });
25
+
26
+ const ColorsTemplate = (args) => ({
27
+ components: { BaseTimelineItem },
28
+ setup() {
29
+ const items = colors.map((color) => {
30
+ return {
31
+ title: 'Advanced to phone screening by Bethany Blake',
32
+ icon: 'heroicons:shield-check-20-solid',
33
+ description:
34
+ 'Lorem nostrud quis aute elit ea Lorem magna eiusmod ipsum. Eu ipsum eiusmod ad minim adipisicing irure. Fugiat ut adipisicing consequat dolor.',
35
+ color: color,
36
+ date: '15 Jan',
37
+ };
38
+ });
39
+ return { args, items };
40
+ },
41
+ template: `
42
+ <div class="max-w-md">
43
+ <ul role="list" class="-mb-8">
44
+ <li v-for="(item, index) in items" :key="index">
45
+ <p class="text-xs text-slate-600 leading-tight mb-4">{{ item.color }}</p>
46
+ <div class="relative pb-8">
47
+ <BaseTimelineItem :item="item" />
48
+ </div>
49
+ </li>
50
+ </ul>
51
+ </div>
52
+ `,
53
+ });
54
+
55
+ export const Simple = Template.bind({});
56
+ Simple.args = {
57
+ item: {
58
+ title: 'Advanced to phone screening by Bethany Blake',
59
+ icon: 'heroicons:shield-check-20-solid',
60
+ description: '',
61
+ color: 'warning',
62
+ date: '15 Jan',
63
+ },
64
+ };
65
+
66
+ export const WithDescription = Template.bind({});
67
+ WithDescription.args = {
68
+ item: {
69
+ title: 'Advanced to phone screening by Bethany Blake',
70
+ icon: 'heroicons:shield-check-20-solid',
71
+ description:
72
+ 'Lorem nostrud quis aute elit ea Lorem magna eiusmod ipsum. Eu ipsum eiusmod ad minim adipisicing irure. Fugiat ut adipisicing consequat dolor.',
73
+ color: 'primary',
74
+ date: '15 Jan',
75
+ },
76
+ };
77
+
78
+ export const Colors = ColorsTemplate.bind({});
@@ -0,0 +1,79 @@
1
+ <template>
2
+ <div class="relative flex space-x-3">
3
+ <div>
4
+ <span
5
+ :class="[
6
+ iconBackgroundClass,
7
+ 'flex h-8 w-8 items-center justify-center rounded-full ring-8 ring-white',
8
+ ]"
9
+ >
10
+ <BaseIcon
11
+ class="w-5 h-5 text-white"
12
+ aria-hidden="true"
13
+ :icon="item.icon"
14
+ />
15
+ </span>
16
+ </div>
17
+ <div
18
+ class="flex justify-between flex-1 min-w-0 space-x-4"
19
+ :class="{ 'pt-1.5': !item.description }"
20
+ >
21
+ <div>
22
+ <p class="text-sm leading-tight text-slate-600">
23
+ {{ item.title }}
24
+ </p>
25
+ <p
26
+ v-if="item.description"
27
+ class="mt-1 text-xs leading-tight text-slate-500"
28
+ >
29
+ {{ item.description }}
30
+ </p>
31
+ </div>
32
+ <div
33
+ v-if="item.date"
34
+ class="text-sm text-right text-gray-500 whitespace-nowrap"
35
+ >
36
+ <time :datetime="item.date">{{ item.date }}</time>
37
+ </div>
38
+ </div>
39
+ </div>
40
+ </template>
41
+
42
+ <script lang="ts" setup>
43
+ import { TimelineItem } from '../types/TimelineItem';
44
+ import { Colors } from '../types/Colors';
45
+ import { PropType } from 'vue';
46
+ import { BaseIcon } from '.';
47
+
48
+ const props = defineProps({
49
+ item: {
50
+ required: true,
51
+ type: Object as PropType<TimelineItem>,
52
+ },
53
+ });
54
+
55
+ const iconBackgroundClass = computed((): string => {
56
+ if (props.item.color == Colors.primary) {
57
+ return 'bg-primary-600';
58
+ }
59
+ if (props.item.color == Colors.danger) {
60
+ return 'bg-red-600';
61
+ }
62
+ if (props.item.color == Colors.warning) {
63
+ return 'bg-yellow-600';
64
+ }
65
+ if (props.item.color == Colors.info) {
66
+ return 'bg-blue-500';
67
+ }
68
+ if (props.item.color == Colors.grey) {
69
+ return 'bg-slate-500';
70
+ }
71
+ if (props.item.color == Colors.black) {
72
+ return 'bg-slate-900';
73
+ }
74
+ if (props.item.color == Colors.success) {
75
+ return 'bg-green-500';
76
+ }
77
+ return 'bg-gray-500';
78
+ });
79
+ </script>
@@ -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,6 +64,8 @@ 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
 
66
70
  import BaseLayoutStacked from './BaseLayoutStacked.vue';
67
71
  import BaseLayoutStackedConfigurable from './BaseLayoutStackedConfigurable.vue';
@@ -120,9 +124,11 @@ export {
120
124
  BaseRadioGroup,
121
125
  BaseReadMore,
122
126
  BaseSelect,
127
+ BaseShortcut,
123
128
  BaseSideNavigation,
124
129
  BaseSideNavigationItem,
125
130
  BaseSkeleton,
131
+ BaseStatistic,
126
132
  BaseSwitch,
127
133
  BaseSystemAlert,
128
134
  BaseTabs,
@@ -133,6 +139,8 @@ export {
133
139
  BaseTableColumn,
134
140
  BaseTextarea,
135
141
  BaseTextareaAutoresize,
142
+ BaseTimeline,
143
+ BaseTimelineItem,
136
144
  BaseLayoutStacked,
137
145
  BaseLayoutStackedConfigurable,
138
146
  BaseLayoutSidebar,
package/src/index.ts CHANGED
@@ -8,7 +8,6 @@ import fr from '@/lang/fr.json';
8
8
  import { useDialogsStore } from './stores/dialogs';
9
9
  import { useNotificationsStore } from './stores/notifications';
10
10
  import { useSystemAlertStore } from './stores/systemAlerts';
11
- import { ActionItem } from './types/types';
12
11
 
13
12
  const messages = { en, fr };
14
13
 
@@ -82,5 +81,3 @@ export { config };
82
81
  export { useDialogsStore };
83
82
  export { useNotificationsStore };
84
83
  export { useSystemAlertStore };
85
-
86
- export { type ActionItem };
@@ -0,0 +1,9 @@
1
+ export enum Colors {
2
+ primary = 'primary',
3
+ danger = 'danger',
4
+ warning = 'warning',
5
+ info = 'info',
6
+ grey = 'grey',
7
+ black = 'black',
8
+ success = 'success',
9
+ }
@@ -0,0 +1,8 @@
1
+ import { Colors } from './Colors';
2
+ export interface TimelineItem {
3
+ title: string;
4
+ icon: string;
5
+ description?: null | string;
6
+ date?: string | null;
7
+ color?: Colors | null;
8
+ }