Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

polish numericGestureControl stories

Sultan47273312694f
diff --git a/app/shared/design-system/components/primitives/numericGestureControl.stories.jsx b/app/shared/design-system/components/primitives/numericGestureControl.stories.jsx
index edd3218f0d..2914c288dc 100644
--- a/app/shared/design-system/components/primitives/numericGestureControl.stories.jsx
+++ b/app/shared/design-system/components/primitives/numericGestureControl.stories.jsx
@@ -1,12 +1,10 @@
import {useRef, useEffect} from 'react';
import {numericGestureControl} from './numericGestureControl.js';
-export default { title: 'numericGestureControl' };
-
const useNumericGestureControl = ({ref, value, direction}) => {
useEffect(() => {
const {disconnectedCallback} = numericGestureControl(ref.current, {
- initialValue: value,
+ initialValue: ref.current.value = value,
direction: direction,
onValueChange: (event) => {
event.preventDefault();
@@ -24,5 +22,18 @@ const Input = ({value, direction}) => {
return <input defaultValue={value} ref={ref} />;
}
-export const Horizontal = () => <Input direction="horizontal" value={0} />;
-export const Vertical = () => <Input direction="vertical" value={0} />;
+export const NumericInput = Object.assign(Input.bind({}), {args: { value: 0, direction: 'horizontal' }});
+
+export default {
+ title: 'numericGestureControl',
+ component: Input,
+ argTypes: {
+ value: {
+ control: { type: 'number' },
+ },
+ direction: {
+ options: ['horizontal', 'vertical'],
+ control: { type: 'radio' },
+ },
+ },
+};