@mongodb-js/compass-components 1.32.1 → 1.32.2
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/lib/components/actions/action-glyph.d.ts +11 -0
- package/lib/components/actions/action-glyph.d.ts.map +1 -0
- package/lib/components/actions/action-glyph.js +19 -0
- package/lib/components/actions/action-glyph.js.map +1 -0
- package/lib/components/actions/constants.d.ts +7 -0
- package/lib/components/actions/constants.d.ts.map +1 -0
- package/lib/components/actions/constants.js +9 -0
- package/lib/components/actions/constants.js.map +1 -0
- package/lib/components/actions/dropdown-menu-button.d.ts +19 -0
- package/lib/components/actions/dropdown-menu-button.d.ts.map +1 -0
- package/lib/components/actions/dropdown-menu-button.js +75 -0
- package/lib/components/actions/dropdown-menu-button.js.map +1 -0
- package/lib/components/actions/item-action-button.d.ts +4 -0
- package/lib/components/actions/item-action-button.d.ts.map +1 -0
- package/lib/components/actions/item-action-button.js +22 -0
- package/lib/components/actions/item-action-button.js.map +1 -0
- package/lib/components/actions/item-action-controls.d.ts +20 -0
- package/lib/components/actions/item-action-controls.d.ts.map +1 -0
- package/lib/components/actions/item-action-controls.js +85 -0
- package/lib/components/actions/item-action-controls.js.map +1 -0
- package/lib/components/actions/item-action-group.d.ts +19 -0
- package/lib/components/actions/item-action-group.d.ts.map +1 -0
- package/lib/components/actions/item-action-group.js +69 -0
- package/lib/components/actions/item-action-group.js.map +1 -0
- package/lib/components/actions/item-action-menu.d.ts +20 -0
- package/lib/components/actions/item-action-menu.d.ts.map +1 -0
- package/lib/components/actions/item-action-menu.js +89 -0
- package/lib/components/actions/item-action-menu.js.map +1 -0
- package/lib/components/actions/small-icon-button.d.ts +11 -0
- package/lib/components/actions/small-icon-button.d.ts.map +1 -0
- package/lib/components/actions/small-icon-button.js +66 -0
- package/lib/components/actions/small-icon-button.js.map +1 -0
- package/lib/components/actions/types.d.ts +32 -0
- package/lib/components/actions/types.d.ts.map +1 -0
- package/lib/components/actions/types.js +3 -0
- package/lib/components/actions/types.js.map +1 -0
- package/lib/components/actions/utils.d.ts +2 -0
- package/lib/components/actions/utils.d.ts.map +1 -0
- package/lib/components/actions/utils.js +8 -0
- package/lib/components/actions/utils.js.map +1 -0
- package/lib/components/combobox-with-custom-option.d.ts +1 -1
- package/lib/components/combobox-with-custom-option.d.ts.map +1 -1
- package/lib/components/combobox-with-custom-option.js +3 -3
- package/lib/components/combobox-with-custom-option.js.map +1 -1
- package/lib/components/document-list/element-actions.d.ts.map +1 -1
- package/lib/components/document-list/element-actions.js +1 -1
- package/lib/components/document-list/element-actions.js.map +1 -1
- package/lib/components/document-list/element-editors.d.ts.map +1 -1
- package/lib/components/document-list/element-editors.js +12 -5
- package/lib/components/document-list/element-editors.js.map +1 -1
- package/lib/components/document-list/element.d.ts.map +1 -1
- package/lib/components/document-list/element.js +10 -3
- package/lib/components/document-list/element.js.map +1 -1
- package/lib/components/feedback-popover.d.ts +2 -5
- package/lib/components/feedback-popover.d.ts.map +1 -1
- package/lib/components/feedback-popover.js +1 -5
- package/lib/components/feedback-popover.js.map +1 -1
- package/lib/components/file-input.js +3 -3
- package/lib/components/file-input.js.map +1 -1
- package/lib/components/guide-cue/guide-cue.d.ts +1 -2
- package/lib/components/guide-cue/guide-cue.d.ts.map +1 -1
- package/lib/components/guide-cue/guide-cue.js +1 -3
- package/lib/components/guide-cue/guide-cue.js.map +1 -1
- package/lib/components/interactive-popover.d.ts +4 -4
- package/lib/components/interactive-popover.d.ts.map +1 -1
- package/lib/components/interactive-popover.js +1 -1
- package/lib/components/interactive-popover.js.map +1 -1
- package/lib/components/leafygreen.d.ts +4 -54
- package/lib/components/leafygreen.d.ts.map +1 -1
- package/lib/components/leafygreen.js +7 -6
- package/lib/components/leafygreen.js.map +1 -1
- package/lib/components/links/link.d.ts +7 -7
- package/lib/components/tab-nav-bar.d.ts.map +1 -1
- package/lib/components/tab-nav-bar.js +8 -1
- package/lib/components/tab-nav-bar.js.map +1 -1
- package/lib/components/virtual-list.d.ts +3 -5
- package/lib/components/virtual-list.d.ts.map +1 -1
- package/lib/components/virtual-list.js +2 -2
- package/lib/components/virtual-list.js.map +1 -1
- package/lib/components/workspace-tabs/tab.d.ts +2 -3
- package/lib/components/workspace-tabs/tab.d.ts.map +1 -1
- package/lib/components/workspace-tabs/tab.js.map +1 -1
- package/lib/components/workspace-tabs/workspace-tabs.d.ts +2 -2
- package/lib/components/workspace-tabs/workspace-tabs.d.ts.map +1 -1
- package/lib/hooks/use-confirmation.d.ts +0 -1
- package/lib/hooks/use-confirmation.d.ts.map +1 -1
- package/lib/hooks/use-confirmation.js +0 -1
- package/lib/hooks/use-confirmation.js.map +1 -1
- package/lib/hooks/use-stacked-component.d.ts +1 -6
- package/lib/hooks/use-stacked-component.d.ts.map +1 -1
- package/lib/hooks/use-stacked-component.js +9 -28
- package/lib/hooks/use-stacked-component.js.map +1 -1
- package/lib/hooks/use-virtual-list-item-observer.d.ts +2 -4
- package/lib/hooks/use-virtual-list-item-observer.d.ts.map +1 -1
- package/lib/hooks/use-virtual-list-item-observer.js +1 -1
- package/lib/hooks/use-virtual-list-item-observer.js.map +1 -1
- package/lib/index.d.ts +9 -6
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -9
- package/lib/index.js.map +1 -1
- package/package.json +47 -49
- package/lib/components/combobox/Chip.d.ts +0 -4
- package/lib/components/combobox/Chip.d.ts.map +0 -1
- package/lib/components/combobox/Chip.js +0 -230
- package/lib/components/combobox/Chip.js.map +0 -1
- package/lib/components/combobox/Combobox.d.ts +0 -48
- package/lib/components/combobox/Combobox.d.ts.map +0 -1
- package/lib/components/combobox/Combobox.js +0 -1029
- package/lib/components/combobox/Combobox.js.map +0 -1
- package/lib/components/combobox/Combobox.styles.d.ts +0 -53
- package/lib/components/combobox/Combobox.styles.d.ts.map +0 -1
- package/lib/components/combobox/Combobox.styles.js +0 -294
- package/lib/components/combobox/Combobox.styles.js.map +0 -1
- package/lib/components/combobox/Combobox.types.d.ts +0 -295
- package/lib/components/combobox/Combobox.types.d.ts.map +0 -1
- package/lib/components/combobox/Combobox.types.js +0 -66
- package/lib/components/combobox/Combobox.types.js.map +0 -1
- package/lib/components/combobox/ComboboxContext.d.ts +0 -21
- package/lib/components/combobox/ComboboxContext.d.ts.map +0 -1
- package/lib/components/combobox/ComboboxContext.js +0 -19
- package/lib/components/combobox/ComboboxContext.js.map +0 -1
- package/lib/components/combobox/ComboboxGroup.d.ts +0 -15
- package/lib/components/combobox/ComboboxGroup.d.ts.map +0 -1
- package/lib/components/combobox/ComboboxGroup.js +0 -84
- package/lib/components/combobox/ComboboxGroup.js.map +0 -1
- package/lib/components/combobox/ComboboxMenu/ComboboxMenu.d.ts +0 -9
- package/lib/components/combobox/ComboboxMenu/ComboboxMenu.d.ts.map +0 -1
- package/lib/components/combobox/ComboboxMenu/ComboboxMenu.js +0 -91
- package/lib/components/combobox/ComboboxMenu/ComboboxMenu.js.map +0 -1
- package/lib/components/combobox/ComboboxMenu/Menu.styles.d.ts +0 -26
- package/lib/components/combobox/ComboboxMenu/Menu.styles.d.ts.map +0 -1
- package/lib/components/combobox/ComboboxMenu/Menu.styles.js +0 -119
- package/lib/components/combobox/ComboboxMenu/Menu.styles.js.map +0 -1
- package/lib/components/combobox/ComboboxOption.d.ts +0 -20
- package/lib/components/combobox/ComboboxOption.d.ts.map +0 -1
- package/lib/components/combobox/ComboboxOption.js +0 -272
- package/lib/components/combobox/ComboboxOption.js.map +0 -1
- package/lib/components/combobox/Menu.styles.d.ts +0 -22
- package/lib/components/combobox/Menu.styles.d.ts.map +0 -1
- package/lib/components/combobox/Menu.styles.js +0 -102
- package/lib/components/combobox/Menu.styles.js.map +0 -1
- package/lib/components/combobox/index.d.ts +0 -6
- package/lib/components/combobox/index.d.ts.map +0 -1
- package/lib/components/combobox/index.js +0 -15
- package/lib/components/combobox/index.js.map +0 -1
- package/lib/components/combobox/utils/OptionObjectUtils.d.ts +0 -23
- package/lib/components/combobox/utils/OptionObjectUtils.d.ts.map +0 -1
- package/lib/components/combobox/utils/OptionObjectUtils.js +0 -40
- package/lib/components/combobox/utils/OptionObjectUtils.js.map +0 -1
- package/lib/components/combobox/utils/flattenChildren.d.ts +0 -12
- package/lib/components/combobox/utils/flattenChildren.d.ts.map +0 -1
- package/lib/components/combobox/utils/flattenChildren.js +0 -47
- package/lib/components/combobox/utils/flattenChildren.js.map +0 -1
- package/lib/components/combobox/utils/getNameAndValue.d.ts +0 -15
- package/lib/components/combobox/utils/getNameAndValue.d.ts.map +0 -1
- package/lib/components/combobox/utils/getNameAndValue.js +0 -24
- package/lib/components/combobox/utils/getNameAndValue.js.map +0 -1
- package/lib/components/combobox/utils/index.d.ts +0 -5
- package/lib/components/combobox/utils/index.d.ts.map +0 -1
- package/lib/components/combobox/utils/index.js +0 -14
- package/lib/components/combobox/utils/index.js.map +0 -1
- package/lib/components/combobox/utils/wrapJSX.d.ts +0 -15
- package/lib/components/combobox/utils/wrapJSX.d.ts.map +0 -1
- package/lib/components/combobox/utils/wrapJSX.js +0 -53
- package/lib/components/combobox/utils/wrapJSX.js.map +0 -1
- package/lib/components/item-action-controls.d.ts +0 -87
- package/lib/components/item-action-controls.d.ts.map +0 -1
- package/lib/components/item-action-controls.js +0 -239
- package/lib/components/item-action-controls.js.map +0 -1
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import type { Either, HTMLElementProps } from '@leafygreen-ui/lib';
|
|
3
|
-
/**
|
|
4
|
-
* Prop Enums & Types
|
|
5
|
-
*/
|
|
6
|
-
export declare const ComboboxElement: {
|
|
7
|
-
readonly Input: "Input";
|
|
8
|
-
readonly ClearButton: "ClearButton";
|
|
9
|
-
readonly FirstChip: "FirstChip";
|
|
10
|
-
readonly LastChip: "LastChip";
|
|
11
|
-
readonly MiddleChip: "MiddleChip";
|
|
12
|
-
readonly Combobox: "Combobox";
|
|
13
|
-
readonly Menu: "Menu";
|
|
14
|
-
};
|
|
15
|
-
export type ComboboxElement = typeof ComboboxElement[keyof typeof ComboboxElement];
|
|
16
|
-
/**
|
|
17
|
-
* Prop types
|
|
18
|
-
*/
|
|
19
|
-
export declare const ComboboxSize: {
|
|
20
|
-
readonly Default: "default";
|
|
21
|
-
readonly Large: "large";
|
|
22
|
-
};
|
|
23
|
-
export type ComboboxSize = typeof ComboboxSize[keyof typeof ComboboxSize];
|
|
24
|
-
export declare const TruncationLocation: {
|
|
25
|
-
readonly start: "start";
|
|
26
|
-
readonly middle: "middle";
|
|
27
|
-
readonly end: "end";
|
|
28
|
-
readonly none: "none";
|
|
29
|
-
};
|
|
30
|
-
export type TruncationLocation = typeof TruncationLocation[keyof typeof TruncationLocation];
|
|
31
|
-
export declare const Overflow: {
|
|
32
|
-
/**
|
|
33
|
-
* Combobox will be set to a fixed width, and will expand its height based on the number of Chips selected
|
|
34
|
-
*/
|
|
35
|
-
readonly expandY: "expand-y";
|
|
36
|
-
/**
|
|
37
|
-
* Combobox will be set to a fixed height and width (default 100% of container). Chips will be scrollable left-right
|
|
38
|
-
*/
|
|
39
|
-
readonly scrollX: "scroll-x";
|
|
40
|
-
/**
|
|
41
|
-
* @deprecated
|
|
42
|
-
*/
|
|
43
|
-
readonly expandX: "expand-x";
|
|
44
|
-
};
|
|
45
|
-
export type Overflow = typeof Overflow[keyof typeof Overflow];
|
|
46
|
-
export declare const State: {
|
|
47
|
-
readonly error: "error";
|
|
48
|
-
readonly none: "none";
|
|
49
|
-
};
|
|
50
|
-
export type State = typeof State[keyof typeof State];
|
|
51
|
-
export declare const SearchState: {
|
|
52
|
-
readonly unset: "unset";
|
|
53
|
-
readonly error: "error";
|
|
54
|
-
readonly loading: "loading";
|
|
55
|
-
};
|
|
56
|
-
export type SearchState = typeof SearchState[keyof typeof SearchState];
|
|
57
|
-
/**
|
|
58
|
-
* Generic Typing
|
|
59
|
-
*/
|
|
60
|
-
export type SelectValueType<M extends boolean> = M extends true ? Array<string> : string | null;
|
|
61
|
-
export type onChangeType<M extends boolean> = M extends true ? (value: SelectValueType<true>) => void : (value: SelectValueType<false>) => void;
|
|
62
|
-
export declare function getNullSelection<M extends boolean>(multiselect: M): SelectValueType<M>;
|
|
63
|
-
/**
|
|
64
|
-
* Combobox Props
|
|
65
|
-
*/
|
|
66
|
-
export interface ComboboxMultiselectProps<M extends boolean> {
|
|
67
|
-
/**
|
|
68
|
-
* Defines whether a user can select multiple options, or only a single option.
|
|
69
|
-
* When using TypeScript, `multiselect` affects the valid values of `initialValue`, `value`, and `onChange`
|
|
70
|
-
*/
|
|
71
|
-
multiselect?: M;
|
|
72
|
-
/**
|
|
73
|
-
* The initial selection.
|
|
74
|
-
* Must be a string (or array of strings) that matches the `value` prop of a `ComboboxOption`.
|
|
75
|
-
* Changing the `initialValue` after initial render will not change the selection.
|
|
76
|
-
*/
|
|
77
|
-
initialValue?: SelectValueType<M>;
|
|
78
|
-
/**
|
|
79
|
-
* A callback called when the selection changes.
|
|
80
|
-
* Callback receives a single argument that is the new selection, either string, or string array
|
|
81
|
-
*/
|
|
82
|
-
onChange?: onChangeType<M>;
|
|
83
|
-
/**
|
|
84
|
-
* The controlled value of the Combobox.
|
|
85
|
-
* Must be a string (or array of strings) that matches the `value` prop of a `ComboboxOption`.
|
|
86
|
-
* Changing `value` after initial render _will_ affect the selection.
|
|
87
|
-
* `value` will always take precedence over `initialValue` if both are provided.
|
|
88
|
-
*/
|
|
89
|
-
value?: SelectValueType<M>;
|
|
90
|
-
/**
|
|
91
|
-
* Defines the overflow behavior of a multiselect combobox.
|
|
92
|
-
*
|
|
93
|
-
* `expand-y`: Combobox has fixed width, and additional selections will cause the element to grow in the block direction.
|
|
94
|
-
*
|
|
95
|
-
* `expand-x`: Combobox has fixed height, and additional selections will cause the element to grow in the inline direction.
|
|
96
|
-
*
|
|
97
|
-
* `scroll-x`: Combobox has fixed height and width, and additional selections will cause the element to be scrollable in the x (horizontal) direction.
|
|
98
|
-
*/
|
|
99
|
-
overflow?: M extends true ? Overflow : undefined;
|
|
100
|
-
}
|
|
101
|
-
export interface BaseComboboxProps extends Omit<HTMLElementProps<'div'>, 'onChange'> {
|
|
102
|
-
/**
|
|
103
|
-
* Defines the Combobox Options by passing children. Must be `ComboboxOption` or `ComboboxGroup`
|
|
104
|
-
*/
|
|
105
|
-
children?: ReactNode;
|
|
106
|
-
/**
|
|
107
|
-
* An accessible label for the input, rendered in a <label> to the DOM
|
|
108
|
-
*/
|
|
109
|
-
label?: string;
|
|
110
|
-
/**
|
|
111
|
-
* An accessible label for the input, used only for screen-readers
|
|
112
|
-
*/
|
|
113
|
-
'aria-label'?: string;
|
|
114
|
-
/**
|
|
115
|
-
* A description for the input
|
|
116
|
-
*/
|
|
117
|
-
description?: string;
|
|
118
|
-
/**
|
|
119
|
-
* A placeholder for the input element. Uses the native `placeholder` attribute.
|
|
120
|
-
*/
|
|
121
|
-
placeholder?: string;
|
|
122
|
-
/**
|
|
123
|
-
* Disables all interaction with the component
|
|
124
|
-
*/
|
|
125
|
-
disabled?: boolean;
|
|
126
|
-
/**
|
|
127
|
-
* Defines the visual size of the component
|
|
128
|
-
*/
|
|
129
|
-
size?: ComboboxSize;
|
|
130
|
-
/**
|
|
131
|
-
* Toggles Dark Mode
|
|
132
|
-
*/
|
|
133
|
-
darkMode?: boolean;
|
|
134
|
-
/**
|
|
135
|
-
* The error state of the component. Defines whether the error message is displayed.
|
|
136
|
-
*/
|
|
137
|
-
state?: State;
|
|
138
|
-
/**
|
|
139
|
-
* The message shown below the input when state is `error`
|
|
140
|
-
*/
|
|
141
|
-
errorMessage?: string;
|
|
142
|
-
/**
|
|
143
|
-
* The state of search results. Toggles search messages within the menu.
|
|
144
|
-
*/
|
|
145
|
-
searchState?: SearchState;
|
|
146
|
-
/**
|
|
147
|
-
* A message shown within the menu when there are no options passed in as children, or `filteredOptions` is an empty array
|
|
148
|
-
*/
|
|
149
|
-
searchEmptyMessage?: string;
|
|
150
|
-
/**
|
|
151
|
-
* A message shown within the menu when searchState is `error`
|
|
152
|
-
*/
|
|
153
|
-
searchErrorMessage?: string;
|
|
154
|
-
/**
|
|
155
|
-
* A message shown within the menu when searchState is `loading`
|
|
156
|
-
*/
|
|
157
|
-
searchLoadingMessage?: string;
|
|
158
|
-
/**
|
|
159
|
-
* A callback called when the search input changes.
|
|
160
|
-
* Receives a single argument that is the current input value.
|
|
161
|
-
* Use this callback to set `searchState` and/or `filteredOptions` appropriately
|
|
162
|
-
*/
|
|
163
|
-
onFilter?: (value: string) => void;
|
|
164
|
-
/**
|
|
165
|
-
* Defines whether the Clear button appears to the right of the input.
|
|
166
|
-
*/
|
|
167
|
-
clearable?: boolean;
|
|
168
|
-
/**
|
|
169
|
-
* A callback fired when the Clear button is pressed.
|
|
170
|
-
* Fired _after_ `onChange`, and _before_ `onFilter`
|
|
171
|
-
*/
|
|
172
|
-
onClear?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
173
|
-
/**
|
|
174
|
-
* An array used to define which options are displayed.
|
|
175
|
-
* Do not remove options from the JSX children, as this will affect the selected options
|
|
176
|
-
*/
|
|
177
|
-
filteredOptions?: Array<string>;
|
|
178
|
-
/**
|
|
179
|
-
* Defines where the ellipses appear in a Chip when the length exceeds the `chipCharacterLimit`
|
|
180
|
-
*/
|
|
181
|
-
chipTruncationLocation?: TruncationLocation;
|
|
182
|
-
/**
|
|
183
|
-
* Defined the character limit of a multiselect Chip before they start truncating.
|
|
184
|
-
* Note: the three ellipses dots are included in the character limit.
|
|
185
|
-
*/
|
|
186
|
-
chipCharacterLimit?: number;
|
|
187
|
-
/**
|
|
188
|
-
* Specifies that the popover content should be rendered at the end of the DOM,
|
|
189
|
-
* rather than in the DOM tree.
|
|
190
|
-
*
|
|
191
|
-
* default: `true`
|
|
192
|
-
*/
|
|
193
|
-
usePortal?: boolean;
|
|
194
|
-
/**
|
|
195
|
-
* When usePortal is `true`, specifies a class name to apply to the root element of the portal.
|
|
196
|
-
*/
|
|
197
|
-
portalClassName?: undefined;
|
|
198
|
-
/**
|
|
199
|
-
* When usePortal is `true`, specifies an element to portal within. The default behavior is to generate a div at the end of the document to render within.
|
|
200
|
-
*/
|
|
201
|
-
portalContainer?: null;
|
|
202
|
-
/**
|
|
203
|
-
* When usePortal is `true`, specifies the scrollable element to position relative to.
|
|
204
|
-
*/
|
|
205
|
-
scrollContainer?: null;
|
|
206
|
-
/**
|
|
207
|
-
* Number that controls the z-index of the popover element directly.
|
|
208
|
-
*/
|
|
209
|
-
popoverZIndex?: number;
|
|
210
|
-
/**
|
|
211
|
-
* Popover menu class name
|
|
212
|
-
*/
|
|
213
|
-
popoverClassName?: string;
|
|
214
|
-
}
|
|
215
|
-
export type ComboboxProps<M extends boolean> = Either<BaseComboboxProps & ComboboxMultiselectProps<M>, 'label' | 'aria-label'>;
|
|
216
|
-
/**
|
|
217
|
-
* Combobox Option Props
|
|
218
|
-
*/
|
|
219
|
-
interface BaseComboboxOptionProps {
|
|
220
|
-
/**
|
|
221
|
-
* The internal value of the option. Used as the identifier in Combobox `initialValue`, value and filteredOptions.
|
|
222
|
-
* When undefined, this is set to `_.kebabCase(displayName)`
|
|
223
|
-
*/
|
|
224
|
-
value?: string;
|
|
225
|
-
/**
|
|
226
|
-
* The display value of the option. Used as the rendered string within the menu and chips.
|
|
227
|
-
* When undefined, this is set to `value`
|
|
228
|
-
*/
|
|
229
|
-
displayName?: string;
|
|
230
|
-
/**
|
|
231
|
-
* The icon to display to the left of the option in the menu.
|
|
232
|
-
*/
|
|
233
|
-
glyph?: ReactElement;
|
|
234
|
-
/**
|
|
235
|
-
* Defines whether the option is disabled.
|
|
236
|
-
* Node: disabled options are still rendered in the menu, but not selectable.
|
|
237
|
-
*/
|
|
238
|
-
disabled?: boolean;
|
|
239
|
-
/**
|
|
240
|
-
* Styling Prop
|
|
241
|
-
*/
|
|
242
|
-
className?: string;
|
|
243
|
-
/**
|
|
244
|
-
* A description for the option.
|
|
245
|
-
*/
|
|
246
|
-
description?: string;
|
|
247
|
-
}
|
|
248
|
-
export type ComboboxOptionProps = Either<BaseComboboxOptionProps, 'value' | 'displayName'>;
|
|
249
|
-
export interface OptionObject {
|
|
250
|
-
value: string;
|
|
251
|
-
displayName: string;
|
|
252
|
-
isDisabled: boolean;
|
|
253
|
-
hasGlyph?: boolean;
|
|
254
|
-
description?: string;
|
|
255
|
-
}
|
|
256
|
-
export interface InternalComboboxOptionProps {
|
|
257
|
-
value: string;
|
|
258
|
-
displayName: string;
|
|
259
|
-
isSelected: boolean;
|
|
260
|
-
isFocused: boolean;
|
|
261
|
-
setSelected: () => void;
|
|
262
|
-
disabled?: boolean;
|
|
263
|
-
glyph?: ReactElement;
|
|
264
|
-
className?: string;
|
|
265
|
-
index: number;
|
|
266
|
-
description?: string;
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Combobox Group Props
|
|
270
|
-
*/
|
|
271
|
-
export interface ComboboxGroupProps {
|
|
272
|
-
/**
|
|
273
|
-
* Label for the group of options
|
|
274
|
-
*/
|
|
275
|
-
label: string;
|
|
276
|
-
/**
|
|
277
|
-
* Options in the group. Must be one or more `ComboboxOption` components
|
|
278
|
-
*/
|
|
279
|
-
children: React.ReactNode;
|
|
280
|
-
/**
|
|
281
|
-
* Styling prop
|
|
282
|
-
*/
|
|
283
|
-
className?: string;
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Combobox Chip
|
|
287
|
-
*/
|
|
288
|
-
export interface ChipProps {
|
|
289
|
-
displayName: string;
|
|
290
|
-
isFocused: boolean;
|
|
291
|
-
onRemove: () => void;
|
|
292
|
-
onFocus: () => void;
|
|
293
|
-
}
|
|
294
|
-
export {};
|
|
295
|
-
//# sourceMappingURL=Combobox.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.types.d.ts","sourceRoot":"","sources":["../../../src/components/combobox/Combobox.types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OA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,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,CACtC,uBAAuB,EACvB,OAAO,GAAG,aAAa,CACxB,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AAEH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AAEH,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable filename-rules/match */
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getNullSelection = exports.SearchState = exports.State = exports.Overflow = exports.TruncationLocation = exports.ComboboxSize = exports.ComboboxElement = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Prop Enums & Types
|
|
7
|
-
*/
|
|
8
|
-
exports.ComboboxElement = {
|
|
9
|
-
Input: 'Input',
|
|
10
|
-
ClearButton: 'ClearButton',
|
|
11
|
-
FirstChip: 'FirstChip',
|
|
12
|
-
LastChip: 'LastChip',
|
|
13
|
-
MiddleChip: 'MiddleChip',
|
|
14
|
-
Combobox: 'Combobox',
|
|
15
|
-
Menu: 'Menu',
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Prop types
|
|
19
|
-
*/
|
|
20
|
-
exports.ComboboxSize = {
|
|
21
|
-
// TODO: add XSmall & Small variants after the refresh
|
|
22
|
-
// XSmall: 'xsmall',
|
|
23
|
-
// Small: 'small',
|
|
24
|
-
Default: 'default',
|
|
25
|
-
Large: 'large',
|
|
26
|
-
};
|
|
27
|
-
exports.TruncationLocation = {
|
|
28
|
-
start: 'start',
|
|
29
|
-
middle: 'middle',
|
|
30
|
-
end: 'end',
|
|
31
|
-
none: 'none',
|
|
32
|
-
};
|
|
33
|
-
exports.Overflow = {
|
|
34
|
-
/**
|
|
35
|
-
* Combobox will be set to a fixed width, and will expand its height based on the number of Chips selected
|
|
36
|
-
*/
|
|
37
|
-
expandY: 'expand-y',
|
|
38
|
-
/**
|
|
39
|
-
* Combobox will be set to a fixed height and width (default 100% of container). Chips will be scrollable left-right
|
|
40
|
-
*/
|
|
41
|
-
scrollX: 'scroll-x',
|
|
42
|
-
/**
|
|
43
|
-
* @deprecated
|
|
44
|
-
*/
|
|
45
|
-
expandX: 'expand-x',
|
|
46
|
-
};
|
|
47
|
-
exports.State = {
|
|
48
|
-
error: 'error',
|
|
49
|
-
none: 'none',
|
|
50
|
-
};
|
|
51
|
-
exports.SearchState = {
|
|
52
|
-
unset: 'unset',
|
|
53
|
-
error: 'error',
|
|
54
|
-
loading: 'loading',
|
|
55
|
-
};
|
|
56
|
-
// Returns the correct empty state for multiselcect / single select
|
|
57
|
-
function getNullSelection(multiselect) {
|
|
58
|
-
if (multiselect) {
|
|
59
|
-
return [];
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.getNullSelection = getNullSelection;
|
|
66
|
-
//# sourceMappingURL=Combobox.types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.types.js","sourceRoot":"","sources":["../../../src/components/combobox/Combobox.types.ts"],"names":[],"mappings":";AAAA,yCAAyC;;;AAKzC;;GAEG;AAEU,QAAA,eAAe,GAAG;IAC7B,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;IAC1B,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;CACJ,CAAC;AAIX;;GAEG;AAEU,QAAA,YAAY,GAAG;IAC1B,sDAAsD;IACtD,oBAAoB;IACpB,kBAAkB;IAClB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;CACN,CAAC;AAGE,QAAA,kBAAkB,GAAG;IAChC,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACJ,CAAC;AAIE,QAAA,QAAQ,GAAG;IACtB;;OAEG;IACH,OAAO,EAAE,UAAU;IACnB;;OAEG;IACH,OAAO,EAAE,UAAU;IACnB;;OAEG;IACH,OAAO,EAAE,UAAU;CACX,CAAC;AAGE,QAAA,KAAK,GAAG;IACnB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;CACJ,CAAC;AAGE,QAAA,WAAW,GAAG;IACzB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;CACV,CAAC;AAeX,mEAAmE;AACnE,SAAgB,gBAAgB,CAC9B,WAAc;IAEd,IAAI,WAAW,EAAE;QACf,OAAO,EAAyC,CAAC;KAClD;SAAM;QACL,OAAO,IAA0B,CAAC;KACnC;AACH,CAAC;AARD,4CAQC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Theme } from '@leafygreen-ui/lib';
|
|
3
|
-
import { ComboboxSize, SearchState, State, TruncationLocation } from './Combobox.types';
|
|
4
|
-
interface ComboboxData {
|
|
5
|
-
multiselect: boolean;
|
|
6
|
-
darkMode: boolean;
|
|
7
|
-
theme: Theme;
|
|
8
|
-
size: ComboboxSize;
|
|
9
|
-
withIcons: boolean;
|
|
10
|
-
disabled: boolean;
|
|
11
|
-
isOpen: boolean;
|
|
12
|
-
state: State;
|
|
13
|
-
searchState: SearchState;
|
|
14
|
-
chipTruncationLocation?: TruncationLocation;
|
|
15
|
-
chipCharacterLimit?: number;
|
|
16
|
-
inputValue?: string;
|
|
17
|
-
searchInputSize: number;
|
|
18
|
-
}
|
|
19
|
-
export declare const ComboboxContext: import("react").Context<ComboboxData>;
|
|
20
|
-
export {};
|
|
21
|
-
//# sourceMappingURL=ComboboxContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxContext.d.ts","sourceRoot":"","sources":["../../../src/components/combobox/ComboboxContext.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EACL,YAAY,EACZ,WAAW,EACX,KAAK,EACL,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAE1B,UAAU,YAAY;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,YAAY,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,WAAW,CAAC;IACzB,sBAAsB,CAAC,EAAE,kBAAkB,CAAC;IAC5C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,eAAe,uCAW1B,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ComboboxContext = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const lib_1 = require("@leafygreen-ui/lib");
|
|
6
|
-
const Combobox_types_1 = require("./Combobox.types");
|
|
7
|
-
exports.ComboboxContext = (0, react_1.createContext)({
|
|
8
|
-
multiselect: false,
|
|
9
|
-
darkMode: false,
|
|
10
|
-
theme: lib_1.Theme.Light,
|
|
11
|
-
size: Combobox_types_1.ComboboxSize.Default,
|
|
12
|
-
withIcons: false,
|
|
13
|
-
disabled: false,
|
|
14
|
-
isOpen: false,
|
|
15
|
-
state: Combobox_types_1.State.none,
|
|
16
|
-
searchState: Combobox_types_1.SearchState.unset,
|
|
17
|
-
searchInputSize: 384,
|
|
18
|
-
});
|
|
19
|
-
//# sourceMappingURL=ComboboxContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxContext.js","sourceRoot":"","sources":["../../../src/components/combobox/ComboboxContext.tsx"],"names":[],"mappings":";;;AAAA,iCAAsC;AAEtC,4CAA2C;AAE3C,qDAK0B;AAkBb,QAAA,eAAe,GAAG,IAAA,qBAAa,EAAe;IACzD,WAAW,EAAE,KAAK;IAClB,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,WAAK,CAAC,KAAK;IAClB,IAAI,EAAE,6BAAY,CAAC,OAAO;IAC1B,SAAS,EAAE,KAAK;IAChB,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,sBAAK,CAAC,IAAI;IACjB,WAAW,EAAE,4BAAW,CAAC,KAAK;IAC9B,eAAe,EAAE,GAAG;CACrB,CAAC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { ComboboxGroupProps } from './Combobox.types';
|
|
4
|
-
export declare function InternalComboboxGroup({ label, className, children, }: ComboboxGroupProps): JSX.Element;
|
|
5
|
-
declare function ComboboxGroup(_: ComboboxGroupProps): JSX.Element;
|
|
6
|
-
declare namespace ComboboxGroup {
|
|
7
|
-
var displayName: string;
|
|
8
|
-
var propTypes: {
|
|
9
|
-
className: PropTypes.Requireable<string>;
|
|
10
|
-
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
11
|
-
label: PropTypes.Validator<string>;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export default ComboboxGroup;
|
|
15
|
-
//# sourceMappingURL=ComboboxGroup.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxGroup.d.ts","sourceRoot":"","sources":["../../../src/components/combobox/ComboboxGroup.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAOnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAkCtD,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,SAAS,EACT,QAAQ,GACT,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAqBlC;AAUD,iBAAwB,aAAa,CAAC,CAAC,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAExE;kBAFuB,aAAa;;;;;;;;eAAb,aAAa"}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.InternalComboboxGroup = void 0;
|
|
30
|
-
const react_1 = __importStar(require("react"));
|
|
31
|
-
const prop_types_1 = __importDefault(require("prop-types"));
|
|
32
|
-
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
33
|
-
const hooks_1 = require("@leafygreen-ui/hooks");
|
|
34
|
-
const lib_1 = require("@leafygreen-ui/lib");
|
|
35
|
-
const palette_1 = require("@leafygreen-ui/palette");
|
|
36
|
-
const ComboboxContext_1 = require("./ComboboxContext");
|
|
37
|
-
const comboboxGroupStyle = {
|
|
38
|
-
[lib_1.Theme.Light]: (0, emotion_1.css) `
|
|
39
|
-
padding-top: 8px;
|
|
40
|
-
`,
|
|
41
|
-
[lib_1.Theme.Dark]: (0, emotion_1.css) `
|
|
42
|
-
padding-top: 8px;
|
|
43
|
-
`,
|
|
44
|
-
};
|
|
45
|
-
const comboboxGroupLabel = (0, emotion_1.css) `
|
|
46
|
-
cursor: default;
|
|
47
|
-
width: 100%;
|
|
48
|
-
padding: 0 12px 2px;
|
|
49
|
-
outline: none;
|
|
50
|
-
overflow-wrap: anywhere;
|
|
51
|
-
font-size: 12px;
|
|
52
|
-
line-height: 16px;
|
|
53
|
-
font-weight: bold;
|
|
54
|
-
text-transform: uppercase;
|
|
55
|
-
letter-spacing: 0.4px;
|
|
56
|
-
`;
|
|
57
|
-
const comboboxGroupLabelThemeStyle = {
|
|
58
|
-
[lib_1.Theme.Light]: (0, emotion_1.css) `
|
|
59
|
-
color: ${palette_1.palette.gray.dark1};
|
|
60
|
-
`,
|
|
61
|
-
[lib_1.Theme.Dark]: (0, emotion_1.css) `
|
|
62
|
-
color: ${palette_1.palette.gray.light1};
|
|
63
|
-
`,
|
|
64
|
-
};
|
|
65
|
-
function InternalComboboxGroup({ label, className, children, }) {
|
|
66
|
-
const { theme } = (0, react_1.useContext)(ComboboxContext_1.ComboboxContext);
|
|
67
|
-
const groupId = (0, hooks_1.useIdAllocator)({ prefix: 'combobox-group' });
|
|
68
|
-
const childCount = react_1.default.Children.count(children);
|
|
69
|
-
return childCount > 0 ? (react_1.default.createElement("div", { className: (0, emotion_1.cx)(comboboxGroupStyle[theme], className) },
|
|
70
|
-
react_1.default.createElement("div", { className: (0, emotion_1.cx)(comboboxGroupLabel, comboboxGroupLabelThemeStyle[theme]), id: groupId }, label),
|
|
71
|
-
react_1.default.createElement("div", { role: "group", "aria-labelledby": groupId }, children))) : (react_1.default.createElement(react_1.default.Fragment, null));
|
|
72
|
-
}
|
|
73
|
-
exports.InternalComboboxGroup = InternalComboboxGroup;
|
|
74
|
-
ComboboxGroup.displayName = 'ComboboxGroup';
|
|
75
|
-
ComboboxGroup.propTypes = {
|
|
76
|
-
className: prop_types_1.default.string,
|
|
77
|
-
children: prop_types_1.default.node.isRequired,
|
|
78
|
-
label: prop_types_1.default.string.isRequired,
|
|
79
|
-
};
|
|
80
|
-
function ComboboxGroup(_) {
|
|
81
|
-
throw Error('`ComboboxGroup` must be a child of a `Combobox` instance');
|
|
82
|
-
}
|
|
83
|
-
exports.default = ComboboxGroup;
|
|
84
|
-
//# sourceMappingURL=ComboboxGroup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxGroup.js","sourceRoot":"","sources":["../../../src/components/combobox/ComboboxGroup.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAC1C,4DAAmC;AAEnC,oDAAiD;AACjD,gDAAsD;AACtD,4CAA2C;AAC3C,oDAAiD;AAGjD,uDAAoD;AAEpD,MAAM,kBAAkB,GAA0B;IAChD,CAAC,WAAK,CAAC,KAAK,CAAC,EAAE,IAAA,aAAG,EAAA;;GAEjB;IACD,CAAC,WAAK,CAAC,IAAI,CAAC,EAAE,IAAA,aAAG,EAAA;;GAEhB;CACF,CAAC;AAEF,MAAM,kBAAkB,GAAG,IAAA,aAAG,EAAA;;;;;;;;;;;CAW7B,CAAC;AAEF,MAAM,4BAA4B,GAA0B;IAC1D,CAAC,WAAK,CAAC,KAAK,CAAC,EAAE,IAAA,aAAG,EAAA;aACP,iBAAO,CAAC,IAAI,CAAC,KAAK;GAC5B;IACD,CAAC,WAAK,CAAC,IAAI,CAAC,EAAE,IAAA,aAAG,EAAA;aACN,iBAAO,CAAC,IAAI,CAAC,MAAM;GAC7B;CACF,CAAC;AAEF,SAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,SAAS,EACT,QAAQ,GACW;IACnB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,kBAAU,EAAC,iCAAe,CAAC,CAAC;IAE9C,MAAM,OAAO,GAAG,IAAA,sBAAc,EAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAC7D,MAAM,UAAU,GAAG,eAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAElD,OAAO,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,CACtB,uCAAK,SAAS,EAAE,IAAA,YAAE,EAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;QACtD,uCACE,SAAS,EAAE,IAAA,YAAE,EAAC,kBAAkB,EAAE,4BAA4B,CAAC,KAAK,CAAC,CAAC,EACtE,EAAE,EAAE,OAAO,IAEV,KAAK,CACF;QACN,uCAAK,IAAI,EAAC,OAAO,qBAAkB,OAAO,IACvC,QAAQ,CACL,CACF,CACP,CAAC,CAAC,CAAC,CACF,6DAAK,CACN,CAAC;AACJ,CAAC;AAzBD,sDAyBC;AAED,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC;AAE5C,aAAa,CAAC,SAAS,GAAG;IACxB,SAAS,EAAE,oBAAS,CAAC,MAAM;IAC3B,QAAQ,EAAE,oBAAS,CAAC,IAAI,CAAC,UAAU;IACnC,KAAK,EAAE,oBAAS,CAAC,MAAM,CAAC,UAAU;CACnC,CAAC;AAEF,SAAwB,aAAa,CAAC,CAAqB;IACzD,MAAM,KAAK,CAAC,0DAA0D,CAAC,CAAC;AAC1E,CAAC;AAFD,gCAEC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComboboxProps } from '../Combobox.types';
|
|
3
|
-
export declare const ComboboxMenu: React.ForwardRefExoticComponent<{
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
refEl: React.RefObject<HTMLDivElement>;
|
|
6
|
-
id: string;
|
|
7
|
-
labelId: string;
|
|
8
|
-
} & Pick<ComboboxProps<any>, "popoverZIndex" | "className" | "usePortal" | "portalClassName" | "portalContainer" | "scrollContainer" | "searchEmptyMessage" | "searchErrorMessage" | "searchLoadingMessage"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
-
//# sourceMappingURL=ComboboxMenu.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/combobox/ComboboxMenu/ComboboxMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AASnD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAiClD,eAAO,MAAM,YAAY;eAjBZ,MAAM,SAAS;WACnB,MAAM,SAAS,CAAC,cAAc,CAAC;QAClC,MAAM;aACD,MAAM;mPAoIhB,CAAC"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.ComboboxMenu = void 0;
|
|
30
|
-
const react_1 = __importStar(require("react"));
|
|
31
|
-
const isUndefined_1 = __importDefault(require("lodash/isUndefined"));
|
|
32
|
-
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
33
|
-
const hooks_1 = require("@leafygreen-ui/hooks");
|
|
34
|
-
const icon_1 = __importDefault(require("@leafygreen-ui/icon"));
|
|
35
|
-
const palette_1 = require("@leafygreen-ui/palette");
|
|
36
|
-
const leafygreen_1 = require("../../leafygreen");
|
|
37
|
-
const ComboboxContext_1 = require("../ComboboxContext");
|
|
38
|
-
const Menu_styles_1 = require("./Menu.styles");
|
|
39
|
-
exports.ComboboxMenu = react_1.default.forwardRef(({ children, id, refEl, labelId, searchLoadingMessage, searchErrorMessage, searchEmptyMessage, className, ...popoverProps }, forwardedRef) => {
|
|
40
|
-
const { disabled, darkMode, theme, size, isOpen, searchState } = (0, react_1.useContext)(ComboboxContext_1.ComboboxContext);
|
|
41
|
-
const ref = (0, hooks_1.useForwardedRef)(forwardedRef, null);
|
|
42
|
-
/** The max height of the menu element */
|
|
43
|
-
const availableSpace = (0, hooks_1.useAvailableSpace)(refEl);
|
|
44
|
-
const maxHeightValue = !(0, isUndefined_1.default)(availableSpace)
|
|
45
|
-
? `${Math.min(availableSpace, 256)}px`
|
|
46
|
-
: 'unset';
|
|
47
|
-
/**
|
|
48
|
-
* The rendered menu JSX contents
|
|
49
|
-
* Includes error, empty, search and default states
|
|
50
|
-
*/
|
|
51
|
-
const renderedMenuContents = (0, react_1.useMemo)(() => {
|
|
52
|
-
const messageStyles = (0, emotion_1.cx)(Menu_styles_1.menuMessageBaseStyle, Menu_styles_1.menuMessageThemeStyle[theme], Menu_styles_1.menuMessageSizeStyle[size]);
|
|
53
|
-
switch (searchState) {
|
|
54
|
-
case 'loading': {
|
|
55
|
-
return (react_1.default.createElement("span", { className: messageStyles },
|
|
56
|
-
react_1.default.createElement(icon_1.default, { glyph: "Refresh", color: darkMode ? palette_1.palette.blue.light1 : palette_1.palette.blue.base, className: Menu_styles_1.loadingIconStyle }),
|
|
57
|
-
searchLoadingMessage));
|
|
58
|
-
}
|
|
59
|
-
case 'error': {
|
|
60
|
-
return (react_1.default.createElement("span", { className: messageStyles },
|
|
61
|
-
react_1.default.createElement(icon_1.default, { glyph: "Warning", color: darkMode ? palette_1.palette.red.light1 : palette_1.palette.red.base }),
|
|
62
|
-
searchErrorMessage));
|
|
63
|
-
}
|
|
64
|
-
case 'unset':
|
|
65
|
-
default: {
|
|
66
|
-
if (children &&
|
|
67
|
-
typeof children === 'object' &&
|
|
68
|
-
'length' in children &&
|
|
69
|
-
children.length > 0) {
|
|
70
|
-
return react_1.default.createElement("ul", { className: Menu_styles_1.menuList }, children);
|
|
71
|
-
}
|
|
72
|
-
return react_1.default.createElement("span", { className: messageStyles }, searchEmptyMessage);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}, [
|
|
76
|
-
theme,
|
|
77
|
-
size,
|
|
78
|
-
searchState,
|
|
79
|
-
darkMode,
|
|
80
|
-
searchLoadingMessage,
|
|
81
|
-
searchErrorMessage,
|
|
82
|
-
children,
|
|
83
|
-
searchEmptyMessage,
|
|
84
|
-
]);
|
|
85
|
-
return (react_1.default.createElement(leafygreen_1.Popover, { active: isOpen && !disabled, spacing: 4, align: "bottom", justify: "middle", refEl: refEl, adjustOnMutation: true, className: (0, emotion_1.cx)(className, Menu_styles_1.popoverStyle, Menu_styles_1.popoverThemeStyle[theme]), ...popoverProps },
|
|
86
|
-
react_1.default.createElement("div", { ref: ref, id: id, role: "listbox", "aria-labelledby": labelId, "aria-expanded": isOpen, className: (0, emotion_1.cx)(Menu_styles_1.menuBaseStyle, Menu_styles_1.menuThemeStyle[theme], (0, emotion_1.css) `
|
|
87
|
-
max-height: ${maxHeightValue};
|
|
88
|
-
`), onMouseDownCapture: (e) => e.preventDefault() }, renderedMenuContents)));
|
|
89
|
-
});
|
|
90
|
-
exports.ComboboxMenu.displayName = 'ComboboxMenu';
|
|
91
|
-
//# sourceMappingURL=ComboboxMenu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxMenu.js","sourceRoot":"","sources":["../../../../src/components/combobox/ComboboxMenu/ComboboxMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAmD;AACnD,qEAA6C;AAE7C,oDAAiD;AACjD,gDAA0E;AAC1E,+DAAuC;AACvC,oDAAiD;AACjD,iDAA2C;AAG3C,wDAAqD;AAErD,+CAUuB;AAoBV,QAAA,YAAY,GAAG,eAAK,CAAC,UAAU,CAC1C,CACE,EACE,QAAQ,EACR,EAAE,EACF,KAAK,EACL,OAAO,EACP,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACT,GAAG,YAAY,EACG,EACpB,YAAY,EACZ,EAAE;IACF,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,GAC5D,IAAA,kBAAU,EAAC,iCAAe,CAAC,CAAC;IAC9B,MAAM,GAAG,GAAG,IAAA,uBAAe,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAEhD,yCAAyC;IACzC,MAAM,cAAc,GAAG,IAAA,yBAAiB,EAAC,KAAK,CAAC,CAAC;IAChD,MAAM,cAAc,GAAG,CAAC,IAAA,qBAAW,EAAC,cAAc,CAAC;QACjD,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,GAAG,CAAC,IAAI;QACtC,CAAC,CAAC,OAAO,CAAC;IAEZ;;;OAGG;IACH,MAAM,oBAAoB,GA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