@kiva/kv-components 6.7.0 → 6.8.1

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.
@@ -1,11 +1,11 @@
1
- import { toRefs as h, ref as v, computed as d, resolveComponent as y, openBlock as n, createElementBlock as o, normalizeClass as i, createElementVNode as s, createBlock as _, createCommentVNode as f, withDirectives as L, vShow as S, toDisplayString as C } from "vue";
2
- import { isLegacyPlaceholderAvatar as x, randomizedUserAvatarClass as k } from "../utils/imageUtils.js";
3
- import A from "./KvLoadingPlaceholder.js";
4
- import F from "../_virtual/_plugin-vue_export-helper.js";
5
- const U = {
1
+ import { toRefs as y, ref as g, computed as d, resolveComponent as S, openBlock as n, createElementBlock as i, normalizeClass as r, createElementVNode as o, createBlock as _, normalizeStyle as L, createCommentVNode as u, withDirectives as C, vShow as x, toDisplayString as k } from "vue";
2
+ import { isLegacyPlaceholderAvatar as A, randomizedUserAvatarClass as F } from "../utils/imageUtils.js";
3
+ import U from "./KvLoadingPlaceholder.js";
4
+ import H from "../_virtual/_plugin-vue_export-helper.js";
5
+ const b = {
6
6
  name: "KvUserAvatar",
7
7
  components: {
8
- KvLoadingPlaceholder: A
8
+ KvLoadingPlaceholder: U
9
9
  },
10
10
  props: {
11
11
  /**
@@ -30,86 +30,92 @@ const U = {
30
30
  default: !1
31
31
  }
32
32
  },
33
- setup(m) {
33
+ setup(w) {
34
34
  const {
35
35
  lenderName: l,
36
36
  lenderImageUrl: t,
37
37
  isSmall: e
38
- } = h(m), r = v(!0), c = d(() => l.value === "" && t.value === "" || l.value === "Anonymous"), w = () => {
38
+ } = y(w), s = g(!0), c = g(null), m = d(() => l.value === "" && t.value === "" || l.value === "Anonymous"), f = () => {
39
39
  const a = e != null && e.value ? "tw-w-3 tw-h-3 tw-text-h4" : "tw-w-6 tw-h-6 tw-text-h2";
40
- return `${k()} ${a}`;
41
- }, u = d(() => {
40
+ return `${F()} ${a}`;
41
+ }, h = d(() => {
42
42
  var a;
43
43
  return ((a = t == null ? void 0 : t.value) == null ? void 0 : a.split("/").pop()) ?? "";
44
- }), g = d(() => {
44
+ }), v = d(() => {
45
45
  var a;
46
46
  return (a = l == null ? void 0 : l.value) == null ? void 0 : a.substring(0, 1).toUpperCase();
47
47
  });
48
48
  return {
49
- isAnonymousUser: c,
50
- avatarClass: w,
51
- imageFilename: u,
52
- lenderNameFirstLetter: g,
53
- isLegacyPlaceholderAvatar: x,
54
- isLoading: r,
49
+ isAnonymousUser: m,
50
+ avatarClass: f,
51
+ imageFilename: h,
52
+ lenderNameFirstLetter: v,
53
+ isLegacyPlaceholderAvatar: A,
54
+ isLoading: s,
55
55
  onImgLoad: () => {
56
- r.value = !1;
57
- }
56
+ s.value = !1;
57
+ },
58
+ imageRef: c
58
59
  };
59
60
  }
60
- }, H = { key: 1 }, b = ["src"], B = { class: "tw-self-center" };
61
- function I(m, l, t, e, r, c) {
62
- const w = y("kv-loading-placeholder");
63
- return n(), o("div", {
64
- class: i(["data-hj-suppress tw-flex", { "tw-w-3": t.isSmall, "tw-w-6": !t.isSmall }])
61
+ }, B = { key: 1 }, I = ["src"], p = { class: "tw-self-center" };
62
+ function N(w, l, t, e, s, c) {
63
+ const m = S("kv-loading-placeholder");
64
+ return n(), i("div", {
65
+ class: r(["data-hj-suppress tw-flex", { "tw-w-3": t.isSmall, "tw-w-6": !t.isSmall }])
65
66
  }, [
66
- e.isAnonymousUser ? (n(), o("div", {
67
+ e.isAnonymousUser ? (n(), i("div", {
67
68
  key: 0,
68
- class: i(["tw-rounded-full tw-bg-brand tw-inline-flex tw-align-center tw-justify-center", { "tw-w-3 tw-h-3": t.isSmall, "tw-w-6 tw-h-6": !t.isSmall }])
69
+ class: r(["tw-rounded-full tw-bg-brand tw-inline-flex tw-align-center tw-justify-center", { "tw-w-3 tw-h-3": t.isSmall, "tw-w-6 tw-h-6": !t.isSmall }])
69
70
  }, [
70
- (n(), o("svg", {
71
- class: i(["tw-h-full tw-text-brand", { "tw-w-3 tw-h-3": t.isSmall }]),
71
+ (n(), i("svg", {
72
+ class: r(["tw-h-full tw-text-brand", { "tw-w-3 tw-h-3": t.isSmall }]),
72
73
  width: "25",
73
74
  height: "37",
74
75
  viewBox: "0 0 25 37",
75
76
  fill: "none",
76
77
  xmlns: "http://www.w3.org/2000/svg"
77
78
  }, l[1] || (l[1] = [
78
- s("path", {
79
+ o("path", {
79
80
  d: "M8.22861 0.875H0.857178V36.3125H8.22861V0.875Z",
80
81
  fill: "white"
81
82
  }, null, -1),
82
- s("path", {
83
+ o("path", {
83
84
  d: "M10.1143 23.2751C21.9428 23.2751 24.6857 13.2126 24.6857 11.4626H23.6571C11.8286 11.4626 9.08569 21.5251 9.08569 23.2751H10.1143Z",
84
85
  fill: "white"
85
86
  }, null, -1),
86
- s("path", {
87
+ o("path", {
87
88
  d: "M9.08569 24.2376C9.08569 26.0751 11.1428 36.3126 23.8285 36.3126H24.8571C24.8571 34.4751 22.8 24.2376 10.1143 24.2376H9.08569Z",
88
89
  fill: "white"
89
90
  }, null, -1)
90
91
  ]), 2))
91
- ], 2)) : !e.isLegacyPlaceholderAvatar(e.imageFilename) && e.imageFilename ? (n(), o("div", H, [
92
- e.isLoading ? (n(), _(w, {
92
+ ], 2)) : !e.isLegacyPlaceholderAvatar(e.imageFilename) && e.imageFilename ? (n(), i("div", B, [
93
+ e.isLoading ? (n(), _(m, {
93
94
  key: 0,
94
- class: i(["!tw-rounded-full", { "!tw-w-3 !tw-h-3": t.isSmall, "!tw-w-6 !tw-h-6": !t.isSmall }])
95
- }, null, 8, ["class"])) : f("", !0),
96
- L(s("img", {
95
+ style: L({
96
+ width: t.isSmall ? "1.5rem" : "3rem",
97
+ height: t.isSmall ? "1.5rem" : "3rem"
98
+ }),
99
+ class: "!tw-rounded-full"
100
+ }, null, 8, ["style"])) : u("", !0),
101
+ C(o("img", {
102
+ ref: "imageRef",
97
103
  src: t.lenderImageUrl,
98
104
  alt: "Image of lender",
99
- class: i(["tw-rounded-full tw-inline-block", { "tw-w-3 tw-h-3": t.isSmall, "tw-w-6 tw-h-6": !t.isSmall }]),
100
- onLoad: l[0] || (l[0] = (u) => e.onImgLoad())
101
- }, null, 42, b), [
102
- [S, !e.isLoading]
105
+ class: r(["tw-rounded-full tw-inline-block", { "tw-w-3 tw-h-3": t.isSmall, "tw-w-6 tw-h-6": !t.isSmall }]),
106
+ onLoad: l[0] || (l[0] = (f) => e.onImgLoad())
107
+ }, null, 42, I), [
108
+ [x, !e.isLoading]
103
109
  ])
104
- ])) : e.isLegacyPlaceholderAvatar(e.imageFilename) || !e.imageFilename ? (n(), o("div", {
110
+ ])) : e.isLegacyPlaceholderAvatar(e.imageFilename) || !e.imageFilename ? (n(), i("div", {
105
111
  key: 2,
106
- class: i(["tw-rounded-full tw-inline-flex tw-align-center tw-justify-center", e.avatarClass()])
112
+ class: r(["tw-rounded-full tw-inline-flex tw-align-center tw-justify-center", e.avatarClass()])
107
113
  }, [
108
- s("span", B, C(e.lenderNameFirstLetter), 1)
109
- ], 2)) : f("", !0)
114
+ o("span", p, k(e.lenderNameFirstLetter), 1)
115
+ ], 2)) : u("", !0)
110
116
  ], 2);
111
117
  }
112
- const K = /* @__PURE__ */ F(U, [["render", I]]);
118
+ const M = /* @__PURE__ */ H(b, [["render", N]]);
113
119
  export {
114
- K as default
120
+ M as default
115
121
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "6.7.0",
3
+ "version": "6.8.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -107,5 +107,5 @@
107
107
  "embla-carousel-fade",
108
108
  "popper.js"
109
109
  ],
110
- "gitHead": "cd2c1146ba70de5cde2dd547181a3e4489c627d3"
110
+ "gitHead": "26e1f18a4d9bb716f47da262f1eb9f9d84924a81"
111
111
  }