-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Design system/layouts/question (#66)
- Loading branch information
Showing
10 changed files
with
167 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import { Question } from "@repo/design-system/ui"; | ||
|
||
const meta: Meta<typeof Question> = { | ||
title: "Layouts/Question", | ||
component: Question, | ||
}; | ||
|
||
type QuestionStory = StoryObj<typeof meta>; | ||
|
||
export const Default: QuestionStory = { | ||
// args: { | ||
// children: "Volební kalkulačka", | ||
// }, | ||
}; | ||
|
||
export default meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
"use client"; | ||
|
||
import { Question } from "@repo/design-system/ui"; | ||
import { ArrowIconLeft, ArrowIconRight } from "@repo/design-system/demo"; | ||
import { Button } from "@repo/design-system/ui"; | ||
|
||
export default function Page() { | ||
return ( | ||
<> | ||
{/* content */} | ||
{/* mobile arrow bar */} | ||
<div className="flex justify-between sm:hidden"> | ||
<Button | ||
hasIcon | ||
icon={ArrowIconLeft} | ||
iconPosition="left" | ||
kind="link" | ||
fitContent | ||
> | ||
Předchozí | ||
</Button> | ||
<Button | ||
hasIcon | ||
icon={ArrowIconRight} | ||
iconPosition="right" | ||
kind="link" | ||
fitContent | ||
> | ||
Přeskočit | ||
</Button> | ||
</div> | ||
<div className="min-[701px]:grid sm:grid xs:flex xs:flex-col xs:gap-2 min-[701px]:grid-cols-[1fr_clamp(32rem,_50vw,_48rem)_1fr] sm:grid-cols-[1fr_clamp(32rem,_50vw,_48rem)_1fr] sm:gap-8"> | ||
{/* desktop grid content */} | ||
{/* Place button end with flex ok? */} | ||
<div className="min-[701px]:flex justify-end items-center xs:hidden"> | ||
{/* button wrapper */} | ||
<div className="hidden min-[701px]:hidden sm:block"> | ||
<Button | ||
hasIcon | ||
fitContent | ||
icon={ArrowIconLeft} | ||
kind="link" | ||
// fix k1 prefix issue!!! | ||
> | ||
<span className="hidden md:block"> | ||
Předchozí <span className="hidden lg:inline">otázka</span> | ||
</span> | ||
</Button> | ||
</div> | ||
</div> | ||
<div> | ||
<Question /> | ||
</div> | ||
<div className="content-center hidden xs:block"> | ||
{/* button wrapper */} | ||
<div className="hidden min-[701px]:hidden sm:block"> | ||
<Button | ||
hasIcon | ||
fitContent | ||
icon={ArrowIconRight} | ||
iconPosition="right" | ||
kind="link" | ||
> | ||
<span className="hidden md:block"> | ||
Přeskočit <span className="hidden lg:inline">otázku</span> | ||
</span> | ||
</Button> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ThemeConfig } from "tailwindcss/types/config"; | ||
|
||
const padding: Pick<Partial<ThemeConfig>, "padding"> = { | ||
// We're adding these as a default padding scale, but feel free to use any multiplies of 0.25rem as part of default Tailwind CSS padding scale e.g. h-10 p-2 | ||
padding: { | ||
customDesktop: "calc(calc(1rem * 2) - calc(1rem / 16))", | ||
customMobile: "calc(1rem / 2 - 1rem / 16)", | ||
}, | ||
}; | ||
|
||
export default padding; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { ThemeConfig } from "tailwindcss/types/config"; | ||
|
||
const screens: Pick<Partial<ThemeConfig>, "screens"> = { | ||
// !!! We replace the default Tailwind CSS breakpoints scale with our own | ||
screens: { | ||
xs: "576px", | ||
sm: "768px", | ||
md: "992px", | ||
lg: "1200px", | ||
xl: "1400px", | ||
}, | ||
}; | ||
|
||
export default screens; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./question"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Card } from "@repo/design-system/ui"; | ||
import { Badge } from "@repo/design-system/badge"; | ||
|
||
const Question = () => { | ||
return ( | ||
<Card | ||
corner="topLeft" | ||
className="k1-flex k1-flex-col k1-w-auto k1-p-customMobile md:k1-p-customDesktop k1-gap-4" | ||
> | ||
<div className="k1-flex k1-gap-4 k1-flex-wrap k1-items-center"> | ||
<span className="k1-text-sm k1-font-normal">2/25</span> | ||
<span className="k1-text-sm k1-font-normal"> | ||
Hromadná doprava vs. automobilová | ||
</span> | ||
<Badge>Veřejná doprava</Badge> | ||
</div> | ||
<div> | ||
{/* TODO: line height fix value */} | ||
<span className="k1-font-bold k1-text-2xl md:k1-text-4xl k1-leading-6 k1-tracking-tighter"> | ||
Investice do hromadné dopravy by měly mít přednost před rozvojem | ||
infrastruktury pro osobní automobilovou dopravu. | ||
</span> | ||
</div> | ||
<div> | ||
<p className="k1-font-normal k1-text-base k1-text-neutral"> | ||
Investice do veřejné dopravy jsou klíčové pro všechny kraje, zejména | ||
pro venkovské a méně rozvinuté oblasti. | ||
</p> | ||
</div> | ||
</Card> | ||
); | ||
}; | ||
|
||
export { Question }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters