Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Tabs #225

Merged
merged 2 commits into from
Aug 22, 2023
Merged

Tabs #225

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/components/TabItem/RTabItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ export interface IProps {
* <TabItem block />
*/
block?: boolean;

/**
* Color of the tab item
* @type string
* @default ''
* @example
* <TabItem color="" />
*/
color?: string;
}
const props = withDefaults(defineProps<IProps>(), {
label: '',
Expand All @@ -94,6 +103,7 @@ const props = withDefaults(defineProps<IProps>(), {
modelValue: '',
tile: false,
block: false,
color: '',
});

const emit = defineEmits(['update:modelValue', 'click:icon']);
Expand All @@ -107,6 +117,12 @@ const classes = computed(() => {
};
});

const style = computed(() => {
return {
color: props.color,
};
});

/**
* @description Fires when the tab is clicked
* @param {id} id - The id of the tab
Expand All @@ -129,6 +145,7 @@ function handleIconClick(): void {
:aria-disabled="props.disabled"
:aria-selected="props.modelValue === props.id"
:class="classes"
:style="style"
:disabled="props.disabled"
@click.stop="handleTab(props.id)"
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/TabItem/tab-item.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import '../../index.css';

.tab-item {
@apply transition-all gap-2 min-w-fit py-3 px-6 bg-transparent flex justify-center items-center text-gray-500 text-sm font-medium cursor-pointer;
@apply transition-all gap-2 min-w-fit py-3 px-6 bg-transparent flex justify-center items-center text-[var(--neutral-500)] text-sm font-medium cursor-pointer;

&:disabled {
@apply cursor-not-allowed bg-inherit opacity-50;
Expand Down