From e0e16de1442346d546a00bd72745b5ecdf8f61b6 Mon Sep 17 00:00:00 2001 From: Brian McGee Date: Thu, 31 Jul 2025 11:28:14 +0100 Subject: [PATCH] feat(ui): MachineTags component and tags section in machine detail pane --- .../src/components/Form/Combobox.stories.tsx | 136 ------------ .../ui/src/components/Form/Combobox.tsx | 181 --------------- .../Form/{Combobox.css => MachineTags.css} | 18 +- .../ui/src/components/Form/MachineTags.tsx | 206 ++++++++++++++++++ .../Sidebar/SidebarPane.stories.tsx | 80 +++---- .../ui/src/routes/Machine/Machine.tsx | 17 +- .../ui/src/routes/Machine/SectionGeneral.tsx | 19 +- .../ui/src/routes/Machine/SectionTags.tsx | 86 ++++++++ 8 files changed, 367 insertions(+), 376 deletions(-) delete mode 100644 pkgs/clan-app/ui/src/components/Form/Combobox.stories.tsx delete mode 100644 pkgs/clan-app/ui/src/components/Form/Combobox.tsx rename pkgs/clan-app/ui/src/components/Form/{Combobox.css => MachineTags.css} (91%) create mode 100644 pkgs/clan-app/ui/src/components/Form/MachineTags.tsx create mode 100644 pkgs/clan-app/ui/src/routes/Machine/SectionTags.tsx diff --git a/pkgs/clan-app/ui/src/components/Form/Combobox.stories.tsx b/pkgs/clan-app/ui/src/components/Form/Combobox.stories.tsx deleted file mode 100644 index 0b3c5b7fc..000000000 --- a/pkgs/clan-app/ui/src/components/Form/Combobox.stories.tsx +++ /dev/null @@ -1,136 +0,0 @@ -import type { Meta, StoryContext, StoryObj } from "@kachurun/storybook-solid"; -import cx from "classnames"; - -import { Combobox, ComboboxProps } from "./Combobox"; - -const ComboboxExamples = (props: ComboboxProps) => ( -
-
- - -
-
- - -
-
- - -
-
- - -
-
-); - -const meta = { - title: "Components/Form/Combobox", - component: ComboboxExamples, - decorators: [ - (Story: StoryObj, context: StoryContext>) => { - return ( -
- -
- ); - }, - ], -} satisfies Meta>; - -export default meta; - -export type Story = StoryObj; - -export const Bare: Story = { - args: { - options: ["foo", "bar", "baz"], - defaultValue: "foo", - }, -}; - -export const Label: Story = { - args: { - ...Bare.args, - label: "DOB", - }, -}; - -export const Description: Story = { - args: { - ...Label.args, - description: "The date you were born", - }, -}; - -export const Required: Story = { - args: { - ...Description.args, - required: true, - }, -}; - -export const Multiple: Story = { - args: { - ...Description.args, - required: true, - multiple: true, - defaultValue: ["foo", "bar"], - }, -}; - -export const Tooltip: Story = { - args: { - ...Required.args, - tooltip: "The day you came out of your momma", - }, -}; - -export const Ghost: Story = { - args: { - ...Tooltip.args, - ghost: true, - }, -}; - -export const Invalid: Story = { - args: { - ...Tooltip.args, - validationState: "invalid", - }, -}; - -export const Disabled: Story = { - args: { - ...Tooltip.args, - disabled: true, - }, -}; - -export const MultipleDisabled: Story = { - args: { - ...Multiple.args, - disabled: true, - }, -}; - -export const ReadOnly: Story = { - args: { - ...Tooltip.args, - readOnly: true, - defaultValue: "foo", - }, -}; - -export const MultipleReadonly: Story = { - args: { - ...Multiple.args, - readOnly: true, - }, -}; diff --git a/pkgs/clan-app/ui/src/components/Form/Combobox.tsx b/pkgs/clan-app/ui/src/components/Form/Combobox.tsx deleted file mode 100644 index ce0f08923..000000000 --- a/pkgs/clan-app/ui/src/components/Form/Combobox.tsx +++ /dev/null @@ -1,181 +0,0 @@ -import Icon from "@/src/components/Icon/Icon"; -import { - Combobox as KCombobox, - ComboboxRootOptions as KComboboxRootOptions, -} from "@kobalte/core/combobox"; -import { isFunction } from "@kobalte/utils"; - -import "./Combobox.css"; -import { CollectionNode } from "@kobalte/core"; -import { Label } from "./Label"; -import cx from "classnames"; -import { FieldProps } from "./Field"; -import { Orienter } from "./Orienter"; -import { Typography } from "@/src/components/Typography/Typography"; -import { Accessor, Component, For, Show, splitProps } from "solid-js"; -import { Tag } from "@/src/components/Tag/Tag"; - -export type ComboboxProps = FieldProps & - KComboboxRootOptions & { - inverted: boolean; - itemControl?: Component>; - }; - -export const DefaultItemComponent = ( - props: ComboboxItemComponentProps