-
-
);
};
diff --git a/app/javascript/mastodon/components/form_fields/index.ts b/app/javascript/mastodon/components/form_fields/index.ts
index 8100d560495..8dd693d51e1 100644
--- a/app/javascript/mastodon/components/form_fields/index.ts
+++ b/app/javascript/mastodon/components/form_fields/index.ts
@@ -1,4 +1,5 @@
export { TextInputField } from './text_input_field';
export { TextAreaField } from './text_area_field';
-export { ToggleField, PlainToggleField } from './toggle_field';
+export { CheckboxField, Checkbox } from './checkbox_field';
+export { ToggleField, Toggle } from './toggle_field';
export { SelectField } from './select_field';
diff --git a/app/javascript/mastodon/components/form_fields/select_field.stories.tsx b/app/javascript/mastodon/components/form_fields/select_field.stories.tsx
index 30897adda1f..762436fe287 100644
--- a/app/javascript/mastodon/components/form_fields/select_field.stories.tsx
+++ b/app/javascript/mastodon/components/form_fields/select_field.stories.tsx
@@ -35,6 +35,12 @@ type Story = StoryObj
;
export const Simple: Story = {};
+export const WithoutHint: Story = {
+ args: {
+ hint: undefined,
+ },
+};
+
export const Required: Story = {
args: {
required: true,
diff --git a/app/javascript/mastodon/components/form_fields/select_field.tsx b/app/javascript/mastodon/components/form_fields/select_field.tsx
index aa058fc782e..e612a215b5d 100644
--- a/app/javascript/mastodon/components/form_fields/select_field.tsx
+++ b/app/javascript/mastodon/components/form_fields/select_field.tsx
@@ -1,8 +1,8 @@
import type { ComponentPropsWithoutRef } from 'react';
import { forwardRef } from 'react';
-import { FormFieldWrapper } from './wrapper';
-import type { CommonFieldWrapperProps } from './wrapper';
+import { FormFieldWrapper } from './form_field_wrapper';
+import type { CommonFieldWrapperProps } from './form_field_wrapper';
interface Props
extends ComponentPropsWithoutRef<'select'>, CommonFieldWrapperProps {}
diff --git a/app/javascript/mastodon/components/form_fields/text_area_field.stories.tsx b/app/javascript/mastodon/components/form_fields/text_area_field.stories.tsx
index f06a8a223ad..f4b84409169 100644
--- a/app/javascript/mastodon/components/form_fields/text_area_field.stories.tsx
+++ b/app/javascript/mastodon/components/form_fields/text_area_field.stories.tsx
@@ -25,6 +25,12 @@ type Story = StoryObj;
export const Simple: Story = {};
+export const WithoutHint: Story = {
+ args: {
+ hint: undefined,
+ },
+};
+
export const Required: Story = {
args: {
required: true,
diff --git a/app/javascript/mastodon/components/form_fields/text_area_field.tsx b/app/javascript/mastodon/components/form_fields/text_area_field.tsx
index bfd5ce8a41e..fd514a88e2c 100644
--- a/app/javascript/mastodon/components/form_fields/text_area_field.tsx
+++ b/app/javascript/mastodon/components/form_fields/text_area_field.tsx
@@ -1,8 +1,8 @@
import type { ComponentPropsWithoutRef } from 'react';
import { forwardRef } from 'react';
-import { FormFieldWrapper } from './wrapper';
-import type { CommonFieldWrapperProps } from './wrapper';
+import { FormFieldWrapper } from './form_field_wrapper';
+import type { CommonFieldWrapperProps } from './form_field_wrapper';
interface Props
extends ComponentPropsWithoutRef<'textarea'>, CommonFieldWrapperProps {}
diff --git a/app/javascript/mastodon/components/form_fields/text_input_field.stories.tsx b/app/javascript/mastodon/components/form_fields/text_input_field.stories.tsx
index e1ee57fdf53..ec00ef5fd39 100644
--- a/app/javascript/mastodon/components/form_fields/text_input_field.stories.tsx
+++ b/app/javascript/mastodon/components/form_fields/text_input_field.stories.tsx
@@ -25,6 +25,12 @@ type Story = StoryObj;
export const Simple: Story = {};
+export const WithoutHint: Story = {
+ args: {
+ hint: undefined,
+ },
+};
+
export const Required: Story = {
args: {
required: true,
diff --git a/app/javascript/mastodon/components/form_fields/text_input_field.tsx b/app/javascript/mastodon/components/form_fields/text_input_field.tsx
index 3baafbc57c0..3b2d941173f 100644
--- a/app/javascript/mastodon/components/form_fields/text_input_field.tsx
+++ b/app/javascript/mastodon/components/form_fields/text_input_field.tsx
@@ -1,8 +1,8 @@
import type { ComponentPropsWithoutRef } from 'react';
import { forwardRef } from 'react';
-import { FormFieldWrapper } from './wrapper';
-import type { CommonFieldWrapperProps } from './wrapper';
+import { FormFieldWrapper } from './form_field_wrapper';
+import type { CommonFieldWrapperProps } from './form_field_wrapper';
interface Props
extends ComponentPropsWithoutRef<'input'>, CommonFieldWrapperProps {}
diff --git a/app/javascript/mastodon/components/form_fields/toggle_field.stories.tsx b/app/javascript/mastodon/components/form_fields/toggle_field.stories.tsx
index 260ba4131fc..924c18aa74c 100644
--- a/app/javascript/mastodon/components/form_fields/toggle_field.stories.tsx
+++ b/app/javascript/mastodon/components/form_fields/toggle_field.stories.tsx
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react-vite';
-import { PlainToggleField, ToggleField } from './toggle_field';
+import { Toggle, ToggleField } from './toggle_field';
const meta = {
title: 'Components/Form Fields/ToggleField',
@@ -16,14 +16,6 @@ const meta = {
control: { type: 'range', min: 10, max: 40, step: 1 },
},
},
- render(args) {
- // Component styles require a wrapper class at the moment
- return (
-
-
-
- );
- },
} satisfies Meta;
export default meta;
@@ -32,6 +24,12 @@ type Story = StoryObj;
export const Simple: Story = {};
+export const WithoutHint: Story = {
+ args: {
+ hint: undefined,
+ },
+};
+
export const Required: Story = {
args: {
required: true,
@@ -60,7 +58,7 @@ export const Disabled: Story = {
export const Plain: Story = {
render(props) {
- return ;
+ return ;
},
};
diff --git a/app/javascript/mastodon/components/form_fields/toggle_field.tsx b/app/javascript/mastodon/components/form_fields/toggle_field.tsx
index e14bb54ad12..6cafbcdc360 100644
--- a/app/javascript/mastodon/components/form_fields/toggle_field.tsx
+++ b/app/javascript/mastodon/components/form_fields/toggle_field.tsx
@@ -3,9 +3,9 @@ import { forwardRef } from 'react';
import classNames from 'classnames';
+import type { CommonFieldWrapperProps } from './form_field_wrapper';
+import { FormFieldWrapper } from './form_field_wrapper';
import classes from './toggle.module.css';
-import type { CommonFieldWrapperProps } from './wrapper';
-import { FormFieldWrapper } from './wrapper';
type Props = Omit, 'type'> & {
size?: number;
@@ -21,16 +21,15 @@ export const ToggleField = forwardRef<
required={required}
hasError={hasError}
inputId={id}
+ inputPlacement='inline-end'
>
- {(inputProps) => (
-
- )}
+ {(inputProps) => }
));
ToggleField.displayName = 'ToggleField';
-export const PlainToggleField = forwardRef(
+export const Toggle = forwardRef(
({ className, size, ...otherProps }, ref) => (
(
),
);
-PlainToggleField.displayName = 'PlainToggleField';
+Toggle.displayName = 'Toggle';
diff --git a/app/javascript/mastodon/features/account_timeline/v2/filters.tsx b/app/javascript/mastodon/features/account_timeline/v2/filters.tsx
index 874d653c207..d9adec13fac 100644
--- a/app/javascript/mastodon/features/account_timeline/v2/filters.tsx
+++ b/app/javascript/mastodon/features/account_timeline/v2/filters.tsx
@@ -7,7 +7,7 @@ import { useParams } from 'react-router';
import Overlay from 'react-overlays/esm/Overlay';
-import { PlainToggleField } from '@/mastodon/components/form_fields/toggle_field';
+import { Toggle } from '@/mastodon/components/form_fields';
import { Icon } from '@/mastodon/components/icon';
import KeyboardArrowDownIcon from '@/material-icons/400-24px/keyboard_arrow_down.svg?react';
@@ -119,7 +119,7 @@ const FilterDropdown: FC = () => {
defaultMessage='Show replies'
/>
- {
defaultMessage='Show boosts'
/>
-
-