@momentum-design/components 0.101.4 → 0.102.1

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.
package/dist/index.d.ts CHANGED
@@ -67,6 +67,7 @@ import Tab from './components/tab';
67
67
  import TabList from './components/tablist';
68
68
  import Text from './components/text';
69
69
  import Textarea from './components/textarea';
70
+ import Typewriter from './components/typewriter';
70
71
  import ThemeProvider from './components/themeprovider';
71
72
  import Toast from './components/toast';
72
73
  import Toggle from './components/toggle';
@@ -79,12 +80,13 @@ import type { PopoverPlacement } from './components/popover/popover.types';
79
80
  import type { SkeletonVariant } from './components/skeleton/skeleton.types';
80
81
  import type { SpinnerSize, SpinnerVariant } from './components/spinner/spinner.types';
81
82
  import type { TextType } from './components/text/text.types';
83
+ import type { TextType as TypewriterType } from './components/typewriter/typewriter.types';
82
84
  import type { MenuPopoverActionEvent, MenuPopoverChangeEvent } from './components/menupopover/menupopover.types';
83
85
  import type { SelectChangeEvent, SelectInputEvent } from './components/select/select.types';
84
86
  import type { MenuSectionChangeEvent } from './components/menusection/menusection.types';
85
87
  import { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, PILL_BUTTON_SIZES } from './components/button/button.constants';
86
88
  import { SKELETON_VARIANTS } from './components/skeleton/skeleton.constants';
87
89
  import { inMemoryCache, webAPIIconsCache } from './utils/icon-cache';
88
- export { Accordion, AccordionButton, AccordionGroup, AlertChip, Animation, Appheader, Avatar, AvatarButton, Badge, Brandvisual, Bullet, Button, ButtonGroup, ButtonLink, Card, CardButton, CardCheckbox, CardRadio, Checkbox, Chip, Coachmark, Dialog, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, LinkButton, Linksimple, List, Listheader, ListItem, Marker, MenuBar, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuPopover, MenuSection, NavMenuItem, OptGroup, Option, Password, Popover, Presence, Progressbar, Progressspinner, Radio, RadioGroup, ScreenreaderAnnouncer, Searchfield, Select, SelectListbox, SideNavigation, Skeleton, Spinner, StaticCheckbox, StaticRadio, StaticToggle, Stepper, StepperConnector, StepperItem, Tab, TabList, Text, Textarea, ThemeProvider, Toast, Toggle, ToggleTip, Tooltip, VirtualizedList, };
89
- export type { BadgeType, ButtonColor, ButtonVariant, IconButtonSize, MenuPopoverActionEvent, MenuPopoverChangeEvent, MenuSectionChangeEvent, PillButtonSize, PopoverPlacement, SkeletonVariant, SelectChangeEvent, SelectInputEvent, SpinnerSize, SpinnerVariant, TextType, };
90
+ export { Accordion, AccordionButton, AccordionGroup, AlertChip, Animation, Appheader, Avatar, AvatarButton, Badge, Brandvisual, Bullet, Button, ButtonGroup, ButtonLink, Card, CardButton, CardCheckbox, CardRadio, Checkbox, Chip, Coachmark, Dialog, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, LinkButton, Linksimple, List, Listheader, ListItem, Marker, MenuBar, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuPopover, MenuSection, NavMenuItem, OptGroup, Option, Password, Popover, Presence, Progressbar, Progressspinner, Radio, RadioGroup, ScreenreaderAnnouncer, Searchfield, Select, SelectListbox, SideNavigation, Skeleton, Spinner, StaticCheckbox, StaticRadio, StaticToggle, Stepper, StepperConnector, StepperItem, Tab, TabList, Text, Textarea, ThemeProvider, Toast, Toggle, Typewriter, ToggleTip, Tooltip, VirtualizedList, };
91
+ export type { BadgeType, ButtonColor, ButtonVariant, IconButtonSize, MenuPopoverActionEvent, MenuPopoverChangeEvent, MenuSectionChangeEvent, PillButtonSize, PopoverPlacement, SkeletonVariant, SelectChangeEvent, SelectInputEvent, SpinnerSize, SpinnerVariant, TextType, TypewriterType, };
90
92
  export { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, inMemoryCache, PILL_BUTTON_SIZES, SKELETON_VARIANTS, webAPIIconsCache, };
