mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 10:51:06 +00:00
chore: lift components folder
This commit is contained in:
parent
76df51674d
commit
2200b29b92
301 changed files with 57 additions and 76 deletions
27
src/Tile/ClickableTile.svelte
Normal file
27
src/Tile/ClickableTile.svelte
Normal file
|
@ -0,0 +1,27 @@
|
|||
<script>
|
||||
export let clicked = false;
|
||||
export let light = false;
|
||||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y-missing-attribute -->
|
||||
<a
|
||||
class:bx--tile={true}
|
||||
class:bx--tile--clickable={true}
|
||||
class:bx--tile--is-clicked={clicked}
|
||||
class:bx--tile--light={light}
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:click={() => {
|
||||
clicked = !clicked;
|
||||
}}
|
||||
on:keydown
|
||||
on:keydown={({ key }) => {
|
||||
if (key === ' ' || key === 'Enter') {
|
||||
clicked = !clicked;
|
||||
}
|
||||
}}
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave>
|
||||
<slot />
|
||||
</a>
|
Loading…
Add table
Add a link
Reference in a new issue