@kiva/kv-components 9.1.0 → 9.2.0

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.
Files changed (42) hide show
  1. package/dist/utils/headerMenuTiming.d.ts +6 -0
  2. package/dist/utils/headerMenuTiming.js +9 -0
  3. package/dist/utils/useHeaderMenuGroup.d.ts +27 -0
  4. package/dist/utils/useHeaderMenuGroup.js +68 -0
  5. package/dist/utils/useHeaderMenuPlacement.d.ts +6 -0
  6. package/dist/utils/useHeaderMenuPlacement.js +30 -0
  7. package/dist/utils/useHeaderMenuState.d.ts +10 -0
  8. package/dist/utils/useHeaderMenuState.js +21 -0
  9. package/dist/utils/useHoverIntent.d.ts +5 -0
  10. package/dist/utils/useHoverIntent.js +17 -0
  11. package/dist/utils/useOutsidePointerDown.d.ts +2 -0
  12. package/dist/utils/useOutsidePointerDown.js +19 -0
  13. package/dist/utils/usePointerType.d.ts +5 -0
  14. package/dist/utils/usePointerType.js +19 -0
  15. package/dist/vue/KvCheckoutReceipt.css +1 -1
  16. package/dist/vue/KvCheckoutReceipt.js +20 -21
  17. package/dist/vue/KvLoanTag.js +9 -10
  18. package/dist/vue/KvPopper.vue.d.ts +16 -0
  19. package/dist/vue/KvPopper2.js +42 -9
  20. package/dist/vue/KvTooltip.css +1 -1
  21. package/dist/vue/KvTooltip.js +40 -40
  22. package/dist/vue/KvTooltip2.js +60 -50
  23. package/dist/vue/KvWwwHeaderBasic/HeaderMenuGroup.css +1 -0
  24. package/dist/vue/KvWwwHeaderBasic/HeaderMenuGroup.js +35 -0
  25. package/dist/vue/KvWwwHeaderBasic/HeaderMenuGroup.vue.d.ts +25 -0
  26. package/dist/vue/KvWwwHeaderBasic/HeaderMenuGroup2.js +37 -0
  27. package/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic.css +1 -1
  28. package/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic.js +29 -75
  29. package/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic2.js +37 -92
  30. package/dist/vue/KvWwwHeaderBasic/LinkBar.css +1 -1
  31. package/dist/vue/KvWwwHeaderBasic/LinkBar.js +206 -132
  32. package/dist/vue/KvWwwHeaderBasic/LinkBar.vue.d.ts +226 -185
  33. package/dist/vue/KvWwwHeaderBasic/LinkBar2.js +69 -96
  34. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MobileLendMenu.vue.d.ts +9 -1
  35. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/SearchPanel.js +12 -11
  36. package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/SearchPanel.vue.d.ts +9 -1
  37. package/dist/vue/KvWwwHeaderBasic/SearchBar.js +12 -12
  38. package/dist/vue/KvWwwHeaderBasic/SearchBar.vue.d.ts +9 -1
  39. package/dist/vue/KvWwwHeaderBasic/SearchBar2.js +49 -43
  40. package/package.json +3 -4
  41. package/dist/utils/useHeaderBasicMenuState.d.ts +0 -3197
  42. package/dist/utils/useHeaderBasicMenuState.js +0 -30
