-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(xo-core): update
TabItem
and TabList
components to v2
- Loading branch information
Showing
16 changed files
with
187 additions
and
199 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
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
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
16 changes: 8 additions & 8 deletions
16
@xen-orchestra/lite/src/stories/web-core/tab/tab-list.story.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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
<template> | ||
<ComponentStory | ||
v-slot="{ properties }" | ||
:params="[prop('disabled').bool().widget(), slot().help('Contains <RouterTab> or <TabItem>')]" | ||
:params="[prop('disabled').bool().widget(), slot().help('Contains <RouterTab> or <VtsTabItem>')]" | ||
> | ||
<TabList v-bind="properties"> | ||
<TabItem>Foo</TabItem> | ||
<TabItem>Bar</TabItem> | ||
<TabItem>Baz</TabItem> | ||
</TabList> | ||
<VtsTabList v-bind="properties"> | ||
<VtsTabItem>Foo</VtsTabItem> | ||
<VtsTabItem>Bar</VtsTabItem> | ||
<VtsTabItem>Baz</VtsTabItem> | ||
</VtsTabList> | ||
</ComponentStory> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import ComponentStory from '@/components/component-story/ComponentStory.vue' | ||
import { prop, slot } from '@/libs/story/story-param' | ||
import TabItem from '@core/components/tab/TabItem.vue' | ||
import TabList from '@core/components/tab/TabList.vue' | ||
import VtsTabItem from '@core/components/tab/VtsTabItem.vue' | ||
import VtsTabList from '@core/components/tab/VtsTabList.vue' | ||
</script> |
This file was deleted.
Oops, something went wrong.
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,84 @@ | ||
<!-- v2 --> | ||
<template> | ||
<component :is="tag" :class="classNames" class="vts-tab-item"> | ||
<slot /> | ||
</component> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { useContext } from '@core/composables/context.composable' | ||
import { DisabledContext } from '@core/context' | ||
import { useUiStore } from '@core/stores/ui.store' | ||
import { storeToRefs } from 'pinia' | ||
import { computed } from 'vue' | ||
|
||
const props = withDefaults( | ||
defineProps<{ | ||
disabled?: boolean | ||
selected?: boolean | ||
tag?: string | ||
}>(), | ||
{ tag: 'span', disabled: undefined } | ||
) | ||
|
||
defineSlots<{ | ||
default(): any | ||
}>() | ||
|
||
const { isMobile } = storeToRefs(useUiStore()) | ||
|
||
const isDisabled = useContext(DisabledContext, () => props.disabled) | ||
|
||
const classNames = computed(() => { | ||
return [ | ||
isMobile.value ? 'typo c3-semi-bold' : 'typo c1-semi-bold', | ||
{ | ||
disabled: isDisabled.value, | ||
selected: props.selected, | ||
mobile: isMobile.value, | ||
}, | ||
] | ||
}) | ||
</script> | ||
|
||
<style lang="postcss" scoped> | ||
.vts-tab-item { | ||
display: flex; | ||
align-items: center; | ||
gap: 1.6rem; | ||
padding: 1.6rem; | ||
text-decoration: none; | ||
color: var(--color-neutral-txt-primary); | ||
border-bottom: 0.2rem solid transparent; | ||
cursor: pointer; | ||
|
||
&.mobile { | ||
gap: 0.8rem; | ||
padding: 0.8rem; | ||
} | ||
|
||
/* INTERACTION VARIANTS */ | ||
|
||
&:hover { | ||
border-color: var(--color-normal-item-hover); | ||
background-color: var(--color-normal-background-hover); | ||
} | ||
|
||
&:active { | ||
border-color: var(--color-normal-item-active); | ||
background-color: var(--color-normal-background-active); | ||
} | ||
|
||
&.selected { | ||
border-color: var(--color-normal-item-base); | ||
background-color: var(--color-normal-background-selected); | ||
} | ||
|
||
&.disabled { | ||
color: var(--color-neutral-txt-secondary); | ||
border-color: transparent; | ||
background-color: transparent; | ||
pointer-events: none; | ||
} | ||
} | ||
</style> |
Oops, something went wrong.