mirror of
https://github.com/bitwarden/browser
synced 2026-02-22 04:14:04 +00:00
* WIP * add new link styles * update link stories * skip default screenshot as variations are covered in other stories * updated docs and story background * make default the default linkType value * remove references to primary link type in CL * use better bg colors in stories * remove duplicate linkType * update aria-disabled text to use new palette * add back primary link type to story * fix capitolization * add backticks to variant names in docs * remove important from link styles * fix generic selector to find correct button * fix capitolization * mark variants as deprecated in docs * fix link hover text colors
50 lines
1.6 KiB
Plaintext
50 lines
1.6 KiB
Plaintext
import { Meta, Story, Primary, Controls, Title, Description } from "@storybook/addon-docs/blocks";
|
|
|
|
import * as stories from "./link.stories";
|
|
|
|
<Meta of={stories} />
|
|
|
|
```ts
|
|
import { LinkModule } from "@bitwarden/components";
|
|
```
|
|
|
|
<Title>Link / Text button</Title>
|
|
<Description />
|
|
|
|
<Primary />
|
|
<Controls />
|
|
|
|
## Variants
|
|
|
|
You can use one of the following variants by providing it as the `linkType` input:
|
|
|
|
- @deprecated `primary` => use `default` instead
|
|
- @deprecated `secondary` => use `subtle` instead
|
|
- `default` - most common, uses brand color
|
|
- `subtle` - matches the main text color
|
|
- `contrast` - for high contrast against a dark background (or a light background in dark mode)
|
|
- `light` - always a light color, even in dark mode
|
|
- `warning` - used in association with warning callouts/banners
|
|
- `success` - used in association with success callouts/banners
|
|
- `danger` - used in association with danger callouts/banners
|
|
|
|
## Sizes
|
|
|
|
If you want to display a link with a smaller text size, apply the `tw-text-sm` class. This will
|
|
match the `body2` variant of the Typography directive.
|
|
|
|
## With icons
|
|
|
|
Text Links/buttons can have icons on left or the right.
|
|
|
|
To indicate a new or add action, the <i class="bwi bwi-plus-circle"></i> icon on is used on the
|
|
left.
|
|
|
|
An angle icon, <i class="bwi bwi-angle-right"></i>, is used on the left to indicate an expand to
|
|
show/hide additional content.
|
|
|
|
## Accessibility
|
|
|
|
- Make sure to only use the Link on backgrounds that maintain the WCAG color contrast ratios.
|
|
- Be sure to select the correct element type (anchor or button) for the intended action.
|