@kiva/kv-components 6.8.1 → 6.9.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,6 +1,6 @@
1
- import { toRefs as f, ref as p, computed as w, watch as _, onMounted as g, resolveComponent as s, openBlock as d, createElementBlock as u, createElementVNode as i, toDisplayString as h, createVNode as v, withModifiers as k, withCtx as x, withDirectives as C, renderSlot as y, createCommentVNode as b, vShow as F } from "vue";
1
+ import { toRefs as m, ref as p, computed as w, watch as _, onMounted as g, resolveComponent as s, openBlock as d, createElementBlock as u, createElementVNode as i, toDisplayString as h, createVNode as v, withModifiers as k, withCtx as x, withDirectives as C, renderSlot as b, createCommentVNode as y, vShow as F } from "vue";
2
2
  import { mdiChevronDown as S, mdiChevronUp as M } from "@mdi/js";
3
- import { paramCase as Q } from "change-case";
3
+ import { kebabCase as Q } from "change-case";
4
4
  import A from "./KvExpandable.js";
5
5
  import D from "./KvMaterialIcon.js";
6
6
  import E from "../_virtual/_plugin-vue_export-helper.js";
@@ -45,11 +45,11 @@ const H = {
45
45
  const {
46
46
  title: n,
47
47
  active: t
48
- } = f(o), e = p(t.value || !1), l = w(() => Q(n.value)), r = () => {
48
+ } = m(o), e = p(t.value || !1), l = w(() => Q(n.value)), c = () => {
49
49
  o.kvTrackFunction("faq", "toggle", l.value, e.value ? "expand" : "collapse"), e.value = !e.value, a("toggle", { title: l.value });
50
50
  };
51
- return _(t, (c) => {
52
- e.value = c;
51
+ return _(t, (r) => {
52
+ e.value = r;
53
53
  }), g(() => {
54
54
  o.routeHash === `#${l.value}` && (e.value = !0);
55
55
  }), {
@@ -57,33 +57,33 @@ const H = {
57
57
  mdiChevronDown: S,
58
58
  mdiChevronUp: M,
59
59
  titleSlugified: l,
60
- toggleFAQ: r
60
+ toggleFAQ: c
61
61
  };
62
62
  }
63
63
  }, T = { class: "tw-whitespace-normal" }, B = { class: "tw-text-subhead tw-text-left" }, K = { class: "tw-prose tw-pb-4 tw-pt-2" }, N = ["innerHTML"];
64
64
  function V(o, a, n, t, e, l) {
65
- const r = s("kv-material-icon"), c = s("kv-expandable");
65
+ const c = s("kv-material-icon"), r = s("kv-expandable");
66
66
  return d(), u("div", T, [
67
67
  i("button", {
68
68
  class: "tw-w-full tw-py-2 tw-flex tw-justify-between tw-not-prose",
69
- onClick: a[0] || (a[0] = (...m) => t.toggleFAQ && t.toggleFAQ(...m))
69
+ onClick: a[0] || (a[0] = (...f) => t.toggleFAQ && t.toggleFAQ(...f))
70
70
  }, [
71
71
  i("h3", B, h(n.title), 1),
72
- v(r, {
72
+ v(c, {
73
73
  class: "tw-w-4 tw-h-4",
74
74
  icon: t.open ? t.mdiChevronUp : t.mdiChevronDown,
75
75
  onClick: k(t.toggleFAQ, ["stop"])
76
76
  }, null, 8, ["icon", "onClick"])
77
77
  ]),
78
- v(c, { easing: "ease-in-out" }, {
78
+ v(r, { easing: "ease-in-out" }, {
79
79
  default: x(() => [
80
80
  C(i("div", null, [
81
81
  i("div", K, [
82
- y(o.$slots, "default"),
82
+ b(o.$slots, "default"),
83
83
  n.content !== "" ? (d(), u("div", {
84
84
  key: 0,
85
85
  innerHTML: n.content
86
- }, null, 8, N)) : b("", !0)
86
+ }, null, 8, N)) : y("", !0)
87
87
  ])
88
88
  ], 512), [
89
89
  [F, t.open]
@@ -1,11 +1,11 @@
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 = {
1
+ import { toRefs as A, ref as v, computed as d, onMounted as F, resolveComponent as U, openBlock as n, createElementBlock as o, normalizeClass as r, createElementVNode as s, createBlock as p, normalizeStyle as H, createCommentVNode as y, withDirectives as b, vShow as B, toDisplayString as I } from "vue";
2
+ import { isLegacyPlaceholderAvatar as P, randomizedUserAvatarClass as D } from "../utils/imageUtils.js";
3
+ import M from "./KvLoadingPlaceholder.js";
4
+ import N from "../_virtual/_plugin-vue_export-helper.js";
5
+ const V = {
6
6
  name: "KvUserAvatar",
7
7
  components: {
8
- KvLoadingPlaceholder: U
8
+ KvLoadingPlaceholder: M
9
9
  },
10
10
  props: {
11
11
  /**
@@ -30,92 +30,104 @@ const b = {
30
30
  default: !1
31
31
  }
32
32
  },
33
- setup(w) {
33
+ setup(u) {
34
34
  const {
35
- lenderName: l,
35
+ lenderName: a,
36
36
  lenderImageUrl: t,
37
37
  isSmall: e
38
- } = y(w), s = g(!0), c = g(null), m = d(() => l.value === "" && t.value === "" || l.value === "Anonymous"), f = () => {
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 `${F()} ${a}`;
41
- }, h = d(() => {
42
- var a;
43
- return ((a = t == null ? void 0 : t.value) == null ? void 0 : a.split("/").pop()) ?? "";
44
- }), v = d(() => {
45
- var a;
46
- return (a = l == null ? void 0 : l.value) == null ? void 0 : a.substring(0, 1).toUpperCase();
38
+ } = A(u), i = v(!0), m = v(null), c = d(() => a.value === "" && t.value === "" || a.value === "Anonymous"), f = () => {
39
+ const l = e != null && e.value ? "tw-w-3 tw-h-3 tw-text-h4" : "tw-w-6 tw-h-6 tw-text-h2";
40
+ return `${D()} ${l}`;
41
+ }, S = d(() => {
42
+ var l;
43
+ return ((l = t == null ? void 0 : t.value) == null ? void 0 : l.split("/").pop()) ?? "";
44
+ }), _ = d(() => {
45
+ var l;
46
+ return (l = a == null ? void 0 : a.value) == null ? void 0 : l.substring(0, 1).toUpperCase();
47
+ }), g = () => {
48
+ i.value = !1;
49
+ }, C = (l, w = 1e4) => new Promise((L, k) => {
50
+ const x = Date.now() + w, h = () => {
51
+ l.complete ? L(l) : Date.now() > x ? k(new Error(`Timeout: ${l.src}`)) : setTimeout(h, 50);
52
+ };
53
+ h();
47
54
  });
48
- return {
49
- isAnonymousUser: m,
55
+ return F(async () => {
56
+ const l = m.value;
57
+ try {
58
+ await C(l), g();
59
+ } catch (w) {
60
+ console.log(w.message);
61
+ }
62
+ }), {
63
+ isAnonymousUser: c,
50
64
  avatarClass: f,
51
- imageFilename: h,
52
- lenderNameFirstLetter: v,
53
- isLegacyPlaceholderAvatar: A,
54
- isLoading: s,
55
- onImgLoad: () => {
56
- s.value = !1;
57
- },
58
- imageRef: c
65
+ imageFilename: S,
66
+ lenderNameFirstLetter: _,
67
+ isLegacyPlaceholderAvatar: P,
68
+ isLoading: i,
69
+ onImgLoad: g,
70
+ imageRef: m
59
71
  };
60
72
  }
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", {
73
+ }, j = { key: 1 }, z = ["src"], E = { class: "tw-self-center" };
74
+ function K(u, a, t, e, i, m) {
75
+ const c = U("kv-loading-placeholder");
76
+ return n(), o("div", {
65
77
  class: r(["data-hj-suppress tw-flex", { "tw-w-3": t.isSmall, "tw-w-6": !t.isSmall }])
66
78
  }, [
67
- e.isAnonymousUser ? (n(), i("div", {
79
+ e.isAnonymousUser ? (n(), o("div", {
68
80
  key: 0,
69
81
  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 }])
70
82
  }, [
71
- (n(), i("svg", {
83
+ (n(), o("svg", {
72
84
  class: r(["tw-h-full tw-text-brand", { "tw-w-3 tw-h-3": t.isSmall }]),
73
85
  width: "25",
74
86
  height: "37",
75
87
  viewBox: "0 0 25 37",
76
88
  fill: "none",
77
89
  xmlns: "http://www.w3.org/2000/svg"
78
- }, l[1] || (l[1] = [
79
- o("path", {
90
+ }, a[1] || (a[1] = [
91
+ s("path", {
80
92
  d: "M8.22861 0.875H0.857178V36.3125H8.22861V0.875Z",
81
93
  fill: "white"
82
94
  }, null, -1),
83
- o("path", {
95
+ s("path", {
84
96
  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",
85
97
  fill: "white"
86
98
  }, null, -1),
87
- o("path", {
99
+ s("path", {
88
100
  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",
89
101
  fill: "white"
90
102
  }, null, -1)
91
103
  ]), 2))
92
- ], 2)) : !e.isLegacyPlaceholderAvatar(e.imageFilename) && e.imageFilename ? (n(), i("div", B, [
93
- e.isLoading ? (n(), _(m, {
104
+ ], 2)) : !e.isLegacyPlaceholderAvatar(e.imageFilename) && e.imageFilename ? (n(), o("div", j, [
105
+ e.isLoading ? (n(), p(c, {
94
106
  key: 0,
95
- style: L({
107
+ style: H({
96
108
  width: t.isSmall ? "1.5rem" : "3rem",
97
109
  height: t.isSmall ? "1.5rem" : "3rem"
98
110
  }),
99
111
  class: "!tw-rounded-full"
100
- }, null, 8, ["style"])) : u("", !0),
101
- C(o("img", {
112
+ }, null, 8, ["style"])) : y("", !0),
113
+ b(s("img", {
102
114
  ref: "imageRef",
103
115
  src: t.lenderImageUrl,
104
116
  alt: "Image of lender",
105
117
  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]
118
+ onLoad: a[0] || (a[0] = (f) => e.onImgLoad())
119
+ }, null, 42, z), [
120
+ [B, !e.isLoading]
109
121
  ])
110
- ])) : e.isLegacyPlaceholderAvatar(e.imageFilename) || !e.imageFilename ? (n(), i("div", {
122
+ ])) : e.isLegacyPlaceholderAvatar(e.imageFilename) || !e.imageFilename ? (n(), o("div", {
111
123
  key: 2,
112
124
  class: r(["tw-rounded-full tw-inline-flex tw-align-center tw-justify-center", e.avatarClass()])
113
125
  }, [
114
- o("span", p, k(e.lenderNameFirstLetter), 1)
115
- ], 2)) : u("", !0)
126
+ s("span", E, I(e.lenderNameFirstLetter), 1)
127
+ ], 2)) : y("", !0)
116
128
  ], 2);
117
129
  }
118
- const M = /* @__PURE__ */ H(b, [["render", N]]);
130
+ const G = /* @__PURE__ */ N(V, [["render", K]]);
119
131
  export {
120
- M as default
132
+ G as default
121
133
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "6.8.1",
3
+ "version": "6.9.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -46,7 +46,7 @@
46
46
  "babel-core": "^7.0.0-bridge.0",
47
47
  "babel-jest": "^27.0.6",
48
48
  "babel-loader": "^8.2.2",
49
- "change-case": "^4.1.2",
49
+ "change-case": "^5.4.4",
50
50
  "chromatic": "^5.9.2",
51
51
  "css-loader": "^6.0.0",
52
52
  "date-fns": "^2.30.0",
@@ -93,7 +93,7 @@
93
93
  "@kiva/kv-tokens": "3.x",
94
94
  "@mdi/js": "7.x",
95
95
  "@vueuse/integrations": "9.x",
96
- "change-case": "4.x",
96
+ "change-case": "^5.4.4",
97
97
  "date-fns": "2.x",
98
98
  "focus-trap": "6.x",
99
99
  "nanoid": "3.x",
@@ -107,5 +107,5 @@
107
107
  "embla-carousel-fade",
108
108
  "popper.js"
109
109
  ],
110
- "gitHead": "26e1f18a4d9bb716f47da262f1eb9f9d84924a81"
110
+ "gitHead": "dad6b80ddad74a9981a9fdf87a625a16d112fb2b"
111
111
  }