package/dist/index.js CHANGED
@@ -69,6 +69,7 @@ import Tab from './components/tab';
69
69
  import TabList from './components/tablist';
70
70
  import Text from './components/text';
71
71
  import Textarea from './components/textarea';
72
+ import Typewriter from './components/typewriter';
72
73
  import ThemeProvider from './components/themeprovider';
73
74
  import Toast from './components/toast';
74
75
  import Toggle from './components/toggle';
@@ -80,6 +81,6 @@ import { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, PILL_BUTTON_SIZES, }
80
81
  import { SKELETON_VARIANTS } from './components/skeleton/skeleton.constants';
81
82
  import { inMemoryCache, webAPIIconsCache } from './utils/icon-cache';
82
83
  // Components Exports
83
- export { Accordion, AccordionButton, AccordionGroup, AlertChip, Animation, Appheader, Avatar, AvatarButton, Badge, Brandvisual, Bullet, Button, ButtonGroup, ButtonLink, Card, CardButton, CardCheckbox, CardRadio, Checkbox, Chip, Coachmark, Dialog, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, LinkButton, Linksimple, List, Listheader, ListItem, Marker, MenuBar, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuPopover, MenuSection, NavMenuItem, OptGroup, Option, Password, Popover, Presence, Progressbar, Progressspinner, Radio, RadioGroup, ScreenreaderAnnouncer, Searchfield, Select, SelectListbox, SideNavigation, Skeleton, Spinner, StaticCheckbox, StaticRadio, StaticToggle, Stepper, StepperConnector, StepperItem, Tab, TabList, Text, Textarea, ThemeProvider, Toast, Toggle, ToggleTip, Tooltip, VirtualizedList, };
84
+ export { Accordion, AccordionButton, AccordionGroup, AlertChip, Animation, Appheader, Avatar, AvatarButton, Badge, Brandvisual, Bullet, Button, ButtonGroup, ButtonLink, Card, CardButton, CardCheckbox, CardRadio, Checkbox, Chip, Coachmark, Dialog, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, LinkButton, Linksimple, List, Listheader, ListItem, Marker, MenuBar, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuPopover, MenuSection, NavMenuItem, OptGroup, Option, Password, Popover, Presence, Progressbar, Progressspinner, Radio, RadioGroup, ScreenreaderAnnouncer, Searchfield, Select, SelectListbox, SideNavigation, Skeleton, Spinner, StaticCheckbox, StaticRadio, StaticToggle, Stepper, StepperConnector, StepperItem, Tab, TabList, Text, Textarea, ThemeProvider, Toast, Toggle, Typewriter, ToggleTip, Tooltip, VirtualizedList, };
84
85
  // Constants / Utils Exports
85
86
  export { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, inMemoryCache, PILL_BUTTON_SIZES, SKELETON_VARIANTS, webAPIIconsCache, };
@@ -1,9 +1,9 @@
1
1
  export { default as Accordion } from './accordion';
2
2
  export { default as AccordionButton } from './accordionbutton';
3
3
  export { default as AccordionGroup } from './accordiongroup';
4
- export { default as Animation } from './animation';
5
4
  export { default as AlertChip } from './alertchip';
6
5
  export { default as Appheader } from './appheader';
6
+ export { default as Animation } from './animation';
7
7
  export { default as Avatar } from './avatar';
8
8
  export { default as AvatarButton } from './avatarbutton';
9
9
  export { default as Badge } from './badge';
