@momentum-design/components 0.101.3 → 0.102.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.
@@ -0,0 +1,22 @@
1
+ import utils from '../../utils/tag-name';
2
+ import { DEFAULTS as TEXT_DEFAULTS } from '../text/text.constants';
3
+ const TAG_NAME = utils.constructTagName('typewriter');
4
+ const SPEED = {
5
+ VERY_SLOW: 240,
6
+ SLOW: 120,
7
+ NORMAL: 60,
8
+ FAST: 20,
9
+ VERY_FAST: 1,
10
+ };
11
+ const DEFAULTS = {
12
+ TYPE: TEXT_DEFAULTS.TYPE,
13
+ TEXT_ELEMENT_TAGNAME: TEXT_DEFAULTS.TEXT_ELEMENT_TAGNAME,
14
+ CSS_PART_TEXT: 'text',
15
+ CSS_PART_CONTAINER: 'container',
16
+ CHILDREN: '',
17
+ SPEED: 'normal',
18
+ CUSTOM_EVENT: {
19
+ TYPING_COMPLETE: 'typing-complete',
20
+ },
21
+ };
22
+ export { TAG_NAME, DEFAULTS, SPEED };
@@ -0,0 +1,2 @@
1
+ declare const styles: import("lit").CSSResult[];
2
+ export default styles;
@@ -0,0 +1,19 @@
1
+ import { css } from 'lit';
2
+ const styles = [
3
+ css `
4
+ :host {
5
+ display: block;
6
+ position: relative;
7
+ }
8
+
9
+ [part='container'] {
10
+ display: flex;
11
+ align-items: baseline;
12
+ }
13
+
14
+ .typewriter-hidden {
15
+ display: none;
16
+ }
17
+ `,
18
+ ];
19
+ export default styles;
@@ -0,0 +1,21 @@
1
+ import type { TypedEvent } from '../../utils/types';
2
+ import type { TextType, TagName } from '../text/text.types';
3
+ import type Typewriter from './typewriter.component';
4
+ type TypewriterSpeed = 'slow' | 'normal' | 'fast' | 'very-slow' | 'very-fast' | string;
5
+ interface TextChunk {
6
+ text: string;
7
+ speed?: TypewriterSpeed;
8
+ instant?: boolean;
9
+ }
10
+ type TypewriterChangeEvent = TypedEvent<Typewriter, {
11
+ content: string;
12
+ isTyping: boolean;
13
+ }>;
14
+ type TypewriterTypingCompleteEvent = TypedEvent<Typewriter, {
15
+ finalContent: string;
16
+ }>;
17
+ interface Events {
18
+ onChangeEvent: TypewriterChangeEvent;
19
+ onTypingCompleteEvent: TypewriterTypingCompleteEvent;
20
+ }
21
+ export type { TypewriterSpeed, TextType, TagName, Events, TextChunk, TypewriterChangeEvent, TypewriterTypingCompleteEvent, };
@@ -0,0 +1 @@
1
+ export {};