Skip to content

Commit

Permalink
Merge pull request #27 from ebs-integrator/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
marcellefter authored Jan 19, 2021
2 parents baacf23 + 0760bab commit 39c5aad
Show file tree
Hide file tree
Showing 50 changed files with 1,987 additions and 2,121 deletions.
5 changes: 3 additions & 2 deletions .storybook/storybook.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@

.storybook-rows {
display: flex;
width: 100%;
min-width: 50vw;
width: 50vw;
min-width: 100%;
max-width: 100%;

.storybook-row {
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ebs-integrator/react-ebs-ui",
"version": "0.0.1-beta.8",
"version": "0.0.1-beta.9",
"description": "Basic React UI elements.",
"author": "EBS Integrator",
"maintainers": [
Expand Down
34 changes: 18 additions & 16 deletions src/components/atoms/Alert/Alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,38 @@
padding: $alert-padding;
border-radius: $border-radius;

svg {
.ebs-icon {
width: $alert-icon-size;
height: $alert-icon-size;
border-radius: 100px;
margin-right: $alert-icon-margin;
color: $success-color;
}

&__type {
&--info {
border: 1px dashed $info-color;
&--info {
border: 1px dashed $info-color;

svg {
color: $info-color;
}
.ebs-icon {
color: $info-color;
}
}

&--warning {
border: 1px dashed $warning-color;
&--warning {
border: 1px dashed $warning-color;

svg {
color: $warning-color;
}
.ebs-icon {
color: $warning-color;
}
}

&--error {
border: 1px dashed $danger-color;

&--error {
border: 1px solid $danger-color;
.ebs-icon {
color: $danger-color;

svg {
color: $danger-color;
path:last-child {
fill: $white;
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/components/atoms/Alert/Alert.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import * as React from 'react';

import cn from 'classnames';
import { Icon } from '../';

export type AlertType = 'success' | 'info' | 'warning' | 'error';
Expand Down Expand Up @@ -30,7 +32,7 @@ export const Alert: React.FC<Props> = ({ type = 'success', message = '', classNa
}, [message, getHeader]);

return message.length ? (
<div ref={ref} className={`ebs-alert ebs-alert__type--${type} ${className}`}>
<div ref={ref} className={cn(`ebs-alert`, `ebs-alert--${type}`, className)}>
{renderByType[type]}
{message}
</div>
Expand Down
156 changes: 74 additions & 82 deletions src/components/atoms/Avatar/Avatar.scss
Original file line number Diff line number Diff line change
@@ -1,56 +1,49 @@
.ebs-avatar {
@include flex-center;
position: relative;
border-radius: $border-radius;
@include flex-center;

&__type {
&--regular {
color: $primary-color;
background-color: $grey-100;
}

&--primary {
color: $white;
background-color: $primary-color;
}
&--circle,
&--circle &__img {
border-radius: 50%;
}

&--white {
color: $text-color;
background-color: $white;
}
&--regular {
color: $primary-color;
background-color: $grey-100;
}

&.circle {
border-radius: 50%;
&--primary {
color: $white;
background-color: $primary-color;
}

.ebs-avatar__img {
border-radius: 50%;
}
&--white {
color: $text-color;
background-color: $white;
}

&.ebs-avatar__size {
&--small {
min-width: $avatar-size-small;
width: $avatar-size-small;
height: $avatar-size-small;
&--small {
min-width: $avatar-size-small;
width: $avatar-size-small;
height: $avatar-size-small;
}

.ebs-avatar-short-alt {
font-size: $avatar-font-small;
}
}
&--small &-short-alt {
font-size: $avatar-font-small;
}

&--big {
min-width: $avatar-size-big;
width: $avatar-size-big;
height: $avatar-size-big;
&--big {
min-width: $avatar-size-big;
width: $avatar-size-big;
height: $avatar-size-big;
}

.ebs-avatar-short-alt {
font-size: $avatar-font-big;
}
}
&--big &-short-alt {
font-size: $avatar-font-big;
}

.ebs-avatar__short-alt {
&__short-alt {
position: absolute;
left: 50%;
top: 50%;
Expand All @@ -59,7 +52,7 @@
white-space: nowrap;
}

.ebs-avatar__img {
&__img {
position: relative;
width: 100%;
height: 100%;
Expand All @@ -68,7 +61,7 @@
object-fit: cover;
}

.ebs-avatar__status {
&__status {
position: absolute;
bottom: rem(-2.5px);
right: rem(-2.5px);
Expand All @@ -85,65 +78,64 @@
background-color: $primary-color;
}

&--uanctive {
&--inactive {
background-color: $avatar-status-uanctive;
}
}
}

.ebs-avatar__card {
display: inline-flex;
align-items: center;
background-color: #f9f9f9;
border: 1px solid #dfddd6;
border-radius: $border-radius;
&__card {
display: inline-flex;
align-items: center;
background-color: #f9f9f9;
border: 1px solid #dfddd6;
border-radius: $border-radius;

.ebs-avatar {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
height: rem(23px);
width: rem(23px);
&-alt {
color: #333;
padding: rem(0 $gutter-size / 2);
border-top-right-radius: $border-radius;
border-bottom-right-radius: $border-radius;
@include fontMedium;
font-size: rem(9px);
}

img {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
}

.ebs-avatar__card-alt {
color: #333;
padding: rem(0 $gutter-size / 2);
border-top-right-radius: $border-radius;
border-bottom-right-radius: $border-radius;
@include fontMedium;
font-size: rem(9px);
.ebs-avatar {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
height: rem(23px);
width: rem(23px);
}
}
}

.ebs-avatar__inline {
display: flex;
align-items: center;
&__inline {
display: flex;
align-items: center;
text-align: left;

.ebs-avatar__inline-alt {
margin-left: $gutter-size;
@include fontSemiBold;
font-size: rem(12px);
color: $black;
}
&--reversed &-alt {
margin-left: 0;
margin-right: $gutter-size;
}

&.is-white .ebs-avatar__inline-alt {
color: $white;
}
&-alt {
margin-left: $gutter-size;
@include fontSemiBold;
font-size: rem(12px);
color: $black;
}

.ebs-avatar__inline-description {
font-size: rem(10px);
color: $avatar-description-color;
}
&--white &-alt {
color: $white;
}

&.is-reversed {
.ebs-avatar__inline-alt {
margin-left: 0;
margin-right: $gutter-size;
&-description {
font-size: rem(10px);
color: $avatar-description-color;
}
}
}
4 changes: 2 additions & 2 deletions src/components/atoms/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export const Avatar: React.FC<AvatarProps> = ({

return (
<div
className={cn(`ebs-avatar`, `ebs-avatar__size--${size}`, `ebs-avatar__type--${type}`, className, {
circle: circle,
className={cn(`ebs-avatar`, `ebs-avatar--${size}`, `ebs-avatar--${type}`, className, {
'ebs-avatar--circle': circle,
})}
>
{img ? (
Expand Down
11 changes: 10 additions & 1 deletion src/components/atoms/Avatar/AvatarInline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ export const AvatarInline: React.FC<CardProps> = ({
description,
reversed = false,
}) => (
<div className={cn(`ebs-avatar__inline`, className, { 'is-reversed': reversed, 'is-white': type === 'white' })}>
<div
className={cn(
`ebs-avatar__inline`,
{
'ebs-avatar__inline--reversed': reversed,
'ebs-avatar__inline--white': type === 'white',
},
className,
)}
>
{!reversed && (
<Avatar
size="small"
Expand Down
Loading

0 comments on commit 39c5aad

Please sign in to comment.