Skip to content

Commit bb5282f

Browse files
authored
Add new illustration and slider grid justify aligns (#122)
* Add new illustration * left/right
1 parent 879445e commit bb5282f

File tree

7 files changed

+208
-3
lines changed

7 files changed

+208
-3
lines changed

src/illustrations/illustration.stories.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { SnakesWithDirections } from "./snakes-with-directions";
2525
import { SnakesWithOutlines } from "./snakes-with-outlines";
2626
import { TripleSnakes } from "./triple-snakes";
2727
import { SnakeWithPopcorn } from "./snake-with-popcorn";
28+
import { SnakesFacingLeft } from "./snakes-facing-left";
2829

2930
export default {
3031
title: "Illustrations",
@@ -115,3 +116,6 @@ TripleSnakesStory.args = { component: TripleSnakes };
115116

116117
export const SnakeWithPopcornStory = Template.bind({});
117118
SnakeWithPopcornStory.args = { component: SnakeWithPopcorn };
119+
120+
export const SnakesFacingLeftStory = Template.bind({});
121+
SnakesFacingLeftStory.args = { component: SnakesFacingLeft };

src/illustrations/illustrations.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { SnakesWithCocktail } from "./snakes-with-cocktail";
2525
import { SnakesWithDirections } from "./snakes-with-directions";
2626
import { SnakesWithOutlines } from "./snakes-with-outlines";
2727
import { TripleSnakes } from "./triple-snakes";
28+
import { SnakesFacingLeft } from "./snakes-facing-left";
2829
import { Illustration } from "./types";
2930

3031
export const getIllustration = (name: Illustration | undefined) => {
@@ -83,6 +84,8 @@ export const getIllustration = (name: Illustration | undefined) => {
8384
return SnakeTailUp;
8485
case "snakeWithPopcorn":
8586
return SnakeWithPopcorn;
87+
case "snakesFacingLeft":
88+
return SnakesFacingLeft;
8689
}
8790
return null;
8891
};

src/illustrations/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ export { SnakesWithOutlines } from "./snakes-with-outlines";
2525
export { TripleSnakes } from "./triple-snakes";
2626
export { SnakeTailUp } from "./snake-tail-up";
2727
export { SnakeWithPopcorn } from "./snake-with-popcorn";
28+
export { SnakesFacingLeft } from "./snakes-facing-left";
2829
export { getIllustration } from "./illustrations";

src/illustrations/snake-tail-up.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ export const SnakeTailUp = (props: React.SVGProps<SVGSVGElement>) => {
3434
</defs>
3535
</svg>
3636
);
37-
}
37+
};

src/illustrations/snakes-facing-left.tsx

Lines changed: 194 additions & 0 deletions
Large diffs are not rendered by default.

src/illustrations/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ export type Illustration =
2525
| "snakesWithOutlines"
2626
| "tripleSnakes"
2727
| "snakeTailUp"
28-
| "snakeWithPopcorn";
28+
| "snakeWithPopcorn"
29+
| "snakesFacingLeft";

src/slider-grid/slider-grid.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type Props = {
1010
cols: number;
1111
mdCols?: number;
1212
background?: "snake" | "none";
13-
justifyContent?: "center";
13+
justifyContent?: "left" | "center" | "right";
1414
wrap?: "wrap" | "nowrap";
1515
};
1616

@@ -73,7 +73,9 @@ export const SliderGrid = ({
7373
className={clsx(
7474
`snap-x snap-mandatory overflow-x-auto flex md:-mt-2 lg:-mt-4 md:px-2 lg:px-0`,
7575
{
76+
"md:justify-start": justifyContent === "left",
7677
"md:justify-center": justifyContent === "center",
78+
"md:justify-end": justifyContent === "right",
7779

7880
"md:flex-wrap": wrap === "wrap",
7981
"md:flex-nowrap": wrap === "nowrap",

0 commit comments

Comments
 (0)