Skip to content

Commit c647a30

Browse files
committed
feat: mark switch as deprecated
1 parent d0ce262 commit c647a30

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

packages/Form/Input/switch/src/Switch.stories.tsx

+10-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import readme from '../README.md';
77
import SwitchItem from './SwitchItem';
88

99
export default {
10-
title: 'Form elements/Radio switch',
10+
title: 'Form elements/Radio switch (Deprecated)',
1111
component: Switch,
1212
parameters: {
1313
readme: {
@@ -40,7 +40,15 @@ const options: Omit<ComponentProps<typeof SwitchItem>, 'onChange'>[] = [
4040

4141
type SwitchProps = ComponentProps<typeof Switch>;
4242

43-
export const SwitchStory: Story<SwitchProps> = (args) => <Switch {...args} />;
43+
export const SwitchStory: Story<SwitchProps> = (args) => (
44+
<>
45+
<p>
46+
Deprecated: This component is no longer maintained and shouldn't be used.
47+
It will be removed in the next version.
48+
</p>
49+
<Switch {...args} />
50+
</>
51+
);
4452
SwitchStory.storyName = 'Switch';
4553
SwitchStory.args = {
4654
name: 'Form.SwitchInput',

packages/Form/Input/switch/src/Switch.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ type Props = Omit<SwitchItemProps, keyof Pick<Option, 'id' | 'label'>> & {
1616
options: SwitchOptions[];
1717
};
1818

19+
/**
20+
* @deprecated This component is no longer maintained and shouldn't be used. It will be removed in the next version.
21+
*/
1922
const Switch = ({ value, options, onChange, ...otherProps }: Props) => {
2023
const [selectedValue, setSelectedValue] = useState(value);
2124
const [sliderStyle, setSliderStyle] = useState<CSSProperties>({

packages/Form/Input/switch/src/SwitchInput.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ type Props = ComponentPropsWithoutRef<typeof Field> &
1515
disabled?: Boolean;
1616
};
1717

18+
/**
19+
* @deprecated This component is no longer maintained and shouldn't be used. It will be removed in the next version.
20+
*/
1821
const SwitchInput = ({
1922
classModifier,
2023
message,

0 commit comments

Comments
 (0)