@kiva/kv-components 3.48.1 → 3.48.2
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 +11 -0
- package/package.json +2 -2
- package/vue/KvLightbox.vue +7 -1
- package/vue/stories/KvLightbox.stories.js +49 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.2](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.48.1...@kiva/kv-components@3.48.2) (2023-12-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **KvLightbox:** allow focus on open alerts, clicks on browser extensions and outside lightbox ([969cf63](https://github.com/kiva/kv-ui-elements/commit/969cf638d27212052ade5e08e7de9786018bef9e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [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
18
|
|
|
8
19
|
**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.
|
|
3
|
+
"version": "3.48.2",
|
|
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": "
|
|
78
|
+
"gitHead": "992d943a0e3a39d8bb33162c1e059d295266c933"
|
|
79
79
|
}
|
package/vue/KvLightbox.vue
CHANGED
|
@@ -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(
|
|
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.' };
|