Skip to content
This repository was archived by the owner on Mar 16, 2024. It is now read-only.
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
7 changes: 7 additions & 0 deletions @types/cherry.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ interface ColProps {
| "inline-flex"
| "none";
fullScreen?: boolean;
sticky?: boolean;
theme?: object;
}

Expand Down Expand Up @@ -165,6 +166,7 @@ interface InputProps
size?: "default" | "big";
label?: string;
fullWidth?: boolean;
variant?: "primary" | "secondary" | "tertiary";
theme?: object;
}

Expand All @@ -176,13 +178,16 @@ interface ToggleInputProps
size?: "default" | "big";
label?: string;
fullWidth?: boolean;
variant?: "primary" | "secondary" | "tertiary";
theme?: object;
}

interface RangeSliderProps
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {
type?: "range";
size?: "default" | "big";
fullWidth?: boolean;
variant?: "primary" | "secondary" | "tertiary";
theme?: object;
}

Expand All @@ -194,6 +199,7 @@ interface SelectProps
size?: "default" | "big";
label?: string;
fullWidth?: boolean;
variant?: "primary" | "secondary" | "tertiary";
theme?: object;
}

Expand All @@ -205,6 +211,7 @@ interface TextareaProps
size?: "default" | "big";
label?: string;
fullWidth?: boolean;
variant?: "primary" | "secondary" | "tertiary";
theme?: object;
}

