mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 05:19:49 +00:00
Add eslint rule and fix as many issues as possible
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import type { Meta, StoryObj } from "@storybook/react";
|
||||
|
||||
import { Switch } from './Switch';
|
||||
import { Switch } from "./Switch";
|
||||
|
||||
const meta: Meta<typeof Switch> = {
|
||||
title: 'Components/Switch',
|
||||
title: "Components/Switch",
|
||||
component: Switch,
|
||||
tags: ['v2'],
|
||||
tags: ["v2"],
|
||||
argTypes: {}
|
||||
};
|
||||
|
||||
@@ -15,20 +15,20 @@ type Story = StoryObj<typeof Switch>;
|
||||
// More on writing stories with args: https://storybook.js.org/docs/7.0/react/writing-stories/args
|
||||
export const Simple: Story = {
|
||||
args: {
|
||||
children: 'Dark mode'
|
||||
children: "Dark mode"
|
||||
}
|
||||
};
|
||||
|
||||
export const Disabled: Story = {
|
||||
args: {
|
||||
children: 'Dark mode',
|
||||
children: "Dark mode",
|
||||
isDisabled: true
|
||||
}
|
||||
};
|
||||
|
||||
export const Required: Story = {
|
||||
args: {
|
||||
children: 'Dark mode',
|
||||
children: "Dark mode",
|
||||
isRequired: true
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ReactNode } from 'react';
|
||||
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
import { ReactNode } from "react";
|
||||
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
export type SwitchProps = Omit<SwitchPrimitive.SwitchProps, 'checked' | 'disabled' | 'required'> & {
|
||||
export type SwitchProps = Omit<SwitchPrimitive.SwitchProps, "checked" | "disabled" | "required"> & {
|
||||
children: ReactNode;
|
||||
id: string;
|
||||
isChecked?: boolean;
|
||||
@@ -30,8 +30,8 @@ export const Switch = ({
|
||||
checked={isChecked}
|
||||
disabled={isDisabled}
|
||||
className={twMerge(
|
||||
'ml-3 h-5 w-9 rounded-full bg-bunker-300 transition-all data-[state=checked]:bg-primary',
|
||||
isDisabled && 'bg-bunker-400 hover:bg-bunker-400',
|
||||
"ml-3 h-5 w-9 rounded-full bg-bunker-300 transition-all data-[state=checked]:bg-primary",
|
||||
isDisabled && "bg-bunker-400 hover:bg-bunker-400",
|
||||
className
|
||||
)}
|
||||
id={id}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export type { SwitchProps } from './Switch';
|
||||
export { Switch } from './Switch';
|
||||
export type { SwitchProps } from "./Switch";
|
||||
export { Switch } from "./Switch";
|
||||
|
||||
Reference in New Issue
Block a user