sprintify-ui 0.0.196 → 0.0.197

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.
@@ -5,11 +5,7 @@
5
5
  <span :class="textSize">{{ label }}</span>
6
6
  </div>
7
7
  <div v-if="count" class="relative -top-px ml-[5px]">
8
- <BaseCounter
9
- :count="count"
10
- :max-digit="2"
11
- :color="active ? 'white' : 'primary'"
12
- />
8
+ <BaseCounter :count="count" :max-digit="2" :color="color" />
13
9
  </div>
14
10
  </div>
15
11
  </template>
@@ -79,11 +75,12 @@ const buttonClasses = computed((): string => {
79
75
  let baseClasses =
80
76
  'flex items-center justify-between w-full leading-tight py-2 text-sm text-left rounded';
81
77
 
78
+ baseClasses += ' ' + textColor.value;
79
+
82
80
  if (!props.active) {
83
81
  baseClasses += ' bg-white';
84
- baseClasses += ' ' + textColor.value;
85
82
  } else {
86
- baseClasses += ' bg-primary-600 text-white';
83
+ baseClasses += ' bg-slate-100';
87
84
  }
88
85
 
89
86
  if (props.icon) {
@@ -100,8 +97,6 @@ const iconClasses = computed((): string => {
100
97
 
101
98
  if (!props.active) {
102
99
  baseClasses += ' opacity-70 ' + textColor.value;
103
- } else {
104
- baseClasses += ' text-primary-100';
105
100
  }
106
101
 
107
102
  return baseClasses;
@@ -2,7 +2,7 @@
2
2
  <div :class="classes">
3
3
  <div class="group flex grow items-center">
4
4
  <BaseIcon v-if="icon" :icon="icon" :class="iconClasses" />
5
- {{ label }}
5
+ <span :class="[sizeClasses]">{{ label }}</span>
6
6
  </div>
7
7
  <div v-if="count" class="relative -top-px ml-[5px]">
8
8
  <BaseCounter :count="count" :max-digit="2" :color="'primary'" />
@@ -12,6 +12,7 @@
12
12
 
13
13
  <script lang="ts" setup>
14
14
  import { Icon as BaseIcon } from '@iconify/vue';
15
+ import { PropType } from 'vue';
15
16
  import BaseCounter from './BaseCounter.vue';
16
17
 
17
18
  const props = defineProps({
@@ -35,6 +36,10 @@ const props = defineProps({
35
36
  default: false,
36
37
  type: Boolean,
37
38
  },
39
+ size: {
40
+ default: 'md',
41
+ type: String as PropType<'sm' | 'md'>,
42
+ },
38
43
  });
39
44
 
40
45
  const classes = computed(() => {
@@ -42,12 +47,6 @@ const classes = computed(() => {
42
47
  'text-left border-b-2 px-2 flex items-center text-base font-medium w-full',
43
48
  ];
44
49
 
45
- if (props.dark) {
46
- classList.push('');
47
- } else {
48
- classList.push('');
49
- }
50
-
51
50
  if (props.active) {
52
51
  if (props.dark) {
53
52
  classList.push('border-white text-white');
@@ -77,4 +76,11 @@ const iconClasses = computed((): string[] => {
77
76
  }
78
77
  return classList;
79
78
  });
79
+
80
+ const sizeClasses = computed(() => {
81
+ if (props.size == 'sm') {
82
+ return 'text-sm';
83
+ }
84
+ return 'text-base';
85
+ });
80
86
  </script>
@@ -15,25 +15,21 @@
15
15
  :active="active"
16
16
  :count="item.count"
17
17
  :dark="dark"
18
+ :size="size"
18
19
  />
19
20
  </template>
20
21
  </BaseActionItem>
21
22
 
22
23
  <div
23
24
  v-if="showSubActions && item.actions && item.actions.length"
24
- class="ml-10 mt-1.5 mb-3"
25
+ class="mt-2 mb-3"
25
26
  >
26
- <div v-for="subItem in item.actions" :key="subItem.label" class="mb-1">
27
+ <div v-for="subItem in item.actions" :key="subItem.label">
27
28
  <BaseActionItem
28
29
  :to="subItem.to"
29
30
  :href="subItem.href"
30
31
  :action="subItem.action"
31
- :class="[
32
- 'flex w-full',
33
- dark
34
- ? 'text-slate-300 hover:text-white'
35
- : 'text-slate-900 hover:text-slate-600',
36
- ]"
32
+ :class="subItemClasses"
37
33
  >
38
34
  {{ subItem.label }}
39
35
  </BaseActionItem>
@@ -61,6 +57,10 @@ const props = defineProps({
61
57
  default: 'toggle',
62
58
  type: String as PropType<'toggle' | 'always'>,
63
59
  },
60
+ size: {
61
+ default: 'md',
62
+ type: String as PropType<'xs' | 'sm' | 'md'>,
63
+ },
64
64
  });
65
65
 
66
66
  const emit = defineEmits(['click']);
@@ -88,4 +88,24 @@ const showSubActions = computed((): boolean => {
88
88
  }
89
89
  return routeActive.value;
90
90
  });
91
+
92
+ const subItemClasses = computed((): string[] => {
93
+ const classList = ['flex w-full font-normal'];
94
+
95
+ if (props.dark) {
96
+ classList.push('text-slate-300 hover:text-white');
97
+ } else {
98
+ classList.push('text-slate-900 hover:text-slate-600');
99
+ }
100
+
101
+ if (props.size == 'xs') {
102
+ classList.push('pl-[33.5px] text-[13px] mb-1');
103
+ } else if (props.size == 'sm') {
104
+ classList.push('pl-[36px] text-sm mb-1.5');
105
+ } else {
106
+ classList.push('pl-[40px] text-base mb-1');
107
+ }
108
+
109
+ return classList;
110
+ });
91
111
  </script>
@@ -2,16 +2,22 @@
2
2
  <div :class="classes">
3
3
  <div class="group flex grow items-center">
4
4
  <BaseIcon v-if="icon" :icon="icon" :class="iconClasses" />
5
- {{ label }}
5
+ <span>{{ label }}</span>
6
6
  </div>
7
7
  <div v-if="count" class="relative -top-px ml-[5px]">
8
- <BaseCounter :count="count" :max-digit="2" :color="'primary'" />
8
+ <BaseCounter
9
+ :size="size"
10
+ :count="count"
11
+ :max-digit="2"
12
+ :color="'primary'"
13
+ />
9
14
  </div>
10
15
  </div>
11
16
  </template>
12
17
 
13
18
  <script lang="ts" setup>
14
19
  import { Icon as BaseIcon } from '@iconify/vue';
20
+ import { PropType } from 'vue';
15
21
  import BaseCounter from './BaseCounter.vue';
16
22
 
17
23
  const props = defineProps({
@@ -35,24 +41,20 @@ const props = defineProps({
35
41
  default: false,
36
42
  type: Boolean,
37
43
  },
44
+ size: {
45
+ default: 'md',
46
+ type: String as PropType<'xs' | 'sm' | 'md'>,
47
+ },
38
48
  });
39
49
 
40
50
  const classes = computed(() => {
41
- const classList = [
42
- 'text-left px-3 py-2 rounded-md flex text-base font-medium w-full',
43
- ];
44
-
45
- if (props.dark) {
46
- classList.push('');
47
- } else {
48
- classList.push('');
49
- }
51
+ const classList = ['text-left rounded-md flex w-full'];
50
52
 
51
53
  if (props.active) {
52
54
  if (props.dark) {
53
55
  classList.push('bg-slate-700 text-white');
54
56
  } else {
55
- classList.push('bg-slate-100 text-slate-900');
57
+ classList.push('bg-slate-100 text-primary-700');
56
58
  }
57
59
  } else {
58
60
  if (props.dark) {
@@ -62,16 +64,41 @@ const classes = computed(() => {
62
64
  }
63
65
  }
64
66
 
67
+ if (props.size == 'xs') {
68
+ classList.push('text-[13px] px-2.5 py-1 font-medium');
69
+ }
70
+
71
+ if (props.size == 'sm') {
72
+ classList.push('text-sm px-3 py-1.5 font-medium');
73
+ }
74
+
75
+ if (props.size == 'md') {
76
+ classList.push('text-base px-3 py-2 font-medium');
77
+ }
78
+
65
79
  return classList;
66
80
  });
67
81
 
68
82
  const iconClasses = computed((): string[] => {
69
- const classList = ['w-5 h-5 shrink-0 mr-2 leading-none inline-block'];
83
+ const classList = ['shrink-0 leading-none inline-block'];
70
84
  if (props.active) {
71
85
  classList.push('opacity-100');
72
86
  } else {
73
87
  classList.push('opacity-70 group-hover:opacity-100');
74
88
  }
89
+
90
+ if (props.size == 'xs') {
91
+ classList.push('w-3.5 h-3.5 mr-2');
92
+ }
93
+
94
+ if (props.size == 'sm') {
95
+ classList.push('w-4 h-4 mr-2');
96
+ }
97
+
98
+ if (props.size == 'md') {
99
+ classList.push('w-5 h-5 mr-2');
100
+ }
101
+
75
102
  return classList;
76
103
  });
77
104
  </script>