Expand Down
2 changes: 1 addition & 1 deletion dist/cherry.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cherry.module.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cherry-components",
"version": "0.0.2-6",
"version": "0.0.2-7",
"description": "Cherry React Components",
"main": "dist/cherry.js",
"module": "dist/cherry.module.js",
Expand Down
4 changes: 3 additions & 1 deletion src/Layout/Grid/Col/Col.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function Col({
lastXxxl,
display,
fullScreen,
sticky,
theme = localTheme,
}) {
return (
Expand Down Expand Up @@ -64,8 +65,9 @@ function Col({
lastXxxl,
display,
fullScreen,
sticky,
)}
className={className}
className={className ? `col ${className}` : "col"}
id={id}
data-col
>
Expand Down
13 changes: 12 additions & 1 deletion src/Layout/Grid/Col/Col.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { css } from "@emotion/react";
import { mq, Breakpoints } from "../../../mq";

const col = css`
position: relative;
width: 100%;
min-height: 1px;
flex-basis: 0;
Expand Down Expand Up @@ -118,6 +117,7 @@ export const colStyles = (
lastXxxl,
display,
fullScreen,
sticky,
) => css`
${display &&
css`
Expand Down Expand Up @@ -158,6 +158,17 @@ export const colStyles = (
}
`}

${sticky &&
css`
${mq(Breakpoints.lg)} {
position: sticky;
top: ${theme.spacing.paddingTopBody.desktop};
max-height: calc(100vh - ${theme.spacing.paddingTopBody.desktop});
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
`}

${mq(Breakpoints.xs)} {
${firstXs &&
css`
Expand Down
12 changes: 6 additions & 6 deletions src/Layout/Grid/Row/Row.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ function Row({
alignItems,
justifyContent,
gutterXs = "default",
gutterSm,
gutterMd,
gutterLg,
gutterXl,
gutterXxl,
gutterXxxl,
gutterSm = "default",
gutterMd = "default",
gutterLg = "default",
gutterXl = "default",
gutterXxl = "default",
gutterXxxl = "default",
theme = localTheme,
}) {
return (
Expand Down
63 changes: 21 additions & 42 deletions src/Layout/Grid/Row/Row.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.default};
margin-left: ${theme.spacing.marginRow.default};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.default};
padding-left: ${theme.spacing.gutterCol.default};
}
Expand All @@ -98,8 +97,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.medium};
margin-left: ${theme.spacing.marginRow.medium};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.medium};
padding-left: ${theme.spacing.gutterCol.medium};
}
Expand All @@ -110,8 +108,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.big};
margin-left: ${theme.spacing.marginRow.big};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.big};
padding-left: ${theme.spacing.gutterCol.big};
}
Expand All @@ -124,8 +121,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.default};
margin-left: ${theme.spacing.marginRow.default};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.default};
padding-left: ${theme.spacing.gutterCol.default};
}
Expand All @@ -136,8 +132,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.medium};
margin-left: ${theme.spacing.marginRow.medium};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.medium};
padding-left: ${theme.spacing.gutterCol.medium};
}
Expand All @@ -148,8 +143,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.big};
margin-left: ${theme.spacing.marginRow.big};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.big};
padding-left: ${theme.spacing.gutterCol.big};
}
Expand All @@ -162,8 +156,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.default};
margin-left: ${theme.spacing.marginRow.default};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.default};
padding-left: ${theme.spacing.gutterCol.default};
}
Expand All @@ -174,8 +167,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.medium};
margin-left: ${theme.spacing.marginRow.medium};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.medium};
padding-left: ${theme.spacing.gutterCol.medium};
}
Expand All @@ -186,8 +178,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.big};
margin-left: ${theme.spacing.marginRow.big};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.big};
padding-left: ${theme.spacing.gutterCol.big};
}
Expand All @@ -200,8 +191,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.default};
margin-left: ${theme.spacing.marginRow.default};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.default};
padding-left: ${theme.spacing.gutterCol.default};
}
Expand All @@ -212,8 +202,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.medium};
margin-left: ${theme.spacing.marginRow.medium};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.medium};
padding-left: ${theme.spacing.gutterCol.medium};
}
Expand All @@ -224,8 +213,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.big};
margin-left: ${theme.spacing.marginRow.big};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.big};
padding-left: ${theme.spacing.gutterCol.big};
}
Expand All @@ -238,8 +226,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.default};
margin-left: ${theme.spacing.marginRow.default};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.default};
padding-left: ${theme.spacing.gutterCol.default};
}
Expand All @@ -250,8 +237,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.medium};
margin-left: ${theme.spacing.marginRow.medium};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.medium};
padding-left: ${theme.spacing.gutterCol.medium};
}
Expand All @@ -262,8 +248,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.big};
margin-left: ${theme.spacing.marginRow.big};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.big};
padding-left: ${theme.spacing.gutterCol.big};
}
Expand All @@ -276,8 +261,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.default};
margin-left: ${theme.spacing.marginRow.default};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.default};
padding-left: ${theme.spacing.gutterCol.default};
}
Expand All @@ -288,8 +272,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.medium};
margin-left: ${theme.spacing.marginRow.medium};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.medium};
padding-left: ${theme.spacing.gutterCol.medium};
}
Expand All @@ -300,8 +283,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.big};
margin-left: ${theme.spacing.marginRow.big};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.big};
padding-left: ${theme.spacing.gutterCol.big};
}
Expand All @@ -314,8 +296,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.default};
margin-left: ${theme.spacing.marginRow.default};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.default};
padding-left: ${theme.spacing.gutterCol.default};
}
Expand All @@ -326,8 +307,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.medium};
margin-left: ${theme.spacing.marginRow.medium};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.medium};
padding-left: ${theme.spacing.gutterCol.medium};
}
Expand All @@ -338,8 +318,7 @@ export const rowStyles = (
margin-right: ${theme.spacing.marginRow.big};
margin-left: ${theme.spacing.marginRow.big};

& [data-col],
& > * {
& .col {
padding-right: ${theme.spacing.gutterCol.big};
padding-left: ${theme.spacing.gutterCol.big};
}
Expand Down
13 changes: 12 additions & 1 deletion src/Layout/Input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,21 @@ function Input({
error,
label,
fullWidth,
variant = "secondary",
theme = localTheme,
...props
}) {
if ((type === "checkbox") | (type === "radio")) {
return (
<div css={radioCheckWrapperStyles(theme, type, size, fullWidth)}>
<div
css={radioCheckWrapperStyles(
theme,
type,
size,
fullWidth,
variant,
)}
>
<input
type={type}
className={className}
Expand All @@ -30,6 +39,7 @@ function Input({
success,
error,
fullWidth,
variant,
)}
{...props}
/>
Expand Down Expand Up @@ -61,6 +71,7 @@ function Input({
success,
error,
fullWidth,
variant,
)}
{...props}
/>
Expand Down
Loading