sprintify-ui 0.0.47 → 0.0.48

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,65 @@
1
+ import BaseStepperItem from './BaseStepperItem.vue';
2
+
3
+ export default {
4
+ title: 'Components/BaseStepperItem',
5
+ component: BaseStepperItem,
6
+ argTypes: {
7
+ status: {
8
+ control: { type: 'select' },
9
+ options: ['pending', 'current', 'completed'],
10
+ },
11
+ description: {
12
+ control: { type: 'text' },
13
+ },
14
+ },
15
+ };
16
+
17
+ const Template = (args) => ({
18
+ components: { BaseStepperItem },
19
+ setup() {
20
+ return { args };
21
+ },
22
+ template: `
23
+ <div class="lg:border-t lg:border-b lg:border-gray-200">
24
+ <nav class="px-4 mx-auto max-w-7xl sm:px-6 lg:px-8" aria-label="Progress">
25
+ <ol
26
+ role="list"
27
+ class="overflow-hidden rounded-md lg:flex lg:rounded-none lg:border-l lg:border-r lg:border-gray-200"
28
+ >
29
+ <li
30
+ class="relative overflow-hidden lg:flex-1"
31
+ >
32
+ <div
33
+ :class="[
34
+ 'rounded-t-md border-b-0',
35
+ 'overflow-hidden border border-gray-200 lg:border-0',
36
+ ]"
37
+ >
38
+ <BaseStepperItem v-bind="args"/>
39
+ </div>
40
+ </li>
41
+ </ol>
42
+ </nav>
43
+ </div>
44
+ `,
45
+ });
46
+
47
+ export const Simple = Template.bind({});
48
+
49
+ Simple.args = {
50
+ title: 'Job application',
51
+ description: '',
52
+ stepNumber: 1,
53
+ status: 'pending',
54
+ index: 0,
55
+ };
56
+
57
+ export const WithDescription = Template.bind({});
58
+
59
+ WithDescription.args = {
60
+ title: 'Job application',
61
+ description: 'Vitae sed mi luctus laoreet.',
62
+ stepNumber: 1,
63
+ status: 'current',
64
+ index: 0,
65
+ };
@@ -0,0 +1,149 @@
1
+ <template>
2
+ <button
3
+ v-if="status === 'completed'"
4
+ type="button"
5
+ class="group"
6
+ @click="$emit('click')"
7
+ >
8
+ <span
9
+ class="absolute top-0 left-0 h-full w-1 bg-transparent group-hover:bg-slate-200 lg:bottom-0 lg:top-auto lg:h-1 lg:w-full"
10
+ aria-hidden="true"
11
+ />
12
+ <span
13
+ :class="[
14
+ index !== 0 ? 'lg:pl-9' : '',
15
+ 'flex items-start px-6 py-5 text-sm font-medium',
16
+ ]"
17
+ >
18
+ <span class="flex-shrink-0">
19
+ <span
20
+ class="flex h-10 w-10 items-center justify-center rounded-full bg-indigo-600"
21
+ >
22
+ <BaseIcon
23
+ :icon="'mdi-check'"
24
+ class="h-6 w-6 text-white"
25
+ aria-hidden="true"
26
+ />
27
+ </span>
28
+ </span>
29
+ <span class="mt-0.5 ml-4 flex min-w-0 flex-col items-start">
30
+ <span class="mb-0.5 text-left text-sm font-medium leading-tight">{{
31
+ title
32
+ }}</span>
33
+ <span
34
+ v-if="description"
35
+ class="text-left text-sm font-normal leading-snug text-slate-500"
36
+ >
37
+ {{ description }}
38
+ </span>
39
+ </span>
40
+ </span>
41
+ </button>
42
+ <button
43
+ v-else-if="status === 'current'"
44
+ aria-current="step"
45
+ type="button"
46
+ @click="$emit('click')"
47
+ >
48
+ <span
49
+ class="absolute top-0 left-0 h-full w-1 bg-indigo-600 lg:bottom-0 lg:top-auto lg:h-1 lg:w-full"
50
+ aria-hidden="true"
51
+ />
52
+ <span
53
+ :class="[
54
+ index !== 0 ? 'lg:pl-9' : '',
55
+ 'flex items-start px-6 py-5 text-sm font-medium',
56
+ ]"
57
+ >
58
+ <span class="flex-shrink-0">
59
+ <span
60
+ class="flex h-10 w-10 items-center justify-center rounded-full border-2 border-indigo-600"
61
+ >
62
+ <span class="text-indigo-600">{{ stepNumber }}</span>
63
+ </span>
64
+ </span>
65
+ <span class="mt-0.5 ml-4 flex min-w-0 flex-col items-start">
66
+ <span
67
+ class="mb-0.5 text-left text-sm font-medium leading-tight text-indigo-600"
68
+ >
69
+ {{ title }}
70
+ </span>
71
+ <span
72
+ v-if="description"
73
+ class="text-left text-sm font-normal leading-snug text-slate-500"
74
+ >
75
+ {{ description }}
76
+ </span>
77
+ </span>
78
+ </span>
79
+ </button>
80
+ <button
81
+ v-else-if="status == 'pending'"
82
+ type="button"
83
+ class="group"
84
+ @click="$emit('click')"
85
+ >
86
+ <span
87
+ class="absolute top-0 left-0 h-full w-1 bg-transparent group-hover:bg-slate-200 lg:bottom-0 lg:top-auto lg:h-1 lg:w-full"
88
+ aria-hidden="true"
89
+ />
90
+ <span
91
+ :class="[
92
+ index !== 0 ? 'lg:pl-9' : '',
93
+ 'flex items-start px-6 py-5 text-sm font-medium',
94
+ ]"
95
+ >
96
+ <span class="flex-shrink-0">
97
+ <span
98
+ class="flex h-10 w-10 items-center justify-center rounded-full border-2 border-slate-300"
99
+ >
100
+ <span class="text-slate-500">{{ stepNumber }}</span>
101
+ </span>
102
+ </span>
103
+ <span class="mt-0.5 ml-4 flex min-w-0 flex-col items-start">
104
+ <span
105
+ class="mb-0.5 text-left text-sm font-medium leading-tight text-slate-600"
106
+ >
107
+ {{ title }}
108
+ </span>
109
+ <span
110
+ v-if="description"
111
+ class="text-left text-sm font-normal leading-snug text-slate-500"
112
+ >
113
+ {{ description }}
114
+ </span>
115
+ </span>
116
+ </span>
117
+ </button>
118
+ </template>
119
+
120
+ <script lang="ts" setup>
121
+ import { PropType } from 'vue';
122
+ import { BaseIcon } from '.';
123
+
124
+ defineProps({
125
+ stepNumber: {
126
+ required: true,
127
+ type: Number,
128
+ },
129
+ title: {
130
+ required: true,
131
+ type: String,
132
+ },
133
+ description: {
134
+ required: false,
135
+ default: null,
136
+ type: String as PropType<string | null>,
137
+ },
138
+ status: {
139
+ required: true,
140
+ type: String,
141
+ },
142
+ index: {
143
+ required: true,
144
+ type: Number,
145
+ },
146
+ });
147
+
148
+ defineEmits(['click']);
149
+ </script>
@@ -41,7 +41,7 @@
41
41
 
