chore(web): unique ID generation (#9932)

* chore(web): automatically generate unique IDs

* fix: revert changes to Slider

* chore: add test for id store
This commit is contained in:
Ben 2024-06-01 22:58:35 +00:00 committed by GitHub
parent 4e16e2520d
commit 01f52c9021
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
52 changed files with 83 additions and 150 deletions

View file

@ -3,13 +3,9 @@
import { fade } from 'svelte/transition';
import FocusTrap from '$lib/components/shared-components/focus-trap.svelte';
import ModalHeader from '$lib/components/shared-components/modal-header.svelte';
import { uniqueIdStore } from '$lib/stores/unique-id.store';
export let onClose: () => void;
/**
* Unique identifier for the modal.
*/
export let id: string;
export let title: string;
/**
* If true, the logo will be displayed next to the modal title.
@ -28,6 +24,11 @@
*/
export let width: 'wide' | 'narrow' | 'auto' = 'narrow';
/**
* Unique identifier for the modal.
*/
let id: string = uniqueIdStore.generateId();
$: titleId = `${id}-title`;
$: isStickyBottom = !!$$slots['sticky-bottom'];