@@ -16,8 +16,8 @@ export { default as Buttonsimple } from './buttonsimple';
16
16
  export { default as Card } from './card';
17
17
  export { default as CardButton } from './cardbutton';
18
18
  export { default as CardCheckbox } from './cardcheckbox';
19
- export { default as Checkbox } from './checkbox';
20
19
  export { default as CardRadio } from './cardradio';
20
+ export { default as Checkbox } from './checkbox';
21
21
  export { default as Chip } from './chip';
22
22
  export { default as Coachmark } from './coachmark';
23
23
  export { default as Dialog } from './dialog';
@@ -74,4 +74,5 @@ export { default as Toast } from './toast';
74
74
  export { default as Toggle } from './toggle';
75
75
  export { default as ToggleTip } from './toggletip';
76
76
  export { default as Tooltip } from './tooltip';
77
+ export { default as Typewriter } from './typewriter';
77
78
  export { default as VirtualizedList } from './virtualizedlist';
@@ -1,9 +1,9 @@
1
1
  export { default as Accordion } from './accordion';
2
2
  export { default as AccordionButton } from './accordionbutton';
3
3
  export { default as AccordionGroup } from './accordiongroup';
4
- export { default as Animation } from './animation';
5
4
  export { default as AlertChip } from './alertchip';
6
5
  export { default as Appheader } from './appheader';
6
+ export { default as Animation } from './animation';
7
7
  export { default as Avatar } from './avatar';
8
8
  export { default as AvatarButton } from './avatarbutton';
9
9
  export { default as Badge } from './badge';
@@ -16,8 +16,8 @@ export { default as Buttonsimple } from './buttonsimple';
16
16
  export { default as Card } from './card';
17
17
  export { default as CardButton } from './cardbutton';
18
18
  export { default as CardCheckbox } from './cardcheckbox';
19
- export { default as Checkbox } from './checkbox';
20
19
  export { default as CardRadio } from './cardradio';
20
+ export { default as Checkbox } from './checkbox';
21
21
  export { default as Chip } from './chip';
22
22
  export { default as Coachmark } from './coachmark';
23
23
  export { default as Dialog } from './dialog';
@@ -74,4 +74,5 @@ export { default as Toast } from './toast';
74
74
  export { default as Toggle } from './toggle';
75
75
  export { default as ToggleTip } from './toggletip';
76
76
  export { default as Tooltip } from './tooltip';
77
+ export { default as Typewriter } from './typewriter';
77
78
  export { default as VirtualizedList } from './virtualizedlist';
@@ -28,6 +28,8 @@ import Component from '../../components/listitem';
28
28
  * @slot trailing-text-side-header - slot for list item side header text.
29
29
  * @slot trailing-text-subline - slot for list item subline text.
30
30
  * @slot trailing-controls - slot for list item controls to appear of trailing end.
31
+ * @slot content - content slot can be used to override the content completely. Be aware that
32
+ * this will override the default content of the list item.
31
33
  *
32
34
  * @cssproperty --mdc-listitem-default-background-color - Allows customization of the default background color.
33
35
  * @cssproperty --mdc-listitem-background-color-hover - Allows customization of the background color on hover.
@@ -38,7 +40,11 @@ import Component from '../../components/listitem';
38
40
  * - Allows customization of the secondary and tertiary label text slot color.
39
41
  * @cssproperty --mdc-listitem-disabled-color - Allows customization of the disabled color.
40
42
  * @cssproperty --mdc-listitem-column-gap - Allows customization of column gap.
41
- * @cssproperty --mdc-listitem-padding-left-and-right - Allows customization of padding left and right.
43
+ * @cssproperty --mdc-listitem-padding-left-right - Allows customization of padding left and right.
44
+ * @cssproperty --mdc-listitem-padding-top-bottom - Allows customization of padding top and bottom.
45
+ * @cssproperty --mdc-listitem-cursor - Allows customization of the cursor.
46
+ * @cssproperty --mdc-listitem-width - Allows customization of the width of the list item.
47
+ * @cssproperty --mdc-listitem-height - Allows customization of the height of the list item.
42
48
  *
