sprintify-ui 0.11.31 → 0.11.32

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.
@@ -11610,28 +11610,31 @@ const FM = ["src"], _M = ["fill"], VM = ["font-size"], jM = { class: "truncate"
11610
11610
  return "1rem";
11611
11611
  }
11612
11612
  }), r = S(() => t.max > 3 ? t.max : 3), o = S(() => t.users.length > r.value ? t.users.slice(0, r.value) : t.users), i = S(() => Array.isArray(t.users) && t.users.length > r.value ? t.users.length - r.value : 0), s = S(() => (Array.isArray(t.users) && t.users.length > r.value) ?? !1), l = S(() => {
11613
- const u = "h-9 w-9";
11614
- return t.size == "xs" ? "h-6 w-6" : t.size == "sm" ? "h-8 w-8" : t.size == "base" ? u : t.size == "lg" ? "h-12 w-12" : t.size == "xl" ? "h-14 w-14" : u;
11613
+ const c = "h-9 w-9";
11614
+ return t.size == "xs" ? "h-6 w-6" : t.size == "sm" ? "h-8 w-8" : t.size == "base" ? c : t.size == "lg" ? "h-12 w-12" : t.size == "xl" ? "h-14 w-14" : c;
11615
11615
  }), a = S(() => {
11616
- const u = "text-xs";
11617
- return t.size == "xs" ? "text-[8px]" : t.size == "sm" ? "text-[10px]" : t.size == "base" ? "text-xs" : t.size == "lg" || t.size == "xl" ? "text-sm" : u;
11616
+ const c = "text-xs";
11617
+ return t.size == "xs" ? "text-[8px]" : t.size == "sm" ? "text-[10px]" : t.size == "base" ? "text-xs" : t.size == "lg" || t.size == "xl" ? "text-sm" : c;
11618
11618
  });
