-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cddc0ae
commit 4c0fb8e
Showing
80 changed files
with
3,308 additions
and
466 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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,68 @@ | ||
<script setup lang="ts"> | ||
import { PropType } from 'vue'; | ||
export interface IBreadcrumb { | ||
name: string; | ||
routeName?: string; | ||
} | ||
defineProps({ | ||
data: { | ||
type: Array as PropType<IBreadcrumb[]>, | ||
required: true, | ||
}, | ||
}); | ||
</script> | ||
|
||
<template> | ||
<section class="BaseBreadcrumbs base-breadcrumbs"> | ||
<div class="base-breadcrumbs__container"> | ||
<div | ||
v-for="item in data" | ||
:key="item.routeName" | ||
class="base-breadcrumbs__item-wrap" | ||
> | ||
<component | ||
:is="item.routeName ? 'router-link' : 'span'" | ||
:to="{ name: item.routeName }" | ||
class="base-breadcrumbs__item" | ||
> | ||
<span class="is--h6__title"> | ||
{{ item.name }} | ||
</span> | ||
</component> | ||
<span class="base-breadcrumbs__divider"> | ||
/ | ||
</span> | ||
</div> | ||
</div> | ||
</section> | ||
</template> | ||
|
||
<style lang="sass" scoped> | ||
@import 'index.sass' | ||
.base-breadcrumbs | ||
$root: & | ||
&__container | ||
gap: 8px | ||
display: flex | ||
flex-wrap: wrap | ||
&__item | ||
color: $black | ||
&__divider | ||
color: $gray-50 | ||
&__item-wrap | ||
gap: 8px | ||
display: flex | ||
&:last-of-type | ||
#{$root}__item | ||
color: $gray-50 | ||
#{$root}__divider | ||
display: none | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@import 'UiKit/styles/_colors.sass' | ||
@import 'UiKit/styles/_global.sass' |
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
83 changes: 83 additions & 0 deletions
83
src/components/BaseContentSwitcher/BaseContentSwitcher.vue
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,83 @@ | ||
<script lang="ts" setup> | ||
import { withDefaults } from 'vue'; | ||
import { Tab } from './types'; | ||
const props = withDefaults(defineProps<{ | ||
tabs: Tab[]; | ||
modelValue?: string | number; | ||
fullWidth?: boolean, | ||
}>(), { | ||
}); | ||
const emit = defineEmits<{ | ||
(e: 'update:modelValue', value: Tab['value']): void; | ||
(e: 'itemClick', value: Tab): void; | ||
}>(); | ||
function onItemClick(tab: Tab) { | ||
emit('update:modelValue', tab.value); | ||
emit('itemClick', tab); | ||
} | ||
</script> | ||
|
||
<template> | ||
<div | ||
class="BaseContentSwitcher base-content-switcher" | ||
> | ||
<div | ||
v-for="tab in props.tabs" | ||
:key="tab.value" | ||
class="base-content-switcher__item" | ||
:class="[{ 'is--active': modelValue === tab.value, 'is--full-width': fullWidth }]" | ||
:style="{width: fullWidth ? `${100/(props.tabs.length)}%` : 'auto'}" | ||
@click="onItemClick(tab)" | ||
> | ||
<slot | ||
name="tab" | ||
:tab="tab" | ||
> | ||
<span | ||
class="base-content-switcher__item-label is--small-2" | ||
:title="tab.label" | ||
> | ||
{{ tab.label }} | ||
</span> | ||
</slot> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style lang="sass" scoped> | ||
@import 'index.sass' | ||
.base-content-switcher | ||
height: 32px | ||
display: flex | ||
flex-direction: row | ||
align-items: center | ||
gap: 4px | ||
border-radius: 2px | ||
background: $gray-20 | ||
padding: 4px | ||
&.is--full-width | ||
width: 100% | ||
&__item | ||
cursor: pointer | ||
display: flex | ||
padding: 3px 12px | ||
align-items: center | ||
gap: 4px | ||
align-self: stretch | ||
border-radius: 2px | ||
color: $gray-60 | ||
+mt(.2s) | ||
&.is--active | ||
+mt(.2s) | ||
background-color: $white | ||
color: $black | ||
&:hover | ||
color: $black | ||
&__item-label | ||
flex-shrink: 0 | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@import 'UiKit/styles/_colors.sass' | ||
@import 'UiKit/styles/_mixins.sass' |
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,4 @@ | ||
import BaseContentSwitcher from './BaseContentSwitcher.vue'; | ||
|
||
export { BaseContentSwitcher }; | ||
export * from './types'; |
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,4 @@ | ||
export type Tab = object & { | ||
value: string | number; | ||
label?: string; | ||
}; |
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,85 @@ | ||
<script setup lang="ts"> | ||
import { ref } from 'vue'; | ||
import { onClickOutside } from '@vueuse/core'; | ||
import ArrowDown from './assets/chevron-down.svg'; | ||
const isActive = ref(false); | ||
const target = ref(null); | ||
onClickOutside(target, () => { | ||
isActive.value = false; | ||
}) | ||
</script> | ||
|
||
|
||
<template> | ||
<div | ||
ref="target" | ||
class="BaseDropdown base-dropdown" | ||
> | ||
<div | ||
class="base-dropdown__selected" | ||
:class="{ 'is-active': isActive }" | ||
@click="isActive = !isActive" | ||
> | ||
<slot /> | ||
|
||
<img | ||
v-svg-inline | ||
:src="ArrowDown" | ||
class="base-dropdown__selected-arrow" | ||
alt="dropdown selected arrow" | ||
> | ||
</div> | ||
<Transition name="fade" mode="out-in"> | ||
<div | ||
v-show="isActive" | ||
class="base-dropdown__items" | ||
> | ||
<slot name="listItem" /> | ||
</div> | ||
</Transition> | ||
</div> | ||
</template> | ||
|
||
|
||
<style lang="sass" scoped> | ||
@import 'index.sass' | ||
.base-dropdown | ||
$root: & | ||
position: relative | ||
width: fit-content | ||
&__selected | ||
position: relative | ||
display: flex | ||
align-items: center | ||
cursor: pointer | ||
width: fit-content | ||
&.is-active | ||
.base-dropdown | ||
&__selected-arrow | ||
transform: rotate(180deg) | ||
&__selected-arrow | ||
width: 14px | ||
color: $gray-70 | ||
transition: all 0.3s | ||
transform-origin: center | ||
&__items | ||
position: absolute | ||
right: 0 | ||
top: calc(100% + 13px) | ||
z-index: 1 | ||
display: flex | ||
width: 100% | ||
padding: 8px 0px | ||
flex-direction: column | ||
align-items: flex-start | ||
border-radius: 2px | ||
background: $white | ||
box-shadow: $box-shadow-small | ||
</style> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,3 @@ | ||
@import 'UiKit/styles/_colors.sass' | ||
@import 'UiKit/styles/_mixins.sass' | ||
@import 'UiKit/styles/_global.sass' |
Oops, something went wrong.