settings -> dark/light mode

This commit is contained in:
ari committed 2022-08-30 21:50:43 -04:00
1 parent 416d88b965
commit 03a735b281
47 files changed
+867 -736

No files matched your search

@@ -1,58 +1,49 @@
import { ComponentMeta, ComponentStory } from "@storybook/react";
import { Page } from "components/Page";
import { useState } from "react";
import InputTextBubble from "./InputTextBubble";
export default {
title: 'Inputs/InputTextBubble',
component: InputTextBubble,
parameters: { actions: { argTypesRegex: '^on.*' } },
argTypes: {
label: {
defaultValue: 'Sample Title'
}
}
} as ComponentMeta<typeof InputTextBubble>;
import { makeStory } from "devUtils";
const { make, componentMeta } = makeStory({
Component: InputTextBubble,
BaseTemplate: (args) => {
const [value, setValue] = useState<string | string[]>(args.value ?? "");
return (
<div style={{ maxWidth: "200px", overflow: "hidden" }}>
<InputTextBubble {...args} value={value} onChange={setValue} />
</div>
);
},
meta: {
title: "Inputs/InputTextBubble",
argTypes: {
label: {
defaultValue: "Sample Title",
},
},
},
});
export const ArrayText: ComponentStory<typeof InputTextBubble> = args => {
export default componentMeta;
const [value, setValue] = useState<string | string[]>(['wow', 'lots of bubbles', 'itchen', 'bathroom'])
return <Page>
<div style={{ maxWidth: '200px', overflow: 'hidden' }}>
<InputTextBubble {...args} value={value} onChange={setValue} />
</div>
</Page>
}
export const ArrayText = make({
value: ["wow", "lots of bubbles", "itchen", "bathroom"],
});
export const JustText = make({
value: "hello",
});
export const JustText: ComponentStory<typeof InputTextBubble> = args => {
const [value, setValue] = useState<string | string[]>('hello')
return <Page>
<InputTextBubble {...args} value={value} onChange={setValue} />
</Page>
}
export const ManyOptions: ComponentStory<typeof InputTextBubble> = args => {
const [value, setValue] = useState<string | string[]>('hello')
return <Page>
<InputTextBubble {...args} value={value} onChange={setValue} />
</Page>
}
ManyOptions.args = {
...ManyOptions.args,
export const ManyOptions = make({
value: "hello",
options: [
'sensor.humidity_bathroom',
'sensor.humidity_bedroom',
'sensor.humidity_laundry',
'sensor.temp_bathroom',
'sensor.temp_bedroom',
'switch.living_room',
'switch.bathroom',
'light.bedroom_main',
'light.bedroom_second',
]
}
"sensor.humidity_bathroom",
"sensor.humidity_bedroom",
"sensor.humidity_laundry",
"sensor.temp_bathroom",
"sensor.temp_bedroom",
"switch.living_room",
"switch.bathroom",
"light.bedroom_main",
"light.bedroom_second",
],
});