@carbon/react 1.57.0-rc.0 → 1.57.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.
Files changed (52) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +971 -936
  2. package/es/components/ComboBox/ComboBox.js +1 -0
  3. package/es/components/ContainedList/ContainedList.d.ts +7 -3
  4. package/es/components/ContainedList/ContainedList.js +3 -2
  5. package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +1 -2
  6. package/es/components/ContainedList/ContainedListItem/index.d.ts +9 -0
  7. package/es/components/ContainedList/index.d.ts +11 -0
  8. package/es/components/ContainedList/index.js +13 -0
  9. package/es/components/DataTable/stories/examples/TableToolbarFilter.d.ts +51 -0
  10. package/es/components/DatePicker/DatePicker.d.ts +5 -4
  11. package/es/components/DatePicker/plugins/rangePlugin.js +5 -6
  12. package/es/components/Dialog/index.d.ts +31 -0
  13. package/es/components/ListBox/next/ListBoxTrigger.js +4 -3
  14. package/es/components/MultiSelect/FilterableMultiSelect.d.ts +177 -0
  15. package/es/components/MultiSelect/FilterableMultiSelect.js +388 -313
  16. package/es/components/MultiSelect/MultiSelect.js +1 -2
  17. package/es/components/MultiSelect/MultiSelectPropTypes.d.ts +62 -0
  18. package/es/components/MultiSelect/index.d.ts +10 -0
  19. package/es/components/MultiSelect/index.js +2 -0
  20. package/es/components/Pagination/Pagination.js +9 -9
  21. package/es/components/RadioButton/RadioButton.d.ts +4 -0
  22. package/es/components/RadioButton/RadioButton.js +7 -1
  23. package/es/components/RadioButtonGroup/RadioButtonGroup.d.ts +4 -0
  24. package/es/components/RadioButtonGroup/RadioButtonGroup.js +7 -1
  25. package/es/components/TimePicker/TimePicker.js +1 -1
  26. package/es/index.js +3 -1
  27. package/lib/components/ComboBox/ComboBox.js +1 -0
  28. package/lib/components/ContainedList/ContainedList.d.ts +7 -3
  29. package/lib/components/ContainedList/ContainedList.js +3 -2
  30. package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +1 -2
  31. package/lib/components/ContainedList/ContainedListItem/index.d.ts +9 -0
  32. package/lib/components/ContainedList/index.d.ts +11 -0
  33. package/lib/components/ContainedList/index.js +19 -0
  34. package/lib/components/DataTable/stories/examples/TableToolbarFilter.d.ts +51 -0
  35. package/lib/components/DatePicker/DatePicker.d.ts +5 -4
  36. package/lib/components/DatePicker/plugins/rangePlugin.js +5 -6
  37. package/lib/components/Dialog/index.d.ts +31 -0
  38. package/lib/components/ListBox/next/ListBoxTrigger.js +4 -3
  39. package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +177 -0
  40. package/lib/components/MultiSelect/FilterableMultiSelect.js +387 -312
  41. package/lib/components/MultiSelect/MultiSelect.js +1 -2
  42. package/lib/components/MultiSelect/MultiSelectPropTypes.d.ts +62 -0
  43. package/lib/components/MultiSelect/index.d.ts +10 -0
  44. package/lib/components/MultiSelect/index.js +2 -0
  45. package/lib/components/Pagination/Pagination.js +9 -9
  46. package/lib/components/RadioButton/RadioButton.d.ts +4 -0
  47. package/lib/components/RadioButton/RadioButton.js +7 -1
  48. package/lib/components/RadioButtonGroup/RadioButtonGroup.d.ts +4 -0
  49. package/lib/components/RadioButtonGroup/RadioButtonGroup.js +7 -1
  50. package/lib/components/TimePicker/TimePicker.js +1 -1
  51. package/lib/index.js +4 -2
  52. package/package.json +7 -7