@@ -0,0 +1,6 @@
1
+ export declare const MENU_OPEN_DELAY_MS = 100;
2
+ export declare const MENU_CLOSE_FADE_MS = 100;
3
+ export declare const MENU_TIMING_VARS: {
4
+ '--menu-open-delay': string;
5
+ '--menu-close-fade': string;
6
+ };
@@ -0,0 +1,9 @@
1
+ const _ = 100, E = 100, M = {
2
+ "--menu-open-delay": "100ms",
3
+ "--menu-close-fade": "100ms"
4
+ };
5
+ export {
6
+ E as MENU_CLOSE_FADE_MS,
7
+ _ as MENU_OPEN_DELAY_MS,
8
+ M as MENU_TIMING_VARS
9
+ };
@@ -0,0 +1,27 @@
1
+ import { Ref } from 'vue';
2
+ import { HeaderMenuState } from '../../../../../../../../../src/utils/useHeaderMenuState';
3
+ import { HeaderMenuPlacement } from '../../../../../../../../../src/utils/useHeaderMenuPlacement';
4
+ export interface TriggerAttrs {
5
+ 'aria-expanded': boolean;
6
+ 'aria-controls': string;
7
+ onClick(event: Event): void;
8
+ }
9
+ export interface HeaderMenuGroupOptions {
10
+ panelId: Ref<string>;
11
+ rootRef: Ref<HTMLElement | null>;
12
+ menus: HeaderMenuState;
13
+ placement?: HeaderMenuPlacement | null;
14
+ }
15
+ export declare function useHeaderMenuGroup({ panelId, rootRef, menus, placement, }: HeaderMenuGroupOptions): {
16
+ approached: Ref<boolean, boolean>;
17
+ toggled: import('vue').ComputedRef<boolean>;
18
+ expanded: import('vue').ComputedRef<any>;
19
+ trigger: import('vue').ComputedRef<TriggerAttrs>;
20
+ toggle: (event?: Event) => void;
21
+ close: () => void;
22
+ onPointerEnter: (event: PointerEvent) => void;
23
+ onPointerLeave: () => void;
24
+ onFocusIn: () => void;
25
+ onFocusOut: (event: FocusEvent) => void;
26
+ onKeydown: (event: KeyboardEvent) => void;
27
+ };
@@ -0,0 +1,68 @@
1
+ import { ref as k, computed as s, onMounted as m, onBeforeUnmount as x } from "vue";
2
+ import { MENU_OPEN_DELAY_MS as A } from "./headerMenuTiming.js";
3
+ import { useHoverIntent as D } from "./useHoverIntent.js";
4
+ import { useOutsidePointerDown as H } from "./useOutsidePointerDown.js";
5
+ function w({
6
+ panelId: l,
7
+ rootRef: a,
8
+ menus: t,
9
+ placement: c
10
+ }) {
11
+ const n = k(!1), f = D(A);
12
+ let i;
13
+ const o = s(() => t.toggledId.value === l.value), v = s(() => o.value || f.settled.value);
14
+ function d(e) {
15
+ if ((e == null ? void 0 : e.currentTarget) instanceof HTMLAnchorElement && e.currentTarget.hasAttribute("href")) {
16
+ if (t.pointerType.value !== "touch") return;
17
+ e.preventDefault();
18
+ }
19
+ n.value = !0, t.toggle(l.value);
20
+ }
21
+ function u() {
22
+ o.value && t.close();
23
+ }
24
+ H(a, o, u);
25
+ function p(e) {
26
+ n.value = !0, e.pointerType !== "touch" && (o.value || t.close(), f.enter());
27
+ }
28
+ function h() {
29
+ f.leave();
30
+ }
31
+ function E() {
32
+ n.value = !0;
33
+ }
34
+ function T(e) {
35
+ var r;
36
+ e.relatedTarget instanceof Element && ((r = a.value) != null && r.contains(e.relatedTarget) || u());
37
+ }
38
+ function y(e) {
39
+ var r, g;
40
+ e.key !== "Escape" || !o.value || (u(), (g = (r = a.value) == null ? void 0 : r.querySelector("[aria-expanded]")) == null || g.focus());
41
+ }
42
+ const M = s(() => ({
43
+ "aria-expanded": v.value,
44
+ "aria-controls": l.value,
45
+ onClick: d
46
+ }));
47
+ return m(() => {
48
+ const e = a.value;
49
+ e && (i = c == null ? void 0 : c.registerGroup(e), e.matches(":hover") && (n.value = !0));
50
+ }), x(() => {
51
+ i == null || i(), u();
52
+ }), {
53
+ approached: n,
54
+ toggled: o,
55
+ expanded: v,
56
+ trigger: M,
57
+ toggle: d,
58
+ close: u,
59
+ onPointerEnter: p,
60
+ onPointerLeave: h,
61
+ onFocusIn: E,
62
+ onFocusOut: T,
63
+ onKeydown: y
64
+ };
65
+ }
66
+ export {
67
+ w as useHeaderMenuGroup
68
+ };
@@ -0,0 +1,6 @@
1
+ import { InjectionKey, Ref } from 'vue';
2
+ export interface HeaderMenuPlacement {
3
+ registerGroup(el: HTMLElement): () => void;
4
+ }
5
+ export declare const HEADER_MENU_PLACEMENT: InjectionKey<HeaderMenuPlacement>;
6
+ export declare function useHeaderMenuPlacement(rootRef: Ref<HTMLElement | null>): HeaderMenuPlacement;
@@ -0,0 +1,30 @@
1
+ import { onMounted as g, onBeforeUnmount as d } from "vue";
2
+ const p = Symbol("headerMenuPlacement");
3
+ function y(c) {
4
+ const o = /* @__PURE__ */ new Set();
5
+ let e = null;
6
+ function a() {
7
+ const t = c.value, i = t == null ? void 0 : t.offsetParent;
8
+ if (!t || !(i instanceof HTMLElement)) return;
9
+ const n = i.getBoundingClientRect(), u = Array.from(o, (r) => [r, r.getBoundingClientRect()]);
10
+ t.style.setProperty("--nav-height", `${n.height}px`), u.forEach(([r, s]) => {
11
+ const f = s.left + s.width / 2;
12
+ r.style.setProperty("--trigger-gap-left", `${f - n.left}px`), r.style.setProperty("--trigger-gap-right", `${n.right - f}px`), r.style.setProperty("--trigger-width", `${s.width}px`);
13
+ });
14
+ }
15
+ function l(t) {
16
+ return o.add(t), e == null || e.observe(t), () => {
17
+ o.delete(t), e == null || e.unobserve(t);
18
+ };
19
+ }
20
+ return g(() => {
21
+ const t = c.value, i = t == null ? void 0 : t.offsetParent;
22
+ typeof ResizeObserver < "u" && t && i instanceof HTMLElement && (e = new ResizeObserver(a), e.observe(i), Array.from(t.children).forEach((n) => e == null ? void 0 : e.observe(n)), o.forEach((n) => e == null ? void 0 : e.observe(n))), a();
23
+ }), d(() => {
24
+ e == null || e.disconnect(), e = null;
25
+ }), { registerGroup: l };
26
+ }
27
+ export {
28
+ p as HEADER_MENU_PLACEMENT,
29
+ y as useHeaderMenuPlacement
30
+ };
@@ -0,0 +1,10 @@
1
+ import { InjectionKey, Ref } from 'vue';
2
+ import { PointerType } from '../../../../../../../../../src/utils/usePointerType';
3
+ export interface HeaderMenuState {
4
+ toggledId: Readonly<Ref<string | null>>;
5
+ pointerType: Readonly<Ref<PointerType | null>>;
6
+ toggle(id: string): void;
7
+ close(): void;
8
+ }
9
+ export declare const HEADER_MENU_STATE: InjectionKey<HeaderMenuState>;
10
+ export declare function useHeaderMenuState(pointerType: Readonly<Ref<PointerType | null>>): HeaderMenuState;
@@ -0,0 +1,21 @@
1
+ import { ref as u, readonly as r } from "vue";
2
+ const c = Symbol("headerMenuState");
3
+ function d(n) {
4
+ const e = u(null);
5
+ function t(l) {
6
+ e.value = e.value === l ? null : l;
7
+ }
8
+ function o() {
9
+ e.value = null;
10
+ }
11
+ return {
12
+ toggledId: r(e),
13
+ pointerType: n,
14
+ toggle: t,
15
+ close: o
16
+ };
17
+ }
18
+ export {
19
+ c as HEADER_MENU_STATE,
20
+ d as useHeaderMenuState
21
+ };
@@ -0,0 +1,5 @@
1
+ export declare function useHoverIntent(delayMs: number): {
2
+ settled: import('vue').Ref<boolean, boolean>;
3
+ enter: () => void;
4
+ leave: () => void;
5
+ };
@@ -0,0 +1,17 @@
1
+ import { ref as u, onBeforeUnmount as l } from "vue";
2
+ function a(o) {
3
+ const t = u(!1);
4
+ let e;
5
+ function n() {
6
+ clearTimeout(e), e = setTimeout(() => {
7
+ t.value = !0;
8
+ }, o);
9
+ }
10
+ function r() {
11
+ clearTimeout(e), t.value = !1;
12
+ }
13
+ return l(() => clearTimeout(e)), { settled: t, enter: n, leave: r };
14
+ }
15
+ export {
16
+ a as useHoverIntent
17
+ };
@@ -0,0 +1,2 @@
1
+ import { Ref } from 'vue';
2
+ export declare function useOutsidePointerDown(rootRef: Ref<HTMLElement | null>, active: Ref<boolean>, onOutside: () => void): void;
@@ -0,0 +1,19 @@
1
+ import { watch as f, onMounted as a, onBeforeUnmount as c } from "vue";
2
+ function s(u, o, d) {
3
+ function e(n) {
4
+ var i;
5
+ n.target instanceof Node && ((i = u.value) != null && i.contains(n.target)) || d();
6
+ }
7
+ function t() {
8
+ document.addEventListener("pointerdown", e);
9
+ }
10
+ function r() {
11
+ document.removeEventListener("pointerdown", e);
12
+ }
13
+ f(o, (n) => n ? t() : r()), a(() => {
14
+ o.value && t();
15
+ }), c(r);
16
+ }
17
+ export {
18
+ s as useOutsidePointerDown
19
+ };
@@ -0,0 +1,5 @@
1
+ import { Ref } from 'vue';
2
+ export type PointerType = 'mouse' | 'pen' | 'touch';
3
+ export declare function usePointerType(rootRef: Ref<HTMLElement | null>): {
4
+ pointerType: Ref<PointerType, PointerType>;
5
+ };
@@ -0,0 +1,19 @@
1
+ import { ref as i, onMounted as a, onBeforeUnmount as p } from "vue";
2
+ function s(n) {
3
+ const o = i(null);
4
+ function r(t) {
5
+ const e = t.pointerType;
6
+ e && e !== o.value && (o.value = e);
7
+ }
8
+ return a(() => {
9
+ var e, u;
10
+ const t = typeof window.matchMedia == "function" && window.matchMedia("(hover: none)").matches;
11
+ o.value = t ? "touch" : "mouse", (e = n.value) == null || e.addEventListener("pointerdown", r, { capture: !0, passive: !0 }), (u = n.value) == null || u.addEventListener("pointermove", r, { capture: !0, passive: !0 });
12
+ }), p(() => {
13
+ var t, e;
14
+ (t = n.value) == null || t.removeEventListener("pointerdown", r, { capture: !0 }), (e = n.value) == null || e.removeEventListener("pointermove", r, { capture: !0 });
15
+ }), { pointerType: o };
16
+ }
17
+ export {
18
+ s as usePointerType
19
+ };
@@ -1 +1 @@
1
- .section[data-v-1d721061]{border-bottom-width:.0625rem;border-top-width:0px;--tw-border-opacity: 1;border-color:rgba(var(--border-tertiary),var(--tw-border-opacity, 1));padding:.5rem;display:block;overflow:hidden}@media print{.section[data-v-1d721061]{page-break-inside:avoid}}.section--lender-info[data-v-1d721061]{padding-top:0}.section--print[data-v-1d721061]{border-bottom:0}.checkout-receipt__headline[data-v-1d721061]{text-align:center;margin-bottom:1.5rem}.checkout-receipt__item-list[data-v-1d721061]{list-style:none;margin:0;width:100%}.loan__name[data-v-1d721061]{margin-bottom:.5rem}.loan__name--inline[data-v-1d721061]{display:inline-block}.loan__amount[data-v-1d721061]{text-align:right}.total[data-v-1d721061]{display:flex;align-items:baseline}.total__header[data-v-1d721061],.total__amount[data-v-1d721061]{text-align:right;flex:1}.total__amount[data-v-1d721061]{flex-grow:.33}.payments[data-v-1d721061]{border-bottom:none}.payments__type[data-v-1d721061]{display:flex;text-align:right}.payments__type-title[data-v-1d721061],.payments__type-amount[data-v-1d721061]{flex:1}.print[data-v-1d721061]{margin:0 auto}
1
+ .section[data-v-e06307e1]{border-bottom-width:.0625rem;border-top-width:0px;--tw-border-opacity: 1;border-color:rgba(var(--border-tertiary),var(--tw-border-opacity, 1));padding:.5rem;display:block;overflow:hidden}@media print{.section[data-v-e06307e1]{page-break-inside:avoid}}.section--lender-info[data-v-e06307e1]{padding-top:0}.section--print[data-v-e06307e1]{border-bottom:0}.checkout-receipt__headline[data-v-e06307e1]{text-align:center;margin-bottom:1.5rem}.checkout-receipt__item-list[data-v-e06307e1]{list-style:none;margin:0;width:100%}.loan__name[data-v-e06307e1]{margin-bottom:.5rem}.loan__name--inline[data-v-e06307e1]{display:inline-block}.loan__amount[data-v-e06307e1]{text-align:right}.total[data-v-e06307e1]{display:flex;align-items:baseline}.total__header[data-v-e06307e1],.total__amount[data-v-e06307e1]{text-align:right;flex:1}.total__amount[data-v-e06307e1]{flex-grow:.33}.payments[data-v-e06307e1]{border-bottom:none}.payments__type[data-v-e06307e1]{display:flex;text-align:right}.payments__type-title[data-v-e06307e1],.payments__type-amount[data-v-e06307e1]{flex:1}.print[data-v-e06307e1]{margin:0 auto}
@@ -1,5 +1,5 @@
1
- import C from "./KvCheckoutReceipt2.js";
2
- import { resolveComponent as _, resolveDirective as f, openBlock as s, createElementBlock as o, createElementVNode as e, toDisplayString as i, createCommentVNode as d, Fragment as c, renderList as k, createTextVNode as l, createVNode as p, withCtx as v, withDirectives as b } from "vue";
1
+ import f from "./KvCheckoutReceipt2.js";
2
+ import { resolveComponent as _, resolveDirective as h, openBlock as s, createElementBlock as o, createElementVNode as e, toDisplayString as i, createCommentVNode as d, Fragment as c, renderList as k, createTextVNode as l, createVNode as p, withCtx as v, withDirectives as b } from "vue";
3
3
  import "./KvCheckoutReceipt.css";