11619
- return (u, c) => (k(), $("div", WM, [
11620
- (k(!0), $(Re, null, Ge(g(o), (d, f) => (k(), $("div", {
11621
- key: d.email + "-" + f,
11619
+ function u(c, d) {
11620
+ return `${c.email || c.name || c.full_name || c.label || c.avatar_url || d}-${d}`;
11621
+ }
11622
+ return (c, d) => (k(), $("div", WM, [
11623
+ (k(!0), $(Re, null, Ge(g(o), (f, p) => (k(), $("div", {
11624
+ key: u(f, p),
11622
11625
  class: "shrink-0",
11623
11626
  style: Fe({
11624
- marginLeft: f === 0 ? "0" : "-" + g(e)
11627
+ marginLeft: p === 0 ? "0" : "-" + g(e)
11625
11628
  })
11626
11629
  }, [
11627
11630
  A("div", qM, [
11628
11631
  ee(Ys, {
11629
11632
  class: "flex",
11630
11633
  tooltip: n.tooltip,
11631
- user: d,
11634
+ user: f,
11632
11635
  size: n.size,
11633
11636
  "show-details": !1,
11634
- to: n.to ? n.to(d) : void 0
11637
+ to: n.to ? n.to(f) : void 0
11635
11638
  }, null, 8, ["tooltip", "user", "size", "to"])
11636
11639
  ])
11637
11640
  ], 4))), 128)),
@@ -1,10 +1,6 @@
1
1
  import { PropType } from 'vue';
2
- import { User } from '@/types/User';
2
+ import { AvatarUserInput } from '@/types/User';
3
3
  import { RouteLocationRaw } from 'vue-router';
4
- type AvatarUserInput = Partial<User> & {
5
- name?: string;
6
- label?: string;
7
- };
8
4
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
9
5
  user: {
10
6
  default: undefined;
@@ -1,10 +1,10 @@
1
- import { User } from '@/types/User';
1
+ import { AvatarUserInput } from '@/types/User';
2
2
  import { PropType } from 'vue';
3
3
  import { RouteLocationRaw } from 'vue-router';
4
4
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
5
5
  users: {
6
6
  required: true;
7
- type: PropType<User[]>;
7
+ type: PropType<AvatarUserInput[]>;
8
8
  };
9
9
  size: {
10
10
  default: string;
@@ -12,7 +12,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
12
12
  };
13
13
  to: {
14
14
  default: undefined;
15
- type: PropType<(user: User) => RouteLocationRaw>;
15
+ type: PropType<(user: AvatarUserInput) => RouteLocationRaw>;
16
16
  };
17
17
  max: {
18
18
  default: number;
@@ -25,7 +25,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
25
25
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
26
26
  users: {
27
27
  required: true;
28
- type: PropType<User[]>;
28
+ type: PropType<AvatarUserInput[]>;
29
29
  };
30
30
  size: {
31
31
  default: string;
@@ -33,7 +33,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
33
33
  };
34
34
  to: {
35
35
  default: undefined;
36
- type: PropType<(user: User) => RouteLocationRaw>;
36
+ type: PropType<(user: AvatarUserInput) => RouteLocationRaw>;
37
37
  };
38
38
  max: {
39
39
  default: number;
@@ -44,7 +44,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
44
44
  type: BooleanConstructor;
45
45
  };
46
46
  }>> & Readonly<{}>, {
47
- to: (user: User) => RouteLocationRaw;
47
+ to: (user: AvatarUserInput) => RouteLocationRaw;
48
48
  size: string;
49
49
  max: number;
50
50
  tooltip: boolean;
@@ -3,4 +3,8 @@ interface User {
3
3
  email?: string;
4
4
  avatar_url?: string;
5
5
  }
6
- export type { User };
6
+ type AvatarUserInput = Partial<User> & {
7
+ name?: string;
8
+ label?: string;
9
+ };
10
+ export type { User, AvatarUserInput };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.11.31",
3
+ "version": "0.11.32",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "generate-llm-txt": "node scripts/generate-llm-txt.js",
@@ -65,7 +65,7 @@
65
65
 
66
66
  <script lang="ts" setup>
67
67
  import { PropType } from 'vue';
68
- import { User } from '@/types/User';
68
+ import { AvatarUserInput } from '@/types/User';
69
69
  import { RouteLocationRaw } from 'vue-router';
70
70
  import { twMerge } from 'tailwind-merge';
71
71
  import BaseTooltip from './BaseTooltip.vue';
@@ -75,11 +75,6 @@ defineOptions({
75
75
  inheritAttrs: false,
76
76
  })
77
77
 
78
- type AvatarUserInput = Partial<User> & {
79
- name?: string;
80
- label?: string;
81
- };
82
-
83
78
  const props = defineProps({
84
79
  user: {
85
80
  default: undefined,
@@ -2,7 +2,7 @@
2
2
  <div class="flex items-center -space-x-4">
3
3
  <div
4
4
  v-for="(user, index) in users"
5
- :key="user.email + '-' + index"
5
+ :key="getUserKey(user, index)"
6
6
  class="shrink-0"
7
7
  :style="{
8
8
  marginLeft: index === 0 ? '0' : '-' + spacing,
@@ -40,7 +40,7 @@
40
40
  </template>
41
41
 
42
42
  <script lang="ts" setup>
43
- import { User } from '@/types/User';
43
+ import { AvatarUserInput } from '@/types/User';
44
44
  import { PropType } from 'vue';
45
45
  import { RouteLocationRaw } from 'vue-router';
46
46
  import BaseAvatar from './BaseAvatar.vue';
@@ -48,7 +48,7 @@ import BaseAvatar from './BaseAvatar.vue';
48
48
  const props = defineProps({
49
49
  users: {
50
50
  required: true,
51
- type: Array as PropType<User[]>,
51
+ type: Array as PropType<AvatarUserInput[]>,
52
52
  },
53
53
  size: {
54
54
  default: 'base',
@@ -56,7 +56,7 @@ const props = defineProps({
56
56
  },
57
57
  to: {
58
58
  default: undefined,
59
- type: Function as PropType<(user: User) => RouteLocationRaw>,
59
+ type: Function as PropType<(user: AvatarUserInput) => RouteLocationRaw>,
60
60
  },
61
61
  max: {
62
62
  default: 10,
@@ -149,4 +149,16 @@ const fontSizeClass = computed((): string => {
149
149
  }
150
150
  return base;
151
151
  });
152
+
153
+ function getUserKey(user: AvatarUserInput, index: number): string {
154
+ const key =
155
+ user.email ||
156
+ user.name ||
157
+ user.full_name ||
158
+ user.label ||
159
+ user.avatar_url ||
160
+ index;
161
+
162
+ return `${key}-${index}`;
163
+ }
152
164
  </script>
package/src/types/User.ts CHANGED
@@ -4,4 +4,9 @@ interface User {
4
4
  avatar_url?: string;
5
5
  }
6
6
 
7
- export type { User };
7
+ type AvatarUserInput = Partial<User> & {
8
+ name?: string;
9
+ label?: string;
10
+ };
11
+
12
+ export type { User, AvatarUserInput };