generated from nl-design-system/example
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes #477 --------- Co-authored-by: Ruben Smit <[email protected]> Co-authored-by: Mees <[email protected]> Co-authored-by: Sjimmie <[email protected]>
- Loading branch information
1 parent
448b86a
commit 70381ba
Showing
5 changed files
with
75 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Image as UtrechtImage } from '@utrecht/component-library-react/dist/css-module'; | ||
import { ForwardedRef, forwardRef, ImgHTMLAttributes } from 'react'; | ||
|
||
export const Image = forwardRef( | ||
({ className, ...restProps }: ImgHTMLAttributes<HTMLImageElement>, ref: ForwardedRef<HTMLImageElement>) => ( | ||
<UtrechtImage {...restProps} ref={ref} photo className={className} /> | ||
), | ||
); | ||
|
||
Image.displayName = 'Image'; |
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,3 @@ | ||
<!-- @license CC0-1.0 --> | ||
|
||
# Rijkshuisstijl Community image component |
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,61 @@ | ||
import { Image } from '@rijkshuisstijl-community/components-react'; | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import readme from './image.md?raw'; | ||
|
||
const meta = { | ||
title: 'Rijkshuisstijl/Image', | ||
id: 'rijkshuisstijl-image', | ||
component: Image, | ||
argTypes: { | ||
src: { | ||
description: 'Image source', | ||
control: { type: 'text' }, | ||
table: { | ||
category: 'Property', | ||
}, | ||
}, | ||
alt: { | ||
description: 'Image alt text', | ||
control: { type: 'text' }, | ||
table: { | ||
category: 'Property', | ||
}, | ||
}, | ||
width: { | ||
description: 'Image width', | ||
control: { type: 'number' }, | ||
table: { | ||
category: 'Property', | ||
}, | ||
}, | ||
height: { | ||
description: 'Image height', | ||
control: { type: 'number' }, | ||
table: { | ||
category: 'Property', | ||
}, | ||
}, | ||
}, | ||
tags: ['autodocs'], | ||
parameters: { | ||
docs: { | ||
description: { | ||
component: readme, | ||
}, | ||
}, | ||
}, | ||
} as Meta<typeof Image>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
alt: 'Multicolored tulip field', | ||
height: 763, | ||
width: 640, | ||
src: './placeholder.jpg', | ||
}, | ||
name: 'Image', | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.