-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[aksel.nav.no] Adjust exaples of Box and Bleed (#3321)
Co-authored-by: Ken <[email protected]>
- Loading branch information
1 parent
916b383
commit ef44f2a
Showing
18 changed files
with
79 additions
and
108 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
42 changes: 22 additions & 20 deletions
42
aksel.nav.no/website/pages/eksempler/primitive-bleed/full.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,39 +1,41 @@ | ||
import { Bleed, Box, HStack } from "@navikt/ds-react"; | ||
import { Bleed, BodyLong, Box, HStack, Page } from "@navikt/ds-react"; | ||
import { withDsExample } from "@/web/examples/withDsExample"; | ||
|
||
const Example = () => { | ||
return ( | ||
<DemoWrapper> | ||
<Page.Block width="text"> | ||
<BodyLong spacing> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque at | ||
maximus mauris. Sed nec fermentum orci, vel tempus tortor. Praesent | ||
lectus neque, hendrerit et sollicitudin quis, imperdiet vel est. | ||
</BodyLong> | ||
|
||
<Bleed marginInline="full" asChild> | ||
<Box padding="3" className="p" background="surface-alt-3-subtle"> | ||
<HStack justify="center">Full</HStack> | ||
<Box padding="3" marginBlock="0 7" background="surface-alt-3-subtle"> | ||
<HStack justify="center"> | ||
Bleed med marginInline="full" | ||
</HStack> | ||
</Box> | ||
</Bleed> | ||
</DemoWrapper> | ||
); | ||
}; | ||
|
||
function DemoWrapper({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<Box background="surface-alt-3" padding="5" borderRadius="large"> | ||
<Box background="surface-subtle" padding="5" borderRadius="medium"> | ||
{children} | ||
</Box> | ||
</Box> | ||
<BodyLong> | ||
Sed euismod mi nec purus euismod scelerisque. Nam tristique tincidunt | ||
nisi ultricies sollicitudin. Etiam maximus ex sit amet turpis vestibulum | ||
pharetra. | ||
</BodyLong> | ||
</Page.Block> | ||
); | ||
} | ||
}; | ||
|
||
// EXAMPLES DO NOT INCLUDE CONTENT BELOW THIS LINE | ||
export default withDsExample(Example, { | ||
showBreakpoints: true, | ||
}); | ||
export default withDsExample(Example); | ||
|
||
/* Storybook story */ | ||
export const Demo = { | ||
render: Example, | ||
}; | ||
|
||
export const args = { | ||
index: 3, | ||
desc: "I noen tilfeller må du også sette 'overflow-x: hidden;' på body for å unngå horisontal scrollbar. Full lar Bleed bryte ut av parent og dekke hele skjermbredden. Dette kan være nyttig for 'Heroes' eller lignende elementer som ønsker å bryte ut av parent-layout", | ||
index: 1, | ||
desc: "Med marginInline=full kan du få enkeltelementer til å dekke hele skjermbredden mens resten av innholdet følger bredden satt av parent-container som vanlig. OBS: Du må kanskje sette 'overflow-x: hidden' på body for å unngå horisontal scrollbar.", | ||
}; |
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
Oops, something went wrong.