Compare commits

...

2 Commits

Author SHA1 Message Date
Wahyu Kurniawan
ee1854f56b
📝 docs: add button link component to the example page 2024-02-21 17:12:32 +07:00
Wahyu Kurniawan
d385e5e7c5
️ feat: add new variants link and link-empashized on the button component 2024-02-21 17:12:02 +07:00
3 changed files with 54 additions and 1 deletions

View File

@ -118,6 +118,29 @@ export const buttonTheme = tv(
'disabled:border-transparent',
'disabled:shadow-none',
],
link: [
'p-0',
'gap-1.5',
'text-elements-link',
'rounded',
'focus-ring',
'hover:underline',
'hover:text-elements-link-hovered',
'disabled:text-controls-disabled',
'disabled:hover:no-underline',
],
'link-emphasized': [
'p-0',
'gap-1.5',
'text-elements-high-em',
'rounded',
'underline',
'focus-ring',
'hover:text-elements-link-hovered',
'disabled:text-controls-disabled',
'disabled:hover:no-underline',
'dark:text-elements-on-high-contrast',
],
unstyled: [],
},
},

View File

@ -7,7 +7,11 @@ import {
} from './renders/checkbox';
import { avatars, avatarsFallback } from './renders/avatar';
import { renderBadges } from './renders/badge';
import { renderButtonIcons, renderButtons } from './renders/button';
import {
renderButtonIcons,
renderButtons,
renderLinks,
} from './renders/button';
import {
renderTabWithBadges,
renderTabs,
@ -112,6 +116,16 @@ const Page = () => {
<h1 className="text-2xl font-bold">Vertical Tabs</h1>
{renderVerticalTabs()}
</div>
<div className="w-full h border border-gray-200 px-20 my-10" />
{/* Link */}
<div className="flex flex-col gap-10 items-center justify-between">
<h1 className="text-2xl font-bold">Link</h1>
<div className="flex gap-4 items-center justify-center">
{renderLinks()}
</div>
</div>
</div>
</div>
</div>

View File

@ -47,3 +47,19 @@ export const renderButtonIcons = () => {
</div>
));
};
export const renderLinks = () => {
return ['link', 'link-emphasized', 'disabled'].map((variant) => (
<Button
variant={
variant !== 'disabled' ? (variant as ButtonTheme['variant']) : 'link'
}
key={variant}
leftIcon={<PlusIcon />}
rightIcon={<PlusIcon />}
disabled={variant === 'disabled'}
>
Link
</Button>
));
};