import styled from '@emotion/styled';
import {
FieldGroupSVGLineStyleFields,
FieldGroupSVGTextStyleFields,
withFieldGroup,
withForm,
} from 'react-science/ui';
import type { z } from 'zod';
import type { gridlineValidation } from '../validation/axis_tab_validation.ts';
import { defaultGeneralSettingsFormValues } from '../validation.ts';
// TODO: Expose the Fieldset and Legend components in react-science/ui package
const Fieldset = styled.fieldset`
display: block;
border-top: 1px lightgrey groove;
min-inline-size: min-content;
`;
const Legend = styled.legend`
display: block;
padding-inline-end: 5px;
`;
export const AxisTab = withForm({
defaultValues: defaultGeneralSettingsFormValues,
render: ({ form }) => {
return (
<>
>
);
},
});
const TicksSection = withFieldGroup({
defaultValues: defaultGeneralSettingsFormValues.axis,
render: ({ group }) => {
const { AppField, Section } = group;
return (
<>
{({ Checkbox }) => }
{(field) => }
{(field) => (
)}
{(field) => }
>
);
},
});
const Spectra1DSection = withFieldGroup({
defaultValues: defaultGeneralSettingsFormValues.axis,
render: ({ group }) => {
const { Section } = group;
return (
);
},
});
const defaultValuesGridline: z.input = {
enabled: true,
lineStyle: {},
};
const GridlineSection = withFieldGroup({
defaultValues: defaultValuesGridline,
props: { label: '' },
render: ({ group, label }) => {
const { AppField, Section } = group;
return (
);
},
});
const Spectra2DSection = withFieldGroup({
defaultValues: defaultGeneralSettingsFormValues.axis,
render: ({ group }) => {
const { Section } = group;
return (
);
},
});