@momentum-design/components 0.112.6 → 0.113.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.
- package/dist/browser/index.js +619 -388
- package/dist/browser/index.js.map +4 -4
- package/dist/components/combobox/combobox.component.d.ts +261 -7
- package/dist/components/combobox/combobox.component.js +737 -9
- package/dist/components/combobox/combobox.constants.d.ts +8 -1
- package/dist/components/combobox/combobox.constants.js +8 -1
- package/dist/components/combobox/combobox.events.d.ts +27 -0
- package/dist/components/combobox/combobox.events.js +35 -0
- package/dist/components/combobox/combobox.styles.js +122 -1
- package/dist/components/combobox/combobox.types.d.ts +22 -1
- package/dist/components/combobox/combobox.types.js +0 -1
- package/dist/components/combobox/index.d.ts +5 -0
- package/dist/components/combobox/index.js +5 -0
- package/dist/components/divider/divider.styles.js +4 -0
- package/dist/components/input/input.styles.js +10 -10
- package/dist/components/optgroup/optgroup.styles.js +3 -0
- package/dist/components/option/option.styles.d.ts +2 -2
- package/dist/components/option/option.styles.js +36 -23
- package/dist/components/popover/popover.component.d.ts +2 -2
- package/dist/components/popover/popover.component.js +1 -1
- package/dist/components/popover/popover.constants.d.ts +5 -1
- package/dist/components/popover/popover.constants.js +7 -2
- package/dist/components/popover/popover.types.d.ts +3 -2
- package/dist/custom-elements.json +11704 -10553
- package/dist/react/combobox/index.d.ts +71 -4
- package/dist/react/combobox/index.js +60 -4
- package/dist/react/index.d.ts +7 -7
- package/dist/react/index.js +7 -7
- package/package.json +1 -1
@@ -1,12 +1,79 @@
|
|
1
|
+
import { type EventName } from '@lit/react';
|
1
2
|
import Component from '../../components/combobox';
|
2
3
|
/**
|
3
|
-
*
|
4
|
+
* The Combobox component is a text-based dropdown control that allows users to select an option from a predefined list.
|
5
|
+
* Users can type text to filter the options and select their desired choice.
|
6
|
+
*
|
7
|
+
* When the user starts typing, the filter uses a "starts with" search and displays options based on the text entered by the user.
|
8
|
+
* If the user entered text that doesn't match with any of the options, then the text in the `no-result-text` attribute will be displayed.
|
9
|
+
*
|
10
|
+
* If there is no text in the `no-result-text` attribute then nothing will be shown.
|
11
|
+
*
|
12
|
+
* Combobox is designed to work with `mdc-option` for individual options and `mdc-optgroup` for grouping related options.
|
13
|
+
* The component ensures accessibility and usability while handling various use cases, including long text truncation with tooltip support.
|
14
|
+
*
|
15
|
+
* Every mdc-option should have a `value` attribute set to ensure proper form submission.
|
16
|
+
*
|
17
|
+
* To set a default option, use the `selected` attribute on the `mdc-option` element.
|
18
|
+
*
|
19
|
+
* **Note:** Make sure to add `mdc-selectlistbox` as a child of `mdc-combobox` and wrap options/optgroup in it to ensure proper accessibility functionality. Read more about it in SelectListBox documentation.
|
20
|
+
*
|
21
|
+
* If you need to use `mdc-tooltip` with any options, make sure to place the tooltip component outside the `mdc-selectlistbox` element. Read more about it in Options documentation.
|
22
|
+
*
|
23
|
+
* To understand more about combobox and its patterns, refer to this [WCAG example](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-autocomplete-list/).
|
24
|
+
*
|
25
|
+
* @dependency mdc-buttonsimple
|
26
|
+
* @dependency mdc-icon
|
27
|
+
* @dependency mdc-input
|
28
|
+
* @dependency mdc-listitem
|
29
|
+
* @dependency mdc-popover
|
4
30
|
*
|
5
31
|
* @tagname mdc-combobox
|
6
32
|
*
|
7
|
-
* @slot default - This is a default/unnamed slot
|
33
|
+
* @slot default - This is a default/unnamed slot for Selectlistbox including options and/or option group.
|
34
|
+
*
|
35
|
+
* @event click - (React: onClick) This event is dispatched when the combobox is clicked.
|
36
|
+
* @event change - (React: onChange) This event is dispatched when the combobox is changed.
|
37
|
+
* @event input - (React: onInput) This event is dispatched when the combobox is changed.
|
38
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the combobox.
|
39
|
+
* @event focus - (React: onFocus) This event is dispatched when the combobox receives focus.
|
40
|
+
*
|
41
|
+
* @cssproperty --mdc-combobox-border-color - The border color of the combobox
|
42
|
+
* @cssproperty --mdc-combobox-icon-color - The icon color of the combobox
|
43
|
+
* @cssproperty --mdc-combobox-listbox-height - The height of the listbox inside the combobox
|
44
|
+
* @cssproperty --mdc-combobox-listbox-width - The width of the listbox inside the combobox
|
45
|
+
* @cssproperty --mdc-combobox-width - The width of the combobox
|
46
|
+
* @cssproperty --mdc-combobox-hover-background-color - The background color of the combobox when hovered
|
47
|
+
* @cssproperty --mdc-combobox-focused-background-color - The background color of the combobox when focused
|
48
|
+
* @cssproperty --mdc-combobox-error-border-color - The border color of the combobox when in error state
|
49
|
+
* @cssproperty --mdc-combobox-warning-border-color - The border color of the combobox when in warning state
|
50
|
+
* @cssproperty --mdc-combobox-success-border-color - The border color of the combobox when in success state
|
51
|
+
* @cssproperty --mdc-combobox-primary-border-color - The border color of the combobox when in primary state
|
52
|
+
* @cssproperty --mdc-combobox-text-color-disabled - The text color of the combobox when disabled
|
53
|
+
* @cssproperty --mdc-combobox-focused-border-color - The border color of the combobox when focused
|
8
54
|
*
|
9
|
-
* @
|
55
|
+
* @csspart internal-native-input - The internal native input element of the combobox.
|
56
|
+
* @csspart mdc-input - The input element of the combobox.
|
57
|
+
* @csspart no-result-text - The no result text element of the combobox.
|
58
|
+
* @csspart combobox__base - The base container element of the combobox.
|
59
|
+
* @csspart combobox__button - The button element of the combobox.
|
60
|
+
* @csspart combobox__button-icon - The icon element of the button of the combobox.
|
10
61
|
*/
|
11
|
-
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
|
62
|
+
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
|
63
|
+
onClick: EventName<import("../../utils/types").OverrideEventTarget<MouseEvent, Component>>;
|
64
|
+
onChange: EventName<CustomEvent<{
|
65
|
+
value: string;
|
66
|
+
label?: string | undefined;
|
67
|
+
}> & {
|
68
|
+
target: Component;
|
69
|
+
}>;
|
70
|
+
onInput: EventName<CustomEvent<{
|
71
|
+
value: string;
|
72
|
+
label?: string | undefined;
|
73
|
+
}> & {
|
74
|
+
target: Component;
|
75
|
+
}>;
|
76
|
+
onKeyDown: EventName<import("../../utils/types").OverrideEventTarget<KeyboardEvent, Component>>;
|
77
|
+
onFocus: EventName<import("../../utils/types").OverrideEventTarget<FocusEvent, Component>>;
|
78
|
+
}>;
|
12
79
|
export default reactWrapper;
|
@@ -3,19 +3,75 @@ import { createComponent } from '@lit/react';
|
|
3
3
|
import Component from '../../components/combobox';
|
4
4
|
import { TAG_NAME } from '../../components/combobox/combobox.constants';
|
5
5
|
/**
|
6
|
-
*
|
6
|
+
* The Combobox component is a text-based dropdown control that allows users to select an option from a predefined list.
|
7
|
+
* Users can type text to filter the options and select their desired choice.
|
8
|
+
*
|
9
|
+
* When the user starts typing, the filter uses a "starts with" search and displays options based on the text entered by the user.
|
10
|
+
* If the user entered text that doesn't match with any of the options, then the text in the `no-result-text` attribute will be displayed.
|
11
|
+
*
|
12
|
+
* If there is no text in the `no-result-text` attribute then nothing will be shown.
|
13
|
+
*
|
14
|
+
* Combobox is designed to work with `mdc-option` for individual options and `mdc-optgroup` for grouping related options.
|
15
|
+
* The component ensures accessibility and usability while handling various use cases, including long text truncation with tooltip support.
|
16
|
+
*
|
17
|
+
* Every mdc-option should have a `value` attribute set to ensure proper form submission.
|
18
|
+
*
|
19
|
+
* To set a default option, use the `selected` attribute on the `mdc-option` element.
|
20
|
+
*
|
21
|
+
* **Note:** Make sure to add `mdc-selectlistbox` as a child of `mdc-combobox` and wrap options/optgroup in it to ensure proper accessibility functionality. Read more about it in SelectListBox documentation.
|
22
|
+
*
|
23
|
+
* If you need to use `mdc-tooltip` with any options, make sure to place the tooltip component outside the `mdc-selectlistbox` element. Read more about it in Options documentation.
|
24
|
+
*
|
25
|
+
* To understand more about combobox and its patterns, refer to this [WCAG example](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-autocomplete-list/).
|
26
|
+
*
|
27
|
+
* @dependency mdc-buttonsimple
|
28
|
+
* @dependency mdc-icon
|
29
|
+
* @dependency mdc-input
|
30
|
+
* @dependency mdc-listitem
|
31
|
+
* @dependency mdc-popover
|
7
32
|
*
|
8
33
|
* @tagname mdc-combobox
|
9
34
|
*
|
10
|
-
* @slot default - This is a default/unnamed slot
|
35
|
+
* @slot default - This is a default/unnamed slot for Selectlistbox including options and/or option group.
|
36
|
+
*
|
37
|
+
* @event click - (React: onClick) This event is dispatched when the combobox is clicked.
|
38
|
+
* @event change - (React: onChange) This event is dispatched when the combobox is changed.
|
39
|
+
* @event input - (React: onInput) This event is dispatched when the combobox is changed.
|
40
|
+
* @event keydown - (React: onKeyDown) This event is dispatched when a key is pressed down on the combobox.
|
41
|
+
* @event focus - (React: onFocus) This event is dispatched when the combobox receives focus.
|
42
|
+
*
|
43
|
+
* @cssproperty --mdc-combobox-border-color - The border color of the combobox
|
44
|
+
* @cssproperty --mdc-combobox-icon-color - The icon color of the combobox
|
45
|
+
* @cssproperty --mdc-combobox-listbox-height - The height of the listbox inside the combobox
|
46
|
+
* @cssproperty --mdc-combobox-listbox-width - The width of the listbox inside the combobox
|
47
|
+
* @cssproperty --mdc-combobox-width - The width of the combobox
|
48
|
+
* @cssproperty --mdc-combobox-hover-background-color - The background color of the combobox when hovered
|
49
|
+
* @cssproperty --mdc-combobox-focused-background-color - The background color of the combobox when focused
|
50
|
+
* @cssproperty --mdc-combobox-error-border-color - The border color of the combobox when in error state
|
51
|
+
* @cssproperty --mdc-combobox-warning-border-color - The border color of the combobox when in warning state
|
52
|
+
* @cssproperty --mdc-combobox-success-border-color - The border color of the combobox when in success state
|
53
|
+
* @cssproperty --mdc-combobox-primary-border-color - The border color of the combobox when in primary state
|
54
|
+
* @cssproperty --mdc-combobox-text-color-disabled - The text color of the combobox when disabled
|
55
|
+
* @cssproperty --mdc-combobox-focused-border-color - The border color of the combobox when focused
|
11
56
|
*
|
12
|
-
* @
|
57
|
+
* @csspart internal-native-input - The internal native input element of the combobox.
|
58
|
+
* @csspart mdc-input - The input element of the combobox.
|
59
|
+
* @csspart no-result-text - The no result text element of the combobox.
|
60
|
+
* @csspart combobox__base - The base container element of the combobox.
|
61
|
+
* @csspart combobox__button - The button element of the combobox.
|
62
|
+
* @csspart combobox__button-icon - The icon element of the button of the combobox.
|
13
63
|
*/
|
14
64
|
const reactWrapper = createComponent({
|
15
65
|
tagName: TAG_NAME,
|
16
66
|
elementClass: Component,
|
17
67
|
react: React,
|
18
|
-
events: {
|
68
|
+
events: {
|
69
|
+
onClick: 'click',
|
70
|
+
onChange: 'change',
|
71
|
+
onInput: 'input',
|
72
|
+
onKeyDown: 'keydown',
|
73
|
+
onFocus: 'focus',
|
74
|
+
},
|
19
75
|
displayName: 'Combobox',
|
20
76
|
});
|
21
77
|
export default reactWrapper;
|
package/dist/react/index.d.ts
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
export { default as AccordionButton } from './accordionbutton';
|
2
1
|
export { default as Accordion } from './accordion';
|
2
|
+
export { default as AccordionButton } from './accordionbutton';
|
3
3
|
export { default as AccordionGroup } from './accordiongroup';
|
4
4
|
export { default as AlertChip } from './alertchip';
|
5
5
|
export { default as Animation } from './animation';
|
6
6
|
export { default as Appheader } from './appheader';
|
7
|
+
export { default as Avatar } from './avatar';
|
7
8
|
export { default as AvatarButton } from './avatarbutton';
|
8
9
|
export { default as Badge } from './badge';
|
9
10
|
export { default as Brandvisual } from './brandvisual';
|
10
|
-
export { default as Avatar } from './avatar';
|
11
11
|
export { default as Bullet } from './bullet';
|
12
|
-
export { default as Button } from './button';
|
13
|
-
export { default as ButtonGroup } from './buttongroup';
|
14
12
|
export { default as ButtonLink } from './buttonlink';
|
15
13
|
export { default as Buttonsimple } from './buttonsimple';
|
14
|
+
export { default as ButtonGroup } from './buttongroup';
|
15
|
+
export { default as Button } from './button';
|
16
16
|
export { default as Card } from './card';
|
17
17
|
export { default as CardButton } from './cardbutton';
|
18
18
|
export { default as CardCheckbox } from './cardcheckbox';
|
@@ -41,15 +41,15 @@ export { default as Marker } from './marker';
|
|
41
41
|
export { default as MenuBar } from './menubar';
|
42
42
|
export { default as MenuItem } from './menuitem';
|
43
43
|
export { default as MenuItemCheckbox } from './menuitemcheckbox';
|
44
|
-
export { default as MenuItemRadio } from './menuitemradio';
|
45
44
|
export { default as MenuPopover } from './menupopover';
|
46
45
|
export { default as MenuSection } from './menusection';
|
46
|
+
export { default as MenuItemRadio } from './menuitemradio';
|
47
47
|
export { default as NavMenuItem } from './navmenuitem';
|
48
48
|
export { default as OptGroup } from './optgroup';
|
49
49
|
export { default as Option } from './option';
|
50
|
-
export { default as Password } from './password';
|
51
50
|
export { default as Popover } from './popover';
|
52
51
|
export { default as Presence } from './presence';
|
52
|
+
export { default as Password } from './password';
|
53
53
|
export { default as Progressbar } from './progressbar';
|
54
54
|
export { default as Progressspinner } from './progressspinner';
|
55
55
|
export { default as Radio } from './radio';
|
@@ -71,10 +71,10 @@ export { default as StepperConnector } from './stepperconnector';
|
|
71
71
|
export { default as StepperItem } from './stepperitem';
|
72
72
|
export { default as Tab } from './tab';
|
73
73
|
export { default as TabList } from './tablist';
|
74
|
-
export { default as Text } from './text';
|
75
74
|
export { default as Textarea } from './textarea';
|
76
75
|
export { default as ThemeProvider } from './themeprovider';
|
77
76
|
export { default as Toast } from './toast';
|
77
|
+
export { default as Text } from './text';
|
78
78
|
export { default as Toggle } from './toggle';
|
79
79
|
export { default as ToggleTip } from './toggletip';
|
80
80
|
export { default as Tooltip } from './tooltip';
|
package/dist/react/index.js
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
export { default as AccordionButton } from './accordionbutton';
|
2
1
|
export { default as Accordion } from './accordion';
|
2
|
+
export { default as AccordionButton } from './accordionbutton';
|
3
3
|
export { default as AccordionGroup } from './accordiongroup';
|
4
4
|
export { default as AlertChip } from './alertchip';
|
5
5
|
export { default as Animation } from './animation';
|
6
6
|
export { default as Appheader } from './appheader';
|
7
|
+
export { default as Avatar } from './avatar';
|
7
8
|
export { default as AvatarButton } from './avatarbutton';
|
8
9
|
export { default as Badge } from './badge';
|
9
10
|
export { default as Brandvisual } from './brandvisual';
|
10
|
-
export { default as Avatar } from './avatar';
|
11
11
|
export { default as Bullet } from './bullet';
|
12
|
-
export { default as Button } from './button';
|
13
|
-
export { default as ButtonGroup } from './buttongroup';
|
14
12
|
export { default as ButtonLink } from './buttonlink';
|
15
13
|
export { default as Buttonsimple } from './buttonsimple';
|
14
|
+
export { default as ButtonGroup } from './buttongroup';
|
15
|
+
export { default as Button } from './button';
|
16
16
|
export { default as Card } from './card';
|
17
17
|
export { default as CardButton } from './cardbutton';
|
18
18
|
export { default as CardCheckbox } from './cardcheckbox';
|
@@ -41,15 +41,15 @@ export { default as Marker } from './marker';
|
|
41
41
|
export { default as MenuBar } from './menubar';
|
42
42
|
export { default as MenuItem } from './menuitem';
|
43
43
|
export { default as MenuItemCheckbox } from './menuitemcheckbox';
|
44
|
-
export { default as MenuItemRadio } from './menuitemradio';
|
45
44
|
export { default as MenuPopover } from './menupopover';
|
46
45
|
export { default as MenuSection } from './menusection';
|
46
|
+
export { default as MenuItemRadio } from './menuitemradio';
|
47
47
|
export { default as NavMenuItem } from './navmenuitem';
|
48
48
|
export { default as OptGroup } from './optgroup';
|
49
49
|
export { default as Option } from './option';
|
50
|
-
export { default as Password } from './password';
|
51
50
|
export { default as Popover } from './popover';
|
52
51
|
export { default as Presence } from './presence';
|
52
|
+
export { default as Password } from './password';
|
53
53
|
export { default as Progressbar } from './progressbar';
|
54
54
|
export { default as Progressspinner } from './progressspinner';
|
55
55
|
export { default as Radio } from './radio';
|
@@ -71,10 +71,10 @@ export { default as StepperConnector } from './stepperconnector';
|
|
71
71
|
export { default as StepperItem } from './stepperitem';
|
72
72
|
export { default as Tab } from './tab';
|
73
73
|
export { default as TabList } from './tablist';
|
74
|
-
export { default as Text } from './text';
|
75
74
|
export { default as Textarea } from './textarea';
|
76
75
|
export { default as ThemeProvider } from './themeprovider';
|
77
76
|
export { default as Toast } from './toast';
|
77
|
+
export { default as Text } from './text';
|
78
78
|
export { default as Toggle } from './toggle';
|
79
79
|
export { default as ToggleTip } from './toggletip';
|
80
80
|
export { default as Tooltip } from './tooltip';
|