diff --git a/src/components/GenericLabel/GenericLabel.tsx b/src/components/GenericLabel/GenericLabel.tsx index dcfcf900..9bb09535 100644 --- a/src/components/GenericLabel/GenericLabel.tsx +++ b/src/components/GenericLabel/GenericLabel.tsx @@ -18,8 +18,10 @@ const FormFieldLabel = styled.label` ? ` color: ${theme.click.field.color.genericLabel.disabled}; font: ${theme.click.field.typography.genericLabel.disabled}; + cursor: not-allowed; ` : ` + cursor: pointer; color: ${theme.click.field.color.genericLabel.default}; font: ${theme.click.field.typography.genericLabel.default}; &:hover { diff --git a/src/components/Switch/Switch.stories.ts b/src/components/Switch/Switch.stories.ts deleted file mode 100644 index ab500a5d..00000000 --- a/src/components/Switch/Switch.stories.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Switch } from "./Switch"; - -export default { - component: Switch, - title: "Forms/Switch", - tags: ["switch", "autodocs"], - argTypes: { - orientation: { control: "inline-radio", options: ["horizontal", "vertical"] }, - dir: { control: "inline-radio", options: ["start", "end"] }, - }, -}; - -export const Playground = { - args: { - checked: true, - disabled: false, - label: "Switch label", - }, -}; diff --git a/src/components/Switch/Switch.stories.tsx b/src/components/Switch/Switch.stories.tsx new file mode 100644 index 00000000..e429e71c --- /dev/null +++ b/src/components/Switch/Switch.stories.tsx @@ -0,0 +1,35 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import { Switch } from "./Switch"; +import { useState } from "react"; + +const meta: Meta = { + component: Switch, + title: "Forms/Switch", + tags: ["switch", "autodocs"], + argTypes: { + orientation: { control: "inline-radio", options: ["horizontal", "vertical"] }, + dir: { control: "inline-radio", options: ["start", "end"] }, + }, +}; + +export default meta; +type Story = StoryObj; + +export const Playground: Story = { + render: args => { + const [isChecked, setIsChecked] = useState(args.checked); + + return ( + + ); + }, + args: { + checked: true, + disabled: false, + label: "Switch label", + }, +}; diff --git a/src/components/Switch/Switch.tsx b/src/components/Switch/Switch.tsx index 775da7ac..05962d30 100644 --- a/src/components/Switch/Switch.tsx +++ b/src/components/Switch/Switch.tsx @@ -116,6 +116,7 @@ const SwitchRoot = styled(RadixSwitch.Root)(props => { borderRadius: props.theme.click.switch.radii.all, position: "relative", padding: 0, + cursor: props.disabled ? "not-allowed" : "pointer", }; });