diff --git a/src/components/Tabs/Tabs.stories.mdx b/src/components/Tabs/Tabs.stories.mdx new file mode 100644 index 0000000..2db8d37 --- /dev/null +++ b/src/components/Tabs/Tabs.stories.mdx @@ -0,0 +1,215 @@ +import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs'; + +import Tabs from './Tabs.vue'; + +export const defaultArgs = { + tabs: { + control: { + type: 'object', + }, + defaultValue: [ + { label: 'Tab 1', icon: 'home', iconKind: 'filled', badge: '10' }, + { label: 'Tab 2', icon: 'add_circle', disabled: true }, + { label: 'Tab 3', icon: 'favorite' }, + { label: 'Tab 4', icon: 'face' }, + { label: 'Tab 5', icon: 'settings' }, + ], + }, + variant: { + control: { + type: 'select', + options: [ + 'default', + 'pill', + 'underline', + 'icon', + 'icon-pill', + 'icon-underline', + 'icon-only', + ], + }, + defaultValue: 'default', + }, + size: { + control: { + type: 'select', + options: ['small', 'medium', 'large'], + }, + defaultValue: 'medium', + }, + color: { + control: { + type: 'color', + }, + defaultValue: '', + }, + bgColor: { + control: { + type: 'color', + }, + defaultValue: '', + }, + activeColor: { + control: { + type: 'color', + }, + defaultValue: '', + }, + activeBgColor: { + control: { + type: 'color', + }, + defaultValue: '', + }, + align: { + control: { + type: 'select', + options: ['left', 'center', 'right'], + }, + defaultValue: 'center', + }, + scrollable: { + control: { + type: 'boolean', + }, + defaultValue: false, + }, + onClick: { + action: 'click', + }, +}; + + + +export const Default = (args) => ({ + components: { Tabs }, + setup() { + return { args }; + }, + template: ` + + + + `, +}); + +# Default + + + + {Default.bind({})} + + + +# Icon Only + + + + {Default.bind({})} + + + +# Pill + + + + {Default.bind({})} + + + +# Icon Pill + + + + {Default.bind({})} + + + +# Text Only + + + + {Default.bind({})} + + + + diff --git a/src/components/Tabs/Tabs.vue b/src/components/Tabs/Tabs.vue new file mode 100644 index 0000000..d82d69d --- /dev/null +++ b/src/components/Tabs/Tabs.vue @@ -0,0 +1,65 @@ + + diff --git a/src/components/Tabs/tabs.css b/src/components/Tabs/tabs.css new file mode 100644 index 0000000..c970b2d --- /dev/null +++ b/src/components/Tabs/tabs.css @@ -0,0 +1,25 @@ +@tailwind components; + +* { + @apply font-sans; +} + +.tabs-wrapper { + @apply w-full grid place-items-center; +} + +.tabs { + @apply flex w-full border-0 border-b border-gray-200 border-solid; +} + +.tab-wrapper { + @apply flex flex-col w-full; +} + +.tab { + @apply w-full p-2 bg-transparent border-none flex justify-center items-center text-gray-500 text-sm font-medium cursor-pointer disabled:cursor-not-allowed disabled:bg-inherit disabled:opacity-50; +} + +.tabs--scrollable { + @apply overflow-x-auto; +} diff --git a/src/components/Tabs/types.ts b/src/components/Tabs/types.ts new file mode 100644 index 0000000..beb1889 --- /dev/null +++ b/src/components/Tabs/types.ts @@ -0,0 +1,7 @@ +export type Tab = { + label?: string; + icon?: string; + disabled?: boolean; + iconKind?: string; + badge?: string; +};