@carbon/react 1.67.1 → 1.68.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/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +880 -880
- package/es/components/ComboBox/ComboBox.d.ts +5 -0
- package/es/components/ComboBox/ComboBox.js +147 -45
- package/es/components/ComposedModal/ModalHeader.js +1 -1
- package/es/components/DatePicker/DatePicker.js +10 -6
- package/es/components/Dropdown/Dropdown.js +3 -2
- package/es/components/FeatureFlags/index.d.ts +56 -0
- package/es/components/FeatureFlags/index.js +2 -2
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.d.ts +15 -0
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +1 -2
- package/es/components/FluidComboBox/FluidComboBox.d.ts +102 -0
- package/es/components/FluidComboBox/FluidComboBox.js +2 -3
- package/es/components/FluidComboBox/index.d.ts +13 -0
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.d.ts +19 -0
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +2 -2
- package/es/components/FluidDatePicker/FluidDatePicker.d.ts +39 -0
- package/es/components/FluidDatePicker/FluidDatePicker.js +2 -3
- package/es/components/FluidDatePicker/index.d.ts +13 -0
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.d.ts +10 -0
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +1 -2
- package/es/components/FluidDatePickerInput/index.d.ts +9 -0
- package/es/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +144 -0
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.d.ts +15 -0
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +1 -2
- package/es/components/FluidMultiSelect/FluidMultiSelect.d.ts +149 -0
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +5 -3
- package/es/components/FluidMultiSelect/index.d.ts +13 -0
- package/es/components/FluidNumberInput/index.d.ts +2 -2
- package/es/components/FluidSearch/index.d.ts +2 -2
- package/es/components/FluidSelect/index.d.ts +2 -2
- package/es/components/FluidTimePicker/index.d.ts +2 -2
- package/es/components/Modal/Modal.js +1 -1
- package/es/components/MultiSelect/FilterableMultiSelect.d.ts +2 -2
- package/es/components/Tabs/usePressable.js +2 -0
- package/es/components/Tooltip/DefinitionTooltip.js +4 -2
- package/es/index.js +7 -7
- package/lib/components/ComboBox/ComboBox.d.ts +5 -0
- package/lib/components/ComboBox/ComboBox.js +146 -44
- package/lib/components/ComposedModal/ModalHeader.js +1 -1
- package/lib/components/DatePicker/DatePicker.js +9 -5
- package/lib/components/Dropdown/Dropdown.js +3 -2
- package/lib/components/FeatureFlags/index.d.ts +56 -0
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.d.ts +15 -0
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +1 -2
- package/lib/components/FluidComboBox/FluidComboBox.d.ts +102 -0
- package/lib/components/FluidComboBox/FluidComboBox.js +2 -3
- package/lib/components/FluidComboBox/index.d.ts +13 -0
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.d.ts +19 -0
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +2 -2
- package/lib/components/FluidDatePicker/FluidDatePicker.d.ts +39 -0
- package/lib/components/FluidDatePicker/FluidDatePicker.js +3 -4
- package/lib/components/FluidDatePicker/index.d.ts +13 -0
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.d.ts +10 -0
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +1 -2
- package/lib/components/FluidDatePickerInput/index.d.ts +9 -0
- package/lib/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +144 -0
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.d.ts +15 -0
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +1 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.d.ts +149 -0
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +5 -3
- package/lib/components/FluidMultiSelect/index.d.ts +13 -0
- package/lib/components/FluidNumberInput/index.d.ts +2 -2
- package/lib/components/FluidSearch/index.d.ts +2 -2
- package/lib/components/FluidSelect/index.d.ts +2 -2
- package/lib/components/FluidTimePicker/index.d.ts +2 -2
- package/lib/components/Modal/Modal.js +1 -1
- package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +2 -2
- package/lib/components/Tabs/usePressable.js +2 -0
- package/lib/components/Tooltip/DefinitionTooltip.js +4 -2
- package/lib/index.js +14 -14
- package/package.json +9 -9
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022
|
|
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 FluidComboBox from './FluidComboBox';
|
|
8
|
+
import type { FluidComboBoxProps } from './FluidComboBox';
|
|
9
|
+
import type { FluidComboBoxSkeletonProps } from './FluidComboBox.Skeleton';
|
|
10
|
+
export type { FluidComboBoxProps, FluidComboBoxSkeletonProps };
|
|
11
|
+
export default FluidComboBox;
|
|
12
|
+
export { FluidComboBox };
|
|
13
|
+
export { default as FluidComboBoxSkeleton } from './FluidComboBox.Skeleton';
|
|
@@ -0,0 +1,19 @@
|
|
|
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 React from 'react';
|
|
8
|
+
export interface FluidDatePickerSkeletonProps {
|
|
9
|
+
/**
|
|
10
|
+
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
11
|
+
*/
|
|
12
|
+
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Specify which variant of the DatePicker the skeleton should mimic
|
|
15
|
+
*/
|
|
16
|
+
datePickerType?: 'simple' | 'single' | 'range';
|
|
17
|
+
}
|
|
18
|
+
declare const FluidDatePickerSkeleton: React.FC<FluidDatePickerSkeletonProps>;
|
|
19
|
+
export default FluidDatePickerSkeleton;
|
|
@@ -13,7 +13,7 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
13
13
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
14
14
|
import { Calendar } from '@carbon/icons-react';
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
const FluidDatePickerSkeleton = _ref => {
|
|
17
17
|
let {
|
|
18
18
|
className,
|
|
19
19
|
datePickerType = 'single',
|
|
@@ -50,7 +50,7 @@ function FluidDatePickerSkeleton(_ref) {
|
|
|
50
50
|
role: "img",
|
|
51
51
|
"aria-hidden": "true"
|
|
52
52
|
}))));
|
|
53
|
-
}
|
|
53
|
+
};
|
|
54
54
|
FluidDatePickerSkeleton.propTypes = {
|
|
55
55
|
/**
|
|
56
56
|
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022
|
|
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 React from 'react';
|
|
8
|
+
export interface FluidDatePickerProps {
|
|
9
|
+
/**
|
|
10
|
+
* The child node(s)
|
|
11
|
+
*/
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Specify whether or not the control is invalid
|
|
19
|
+
*/
|
|
20
|
+
invalid?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Provide the text that is displayed when the control is in error state
|
|
23
|
+
*/
|
|
24
|
+
invalidText?: React.ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the input should be read-only
|
|
27
|
+
*/
|
|
28
|
+
readOnly?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Specify whether the control is currently in warning state
|
|
31
|
+
*/
|
|
32
|
+
warn?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Provide the text that is displayed when the control is in warning state
|
|
35
|
+
*/
|
|
36
|
+
warnText?: React.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
declare const FluidDatePicker: React.FC<FluidDatePickerProps>;
|
|
39
|
+
export default FluidDatePicker;
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
|
-
import React__default from 'react';
|
|
11
10
|
import cx from 'classnames';
|
|
12
11
|
import DatePicker from '../DatePicker/DatePicker.js';
|
|
13
12
|
import '../DatePicker/DatePicker.Skeleton.js';
|
|
14
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
14
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
15
|
+
import React__default from 'react';
|
|
16
16
|
|
|
17
17
|
const FluidDatePicker = /*#__PURE__*/React__default.forwardRef(function FluidDatePicker(_ref, ref) {
|
|
18
18
|
let {
|
|
@@ -76,6 +76,5 @@ FluidDatePicker.propTypes = {
|
|
|
76
76
|
*/
|
|
77
77
|
warnText: PropTypes.node
|
|
78
78
|
};
|
|
79
|
-
var FluidDatePicker$1 = FluidDatePicker;
|
|
80
79
|
|
|
81
|
-
export { FluidDatePicker
|
|
80
|
+
export { FluidDatePicker as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022
|
|
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 FluidDatePicker from './FluidDatePicker';
|
|
8
|
+
import type { FluidDatePickerProps } from './FluidDatePicker';
|
|
9
|
+
import { FluidDatePickerSkeletonProps } from './FluidDatePicker.Skeleton';
|
|
10
|
+
export type { FluidDatePickerProps, FluidDatePickerSkeletonProps };
|
|
11
|
+
export { default as FluidDatePickerSkeleton } from './FluidDatePicker.Skeleton';
|
|
12
|
+
export default FluidDatePicker;
|
|
13
|
+
export { FluidDatePicker };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022
|
|
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 React from 'react';
|
|
8
|
+
import { DatePickerInputProps } from '../DatePickerInput';
|
|
9
|
+
declare const FluidDatePickerInput: React.ForwardRefExoticComponent<DatePickerInputProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export default FluidDatePickerInput;
|
|
@@ -22,6 +22,5 @@ const FluidDatePickerInput = /*#__PURE__*/React__default.forwardRef(function Flu
|
|
|
22
22
|
ref: ref
|
|
23
23
|
}, other)));
|
|
24
24
|
});
|
|
25
|
-
var FluidDatePickerInput$1 = FluidDatePickerInput;
|
|
26
25
|
|
|
27
|
-
export { FluidDatePickerInput
|
|
26
|
+
export { FluidDatePickerInput as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022
|
|
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 FluidDatePickerInput from './FluidDatePickerInput';
|
|
8
|
+
export default FluidDatePickerInput;
|
|
9
|
+
export { FluidDatePickerInput };
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022
|
|
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 React, { FunctionComponent } from 'react';
|
|
8
|
+
import { UseComboboxProps, UseMultipleSelectionProps } from 'downshift';
|
|
9
|
+
import { FilterableMultiSelectProps } from '../MultiSelect/FilterableMultiSelect';
|
|
10
|
+
interface OnChangeData<ItemType> {
|
|
11
|
+
selectedItems: ItemType[] | null;
|
|
12
|
+
}
|
|
13
|
+
export interface FluidFilterableMultiSelectProps<ItemType> extends FilterableMultiSelectProps<ItemType> {
|
|
14
|
+
/**
|
|
15
|
+
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Specify the text that should be read for screen readers that describes total items selected
|
|
20
|
+
*/
|
|
21
|
+
clearSelectionDescription?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Specify the text that should be read for screen readers to clear selection.
|
|
24
|
+
*/
|
|
25
|
+
clearSelectionText?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Specify the direction of the multiselect dropdown. Can be either top or bottom.
|
|
28
|
+
*/
|
|
29
|
+
direction?: 'top' | 'bottom';
|
|
30
|
+
/**
|
|
31
|
+
* Specify whether the `<input>` should be disabled
|
|
32
|
+
*/
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Additional props passed to Downshift.
|
|
36
|
+
*
|
|
37
|
+
* **Use with caution:** anything you define here overrides the components'
|
|
38
|
+
* internal handling of that prop. Downshift APIs and internals are subject to
|
|
39
|
+
* change, and in some cases they can not be shimmed by Carbon to shield you
|
|
40
|
+
* from potentially breaking changes.
|
|
41
|
+
*/
|
|
42
|
+
downshiftProps?: Partial<UseMultipleSelectionProps<ItemType>>;
|
|
43
|
+
/**
|
|
44
|
+
* Specify a custom `id` for the `<input>`
|
|
45
|
+
*/
|
|
46
|
+
id: string;
|
|
47
|
+
/**
|
|
48
|
+
* Allow users to pass in arbitrary items from their collection that are
|
|
49
|
+
* pre-selected
|
|
50
|
+
*/
|
|
51
|
+
initialSelectedItems?: ItemType[];
|
|
52
|
+
/**
|
|
53
|
+
* Specify if the currently selected value is invalid.
|
|
54
|
+
*/
|
|
55
|
+
invalid?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Provide the text that is displayed when the control is in an invalid state
|
|
58
|
+
*/
|
|
59
|
+
invalidText?: React.ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* Specify if the `FluidMultiSelect` should render its menu items in condensed mode
|
|
62
|
+
*/
|
|
63
|
+
isCondensed?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Function to render items as custom components instead of strings.
|
|
66
|
+
* Defaults to null and is overridden by a getter
|
|
67
|
+
*/
|
|
68
|
+
itemToElement?: FunctionComponent<ItemType>;
|
|
69
|
+
/**
|
|
70
|
+
* Helper function passed to downshift that allows the library to render a
|
|
71
|
+
* given item to a string label. By default, it extracts the `label` field
|
|
72
|
+
* from a given item to serve as the item label in the list. Consider
|
|
73
|
+
* declaring function with `useCallback` to prevent unnecessary re-renders.
|
|
74
|
+
*/
|
|
75
|
+
itemToString?(item: ItemType): string;
|
|
76
|
+
/**
|
|
77
|
+
* We try to stay as generic as possible here to allow individuals to pass
|
|
78
|
+
* in a collection of whatever kind of data structure they prefer
|
|
79
|
+
*/
|
|
80
|
+
items: ItemType[];
|
|
81
|
+
/**
|
|
82
|
+
* Generic `label` that will be used as the textual representation of what
|
|
83
|
+
* this field is for
|
|
84
|
+
*/
|
|
85
|
+
label: NonNullable<React.ReactNode>;
|
|
86
|
+
/**
|
|
87
|
+
* Specify the locale of the control. Used for the default `compareItems`
|
|
88
|
+
* used for sorting the list of items in the control.
|
|
89
|
+
*/
|
|
90
|
+
locale?: string;
|
|
91
|
+
/**
|
|
92
|
+
* `onChange` is a utility for this controlled component to communicate to a
|
|
93
|
+
* consuming component what kind of internal state changes are occurring.
|
|
94
|
+
*/
|
|
95
|
+
onChange?(data: OnChangeData<ItemType>): void;
|
|
96
|
+
/**
|
|
97
|
+
* **Filterable variant only** - `onInputValueChange` is a utility for this controlled component to communicate to
|
|
98
|
+
* the currently typed input.
|
|
99
|
+
*/
|
|
100
|
+
onInputValueChange?: UseComboboxProps<ItemType>['onInputValueChange'];
|
|
101
|
+
/**
|
|
102
|
+
* `onMenuChange` is a utility for this controlled component to communicate to a
|
|
103
|
+
* consuming component that the menu was open(`true`)/closed(`false`).
|
|
104
|
+
*/
|
|
105
|
+
onMenuChange?(open: boolean): void;
|
|
106
|
+
/**
|
|
107
|
+
* Whether or not the Multiselect is readonly
|
|
108
|
+
*/
|
|
109
|
+
readOnly?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* For full control of the selected items
|
|
112
|
+
*/
|
|
113
|
+
selectedItems?: ItemType[];
|
|
114
|
+
/**
|
|
115
|
+
* Specify feedback (mode) of the selection.
|
|
116
|
+
* `top`: selected item jumps to top
|
|
117
|
+
* `fixed`: selected item stays at it's position
|
|
118
|
+
* `top-after-reopen`: selected item jump to top after reopen dropdown
|
|
119
|
+
*/
|
|
120
|
+
selectionFeedback?: 'top' | 'fixed' | 'top-after-reopen';
|
|
121
|
+
/**
|
|
122
|
+
* Provide the title text that will be read by a screen reader when
|
|
123
|
+
* visiting this control
|
|
124
|
+
*/
|
|
125
|
+
titleText?: React.ReactNode;
|
|
126
|
+
/**
|
|
127
|
+
* Callback function for translating ListBoxMenuIcon SVG title
|
|
128
|
+
*/
|
|
129
|
+
translateWithId?: (id: string) => string;
|
|
130
|
+
/**
|
|
131
|
+
* Specify title to show title on hover
|
|
132
|
+
*/
|
|
133
|
+
useTitleInItem?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Specify whether the control is currently in warning state
|
|
136
|
+
*/
|
|
137
|
+
warn?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Provide the text that is displayed when the control is in warning state
|
|
140
|
+
*/
|
|
141
|
+
warnText?: React.ReactNode;
|
|
142
|
+
}
|
|
143
|
+
declare const FluidMultiSelect: React.ForwardRefExoticComponent<Omit<FluidFilterableMultiSelectProps<unknown>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
144
|
+
export default FluidMultiSelect;
|
|
@@ -0,0 +1,15 @@
|
|
|
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 React from 'react';
|
|
8
|
+
export interface FluidMultiSelectSkeletonProps {
|
|
9
|
+
/**
|
|
10
|
+
* Specify an optional className to add.
|
|
11
|
+
*/
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const FluidMultiSelectSkeleton: React.FC<FluidMultiSelectSkeletonProps>;
|
|
15
|
+
export default FluidMultiSelectSkeleton;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022
|
|
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 React from 'react';
|
|
8
|
+
import { UseSelectProps } from 'downshift';
|
|
9
|
+
import { MultiSelectProps } from '../MultiSelect/MultiSelect';
|
|
10
|
+
interface OnChangeData<ItemType> {
|
|
11
|
+
selectedItems: ItemType[] | null;
|
|
12
|
+
}
|
|
13
|
+
export interface FluidMultiSelectProps<ItemType> extends MultiSelectProps<ItemType> {
|
|
14
|
+
/**
|
|
15
|
+
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Specify the text that should be read for screen readers that describes total items selected
|
|
20
|
+
*/
|
|
21
|
+
clearSelectionDescription?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Specify the text that should be read for screen readers to clear selection.
|
|
24
|
+
*/
|
|
25
|
+
clearSelectionText?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Specify the direction of the multiselect dropdown. Can be either top or bottom.
|
|
28
|
+
*/
|
|
29
|
+
direction?: 'top' | 'bottom';
|
|
30
|
+
/**
|
|
31
|
+
* Specify whether the `<input>` should be disabled
|
|
32
|
+
*/
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Additional props passed to Downshift.
|
|
36
|
+
*
|
|
37
|
+
* **Use with caution:** anything you define here overrides the components'
|
|
38
|
+
* internal handling of that prop. Downshift APIs and internals are subject to
|
|
39
|
+
* change, and in some cases they can not be shimmed by Carbon to shield you
|
|
40
|
+
* from potentially breaking changes.
|
|
41
|
+
*/
|
|
42
|
+
downshiftProps?: Partial<UseSelectProps<ItemType>>;
|
|
43
|
+
/**
|
|
44
|
+
* Specify a custom `id` for the `<input>`
|
|
45
|
+
*/
|
|
46
|
+
id: string;
|
|
47
|
+
/**
|
|
48
|
+
* Allow users to pass in arbitrary items from their collection that are
|
|
49
|
+
* pre-selected
|
|
50
|
+
*/
|
|
51
|
+
initialSelectedItems?: ItemType[];
|
|
52
|
+
/**
|
|
53
|
+
* Specify if the currently selected value is invalid.
|
|
54
|
+
*/
|
|
55
|
+
invalid?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Provide the text that is displayed when the control is in an invalid state
|
|
58
|
+
*/
|
|
59
|
+
invalidText?: React.ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* Specify if the `FluidMultiSelect` should render its menu items in condensed mode
|
|
62
|
+
*/
|
|
63
|
+
isCondensed?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Specify if the `FluidMultiSelect` should render the `filterable` variant of `FluidMultiSelect`
|
|
66
|
+
* @deprecated This prop is deprecated in favor of new component called FluidFilterableMultiSelect and will be removed in the next major release
|
|
67
|
+
*/
|
|
68
|
+
isFilterable?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Function to render items as custom components instead of strings.
|
|
71
|
+
* Defaults to null and is overridden by a getter
|
|
72
|
+
*/
|
|
73
|
+
itemToElement?: React.JSXElementConstructor<ItemType>;
|
|
74
|
+
/**
|
|
75
|
+
* Helper function passed to downshift that allows the library to render a
|
|
76
|
+
* given item to a string label. By default, it extracts the `label` field
|
|
77
|
+
* from a given item to serve as the item label in the list. Consider
|
|
78
|
+
* declaring function with `useCallback` to prevent unnecessary re-renders.
|
|
79
|
+
*/
|
|
80
|
+
itemToString?(item: ItemType): string;
|
|
81
|
+
/**
|
|
82
|
+
* We try to stay as generic as possible here to allow individuals to pass
|
|
83
|
+
* in a collection of whatever kind of data structure they prefer
|
|
84
|
+
*/
|
|
85
|
+
items: ItemType[];
|
|
86
|
+
/**
|
|
87
|
+
* Generic `label` that will be used as the textual representation of what
|
|
88
|
+
* this field is for
|
|
89
|
+
*/
|
|
90
|
+
label: NonNullable<React.ReactNode>;
|
|
91
|
+
/**
|
|
92
|
+
* Specify the locale of the control. Used for the default `compareItems`
|
|
93
|
+
* used for sorting the list of items in the control.
|
|
94
|
+
*/
|
|
95
|
+
locale?: string;
|
|
96
|
+
/**
|
|
97
|
+
* `onChange` is a utility for this controlled component to communicate to a
|
|
98
|
+
* consuming component what kind of internal state changes are occurring.
|
|
99
|
+
*/
|
|
100
|
+
onChange?(data: OnChangeData<ItemType>): void;
|
|
101
|
+
/**
|
|
102
|
+
* **Filterable variant only** - `onInputValueChange` is a utility for this controlled component to communicate to
|
|
103
|
+
* the currently typed input.
|
|
104
|
+
*/
|
|
105
|
+
onInputValueChange?: (inputValue: string) => void;
|
|
106
|
+
/**
|
|
107
|
+
* `onMenuChange` is a utility for this controlled component to communicate to a
|
|
108
|
+
* consuming component that the menu was open(`true`)/closed(`false`).
|
|
109
|
+
*/
|
|
110
|
+
onMenuChange?(open: boolean): void;
|
|
111
|
+
/**
|
|
112
|
+
* Whether or not the Multiselect is readonly
|
|
113
|
+
*/
|
|
114
|
+
readOnly?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* For full control of the selected items
|
|
117
|
+
*/
|
|
118
|
+
selectedItems?: ItemType[];
|
|
119
|
+
/**
|
|
120
|
+
* Specify feedback (mode) of the selection.
|
|
121
|
+
* `top`: selected item jumps to top
|
|
122
|
+
* `fixed`: selected item stays at it's position
|
|
123
|
+
* `top-after-reopen`: selected item jump to top after reopen dropdown
|
|
124
|
+
*/
|
|
125
|
+
selectionFeedback?: 'top' | 'fixed' | 'top-after-reopen';
|
|
126
|
+
/**
|
|
127
|
+
* Provide the title text that will be read by a screen reader when
|
|
128
|
+
* visiting this control
|
|
129
|
+
*/
|
|
130
|
+
titleText?: React.ReactNode;
|
|
131
|
+
/**
|
|
132
|
+
* Callback function for translating ListBoxMenuIcon SVG title
|
|
133
|
+
*/
|
|
134
|
+
translateWithId?: (id: string) => string;
|
|
135
|
+
/**
|
|
136
|
+
* Specify title to show title on hover
|
|
137
|
+
*/
|
|
138
|
+
useTitleInItem?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Specify whether the control is currently in warning state
|
|
141
|
+
*/
|
|
142
|
+
warn?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Provide the text that is displayed when the control is in warning state
|
|
145
|
+
*/
|
|
146
|
+
warnText?: React.ReactNode;
|
|
147
|
+
}
|
|
148
|
+
declare const FluidMultiSelect: React.ForwardRefExoticComponent<FluidMultiSelectProps<unknown> & React.RefAttributes<HTMLButtonElement>>;
|
|
149
|
+
export default FluidMultiSelect;
|
|
@@ -30,7 +30,10 @@ const FluidMultiSelect = /*#__PURE__*/React__default.forwardRef(function FluidMu
|
|
|
30
30
|
value: {
|
|
31
31
|
isFluid: true
|
|
32
32
|
}
|
|
33
|
-
}, isFilterable ?
|
|
33
|
+
}, isFilterable ?
|
|
34
|
+
/*#__PURE__*/
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
React__default.createElement(FilterableMultiSelect, _extends({
|
|
34
37
|
ref: ref,
|
|
35
38
|
className: classNames
|
|
36
39
|
}, other)) : /*#__PURE__*/React__default.createElement(MultiSelect, _extends({
|
|
@@ -199,6 +202,5 @@ FluidMultiSelect.propTypes = {
|
|
|
199
202
|
*/
|
|
200
203
|
warnText: PropTypes.node
|
|
201
204
|
};
|
|
202
|
-
var FluidMultiSelect$1 = FluidMultiSelect;
|
|
203
205
|
|
|
204
|
-
export { FluidMultiSelect
|
|
206
|
+
export { FluidMultiSelect as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2022
|
|
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 FluidMultiSelect from './FluidMultiSelect';
|
|
8
|
+
import type { FluidMultiSelectProps } from './FluidMultiSelect';
|
|
9
|
+
import type { FluidMultiSelectSkeletonProps } from './FluidMultiSelect.Skeleton';
|
|
10
|
+
export type { FluidMultiSelectProps, FluidMultiSelectSkeletonProps };
|
|
11
|
+
export default FluidMultiSelect;
|
|
12
|
+
export { FluidMultiSelect };
|
|
13
|
+
export { default as FluidMultiSelectSkeleton } from './FluidMultiSelect.Skeleton';
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import { FluidNumberInputProps } from './FluidNumberInput';
|
|
8
|
-
import { FluidNumberInputSkeletonProps } from './FluidNumberInput.Skeleton';
|
|
7
|
+
import type { FluidNumberInputProps } from './FluidNumberInput';
|
|
8
|
+
import type { FluidNumberInputSkeletonProps } from './FluidNumberInput.Skeleton';
|
|
9
9
|
export { type FluidNumberInputProps, type FluidNumberInputSkeletonProps };
|
|
10
10
|
export { default, default as FluidNumberInput } from './FluidNumberInput';
|
|
11
11
|
export { default as FluidNumberInputSkeleton } from './FluidNumberInput.Skeleton';
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import { FluidSearchProps } from './FluidSearch';
|
|
8
|
-
import { FluidSearchSkeletonProps } from './FluidSearch.Skeleton';
|
|
7
|
+
import type { FluidSearchProps } from './FluidSearch';
|
|
8
|
+
import type { FluidSearchSkeletonProps } from './FluidSearch.Skeleton';
|
|
9
9
|
export { default, default as FluidSearch } from './FluidSearch';
|
|
10
10
|
export { type FluidSearchProps, type FluidSearchSkeletonProps };
|
|
11
11
|
export { default as FluidSearchSkeleton } from './FluidSearch.Skeleton';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import FluidSelect from './FluidSelect';
|
|
8
|
-
import FluidSelectSkeletonProps from './FluidSelect.Skeleton';
|
|
9
|
-
import FluidSelectProps from './FluidSelect.Skeleton';
|
|
8
|
+
import type FluidSelectSkeletonProps from './FluidSelect.Skeleton';
|
|
9
|
+
import type FluidSelectProps from './FluidSelect.Skeleton';
|
|
10
10
|
export type { FluidSelectSkeletonProps, FluidSelectProps };
|
|
11
11
|
export default FluidSelect;
|
|
12
12
|
export { FluidSelect };
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import FluidTimePicker from './FluidTimePicker';
|
|
8
|
-
import { FluidTimePickerProps } from './FluidTimePicker';
|
|
9
|
-
import { FluidTimePickerSkeletonProps } from './FluidTimePicker.Skeleton';
|
|
8
|
+
import { type FluidTimePickerProps } from './FluidTimePicker';
|
|
9
|
+
import { type FluidTimePickerSkeletonProps } from './FluidTimePicker.Skeleton';
|
|
10
10
|
export { default as FluidTimePickerSkeleton } from './FluidTimePicker.Skeleton';
|
|
11
11
|
export type { FluidTimePickerProps, FluidTimePickerSkeletonProps };
|
|
12
12
|
export default FluidTimePicker;
|
|
@@ -264,7 +264,7 @@ const Modal = /*#__PURE__*/React__default.forwardRef(function Modal(_ref, ref) {
|
|
|
264
264
|
id: modalLabelId,
|
|
265
265
|
className: `${prefix}--modal-header__label`
|
|
266
266
|
}, modalLabel), /*#__PURE__*/React__default.createElement(Text, {
|
|
267
|
-
as: "
|
|
267
|
+
as: "h2",
|
|
268
268
|
id: modalHeadingId,
|
|
269
269
|
className: `${prefix}--modal-header__heading`
|
|
270
270
|
}, modalHeading), normalizedSlug, !passiveModal && modalButton), /*#__PURE__*/React__default.createElement(Layer, _extends({
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import { type UseComboboxProps, type UseMultipleSelectionProps } from 'downshift';
|
|
8
|
-
import { ReactNode, FunctionComponent, ReactElement } from 'react';
|
|
8
|
+
import React, { ReactNode, FunctionComponent, ReactElement } from 'react';
|
|
9
9
|
import { type MultiSelectSortingProps } from './MultiSelectPropTypes';
|
|
10
10
|
import { TranslateWithId } from '../../types/common';
|
|
11
11
|
/**
|
|
@@ -16,7 +16,7 @@ import { TranslateWithId } from '../../types/common';
|
|
|
16
16
|
* ends up just being defined as "string".)
|
|
17
17
|
*/
|
|
18
18
|
type TranslationKey = 'close.menu' | 'open.menu' | 'clear.all' | 'clear.selection';
|
|
19
|
-
export interface FilterableMultiSelectProps<ItemType> extends MultiSelectSortingProps<ItemType>, TranslateWithId<TranslationKey> {
|
|
19
|
+
export interface FilterableMultiSelectProps<ItemType> extends MultiSelectSortingProps<ItemType>, React.RefAttributes<HTMLDivElement>, TranslateWithId<TranslationKey> {
|
|
20
20
|
/**
|
|
21
21
|
* Specify a label to be read by screen readers on the container node
|
|
22
22
|
* @deprecated
|
|
@@ -60,8 +60,10 @@ const DefinitionTooltip = _ref => {
|
|
|
60
60
|
onBlur: () => {
|
|
61
61
|
setOpen(false);
|
|
62
62
|
},
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
onMouseDown: event => {
|
|
64
|
+
// We use onMouseDown rather than onClick to make sure this triggers
|
|
65
|
+
// before onFocus.
|
|
66
|
+
if (event.button === 0) setOpen(!isOpen);
|
|
65
67
|
},
|
|
66
68
|
onKeyDown: onKeyDown,
|
|
67
69
|
type: "button"
|
package/es/index.js
CHANGED
|
@@ -159,6 +159,13 @@ export { default as SideNavMenuItem } from './components/UIShell/SideNavMenuItem
|
|
|
159
159
|
export { default as SideNavSwitcher } from './components/UIShell/SideNavSwitcher.js';
|
|
160
160
|
export { default as UnorderedList } from './components/UnorderedList/UnorderedList.js';
|
|
161
161
|
export { FeatureFlags as unstable_FeatureFlags, useFeatureFlag as unstable_useFeatureFlag, useFeatureFlags as unstable_useFeatureFlags } from './components/FeatureFlags/index.js';
|
|
162
|
+
export { default as unstable__FluidComboBox } from './components/FluidComboBox/FluidComboBox.js';
|
|
163
|
+
export { default as unstable__FluidComboBoxSkeleton } from './components/FluidComboBox/FluidComboBox.Skeleton.js';
|
|
164
|
+
export { default as unstable__FluidDatePicker } from './components/FluidDatePicker/FluidDatePicker.js';
|
|
165
|
+
export { default as unstable__FluidDatePickerSkeleton } from './components/FluidDatePicker/FluidDatePicker.Skeleton.js';
|
|
166
|
+
export { default as unstable__FluidDatePickerInput } from './components/FluidDatePickerInput/FluidDatePickerInput.js';
|
|
167
|
+
export { default as unstable__FluidMultiSelect } from './components/FluidMultiSelect/FluidMultiSelect.js';
|
|
168
|
+
export { default as unstable__FluidMultiSelectSkeleton } from './components/FluidMultiSelect/FluidMultiSelect.Skeleton.js';
|
|
162
169
|
export { default as unstable__FluidSelect } from './components/FluidSelect/FluidSelect.js';
|
|
163
170
|
export { default as unstable__FluidSelectSkeleton } from './components/FluidSelect/FluidSelect.Skeleton.js';
|
|
164
171
|
export { default as unstable__FluidSearch } from './components/FluidSearch/FluidSearch.js';
|
|
@@ -190,7 +197,6 @@ import './components/Text/index.js';
|
|
|
190
197
|
export { GlobalTheme, Theme, ThemeContext, usePrefersDarkScheme, useTheme } from './components/Theme/index.js';
|
|
191
198
|
export { PrefixContext, usePrefix } from './internal/usePrefix.js';
|
|
192
199
|
export { useIdPrefix } from './internal/useIdPrefix.js';
|
|
193
|
-
export { default as unstable__FluidDatePickerSkeleton } from './components/FluidDatePicker/FluidDatePicker.Skeleton.js';
|
|
194
200
|
export { default as unstable_PageSelector } from './components/Pagination/experimental/PageSelector.js';
|
|
195
201
|
export { default as unstable_Pagination } from './components/Pagination/experimental/Pagination.js';
|
|
196
202
|
export { default as ContainedListItem } from './components/ContainedList/ContainedListItem/ContainedListItem.js';
|
|
@@ -199,14 +205,8 @@ export { default as useContextMenu } from './components/ContextMenu/useContextMe
|
|
|
199
205
|
export { default as SliderSkeleton } from './components/Slider/Slider.Skeleton.js';
|
|
200
206
|
export { default as TextInputSkeleton } from './components/TextInput/TextInput.Skeleton.js';
|
|
201
207
|
export { default as TextInput } from './components/TextInput/TextInput.js';
|
|
202
|
-
export { default as unstable__FluidComboBox } from './components/FluidComboBox/FluidComboBox.js';
|
|
203
|
-
export { default as unstable__FluidComboBoxSkeleton } from './components/FluidComboBox/FluidComboBox.Skeleton.js';
|
|
204
|
-
export { default as unstable__FluidDatePicker } from './components/FluidDatePicker/FluidDatePicker.js';
|
|
205
|
-
export { default as unstable__FluidDatePickerInput } from './components/FluidDatePickerInput/FluidDatePickerInput.js';
|
|
206
208
|
export { default as unstable__FluidDropdown } from './components/FluidDropdown/FluidDropdown.js';
|
|
207
209
|
export { default as unstable__FluidDropdownSkeleton } from './components/FluidDropdown/FluidDropdown.Skeleton.js';
|
|
208
|
-
export { default as unstable__FluidMultiSelect } from './components/FluidMultiSelect/FluidMultiSelect.js';
|
|
209
|
-
export { default as unstable__FluidMultiSelectSkeleton } from './components/FluidMultiSelect/FluidMultiSelect.Skeleton.js';
|
|
210
210
|
export { LayoutDirection as unstable_LayoutDirection } from './components/LayoutDirection/LayoutDirection.js';
|
|
211
211
|
export { useLayoutDirection as unstable_useLayoutDirection } from './components/LayoutDirection/useLayoutDirection.js';
|
|
212
212
|
export { Text as unstable_Text } from './components/Text/Text.js';
|