@@ -0,0 +1,177 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { type UseComboboxProps, type UseMultipleSelectionProps } from 'downshift';
8
+ import { ReactNodeLike } from 'prop-types';
9
+ import { ReactNode, FunctionComponent, ReactElement } from 'react';
10
+ import { type ItemBase, type SortingPropTypes } from './MultiSelectPropTypes';
11
+ export interface FilterableMultiSelectProps<Item extends ItemBase> extends SortingPropTypes<Item> {
12
+ /**
13
+ * Specify a label to be read by screen readers on the container node
14
+ * @deprecated
15
+ */
16
+ 'aria-label'?: string;
17
+ /** @deprecated */
18
+ ariaLabel?: string;
19
+ className?: string;
20
+ /**
21
+ * Specify the text that should be read for screen readers that describes total items selected
22
+ */
23
+ clearSelectionDescription?: string;
24
+ /**
25
+ * Specify the text that should be read for screen readers to clear selection.
26
+ */
27
+ clearSelectionText?: string;
28
+ /**
29
+ * Specify the direction of the multiselect dropdown.
30
+ */
31
+ direction?: 'top' | 'bottom';
32
+ /**
33
+ * Disable the control
34
+ */
35
+ disabled?: boolean;
36
+ /**
37
+ * Additional props passed to Downshift
38
+ */
39
+ downshiftProps?: UseMultipleSelectionProps<Item>;
40
+ /**
41
+ * Default sorter is assigned if not provided.
42
+ */
43
+ filterItems(items: readonly Item[], extra: {
44
+ inputValue: string | null;
45
+ itemToString: NonNullable<UseMultipleSelectionProps<Item>['itemToString']>;
46
+ }): Item[];
47
+ /**
48
+ * Specify whether the title text should be hidden or not
49
+ */
50
+ hideLabel?: boolean;
51
+ /**
52
+ * Provide helper text that is used alongside
53
+ * the control label for additional help
54
+ */
55
+ helperText?: ReactNode;
56
+ /**
57
+ * Specify a custom `id`
58
+ */
59
+ id: string;
60
+ /**
61
+ * Allow users to pass in arbitrary items from their collection that are
62
+ * pre-selected
63
+ */
64
+ initialSelectedItems?: Item[];
65
+ /**
66
+ * Is the current selection invalid?
67
+ */
68
+ invalid?: boolean;
69
+ /**
70
+ * If invalid, what is the error?
71
+ */
72
+ invalidText?: ReactNode;
73
+ /**
74
+ * Function to render items as custom components instead of strings.
75
+ * Defaults to null and is overridden by a getter
76
+ */
77
+ itemToElement?: FunctionComponent<Item>;
78
+ /**
79
+ * Helper function passed to downshift that allows the library to render
80
+ * a given item to a string label.
81
+ *
82
+ * By default, it extracts the `label` field from a given item
83
+ * to serve as the item label in the list.
84
+ */
85
+ itemToString?(item: Item | null): string;
86
+ /**
87
+ * We try to stay as generic as possible here to allow individuals to pass
88
+ * in a collection of whatever kind of data structure they prefer
89
+ */
90
+ items: Item[];
91
+ /**
92
+ * @deprecated `true` to use the light version.
93
+ */
94
+ light?: boolean;
95
+ /**
96
+ * Specify the locale of the control.
97
+ * Used for the default `compareItems`,
98
+ * which is used for sorting the list of items in the control.
99
+ */
100
+ locale?: string;
101
+ /**
102
+ * `onChange` is a utility for this controlled component to communicate to a
103
+ * consuming component what kind of internal state changes are occurring.
104
+ */
105
+ onChange?(changes: {
106
+ selectedItems: Item[];
107
+ }): void;
108
+ /**
109
+ * A utility for this controlled component
110
+ * to communicate to the currently typed input.
111
+ */
112
+ onInputValueChange?: UseComboboxProps<Item>['onInputValueChange'];
113
+ /**
114
+ * `onMenuChange` is a utility for this controlled component to communicate to a
115
+ * consuming component that the menu was opened(`true`)/closed(`false`).
116
+ */
117
+ onMenuChange?(open: boolean): void;
118
+ /**
119
+ * Initialize the component with an open(`true`)/closed(`false`) menu.
120
+ */
121
+ open?: boolean;
122
+ /**
123
+ * Generic `placeholder` that will be used as the textual representation of
124
+ * what this field is for
125
+ */
126
+ placeholder?: string;
127
+ /**
128
+ * Specify feedback (mode) of the selection.
129
+ * `top`: selected item jumps to top
130
+ * `fixed`: selected item stays at its position
131
+ * `top-after-reopen`: selected item jump to top after reopen dropdown
132
+ */
133
+ selectionFeedback?: 'top' | 'fixed' | 'top-after-reopen';
134
+ /**
135
+ * For full control of the selected items
136
+ */
137
+ selectedItems?: Item[];
138
+ /**
139
+ * Specify the size of the ListBox.
140
+ * Currently, supports either `sm`, `md` or `lg` as an option.
141
+ */
142
+ size?: 'sm' | 'md' | 'lg';
143
+ /**
144
+ * **Experimental**: Provide a `Slug` component to be rendered inside the `Checkbox` component
145
+ */
146
+ slug?: ReactNodeLike;
147
+ /**
148
+ * Provide text to be used in a `<label>` element that is tied to the
149
+ * combobox via ARIA attributes.
150
+ */
151
+ titleText?: ReactNode;
152
+ /**
153
+ * Callback function for translating ListBoxMenuIcon SVG title
154
+ */
155
+ translateWithId?(messageId: string, args?: Record<string, unknown>): string;
156
+ type?: 'default' | 'inline';
157
+ /**
158
+ * Specify title to show title on hover
159
+ */
160
+ useTitleInItem?: boolean;
161
+ /**
162
+ * Specify whether the control is currently in warning state
163
+ */
164
+ warn?: boolean;
165
+ /**
166
+ * Provide the text that is displayed when the control is in warning state
167
+ */
168
+ warnText?: ReactNode;
169
+ }
170
+ declare const FilterableMultiSelect: {
171
+ <Item extends ItemBase>(props: FilterableMultiSelectProps<Item>): ReactElement;
172
+ propTypes?: any;
173
+ contextTypes?: any;
174
+ defaultProps?: any;
175
+ displayName?: any;
176
+ };
177
+ export default FilterableMultiSelect;