4
4
  import x from "../_virtual/_plugin-vue_export-helper.js";
5
5
  const g = { class: "checkout-receipt" }, T = { class: "checkout-receipt__wrapper tw-bg-primary tw-p-4 tw-rounded-xs tw-border tw-border-tertiary" }, j = {
@@ -33,24 +33,24 @@ const g = { class: "checkout-receipt" }, T = { class: "checkout-receipt__wrapper
33
33
  }, B = {
34
34
  "data-testid": "kcard",
35
35
  class: "loan kcard"
36
- }, L = {
36
+ }, U = {
37
37
  class: "loan__details data-hj-suppress",
38
38
  "data-testid": "kcard-details"
39
- }, U = {
39
+ }, q = {
40
40
  key: 0,
41
41
  "data-testid": "kcard-details",
42
42
  class: "loan__details data-hj-suppress"
43
- }, q = {
43
+ }, z = {
44
44
  class: "loan__details data-hj-suppress",
45
45
  "data-testid": "kcard-details"
46
- }, z = {
46
+ }, L = {
47
47
  class: "loan__amount tw-text-title",
48
48
  "data-testid": "kcard-amount"
49
- }, G = {
49
+ }, S = {
50
50
  key: 0,
51
51
  "data-testid": "kcard-portfolio",
52
52
  class: "section tw-text-center print:!tw-hidden"
53
- }, S = { href: "/portfolio/kiva-cards" }, W = { class: "checkout-receipt__item-list" }, Y = { class: "section" }, H = {
53
+ }, W = { href: "/portfolio/kiva-cards" }, Y = { class: "checkout-receipt__item-list" }, G = { class: "section" }, H = {
54
54
  class: "loan",
55
55
  "data-testid": "donation"
56
56
  }, J = {
@@ -103,7 +103,7 @@ const g = { class: "checkout-receipt" }, T = { class: "checkout-receipt__wrapper
103
103
  "data-testid": "amount-charged-payment-amount"
104
104
  }, ct = { class: "section section--print print:!tw-hidden" };
105
105
  function pt(_t, t, n, m, mt, r) {
106
- const u = _("kv-material-icon"), y = _("kv-tooltip"), w = _("kv-button"), h = f("kv-track-event");
106
+ const u = _("kv-material-icon"), y = _("kv-tooltip"), w = _("kv-button"), C = h("kv-track-event");
107
107
  return s(), o("div", g, [
108
108
  t[25] || (t[25] = e("h2", { class: "checkout-receipt__headline" }, " Order Confirmation ", -1)),
109
109
  e("div", T, [
@@ -167,8 +167,7 @@ function pt(_t, t, n, m, mt, r) {
167
167
  }, null, 8, ["id", "icon"]),
168
168
  p(y, {
169
169
  "data-testid": "kcard-tool-tip-text",
170
- controller: `print-card-${a.id}`,
171
- theme: "ecoGreenLight"
170
+ controller: `print-card-${a.id}`
172
171
  }, {
173
172
  default: v(() => t[2] || (t[2] = [
174
173
  l(" You can print this card now. We'll also send it to you in an email so you can print it later. ")
@@ -193,7 +192,7 @@ function pt(_t, t, n, m, mt, r) {
193
192
  class: "loan__name tw-text-title",
194
193
  "data-testid": "kcard-type-postal"
195
194
  }, " Postal delivery Kiva Card ", -1)),
196
- e("div", L, [
195
+ e("div", U, [
197
196
  l(" For: " + i(a.kivaCardObject.mailingInfo.firstName) + " " + i(a.kivaCardObject.mailingInfo.lastName), 1),
198
197
  t[6] || (t[6] = e("br", null, null, -1)),
199
198
  l(" " + i(a.kivaCardObject.mailingInfo.address), 1),
@@ -209,13 +208,13 @@ function pt(_t, t, n, m, mt, r) {
209
208
  class: "loan__name tw-text-title",
210
209
  "data-testid": "kcard-type-lender"
211
210
  }, " Kiva Card ", -1)),
212
- a.kivaCardObject.recipient.name ? (s(), o("div", U, " For: " + i(a.kivaCardObject.recipient.name), 1)) : d("", !0)
211
+ a.kivaCardObject.recipient.name ? (s(), o("div", q, " For: " + i(a.kivaCardObject.recipient.name), 1)) : d("", !0)
213
212
  ], 64)) : a.kivaCardObject.deliveryType === "email" ? (s(), o(c, { key: 3 }, [
214
213
  t[11] || (t[11] = e("h3", {
215
214
  class: "loan__name tw-text-title",
216
215
  "data-testid": "kcard-type-email"
217
216
  }, " Email delivery Kiva Card ", -1)),
218
- e("div", q, [
217
+ e("div", z, [
219
218
  t[10] || (t[10] = l(" For: ")),
220
219
  a.kivaCardObject.recipient.name ? (s(), o(c, { key: 0 }, [
221
220
  l(i(a.kivaCardObject.recipient.name) + " – ", 1)
@@ -223,23 +222,23 @@ function pt(_t, t, n, m, mt, r) {
223
222
  l(" " + i(a.kivaCardObject.recipient.email), 1)
224
223
  ])
225
224
  ], 64)) : d("", !0),
226
- e("div", z, " $" + i(a.price), 1)
225
+ e("div", L, " $" + i(a.price), 1)
227
226
  ])
228
227
  ]))), 128)),
229
- r.kivaCards.length > 0 ? (s(), o("li", G, [
228
+ r.kivaCards.length > 0 ? (s(), o("li", S, [
230
229
  t[13] || (t[13] = l(" For more details about all your Kiva Card purchases, please visit your ")),
231
- b((s(), o("a", S, t[12] || (t[12] = [
230
+ b((s(), o("a", W, t[12] || (t[12] = [
232
231
  l(" Kiva portfolio ")
233
232
  ]))), [
234
- [h, ["Thanks", "click", "kiva-card-portfolio"]]
233
+ [C, ["Thanks", "click", "kiva-card-portfolio"]]
235
234
  ]),
236
235
  t[14] || (t[14] = l(". "))
237
236
  ])) : d("", !0)
238
237
  ])
239
238
  ]),
240
239
  e("section", null, [
241
- e("ul", W, [
242
- e("li", Y, [
240
+ e("ul", Y, [
241
+ e("li", G, [
243
242
  e("div", H, [
244
243
  t[15] || (t[15] = e("h3", { class: "loan__name tw-text-title" }, " Donation to Kiva ", -1)),
245
244
  n.receipt.totals.donationTotal > 0 ? (s(), o("a", {
@@ -307,7 +306,7 @@ function pt(_t, t, n, m, mt, r) {
307
306
  ])
308
307
  ]);
309
308
  }
310
- const wt = /* @__PURE__ */ x(C, [["render", pt], ["__scopeId", "data-v-1d721061"]]);
309
+ const wt = /* @__PURE__ */ x(f, [["render", pt], ["__scopeId", "data-v-e06307e1"]]);
311
310
  export {
312
311
  wt as default
313
312
  };
@@ -1,6 +1,6 @@
1
1
  import h from "./KvLoanTag2.js";
2
2
  import { KV_LOAN_TAG_FRAGMENT as L } from "./KvLoanTag2.js";
3
- import { resolveComponent as d, openBlock as e, createElementBlock as r, normalizeStyle as _, normalizeClass as w, Fragment as l, createTextVNode as m, toDisplayString as a, createElementVNode as o, createVNode as p, withCtx as y, renderList as f, createBlock as k, createCommentVNode as s } from "vue";
3
+ import { resolveComponent as d, openBlock as e, createElementBlock as r, normalizeStyle as _, normalizeClass as w, Fragment as o, createTextVNode as m, toDisplayString as a, createElementVNode as l, createVNode as p, withCtx as y, renderList as k, createBlock as f, createCommentVNode as s } from "vue";
4
4
  import x from "../_virtual/_plugin-vue_export-helper.js";
5
5
  const v = ["id"], M = { class: "tw-whitespace-nowrap tw-pb-0.5" };
6
6
  function N(b, i, c, C, T, t) {
@@ -10,30 +10,29 @@ function N(b, i, c, C, T, t) {
10
10
  class: w(["tw-text-small tw-font-medium tw-pt-0.5", { "tw-line-clamp-1": !t.isMultipleMatch }]),
11
11
  style: _({ color: t.tagColor })
12
12
  }, [
13
- t.isMultipleMatch ? (e(), r(l, { key: 0 }, [
13
+ t.isMultipleMatch ? (e(), r(o, { key: 0 }, [
14
14
  m(a(t.totalMatchRatio) + "x match by ", 1),
15
- o("span", {
15
+ l("span", {
16
16
  id: `matching-orgs-${c.loan.id}`,
17
17
  class: "tw-underline tw-decoration-dotted tw-cursor-pointer"
18
18
  }, a(t.multiMatchingOrgs.length) + " organizations", 9, v),
19
19
  p(u, {
20
20
  controller: `matching-orgs-${c.loan.id}`,
21
- "max-width": "320px",
22
- theme: "default"
21
+ "max-width": "320px"
23
22
  }, {
24
23
  default: y(() => [
25
- o("p", M, " Your contribution is matched by " + a(t.multiMatchingOrgs.length) + " partners ", 1),
26
- i[0] || (i[0] = o("hr", { class: "tw-border-caution-highlight tw-py-0.5" }, null, -1)),
27
- (e(!0), r(l, null, f(t.multiMatchingOrgs, (n) => (e(), r("p", {
24
+ l("p", M, " Your contribution is matched by " + a(t.multiMatchingOrgs.length) + " partners ", 1),
25
+ i[0] || (i[0] = l("hr", { class: "tw-border-caution-highlight tw-py-0.5" }, null, -1)),
26
+ (e(!0), r(o, null, k(t.multiMatchingOrgs, (n) => (e(), r("p", {
28
27
  key: n.managedAccountId,
29
28
  class: "tw-m-0"
30
29
  }, a(n.ratio) + ":1 matching by " + a(t.orgDisplayName(n)), 1))), 128))
31
30
  ]),
32
31
  _: 1
33
32
  }, 8, ["controller"])
34
- ], 64)) : (e(), r(l, { key: 1 }, [
33
+ ], 64)) : (e(), r(o, { key: 1 }, [
35
34
  m(a(t.tagText) + " ", 1),
36
- t.variation === "ending-soon" ? (e(), k(g, {
35
+ t.variation === "ending-soon" ? (e(), f(g, {
37
36
  key: 0,
38
37
  deadline: t.deadline
39
38
  }, null, 8, ["deadline"])) : s("", !0)
@@ -23,17 +23,28 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
23
23
  type: ObjectConstructor;
24
24
  default: () => void;
25
25
  };
26
+ persistent: {
27
+ type: BooleanConstructor;
28
+ default: boolean;
29
+ };
26
30
  }>, {}, {
27
31
  popper: any;
28
32
  popperPromise: any;
29
33
  styles: {};
30
34
  show: boolean;
31
35
  timeout: any;
36
+ suppressOpen: boolean;
32
37
  }, {
33
38
  reference(): any;
39
+ hitTargets(): any[];
34
40
  }, {
35
41
  open(): void;
36
42
  close(): void;
43
+ closeOnLeave(): void;
44
+ hide(): void;
45
+ outsideHandler(e: any): void;
46
+ dismiss(): void;
47
+ keyupHandler(e: any): void;
37
48
  toggle(): void;
38
49
  update(): void;
39
50
  initPopper(): any;
@@ -70,11 +81,16 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
70
81
  type: ObjectConstructor;
71
82
  default: () => void;
72
83
  };
84
+ persistent: {
85
+ type: BooleanConstructor;
86
+ default: boolean;
87
+ };
73
88
  }>> & Readonly<{}>, {
74
89
  openDelay: number;
75
90
  closeDelay: number;
76
91
  transitionType: string;
77
92
  popperPlacement: string;
78
93
  popperModifiers: Record<string, any>;
94
+ persistent: boolean;
79
95
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
80
96
  export default _default;
@@ -1,4 +1,4 @@
1
- import { offBodyTouchstart as r, onBodyTouchstart as o, isTargetElement as i } from "../utils/touchEvents.js";
1
+ import { offBodyTouchstart as i, onBodyTouchstart as o, isTargetElement as r } from "../utils/touchEvents.js";
2
2
  const h = {
3
3
  name: "KvPopper",
4
4
  props: {
@@ -14,7 +14,13 @@ const h = {
14
14
  transitionType: { type: String, default: "" },
15
15
  popperPlacement: { type: String, default: "bottom-start" },
16
16
  popperModifiers: { type: Object, default: () => {
17
- } }
17
+ } },
18
+ /**
19
+ * Stay open once shown, rather than closing when the pointer or focus leaves the
20
+ * controller. Escape and an outside click still close it. Use for poppers holding
21
+ * something interactive, which the user has to be able to reach and act on.
22
+ */
23
+ persistent: { type: Boolean, default: !1 }
18
24
  },
19
25
  data() {
20
26
  return {
@@ -22,12 +28,18 @@ const h = {
22
28
  popperPromise: null,
23
29
  styles: {},
24
30
  show: !1,
25
- timeout: null
31
+ timeout: null,
32
+ suppressOpen: !1
26
33
  };
27
34
  },
28
35
  computed: {
29
36
  reference() {
30
37
  return typeof this.controller == "string" ? document.getElementById(this.controller) : this.controller;
38
+ },
39
+ // reference resolves by id on every read, so it is null once the controller leaves
40
+ // the DOM while this popper is still mounted.
41
+ hitTargets() {
42
+ return [this.reference, this.$el].filter(Boolean);
31
43
  }
32
44
  },
33
45
  watch: {
@@ -46,7 +58,7 @@ const h = {
46
58
  },
47
59
  methods: {
48
60
  open() {
49
- this.initPopper().then(() => {
61
+ this.suppressOpen || this.initPopper().then(() => {
50
62
  this.setTimeout(() => {
51
63
  this.show = !0, this.popper.scheduleUpdate(), this.attachBodyEvents();
52
64
  }, this.openDelay);
@@ -57,6 +69,27 @@ const h = {
57
69
  this.show = !1, this.removeBodyEvents();
58
70
  }, this.closeDelay);
59
71
  },
72
+ // Persistent content has to stay reachable, so leaving the controller must not close
73
+ // it — by pointer or by tabbing in. Checked here so the prop can change after mount.
74
+ closeOnLeave() {
75
+ this.persistent || this.close();
76
+ },
77
+ // Close now, skipping closeDelay, for dismissals the user asked for directly.
78
+ hide() {
79
+ window.clearTimeout(this.timeout), this.show = !1, this.removeBodyEvents();
80
+ },
81
+ outsideHandler(e) {
82
+ r(e, this.hitTargets) || this.hide();
83
+ },
84
+ // Ends the current viewing. Returns focus only if it was inside, so it is not
85
+ // stranded on content that just went away.
86
+ dismiss() {
87
+ const e = this.$el.contains(document.activeElement);
88
+ this.hide(), e && this.reference && (this.suppressOpen = !0, this.reference.focus(), this.suppressOpen = !1);
89
+ },
90
+ keyupHandler(e) {
91
+ e.key === "Escape" && (e.stopPropagation(), this.dismiss());
92
+ },
60
93
  toggle() {
61
94
  this.show ? this.close() : this.open();
62
95
  },
@@ -80,22 +113,22 @@ const h = {
80
113
  }), this.popperPromise);
81
114
  },
82
115
  bodyTouchHandler(e) {
83
- i(e, [this.reference, this.$el]) || (this.show = !1, this.removeBodyEvents());
116
+ r(e, this.hitTargets) || (this.show = !1, this.removeBodyEvents());
84
117
  },
85
118
  referenceTapHandler(e) {
86
119
  e.preventDefault(), this.toggle();
87
120
  },
88
121
  attachEvents() {
89
- this.reference.addEventListener("mouseover", this.open), this.reference.addEventListener("focus", this.open), this.reference.addEventListener("mouseout", this.close), this.reference.addEventListener("blur", this.close), this.$el.addEventListener("mouseover", this.open), this.$el.addEventListener("mouseout", this.close), this.reference.addEventListener("touchstart", this.referenceTapHandler);
122
+ this.reference.addEventListener("mouseover", this.open), this.reference.addEventListener("focus", this.open), this.reference.addEventListener("touchstart", this.referenceTapHandler), this.reference.addEventListener("mouseout", this.closeOnLeave), this.reference.addEventListener("blur", this.closeOnLeave), this.$el.addEventListener("mouseover", this.open), this.$el.addEventListener("mouseout", this.closeOnLeave);
90
123
  },
91
124
  attachBodyEvents() {
92
- o(this.bodyTouchHandler);
125
+ o(this.bodyTouchHandler), document.addEventListener("click", this.outsideHandler), document.addEventListener("keyup", this.keyupHandler, !0);
93
126
  },
94
127
  removeEvents() {
95
- this.removeBodyEvents(), this.reference.removeEventListener("touchstart", this.referenceTapHandler), this.reference.removeEventListener("mouseover", this.open), this.reference.removeEventListener("mouseout", this.close), this.$el.removeEventListener("mouseover", this.open), this.$el.removeEventListener("mouseout", this.close);
128
+ this.removeBodyEvents(), this.reference.removeEventListener("touchstart", this.referenceTapHandler), this.reference.removeEventListener("mouseover", this.open), this.reference.removeEventListener("focus", this.open), this.reference.removeEventListener("mouseout", this.closeOnLeave), this.reference.removeEventListener("blur", this.closeOnLeave), this.$el.removeEventListener("mouseover", this.open), this.$el.removeEventListener("mouseout", this.closeOnLeave);
96
129
  },
97
130
  removeBodyEvents() {
98
- r(this.bodyTouchHandler);
131
+ i(this.bodyTouchHandler), document.removeEventListener("click", this.outsideHandler), document.removeEventListener("keyup", this.keyupHandler, !0);
99
132
  },
100
133
  setAttributes(e) {
101
134
  Object.keys(e).forEach((t) => {
@@ -1 +1 @@
1
- .tooltip-pane[data-v-d5f691f8],.tooltip-arrow[data-v-d5f691f8]{box-shadow:0 4px 12px #00000014}.tooltip-arrow[data-v-d5f691f8]{margin:.5rem;border-color:rgba(var(--bg-primary),var(--tw-bg-opacity, 1))}.tooltip-pane[x-placement^=top][data-v-d5f691f8]{margin-bottom:.5rem}.tooltip-pane[x-placement^=top] .tooltip-arrow[data-v-d5f691f8]{border-width:8px 8px 0 8px;border-left-color:transparent;border-right-color:transparent;border-bottom-color:transparent;left:calc(50% - 8px);bottom:-.5rem;margin-top:0;margin-bottom:0}.tooltip-pane[x-placement^=bottom][data-v-d5f691f8]{margin-top:.5rem}.tooltip-pane[x-placement^=bottom] .tooltip-arrow[data-v-d5f691f8]{border-width:0 8px 8px 8px;border-left-color:transparent;border-right-color:transparent;border-top-color:transparent;left:calc(50% - 8px);top:-.5rem;margin-bottom:0;margin-top:0}.tooltip-pane[x-placement^=right][data-v-d5f691f8]{margin-left:.5rem}.tooltip-pane[x-placement^=right] .tooltip-arrow[data-v-d5f691f8]{border-width:8px 8px 8px 0;border-left-color:transparent;border-top-color:transparent;border-bottom-color:transparent;top:calc(50% - 8px);left:-.5rem;margin-left:0;margin-right:0}.tooltip-pane[x-placement^=left][data-v-d5f691f8]{margin-right:.5rem}.tooltip-pane[x-placement^=left] .tooltip-arrow[data-v-d5f691f8]{border-width:8px 0 8px 8px;border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;top:calc(50% - 8px);right:-.5rem;margin-left:0;margin-right:0}
1
+ .tooltip-pane[data-v-eed4fc1b],.tooltip-arrow[data-v-eed4fc1b]{box-shadow:0 4px 12px #00000014}.tooltip-arrow[data-v-eed4fc1b]{margin:.5rem}.tooltip-pane--light .tooltip-arrow[data-v-eed4fc1b]{border-color:#fff}.tooltip-pane--dark .tooltip-arrow[data-v-eed4fc1b]{border-color:#212121}.tooltip-pane--dark[data-v-eed4fc1b] .tw-text-link{color:#78c79f}.tooltip-pane--dark[data-v-eed4fc1b] .tw-text-link:hover,.tooltip-pane--dark[data-v-eed4fc1b] .tw-text-link:focus{color:#fff}.tooltip-pane[x-placement^=top][data-v-eed4fc1b]{margin-bottom:.5rem}.tooltip-pane[x-placement^=top] .tooltip-arrow[data-v-eed4fc1b]{border-width:8px 8px 0 8px;border-left-color:transparent;border-right-color:transparent;border-bottom-color:transparent;left:calc(50% - 8px);bottom:-.5rem;margin-top:0;margin-bottom:0}.tooltip-pane[x-placement^=bottom][data-v-eed4fc1b]{margin-top:.5rem}.tooltip-pane[x-placement^=bottom] .tooltip-arrow[data-v-eed4fc1b]{border-width:0 8px 8px 8px;border-left-color:transparent;border-right-color:transparent;border-top-color:transparent;left:calc(50% - 8px);top:-.5rem;margin-bottom:0;margin-top:0}.tooltip-pane[x-placement^=right][data-v-eed4fc1b]{margin-left:.5rem}.tooltip-pane[x-placement^=right] .tooltip-arrow[data-v-eed4fc1b]{border-width:8px 8px 8px 0;border-left-color:transparent;border-top-color:transparent;border-bottom-color:transparent;top:calc(50% - 8px);left:-.5rem;margin-left:0;margin-right:0}.tooltip-pane[x-placement^=left][data-v-eed4fc1b]{margin-right:.5rem}.tooltip-pane[x-placement^=left] .tooltip-arrow[data-v-eed4fc1b]{border-width:8px 0 8px 8px;border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;top:calc(50% - 8px);right:-.5rem;margin-left:0;margin-right:0}