settings -> dark/light mode
This commit is contained in:
1 parent
416d88b965
commit
03a735b281
47 files changed
+867
-736
No files matched your search
@@ -4,24 +4,30 @@ import { useState } from "react";
|
||||
|
||||
import InputBoolean from "./InputBoolean";
|
||||
|
||||
export default {
|
||||
title: 'Inputs/InputBoolean',
|
||||
component: InputBoolean,
|
||||
parameters: { actions: { argTypesRegex: '^on.*' } },
|
||||
} as ComponentMeta<typeof InputBoolean>;
|
||||
import { makeStory } from "devUtils";
|
||||
|
||||
const { make, componentMeta } = makeStory({
|
||||
Component: InputBoolean,
|
||||
meta: {
|
||||
title: "Inputs/InputBoolean",
|
||||
args: {
|
||||
label: "Template",
|
||||
},
|
||||
},
|
||||
BaseTemplate: (args) => {
|
||||
const [state, onChange] = useState(args.value);
|
||||
return (
|
||||
<InputBoolean
|
||||
{...args}
|
||||
value={state}
|
||||
onChange={(v) => {
|
||||
args.onChange(v);
|
||||
onChange(v);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
const Template: ComponentStory<typeof InputBoolean> = args => {
|
||||
const [state, onChange] = useState(args.value)
|
||||
return <Page>
|
||||
<InputBoolean {...args} value={state} onChange={v => {
|
||||
args.onChange(v)
|
||||
onChange(v)
|
||||
}} />
|
||||
</Page>
|
||||
}
|
||||
|
||||
export const SimpleText = Template.bind({})
|
||||
SimpleText.args = {
|
||||
label: "Template",
|
||||
}
|
||||
export default componentMeta;
|
||||
export const Example = make({});
|
||||
@@ -1,32 +1,31 @@
|
||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
||||
import { Page } from "components/Page";
|
||||
import { useState } from "react";
|
||||
|
||||
import InputNumber from "./InputNumber";
|
||||
|
||||
export default {
|
||||
title: 'Inputs/InputNumber',
|
||||
component: InputNumber,
|
||||
parameters: { actions: { argTypesRegex: '^on.*' } },
|
||||
argTypes: {
|
||||
label: {
|
||||
defaultValue: 'Sample Title'
|
||||
}
|
||||
}
|
||||
} as ComponentMeta<typeof InputNumber>;
|
||||
import { makeStory } from "devUtils";
|
||||
|
||||
const { make, componentMeta } = makeStory({
|
||||
Component: InputNumber,
|
||||
meta: {
|
||||
title: "Inputs/InputNumber",
|
||||
argTypes: {
|
||||
label: {
|
||||
defaultValue: "Sample Title",
|
||||
},
|
||||
},
|
||||
},
|
||||
BaseTemplate: (args) => {
|
||||
const [value, setValue] = useState<number | undefined>(args.value);
|
||||
return <InputNumber {...args} value={value} onChange={setValue} />;
|
||||
},
|
||||
});
|
||||
|
||||
export const NullStart: ComponentStory<typeof InputNumber> = args => {
|
||||
export default componentMeta;
|
||||
|
||||
const [value, setValue] = useState<number | undefined>(undefined)
|
||||
return <Page>
|
||||
<InputNumber {...args} value={value} onChange={setValue} />
|
||||
</Page>
|
||||
}
|
||||
export const SomeStuffAtStart: ComponentStory<typeof InputNumber> = args => {
|
||||
export const NullStart = make({
|
||||
value: undefined,
|
||||
});
|
||||
|
||||
const [value, setValue] = useState<number | undefined>(10)
|
||||
return <Page>
|
||||
<InputNumber {...args} value={value} onChange={setValue} />
|
||||
</Page>
|
||||
}
|
||||
export const SomeStuffAtStart = make({
|
||||
value: 10,
|
||||
});
|
||||
@@ -4,22 +4,21 @@ import { useState } from "react";
|
||||
|
||||
import InputText from "./InputText";
|
||||
|
||||
export default {
|
||||
title: 'Inputs/InputText',
|
||||
component: InputText,
|
||||
parameters: { actions: { argTypesRegex: '^on.*' } },
|
||||
} as ComponentMeta<typeof InputText>;
|
||||
import { makeStory } from "devUtils";
|
||||
|
||||
const { make, componentMeta } = makeStory({
|
||||
Component: InputText,
|
||||
meta: {
|
||||
title: "Inputs/InputText",
|
||||
},
|
||||
BaseTemplate: (args) => {
|
||||
const [value, setValue] = useState("");
|
||||
return <InputText {...args} value={value} onChange={setValue} />;
|
||||
},
|
||||
});
|
||||
|
||||
const Template: ComponentStory<typeof InputText> = args => {
|
||||
export default componentMeta;
|
||||
|
||||
const [value, setValue] = useState('')
|
||||
return <Page>
|
||||
<InputText {...args} value={value} onChange={setValue} />
|
||||
</Page>
|
||||
}
|
||||
|
||||
export const SimpleText = Template.bind({})
|
||||
SimpleText.args = {
|
||||
export const SimpleText = make({
|
||||
label: "Entity ID",
|
||||
}
|
||||
});
|
||||
@@ -1,20 +1,15 @@
|
||||
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
||||
import { Page } from "components/Page";
|
||||
import { useState } from "react";
|
||||
import { AutomationTime } from "types/automations/common";
|
||||
|
||||
import { InputTime } from "./InputTime";
|
||||
|
||||
export default {
|
||||
title: "Inputs/InputTime",
|
||||
component: InputTime,
|
||||
parameters: { actions: { argTypesRegex: "^on.*" } },
|
||||
} as ComponentMeta<typeof InputTime>;
|
||||
import { makeStory } from "devUtils";
|
||||
|
||||
const Template: ComponentStory<typeof InputTime> = (args) => {
|
||||
const [value, setValue] = useState<AutomationTime | undefined>(undefined);
|
||||
return (
|
||||
<Page>
|
||||
const { make, componentMeta } = makeStory({
|
||||
Component: InputTime,
|
||||
BaseTemplate: (args) => {
|
||||
const [value, setValue] = useState<AutomationTime | undefined>(undefined);
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
padding: "1em",
|
||||
@@ -29,12 +24,17 @@ const Template: ComponentStory<typeof InputTime> = (args) => {
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
};
|
||||
);
|
||||
},
|
||||
meta: {
|
||||
title: "Inputs/InputTime",
|
||||
},
|
||||
});
|
||||
|
||||
export const SimpleText = Template.bind({});
|
||||
SimpleText.args = {
|
||||
export default componentMeta;
|
||||
export const Example = make({});
|
||||
|
||||
export const SimpleText = make({
|
||||
label: "Time Stamp",
|
||||
value: "10",
|
||||
};
|
||||
});
|
||||
@@ -4,24 +4,24 @@ import { useState } from "react";
|
||||
|
||||
import InputYaml from "./InputYaml";
|
||||
|
||||
export default {
|
||||
title: 'Inputs/InputYaml',
|
||||
component: InputYaml,
|
||||
parameters: { actions: { argTypesRegex: '^on.*' } },
|
||||
} as ComponentMeta<typeof InputYaml>;
|
||||
import { makeStory } from "devUtils";
|
||||
|
||||
const { make, componentMeta } = makeStory({
|
||||
Component: InputYaml,
|
||||
BaseTemplate: (args) => {
|
||||
const [value, setValue] = useState({
|
||||
test: "data",
|
||||
});
|
||||
return <InputYaml {...args} value={value} onChange={setValue} />;
|
||||
},
|
||||
meta: {
|
||||
title: "Inputs/InputYaml",
|
||||
},
|
||||
});
|
||||
|
||||
const Template: ComponentStory<typeof InputYaml> = args => {
|
||||
export default componentMeta;
|
||||
export const Example = make({});
|
||||
|
||||
const [value, setValue] = useState({
|
||||
"test": "data"
|
||||
})
|
||||
return <Page>
|
||||
<InputYaml {...args} value={value} onChange={setValue} />
|
||||
</Page>
|
||||
}
|
||||
|
||||
export const SimpleText = Template.bind({})
|
||||
SimpleText.args = {
|
||||
export const SimpleText = make({
|
||||
label: "Template",
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user