Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified __snapshots__/card--card-news-chromium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified __snapshots__/card--card-news-firefox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified __snapshots__/card--card-news-webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified __snapshots__/container--container-with-news-chromium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified __snapshots__/container--container-with-news-firefox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified __snapshots__/container--container-with-news-webkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/components/card/Card.style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
&--outline {
outline: 1px solid borderColor();
outline-offset: .5rem;
margin: .5rem;
}

&__section {
Expand Down
2 changes: 1 addition & 1 deletion src/components/card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {Color, Size} from "../../utils/types";


export interface CardType extends HTMLProps<HTMLDivElement> {
children: ReactElement[]
children: ReactNode | ReactNode[]
//defaults to secondary
color?: Color,
//defaults to normal
Expand Down
18 changes: 18 additions & 0 deletions src/components/col/Col.style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@use "sass:math";
@import "../../styles/media";

.col {
flex: 1 0 0;
}

@each $name, $breakpoint in $breakpoints {
@for $i from 1 through 12 {
.col-#{$name}-#{$i} {
@include respond-above($name) {
flex: 0 0 auto;
width: math.div($i, 12) * 100%;
}
}
}
}

25 changes: 25 additions & 0 deletions src/components/col/Col.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React, {HTMLProps, ReactNode} from "react";
import "./Col.style.scss"

export type ColBreakPointRange = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;

export interface ColType extends HTMLProps<HTMLDivElement> {
children: ReactNode | ReactNode[]
xs?: ColBreakPointRange
sm?: ColBreakPointRange
md?: ColBreakPointRange
lg?: ColBreakPointRange
xl?: ColBreakPointRange
xxl?: ColBreakPointRange
}

const Col: React.FC<ColType> = (props) => {

const {children, xs, sm, md, lg, xl, xxl, ...args} = props

return <div {...args} className={`col ${xs ? `col-xs-${xs}` : ""} ${sm ? `col-sm-${sm}` : ""} ${md ? `col-md-${md}` : ""} ${lg ? `col-lg-${lg}` : ""} ${xl ? `col-lg-${xl}` : ""} ${xxl ? `col-xxl-${xxl}` : ""}`}>
{children}
</div>
}

export default Col
36 changes: 36 additions & 0 deletions src/components/container/Container.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import ButtonGroup from "../button-group/ButtonGroup";
import Button from "../button/Button";
import {IconHeart, IconShare} from "@tabler/icons-react";
import React from "react";
import Row from "../row/Row";
import Col from "../col/Col";

const meta: Meta = {
title: "Container",
Expand Down Expand Up @@ -57,4 +59,38 @@ export const ContainerWithNews = () => {

</Card>
</Container>
}

export const ContainerRowCol = () => {
return <div style={{background: "#ffffff1a", padding: "1rem 0"}}>
<Container>
<Row>
<Col xs={12} lg={4}>
<Card gradient variant={"outlined"} color={"info"}>
<Text size={"md"}>Heading 1</Text>
</Card>
</Col>
<Col xs={12} lg={4}>
<Card gradient variant={"outlined"} color={"info"}>
<Text size={"md"}>Heading 2</Text>
</Card>
</Col>
<Col xs={12} lg={4}>
<Card gradient variant={"outlined"} color={"info"}>
<Text size={"md"}>Heading 2</Text>
</Card>
</Col>
<Col>
<Card gradient variant={"outlined"} color={"info"}>
<Text size={"md"}>Heading 2</Text>
</Card>
</Col>
<Col>
<Card gradient variant={"outlined"} color={"info"}>
<Text size={"md"}>Heading 2</Text>
</Card>
</Col>
</Row>
</Container>
</div>
}
3 changes: 2 additions & 1 deletion src/components/container/Container.style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
margin-left: auto;
max-width: 1320px;
min-width: 1320px;
padding: 4rem 1rem;
padding-left: 1rem;
padding-right: 1rem;
position: relative;
z-index: 1;

Expand Down
14 changes: 14 additions & 0 deletions src/components/row/Row.style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.row {
display: flex;
flex-wrap: wrap;

+ .row {
margin-top: 1rem;
}

> * {
flex-shrink: 0;
max-width: 100%;
width: 100%;
}
}
17 changes: 17 additions & 0 deletions src/components/row/Row.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React, {HTMLProps, ReactNode} from "react";
import "./Row.style.scss"

export interface RowType extends HTMLProps<HTMLDivElement> {
children: ReactNode | ReactNode[]
}

const Row: React.FC<RowType> = (props) => {

const {children, ...args} = props

return <div {...args} className={"row"}>
{children}
</div>
}

export default Row