@uibit/text-typing 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,68 +1,82 @@
1
1
  import { Component, ChangeDetectionStrategy, ElementRef, input, effect, output, booleanAttribute, numberAttribute } from '@angular/core';
2
2
  import '@uibit/text-typing';
3
3
  import type { TextTyping as HTMLElementClass } from '@uibit/text-typing';
4
-
5
4
  @Component({
6
- selector: 'uibit-text-typing',
7
- template: '<ng-content></ng-content>',
8
- changeDetection: ChangeDetectionStrategy.OnPush,
9
- standalone: true,
10
- host: {
11
- '(phrase-change)': 'phraseChange.emit($event)'
12
- }
5
+ selector: 'uibit-text-typing',
6
+ template: '<ng-content></ng-content>',
7
+ changeDetection: ChangeDetectionStrategy.OnPush,
8
+ standalone: true,
9
+ host: {
10
+ '(phrase-change)': 'phraseChange.emit($event)'
11
+ }
13
12
  })
14
13
  export class NgxTextTyping {
15
- constructor(private el: ElementRef<HTMLElementClass>) {
16
- effect(() => {
17
- if (this.el.nativeElement) {
18
- this.el.nativeElement.typeSpeed = this.typeSpeed();
19
- }
14
+ constructor(private el: ElementRef<HTMLElementClass>){
15
+ effect(()=>{
16
+ if (this.el.nativeElement) {
17
+ this.el.nativeElement.typeSpeed = this.typeSpeed();
18
+ }
19
+ });
20
+ effect(()=>{
21
+ if (this.el.nativeElement) {
22
+ this.el.nativeElement.deleteSpeed = this.deleteSpeed();
23
+ }
24
+ });
25
+ effect(()=>{
26
+ if (this.el.nativeElement) {
27
+ this.el.nativeElement.pauseAfter = this.pauseAfter();
28
+ }
29
+ });
30
+ effect(()=>{
31
+ if (this.el.nativeElement) {
32
+ this.el.nativeElement.pauseBefore = this.pauseBefore();
33
+ }
34
+ });
35
+ effect(()=>{
36
+ if (this.el.nativeElement) {
37
+ this.el.nativeElement.typoRate = this.typoRate();
38
+ }
39
+ });
40
+ effect(()=>{
41
+ if (this.el.nativeElement) {
42
+ this.el.nativeElement.showCursor = this.showCursor();
43
+ }
44
+ });
45
+ effect(()=>{
46
+ if (this.el.nativeElement) {
47
+ this.el.nativeElement.loop = this.loop();
48
+ }
49
+ });
50
+ effect(()=>{
51
+ if (this.el.nativeElement) {
52
+ this.el.nativeElement.locale = this.locale();
53
+ }
54
+ });
55
+ }
56
+ readonly typeSpeed = input<number, any>(80, {
57
+ transform: numberAttribute
20
58
  });
21
- effect(() => {
22
- if (this.el.nativeElement) {
23
- this.el.nativeElement.deleteSpeed = this.deleteSpeed();
24
- }
59
+ readonly deleteSpeed = input<number, any>(40, {
60
+ transform: numberAttribute
25
61
  });
26
- effect(() => {
27
- if (this.el.nativeElement) {
28
- this.el.nativeElement.pauseAfter = this.pauseAfter();
29
- }
62
+ readonly pauseAfter = input<number, any>(1800, {
63
+ transform: numberAttribute
30
64
  });
31
- effect(() => {
32
- if (this.el.nativeElement) {
33
- this.el.nativeElement.pauseBefore = this.pauseBefore();
34
- }
65
+ readonly pauseBefore = input<number, any>(400, {
66
+ transform: numberAttribute
35
67
  });
36
- effect(() => {
37
- if (this.el.nativeElement) {
38
- this.el.nativeElement.typoRate = this.typoRate();
39
- }
68
+ readonly typoRate = input<number, any>(0.04, {
69
+ transform: numberAttribute
40
70
  });
41
- effect(() => {
42
- if (this.el.nativeElement) {
43
- this.el.nativeElement.showCursor = this.showCursor();
44
- }
71
+ readonly showCursor = input<boolean, any>(true, {
72
+ transform: booleanAttribute
45
73
  });
46
- effect(() => {
47
- if (this.el.nativeElement) {
48
- this.el.nativeElement.loop = this.loop();
49
- }
74
+ readonly loop = input<boolean, any>(true, {
75
+ transform: booleanAttribute
50
76
  });
51
- effect(() => {
52
- if (this.el.nativeElement) {
53
- this.el.nativeElement.locale = this.locale();
54
- }
55
- });
56
- }
57
-
58
- readonly typeSpeed = input<number, any>(80, { transform: numberAttribute });
59
- readonly deleteSpeed = input<number, any>(40, { transform: numberAttribute });
60
- readonly pauseAfter = input<number, any>(1800, { transform: numberAttribute });
61
- readonly pauseBefore = input<number, any>(400, { transform: numberAttribute });
62
- readonly typoRate = input<number, any>(0.04, { transform: numberAttribute });
63
- readonly showCursor = input<boolean, any>(true, { transform: booleanAttribute });
64
- readonly loop = input<boolean, any>(true, { transform: booleanAttribute });
65
- readonly locale = input<string, any>('');
66
-
67
- readonly phraseChange = output<CustomEvent<{ phrase: string, index: number }>>();
77
+ readonly locale = input<string>('');
78
+ readonly phraseChange = output<CustomEvent<{
79
+ phrase: string;
80
+ index: number;
81
+ }>>();
68
82
  }
@@ -4,7 +4,17 @@ import '@uibit/text-typing';
4
4
  declare global {
5
5
  namespace astroHTML.JSX {
6
6
  interface IntrinsicElements {
7
- 'uibit-text-typing': Partial<HTMLElementClass> & astroHTML.JSX.HTMLAttributes;
7
+ 'uibit-text-typing': Partial<HTMLElementClass> & astroHTML.JSX.HTMLAttributes & {
8
+ typeSpeed?: number;
9
+ deleteSpeed?: number;
10
+ pauseAfter?: number;
11
+ pauseBefore?: number;
12
+ typoRate?: number;
13
+ showCursor?: boolean;
14
+ loop?: boolean;
15
+ locale?: string;
16
+ "on:phrase-change"?: (event: CustomEvent<{ phrase: string, index: number }>) => void;
17
+ };
8
18
  }
9
19
  }
10
20
  }
@@ -14,6 +14,8 @@ declare module 'preact' {
14
14
  showCursor?: boolean;
15
15
  loop?: boolean;
16
16
  locale?: string;
17
+ onPhraseChange?: (event: CustomEvent<{ phrase: string, index: number }>) => void;
18
+ "on:phrase-change"?: (event: CustomEvent<{ phrase: string, index: number }>) => void;
17
19
  };
18
20
  }
19
21
  }
@@ -0,0 +1,149 @@
1
+ import React, { useRef, useEffect, useLayoutEffect, useImperativeHandle } from 'react';
2
+ import type { TextTyping as HTMLElementClass } from '@uibit/text-typing';
3
+ import '@uibit/text-typing';
4
+ const useTypeOfLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
5
+ export interface TextTypingProps extends Omit<React.HTMLAttributes<HTMLElementClass>, 'typeSpeed' | 'deleteSpeed' | 'pauseAfter' | 'pauseBefore' | 'typoRate' | 'showCursor' | 'loop' | 'locale' | 'onPhraseChange'> {
6
+ children?: React.ReactNode;
7
+ typeSpeed?: number;
8
+ deleteSpeed?: number;
9
+ pauseAfter?: number;
10
+ pauseBefore?: number;
11
+ typoRate?: number;
12
+ showCursor?: boolean;
13
+ loop?: boolean;
14
+ locale?: string;
15
+ onPhraseChange?: (event: CustomEvent<{
16
+ phrase: string;
17
+ index: number;
18
+ }>) => void;
19
+ }
20
+ export const TextTyping = ({ ref, children, ...props }: TextTypingProps & {
21
+ ref?: React.Ref<HTMLElementClass>;
22
+ })=>{
23
+ const innerRef = useRef<HTMLElementClass>(null);
24
+ const propsRef = useRef(props);
25
+ propsRef.current = props;
26
+ useImperativeHandle(ref, ()=>innerRef.current!);
27
+ useTypeOfLayoutEffect(()=>{
28
+ const element = innerRef.current;
29
+ if (element && props.typeSpeed !== undefined) {
30
+ (element as any).typeSpeed = props.typeSpeed;
31
+ }
32
+ }, [
33
+ props.typeSpeed
34
+ ]);
35
+ useTypeOfLayoutEffect(()=>{
36
+ const element = innerRef.current;
37
+ if (element && props.deleteSpeed !== undefined) {
38
+ (element as any).deleteSpeed = props.deleteSpeed;
39
+ }
40
+ }, [
41
+ props.deleteSpeed
42
+ ]);
43
+ useTypeOfLayoutEffect(()=>{
44
+ const element = innerRef.current;
45
+ if (element && props.pauseAfter !== undefined) {
46
+ (element as any).pauseAfter = props.pauseAfter;
47
+ }
48
+ }, [
49
+ props.pauseAfter
50
+ ]);
51
+ useTypeOfLayoutEffect(()=>{
52
+ const element = innerRef.current;
53
+ if (element && props.pauseBefore !== undefined) {
54
+ (element as any).pauseBefore = props.pauseBefore;
55
+ }
56
+ }, [
57
+ props.pauseBefore
58
+ ]);
59
+ useTypeOfLayoutEffect(()=>{
60
+ const element = innerRef.current;
61
+ if (element && props.typoRate !== undefined) {
62
+ (element as any).typoRate = props.typoRate;
63
+ }
64
+ }, [
65
+ props.typoRate
66
+ ]);
67
+ useTypeOfLayoutEffect(()=>{
68
+ const element = innerRef.current;
69
+ if (element && props.showCursor !== undefined) {
70
+ (element as any).showCursor = props.showCursor;
71
+ }
72
+ }, [
73
+ props.showCursor
74
+ ]);
75
+ useTypeOfLayoutEffect(()=>{
76
+ const element = innerRef.current;
77
+ if (element && props.loop !== undefined) {
78
+ (element as any).loop = props.loop;
79
+ }
80
+ }, [
81
+ props.loop
82
+ ]);
83
+ useTypeOfLayoutEffect(()=>{
84
+ const element = innerRef.current;
85
+ if (element && props.locale !== undefined) {
86
+ (element as any).locale = props.locale;
87
+ }
88
+ }, [
89
+ props.locale
90
+ ]);
91
+ useTypeOfLayoutEffect(()=>{
92
+ const element = innerRef.current;
93
+ if (!element) return;
94
+ const handleEvent = (event: Event)=>{
95
+ if (propsRef.current.onPhraseChange) {
96
+ propsRef.current.onPhraseChange(event as any);
97
+ }
98
+ };
99
+ element.addEventListener('phrase-change', handleEvent);
100
+ return ()=>{
101
+ element.removeEventListener('phrase-change', handleEvent);
102
+ };
103
+ }, []);
104
+ const domProps = {
105
+ ...props
106
+ };
107
+ const customPropNames = [
108
+ 'typeSpeed',
109
+ 'deleteSpeed',
110
+ 'pauseAfter',
111
+ 'pauseBefore',
112
+ 'typoRate',
113
+ 'showCursor',
114
+ 'loop',
115
+ 'locale',
116
+ 'onPhraseChange'
117
+ ];
118
+ for (const key of customPropNames){
119
+ delete (domProps as any)[key];
120
+ }
121
+ return React.createElement('uibit-text-typing', {
122
+ ref: innerRef,
123
+ ...domProps
124
+ }, children);
125
+ };
126
+ declare global {
127
+ namespace React {
128
+ namespace JSX {
129
+ interface IntrinsicElements {
130
+ 'uibit-text-typing': React.ClassAttributes<HTMLElementClass> & React.HTMLAttributes<HTMLElementClass> & {
131
+ children?: React.ReactNode;
132
+ class?: string;
133
+ typeSpeed?: number;
134
+ deleteSpeed?: number;
135
+ pauseAfter?: number;
136
+ pauseBefore?: number;
137
+ typoRate?: number;
138
+ showCursor?: boolean;
139
+ loop?: boolean;
140
+ locale?: string;
141
+ onPhraseChange?: (event: CustomEvent<{
142
+ phrase: string;
143
+ index: number;
144
+ }>) => void;
145
+ };
146
+ }
147
+ }
148
+ }
149
+ }
@@ -14,7 +14,7 @@ declare module 'solid-js' {
14
14
  showCursor?: boolean;
15
15
  loop?: boolean;
16
16
  locale?: string;
17
- "on:phrase-change"?: (event: CustomEvent) => void;
17
+ "on:phrase-change"?: (event: CustomEvent<{ phrase: string, index: number }>) => void;
18
18
  };
19
19
  }
20
20
  }
@@ -13,6 +13,8 @@ declare module '@stencil/core' {
13
13
  showCursor?: boolean;
14
14
  loop?: boolean;
15
15
  locale?: string;
16
+ onPhraseChange?: (event: CustomEvent<{ phrase: string, index: number }>) => void;
17
+ "on:phrase-change"?: (event: CustomEvent<{ phrase: string, index: number }>) => void;
16
18
  };
17
19
  }
18
20
  }
@@ -1,19 +1,20 @@
1
1
  <script lang="ts">
2
2
  import '@uibit/text-typing';
3
3
  import type { TextTyping as HTMLElementClass } from '@uibit/text-typing';
4
-
5
- let {
6
- typeSpeed = undefined,
7
- deleteSpeed = undefined,
8
- pauseAfter = undefined,
9
- pauseBefore = undefined,
10
- typoRate = undefined,
11
- showCursor = undefined,
12
- loop = undefined,
13
- locale = undefined,
14
- children
4
+
5
+ let {
6
+ typeSpeed = $bindable(),
7
+ deleteSpeed = $bindable(),
8
+ pauseAfter = $bindable(),
9
+ pauseBefore = $bindable(),
10
+ typoRate = $bindable(),
11
+ showCursor = $bindable(),
12
+ loop = $bindable(),
13
+ locale = $bindable(),
14
+ children,
15
+ ...restProps
15
16
  } = $props<{
16
- children?: any;
17
+ children?: import('svelte').Snippet;
17
18
  typeSpeed?: number;
18
19
  deleteSpeed?: number;
19
20
  pauseAfter?: number;
@@ -22,41 +23,84 @@
22
23
  showCursor?: boolean;
23
24
  loop?: boolean;
24
25
  locale?: string;
25
-
26
+
27
+ [key: string]: any;
26
28
  }>();
27
-
28
- let elementRef: HTMLElementClass | null = $state(null);
29
-
30
- $effect(() => {
31
- if (elementRef && typeSpeed !== undefined) {
29
+
30
+ let elementRef: HTMLElementClass | null = $state(null);
31
+
32
+ $effect(() => {
33
+ if (elementRef && typeSpeed !== undefined && elementRef.typeSpeed !== typeSpeed) {
32
34
  elementRef.typeSpeed = typeSpeed;
33
35
  }
34
- if (elementRef && deleteSpeed !== undefined) {
36
+ if (elementRef && deleteSpeed !== undefined && elementRef.deleteSpeed !== deleteSpeed) {
35
37
  elementRef.deleteSpeed = deleteSpeed;
36
38
  }
37
- if (elementRef && pauseAfter !== undefined) {
39
+ if (elementRef && pauseAfter !== undefined && elementRef.pauseAfter !== pauseAfter) {
38
40
  elementRef.pauseAfter = pauseAfter;
39
41
  }
40
- if (elementRef && pauseBefore !== undefined) {
42
+ if (elementRef && pauseBefore !== undefined && elementRef.pauseBefore !== pauseBefore) {
41
43
  elementRef.pauseBefore = pauseBefore;
42
44
  }
43
- if (elementRef && typoRate !== undefined) {
45
+ if (elementRef && typoRate !== undefined && elementRef.typoRate !== typoRate) {
44
46
  elementRef.typoRate = typoRate;
45
47
  }
46
- if (elementRef && showCursor !== undefined) {
48
+ if (elementRef && showCursor !== undefined && elementRef.showCursor !== showCursor) {
47
49
  elementRef.showCursor = showCursor;
48
50
  }
49
- if (elementRef && loop !== undefined) {
51
+ if (elementRef && loop !== undefined && elementRef.loop !== loop) {
50
52
  elementRef.loop = loop;
51
53
  }
52
- if (elementRef && locale !== undefined) {
54
+ if (elementRef && locale !== undefined && elementRef.locale !== locale) {
53
55
  elementRef.locale = locale;
54
56
  }
55
57
  });
56
-
58
+
59
+ $effect(() => {
60
+ const element = elementRef;
61
+ if (!element) return;
62
+
63
+ const handleEvent = () => {
64
+ if (typeSpeed !== element.typeSpeed) {
65
+ typeSpeed = element.typeSpeed as any;
66
+ }
67
+ if (deleteSpeed !== element.deleteSpeed) {
68
+ deleteSpeed = element.deleteSpeed as any;
69
+ }
70
+ if (pauseAfter !== element.pauseAfter) {
71
+ pauseAfter = element.pauseAfter as any;
72
+ }
73
+ if (pauseBefore !== element.pauseBefore) {
74
+ pauseBefore = element.pauseBefore as any;
75
+ }
76
+ if (typoRate !== element.typoRate) {
77
+ typoRate = element.typoRate as any;
78
+ }
79
+ if (showCursor !== element.showCursor) {
80
+ showCursor = element.showCursor as any;
81
+ }
82
+ if (loop !== element.loop) {
83
+ loop = element.loop as any;
84
+ }
85
+ if (locale !== element.locale) {
86
+ locale = element.locale as any;
87
+ }
88
+ };
89
+
90
+ const events = ['change', 'input', 'phrase-change'];
91
+ for (const event of events) {
92
+ element.addEventListener(event, handleEvent);
93
+ }
94
+ return () => {
95
+ for (const event of events) {
96
+ element.removeEventListener(event, handleEvent);
97
+ }
98
+ };
99
+ });
100
+
57
101
  </script>
58
102
 
59
- <uibit-text-typing bind:this={elementRef} {...$$restProps}>
103
+ <uibit-text-typing bind:this={elementRef} {...restProps}>
60
104
 
61
105
  {#if children}
62
106
  {@render children()}
@@ -1,31 +1,153 @@
1
- import { defineComponent, h } from 'vue';
1
+ import { defineComponent, h, ref, watch } from 'vue';
2
2
  import type { TextTyping as HTMLElementClass } from '@uibit/text-typing';
3
3
  import '@uibit/text-typing';
4
-
5
4
  export const TextTyping = defineComponent({
6
- name: 'TextTyping',
7
- props: {
8
- typeSpeed: { type: [String, Number, Boolean, Array, Object] as any },
9
- deleteSpeed: { type: [String, Number, Boolean, Array, Object] as any },
10
- pauseAfter: { type: [String, Number, Boolean, Array, Object] as any },
11
- pauseBefore: { type: [String, Number, Boolean, Array, Object] as any },
12
- typoRate: { type: [String, Number, Boolean, Array, Object] as any },
13
- showCursor: { type: [String, Number, Boolean, Array, Object] as any },
14
- loop: { type: [String, Number, Boolean, Array, Object] as any },
15
- locale: { type: [String, Number, Boolean, Array, Object] as any }
16
- },
17
- emits: ['phrase-change'],
18
- setup(props, { slots, emit }) {
19
- return () => {
20
- const eventListeners: Record<string, any> = {};
21
- eventListeners['onPhrase-change'] = (event: Event) => {
22
- emit('phrase-change', event);
23
- };
24
-
25
- return h('uibit-text-typing', {
26
- ...props,
27
- ...eventListeners
28
- }, slots.default?.());
29
- };
30
- }
5
+ name: 'TextTyping',
6
+ props: {
7
+ typeSpeed: {
8
+ type: [
9
+ String,
10
+ Number,
11
+ Boolean,
12
+ Array,
13
+ Object
14
+ ] as any
15
+ },
16
+ deleteSpeed: {
17
+ type: [
18
+ String,
19
+ Number,
20
+ Boolean,
21
+ Array,
22
+ Object
23
+ ] as any
24
+ },
25
+ pauseAfter: {
26
+ type: [
27
+ String,
28
+ Number,
29
+ Boolean,
30
+ Array,
31
+ Object
32
+ ] as any
33
+ },
34
+ pauseBefore: {
35
+ type: [
36
+ String,
37
+ Number,
38
+ Boolean,
39
+ Array,
40
+ Object
41
+ ] as any
42
+ },
43
+ typoRate: {
44
+ type: [
45
+ String,
46
+ Number,
47
+ Boolean,
48
+ Array,
49
+ Object
50
+ ] as any
51
+ },
52
+ showCursor: {
53
+ type: [
54
+ String,
55
+ Number,
56
+ Boolean,
57
+ Array,
58
+ Object
59
+ ] as any
60
+ },
61
+ loop: {
62
+ type: [
63
+ String,
64
+ Number,
65
+ Boolean,
66
+ Array,
67
+ Object
68
+ ] as any
69
+ },
70
+ locale: {
71
+ type: [
72
+ String,
73
+ Number,
74
+ Boolean,
75
+ Array,
76
+ Object
77
+ ] as any
78
+ }
79
+ },
80
+ emits: [
81
+ 'phrase-change'
82
+ ],
83
+ setup (props, { slots, emit }) {
84
+ const elementRef = ref<HTMLElementClass | null>(null);
85
+ if (false) {
86
+ watch(()=>props.modelValue, (newVal)=>{
87
+ if (elementRef.value && newVal !== undefined && elementRef.value.value !== newVal) {
88
+ elementRef.value.value = newVal;
89
+ }
90
+ });
91
+ watch(()=>props.value, (newVal)=>{
92
+ if (elementRef.value && newVal !== undefined && elementRef.value.value !== newVal) {
93
+ elementRef.value.value = newVal;
94
+ }
95
+ });
96
+ }
97
+ watch(()=>props.typeSpeed, (newVal)=>{
98
+ if (elementRef.value && newVal !== undefined) {
99
+ (elementRef.value as any).typeSpeed = newVal;
100
+ }
101
+ });
102
+ watch(()=>props.deleteSpeed, (newVal)=>{
103
+ if (elementRef.value && newVal !== undefined) {
104
+ (elementRef.value as any).deleteSpeed = newVal;
105
+ }
106
+ });
107
+ watch(()=>props.pauseAfter, (newVal)=>{
108
+ if (elementRef.value && newVal !== undefined) {
109
+ (elementRef.value as any).pauseAfter = newVal;
110
+ }
111
+ });
112
+ watch(()=>props.pauseBefore, (newVal)=>{
113
+ if (elementRef.value && newVal !== undefined) {
114
+ (elementRef.value as any).pauseBefore = newVal;
115
+ }
116
+ });
117
+ watch(()=>props.typoRate, (newVal)=>{
118
+ if (elementRef.value && newVal !== undefined) {
119
+ (elementRef.value as any).typoRate = newVal;
120
+ }
121
+ });
122
+ watch(()=>props.showCursor, (newVal)=>{
123
+ if (elementRef.value && newVal !== undefined) {
124
+ (elementRef.value as any).showCursor = newVal;
125
+ }
126
+ });
127
+ watch(()=>props.loop, (newVal)=>{
128
+ if (elementRef.value && newVal !== undefined) {
129
+ (elementRef.value as any).loop = newVal;
130
+ }
131
+ });
132
+ watch(()=>props.locale, (newVal)=>{
133
+ if (elementRef.value && newVal !== undefined) {
134
+ (elementRef.value as any).locale = newVal;
135
+ }
136
+ });
137
+ return ()=>{
138
+ const eventListeners: Record<string, any> = {};
139
+ eventListeners['onPhrase-change'] = (event: Event)=>{
140
+ emit('phrase-change', event);
141
+ };
142
+ const mergedProps = {
143
+ ...props,
144
+ ...eventListeners,
145
+ ref: elementRef
146
+ };
147
+ if (false && props.modelValue !== undefined) {
148
+ (mergedProps as any).value = props.modelValue;
149
+ }
150
+ return h('uibit-text-typing', mergedProps, slots.default?.());
151
+ };
152
+ }
31
153
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uibit/text-typing",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Headline text block that cycles through marketing phrases with a realistic typing and deleting animation. Includes speed variance, simulated auto-correcting typos, and a blinking cursor.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -11,7 +11,7 @@
11
11
  "import": "./dist/index.js"
12
12
  },
13
13
  "./custom-elements.json": "./custom-elements.json",
14
- "./react": "./dist/frameworks/react/index.d.ts",
14
+ "./react": "./dist/frameworks/react/index.ts",
15
15
  "./vue": "./dist/frameworks/vue/index.ts",
16
16
  "./svelte": "./dist/frameworks/svelte/index.svelte",
17
17
  "./angular": "./dist/frameworks/angular/index.ts",
@@ -52,7 +52,7 @@
52
52
  "@types/node": "^20.19.43",
53
53
  "lit": "^3.3.3",
54
54
  "typescript": "7.0.2",
55
- "@uibit/codegen": "0.1.0"
55
+ "@uibit/codegen": "0.2.0"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "lit": "^3.0.0",
@@ -1,25 +0,0 @@
1
- import type { HTMLAttributes, ClassAttributes } from 'react';
2
- import type { TextTyping as HTMLElementClass } from '@uibit/text-typing';
3
- import '@uibit/text-typing';
4
-
5
- declare global {
6
- namespace React {
7
- namespace JSX {
8
- interface IntrinsicElements {
9
- 'uibit-text-typing': ClassAttributes<HTMLElementClass> & HTMLAttributes<HTMLElementClass> & {
10
- children?: React.ReactNode;
11
- class?: string;
12
- typeSpeed?: number;
13
- deleteSpeed?: number;
14
- pauseAfter?: number;
15
- pauseBefore?: number;
16
- typoRate?: number;
17
- showCursor?: boolean;
18
- loop?: boolean;
19
- locale?: string;
20
- onPhraseChange?: (event: any) => void;
21
- };
22
- }
23
- }
24
- }
25
- }