-
Notifications
You must be signed in to change notification settings - Fork 42
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] 📝 Oppdatert eksempler for Bleed og show/hide (#2385)
* 📝 Oppdatert eksempler for Bleed og show/hide * ♻️ Refactor wrapper rundt bleed-eksempler
- Loading branch information
Showing
11 changed files
with
239 additions
and
363 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
92 changes: 0 additions & 92 deletions
92
aksel.nav.no/website/pages/eksempler/primitive-bleed/breakpoints.tsx
This file was deleted.
Oops, something went wrong.
55 changes: 17 additions & 38 deletions
55
aksel.nav.no/website/pages/eksempler/primitive-bleed/default.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
60 changes: 60 additions & 0 deletions
60
aksel.nav.no/website/pages/eksempler/primitive-bleed/directions.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,60 @@ | ||
import { Bleed, Box, HStack, VStack } from "@navikt/ds-react"; | ||
import { withDsExample } from "components/website-modules/examples/withDsExample"; | ||
|
||
const Example = () => { | ||
return ( | ||
<VStack gap="4"> | ||
<DemoWrapper> | ||
<Bleed marginInline="10 0" asChild> | ||
<Box padding="3" className="p" background="surface-alt-3-subtle"> | ||
<HStack justify="center">marginInline start</HStack> | ||
</Box> | ||
</Bleed> | ||
</DemoWrapper> | ||
<DemoWrapper> | ||
<Bleed marginInline="0 10" asChild> | ||
<Box padding="3" className="p" background="surface-alt-3-subtle"> | ||
<HStack justify="center">marginInline end</HStack> | ||
</Box> | ||
</Bleed> | ||
</DemoWrapper> | ||
<DemoWrapper> | ||
<Bleed marginBlock="10 0" asChild> | ||
<Box padding="3" className="p" background="surface-alt-3-subtle"> | ||
<HStack justify="center">marginBlock start</HStack> | ||
</Box> | ||
</Bleed> | ||
</DemoWrapper> | ||
<DemoWrapper> | ||
<Bleed marginBlock="0 10" asChild> | ||
<Box padding="3" className="p" background="surface-alt-3-subtle"> | ||
<HStack justify="center">marginBlock end</HStack> | ||
</Box> | ||
</Bleed> | ||
</DemoWrapper> | ||
</VStack> | ||
); | ||
}; | ||
|
||
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> | ||
); | ||
} | ||
|
||
export default withDsExample(Example, { | ||
showBreakpoints: true, | ||
}); | ||
|
||
/* Storybook story */ | ||
export const Demo = { | ||
render: Example, | ||
}; | ||
|
||
export const args = { | ||
index: 1, | ||
}; |
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.