diff --git a/pkgs/clan-app/ui/src/components/Search/TagSelect.module.css b/pkgs/clan-app/ui/src/components/Search/TagSelect.module.css new file mode 100644 index 000000000..67a29f6a9 --- /dev/null +++ b/pkgs/clan-app/ui/src/components/Search/TagSelect.module.css @@ -0,0 +1,38 @@ +.dummybg { + padding: 1rem; + width: 20rem; + min-height: 10rem; + border-radius: 8px; + border: 1px solid #2e4a4b; + background: + linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.18) 100%), + linear-gradient( + 180deg, + var(--clr-bg-inv-3, rgba(46, 74, 75, 0.79)) 0%, + var(--clr-bg-inv-4, rgba(32, 54, 55, 0.79)) 100% + ); + box-shadow: + 0 10px 15px -3px rgba(0, 0, 0, 0.1), + 0 4px 6px -2px rgba(0, 0, 0, 0.05); +} + +.trigger { + @apply rounded-md bg-inv-4 w-full min-h-11; + + &:focus, + &:hover { + @apply outline outline-def-1 outline-1; + background: + linear-gradient( + 90deg, + var(--clr-bg-inv-acc-3, #2c4347) 0%, + var(--clr-bg-inv-acc-2, #4f747a) 100% + ), + var(--clr-bg-inv-4, #203637); + box-shadow: 0 0 0 2px var(--clr-bg-inv-acc-4, #162324) inset; + } + + &.open { + @apply bg-inv-acc-4; + } +} diff --git a/pkgs/clan-app/ui/src/components/Search/TagSelect.stories.tsx b/pkgs/clan-app/ui/src/components/Search/TagSelect.stories.tsx new file mode 100644 index 000000000..ef70a71e0 --- /dev/null +++ b/pkgs/clan-app/ui/src/components/Search/TagSelect.stories.tsx @@ -0,0 +1,38 @@ +import { Meta, StoryObj } from "@kachurun/storybook-solid"; + +import { TagSelect, TagSelectProps } from "./TagSelect"; +import { Tag } from "../Tag/Tag"; +import Icon from "../Icon/Icon"; + +const meta = { + title: "Components/Custom/SelectStepper", + component: TagSelect, +} satisfies Meta>; + +export default meta; + +type Story = StoryObj>; + +const Item = (item: string) => ( + ( + + )} + > + {item} + +); +export const Default: Story = { + args: { + renderItem: Item, + values: ["foo", "bar"], + options: ["foo", "bar", "baz", "qux", "quux"], + onChange: (values: string[]) => { + console.log("Selected values:", values); + }, + onClick: () => { + console.log("Combobox clicked"); + }, + }, +}; diff --git a/pkgs/clan-app/ui/src/components/Search/TagSelect.tsx b/pkgs/clan-app/ui/src/components/Search/TagSelect.tsx new file mode 100644 index 000000000..43a541134 --- /dev/null +++ b/pkgs/clan-app/ui/src/components/Search/TagSelect.tsx @@ -0,0 +1,71 @@ +import Icon from "../Icon/Icon"; +import { Typography } from "../Typography/Typography"; +import { For, JSX, Show } from "solid-js"; +import styles from "./TagSelect.module.css"; +import { Combobox } from "@kobalte/core/combobox"; +import { Button } from "../Button/Button"; + +export interface TagSelectProps { + // Define any props needed for the SelectStepper component + values: T[]; + options: T[]; + onChange: (values: T[]) => void; + onClick: () => void; + renderItem: (item: T) => JSX.Element; +} + +export function TagSelect(props: TagSelectProps) { + return ( +
+
+
+ + Servers + + +
+ + multiple + value={props.values} + onChange={props.onChange} + options={props.options} + allowsEmptyCollection + class="w-full" + > + aria-label="Fruits"> + {(state) => ( + +
+ + + + Select + + + {props.renderItem} +
+
+ )} + + +
+
+ ); +}