mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
feat: start of cards
This commit is contained in:
1 parent
c5f5f69fd6
commit
db8ac195d4
6 files changed
+58
-11
No files matched your search
@@ -0,0 +1,2 @@
|
|||||||
|
.button {
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import type { ComponentProps } from "react";
|
||||||
|
import { classNames } from "../../core/ui/classNames";
|
||||||
|
import "./index.css";
|
||||||
|
|
||||||
|
export interface ButtonProps extends ComponentProps<"button"> {}
|
||||||
|
|
||||||
|
export function Button({ className, ...props }: ButtonProps) {
|
||||||
|
return <button className={classNames("button", className)} {...props} />;
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import type { ComponentProps } from "react";
|
import type { ComponentProps } from "react";
|
||||||
|
import { classNames } from "../../core/ui/classNames";
|
||||||
import type { Color } from "../../core/ui/color";
|
import type { Color } from "../../core/ui/color";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
@@ -7,10 +8,15 @@ export interface TextProps extends ComponentProps<"span"> {
|
|||||||
lowContrast?: boolean;
|
lowContrast?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Text({ color = "gray", lowContrast, ...props }: TextProps) {
|
export function Text({
|
||||||
|
color = "gray",
|
||||||
|
lowContrast,
|
||||||
|
className,
|
||||||
|
...props
|
||||||
|
}: TextProps) {
|
||||||
return (
|
return (
|
||||||
<span
|
<span
|
||||||
className="text"
|
className={classNames("text", className)}
|
||||||
style={{ color: `var(--${color}-${lowContrast ? 11 : 12})` }}
|
style={{ color: `var(--${color}-${lowContrast ? 11 : 12})` }}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,13 +1,17 @@
|
|||||||
import type { ComponentProps, ReactNode } from "react";
|
import type { ComponentProps, ReactNode } from "react";
|
||||||
|
import { classNames } from "../../core/ui/classNames";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
export interface TextFieldProps extends ComponentProps<"input"> {
|
export interface TextFieldProps extends ComponentProps<"input"> {
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function TextField({ children, ...props }: TextFieldProps) {
|
export function TextField({ children, className, ...props }: TextFieldProps) {
|
||||||
return (
|
return (
|
||||||
<div className="text-field" data-has-icon={children !== undefined}>
|
<div
|
||||||
|
className={classNames("text-field", className)}
|
||||||
|
data-has-icon={children !== undefined}
|
||||||
|
>
|
||||||
{children}
|
{children}
|
||||||
<input {...props} />
|
<input {...props} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
import { CaretRightIcon } from "@radix-ui/react-icons";
|
||||||
|
import type { Tool } from "../core/tools/tools";
|
||||||
|
import { Button } from "./Button";
|
||||||
|
import { Text } from "./Text";
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
tool: Tool;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { tool } = Astro.props;
|
||||||
|
---
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.tool-card {
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div class="tool-card">
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<Text>{tool.id}</Text>
|
||||||
|
<Text>{tool.id}</Text>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Button>
|
||||||
|
{tool.id}
|
||||||
|
<CaretRightIcon />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -4,6 +4,7 @@ import "@radix-ui/colors/amber-dark.css";
|
|||||||
import type { GetStaticPaths } from "astro";
|
import type { GetStaticPaths } from "astro";
|
||||||
import packageJson from "../../../../../package.json";
|
import packageJson from "../../../../../package.json";
|
||||||
import HomeHero from "../../components/HomeHero.astro";
|
import HomeHero from "../../components/HomeHero.astro";
|
||||||
|
import ToolCard from "../../components/ToolCard.astro";
|
||||||
import { tools } from "../../core/tools/tools";
|
import { tools } from "../../core/tools/tools";
|
||||||
import BaseLayout from "../../layouts/BaseLayout.astro";
|
import BaseLayout from "../../layouts/BaseLayout.astro";
|
||||||
|
|
||||||
@@ -24,11 +25,5 @@ const { locale } = Astro.props;
|
|||||||
|
|
||||||
<h1>blitzkit {packageJson.version}</h1>
|
<h1>blitzkit {packageJson.version}</h1>
|
||||||
|
|
||||||
{
|
{Object.values(tools).map((tool) => <ToolCard {tool} />)}
|
||||||
Object.values(tools).map((tool) => (
|
|
||||||
<p>
|
|
||||||
<a href={`/${tool.id}`}>{tool.id}</a>
|
|
||||||
</p>
|
|
||||||
))
|
|
||||||
}
|
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
Reference in new issue
Block a user