Skip to content

Commit

Permalink
Added card component
Browse files Browse the repository at this point in the history
  • Loading branch information
lghiur committed May 20, 2024
1 parent 4040b33 commit 8756b58
Show file tree
Hide file tree
Showing 41 changed files with 126,187 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/c8df601cd07dcd5d5f41.js

Large diffs are not rendered by default.

Binary file added src/common/fonts/inter/Inter-Bold.eot
Binary file not shown.
25,445 changes: 25,445 additions & 0 deletions src/common/fonts/inter/Inter-Bold.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/common/fonts/inter/Inter-Bold.ttf
Binary file not shown.
Binary file added src/common/fonts/inter/Inter-Bold.woff
Binary file not shown.
Binary file added src/common/fonts/inter/Inter-Bold.woff2
Binary file not shown.
Binary file added src/common/fonts/inter/Inter-Light.eot
Binary file not shown.
25,012 changes: 25,012 additions & 0 deletions src/common/fonts/inter/Inter-Light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/common/fonts/inter/Inter-Light.ttf
Binary file not shown.
Binary file added src/common/fonts/inter/Inter-Light.woff
Binary file not shown.
Binary file added src/common/fonts/inter/Inter-Light.woff2
Binary file not shown.
Binary file added src/common/fonts/inter/Inter-Medium.eot
Binary file not shown.
25,402 changes: 25,402 additions & 0 deletions src/common/fonts/inter/Inter-Medium.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/common/fonts/inter/Inter-Medium.ttf
Binary file not shown.
Binary file added src/common/fonts/inter/Inter-Medium.woff
Binary file not shown.
Binary file added src/common/fonts/inter/Inter-Medium.woff2
Binary file not shown.
Binary file added src/common/fonts/inter/Inter-Regular.eot
Binary file not shown.
24,343 changes: 24,343 additions & 0 deletions src/common/fonts/inter/Inter-Regular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/common/fonts/inter/Inter-Regular.ttf
Binary file not shown.
Binary file added src/common/fonts/inter/Inter-Regular.woff
Binary file not shown.
Binary file added src/common/fonts/inter/Inter-Regular.woff2
Binary file not shown.
Binary file added src/common/fonts/inter/Inter-SemiBold.eot
Binary file not shown.
25,461 changes: 25,461 additions & 0 deletions src/common/fonts/inter/Inter-SemiBold.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/common/fonts/inter/Inter-SemiBold.ttf
Binary file not shown.
Binary file added src/common/fonts/inter/Inter-SemiBold.woff
Binary file not shown.
Binary file added src/common/fonts/inter/Inter-SemiBold.woff2
Binary file not shown.
1 change: 1 addition & 0 deletions src/common/sass/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@import '../../components/Tooltip/sass/Tooltip.scss';
@import '../../components/Button/sass/Button';
@import '../../components/ButtonGroup/sass/ButtonGroup';
@import '../../components/Card/sass/Card';
@import '../../components/Chart/sass/Chart';
@import '../../components/Collapsible/sass/Collapsible';
@import '../../components/CopyToClipboard/sass/CopyToClipboard';
Expand Down
5 changes: 5 additions & 0 deletions src/common/sass/fonts.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@include font-face('Inter-Bold', $font-path + 'inter/Inter-Bold');
@include font-face('Inter-Light', $font-path + 'inter/Inter-Light');
@include font-face('Inter-Medium', $font-path + 'inter/Inter-Medium');
@include font-face('Inter-Regular', $font-path + 'inter/Inter-Regular');
@include font-face('Inter-SemiBold', $font-path + 'inter/Inter-SemiBold');
@include font-face('OpenSans-Bold', $font-path + 'OpenSans-Bold');
@include font-face('OpenSans-SemiBold', $font-path + 'OpenSans-SemiBold');
@include font-face('OpenSans-Regular', $font-path + 'OpenSans-Regular');
Expand Down
7 changes: 6 additions & 1 deletion src/common/sass/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ $xxl-line-height: 30px;
$xs-font-size: 12px;
$sm-font-size: 14px;
$md-font-size: 16px;
$lg-font-size: 17px;
$lg-font-size: 18px;
$xl-font-size: 20px;
$xxl-font-size: 25px;

Expand Down Expand Up @@ -151,6 +151,11 @@ $grid-breakpoints: (
'xs' '(max-width: ' + $breakpoint-sm + ')'
) !default;

$font-inter-light: 'Inter-Light' !default;
$font-inter-medium: 'Inter-Medium' !default;
$font-inter-regular: 'Inter-Regular' !default;
$font-inter-bold: 'Inter-Bold' !default;

$font-family-regular: 'OpenSans-regular' !default;
$font-family-medium: 'OpenSans-SemiBold' !default;
$font-family-bold: 'OpenSans-Bold' !default;
Expand Down
20 changes: 20 additions & 0 deletions src/components/Card/CardBody.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import PropTypes from 'prop-types';

function CardBody({ children }) {
return (
<div className="tyk-card__body">
{children}
</div>
);
}

CardBody.propTypes = {
children: PropTypes.oneOfType([
PropTypes.element,
PropTypes.node,
PropTypes.string,
]),
};

export default CardBody;
20 changes: 20 additions & 0 deletions src/components/Card/CardFooter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import PropTypes from 'prop-types';

function CardFooter({ children }) {
return (
<div className="tyk-card__footer">
{children}
</div>
);
}

CardFooter.propTypes = {
children: PropTypes.oneOfType([
PropTypes.element,
PropTypes.node,
PropTypes.string,
]),
};

export default CardFooter;
29 changes: 29 additions & 0 deletions src/components/Card/CardHeader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import PropTypes from 'prop-types';

function CardHeader({
right = null,
children,
}) {
return (
<div className="tyk-card__header">
{children && <div className="tyk-card__header-content">{children}</div>}
{right && <div className="tyk-card__header-right">{right}</div>}
</div>
);
}

CardHeader.propTypes = {
right: PropTypes.oneOfType([
PropTypes.element,
PropTypes.node,
PropTypes.string,
]),
children: PropTypes.oneOfType([
PropTypes.element,
PropTypes.node,
PropTypes.string,
]),
};

export default CardHeader;
22 changes: 22 additions & 0 deletions src/components/Card/CardSubTitle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';
import PropTypes from 'prop-types';

function CardSubTitle({
children,
}) {
return (
<h5 className="tyk-card__sub-title">
{children}
</h5>
);
}

CardSubTitle.propTypes = {
children: PropTypes.oneOfType([
PropTypes.element,
PropTypes.node,
PropTypes.string,
]),
};

export default CardSubTitle;
24 changes: 24 additions & 0 deletions src/components/Card/CardSummary.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import PropTypes from 'prop-types';

function CardSummary({
maxLines = 2, // accepted values: 1, 2, 3, 4, 5
children,
}) {
return (
<p className={`tyk-card__summary tyk-card__summary--max-${maxLines}-lines`}>
{children}
</p>
);
}

CardSummary.propTypes = {
maxLines: PropTypes.number,
children: PropTypes.oneOfType([
PropTypes.element,
PropTypes.node,
PropTypes.string,
]),
};

export default CardSummary;
24 changes: 24 additions & 0 deletions src/components/Card/CardTitle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import PropTypes from 'prop-types';

function CardTitle({
maxLines = 1, // accepted values: 1, 2
children,
}) {
return (
<h4 className={`tyk-card__title tyk-card__title--max-${maxLines}-lines`}>
{children}
</h4>
);
}

CardTitle.propTypes = {
maxLines: PropTypes.number,
children: PropTypes.oneOfType([
PropTypes.element,
PropTypes.node,
PropTypes.string,
]),
};

export default CardTitle;
22 changes: 22 additions & 0 deletions src/components/Card/CardTitleGroup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';
import PropTypes from 'prop-types';

function CardTitleGroup({
children,
}) {
return (
<div className="tyk-card__title-group">
{children}
</div>
);
}

CardTitleGroup.propTypes = {
children: PropTypes.oneOfType([
PropTypes.element,
PropTypes.node,
PropTypes.string,
]),
};

export default CardTitleGroup;
22 changes: 22 additions & 0 deletions src/components/Card/CardTitleIcon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';
import PropTypes from 'prop-types';

function CardTitleIcon({
children,
}) {
return (
<div className="tyk-card__title-icon">
{children}
</div>
);
}

CardTitleIcon.propTypes = {
children: PropTypes.oneOfType([
PropTypes.element,
PropTypes.node,
PropTypes.string,
]),
};

export default CardTitleIcon;
Loading

0 comments on commit 8756b58

Please sign in to comment.