43
49
  * @event click - (React: onClick) This event is dispatched when the listitem is clicked.
44
50
  * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the listitem.
@@ -30,6 +30,8 @@ import { TAG_NAME } from '../../components/listitem/listitem.constants';
30
30
  * @slot trailing-text-side-header - slot for list item side header text.
31
31
  * @slot trailing-text-subline - slot for list item subline text.
32
32
  * @slot trailing-controls - slot for list item controls to appear of trailing end.
33
+ * @slot content - content slot can be used to override the content completely. Be aware that
34
+ * this will override the default content of the list item.
33
35
  *
34
36
  * @cssproperty --mdc-listitem-default-background-color - Allows customization of the default background color.
35
37
  * @cssproperty --mdc-listitem-background-color-hover - Allows customization of the background color on hover.
@@ -40,7 +42,11 @@ import { TAG_NAME } from '../../components/listitem/listitem.constants';
40
42
  * - Allows customization of the secondary and tertiary label text slot color.
41
43
  * @cssproperty --mdc-listitem-disabled-color - Allows customization of the disabled color.
42
44
  * @cssproperty --mdc-listitem-column-gap - Allows customization of column gap.
43
- * @cssproperty --mdc-listitem-padding-left-and-right - Allows customization of padding left and right.
45
+ * @cssproperty --mdc-listitem-padding-left-right - Allows customization of padding left and right.
46
+ * @cssproperty --mdc-listitem-padding-top-bottom - Allows customization of padding top and bottom.
47
+ * @cssproperty --mdc-listitem-cursor - Allows customization of the cursor.
48
+ * @cssproperty --mdc-listitem-width - Allows customization of the width of the list item.
49
+ * @cssproperty --mdc-listitem-height - Allows customization of the height of the list item.
44
50
  *
45
51
  * @event click - (React: onClick) This event is dispatched when the listitem is clicked.
46
52
  * @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the listitem.
