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