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.
- Loading branch information
Showing
123 changed files
with
1,880 additions
and
488 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,13 +22,19 @@ | |
"./packages/*", | ||
"./proprietary/*" | ||
], | ||
"dependencies": { | ||
"@storybook/test-runner": "0.21.0", | ||
"http-server": "14.1.1", | ||
"rimraf": "6.0.1" | ||
}, | ||
"devDependencies": { | ||
"@lerna-lite/cli": "3.10.1", | ||
"@lerna-lite/publish": "3.10.1", | ||
"@lerna-lite/run": "3.10.1", | ||
"@types/node": "20.17.6", | ||
"@typescript-eslint/eslint-plugin": "8.18.0", | ||
"@typescript-eslint/parser": "8.18.0", | ||
"concurrently": "9.1.2", | ||
"eslint": "8.57.0", | ||
"eslint-config-prettier": "9.1.0", | ||
"eslint-plugin-import": "2.31.0", | ||
|
@@ -47,7 +53,8 @@ | |
"stylelint": "16.11.0", | ||
"stylelint-config-standard-scss": "13.1.0", | ||
"stylelint-order": "6.0.4", | ||
"typescript": "5.7.2" | ||
"typescript": "5.7.2", | ||
"wait-on": "8.0.1" | ||
}, | ||
"scripts": { | ||
"prebuild": "pnpm run clean", | ||
|
@@ -79,11 +86,8 @@ | |
"update-minor": "npm-check-updates --configFileName .ncurc.minor.cjs", | ||
"update-major": "npm-check-updates --configFileName .ncurc.major.cjs", | ||
"watch:storybook": "npm run --workspace packages/storybook storybook", | ||
"watch:style-dictionary": "lerna run watch:style-dictionary" | ||
}, | ||
"dependencies": { | ||
"http-server": "14.1.1", | ||
"rimraf": "6.0.1" | ||
"watch:style-dictionary": "lerna run watch:style-dictionary", | ||
"test-storybook:ci": "npm run --workspace packages/storybook playwright:install && concurrently -k -s first -n \"STORYBOOK,A11Y-TEST\" -c \"magenta,green\" \"npm run --workspace packages/storybook prod-static -- --silent\" \"wait-on tcp:6006 && npm run --workspace packages/storybook test-storybook\"" | ||
}, | ||
"packageManager": "[email protected]+sha256.b6fd0bfda555e7e584ad7e56b30c68b01d5a04f9ee93989f4b93ca8473c49c74" | ||
} |
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
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1,51 +1,57 @@ | ||
import { Heading, Paragraph, Alert as UtrechtAlert } from '@utrecht/component-library-react'; | ||
import clsx from 'clsx'; | ||
import { ForwardedRef, forwardRef, PropsWithChildren, ReactNode } from 'react'; | ||
import { PropsWithChildren, ReactNode, RefObject } from 'react'; | ||
import { Icon } from './icon/Icon'; | ||
|
||
export interface AlertProps { | ||
ref?: RefObject<HTMLDivElement>; | ||
type: 'info' | 'ok' | 'warning' | 'error'; | ||
heading?: ReactNode; | ||
headingLevel?: 1 | 2 | 3 | 4 | 5; | ||
textContent?: ReactNode; | ||
} | ||
export const Alert = forwardRef( | ||
( | ||
{ type, heading, headingLevel, textContent, children, ...restProps }: PropsWithChildren<AlertProps>, | ||
ref: ForwardedRef<HTMLDivElement>, | ||
) => { | ||
return ( | ||
<UtrechtAlert className="rhc-alert" ref={ref} type={type} {...restProps}> | ||
<div | ||
className={clsx('rhc-alert__icon-container', { | ||
'rhc-alert__icon-container--ok': type === 'ok', | ||
'rhc-alert__icon-container--error': type === 'error', | ||
'rhc-alert__icon-container--warning': type === 'warning', | ||
'rhc-alert__icon-container--info': type === 'info', | ||
})} | ||
> | ||
<Icon | ||
icon={ | ||
type === 'info' | ||
? 'info-circle' | ||
: type === 'ok' | ||
? 'circle-check' | ||
: type === 'warning' | ||
? 'let-op' | ||
: 'alert-circle' | ||
} | ||
/> | ||
</div> | ||
<div> | ||
export const Alert = ({ | ||
ref, | ||
type, | ||
heading, | ||
headingLevel, | ||
textContent, | ||
children, | ||
...restProps | ||
}: PropsWithChildren<AlertProps>) => { | ||
return ( | ||
<UtrechtAlert className="rhc-alert" ref={ref} type={type} {...restProps}> | ||
<div | ||
className={clsx('rhc-alert__icon-container', { | ||
'rhc-alert__icon-container--ok': type === 'ok', | ||
'rhc-alert__icon-container--error': type === 'error', | ||
'rhc-alert__icon-container--warning': type === 'warning', | ||
'rhc-alert__icon-container--info': type === 'info', | ||
})} | ||
> | ||
<Icon | ||
icon={ | ||
type === 'info' | ||
? 'info-circle' | ||
: type === 'ok' | ||
? 'circle-check' | ||
: type === 'warning' | ||
? 'let-op' | ||
: 'alert-circle' | ||
} | ||
/> | ||
</div> | ||
<div> | ||
{heading && ( | ||
<Heading appearance="utrecht-heading-5" level={headingLevel || 3}> | ||
{heading} | ||
</Heading> | ||
<Paragraph>{textContent}</Paragraph> | ||
{children} | ||
</div> | ||
</UtrechtAlert> | ||
); | ||
}, | ||
); | ||
)} | ||
<Paragraph>{textContent}</Paragraph> | ||
{children} | ||
</div> | ||
</UtrechtAlert> | ||
); | ||
}; | ||
|
||
Alert.displayName = 'Alert'; |
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,10 +1 @@ | ||
import { Article as UtrechtArticle, ArticleProps as UtrechtArticleProps } from '@utrecht/component-library-react'; | ||
import { ForwardedRef, forwardRef, PropsWithChildren } from 'react'; | ||
|
||
export const Article = forwardRef( | ||
(props: PropsWithChildren<UtrechtArticleProps>, ref: ForwardedRef<HTMLDivElement>) => { | ||
return <UtrechtArticle ref={ref} {...props}></UtrechtArticle>; | ||
}, | ||
); | ||
|
||
Article.displayName = 'Article'; | ||
export { Article, type ArticleProps } from '@utrecht/component-library-react'; |
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.