generated from nl-design-system/example
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: added Icon component (#664)
- added functional Icons from Tabler - Icons can be selected through a drop down. - Icons are wrapped in the Icon component from Utrecht. --------- Co-authored-by: Mees Work <[email protected]>
- Loading branch information
Showing
6 changed files
with
1,372 additions
and
34 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 |
---|---|---|
@@ -0,0 +1,157 @@ | ||
import { | ||
IconAlertCircle, | ||
IconAlertTriangle, | ||
IconApi, | ||
IconArrowIteration, | ||
IconArrowNarrowDown, | ||
IconArrowNarrowLeft, | ||
IconArrowNarrowRight, | ||
IconArrowNarrowUp, | ||
IconArrowsDiagonal, | ||
IconArrowUpRight, | ||
IconBackhoe, | ||
IconBell, | ||
IconBubble, | ||
IconCalendarCheck, | ||
IconCaretDown, | ||
IconCaretLeft, | ||
IconCaretRight, | ||
IconCaretUp, | ||
IconCheck, | ||
IconClock, | ||
IconCloudLock, | ||
IconCornerLeftUp, | ||
IconDeviceFloppy, | ||
IconDeviceMobile, | ||
IconDotsVertical, | ||
IconDownload, | ||
IconEdit, | ||
IconExternalLink, | ||
IconEye, | ||
IconFile, | ||
IconFilePencil, | ||
IconGridDots, | ||
IconHash, | ||
IconHeart, | ||
IconHome, | ||
IconInfoSquare, | ||
IconLink, | ||
IconLock, | ||
IconLogin2, | ||
IconMail, | ||
IconMapPin, | ||
IconMenu2, | ||
IconMessageDots, | ||
IconNews, | ||
IconPaperclip, | ||
IconPhone, | ||
IconPlayerPlay, | ||
IconPlus, | ||
IconPower, | ||
IconPrinter, | ||
IconQuestionMark, | ||
IconReload, | ||
IconRss, | ||
IconSearch, | ||
IconSend, | ||
IconSettings, | ||
IconShare, | ||
IconSquare, | ||
IconTransfer, | ||
IconTrash, | ||
IconUpload, | ||
IconUser, | ||
IconVolume, | ||
IconVolumeOff, | ||
IconX, | ||
} from '@tabler/icons-react'; | ||
import { Icon as UtrechtIcon } from '@utrecht/component-library-react'; | ||
import { PropsWithChildren } from 'react'; | ||
import { RijkshuisstijlIconID } from './IconTypes'; | ||
|
||
export const IconenSet: Partial<Record<RijkshuisstijlIconID, any>> = { | ||
activiteit: <IconCalendarCheck />, | ||
'agile-werken': <IconArrowIteration />, | ||
'api-inrichting': <IconApi />, | ||
audio: <IconVolume />, | ||
bel: <IconBell />, | ||
bewerken: <IconEdit />, | ||
blog: <IconFilePencil />, | ||
comment: <IconMessageDots />, | ||
communicatie: <IconBubble />, | ||
delen: <IconShare />, | ||
'delta-naar-links': <IconCaretLeft />, | ||
'delta-naar-rechts': <IconCaretRight />, | ||
'delta-omhoog': <IconCaretUp />, | ||
'delta-omlaag': <IconCaretDown />, | ||
'diagonale-pijl': <IconArrowUpRight />, | ||
downloaden: <IconDownload />, | ||
'externe-link': <IconExternalLink />, | ||
favoriet: <IconHeart />, | ||
'foto-vergroten': <IconArrowsDiagonal />, | ||
gegevensuitwisseling: <IconTransfer />, | ||
'geluid-aan': <IconVolume />, | ||
'geluid-uit': <IconVolumeOff />, | ||
'haakse-pijl': <IconCornerLeftUp />, | ||
hashtag: <IconHash />, | ||
home: <IconHome />, | ||
info: <IconInfoSquare />, | ||
inloggen: <IconLogin2 />, | ||
instellingen: <IconSettings />, | ||
'interne-link': <IconLink />, | ||
kalender: <IconCalendarCheck />, | ||
klok: <IconClock />, | ||
kruis: <IconX />, | ||
'let-op-met-loep': <IconAlertCircle />, | ||
'let-op': <IconAlertTriangle />, | ||
locatiemarker: <IconMapPin />, | ||
mail: <IconMail />, | ||
meer: <IconDotsVertical />, | ||
menu: <IconMenu2 />, | ||
nieuws: <IconNews />, | ||
paperclip: <IconPaperclip />, | ||
'permanent-beta': <IconBackhoe />, | ||
'pijl-naar-rechts': <IconArrowNarrowRight />, | ||
'pijl-naar-rechtsboven': <IconArrowUpRight />, | ||
'pijl-omhoog': <IconArrowNarrowUp />, | ||
'pijl-omlaag': <IconArrowNarrowDown />, | ||
plus: <IconPlus />, | ||
printer: <IconPrinter />, | ||
publicatie: <IconFile />, | ||
'rechte-pijl': <IconArrowNarrowUp />, | ||
refresh: <IconReload />, | ||
rss: <IconRss />, | ||
save: <IconDeviceFloppy />, | ||
'secure-link': <IconLock />, | ||
smartphone: <IconDeviceMobile />, | ||
tegelweergave: <IconGridDots />, | ||
telefoon: <IconPhone />, | ||
terug: <IconArrowNarrowLeft />, | ||
toegankelijkheid: <IconEye />, | ||
toelichting: <IconSquare />, | ||
'uit-aanknop': <IconPower />, | ||
upload: <IconUpload />, | ||
user: <IconUser />, | ||
versleutelen: <IconCloudLock />, | ||
verwijderen: <IconTrash />, | ||
verzenden: <IconSend />, | ||
video: <IconPlayerPlay />, | ||
vinkje: <IconCheck />, | ||
vraagteken: <IconQuestionMark />, | ||
zoek: <IconSearch />, | ||
}; | ||
|
||
export const iconOptions = Object.keys(IconenSet); | ||
|
||
interface IconProps { | ||
icon?: any; | ||
} | ||
|
||
export const Icon = ({ children, icon }: PropsWithChildren<IconProps>) => { | ||
return ( | ||
<UtrechtIcon> | ||
{icon && IconenSet[icon as keyof typeof IconenSet]} | ||
{children} | ||
</UtrechtIcon> | ||
); | ||
}; |
Oops, something went wrong.