-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into test/rewrite-delegation-tests
- Loading branch information
Showing
38 changed files
with
942 additions
and
134 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
.avatar { | ||
--avatar-size: 2rem; | ||
min-width: var(--avatar-size); | ||
min-height: var(--avatar-size); | ||
display: grid; | ||
place-content: center; | ||
background-color: #00315d; | ||
color: #ffffff; | ||
text-align: center; | ||
text-transform: uppercase; | ||
} | ||
|
||
.avatar.person { | ||
border-radius: 50%; | ||
} | ||
|
||
.avatar.organization { | ||
border-radius: 0.25em; | ||
} | ||
|
||
.avatar.serviceOwner { | ||
border-radius: 4%; | ||
background-color: #5590e9; | ||
} | ||
|
||
.icon { | ||
font-size: var(--iconFontSize); | ||
display: grid; | ||
place-content: center; | ||
} | ||
|
||
.lg { | ||
--avatar-size: 2.6rem; | ||
--iconFontSize: 2.3em; | ||
} | ||
|
||
.md { | ||
--avatar-size: 2.1rem; | ||
--iconFontSize: 1.8em; | ||
} | ||
|
||
.sm { | ||
--avatar-size: 1.8rem; | ||
--iconFontSize: 1.5em; | ||
} | ||
|
||
.initial { | ||
color: #ffffff; | ||
} |
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,40 @@ | ||
import React from 'react'; | ||
import cn from 'classnames'; | ||
import { Paragraph } from '@digdir/designsystemet-react'; | ||
|
||
import classes from './Avatar.module.css'; | ||
|
||
export type AvatarProfile = 'organization' | 'person' | 'serviceOwner'; | ||
|
||
interface AvatarProps { | ||
/** The size of the component */ | ||
size: 'lg' | 'md' | 'sm'; | ||
/** The name of the avatars owner*/ | ||
name?: string; | ||
/** If displaying an icon istead of initials */ | ||
icon?: React.ReactNode; | ||
/** Determines the shape of the avatar */ | ||
profile?: AvatarProfile; | ||
/** Additional class names for styling */ | ||
className?: string; | ||
} | ||
|
||
export const Avatar = ({ icon, name, size = 'md', profile = 'person', className }: AvatarProps) => { | ||
return ( | ||
<div | ||
className={cn(classes.avatar, classes[size], classes[profile], className)} | ||
aria-hidden | ||
> | ||
{name && ( | ||
<Paragraph | ||
asChild | ||
size={size} | ||
className={classes.initial} | ||
> | ||
<span>{name.charAt(0)}</span> | ||
</Paragraph> | ||
)} | ||
{icon && <span className={cn(classes[size], classes.icon)}>{icon}</span>} | ||
</div> | ||
); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,30 @@ | ||
import React from 'react'; | ||
import classNames from 'classnames'; | ||
import cn from 'classnames'; | ||
|
||
import classes from './List.module.css'; | ||
|
||
interface ListItemProps extends React.HtmlHTMLAttributes<HTMLLIElement> { | ||
children: React.ReactNode; | ||
onClick?: () => void; | ||
} | ||
|
||
export const ListItem = ({ children, className, ...props }: ListItemProps) => { | ||
// TODO: Make this into a complete ListItem component with avatars, title and subtitle as designed | ||
export const ListItem = ({ children, onClick, className, ...props }: ListItemProps) => { | ||
return ( | ||
<li | ||
className={classNames(classes.listItem, className)} | ||
className={cn(classes.listItem)} | ||
{...props} | ||
> | ||
{children} | ||
{onClick ? ( | ||
<button | ||
className={cn(classes.clickableItem, className)} | ||
onClick={onClick} | ||
> | ||
{children} | ||
</button> | ||
) : ( | ||
<div className={className}>{children}</div> | ||
)} | ||
</li> | ||
); | ||
}; |
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,2 @@ | ||
export { List } from './List'; | ||
export { ListItem } from './ListItem'; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
7 changes: 7 additions & 0 deletions
7
src/features/amUI/userRightsPage/DelegationModal/DelegationModal.module.css
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,7 @@ | ||
.modalDialog { | ||
max-width: 1100px; | ||
} | ||
|
||
.content { | ||
margin-bottom: 1em; | ||
} |
Oops, something went wrong.