This commit is contained in:
Brian McGee
2025-07-31 17:13:02 +01:00
parent 1b60a04de6
commit 34e1a322d0
6 changed files with 20 additions and 8 deletions

View File

@@ -12,7 +12,14 @@ import cx from "classnames";
import { FieldProps } from "./Field";
import { Orienter } from "./Orienter";
import { Typography } from "@/src/components/Typography/Typography";
import { Accessor, Component, ComponentProps, For, Show, splitProps } from "solid-js";
import {
Accessor,
Component,
ComponentProps,
For,
Show,
splitProps,
} from "solid-js";
import { Tag } from "@/src/components/Tag/Tag";
import { PolymorphicProps } from "@kobalte/core/polymorphic";
import { TextFieldInputProps } from "@kobalte/core/text-field";

View File

@@ -1,5 +1,4 @@
div.form-field.machine-tags {
div.control {
@apply flex flex-col size-full gap-2;

View File

@@ -78,10 +78,11 @@ export const MachineTags = (props: MachineTagsProps) => {
sortedAndUniqueOptions([...staticOptions, ...defaultValue]),
);
const addOptionAndSelect = (option: MachineTag) => {
// add to the list of available options first
setAvailableOptions(sortedAndUniqueOptions([...availableOptions(), option]));
setAvailableOptions(
sortedAndUniqueOptions([...availableOptions(), option]),
);
// update the selected options
setSelectedOptions(sortedAndUniqueOptions([...selectedOptions(), option]));

View File

@@ -44,8 +44,14 @@ export const Default: Story = {
<SidebarSectionForm
title="General"
schema={v.object({
firstName: v.pipe(v.string(), v.nonEmpty("Please enter a first name.")),
lastName: v.pipe(v.string(), v.nonEmpty("Please enter a last name.")),
firstName: v.pipe(
v.string(),
v.nonEmpty("Please enter a first name."),
),
lastName: v.pipe(
v.string(),
v.nonEmpty("Please enter a last name."),
),
bio: v.string(),
shareProfile: v.optional(v.boolean()),
})}

View File

@@ -25,7 +25,7 @@ export const Machine = (props: RouteSectionProps) => {
<SectionTags {...sectionProps} />
</SidebarPane>
);
}
};
return (
<Show when={useMachineName()} keyed>

View File

@@ -25,7 +25,6 @@ export interface SectionGeneralProps {
}
export const SectionGeneral = (props: SectionGeneralProps) => {
const machineQuery = props.machineQuery;
const initialValues = () => {