-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #599 from madeindjs/WF-47
feat(ui): introduce collapsible section + harmonize collapser - WF-47
- Loading branch information
Showing
7 changed files
with
169 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<template> | ||
<button | ||
role="button" | ||
class="BaseCollapseIcon" | ||
:class="{ 'BaseCollapseIcon--collapsed': isCollapsed }" | ||
@click="isCollapsed = !isCollapsed" | ||
> | ||
<i class="material-symbols-outlined">{{ icon }}</i> | ||
</button> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { computed, PropType } from "vue"; | ||
const props = defineProps({ | ||
direction: { | ||
type: String as PropType<"left-right" | "top-bottom">, | ||
required: true, | ||
}, | ||
}); | ||
const isCollapsed = defineModel({ type: Boolean, required: true }); | ||
const icon = computed(() => | ||
props.direction === "left-right" ? "chevron_left" : "keyboard_arrow_up", | ||
); | ||
</script> | ||
|
||
<style scoped> | ||
.BaseCollapseIcon { | ||
border: none; | ||
border-radius: 50%; | ||
padding: 4px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
background-color: transparent; | ||
height: 32px; | ||
width: 32px; | ||
cursor: pointer; | ||
transition: all 0.3s ease-in-out; | ||
transform: rotate(0deg); | ||
border: 1px solid var(--separatorColor); | ||
} | ||
.BaseCollapseIcon:hover { | ||
background: var(--separatorColor); | ||
} | ||
.BaseCollapseIcon--collapsed { | ||
transform: rotate(180deg); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.