mirror of
https://github.com/snowball-tools/snowballtools-base.git
synced 2024-12-23 00:57:44 +00:00
[T-4862: feat] Link component (#88)
This commit is contained in:
parent
ea44efa0f2
commit
eb6a727425
@ -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: [],
|
||||
},
|
||||
},
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
));
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user