-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #698 from danskernesdigitalebibliotek/develop
Release 2024.32.1
- Loading branch information
Showing
14 changed files
with
206 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { ComponentMeta, ComponentStory } from "@storybook/react"; | ||
import { withDesign } from "storybook-addon-designs"; | ||
import SimpleLink from "./SimpleLink"; | ||
|
||
export default { | ||
title: "Library / Simple Link", | ||
component: SimpleLink, | ||
decorators: [withDesign], | ||
argTypes: { | ||
linkText: { | ||
control: { | ||
type: "text", | ||
defaultValue: "Link text", | ||
}, | ||
}, | ||
href: { | ||
control: { | ||
type: "text", | ||
defaultValue: "https://www.google.com", | ||
}, | ||
}, | ||
target: { | ||
control: { | ||
type: "select", | ||
defaultValue: "_self", | ||
options: ["_blank", "_self"], | ||
}, | ||
}, | ||
args: { | ||
linkText: "Link text", | ||
href: "https://www.google.com", | ||
target: "_self", | ||
}, | ||
}, | ||
parameters: { | ||
design: { | ||
type: "figma", | ||
url: "https://www.figma.com/design/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?node-id=7741-58648&t=Facl3aeVt0fs5t5v-0", | ||
}, | ||
}, | ||
} as ComponentMeta<typeof SimpleLink>; | ||
|
||
const Template: ComponentStory<typeof SimpleLink> = (args) => ( | ||
<SimpleLink {...args} /> | ||
); | ||
|
||
export const OpensInSameWindow = Template.bind({}); | ||
OpensInSameWindow.args = { | ||
linkText: "Link that opens in same window", | ||
href: "https://www.google.com", | ||
target: "_self", | ||
}; | ||
|
||
export const ExternalLink = Template.bind({}); | ||
ExternalLink.args = { | ||
linkText: "Link that opens in new window", | ||
href: "https://www.google.com", | ||
target: "_blank", | ||
}; | ||
|
||
export const WithLongText = Template.bind({}); | ||
WithLongText.args = { | ||
linkText: | ||
"This is a very long link text that should wrap to the next line, demonstrating how lengthy text can be displayed within a link element to ensure proper wrapping and readability across different screen sizes and resolutions.", | ||
href: "https://www.google.com", | ||
target: "_self", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ReactComponent as ArrowSmallRight } from "../Arrows/icon-arrow-ui/icon-arrow-ui-small-right.svg"; | ||
|
||
export type SimpleLinkProps = { | ||
linkText: string; | ||
href: string; | ||
target: "_blank" | "_self"; | ||
}; | ||
|
||
const SimpleLink = ({ linkText, href, target = "_self" }: SimpleLinkProps) => { | ||
return ( | ||
<a | ||
href={href} | ||
target={target} | ||
className="simple-link arrow__hover--right-small" | ||
> | ||
{linkText} | ||
<ArrowSmallRight /> | ||
</a> | ||
); | ||
}; | ||
export default SimpleLink; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
$_simple_link_min_height: 80px; | ||
.simple-link { | ||
display: grid; | ||
align-items: center; | ||
grid-template-columns: 1fr min-content; | ||
gap: $s-xl; | ||
min-height: $_simple_link_min_height; | ||
border: 1px solid $color__global-tertiary-1; | ||
padding: $s-lg $s-xl; | ||
text-decoration: none; | ||
@include typography($typo__body-large); | ||
color: $color__global-grey; | ||
|
||
> svg { | ||
margin-right: 40px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.