@zendeskgarden/react-dropdowns 9.0.0-next.1 → 9.0.0-next.3

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 (94) hide show
  1. package/README.md +73 -69
  2. package/dist/index.cjs.js +1634 -1712
  3. package/dist/index.esm.js +1633 -1700
  4. package/dist/typings/context/useComboboxContext.d.ts +25 -0
  5. package/dist/typings/context/useFieldContext.d.ts +32 -0
  6. package/dist/typings/context/useItemContext.d.ts +14 -0
  7. package/dist/typings/context/useItemGroupContext.d.ts +15 -0
  8. package/dist/typings/context/useMenuContext.d.ts +23 -0
  9. package/dist/typings/context/useOptionContext.d.ts +14 -0
  10. package/dist/typings/elements/{Combobox → combobox}/Combobox.d.ts +0 -2
  11. package/dist/typings/elements/{Fields → combobox}/Label.d.ts +1 -1
  12. package/dist/typings/elements/{Menu/Items/MediaBody.d.ts → combobox/Listbox.d.ts} +2 -4
  13. package/dist/typings/elements/{Fields → combobox}/Message.d.ts +1 -1
  14. package/dist/typings/elements/{Menu/Items/HeaderItem.d.ts → combobox/OptGroup.d.ts} +2 -2
  15. package/dist/typings/elements/{Menu/Items/MediaItem.d.ts → combobox/Option.d.ts} +5 -2
  16. package/dist/typings/elements/{Menu/Items/HeaderIcon.d.ts → combobox/OptionMeta.d.ts} +1 -1
  17. package/dist/typings/elements/combobox/Tag.d.ts +15 -0
  18. package/dist/typings/elements/combobox/TagAvatar.d.ts +14 -0
  19. package/dist/typings/elements/combobox/TagGroup.d.ts +12 -0
  20. package/dist/typings/elements/combobox/utils.d.ts +38 -0
  21. package/dist/typings/elements/{Menu/Items → menu}/Item.d.ts +5 -2
  22. package/dist/typings/elements/{Menu/Items/AddItem.d.ts → menu/ItemGroup.d.ts} +2 -2
  23. package/dist/typings/elements/{Menu/Items → menu}/ItemMeta.d.ts +2 -2
  24. package/dist/typings/elements/{Menu → menu}/Menu.d.ts +0 -2
  25. package/dist/typings/elements/menu/MenuList.d.ts +12 -0
  26. package/dist/typings/elements/{Menu → menu}/Separator.d.ts +1 -1
  27. package/dist/typings/elements/menu/utils.d.ts +29 -0
  28. package/dist/typings/index.d.ts +18 -25
  29. package/dist/typings/types/index.d.ts +242 -121
  30. package/dist/typings/{styled/items/StyledItemIcon.d.ts → views/combobox/StyledCombobox.d.ts} +4 -6
  31. package/dist/typings/{styled/multiselect/StyledMultiselectItemWrapper.d.ts → views/combobox/StyledContainer.d.ts} +1 -1
  32. package/dist/typings/{styled/select/StyledSelect.d.ts → views/combobox/StyledField.d.ts} +1 -1
  33. package/dist/typings/views/combobox/StyledFloatingListbox.d.ts +18 -0
  34. package/dist/typings/views/combobox/StyledHint.d.ts +11 -0
  35. package/dist/typings/views/combobox/StyledInput.d.ts +20 -0
  36. package/dist/typings/{styled/items/StyledAddItem.d.ts → views/combobox/StyledInputGroup.d.ts} +2 -4
  37. package/dist/typings/views/combobox/StyledInputIcon.d.ts +20 -0
  38. package/dist/typings/views/combobox/StyledLabel.d.ts +11 -0
  39. package/dist/typings/views/combobox/StyledListbox.d.ts +17 -0
  40. package/dist/typings/{styled/items/StyledNextItem.d.ts → views/combobox/StyledListboxSeparator.d.ts} +2 -4
  41. package/dist/typings/views/combobox/StyledMessage.d.ts +11 -0
  42. package/dist/typings/views/combobox/StyledOptGroup.d.ts +14 -0
  43. package/dist/typings/views/combobox/StyledOption.d.ts +18 -0
  44. package/dist/typings/views/combobox/StyledOptionContent.d.ts +10 -0
  45. package/dist/typings/views/combobox/StyledOptionIcon.d.ts +12 -0
  46. package/dist/typings/views/combobox/StyledOptionMeta.d.ts +14 -0
  47. package/dist/typings/views/combobox/StyledOptionTypeIcon.d.ts +17 -0
  48. package/dist/typings/views/combobox/StyledTag.d.ts +17 -0
  49. package/dist/typings/views/combobox/StyledTagsButton.d.ts +16 -0
  50. package/dist/typings/views/combobox/StyledTrigger.d.ts +24 -0
  51. package/dist/typings/views/combobox/StyledValue.d.ts +21 -0
  52. package/dist/typings/views/index.d.ts +38 -0
  53. package/dist/typings/views/menu/StyledButton.d.ts +20 -0
  54. package/dist/typings/views/menu/StyledFloatingMenu.d.ts +13 -0
  55. package/dist/typings/{styled/items/StyledPreviousItem.d.ts → views/menu/StyledItem.d.ts} +4 -4
  56. package/dist/typings/views/menu/StyledItemContent.d.ts +13 -0
  57. package/dist/typings/views/menu/StyledItemGroup.d.ts +13 -0
  58. package/dist/typings/views/menu/StyledItemIcon.d.ts +14 -0
  59. package/dist/typings/{styled/items → views/menu}/StyledItemMeta.d.ts +5 -10
  60. package/dist/typings/views/menu/StyledItemTypeIcon.d.ts +14 -0
  61. package/dist/typings/views/menu/StyledMenu.d.ts +19 -0
  62. package/dist/typings/{styled → views}/menu/StyledSeparator.d.ts +7 -4
  63. package/package.json +16 -14
  64. package/dist/typings/elements/Autocomplete/Autocomplete.d.ts +0 -14
  65. package/dist/typings/elements/Dropdown/Dropdown.d.ts +0 -26
  66. package/dist/typings/elements/Menu/Items/MediaFigure.d.ts +0 -11
  67. package/dist/typings/elements/Menu/Items/NextItem.d.ts +0 -12
  68. package/dist/typings/elements/Menu/Items/PreviousItem.d.ts +0 -12
  69. package/dist/typings/elements/Multiselect/Multiselect.d.ts +0 -14
  70. package/dist/typings/elements/Select/Select.d.ts +0 -14
  71. package/dist/typings/elements/Trigger/Trigger.d.ts +0 -24
  72. package/dist/typings/styled/index.d.ts +0 -29
  73. package/dist/typings/styled/items/StyledItem.d.ts +0 -20
  74. package/dist/typings/styled/items/StyledNextIcon.d.ts +0 -12
  75. package/dist/typings/styled/items/StyledPreviousIcon.d.ts +0 -12
  76. package/dist/typings/styled/items/header/StyledHeaderIcon.d.ts +0 -14
  77. package/dist/typings/styled/items/header/StyledHeaderItem.d.ts +0 -16
  78. package/dist/typings/styled/items/media/StyledMediaBody.d.ts +0 -17
  79. package/dist/typings/styled/items/media/StyledMediaFigure.d.ts +0 -287
  80. package/dist/typings/styled/items/media/StyledMediaItem.d.ts +0 -13
  81. package/dist/typings/styled/menu/StyledMenu.d.ts +0 -20
  82. package/dist/typings/styled/menu/StyledMenuWrapper.d.ts +0 -16
  83. package/dist/typings/styled/multiselect/StyledMultiselectInput.d.ts +0 -22
  84. package/dist/typings/styled/multiselect/StyledMultiselectItemsContainer.d.ts +0 -16
  85. package/dist/typings/styled/multiselect/StyledMultiselectMoreAnchor.d.ts +0 -15
  86. package/dist/typings/styled/select/StyledFauxInput.d.ts +0 -22
  87. package/dist/typings/styled/select/StyledInput.d.ts +0 -15
  88. package/dist/typings/utils/garden-placements.d.ts +0 -26
  89. package/dist/typings/utils/useDropdownContext.d.ts +0 -28
  90. package/dist/typings/utils/useFieldContext.d.ts +0 -17
  91. package/dist/typings/utils/useItemContext.d.ts +0 -16
  92. package/dist/typings/utils/useMenuContext.d.ts +0 -17
  93. /package/dist/typings/elements/{Fields → combobox}/Field.d.ts +0 -0
  94. /package/dist/typings/elements/{Fields → combobox}/Hint.d.ts +0 -0
