mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 19:46:36 +00:00
fix(composed-modal): add aria-label prop, update header semantic tags
This commit is contained in:
parent
edc361d392
commit
baea933854
3 changed files with 16 additions and 6 deletions
|
@ -23,27 +23,29 @@
|
|||
import { getContext } from "svelte";
|
||||
import Close20 from "carbon-icons-svelte/lib/Close20/Close20.svelte";
|
||||
|
||||
const { closeModal } = getContext("ComposedModal");
|
||||
const { closeModal, updateLabel } = getContext("ComposedModal");
|
||||
|
||||
$: updateLabel(label);
|
||||
</script>
|
||||
|
||||
<div class:bx--modal-header="{true}" {...$$restProps}>
|
||||
{#if label}
|
||||
<p
|
||||
<h2
|
||||
class:bx--modal-header__label="{true}"
|
||||
class:bx--type-delta="{true}"
|
||||
class="{labelClass}"
|
||||
>
|
||||
{label}
|
||||
</p>
|
||||
</h2>
|
||||
{/if}
|
||||
{#if title}
|
||||
<p
|
||||
<h3
|
||||
class:bx--modal-header__heading="{true}"
|
||||
class:bx--type-beta="{true}"
|
||||
class="{titleClass}"
|
||||
>
|
||||
{title}
|
||||
</p>
|
||||
</h3>
|
||||
{/if}
|
||||
<slot />
|
||||
<button
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue