UNPKG

@zergo0/react-filerobot-image-editor

Version:

React component version of filerobot image editor (FIE).

1 lines 1.06 kB
import _defineProperty from"@babel/runtime/helpers/defineProperty";import React from"react";import Label from"@scaleflex/ui/core/label";import restrictNumber from"../../../../utils/restrictNumber";import{StyledSpacedOptionFields}from"../../../common/AnnotationOptions/AnnotationOptions.styled";import Slider from"../../../common/Slider";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var MIN_VALUE=0,MAX_VALUE=100,SLIDER_STEP=1,TextSpacingsFields=function(a){var b=a.annotation,c=a.updateAnnotation,d=a.t,e=b.letterSpacing,f=b.lineHeight,g=function(a,b){c(_defineProperty({},a,restrictNumber(b,MIN_VALUE,MAX_VALUE)))};return _jsxs(StyledSpacedOptionFields,{preventFlex:!0,children:[_jsx(Label,{children:d("letterSpacing")}),_jsx(Slider,{annotation:"px",isActive:!!e,onChange:function onChange(a){return g("letterSpacing",a)},value:e,step:SLIDER_STEP}),_jsx(Label,{children:d("lineHeight")}),_jsx(Slider,{annotation:"px",isActive:!!f,onChange:function onChange(a){return g("lineHeight",a)},value:f,step:SLIDER_STEP})]})};export default TextSpacingsFields;