mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
refactor(uishell): rename files
This commit is contained in:
parent
45509ae516
commit
e2375b2a12
12 changed files with 72 additions and 64 deletions
|
@ -1,50 +0,0 @@
|
|||
<script>
|
||||
export let type = undefined;
|
||||
export let icon = undefined;
|
||||
export let componentIsActive = undefined;
|
||||
|
||||
let elRigthPanel = undefined;
|
||||
|
||||
import { cx } from '../../../lib';
|
||||
import Icon from '../../Icon/Icon.svelte';
|
||||
import { slide } from 'svelte/transition';
|
||||
|
||||
function mouseUp({ target }) {
|
||||
if (target && elRigthPanel) {
|
||||
if (!elRigthPanel.contains(target)) {
|
||||
componentIsActive = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.component-form {
|
||||
margin: 1rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
<svelte:window on:mouseup={mouseUp} />
|
||||
|
||||
<div id="right-panel-action-component">
|
||||
<button
|
||||
aria-label={type}
|
||||
class={cx('--header__action', componentIsActive && '--header__action--active')}
|
||||
type="button"
|
||||
on:click={() => {
|
||||
componentIsActive = true;
|
||||
}}>
|
||||
<Icon {...icon} />
|
||||
</button>
|
||||
{#if componentIsActive}
|
||||
<div
|
||||
bind:this={elRigthPanel}
|
||||
id="right-panel-action-component-form"
|
||||
class={cx('--header-panel', '--header-panel--expanded')}
|
||||
transition:slide={{ duration: 200 }}>
|
||||
<div class="component-form">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue