From 7e8f1da220f0ccc8c4b5602f6872371448930933 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Mon, 6 Jan 2025 10:18:50 +0100 Subject: [PATCH] UI: init components {group,section,sectionHeader} --- .../app/src/components/group/index.tsx | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 pkgs/webview-ui/app/src/components/group/index.tsx diff --git a/pkgs/webview-ui/app/src/components/group/index.tsx b/pkgs/webview-ui/app/src/components/group/index.tsx new file mode 100644 index 000000000..ef04e66f0 --- /dev/null +++ b/pkgs/webview-ui/app/src/components/group/index.tsx @@ -0,0 +1,60 @@ +import cx from "classnames"; +import { JSX } from "solid-js"; +import Icon, { IconVariant } from "../icon"; + +interface GroupProps { + children: JSX.Element; +} + +export const Group = (props: GroupProps) => ( +
+ {props.children} +
+); + +export type SectionVariant = "attention" | "danger"; + +interface SectionHeaderProps { + variant: SectionVariant; + headline: JSX.Element; +} +const variantColorsMap: Record = { + attention: cx("bg-[#9BD8F2] fg-def-1"), + danger: cx("bg-semantic-2 fg-semantic-2"), +}; + +const variantIconColorsMap: Record = { + attention: cx("fg-def-1"), + danger: cx("fg-semantic-3"), +}; + +const variantIconMap: Record = { + attention: "Attention", + danger: "Warning", +}; + +// SectionHeader component +export const SectionHeader = (props: SectionHeaderProps) => ( +
+ { + + } + {props.headline} +
+); + +// Section component +interface SectionProps { + children: JSX.Element; +} +export const Section = (props: SectionProps) => ( +
{props.children}
+);