sprintify-ui 0.0.53 → 0.0.55

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.0.53",
3
+ "version": "0.0.55",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build-fast": "rimraf dist && vite build",
@@ -3,17 +3,19 @@
3
3
  <img
4
4
  :src="user.avatar_url"
5
5
  :class="[sizeClass, detailsPosition == 'left' ? 'order-2' : 'order-1']"
6
- class="shrink-0 overflow-hidden rounded-full"
6
+ class="shrink-0 overflow-hidden rounded-full object-cover object-center"
7
7
  />
8
8
  <div
9
9
  v-if="showDetails"
10
10
  class="max-w-[120px] grow leading-tight"
11
11
  :class="[
12
12
  textSizeClass,
13
- detailsPosition == 'left'
14
- ? 'order-1 mr-3 text-right'
15
- : 'order-2 ml-3 text-left',
13
+ detailsPosition == 'left' ? 'order-1 text-right' : 'order-2 text-left',
16
14
  ]"
15
+ :style="{
16
+ marginLeft: detailsPosition == 'right' ? spacing : '0',
17
+ marginRight: detailsPosition == 'left' ? spacing : '0',
18
+ }"
17
19
  >
18
20
  <div class="truncate">
19
21
  {{ user.full_name }}
@@ -94,4 +96,21 @@ const textSizeClass = computed((): string => {
94
96
  }
95
97
  return base;
96
98
  });
99
+
100
+ const spacing = computed(() => {
101
+ switch (props.size) {
102
+ case 'xl':
103
+ return '0.95rem';
104
+ case 'lg':
105
+ return '0.85rem';
106
+ case 'base':
107
+ return '0.75rem';
108
+ case 'sm':
109
+ return '0.65rem';
110
+ case 'xs':
111
+ return '0.5rem';
112
+ default:
113
+ return '1rem';
114
+ }
115
+ });
97
116
  </script>
@@ -15,7 +15,7 @@ const breadcrumbs = [
15
15
  to: '/users/1',
16
16
  },
17
17
  {
18
- label: 'Settings',
18
+ label: 'Very long title this is a very long title that will be truncated',
19
19
  to: '/users/1/settings',
20
20
  },
21
21
  ];
@@ -34,7 +34,7 @@
34
34
  <BaseIcon :icon="breadcrumb.icon" />
35
35
  </span>
36
36
  <span v-else>
37
- {{ breadcrumb.label }}
37
+ {{ truncate(breadcrumb.label) }}
38
38
  </span>
39
39
  </a>
40
40
  </RouterLink>
@@ -61,6 +61,7 @@
61
61
  <script lang="ts" setup>
62
62
  import { PropType } from 'vue';
63
63
  import { Breadcrumb } from '@/types';
64
+ import { truncate } from 'lodash';
64
65
 
65
66
  const props = defineProps({
66
67
  breadcrumbs: {
@@ -157,11 +157,7 @@ function transformInputValue(event: Event | null): string | null {
157
157
  const value = get(event, 'target.value', null);
158
158
 
159
159
  if (isString(value)) {
160
- return trim(value);
161
- }
162
-
163
- if (isNumber(value)) {
164
- return trim(value + '');
160
+ return value;
165
161
  }
166
162
 
167
163
  return '';
@@ -79,7 +79,7 @@ function transformInputValue(event: Event | null): string | null {
79
79
  const value = get(event, 'target.value', null);
80
80
 
81
81
  if (isString(value)) {
82
- return trim(value);
82
+ return value;
83
83
  }
84
84
 
85
85
  return '';