()
| 31 | }; |
| 32 | |
| 33 | const TextTypeDemo = () => { |
| 34 | const [key, forceRerender] = useForceRerender(); |
| 35 | const { props, updateProp, resetProps, hasChanges } = useComponentProps(DEFAULT_PROPS); |
| 36 | const { |
| 37 | texts, |
| 38 | typingSpeed, |
| 39 | pauseDuration, |
| 40 | deletingSpeed, |
| 41 | showCursor, |
| 42 | cursorCharacter, |
| 43 | variableSpeedEnabled, |
| 44 | variableSpeedMin, |
| 45 | variableSpeedMax, |
| 46 | cursorBlinkDuration |
| 47 | } = props; |
| 48 | |
| 49 | const cursorOptions = [ |
| 50 | { value: '_', label: 'Underscore (_)' }, |
| 51 | { value: '|', label: 'Pipe (|)' }, |
| 52 | { value: '▎', label: 'Block (▎)' }, |
| 53 | { value: '●', label: 'Dot (●)' }, |
| 54 | { value: '█', label: 'Full Block (█)' } |
| 55 | ]; |
| 56 | |
| 57 | const propData = useMemo( |
| 58 | () => [ |
| 59 | { |
| 60 | name: 'text', |
| 61 | type: 'string | string[]', |
| 62 | default: '-', |
| 63 | description: 'Text or array of texts to type out' |
| 64 | }, |
| 65 | { |
| 66 | name: 'as', |
| 67 | type: 'ElementType', |
| 68 | default: 'div', |
| 69 | description: 'HTML tag to render the component as' |
| 70 | }, |
| 71 | { |
| 72 | name: 'typingSpeed', |
| 73 | type: 'number', |
| 74 | default: '50', |
| 75 | description: 'Speed of typing in milliseconds' |
| 76 | }, |
| 77 | { |
| 78 | name: 'initialDelay', |
| 79 | type: 'number', |
| 80 | default: '0', |
| 81 | description: 'Initial delay before typing starts' |
| 82 | }, |
| 83 | { |
| 84 | name: 'pauseDuration', |
| 85 | type: 'number', |
| 86 | default: '2000', |
| 87 | description: 'Time to wait between typing and deleting' |
| 88 | }, |
| 89 | { |
| 90 | name: 'deletingSpeed', |
nothing calls this directly
no test coverage detected