From 8a59cf7ea34c4bd23b09e95a3015d3f66b780ff4 Mon Sep 17 00:00:00 2001 From: Brian McGee Date: Fri, 22 Aug 2025 12:07:26 +0100 Subject: [PATCH] feat(ui): add NavSection component --- .../NavSection/NavSection.module.css | 16 +++++++++ .../NavSection/NavSection.stories.tsx | 35 +++++++++++++++++++ .../src/components/NavSection/NavSection.tsx | 35 +++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 pkgs/clan-app/ui/src/components/NavSection/NavSection.module.css create mode 100644 pkgs/clan-app/ui/src/components/NavSection/NavSection.stories.tsx create mode 100644 pkgs/clan-app/ui/src/components/NavSection/NavSection.tsx diff --git a/pkgs/clan-app/ui/src/components/NavSection/NavSection.module.css b/pkgs/clan-app/ui/src/components/NavSection/NavSection.module.css new file mode 100644 index 000000000..137fcbc37 --- /dev/null +++ b/pkgs/clan-app/ui/src/components/NavSection/NavSection.module.css @@ -0,0 +1,16 @@ +.navSection { + @apply w-full flex gap-2 items-center justify-between; + @apply rounded-md px-4 py-5 bg-def-2; + + .meta { + @apply flex flex-col gap-2; + } + + &:hover { + @apply bg-def-3 cursor-pointer; + } + + &:active { + @apply bg-def-4; + } +} diff --git a/pkgs/clan-app/ui/src/components/NavSection/NavSection.stories.tsx b/pkgs/clan-app/ui/src/components/NavSection/NavSection.stories.tsx new file mode 100644 index 000000000..6be586a14 --- /dev/null +++ b/pkgs/clan-app/ui/src/components/NavSection/NavSection.stories.tsx @@ -0,0 +1,35 @@ +import type { Meta, StoryObj } from "@kachurun/storybook-solid"; +import { + NavSection, + NavSectionProps, +} from "@/src/components/NavSection/NavSection"; + +const meta: Meta = { + title: "Components/NavSection", + component: NavSection, + decorators: [ + (Story: StoryObj) => ( +
+ +
+ ), + ], +}; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = { + args: { + label: "My Clan", + }, +}; + +export const WithDescription: Story = { + args: { + ...Default.args, + description: + "This is my Clan. There are many Clans like it, but this one is mine", + }, +}; diff --git a/pkgs/clan-app/ui/src/components/NavSection/NavSection.tsx b/pkgs/clan-app/ui/src/components/NavSection/NavSection.tsx new file mode 100644 index 000000000..dcf7e597f --- /dev/null +++ b/pkgs/clan-app/ui/src/components/NavSection/NavSection.tsx @@ -0,0 +1,35 @@ +import cx from "classnames"; +import styles from "./NavSection.module.css"; +import { Button } from "@kobalte/core/button"; +import Icon from "../Icon/Icon"; +import { Typography } from "../Typography/Typography"; +import { Show } from "solid-js"; + +export interface NavSectionProps { + label: string; + description?: string; + onClick: () => void; +} + +export const NavSection = (props: NavSectionProps) => { + return ( + + ); +};