@@ -0,0 +1,51 @@
1
+ import { type EventName } from '@lit/react';
2
+ import Component from '../../components/typewriter';
3
+ /**
4
+ * Typewriter component that creates a typewriter effect on text content.
5
+ * It uses the Text component internally, adding a progressive typing effect.
6
+ *
7
+ * The `type` attribute allows changing the text style (passed to the internal Text component).
8
+ * The `tagname` attribute allows changing the tag name of the text element (passed to the internal Text component).
9
+ * The default tag name is `p`.
10
+ *
11
+ * The `speed` attribute controls typing speed in milliseconds per character:
12
+ * - 'very-slow' = 240ms per character
13
+ * - 'slow' = 120ms per character
14
+ * - 'normal' = 60ms per character (default)
15
+ * - 'fast' = 20ms per character
16
+ * - 'very-fast' = 1ms per character
17
+ * - Or any numeric string representing milliseconds
18
+ *
19
+ * Advanced features:
20
+ * - Dynamic speed adjustment during typing
21
+ * - Chunked text addition via addTextChunk() method
22
+ * - Instant text addition via addInstantTextChunk() method or instant parameter
23
+ * - Mixed instant and animated chunks in queue
24
+ * - Continues typing in background tabs
25
+ * - Performance optimized for large text
26
+ * - maxQueueSize to limit memory usage from excessive queuing
27
+ * - event handling for typing completion and content changes
28
+ *
29
+ * The component includes accessibility features:
30
+ * - Screen readers announce the complete text, not character by character
31
+ * - Uses aria-live="polite" for dynamic content updates
32
+ * - Sets aria-busy during typing animation
33
+ *
34
+ * @dependency mdc-text
35
+ *
36
+ * @tagname mdc-typewriter
37
+ * @slot - Default slot for text content
38
+ *
39
+ * @csspart container - Container for the text element
40
+ * @csspart text - The text element (forwarded to mdc-text)
41
+ *
42
+ * @event typing-complete - (React: onTypingComplete) Fired when the typewriter finishes typing all content.
43
+ * Detail: \{ finalContent: string \}
44
+ * @event change - (React: onChange) Fired when the content of the typewriter changes.
45
+ * Detail: \{ content: string, isTyping: boolean \}
46
+ */
47
+ declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
48
+ onTypingComplete: EventName<import("../../components/typewriter/typewriter.types").TypewriterTypingCompleteEvent>;
49
+ onChange: EventName<import("../../components/typewriter/typewriter.types").TypewriterChangeEvent>;
50
+ }>;
51
+ export default reactWrapper;
@@ -0,0 +1,59 @@
1
+ import * as React from 'react';
2
+ import { createComponent } from '@lit/react';
3
+ import Component from '../../components/typewriter';
4
+ import { TAG_NAME } from '../../components/typewriter/typewriter.constants';
5
+ /**
6
+ * Typewriter component that creates a typewriter effect on text content.
7
+ * It uses the Text component internally, adding a progressive typing effect.
8
+ *
9
+ * The `type` attribute allows changing the text style (passed to the internal Text component).
10
+ * The `tagname` attribute allows changing the tag name of the text element (passed to the internal Text component).
11
+ * The default tag name is `p`.
12
+ *
13
+ * The `speed` attribute controls typing speed in milliseconds per character:
14
+ * - 'very-slow' = 240ms per character
15
+ * - 'slow' = 120ms per character
16
+ * - 'normal' = 60ms per character (default)
17
+ * - 'fast' = 20ms per character
18
+ * - 'very-fast' = 1ms per character
19
+ * - Or any numeric string representing milliseconds
20
+ *
21
+ * Advanced features:
22
+ * - Dynamic speed adjustment during typing
23
+ * - Chunked text addition via addTextChunk() method
24
+ * - Instant text addition via addInstantTextChunk() method or instant parameter
25
+ * - Mixed instant and animated chunks in queue
26
+ * - Continues typing in background tabs
27
+ * - Performance optimized for large text
28
+ * - maxQueueSize to limit memory usage from excessive queuing
29
+ * - event handling for typing completion and content changes
30
+ *
31
+ * The component includes accessibility features:
32
+ * - Screen readers announce the complete text, not character by character
33
+ * - Uses aria-live="polite" for dynamic content updates
34
+ * - Sets aria-busy during typing animation
35
+ *
36
+ * @dependency mdc-text
37
+ *
38
+ * @tagname mdc-typewriter
39
+ * @slot - Default slot for text content
40
+ *
41
+ * @csspart container - Container for the text element
42
+ * @csspart text - The text element (forwarded to mdc-text)
43
+ *
44
+ * @event typing-complete - (React: onTypingComplete) Fired when the typewriter finishes typing all content.
45
+ * Detail: \{ finalContent: string \}
46
+ * @event change - (React: onChange) Fired when the content of the typewriter changes.
47
+ * Detail: \{ content: string, isTyping: boolean \}
48
+ */
49
+ const reactWrapper = createComponent({
50
+ tagName: TAG_NAME,
51
+ elementClass: Component,
52
+ react: React,
53
+ events: {
54
+ onTypingComplete: 'typing-complete',
55
+ onChange: 'change',
56
+ },
57
+ displayName: 'Typewriter',
58
+ });
59
+ export default reactWrapper;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@momentum-design/components",
3
3
  "packageManager": "yarn@3.2.4",
4
- "version": "0.101.4",
4
+ "version": "0.102.1",
5
5
  "engines": {
6
6
  "node": ">=20.0.0",
7
7
  "npm": ">=8.0.0"