42
42
  <script lang="ts" setup>
43
43
  import { TimelineItem } from '../types/TimelineItem';
44
- import { Colors } from '../types/Colors';
44
+ import { Color } from '../types/Color';
45
45
  import { PropType } from 'vue';
46
46
  import { BaseIcon } from '.';
47
47
 
@@ -53,25 +53,25 @@ const props = defineProps({
53
53
  });
54
54
 
55
55
  const iconBackgroundClass = computed((): string => {
56
- if (props.item.color == Colors.primary) {
56
+ if (props.item.color == Color.primary) {
57
57
  return 'bg-primary-600';
58
58
  }
59
- if (props.item.color == Colors.danger) {
59
+ if (props.item.color == Color.danger) {
60
60
  return 'bg-red-600';
61
61
  }
62
- if (props.item.color == Colors.warning) {
62
+ if (props.item.color == Color.warning) {
63
63
  return 'bg-yellow-600';
64
64
  }
65
- if (props.item.color == Colors.info) {
65
+ if (props.item.color == Color.info) {
66
66
  return 'bg-blue-500';
67
67
  }
68
- if (props.item.color == Colors.grey) {
68
+ if (props.item.color == Color.grey) {
69
69
  return 'bg-slate-500';
70
70
  }
71
- if (props.item.color == Colors.black) {
71
+ if (props.item.color == Color.black) {
72
72
  return 'bg-slate-900';
73
73
  }
74
- if (props.item.color == Colors.success) {
74
+ if (props.item.color == Color.success) {
75
75
  return 'bg-green-500';
76
76
  }
77
77
  return 'bg-slate-500';
@@ -1,4 +1,4 @@
1
- export enum Colors {
1
+ export enum Color {
2
2
  primary = 'primary',
3
3
  danger = 'danger',
4
4
  warning = 'warning',
@@ -0,0 +1,5 @@
1
+ export enum Status {
2
+ pending = 'pending',
3
+ completed = 'completed',
4
+ current = 'current',
5
+ }
@@ -0,0 +1,8 @@
1
+ import { Status } from './Status';
2
+
3
+ export interface StepperItem {
4
+ title: string;
5
+ description?: string | null;
6
+ stepNumber: number;
7
+ status: Status;
8
+ }
@@ -1,8 +1,8 @@
1
- import { Colors } from './Colors';
1
+ import { Color } from './Color';
2
2
  export interface TimelineItem {
3
3
  title: string;
4
4
  icon: string;
5
5
  description?: null | string;
6
6
  date?: string | null;
7
- color?: Colors | null;
7
+ color?: Color | null;
8
8
  }