@kiva/kv-components 3.48.1 → 3.48.3

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/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.48.3](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.48.2...@kiva/kv-components@3.48.3) (2023-12-08)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * p4 tag on loan card ([8513e93](https://github.com/kiva/kv-ui-elements/commit/8513e93addcb68f9f6f17f4eb52ee4d33f6af481))
12
+
13
+
14
+
15
+
16
+
17
+ ## [3.48.2](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.48.1...@kiva/kv-components@3.48.2) (2023-12-06)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **KvLightbox:** allow focus on open alerts, clicks on browser extensions and outside lightbox ([969cf63](https://github.com/kiva/kv-ui-elements/commit/969cf638d27212052ade5e08e7de9786018bef9e))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [3.48.1](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.48.0...@kiva/kv-components@3.48.1) (2023-11-29)
7
29
 
8
30
  **Note:** Version bump only for package @kiva/kv-components
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "3.48.1",
3
+ "version": "3.48.3",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -75,5 +75,5 @@
75
75
  "optional": true
76
76
  }
77
77
  },
78
- "gitHead": "2c7054617fe956199335addc794ce7ac78003dab"
78
+ "gitHead": "c2f834e03d69c4df0edfa0abbd9cefc5d193ea48"
79
79
  }
package/utils/loanCard.js CHANGED
@@ -83,8 +83,8 @@ export function loanCardComputedProperties(props) {
83
83
  // Tag as first option for LSE loans
84
84
  if (isLseLoan && tags.length) {
85
85
  const position = Math.floor(Math.random() * tags.length);
86
- const atag = tags[position];
87
- callouts.push(atag);
86
+ const p1Tag = tags[position];
87
+ callouts.push(p1Tag);
88
88
  }
89
89
 
90
90
  if (!categoryPageName.value) {
@@ -116,9 +116,9 @@ export function loanCardComputedProperties(props) {
116
116
  // P4 Tag
117
117
  if (!!tags.length && callouts.length < 2) {
118
118
  const position = Math.floor(Math.random() * tags.length);
119
- const atag = tags[position];
120
- if (!callouts.filter((c) => c.toUpperCase() === tag.toUpperCase()).length) {
121
- callouts.push(atag);
119
+ const p4Tag = tags[position];
120
+ if (!callouts.filter((c) => c.toUpperCase() === p4Tag.toUpperCase()).length) {
121
+ callouts.push(p4Tag);
122
122
  }
123
123
  }
124
124
 
@@ -218,10 +218,16 @@ export default {
218
218
  const kvLightboxBody = ref(null);
219
219
  const controlsRef = ref(null);
220
220
 
221
+ const trapElements = computed(() => [
222
+ kvLightbox.value, // This lightbox
223
+ '[role="alert"]', // Any open toasts/alerts on the page
224
+ ]);
221
225
  const {
222
226
  activate: activateFocusTrap,
223
227
  deactivate: deactivateFocusTrap,
224
- } = useFocusTrap(kvLightbox);
228
+ } = useFocusTrap(trapElements, {
229
+ allowOutsideClick: true, // allow clicking outside the lightbox to close it
230
+ });
225
231
 
226
232
  let makePageInertCallback = null;
227
233
  let onKeyUp = null;
@@ -2,6 +2,7 @@ import { mdiLightningBolt } from '@mdi/js';
2
2
  import KvLightbox from '../KvLightbox.vue';
3
3
  import KvMaterialIcon from '../KvMaterialIcon.vue';
4
4
  import KvButton from '../KvButton.vue';
5
+ import KvToast from '../KvToast.vue';
5
6
 
6
7
  export default {
7
8
  title: 'KvLightbox',
@@ -253,3 +254,51 @@ export const Informational = InformationalTemplate.bind({});
253
254
  Informational.args = {
254
255
  title: 'Lightbox Title',
255
256
  };
257
+
258
+ const ToastInLightboxTemplate = (args, {
259
+ argTypes,
260
+ }) => ({
261
+ props: Object.keys(argTypes),
262
+ components: {
263
+ KvToast,
264
+ KvButton,
265
+ KvLightbox,
266
+ },
267
+ template: `
268
+ <div>
269
+ <kv-button @click="isLightboxVisible = true;">Show lightbox</kv-button>
270
+
271
+ <kv-lightbox
272
+ :visible="isLightboxVisible"
273
+ title="Toast in Lightbox"
274
+ @lightbox-closed="isLightboxVisible = false"
275
+ >
276
+ <p>Click the button below to show a toast.</p>
277
+ <template #controls>
278
+ <kv-button @click="showToast(message, type, persist)">Show Toast</kv-button>
279
+ </template>
280
+ </kv-lightbox>
281
+
282
+ <!-- div below is a kludge for storybook docs -->
283
+ <div class="tw-fixed tw-z-toast tw-inset-0 tw-pointer-events-none">
284
+ <div class="tw-fixed tw-left-0 tw-right-0 tw-top-2 tw-pointer-events-auto">
285
+ <kv-toast ref="toastRef" @close="onClose" />
286
+ </div>
287
+ </div>
288
+ </div>
289
+ `,
290
+ data() {
291
+ return {
292
+ isLightboxVisible: false,
293
+ };
294
+ },
295
+ methods: {
296
+ showToast(messageInput, type, persistInput) {
297
+ this.$refs.toastRef.show(messageInput, type, persistInput);
298
+ },
299
+ onClose() {
300
+ },
301
+ },
302
+ });
303
+ export const toastInLightbox = ToastInLightboxTemplate.bind({});
304
+ toastInLightbox.args = { type: 'confirmation', message: 'This is a toast in a lightbox.' };