-
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 #365 from danskernesdigitalebibliotek/DDFFORM-17-b…
…eskrivelse Add `EventDescription` component + Refactor `ListDescription` component
- Loading branch information
Showing
10 changed files
with
248 additions
and
44 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
18 changes: 9 additions & 9 deletions
18
src/stories/Library/Lists/list-description/ListDescriptionFakeData.tsx
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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { ListData } from "./ListDescription"; | ||
|
||
const fakeData: ListData = { | ||
Type: { value: "Bog", type: "standard" }, | ||
Sprog: { value: "Dansk", type: "standard" }, | ||
Bidragsydere: { value: "Karsten Sand Iversen", type: "link" }, | ||
Originaltitel: { value: "Ulysses (1922)", type: "standard" }, | ||
ISBN: { value: "9788763814584", type: "standard" }, | ||
Udgave: { value: "Udgave, 2. oplag (2015)", type: "standard" }, | ||
Omfang: { value: "795 sider", type: "standard" }, | ||
Forlag: { value: "Rosinante", type: "standard" }, | ||
Målgruppe: { value: "Voksenmateriale", type: "standard" }, | ||
Type: { value: ["Bog"], type: "standard" }, | ||
Sprog: { value: ["Dansk"], type: "standard" }, | ||
Bidragsydere: { value: ["Karsten Sand Iversen"], type: "link" }, | ||
Originaltitel: { value: ["Ulysses (1922)"], type: "standard" }, | ||
ISBN: { value: ["9788763814584"], type: "standard" }, | ||
Udgave: { value: ["Udgave, 2. oplag (2015)"], type: "standard" }, | ||
Omfang: { value: ["795 sider"], type: "standard" }, | ||
Forlag: { value: ["Rosinante"], type: "standard" }, | ||
Målgruppe: { value: ["Voksenmateriale"], type: "standard" }, | ||
}; | ||
|
||
export default fakeData; |
55 changes: 39 additions & 16 deletions
55
src/stories/Library/Lists/list-description/list-description.scss
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 |
---|---|---|
@@ -1,30 +1,53 @@ | ||
dl.list-description { | ||
@extend %text-small-caption; | ||
|
||
max-width: 420px; | ||
color: $c-text-secondary-gray; | ||
display: flex; | ||
flex-flow: column; | ||
|
||
& > div { | ||
display: flex; | ||
flex-flow: row wrap; | ||
.list-description__item { | ||
display: grid; | ||
grid-template-columns: 1fr 2fr; | ||
} | ||
|
||
dt { | ||
flex-basis: 18%; | ||
.list-description__key, | ||
.list-description__value { | ||
padding: 2px 4px; | ||
} | ||
|
||
dd { | ||
flex-basis: 72%; | ||
flex-grow: 1; | ||
margin: 0; | ||
padding: 2px 4px; | ||
.list-description__value { | ||
display: grid; | ||
@include breakpoint-s { | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: $s-sm; | ||
} | ||
} | ||
.link-tag { | ||
@extend %text-small-caption; | ||
color: $c-text-primary-black; | ||
} | ||
} | ||
|
||
dl.list-description.list-description--event { | ||
height: max-content; | ||
display: grid; | ||
grid-template-columns: repeat(2, 1fr); | ||
gap: $s-md; | ||
align-items: start; | ||
|
||
.list-description__item { | ||
grid-template-columns: 1fr; | ||
} | ||
|
||
.list-description__value { | ||
font-weight: bold; | ||
} | ||
|
||
.link-tag { | ||
@extend %text-small-caption; | ||
@include breakpoint-s { | ||
grid-template-columns: 1fr; | ||
gap: $s-xs; | ||
|
||
color: $c-text-primary-black; | ||
.list-description__item { | ||
grid-template-columns: 1fr 2fr; | ||
} | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
src/stories/Library/event-description/EventDescription.tsx
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,44 @@ | ||
import { FC } from "react"; | ||
import HorizontalTermLine, { | ||
HorizontalTermLineProps, | ||
generateId, | ||
} from "../horizontal-term-line/HorizontalTermLine"; | ||
import ListDescription, { | ||
ListData, | ||
} from "../Lists/list-description/ListDescription"; | ||
|
||
export type EventDescriptionProps = { | ||
descriptionTitle: string; | ||
listDescriptionData: ListData; | ||
horizontalTermLineData: HorizontalTermLineProps[]; | ||
descriptionDescription: string; | ||
}; | ||
|
||
const EventDescription: FC<EventDescriptionProps> = ({ | ||
descriptionTitle, | ||
descriptionDescription, | ||
horizontalTermLineData, | ||
listDescriptionData, | ||
}) => { | ||
return ( | ||
<section className="event-description"> | ||
<h2 className="event-description__title">{descriptionTitle}</h2> | ||
<div className="event-description__content"> | ||
<p className="event-description__description"> | ||
{descriptionDescription} | ||
</p> | ||
<div className="event-description__links"> | ||
{horizontalTermLineData.map((item, index) => ( | ||
<HorizontalTermLine {...item} key={generateId(index)} /> | ||
))} | ||
</div> | ||
</div> | ||
<ListDescription | ||
className="event-description__info list-description--event" | ||
data={listDescriptionData} | ||
/> | ||
</section> | ||
); | ||
}; | ||
|
||
export default EventDescription; |
38 changes: 38 additions & 0 deletions
38
src/stories/Library/event-description/event-description.scss
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,38 @@ | ||
.event-description { | ||
@include container(medium); | ||
padding: $s-md; | ||
@include breakpoint-s { | ||
padding: $s-xl $s-4xl; | ||
display: grid; | ||
column-gap: $s-xl; | ||
grid-template-columns: 2fr 1fr; | ||
} | ||
} | ||
|
||
.event-description__title { | ||
@extend %text-header-h4; | ||
margin-bottom: $s-md; | ||
|
||
@include breakpoint-s { | ||
grid-column: 1 / -1; | ||
margin-bottom: $s-lg; | ||
} | ||
} | ||
|
||
.event-description__description { | ||
@extend %text-body-large; | ||
line-height: 24px; | ||
margin-bottom: $s-md; | ||
|
||
@include breakpoint-s { | ||
line-height: 32px; | ||
} | ||
} | ||
|
||
.event-description__links { | ||
margin-bottom: $s-2xl; | ||
|
||
@include breakpoint-s { | ||
margin-bottom: 0; | ||
} | ||
} |
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