feat: Add theme switch

This commit is contained in:
deytenit committed 2026-02-15 15:36:31 +03:00
1 parent 891027cab0
commit 2d1bc9d119
38 files changed
+1724 -218

No files matched your search

@@ -0,0 +1,45 @@
import React, { useState } from 'react';
import { Switch } from './Switch';
import type { Meta, StoryObj } from '@storybook/react';
const meta: Meta<typeof Switch> = {
title: 'Components/Switch',
component: Switch,
tags: ['autodocs'],
};
export default meta;
type Story = StoryObj<typeof Switch>;
export const Default: Story = {
args: {
children: 'Label',
},
};
export const Selected: Story = {
args: {
children: 'Selected State',
isSelected: true,
},
};
export const Disabled: Story = {
args: {
children: 'Disabled State',
isDisabled: true,
},
};
export const Controlled: Story = {
render: function ControlledStory() {
const [isSelected, setSelected] = useState(false);
return (
<Switch isSelected={isSelected} onChange={setSelected}>
{isSelected ? 'On' : 'Off'}
</Switch>
);
},
};