@@ -4,147 +4,268 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import { HTMLAttributes, LiHTMLAttributes, PropsWithChildren } from 'react';
8
- import { ControllerStateAndHelpers, StateChangeOptions } from 'downshift';
9
- import { Modifiers } from 'popper.js';
10
- import { IFauxInputProps } from '@zendeskgarden/react-forms';
7
+ import { HTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, LiHTMLAttributes, ReactElement, ReactNode, RefObject } from 'react';
8
+ import { IOption, IUseComboboxProps, IUseComboboxReturnValue } from '@zendeskgarden/container-combobox';
9
+ import { IUseMenuProps, ISelectedItem as IUseMenuSelectedItem } from '@zendeskgarden/container-menu';
10
+ import { VALIDATION } from '@zendeskgarden/react-forms';
11
+ import { ITagProps as IBaseTagProps } from '@zendeskgarden/react-tags';
12
+ import { IButtonProps } from '@zendeskgarden/react-buttons';
13
+ export type ISelectedItem = IUseMenuSelectedItem;
14
+ export type ISelectedOption = Extract<IUseComboboxReturnValue['selection'], IOption>;
15
+ export type OptionValue = Exclude<IUseComboboxReturnValue['activeValue'], undefined>;
16
+ export declare const OPTION_TYPE: readonly ["add", "danger", "next", "previous"];
17
+ export type OptionType = (typeof OPTION_TYPE)[number];
18
+ export type Validation = (typeof VALIDATION)[number];
11
19
  export declare const PLACEMENT: readonly ["auto", "top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "end", "end-top", "end-bottom", "start", "start-top", "start-bottom"];
12
- export declare const POPPER_PLACEMENT: readonly ["auto", "top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "right", "right-start", "right-end", "left", "left-start", "left-end"];
13
20
  export type GardenPlacement = (typeof PLACEMENT)[number];
14
- export type PopperPlacement = (typeof POPPER_PLACEMENT)[number];
15
- export interface IDropdownProps extends PropsWithChildren {
16
- /** Opens the dropdown */
17
- isOpen?: boolean;
18
- /** Identifies the currently selected item */
19
- selectedItem?: any;
20
- /** Identifies the currently selected items */
21
- selectedItems?: any[];
22
- /** Highlights an element at a selected index */
23
- highlightedIndex?: number;
24
- /** Sets the value of the input element*/
21
+ export interface IComboboxProps extends HTMLAttributes<HTMLDivElement> {
22
+ /** Sets the currently active option index in a controlled combobox */
23
+ activeIndex?: number;
24
+ /** Sets the default active option index in an uncontrolled combobox */
25
+ defaultActiveIndex?: number;
26
+ /** Determines default listbox expansion in an uncontrolled combobox */
27
+ defaultExpanded?: boolean;
28
+ /** Accepts an "end" icon to display */
29
+ endIcon?: ReactElement;
30
+ /** Applies inset `box-shadow` styling on focus */
31
+ focusInset?: boolean;
32
+ /** Identifies the combobox */
33
+ id?: string;
34
+ /** Passes HTML attributes to the input element */
35
+ inputProps?: InputHTMLAttributes<HTMLInputElement>;
36
+ /** Sets the input value in a controlled combobox */
25
37
  inputValue?: string;
38
+ /** Indicates that the combobox provides autocompletion */
39
+ isAutocomplete?: boolean;
40
+ /** Removes borders and padding */
41
+ isBare?: boolean;
42
+ /** Applies compact styling */
43
+ isCompact?: boolean;
44
+ /** Indicates that the combobox is not interactive */
45
+ isDisabled?: boolean;
46
+ /** Determines whether the combobox is editable or select-only */
47
+ isEditable?: boolean;
48
+ /** Determines listbox expansion in a controlled combobox */
49
+ isExpanded?: boolean;
50
+ /** Determines whether multiple options can be selected */
51
+ isMultiselectable?: boolean;
52
+ /** Appends the lisbox to the element provided */
53
+ listboxAppendToNode?: Element | DocumentFragment;
54
+ /** Specifies the listbox `aria-label` */
55
+ listboxAriaLabel?: string;
56
+ /** Sets the `max-height` of the listbox */
57
+ listboxMaxHeight?: string;
58
+ /** Overrides the `min-height` of the listbox */
59
+ listboxMinHeight?: string | null;
60
+ /** Sets the `z-index` of the listbox */
61
+ listboxZIndex?: number;
62
+ /** Overrides the `max-height` of the combobox */
63
+ maxHeight?: string;
64
+ /** Determines the maximum number of tags displayed when a multiselectable combobox is collapsed */
65
+ maxTags?: number;
26
66
  /**
27
- * Handles item selection
28
- *
29
- * @param {any|null} selectedItem The selected item
30
- * @param {Object} stateAndHelpers [Downshift state and helpers](https://github.com/downshift-js/downshift#onselect)
31
- * */
32
- onSelect?: (selectedItem: any | null, stateAndHelpers: ControllerStateAndHelpers<any>) => void;
33
- /**
34
- * Handles state change
35
- *
36
- * @param {Object} options [Downshift internal state changes](https://github.com/downshift-js/downshift#onstatechange)
37
- * @param {Object} stateAndHelpers [Downshift state and helpers](https://github.com/downshift-js/downshift#onstatechange)
38
- * */
39
- onStateChange?: (options: StateChangeOptions<any>, stateAndHelpers: ControllerStateAndHelpers<any>) => void;
40
- /**
41
- * Handles input value change
67
+ * Handles combobox state changes
42
68
  *
43
- * @param {string} inputValue Value of the input element
44
- * @param {Object} stateAndHelpers [Downshift state and helpers](https://github.com/downshift-js/downshift#oninputvaluechange)
45
- * */
46
- onInputValueChange?: (inputValue: string, stateAndHelpers: ControllerStateAndHelpers<any>) => void;
47
- /** Passes customization props to the [Downshift](https://www.downshift-js.com/) component */
48
- downshiftProps?: Record<string, any>;
49
- }
50
- export interface ITriggerProps extends HTMLAttributes<HTMLElement> {
51
- /** Passes the ref callback to components with non-standard ref props (i.e. `innerRef`) */
52
- refKey?: string;
53
- }
54
- export interface ISelectProps extends Omit<IFauxInputProps, 'isFocused' | 'isHovered' | 'readOnly'> {
55
- /** Defines the icon rendered before the element's content */
56
- start?: any;
57
- }
58
- export interface IAutocompleteProps extends ISelectProps {
59
- /** Provides ref access to the underlying input element */
60
- inputRef?: React.Ref<HTMLInputElement>;
61
- }
62
- export interface IComboboxProps extends IAutocompleteProps {
63
- /** Defines text that appears in the element when no items are selected */
64
- placeholder?: string;
65
- /** Defines the icon rendered in the end position */
66
- end?: any;
67
- }
68
- export interface IMultiselectProps extends IAutocompleteProps {
69
+ * @param {string} changes.type The event type that triggered the change
70
+ * @param {boolean} [changes.isExpanded] The updated listbox expansion
71
+ * @param {OptionValue|OptionValue[]} [changes.selectionValue] The updated selection value(s)
72
+ * @param {string} [changes.inputValue] The updated input value
73
+ * @param {number} [changes.activeIndex] The updated active option index
74
+ */
75
+ onChange?: IUseComboboxProps['onChange'];
69
76
  /** Defines text that appears in the element when no items are selected */
70
77
  placeholder?: string;
71
- /** Determines the maximum number of items displayed while collapsed */
72
- maxItems?: number;
73
78
  /**
74
- * Overrides the "+ N more" text displayed when the total number of items exceeds `maxItems`
79
+ * Overrides the "+ N more" text displayed when the total number of multiselectable tags exceeds `maxTags`
75
80
  *
76
81
  * @param {number} value The number of hidden items
82
+ *
77
83
  * @returns {string} a replacement for the "+ N more" text
78
84
  */
79
- renderShowMore?: (value: number) => string;
85
+ renderExpandTags?: (value: number) => string;
80
86
  /**
81
- * Renders each item element. Designed to be used with [Tag](/components/tags).
87
+ * Overrides the `inputValue` or `placeholder` text displayed when the combobox is not focused
82
88
  *
83
- * @param {Object} options Rendered item options
84
- * @param {any} options.value The item value
85
- * @param {Function} options.removeValue Remove item callback
86
- * @returns {React.ReactElement} the item element
89
+ * @param {object|object[]} options.selection Current selection
90
+ * @param {string} [options.inputValue] Current input value
91
+ *
92
+ * @returns {Object} content for the current combobox value
87
93
  */
88
- renderItem: (options: {
89
- value: any;
90
- removeValue: () => void;
91
- }) => React.ReactElement;
94
+ renderValue?: (options: {
95
+ selection: IUseComboboxReturnValue['selection'];
96
+ inputValue?: IUseComboboxReturnValue['inputValue'];
97
+ }) => ReactNode;
98
+ /** Sets the selection value (or `isMultiselectable` values) in a controlled combobox */
99
+ selectionValue?: IUseComboboxProps['selectionValue'];
100
+ /** Accepts a "start" icon to display */
101
+ startIcon?: ReactElement;
102
+ /** Applies validation state styling */
103
+ validation?: Validation;
92
104
  }
93
- export interface IMenuProps extends HTMLAttributes<HTMLUListElement> {
94
- /**
95
- * Passes configuration options to the [Popper instance](https://popper.js.org/docs/v2/modifiers/)
96
- */
97
- popperModifiers?: Modifiers;
98
- /**
99
- * Allows the menu to reposition during browser resize events
100
- */
101
- eventsEnabled?: boolean;
102
- /**
103
- * Sets the `z-index` of the menu
104
- */
105
- zIndex?: number;
106
- /**
107
- * Adjusts the placement of the menu
108
- */
109
- placement?: GardenPlacement;
110
- /**
111
- * Animates the menu
112
- */
113
- isAnimated?: boolean;
114
- /**
115
- * Applies compact styling
116
- */
105
+ export interface ILabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
106
+ /** Applies regular (non-bold) font weight */
107
+ isRegular?: boolean;
108
+ /** Hides the label visually without hiding it from screen readers */
109
+ hidden?: LabelHTMLAttributes<HTMLLabelElement>['hidden'];
110
+ }
111
+ export interface IListboxProps extends HTMLAttributes<HTMLUListElement> {
112
+ /** Appends the lisbox to the element provided */
113
+ appendToNode?: Element | DocumentFragment;
114
+ /** Applies compact styling */
117
115
  isCompact?: boolean;
118
- /**
119
- * Attaches an arrow that points towards the menu trigger
120
- */
116
+ /** Determines listbox expansion */
117
+ isExpanded?: boolean;
118
+ /** Sets the `max-height` of the listbox */
119
+ maxHeight?: IComboboxProps['listboxMaxHeight'];
120
+ /** Sets the `min-height` of the listbox */
121
+ minHeight?: IComboboxProps['listboxMinHeight'];
122
+ /** Provides ref access to the associated trigger element */
123
+ triggerRef: RefObject<HTMLElement>;
124
+ /** Sets the `z-index` of the listbox */
125
+ zIndex?: IComboboxProps['listboxZIndex'];
126
+ }
127
+ export interface IMessageProps extends HTMLAttributes<HTMLDivElement> {
128
+ /** Applies validation state styling */
129
+ validation?: Validation;
130
+ /** Defines the `aria-label` for the validation icon */
131
+ validationLabel?: string;
132
+ }
133
+ export interface IOptionProps extends Omit<LiHTMLAttributes<HTMLLIElement>, 'value'> {
134
+ /** Accepts an icon to display */
135
+ icon?: ReactElement;
136
+ /** Indicates that the option is not interactive */
137
+ isDisabled?: boolean;
138
+ /** Hides the option while retaining props (i.e. selected `tagProps`) */
139
+ isHidden?: boolean;
140
+ /** Determines the initial selection state for the option */
141
+ isSelected?: boolean;
142
+ /** Sets the text label of the option (defaults to `value`) */
143
+ label?: string;
144
+ /** Overrides props (including `children`) for the associated tag */
145
+ tagProps?: Omit<ITagProps, 'option'>;
146
+ /** Determines the option type */
147
+ type?: OptionType;
148
+ /** Sets the unique value that is returned upon selection */
149
+ value: string | object;
150
+ }
151
+ export interface IOptGroupProps extends Omit<LiHTMLAttributes<HTMLLIElement>, 'content'> {
152
+ /** Renders content for the option group (defaults to `label` text) */
153
+ content?: ReactNode;
154
+ /** Accepts an icon to display */
155
+ icon?: ReactElement;
156
+ /** Sets the text label of the option group */
157
+ label?: string;
158
+ }
159
+ export interface ITagProps extends Omit<IBaseTagProps, 'isRound' | 'size'> {
160
+ /** @ignore Associates this tag with the given option (internal only) */
161
+ option: IOption;
162
+ /** Sets the `aria-label` and tooltip for the remove icon */
163
+ removeLabel?: string;
164
+ /** @ignore Sets the `z-index` of the tooltip */
165
+ tooltipZIndex?: number;
166
+ }
167
+ export interface ITagGroupProps {
168
+ /** Indicates that the tag group is not interactive */
169
+ isDisabled?: boolean;
170
+ /** Determines tag group expansion */
171
+ isExpanded: boolean;
172
+ /** Indicates the `z-index` of the listbox */
173
+ listboxZIndex?: number;
174
+ /** Determines the maximum number of tags displayed when the tag group is collapsed */
175
+ maxTags: number;
176
+ /** Provides tag props for the associated option */
177
+ optionTagProps: Record<string, IOptionProps['tagProps']>;
178
+ /** Provides the current selection */
179
+ selection: IOption[];
180
+ }
181
+ export interface IMenuListProps extends HTMLAttributes<HTMLUListElement> {
182
+ /** Appends the menu to the element provided */
183
+ appendToNode?: Element | DocumentFragment;
184
+ /** Attaches an arrow that points towards the menu trigger */
121
185
  hasArrow?: boolean;
122
- /**
123
- * Sets the `max-height` of the menu
124
- */
125
- maxHeight?: string;
126
- /**
127
- * Appends the menu to the element provided
128
- */
129
- appendToNode?: HTMLElement;
186
+ /** Applies compact styling */
187
+ isCompact?: boolean;
188
+ /** Determines menu expansion */
189
+ isExpanded?: boolean;
190
+ /** Provides a list of acceptable fallback placements */
191
+ fallbackPlacements?: Exclude<GardenPlacement, 'auto'>[];
192
+ /** Sets the `max-height` of the menu */
193
+ maxHeight?: IListboxProps['maxHeight'];
194
+ /** Sets the `min-height` of the menu */
195
+ minHeight?: IListboxProps['minHeight'];
196
+ /** Adjusts the placement of the menu */
197
+ placement?: GardenPlacement;
198
+ /** Provides ref access to the associated trigger element */
199
+ triggerRef: RefObject<HTMLElement>;
200
+ /** Sets the `z-index` of the menu */
201
+ zIndex?: IListboxProps['zIndex'];
130
202
  }
131
- export interface IItemProps extends LiHTMLAttributes<HTMLLIElement> {
132
- /** Sets the value that is returned upon selection */
133
- value?: any;
134
- /** Indicates that the element is not interactive */
135
- disabled?: boolean;
136
- /** Applies danger styling */
137
- isDanger?: boolean;
138
- /**
139
- * @ignore Sets the wrapping component for the item
140
- */
141
- component?: any;
203
+ export interface IMenuProps extends HTMLAttributes<HTMLUListElement> {
204
+ /** Appends the menu to the element provided */
205
+ appendToNode?: IMenuListProps['appendToNode'];
206
+ /** Sets the menu button label or renders a provided trigger element */
207
+ button: string | ((props: IButtonProps & {
208
+ ref: RefObject<HTMLButtonElement>;
209
+ }) => ReactNode);
210
+ /** Provides additional props to the menu [Button](/components/button#button) */
211
+ buttonProps?: IButtonProps;
212
+ /** Determines default expansion in an uncontrolled menu */
213
+ defaultExpanded?: IUseMenuProps['defaultExpanded'];
214
+ /** Determines focused value on menu initialization */
215
+ defaultFocusedValue?: IUseMenuProps['defaultFocusedValue'];
216
+ /** Provides a list of acceptable fallback placements */
217
+ fallbackPlacements?: IMenuListProps['fallbackPlacements'];
218
+ /** Sets the focused value in a controlled menu */
219
+ focusedValue?: IUseMenuProps['focusedValue'];
220
+ /** Attaches an arrow that points towards the menu trigger */
221
+ hasArrow?: IMenuListProps['hasArrow'];
222
+ /** Applies compact styling */
223
+ isCompact?: IMenuListProps['isCompact'];
224
+ /** Sets the expansion in a controlled menu */
225
+ isExpanded?: IUseMenuProps['isExpanded'];
226
+ /** Sets the `max-height` of the menu */
227
+ maxHeight?: IListboxProps['maxHeight'];
228
+ /** Sets the `min-height` of the menu */
229
+ minHeight?: IListboxProps['minHeight'];
142
230
  /**
143
- * @ignore Hides the select icon for the item
231
+ * Handles menu state changes
232
+ *
233
+ * @param {string} changes.type The event type that triggered the change
234
+ * @param {boolean} [changes.isExpanded] The updated menu expansion
235
+ * @param {ISelectedItem[]} [changes.selectedItems] The updated selection values
236
+ * @param {string | null} [changes.focusedValue] The updated focused value
144
237
  */
145
- hasIcon?: boolean;
238
+ onChange?: IUseMenuProps['onChange'];
239
+ /** Sets the selected items in a controlled menu */
240
+ selectedItems?: IUseMenuProps['selectedItems'];
241
+ /** Adjusts the placement of the menu */
242
+ placement?: GardenPlacement;
243
+ /** Sets the `z-index` of the menu */
244
+ zIndex?: IListboxProps['zIndex'];
245
+ }
246
+ export interface IItemProps extends Omit<LiHTMLAttributes<HTMLLIElement>, 'value'> {
247
+ /** Accepts an icon to display */
248
+ icon?: ReactElement;
249
+ /** Indicates that the item is not interactive */
250
+ isDisabled?: boolean;
251
+ /** Determines the initial selection state for the item */
252
+ isSelected?: boolean;
253
+ /** Sets the text label of the item (defaults to `value`) */
254
+ label?: string;
255
+ /** Associates the item in a radio item group */
256
+ name?: string;
257
+ /** Determines the item type */
258
+ type?: OptionType;
259
+ /** Sets the unique value that is returned upon selection */
260
+ value: string;
146
261
  }
147
- export interface IHeaderItemProps extends LiHTMLAttributes<HTMLLIElement> {
148
- /** Applies icon styling */
149
- hasIcon?: boolean;
262
+ export interface IItemGroupProps extends Omit<LiHTMLAttributes<HTMLLIElement>, 'content'> {
263
+ /** Renders content for the item group (defaults to `legend` text) */
264
+ content?: ReactNode;
265
+ /** Accepts an icon to display */
266
+ icon?: ReactElement;
267
+ /** Sets the text label of the item group */
268
+ legend?: string;
269
+ /** Configures the selection type for items within the group */
270
+ type?: ISelectedItem['type'];
150
271
  }
@@ -4,14 +4,12 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import { DefaultTheme } from 'styled-components';
8
- interface IStyledItemIconProps {
7
+ import { ThemeProps, DefaultTheme } from 'styled-components';
8
+ interface IStyledComboboxProps extends ThemeProps<DefaultTheme> {
9
9
  isCompact?: boolean;
10
- isVisible?: boolean;
11
- isDisabled?: boolean;
12
10
  }
13
- export declare const StyledItemIcon: import("styled-components").StyledComponent<"div", DefaultTheme, {
11
+ export declare const StyledCombobox: import("styled-components").StyledComponent<"div", DefaultTheme, {
14
12
  'data-garden-id': string;
15
13
  'data-garden-version': string;
16
- } & IStyledItemIconProps, "data-garden-id" | "data-garden-version">;
14
+ } & IStyledComboboxProps, "data-garden-id" | "data-garden-version">;
17
15
  export {};
@@ -4,7 +4,7 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- export declare const StyledMultiselectItemWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
7
+ export declare const StyledContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
8
8
  'data-garden-id': string;
9
9
  'data-garden-version': string;
10
10
  }, "data-garden-id" | "data-garden-version">;
@@ -4,7 +4,7 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- export declare const StyledSelect: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
7
+ export declare const StyledField: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
8
8
  'data-garden-id': string;
9
9
  'data-garden-version': string;
10
10
  }, "data-garden-id" | "data-garden-version">;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { ThemeProps, DefaultTheme } from 'styled-components';
8
+ import { MenuPosition } from '@zendeskgarden/react-theming';
9
+ import { IListboxProps } from '../../types';
10
+ export interface IStyledFloatingListboxProps extends ThemeProps<DefaultTheme> {
11
+ isHidden?: boolean;
12
+ position: MenuPosition;
13
+ zIndex?: IListboxProps['zIndex'];
14
+ }
15
+ export declare const StyledFloatingListbox: import("styled-components").StyledComponent<"div", DefaultTheme, {
16
+ 'data-garden-id': string;
17
+ 'data-garden-version': string;
18
+ } & IStyledFloatingListboxProps, "data-garden-id" | "data-garden-version">;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ /// <reference types="react" />
8
+ export declare const StyledHint: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {
9
+ 'data-garden-id': string;
10
+ 'data-garden-version': string;
11
+ }, "data-garden-id" | "data-garden-version">;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { ThemeProps, DefaultTheme } from 'styled-components';
8
+ interface IStyledInputProps extends ThemeProps<DefaultTheme> {
9
+ isBare?: boolean;
10
+ isCompact?: boolean;
11
+ isEditable?: boolean;
12
+ isMultiselectable?: boolean;
13
+ }
14
+ export declare const getHeight: (props: IStyledInputProps) => number;
15
+ export declare const sizeStyles: (props: IStyledInputProps) => import("styled-components").FlattenSimpleInterpolation;
16
+ export declare const StyledInput: import("styled-components").StyledComponent<"input", DefaultTheme, {
17
+ 'data-garden-id': string;
18
+ 'data-garden-version': string;
19
+ } & IStyledInputProps, "data-garden-id" | "data-garden-version">;
20
+ export {};
@@ -4,10 +4,8 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- /**
8
- * Accepts all `<li>` props
9
- */
10
- export declare const StyledAddItem: import("styled-components").StyledComponent<"li", import("styled-components").DefaultTheme, import("./StyledItem").IStyledItemProps & {
7
+ import { DefaultTheme } from 'styled-components';
8
+ export declare const StyledInputGroup: import("styled-components").StyledComponent<"div", DefaultTheme, {
11
9
  'data-garden-id': string;
12
10
  'data-garden-version': string;
13
11
  }, "data-garden-id" | "data-garden-version">;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ /// <reference types="react" />
8
+ import { ThemeProps, DefaultTheme } from 'styled-components';
9
+ interface IStyledInputIconProps extends ThemeProps<DefaultTheme> {
10
+ isCompact?: boolean;
11
+ isDisabled?: boolean;
12
+ isEnd?: boolean;
13
+ isLabelHovered?: boolean;
14
+ isRotated?: boolean;
15
+ }
16
+ export declare const StyledInputIcon: import("styled-components").StyledComponent<({ children, isCompact, isDisabled, isEnd, isLabelHovered, isRotated, theme, ...props }: any) => import("react").FunctionComponentElement<SVGElement>, DefaultTheme, {
17
+ 'data-garden-id': string;
18
+ 'data-garden-version': string;
19
+ } & IStyledInputIconProps, "data-garden-id" | "data-garden-version">;
20
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ /// <reference types="react" />
8
+ export declare const StyledLabel: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@zendeskgarden/react-forms").ILabelProps & import("react").RefAttributes<HTMLLabelElement>>, import("styled-components").DefaultTheme, {
9
+ 'data-garden-id': string;
10
+ 'data-garden-version': string;
11
+ }, "data-garden-id" | "data-garden-version">;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { DefaultTheme, ThemeProps } from 'styled-components';
8
+ import { IListboxProps } from '../../types';
9
+ export interface IStyledListboxProps extends ThemeProps<DefaultTheme> {
10
+ isCompact?: boolean;
11
+ maxHeight?: IListboxProps['maxHeight'];
12
+ minHeight?: IListboxProps['minHeight'];
13
+ }
14
+ export declare const StyledListbox: import("styled-components").StyledComponent<"ul", DefaultTheme, {
15
+ 'data-garden-id': string;
16
+ 'data-garden-version': string;
17
+ } & IStyledListboxProps, "data-garden-id" | "data-garden-version">;
@@ -4,10 +4,8 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- /**
8
- * Accepts all `<li>` props
9
- */
10
- export declare const StyledNextItem: import("styled-components").StyledComponent<"li", import("styled-components").DefaultTheme, import("./StyledItem").IStyledItemProps & {
7
+ import { DefaultTheme } from 'styled-components';
8
+ export declare const StyledListboxSeparator: import("styled-components").StyledComponent<"li", DefaultTheme, {
11
9
  'data-garden-id': string;
12
10
  'data-garden-version': string;
13
11
  }, "data-garden-id" | "data-garden-version">;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ /// <reference types="react" />
8
+ export declare const StyledMessage: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@zendeskgarden/react-forms").IMessageProps & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {
9
+ 'data-garden-id': string;
10
+ 'data-garden-version': string;
11
+ }, "data-garden-id" | "data-garden-version">;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { ThemeProps, DefaultTheme } from 'styled-components';
8
+ export interface IStyledOptGroupProps extends ThemeProps<DefaultTheme> {
9
+ isCompact?: boolean;
10
+ }
11
+ export declare const StyledOptGroup: import("styled-components").StyledComponent<"ul", DefaultTheme, {
12
+ 'data-garden-id': string;
13
+ 'data-garden-version': string;
14
+ } & IStyledOptGroupProps, "data-garden-id" | "data-garden-version">;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ import { ThemeProps, DefaultTheme } from 'styled-components';
8
+ import { OptionType } from '../../types';
9
+ export interface IStyledOptionProps extends ThemeProps<DefaultTheme> {
10
+ isActive?: boolean;
11
+ isCompact?: boolean;
12
+ $type?: OptionType | 'header' | 'group';
13
+ }
14
+ export declare const getMinHeight: (props: IStyledOptionProps) => number;
15
+ export declare const StyledOption: import("styled-components").StyledComponent<"li", DefaultTheme, {
16
+ 'data-garden-id': string;
17
+ 'data-garden-version': string;
18
+ } & IStyledOptionProps, "data-garden-id" | "data-garden-version">;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ export declare const StyledOptionContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
8
+ 'data-garden-id': string;
9
+ 'data-garden-version': string;
10
+ }, "data-garden-id" | "data-garden-version">;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ /// <reference types="react" />
8
+ import { DefaultTheme } from 'styled-components';
9
+ export declare const StyledOptionIcon: import("styled-components").StyledComponent<({ children, theme, ...props }: any) => import("react").FunctionComponentElement<SVGElement>, DefaultTheme, {
10
+ 'data-garden-id': string;
11
+ 'data-garden-version': string;
12
+ }, "data-garden-id" | "data-garden-version">;