@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.
- package/README.md +73 -69
- package/dist/index.cjs.js +1634 -1712
- package/dist/index.esm.js +1633 -1700
- package/dist/typings/context/useComboboxContext.d.ts +25 -0
- package/dist/typings/context/useFieldContext.d.ts +32 -0
- package/dist/typings/context/useItemContext.d.ts +14 -0
- package/dist/typings/context/useItemGroupContext.d.ts +15 -0
- package/dist/typings/context/useMenuContext.d.ts +23 -0
- package/dist/typings/context/useOptionContext.d.ts +14 -0
- package/dist/typings/elements/{Combobox → combobox}/Combobox.d.ts +0 -2
- package/dist/typings/elements/{Fields → combobox}/Label.d.ts +1 -1
- package/dist/typings/elements/{Menu/Items/MediaBody.d.ts → combobox/Listbox.d.ts} +2 -4
- package/dist/typings/elements/{Fields → combobox}/Message.d.ts +1 -1
- package/dist/typings/elements/{Menu/Items/HeaderItem.d.ts → combobox/OptGroup.d.ts} +2 -2
- package/dist/typings/elements/{Menu/Items/MediaItem.d.ts → combobox/Option.d.ts} +5 -2
- package/dist/typings/elements/{Menu/Items/HeaderIcon.d.ts → combobox/OptionMeta.d.ts} +1 -1
- package/dist/typings/elements/combobox/Tag.d.ts +15 -0
- package/dist/typings/elements/combobox/TagAvatar.d.ts +14 -0
- package/dist/typings/elements/combobox/TagGroup.d.ts +12 -0
- package/dist/typings/elements/combobox/utils.d.ts +38 -0
- package/dist/typings/elements/{Menu/Items → menu}/Item.d.ts +5 -2
- package/dist/typings/elements/{Menu/Items/AddItem.d.ts → menu/ItemGroup.d.ts} +2 -2
- package/dist/typings/elements/{Menu/Items → menu}/ItemMeta.d.ts +2 -2
- package/dist/typings/elements/{Menu → menu}/Menu.d.ts +0 -2
- package/dist/typings/elements/menu/MenuList.d.ts +12 -0
- package/dist/typings/elements/{Menu → menu}/Separator.d.ts +1 -1
- package/dist/typings/elements/menu/utils.d.ts +29 -0
- package/dist/typings/index.d.ts +18 -25
- package/dist/typings/types/index.d.ts +242 -121
- package/dist/typings/{styled/items/StyledItemIcon.d.ts → views/combobox/StyledCombobox.d.ts} +4 -6
- package/dist/typings/{styled/multiselect/StyledMultiselectItemWrapper.d.ts → views/combobox/StyledContainer.d.ts} +1 -1
- package/dist/typings/{styled/select/StyledSelect.d.ts → views/combobox/StyledField.d.ts} +1 -1
- package/dist/typings/views/combobox/StyledFloatingListbox.d.ts +18 -0
- package/dist/typings/views/combobox/StyledHint.d.ts +11 -0
- package/dist/typings/views/combobox/StyledInput.d.ts +20 -0
- package/dist/typings/{styled/items/StyledAddItem.d.ts → views/combobox/StyledInputGroup.d.ts} +2 -4
- package/dist/typings/views/combobox/StyledInputIcon.d.ts +20 -0
- package/dist/typings/views/combobox/StyledLabel.d.ts +11 -0
- package/dist/typings/views/combobox/StyledListbox.d.ts +17 -0
- package/dist/typings/{styled/items/StyledNextItem.d.ts → views/combobox/StyledListboxSeparator.d.ts} +2 -4
- package/dist/typings/views/combobox/StyledMessage.d.ts +11 -0
- package/dist/typings/views/combobox/StyledOptGroup.d.ts +14 -0
- package/dist/typings/views/combobox/StyledOption.d.ts +18 -0
- package/dist/typings/views/combobox/StyledOptionContent.d.ts +10 -0
- package/dist/typings/views/combobox/StyledOptionIcon.d.ts +12 -0
- package/dist/typings/views/combobox/StyledOptionMeta.d.ts +14 -0
- package/dist/typings/views/combobox/StyledOptionTypeIcon.d.ts +17 -0
- package/dist/typings/views/combobox/StyledTag.d.ts +17 -0
- package/dist/typings/views/combobox/StyledTagsButton.d.ts +16 -0
- package/dist/typings/views/combobox/StyledTrigger.d.ts +24 -0
- package/dist/typings/views/combobox/StyledValue.d.ts +21 -0
- package/dist/typings/views/index.d.ts +38 -0
- package/dist/typings/views/menu/StyledButton.d.ts +20 -0
- package/dist/typings/views/menu/StyledFloatingMenu.d.ts +13 -0
- package/dist/typings/{styled/items/StyledPreviousItem.d.ts → views/menu/StyledItem.d.ts} +4 -4
- package/dist/typings/views/menu/StyledItemContent.d.ts +13 -0
- package/dist/typings/views/menu/StyledItemGroup.d.ts +13 -0
- package/dist/typings/views/menu/StyledItemIcon.d.ts +14 -0
- package/dist/typings/{styled/items → views/menu}/StyledItemMeta.d.ts +5 -10
- package/dist/typings/views/menu/StyledItemTypeIcon.d.ts +14 -0
- package/dist/typings/views/menu/StyledMenu.d.ts +19 -0
- package/dist/typings/{styled → views}/menu/StyledSeparator.d.ts +7 -4
- package/package.json +16 -14
- package/dist/typings/elements/Autocomplete/Autocomplete.d.ts +0 -14
- package/dist/typings/elements/Dropdown/Dropdown.d.ts +0 -26
- package/dist/typings/elements/Menu/Items/MediaFigure.d.ts +0 -11
- package/dist/typings/elements/Menu/Items/NextItem.d.ts +0 -12
- package/dist/typings/elements/Menu/Items/PreviousItem.d.ts +0 -12
- package/dist/typings/elements/Multiselect/Multiselect.d.ts +0 -14
- package/dist/typings/elements/Select/Select.d.ts +0 -14
- package/dist/typings/elements/Trigger/Trigger.d.ts +0 -24
- package/dist/typings/styled/index.d.ts +0 -29
- package/dist/typings/styled/items/StyledItem.d.ts +0 -20
- package/dist/typings/styled/items/StyledNextIcon.d.ts +0 -12
- package/dist/typings/styled/items/StyledPreviousIcon.d.ts +0 -12
- package/dist/typings/styled/items/header/StyledHeaderIcon.d.ts +0 -14
- package/dist/typings/styled/items/header/StyledHeaderItem.d.ts +0 -16
- package/dist/typings/styled/items/media/StyledMediaBody.d.ts +0 -17
- package/dist/typings/styled/items/media/StyledMediaFigure.d.ts +0 -287
- package/dist/typings/styled/items/media/StyledMediaItem.d.ts +0 -13
- package/dist/typings/styled/menu/StyledMenu.d.ts +0 -20
- package/dist/typings/styled/menu/StyledMenuWrapper.d.ts +0 -16
- package/dist/typings/styled/multiselect/StyledMultiselectInput.d.ts +0 -22
- package/dist/typings/styled/multiselect/StyledMultiselectItemsContainer.d.ts +0 -16
- package/dist/typings/styled/multiselect/StyledMultiselectMoreAnchor.d.ts +0 -15
- package/dist/typings/styled/select/StyledFauxInput.d.ts +0 -22
- package/dist/typings/styled/select/StyledInput.d.ts +0 -15
- package/dist/typings/utils/garden-placements.d.ts +0 -26
- package/dist/typings/utils/useDropdownContext.d.ts +0 -28
- package/dist/typings/utils/useFieldContext.d.ts +0 -17
- package/dist/typings/utils/useItemContext.d.ts +0 -16
- package/dist/typings/utils/useMenuContext.d.ts +0 -17
- /package/dist/typings/elements/{Fields → combobox}/Field.d.ts +0 -0
- /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,
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
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
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
|
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}
|
|
44
|
-
* @param {
|
|
45
|
-
*
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
|
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
|
-
|
|
85
|
+
renderExpandTags?: (value: number) => string;
|
|
80
86
|
/**
|
|
81
|
-
*
|
|
87
|
+
* Overrides the `inputValue` or `placeholder` text displayed when the combobox is not focused
|
|
82
88
|
*
|
|
83
|
-
* @param {
|
|
84
|
-
* @param {
|
|
85
|
-
*
|
|
86
|
-
* @returns {
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}) =>
|
|
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
|
|
94
|
-
/**
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
-
|
|
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
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
|
132
|
-
/**
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
|
148
|
-
/**
|
|
149
|
-
|
|
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
|
}
|
package/dist/typings/{styled/items/StyledItemIcon.d.ts → views/combobox/StyledCombobox.d.ts}
RENAMED
|
@@ -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
|
|
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
|
|
11
|
+
export declare const StyledCombobox: import("styled-components").StyledComponent<"div", DefaultTheme, {
|
|
14
12
|
'data-garden-id': string;
|
|
15
13
|
'data-garden-version': string;
|
|
16
|
-
} &
|
|
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
|
|
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
|
|
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 {};
|
package/dist/typings/{styled/items/StyledAddItem.d.ts → views/combobox/StyledInputGroup.d.ts}
RENAMED
|
@@ -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
|
-
|
|
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">;
|
package/dist/typings/{styled/items/StyledNextItem.d.ts → views/combobox/StyledListboxSeparator.d.ts}
RENAMED
|
@@ -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
|
-
|
|
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">;
|