Skip to content

Commit

Permalink
LG-2963, LG-3170: LiveExample links (#2066)
Browse files Browse the repository at this point in the history
* add links to story file

* changeset

* valid href

* override link component hover styles
  • Loading branch information
spark33 authored Nov 7, 2023
1 parent fa13595 commit 4ae82db
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changeset/three-wasps-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@leafygreen-ui/callout': patch
'@leafygreen-ui/banner': patch
---

Added links to LiveExample to demonstrate link styles
15 changes: 12 additions & 3 deletions packages/banner/src/Banner.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
storybookExcludedControlParams,
StoryMetaType,
} from '@leafygreen-ui/lib';
import { Link } from '@leafygreen-ui/typography';

import Banner, { BannerProps, Variant } from '.';

Expand All @@ -35,12 +36,21 @@ const meta: StoryMetaType<typeof Banner> = {
},
},
args: {
children:
'To avoid disrupting majority writes, new members are now added to replica sets as priority=0, votes=0 until they reach secondary state, after which Cloud Manager automatically updates the configuration to match the priority and votes value specified in the deployment.',
children: (
<>
To avoid disrupting majority writes, new members are now added to
replica sets as priority=0, votes=0 until they reach secondary state,
after which Cloud Manager automatically updates the configuration to
match the priority and votes value specified in the deployment. &nbsp;
<a href="https://mongodb.com">Anchor tag</a>&nbsp;
<Link>Link Component</Link>
</>
),
darkMode: false,
dismissible: false,
},
argTypes: {
children: storybookArgTypes.children,
darkMode: storybookArgTypes.darkMode,
dismissible: {
control: 'boolean',
Expand All @@ -50,7 +60,6 @@ const meta: StoryMetaType<typeof Banner> = {
control: { type: 'select' },
defaultValue: Variant.Info,
},
children: storybookArgTypes.children,
glyph: {
options: [undefined, ...Object.keys(glyphs)],
control: { type: 'select' },
Expand Down
3 changes: 1 addition & 2 deletions packages/callout/src/Callout.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { Link } from '@leafygreen-ui/typography';

import Callout, { CalloutProps, Variant } from '.';

const loremIpsum = `Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy children ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.`;
const loremWithLinks = (
<div>
<Link href="./">Link component</Link> is simply dummy text of the printing
Expand Down Expand Up @@ -51,7 +50,7 @@ export default meta;

export const LiveExample: StoryFn<CalloutProps> = args => <Callout {...args} />;
LiveExample.args = {
children: loremIpsum,
children: loremWithLinks,
};
LiveExample.parameters = {
chromatic: {
Expand Down
4 changes: 4 additions & 0 deletions packages/callout/src/Callout/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ export const contentStyles = css`
&:focus,
&:focus-visible {
outline: none;
// duplicate these styles to override text-decoration: none in Link component
text-decoration: underline;
text-underline-offset: 3px;
text-decoration-thickness: 2px;
span {
&::after {
display: none;
Expand Down

0 comments on commit 4ae82db

Please sign in to comment.