-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ktreelist): reskin component [KHCP-9008] (#2064)
* chore(sandbox): setup component sandbox [KHCP-9008] * fix(ktreelist): update props and selectors [KHCP-9008] * feat(ktreelist): reskin component [KHCP-9008] * fix(ktreelist): minor fix [KHCP-9008] * docs(tree-list): update component docs [KHCP-9008] * fix(ktreelist): address PR feedback [KHCP-9008] * fix(ktreelist): misc fixes [KHCP-9008] * fix(ktreelist): minor fixes [KHCP-9008] * fix(ktreelist): focus visible state [KHCP-9008] * docs(tree-list): minor fix [KHCP-9008] * docs(tree-list): misc fixes [KHCP-9008]
- Loading branch information
Showing
10 changed files
with
530 additions
and
485 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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,141 @@ | ||
<template> | ||
<SandboxLayout | ||
:links="inject('app-links', [])" | ||
title="KTreeList" | ||
> | ||
<div class="ktreelist-sandbox"> | ||
<SandboxSectionComponent> | ||
<KExternalLink href="https://www.figma.com/file/Yze0SWXl5nKjR0rFdilljK/Components?type=design&node-id=2020%3A12779&mode=dev&t=sqzAn4PCrvEoYpdz-1"> | ||
Figma | ||
</KExternalLink> | ||
</SandboxSectionComponent> | ||
|
||
<!-- Props --> | ||
<SandboxTitleComponent | ||
is-subtitle | ||
title="Props" | ||
/> | ||
<SandboxSectionComponent title="item"> | ||
<KTreeList :items="items1" /> | ||
</SandboxSectionComponent> | ||
<SandboxSectionComponent title="disableDrag"> | ||
<KTreeList | ||
disable-drag | ||
:items="items2" | ||
/> | ||
</SandboxSectionComponent> | ||
<SandboxSectionComponent title="maxDepth"> | ||
<KTreeList | ||
:items="items3" | ||
:max-depth="4" | ||
/> | ||
</SandboxSectionComponent> | ||
<SandboxSectionComponent title="width"> | ||
<KTreeList | ||
:items="items4" | ||
width="300" | ||
/> | ||
</SandboxSectionComponent> | ||
<SandboxSectionComponent title="hideIcons"> | ||
<KTreeList | ||
hide-icons | ||
:items="items5" | ||
/> | ||
</SandboxSectionComponent> | ||
|
||
<!-- Slots --> | ||
<SandboxTitleComponent | ||
is-subtitle | ||
title="Slots" | ||
/> | ||
<SandboxSectionComponent title="item-icon"> | ||
<KTreeList :items="items6"> | ||
<template #item-icon="{ item }"> | ||
<InboxIcon | ||
v-if="item.id.includes('folder')" | ||
:color="item.selected ? KUI_COLOR_TEXT_DECORATIVE_PURPLE : KUI_COLOR_TEXT_DECORATIVE_PURPLE_STRONG" | ||
/> | ||
</template> | ||
</KTreeList> | ||
</SandboxSectionComponent> | ||
<SandboxSectionComponent title="item-label"> | ||
<KTreeList :items="items7"> | ||
<template #item-label="{ item }"> | ||
<span v-if="item.id.includes('folder')"> | ||
<strong>{{ item.name }}</strong> | ||
</span> | ||
<span v-else> | ||
{{ item.name }} | ||
</span> | ||
</template> | ||
</KTreeList> | ||
</SandboxSectionComponent> | ||
</div> | ||
</SandboxLayout> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { inject, ref } from 'vue' | ||
import SandboxTitleComponent from '../components/SandboxTitleComponent.vue' | ||
import SandboxSectionComponent from '../components/SandboxSectionComponent.vue' | ||
import type { TreeListItem } from '@/types' | ||
import { InboxIcon } from '@kong/icons' | ||
import { KUI_COLOR_TEXT_DECORATIVE_PURPLE, KUI_COLOR_TEXT_DECORATIVE_PURPLE_STRONG } from '@kong/design-tokens' | ||
const defaultItems = [ | ||
{ | ||
name: 'Components', | ||
id: 'components-folder', | ||
children: [ | ||
{ | ||
name: 'ProfileCard.vue', | ||
id: 'profile-card', | ||
}, | ||
], | ||
}, | ||
{ | ||
name: 'Pages', | ||
id: 'pages-folder', | ||
children: [ | ||
{ | ||
name: 'Home.vue', | ||
id: 'home', | ||
}, | ||
{ | ||
name: 'User', | ||
id: 'user-folder', | ||
children: [ | ||
{ | ||
name: 'UserList.vue', | ||
id: 'user-list', | ||
}, | ||
{ | ||
name: 'UserDetail.vue', | ||
id: 'user-detail', | ||
}, | ||
{ | ||
name: 'Settings', | ||
id: 'settings-folder', | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
name: 'Types', | ||
id: 'types-folder', | ||
children: [{ | ||
name: 'user.d.ts', | ||
id: 'user-types', | ||
}], | ||
}, | ||
] | ||
const items1 = ref<TreeListItem[]>(JSON.parse(JSON.stringify(defaultItems))) | ||
const items2 = ref<TreeListItem[]>(JSON.parse(JSON.stringify(defaultItems))) | ||
const items3 = ref<TreeListItem[]>(JSON.parse(JSON.stringify(defaultItems))) | ||
const items4 = ref<TreeListItem[]>(JSON.parse(JSON.stringify(defaultItems))) | ||
const items5 = ref<TreeListItem[]>(JSON.parse(JSON.stringify(defaultItems))) | ||
const items6 = ref<TreeListItem[]>(JSON.parse(JSON.stringify(defaultItems))) | ||
const items7 = ref<TreeListItem[]>(JSON.parse(JSON.stringify(defaultItems))) | ||
</script> |
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
Oops, something went wrong.