Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const TextStyleSwitchContainer = styled.div`
display: flex;
flex-direction: row;
gap: 1rem;
height: 30px;
`;

type SvgTextStyleFields = z.input<typeof svgTextStyleFieldsSchema>;
Expand Down
3 changes: 1 addition & 2 deletions src/components/form/components/input_groups/form_group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const FormContainer = styled.div<{
margin: 0;
grid-template-columns: ${(props) =>
props.layout === 'inline' ? '[label] 30% [input] 70%' : '1fr'};
column-gap: 20px;
gap: 5px 20px;
grid-template-rows: ${(props) =>
props.layout === 'inline' ? 'auto auto' : 'auto'};
`;
Expand Down Expand Up @@ -50,7 +50,6 @@ const Label = styled.label<{ layout: Layout }>`
${INPUT_HEIGHT}px - ${(props) => (props.layout === 'inline' ? 26 : 20)}px
);
grid-column: ${(props) => (props.layout === 'inline' ? 'label' : '1 / -1')};
height: 30px;
`;

const ErrorAndHelpText = styled.div`
Expand Down
15 changes: 14 additions & 1 deletion stories/components/form/tanstack/input.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export function NumericInput(props: InputProps) {
}

const inputSchema = z.object({
longLabel: z.string(),
input: z.string().min(1, 'Value must be at least 1 character'),
});

Expand All @@ -93,6 +94,7 @@ export function Input(props: InputProps) {
validationLogic: revalidateLogic({ modeAfterSubmission: 'change' }),
validators: { onDynamic: inputSchema },
defaultValues: {
longLabel: '',
input: '',
},
});
Expand All @@ -103,7 +105,18 @@ export function Input(props: InputProps) {
}

return (
<form noValidate onSubmit={handleSubmit}>
<form style={{ maxWidth: 360 }} noValidate onSubmit={handleSubmit}>
<form.AppField name="longLabel">
{(field) => (
<field.Input
layout={props.layout}
label="Input with a long label should not overlap with the next field"
required
placeholder="Hello, World!"
helpText="a string"
/>
)}
</form.AppField>
<form.AppField name="input">
{(field) => (
<field.Input
Expand Down
Loading