-
-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add CircularProgress & TextArea & DividerPanel
- Loading branch information
Showing
12 changed files
with
200 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/components/editor/previews/CircularProgressPreview.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from "react"; | ||
import { CircularProgress } from "@chakra-ui/core"; | ||
import { useInteractive } from "../../../hooks/useInteractive"; | ||
|
||
const CircularProgressPreview: React.FC<{ component: IComponent }> = ({ | ||
component | ||
}) => { | ||
const { props, ref } = useInteractive(component); | ||
return <CircularProgress ref={ref} {...props} />; | ||
}; | ||
|
||
export default CircularProgressPreview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from "react"; | ||
import { Textarea } from "@chakra-ui/core"; | ||
import { useInteractive } from "../../../hooks/useInteractive"; | ||
|
||
const TextAreaPreview: React.FC<{ component: IComponent }> = ({ | ||
component | ||
}) => { | ||
const { props, ref } = useInteractive(component); | ||
return <Textarea ref={ref} {...props} />; | ||
}; | ||
|
||
export default TextAreaPreview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import React from "react"; | ||
import { | ||
Input, | ||
Slider, | ||
SliderTrack, | ||
SliderFilledTrack, | ||
SliderThumb, | ||
Switch | ||
} from "@chakra-ui/core"; | ||
import FormControl from "../controls/FormControl"; | ||
import { useForm } from "../../../hooks/useForm"; | ||
import ColorsControl from "../controls/ColorsControl"; | ||
|
||
const CircularProgressPanel = () => { | ||
const { values, setValueFromEvent, setValue } = useForm(); | ||
|
||
return ( | ||
<> | ||
<FormControl label="Valeur"> | ||
<Input | ||
size="sm" | ||
value={values.value || "75"} | ||
type="text" | ||
name="value" | ||
onChange={setValueFromEvent} | ||
/> | ||
</FormControl> | ||
<FormControl label="Size"> | ||
<Input | ||
size="sm" | ||
value={values.size || "50px"} | ||
type="text" | ||
name="size" | ||
onChange={setValueFromEvent} | ||
/> | ||
</FormControl> | ||
|
||
<FormControl label="Thickness"> | ||
<Slider | ||
onChange={value => setValue("thickness", value)} | ||
min={0.1} | ||
max={1} | ||
step={0.1} | ||
defaultValue={values.thickness} | ||
> | ||
<SliderTrack /> | ||
<SliderFilledTrack /> | ||
<SliderThumb /> | ||
</Slider> | ||
</FormControl> | ||
|
||
<ColorsControl label="Color" name="color" value={values.color} /> | ||
|
||
<FormControl label="Loading" htmlFor="isIndeterminate"> | ||
<Switch | ||
name="isIndeterminate" | ||
id="isIndeterminate" | ||
size="sm" | ||
isChecked={values.isIndeterminate || false} | ||
onChange={() => setValue("isIndeterminate", !values.isIndeterminate)} | ||
/> | ||
</FormControl> | ||
</> | ||
); | ||
}; | ||
|
||
export default CircularProgressPanel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React from "react"; | ||
import { Input, Select } from "@chakra-ui/core"; | ||
import FormControl from "../controls/FormControl"; | ||
import { useForm } from "../../../hooks/useForm"; | ||
import SizeControl from "../controls/SizeControl"; | ||
|
||
const TextAreaPanel = () => { | ||
const { values, setValueFromEvent } = useForm(); | ||
|
||
return ( | ||
<> | ||
<FormControl label="Valeur"> | ||
<Input | ||
size="sm" | ||
value={values.value || ""} | ||
type="text" | ||
name="value" | ||
onChange={setValueFromEvent} | ||
/> | ||
</FormControl> | ||
<FormControl label="Placeholder"> | ||
<Input | ||
size="sm" | ||
value={values.placeholder || ""} | ||
type="text" | ||
name="placeholder" | ||
onChange={setValueFromEvent} | ||
/> | ||
</FormControl> | ||
<SizeControl name="size" label="Size" value={values.size} /> | ||
<FormControl label="Resize" htmlFor="resize"> | ||
<Select | ||
name="resize" | ||
id="size" | ||
size="sm" | ||
value={values.resize || ""} | ||
onChange={setValueFromEvent} | ||
> | ||
<option>horizontal</option> | ||
<option>vertical</option> | ||
<option>none</option> | ||
</Select> | ||
</FormControl> | ||
</> | ||
); | ||
}; | ||
|
||
export default TextAreaPanel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters