@ertekinno/human-like
Version:
A sophisticated React typewriter effect library with realistic human typing behavior, mobile/desktop keyboards, and comprehensive theming support
3 lines (2 loc) • 1.24 kB
JavaScript
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./useHumanLike-BFxeOC2S.cjs"),a=({text:a,speed:r=80,mistakeFrequency:t=.03,showCursor:o=!0,cursorChar:n="|",cursorBlinkSpeed:i=530,autoStart:u=!0,config:c={},id:p,onStart:d,onComplete:m,onChar:l,onMistake:y,onBackspace:k,onPause:S,onResume:h,keyboardMode:C,onKey:T,className:x,style:g,...N})=>{const H={speed:r,mistakeFrequency:t,...c},{displayText:M,showCursor:A,cursorChar:B,isTyping:E,isCompleted:I,currentState:L}=s.useHumanLike({text:a,config:H,autoStart:u,showCursor:o,cursorChar:n,cursorBlinkSpeed:i,id:p,onStart:d,onComplete:m,onChar:l,onMistake:y,onBackspace:k,onPause:S,onResume:h,keyboardMode:C,onKey:T}),R=g;return e.jsxs("span",{className:`human-like-typewriter ${x||""}`,style:R,"data-typing":E,"data-completed":I,"data-state":L,"data-id":p,...N,children:[M,A&&e.jsx("span",{className:"human-like-cursor",style:{opacity:1},"aria-hidden":"true",children:B})]})};a.displayName="HumanLike",exports.BEHAVIOR_RATES=s.BEHAVIOR_RATES,exports.TIMING_CONSTANTS=s.TIMING_CONSTANTS,exports.TypingEngine=s.TypingEngine,exports.useHumanLike=s.useHumanLike,exports.HumanLike=a;
//# sourceMappingURL=index.js.map