@fluentui-copilot/react-prompt-listbox 0.8.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +16 -1
- package/CHANGELOG.md +10 -1
- package/dist/index.d.ts +0 -252
- package/lib/components/utils/useListboxPositioning.js.map +1 -1
- package/lib/index.js +0 -3
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/utils/useListboxPositioning.js.map +1 -1
- package/lib-commonjs/index.js +0 -36
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +7 -7
- package/lib/PromptListbox.js +0 -2
- package/lib/PromptListbox.js.map +0 -1
- package/lib/PromptOption.js +0 -2
- package/lib/PromptOption.js.map +0 -1
- package/lib/components/PromptListbox/PromptListbox.js +0 -14
- package/lib/components/PromptListbox/PromptListbox.js.map +0 -1
- package/lib/components/PromptListbox/PromptListbox.types.js +0 -2
- package/lib/components/PromptListbox/PromptListbox.types.js.map +0 -1
- package/lib/components/PromptListbox/index.js +0 -5
- package/lib/components/PromptListbox/index.js.map +0 -1
- package/lib/components/PromptListbox/renderPromptListbox.js +0 -26
- package/lib/components/PromptListbox/renderPromptListbox.js.map +0 -1
- package/lib/components/PromptListbox/usePromptListbox.js +0 -82
- package/lib/components/PromptListbox/usePromptListbox.js.map +0 -1
- package/lib/components/PromptListbox/usePromptListboxContextValues.js +0 -33
- package/lib/components/PromptListbox/usePromptListboxContextValues.js.map +0 -1
- package/lib/components/PromptListbox/usePromptListboxStyles.styles.js +0 -41
- package/lib/components/PromptListbox/usePromptListboxStyles.styles.js.map +0 -1
- package/lib/components/PromptOption/PromptOption.js +0 -12
- package/lib/components/PromptOption/PromptOption.js.map +0 -1
- package/lib/components/PromptOption/PromptOption.types.js +0 -4
- package/lib/components/PromptOption/PromptOption.types.js.map +0 -1
- package/lib/components/PromptOption/index.js +0 -5
- package/lib/components/PromptOption/index.js.map +0 -1
- package/lib/components/PromptOption/renderPromptOption.js +0 -10
- package/lib/components/PromptOption/renderPromptOption.js.map +0 -1
- package/lib/components/PromptOption/usePromptOption.js +0 -101
- package/lib/components/PromptOption/usePromptOption.js.map +0 -1
- package/lib/components/PromptOption/usePromptOptionStyles.styles.js +0 -98
- package/lib/components/PromptOption/usePromptOptionStyles.styles.js.map +0 -1
- package/lib/components/utils/OptionCollection.types.js +0 -3
- package/lib/components/utils/OptionCollection.types.js.map +0 -1
- package/lib/components/utils/PromptListboxFunctionality.types.js +0 -2
- package/lib/components/utils/PromptListboxFunctionality.types.js.map +0 -1
- package/lib/components/utils/Selection.types.js +0 -3
- package/lib/components/utils/Selection.types.js.map +0 -1
- package/lib/components/utils/dropdownKeyActions.js +0 -68
- package/lib/components/utils/dropdownKeyActions.js.map +0 -1
- package/lib/components/utils/useOptionCollection.js +0 -39
- package/lib/components/utils/useOptionCollection.js.map +0 -1
- package/lib/components/utils/usePromptListboxFunctionality.js +0 -143
- package/lib/components/utils/usePromptListboxFunctionality.js.map +0 -1
- package/lib/components/utils/useSelection.js +0 -54
- package/lib/components/utils/useSelection.js.map +0 -1
- package/lib/components/utils/useTriggerKeyDown.js +0 -149
- package/lib/components/utils/useTriggerKeyDown.js.map +0 -1
- package/lib-commonjs/PromptListbox.js +0 -29
- package/lib-commonjs/PromptListbox.js.map +0 -1
- package/lib-commonjs/PromptOption.js +0 -29
- package/lib-commonjs/PromptOption.js.map +0 -1
- package/lib-commonjs/components/PromptListbox/PromptListbox.js +0 -23
- package/lib-commonjs/components/PromptListbox/PromptListbox.js.map +0 -1
- package/lib-commonjs/components/PromptListbox/PromptListbox.types.js +0 -5
- package/lib-commonjs/components/PromptListbox/PromptListbox.types.js.map +0 -1
- package/lib-commonjs/components/PromptListbox/index.js +0 -32
- package/lib-commonjs/components/PromptListbox/index.js.map +0 -1
- package/lib-commonjs/components/PromptListbox/renderPromptListbox.js +0 -30
- package/lib-commonjs/components/PromptListbox/renderPromptListbox.js.map +0 -1
- package/lib-commonjs/components/PromptListbox/usePromptListbox.js +0 -69
- package/lib-commonjs/components/PromptListbox/usePromptListbox.js.map +0 -1
- package/lib-commonjs/components/PromptListbox/usePromptListboxContextValues.js +0 -36
- package/lib-commonjs/components/PromptListbox/usePromptListboxContextValues.js.map +0 -1
- package/lib-commonjs/components/PromptListbox/usePromptListboxStyles.styles.js +0 -62
- package/lib-commonjs/components/PromptListbox/usePromptListboxStyles.styles.js.map +0 -1
- package/lib-commonjs/components/PromptOption/PromptOption.js +0 -21
- package/lib-commonjs/components/PromptOption/PromptOption.js.map +0 -1
- package/lib-commonjs/components/PromptOption/PromptOption.types.js +0 -7
- package/lib-commonjs/components/PromptOption/PromptOption.types.js.map +0 -1
- package/lib-commonjs/components/PromptOption/index.js +0 -32
- package/lib-commonjs/components/PromptOption/index.js.map +0 -1
- package/lib-commonjs/components/PromptOption/renderPromptOption.js +0 -16
- package/lib-commonjs/components/PromptOption/renderPromptOption.js.map +0 -1
- package/lib-commonjs/components/PromptOption/usePromptOption.js +0 -103
- package/lib-commonjs/components/PromptOption/usePromptOption.js.map +0 -1
- package/lib-commonjs/components/PromptOption/usePromptOptionStyles.styles.js +0 -188
- package/lib-commonjs/components/PromptOption/usePromptOptionStyles.styles.js.map +0 -1
- package/lib-commonjs/components/utils/OptionCollection.types.js +0 -6
- package/lib-commonjs/components/utils/OptionCollection.types.js.map +0 -1
- package/lib-commonjs/components/utils/PromptListboxFunctionality.types.js +0 -5
- package/lib-commonjs/components/utils/PromptListboxFunctionality.types.js.map +0 -1
- package/lib-commonjs/components/utils/Selection.types.js +0 -6
- package/lib-commonjs/components/utils/Selection.types.js.map +0 -1
- package/lib-commonjs/components/utils/dropdownKeyActions.js +0 -66
- package/lib-commonjs/components/utils/dropdownKeyActions.js.map +0 -1
- package/lib-commonjs/components/utils/useOptionCollection.js +0 -46
- package/lib-commonjs/components/utils/useOptionCollection.js.map +0 -1
- package/lib-commonjs/components/utils/usePromptListboxFunctionality.js +0 -150
- package/lib-commonjs/components/utils/usePromptListboxFunctionality.js.map +0 -1
- package/lib-commonjs/components/utils/useSelection.js +0 -72
- package/lib-commonjs/components/utils/useSelection.js.map +0 -1
- package/lib-commonjs/components/utils/useTriggerKeyDown.js +0 -151
- package/lib-commonjs/components/utils/useTriggerKeyDown.js.map +0 -1
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
"name": "@fluentui-copilot/react-prompt-listbox",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Thu, 12 Jun 2025 17:49:28 GMT",
|
|
6
|
+
"tag": "@fluentui-copilot/react-prompt-listbox_v0.10.0",
|
|
7
|
+
"version": "0.10.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "jiangemma@microsoft.com",
|
|
12
|
+
"package": "@fluentui-copilot/react-prompt-listbox",
|
|
13
|
+
"commit": "af4128f58c1c8a87d220ea59ecef96984bfd5012",
|
|
14
|
+
"comment": "chore: Remove deprecated PromptListbox, PromptOption components."
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Mon, 19 May 2025 18:04:28 GMT",
|
|
6
21
|
"tag": "@fluentui-copilot/react-prompt-listbox_v0.8.1",
|
|
7
22
|
"version": "0.8.1",
|
|
8
23
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
# Change Log - @fluentui-copilot/react-prompt-listbox
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 12 Jun 2025 17:49:28 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [0.10.0](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-prompt-listbox_v0.10.0)
|
|
8
|
+
|
|
9
|
+
Thu, 12 Jun 2025 17:49:28 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-prompt-listbox_v0.8.1..@fluentui-copilot/react-prompt-listbox_v0.10.0)
|
|
11
|
+
|
|
12
|
+
### Minor changes
|
|
13
|
+
|
|
14
|
+
- chore: Remove deprecated PromptListbox, PromptOption components. ([PR #3082](https://github.com/microsoft/fluentai/pull/3082) by jiangemma@microsoft.com)
|
|
15
|
+
|
|
7
16
|
## [0.8.0](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-prompt-listbox_v0.8.0)
|
|
8
17
|
|
|
9
18
|
Sat, 03 May 2025 01:27:44 GMT
|
package/dist/index.d.ts
CHANGED
|
@@ -1,39 +1,22 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
import type { ActiveDescendantContextValue } from '@fluentui/react-aria';
|
|
4
1
|
import { ActiveOptionChangeData } from '@fluentui-copilot/react-input-listbox';
|
|
5
|
-
import type { ComboboxBaseState } from '@fluentui/react-combobox';
|
|
6
|
-
import type { ComboboxProps } from '@fluentui/react-components';
|
|
7
|
-
import type { ComboboxState } from '@fluentui/react-combobox';
|
|
8
|
-
import type { ComponentProps } from '@fluentui/react-components';
|
|
9
|
-
import type { ComponentState } from '@fluentui/react-components';
|
|
10
2
|
import type { EditorInputProps } from '@fluentui-copilot/react-editor-input';
|
|
11
3
|
import type { EventData } from '@fluentui/react-utilities';
|
|
12
4
|
import type { EventHandler } from '@fluentui/react-utilities';
|
|
13
|
-
import type { ForwardRefComponent } from '@fluentui/react-components';
|
|
14
5
|
import type { InputListboxProps } from '@fluentui-copilot/react-input-listbox';
|
|
15
|
-
import type { Listbox } from '@fluentui/react-components';
|
|
16
|
-
import type { ListboxContextValue } from '@fluentui/react-combobox';
|
|
17
|
-
import type { ListboxContextValue as ListboxContextValue_2 } from '@fluentui/react-components';
|
|
18
6
|
import { Option as Option_2 } from '@fluentui-copilot/react-input-listbox';
|
|
19
7
|
import { optionClassNames } from '@fluentui-copilot/react-input-listbox';
|
|
20
8
|
import { OptionOnSelectData } from '@fluentui-copilot/react-input-listbox';
|
|
21
9
|
import { OptionProps } from '@fluentui-copilot/react-input-listbox';
|
|
22
|
-
import type { OptionProps as OptionProps_2 } from '@fluentui/react-components';
|
|
23
10
|
import { OptionSlots } from '@fluentui-copilot/react-input-listbox';
|
|
24
11
|
import { OptionState } from '@fluentui-copilot/react-input-listbox';
|
|
25
|
-
import type { OptionState as OptionState_2 } from '@fluentui/react-components';
|
|
26
12
|
import { OptionValue } from '@fluentui-copilot/react-input-listbox';
|
|
27
13
|
import { OverrideActionHandler } from '@fluentui-copilot/react-input-listbox';
|
|
28
14
|
import { OverrideActionHandlerOptions } from '@fluentui-copilot/react-input-listbox';
|
|
29
15
|
import { OverrideActionHandlerResult } from '@fluentui-copilot/react-input-listbox';
|
|
30
16
|
import type { PortalProps } from '@fluentui/react-components';
|
|
31
17
|
import type { PositioningShorthand } from '@fluentui/react-positioning';
|
|
32
|
-
import type { PositioningShorthand as PositioningShorthand_2 } from '@fluentui/react-components';
|
|
33
18
|
import * as React_2 from 'react';
|
|
34
19
|
import { renderOption_unstable } from '@fluentui-copilot/react-input-listbox';
|
|
35
|
-
import type { Slot } from '@fluentui/react-components';
|
|
36
|
-
import type { SlotClassNames } from '@fluentui/react-components';
|
|
37
20
|
import type { UseInputListboxFunctionalityParams } from '@fluentui-copilot/react-input-listbox';
|
|
38
21
|
import { useInputListboxOptionStyles_unstable } from '@fluentui-copilot/react-input-listbox';
|
|
39
22
|
import { useOption_unstable } from '@fluentui-copilot/react-input-listbox';
|
|
@@ -44,27 +27,10 @@ export declare type OnOpenChangeData = (EventData<'click', React_2.MouseEvent<HT
|
|
|
44
27
|
open: boolean;
|
|
45
28
|
};
|
|
46
29
|
|
|
47
|
-
export declare type OnOpenChangeDataDeprecated = (EventData<'click', React_2.MouseEvent<HTMLSpanElement>> | EventData<'focus', React_2.FocusEvent<HTMLSpanElement>> | EventData<'keyboard', React_2.KeyboardEvent<HTMLSpanElement>>) & {
|
|
48
|
-
open: boolean;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
30
|
export { Option_2 as Option }
|
|
52
31
|
|
|
53
32
|
export { optionClassNames }
|
|
54
33
|
|
|
55
|
-
declare type OptionCollectionState = {
|
|
56
|
-
/** The total number of options in the collection. */
|
|
57
|
-
getCount: () => number;
|
|
58
|
-
/** Returns the option data by key. */
|
|
59
|
-
getOptionById(id: string): OptionValue_2 | undefined;
|
|
60
|
-
/** Returns an array of options filtered by a value matching function against the option's value string. */
|
|
61
|
-
getOptionsMatchingValue(matcher: (value: string) => boolean): OptionValue_2[];
|
|
62
|
-
/** The unordered option data. */
|
|
63
|
-
options: OptionValue_2[];
|
|
64
|
-
/** A function that child options call to register their values. Returns a function to unregister the option. */
|
|
65
|
-
registerOption: (option: OptionValue_2, element: HTMLElement) => () => void;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
34
|
export { OptionOnSelectData }
|
|
69
35
|
|
|
70
36
|
export { OptionProps }
|
|
@@ -75,139 +41,18 @@ export { OptionState }
|
|
|
75
41
|
|
|
76
42
|
export { OptionValue }
|
|
77
43
|
|
|
78
|
-
declare type OptionValue_2 = {
|
|
79
|
-
/** The disabled state of the option. */
|
|
80
|
-
disabled?: boolean;
|
|
81
|
-
/** The `id` attribute of the option. */
|
|
82
|
-
id: string;
|
|
83
|
-
/** The `text` string for the option. */
|
|
84
|
-
text: string;
|
|
85
|
-
/** The value string of the option. */
|
|
86
|
-
value: string;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
44
|
export { OverrideActionHandler }
|
|
90
45
|
|
|
91
46
|
export { OverrideActionHandlerOptions }
|
|
92
47
|
|
|
93
48
|
export { OverrideActionHandlerResult }
|
|
94
49
|
|
|
95
|
-
export declare type ProcessedPromptListboxPropsDeprecated = Partial<Omit<PromptListboxProps, 'activeDescendantController' | 'multiselect'>> & {
|
|
96
|
-
ref?: React_2.MutableRefObject<any>;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
/**@deprecated - use InputListbox instead */
|
|
100
|
-
export declare const PromptListbox: ForwardRefComponent<PromptListboxProps>;
|
|
101
|
-
|
|
102
|
-
export declare const promptListboxClassNames: SlotClassNames<PromptListboxSlots>;
|
|
103
|
-
|
|
104
|
-
declare type PromptListboxContextState = Pick<ComboboxBaseState, keyof ListboxContextValue> & Pick<ComboboxState, 'activeDescendantController'>;
|
|
105
|
-
|
|
106
|
-
declare type PromptListboxContextValues = {
|
|
107
|
-
listbox: ListboxContextValue_2;
|
|
108
|
-
activeDescendant: ActiveDescendantContextValue;
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* PromptListbox Props
|
|
113
|
-
*/
|
|
114
|
-
export declare type PromptListboxProps = Omit<ComponentProps<PromptListboxSlots>, 'multiselect'> & Pick<PortalProps, 'mountNode'> & OptionCollectionState & SelectionState & Pick<PromptListboxContextState, 'activeDescendantController'> & Pick<ComboboxProps, 'onActiveOptionChange'> & {
|
|
115
|
-
/**
|
|
116
|
-
* Whether to listbox should be rendered.
|
|
117
|
-
*
|
|
118
|
-
* @default false
|
|
119
|
-
*/
|
|
120
|
-
open?: boolean;
|
|
121
|
-
/**
|
|
122
|
-
* Whether to render the listbox inline or in a portal.
|
|
123
|
-
*
|
|
124
|
-
* @default false
|
|
125
|
-
*/
|
|
126
|
-
inlinePopup?: boolean;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
export declare type PromptListboxSlots = {
|
|
130
|
-
root: Slot<typeof Listbox>;
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* State used in rendering PromptListbox
|
|
135
|
-
*/
|
|
136
|
-
export declare type PromptListboxState = ComponentState<PromptListboxSlots> & PromptListboxContextState & Required<Pick<PromptListboxProps, 'open' | 'inlinePopup'>> & Pick<PromptListboxProps, 'mountNode'>;
|
|
137
|
-
|
|
138
|
-
/**@deprecated - use Option instead */
|
|
139
|
-
export declare const PromptOption: ForwardRefComponent<PromptOptionProps>;
|
|
140
|
-
|
|
141
|
-
export declare const promptOptionClassNames: SlotClassNames<PromptOptionSlots>;
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* PromptOption Props
|
|
145
|
-
*/
|
|
146
|
-
export declare type PromptOptionProps = ComponentProps<PromptOptionSlots> & Pick<OptionProps_2, 'disabled' | 'value'> & ({
|
|
147
|
-
/**
|
|
148
|
-
* An optional override the string value of the PromptOption's display text,
|
|
149
|
-
* defaulting to the PromptOption's child content.
|
|
150
|
-
* This is used as the PromptInput button's or PromptInput input's value when the option is selected,
|
|
151
|
-
* and as the comparison for type-to-find keyboard functionality.
|
|
152
|
-
*/
|
|
153
|
-
text?: string;
|
|
154
|
-
children: string;
|
|
155
|
-
} | {
|
|
156
|
-
/**
|
|
157
|
-
* The string value of the PromptOption's display text when the PromptOption's children are not a string.
|
|
158
|
-
* This is used as the PromptInput button's or PromptInput input's value when the option is selected,
|
|
159
|
-
* and as the comparison for type-to-find keyboard functionality.
|
|
160
|
-
*/
|
|
161
|
-
text: string;
|
|
162
|
-
children?: React.ReactNode;
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
export declare type PromptOptionSlots = {
|
|
166
|
-
root: NonNullable<Slot<'div'>>;
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* State used in rendering PromptOption
|
|
171
|
-
*/
|
|
172
|
-
export declare type PromptOptionState = ComponentState<PromptOptionSlots> & Pick<OptionState_2, 'disabled' | 'selected'>;
|
|
173
|
-
|
|
174
50
|
export { renderOption_unstable }
|
|
175
51
|
|
|
176
|
-
/**
|
|
177
|
-
* Render the final JSX of PromptListbox
|
|
178
|
-
*/
|
|
179
|
-
export declare const renderPromptListbox_unstable: (state: PromptListboxState, contextValues: PromptListboxContextValues) => JSX.Element;
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Render the final JSX of PromptOption
|
|
183
|
-
*/
|
|
184
|
-
export declare const renderPromptOption_unstable: (state: PromptOptionState) => JSX.Element;
|
|
185
|
-
|
|
186
|
-
/** Possible event types for onOptionSelect */
|
|
187
|
-
declare type SelectionEvents = React_2.ChangeEvent<HTMLElement> | React_2.KeyboardEvent<HTMLElement> | React_2.MouseEvent<HTMLElement>;
|
|
188
|
-
|
|
189
|
-
/** Values returned by the useSelection hook */
|
|
190
|
-
declare type SelectionState = {
|
|
191
|
-
clearSelection: (event: SelectionEvents) => void;
|
|
192
|
-
selectedOptions: string[];
|
|
193
|
-
selectOption: (event: SelectionEvents, option: OptionValue_2) => void;
|
|
194
|
-
};
|
|
195
|
-
|
|
196
52
|
export { useInputListboxOptionStyles_unstable }
|
|
197
53
|
|
|
198
54
|
export { useOption_unstable }
|
|
199
55
|
|
|
200
|
-
/**
|
|
201
|
-
* Create the state required to render PromptListbox.
|
|
202
|
-
*
|
|
203
|
-
* The returned state can be modified with hooks such as usePromptListboxStyles_unstable,
|
|
204
|
-
* before being passed to renderPromptListbox_unstable.
|
|
205
|
-
*
|
|
206
|
-
* @param props - props from this instance of PromptListbox
|
|
207
|
-
* @param ref - reference to root HTMLElement of PromptListbox
|
|
208
|
-
*/
|
|
209
|
-
export declare const usePromptListbox_unstable: (props: PromptListboxProps, ref: React_2.Ref<HTMLDivElement>) => PromptListboxState;
|
|
210
|
-
|
|
211
56
|
export declare type UsePromptListboxFunctionality<ContainerElementType extends HTMLElement> = {
|
|
212
57
|
/**
|
|
213
58
|
* Component to be rendered in the Input component. This should be passed to the listbox prop.
|
|
@@ -242,43 +87,6 @@ export declare type UsePromptListboxFunctionality<ContainerElementType extends H
|
|
|
242
87
|
|
|
243
88
|
export declare function usePromptListboxFunctionality<TriggerElementType extends HTMLElement = HTMLSpanElement, ContainerElementType extends HTMLElement = HTMLDivElement>(params: UsePromptListboxFunctionalityParams): UsePromptListboxFunctionality<ContainerElementType>;
|
|
244
89
|
|
|
245
|
-
export declare type UsePromptListboxFunctionalityDeprecated = {
|
|
246
|
-
/**
|
|
247
|
-
* Component to be rendered in the Input component. This should be passed to the listbox prop.
|
|
248
|
-
*/
|
|
249
|
-
promptListbox: JSX.Element;
|
|
250
|
-
/**
|
|
251
|
-
* Props to be spread in the PromptInput, these props are needed for the keyboard behavior to
|
|
252
|
-
* work correctly.
|
|
253
|
-
*/
|
|
254
|
-
triggerProps: {
|
|
255
|
-
ref: React_2.RefObject<HTMLSpanElement>;
|
|
256
|
-
/**
|
|
257
|
-
* Whether the listbox is being used to go through options or the user is currently typing.
|
|
258
|
-
*/
|
|
259
|
-
isInSelectionMode: boolean;
|
|
260
|
-
} & Required<Pick<EditorInputProps, 'onBlur' | 'onFocus' | 'onKeyDown'>>;
|
|
261
|
-
/**
|
|
262
|
-
* Ref used to point which element the listbox should be anchored to. Most use cases
|
|
263
|
-
* will provide this prop to the PromptInput's EditorInput (since this is the root slot,
|
|
264
|
-
* this is provided directly to the component and not the slot).
|
|
265
|
-
*
|
|
266
|
-
* Note: If the containerRef is the same as the trigger, the ref provided in triggerProps needs
|
|
267
|
-
* to be merged with this one using `useMergedRefs(containerRef, triggerProps.ref);`
|
|
268
|
-
*/
|
|
269
|
-
containerRef: React_2.MutableRefObject<any>;
|
|
270
|
-
/**
|
|
271
|
-
* Plugin used to tell where the cursor is in the EditorInput, this is important for the
|
|
272
|
-
* keyboard behavior. This should be passed as children in the PromptInput.
|
|
273
|
-
*/
|
|
274
|
-
cursorPositionPlugin: JSX.Element;
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* @deprecated -- use usePromptListboxFunctionality from usePromptListboxFunctionalityV2.tsx instead
|
|
279
|
-
*/
|
|
280
|
-
export declare function usePromptListboxFunctionalityDeprecated(params: UsePromptListboxFunctionalityParamsDeprecated): UsePromptListboxFunctionalityDeprecated;
|
|
281
|
-
|
|
282
90
|
export declare type UsePromptListboxFunctionalityParams = UseInputListboxFunctionalityParams & {
|
|
283
91
|
open?: boolean;
|
|
284
92
|
defaultOpen?: boolean;
|
|
@@ -320,64 +128,4 @@ export declare type UsePromptListboxFunctionalityParams = UseInputListboxFunctio
|
|
|
320
128
|
inline?: boolean;
|
|
321
129
|
} & Pick<PortalProps, 'mountNode'>;
|
|
322
130
|
|
|
323
|
-
export declare type UsePromptListboxFunctionalityParamsDeprecated = {
|
|
324
|
-
open?: boolean;
|
|
325
|
-
defaultOpen?: boolean;
|
|
326
|
-
onOpenChange?: EventHandler<OnOpenChangeDataDeprecated>;
|
|
327
|
-
positioning?: PositioningShorthand_2;
|
|
328
|
-
/**
|
|
329
|
-
* Callback to call when the selection mode (selecting an action vs typing) changes.
|
|
330
|
-
*/
|
|
331
|
-
onSelectionModeChange?: (isInSelectionMode: boolean) => void;
|
|
332
|
-
/**
|
|
333
|
-
* Props to be passed to the ListboxComponent
|
|
334
|
-
*/
|
|
335
|
-
listboxProps?: ProcessedPromptListboxPropsDeprecated;
|
|
336
|
-
/**
|
|
337
|
-
* Whether the listbox's width should take all the available space or only
|
|
338
|
-
* the required space.
|
|
339
|
-
*
|
|
340
|
-
* @default false
|
|
341
|
-
*/
|
|
342
|
-
fluid?: boolean;
|
|
343
|
-
/**
|
|
344
|
-
* Whether to allow reaching the listbox options by arrowing up at the start of the input.
|
|
345
|
-
* Note, this prop is meant to be used with the following positioning props:
|
|
346
|
-
* ```ts
|
|
347
|
-
* usePromptListboxFunctionality({
|
|
348
|
-
* positioning: {
|
|
349
|
-
* position: 'above',
|
|
350
|
-
* fallbackPositions: ['above']
|
|
351
|
-
* }
|
|
352
|
-
* });
|
|
353
|
-
* ```
|
|
354
|
-
* This is useful when using PromptListbox with other components such as ChatInput since
|
|
355
|
-
* the input will always stay at the bottom therefore the listbox would always get cut.
|
|
356
|
-
*
|
|
357
|
-
* @default false
|
|
358
|
-
*/
|
|
359
|
-
allowArrowUpNavigation?: boolean;
|
|
360
|
-
};
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* Apply styling to the PromptListbox slots based on the state
|
|
364
|
-
*/
|
|
365
|
-
export declare const usePromptListboxStyles_unstable: (state: PromptListboxState) => PromptListboxState;
|
|
366
|
-
|
|
367
|
-
/**
|
|
368
|
-
* Create the state required to render PromptOption.
|
|
369
|
-
*
|
|
370
|
-
* The returned state can be modified with hooks such as usePromptOptionStyles_unstable,
|
|
371
|
-
* before being passed to renderPromptOption_unstable.
|
|
372
|
-
*
|
|
373
|
-
* @param props - props from this instance of PromptOption
|
|
374
|
-
* @param ref - reference to root HTMLElement of PromptOption
|
|
375
|
-
*/
|
|
376
|
-
export declare const usePromptOption_unstable: (props: PromptOptionProps, ref: React_2.Ref<HTMLDivElement>) => PromptOptionState;
|
|
377
|
-
|
|
378
|
-
/**
|
|
379
|
-
* Apply styling to the PromptOption slots based on the state
|
|
380
|
-
*/
|
|
381
|
-
export declare const usePromptOptionStyles_unstable: (state: PromptOptionState) => PromptOptionState;
|
|
382
|
-
|
|
383
131
|
export { }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useListboxPositioning.ts"],"sourcesContent":["// Brought from Fluent UI\n\nimport { resolvePositioningShorthand, usePositioning } from '@fluentui/react-positioning';\nimport type * as React from 'react';\nimport type { UsePromptListboxFunctionalityParams } from './
|
|
1
|
+
{"version":3,"sources":["useListboxPositioning.ts"],"sourcesContent":["// Brought from Fluent UI\n\nimport { resolvePositioningShorthand, usePositioning } from '@fluentui/react-positioning';\nimport type * as React from 'react';\nimport type { UsePromptListboxFunctionalityParams } from './usePromptListboxFunctionalityV2';\nimport type { PositioningShorthandValue } from '@fluentui/react-positioning';\n\nexport function useListboxPositioning<AnchorElementType extends HTMLElement = HTMLSpanElement>(\n props: Pick<UsePromptListboxFunctionalityParams, 'fluid' | 'positioning'>,\n): [listboxRef: React.RefObject<HTMLSpanElement>, anchorRef: React.RefObject<AnchorElementType>] {\n const { positioning, fluid } = props;\n\n const fallbackPositions: PositioningShorthandValue[] = ['below'];\n\n // popper options\n const popperOptions = {\n position: 'below' as const,\n align: 'start' as const,\n offset: { crossAxis: 0, mainAxis: 2 },\n fallbackPositions: fallbackPositions,\n matchTargetSize: fluid ? ('width' as const) : undefined,\n autoSize: true,\n ...resolvePositioningShorthand(positioning),\n };\n\n const { containerRef: listboxRef, targetRef: anchorRef } = usePositioning(popperOptions);\n\n return [listboxRef, anchorRef];\n}\n"],"names":["resolvePositioningShorthand","usePositioning","useListboxPositioning","props","positioning","fluid","fallbackPositions","popperOptions","position","align","offset","crossAxis","mainAxis","matchTargetSize","undefined","autoSize","containerRef","listboxRef","targetRef","anchorRef"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,yBAAyB;AAEzB,SAASA,2BAA2B,EAAEC,cAAc,QAAQ,8BAA8B;AAK1F,OAAO,SAASC,sBACdC,KAAyE;IAEzE,MAAM,EAAEC,WAAW,EAAEC,KAAK,EAAE,GAAGF;IAE/B,MAAMG,oBAAiD;QAAC;KAAQ;IAEhE,iBAAiB;IACjB,MAAMC,gBAAgB;QACpBC,UAAU;QACVC,OAAO;QACPC,QAAQ;YAAEC,WAAW;YAAGC,UAAU;QAAE;QACpCN,mBAAmBA;QACnBO,iBAAiBR,QAAS,UAAoBS;QAC9CC,UAAU;QACV,GAAGf,4BAA4BI,YAAY;IAC7C;IAEA,MAAM,EAAEY,cAAcC,UAAU,EAAEC,WAAWC,SAAS,EAAE,GAAGlB,eAAeM;IAE1E,OAAO;QAACU;QAAYE;KAAU;AAChC"}
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
export { PromptListbox, promptListboxClassNames, renderPromptListbox_unstable, usePromptListboxStyles_unstable, usePromptListbox_unstable } from './PromptListbox';
|
|
2
1
|
export { usePromptListboxFunctionality } from './components/utils/usePromptListboxFunctionalityV2';
|
|
3
|
-
export { usePromptListboxFunctionality as usePromptListboxFunctionalityDeprecated } from './components/utils/usePromptListboxFunctionality';
|
|
4
|
-
export { PromptOption, promptOptionClassNames, renderPromptOption_unstable, usePromptOptionStyles_unstable, usePromptOption_unstable } from './PromptOption';
|
|
5
2
|
export { Option, optionClassNames, renderOption_unstable, useOption_unstable, useInputListboxOptionStyles_unstable } from '@fluentui-copilot/react-input-listbox';
|
|
6
3
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export { usePromptListboxFunctionality } from './components/utils/usePromptListboxFunctionalityV2';\nexport type {\n OnOpenChangeData,\n UsePromptListboxFunctionalityParams,\n UsePromptListboxFunctionality,\n} from './components/utils/usePromptListboxFunctionalityV2';\n\nexport type {\n ActiveOptionChangeData,\n OptionProps,\n OptionSlots,\n OptionState,\n OptionValue,\n OptionOnSelectData,\n OverrideActionHandler,\n OverrideActionHandlerOptions,\n OverrideActionHandlerResult,\n} from '@fluentui-copilot/react-input-listbox';\nexport {\n Option,\n optionClassNames,\n renderOption_unstable,\n useOption_unstable,\n useInputListboxOptionStyles_unstable,\n} from '@fluentui-copilot/react-input-listbox';\n"],"names":["usePromptListboxFunctionality","Option","optionClassNames","renderOption_unstable","useOption_unstable","useInputListboxOptionStyles_unstable"],"rangeMappings":";","mappings":"AAAA,SAASA,6BAA6B,QAAQ,qDAAqD;AAkBnG,SACEC,MAAM,EACNC,gBAAgB,EAChBC,qBAAqB,EACrBC,kBAAkB,EAClBC,oCAAoC,QAC/B,wCAAwC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useListboxPositioning.ts"],"sourcesContent":["// Brought from Fluent UI\n\nimport { resolvePositioningShorthand, usePositioning } from '@fluentui/react-positioning';\nimport type * as React from 'react';\nimport type { UsePromptListboxFunctionalityParams } from './
|
|
1
|
+
{"version":3,"sources":["useListboxPositioning.ts"],"sourcesContent":["// Brought from Fluent UI\n\nimport { resolvePositioningShorthand, usePositioning } from '@fluentui/react-positioning';\nimport type * as React from 'react';\nimport type { UsePromptListboxFunctionalityParams } from './usePromptListboxFunctionalityV2';\nimport type { PositioningShorthandValue } from '@fluentui/react-positioning';\n\nexport function useListboxPositioning<AnchorElementType extends HTMLElement = HTMLSpanElement>(\n props: Pick<UsePromptListboxFunctionalityParams, 'fluid' | 'positioning'>,\n): [listboxRef: React.RefObject<HTMLSpanElement>, anchorRef: React.RefObject<AnchorElementType>] {\n const { positioning, fluid } = props;\n\n const fallbackPositions: PositioningShorthandValue[] = ['below'];\n\n // popper options\n const popperOptions = {\n position: 'below' as const,\n align: 'start' as const,\n offset: { crossAxis: 0, mainAxis: 2 },\n fallbackPositions: fallbackPositions,\n matchTargetSize: fluid ? ('width' as const) : undefined,\n autoSize: true,\n ...resolvePositioningShorthand(positioning),\n };\n\n const { containerRef: listboxRef, targetRef: anchorRef } = usePositioning(popperOptions);\n\n return [listboxRef, anchorRef];\n}\n"],"names":["useListboxPositioning","props","positioning","fallbackPositions","popperOptions","position","align","offset","crossAxis","mainAxis","matchTargetSize","fluid","undefined","resolvePositioningShorthand","listboxRef","anchorRef","usePositioning"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,yBAAyB;;;;;+BAOTA;;;eAAAA;;;kCAL4C;AAKrD,SAASA,sBACdC,KAAyE;UAEzE,EAEAC,WAAMC,OAAkD,KAAQF;UAEhEE,oBAAiB;QAAA;KAAA;qBACXC;UACJC,gBAAU;kBACVC;eACAC;gBAAUC;uBAAcC;sBAAY;;2BAEpCC;yBACUC,QAAA,UAAAC;kBACPC;QACL,GAAAA,IAAAA,6CAAA,EAAAX,YAAA;;UAIA,gBAAQY,UAAAA,aAAYC,SAAAA,KAAUC,IAAAA,gCAAA,EAAAZ;IAChC,OAAA;QAAAU;QAAAC;KAAA"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -12,30 +12,12 @@ _export(exports, {
|
|
|
12
12
|
Option: function() {
|
|
13
13
|
return _reactinputlistbox.Option;
|
|
14
14
|
},
|
|
15
|
-
PromptListbox: function() {
|
|
16
|
-
return _PromptListbox.PromptListbox;
|
|
17
|
-
},
|
|
18
|
-
PromptOption: function() {
|
|
19
|
-
return _PromptOption.PromptOption;
|
|
20
|
-
},
|
|
21
15
|
optionClassNames: function() {
|
|
22
16
|
return _reactinputlistbox.optionClassNames;
|
|
23
17
|
},
|
|
24
|
-
promptListboxClassNames: function() {
|
|
25
|
-
return _PromptListbox.promptListboxClassNames;
|
|
26
|
-
},
|
|
27
|
-
promptOptionClassNames: function() {
|
|
28
|
-
return _PromptOption.promptOptionClassNames;
|
|
29
|
-
},
|
|
30
18
|
renderOption_unstable: function() {
|
|
31
19
|
return _reactinputlistbox.renderOption_unstable;
|
|
32
20
|
},
|
|
33
|
-
renderPromptListbox_unstable: function() {
|
|
34
|
-
return _PromptListbox.renderPromptListbox_unstable;
|
|
35
|
-
},
|
|
36
|
-
renderPromptOption_unstable: function() {
|
|
37
|
-
return _PromptOption.renderPromptOption_unstable;
|
|
38
|
-
},
|
|
39
21
|
useInputListboxOptionStyles_unstable: function() {
|
|
40
22
|
return _reactinputlistbox.useInputListboxOptionStyles_unstable;
|
|
41
23
|
},
|
|
@@ -44,26 +26,8 @@ _export(exports, {
|
|
|
44
26
|
},
|
|
45
27
|
usePromptListboxFunctionality: function() {
|
|
46
28
|
return _usePromptListboxFunctionalityV2.usePromptListboxFunctionality;
|
|
47
|
-
},
|
|
48
|
-
usePromptListboxFunctionalityDeprecated: function() {
|
|
49
|
-
return _usePromptListboxFunctionality.usePromptListboxFunctionality;
|
|
50
|
-
},
|
|
51
|
-
usePromptListboxStyles_unstable: function() {
|
|
52
|
-
return _PromptListbox.usePromptListboxStyles_unstable;
|
|
53
|
-
},
|
|
54
|
-
usePromptListbox_unstable: function() {
|
|
55
|
-
return _PromptListbox.usePromptListbox_unstable;
|
|
56
|
-
},
|
|
57
|
-
usePromptOptionStyles_unstable: function() {
|
|
58
|
-
return _PromptOption.usePromptOptionStyles_unstable;
|
|
59
|
-
},
|
|
60
|
-
usePromptOption_unstable: function() {
|
|
61
|
-
return _PromptOption.usePromptOption_unstable;
|
|
62
29
|
}
|
|
63
30
|
});
|
|
64
|
-
const _PromptListbox = require("./PromptListbox");
|
|
65
31
|
const _usePromptListboxFunctionalityV2 = require("./components/utils/usePromptListboxFunctionalityV2");
|
|
66
|
-
const _usePromptListboxFunctionality = require("./components/utils/usePromptListboxFunctionality");
|
|
67
|
-
const _PromptOption = require("./PromptOption");
|
|
68
32
|
const _reactinputlistbox = require("@fluentui-copilot/react-input-listbox");
|
|
69
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export { usePromptListboxFunctionality } from './components/utils/usePromptListboxFunctionalityV2';\nexport type {\n OnOpenChangeData,\n UsePromptListboxFunctionalityParams,\n UsePromptListboxFunctionality,\n} from './components/utils/usePromptListboxFunctionalityV2';\n\nexport type {\n ActiveOptionChangeData,\n OptionProps,\n OptionSlots,\n OptionState,\n OptionValue,\n OptionOnSelectData,\n OverrideActionHandler,\n OverrideActionHandlerOptions,\n OverrideActionHandlerResult,\n} from '@fluentui-copilot/react-input-listbox';\nexport {\n Option,\n optionClassNames,\n renderOption_unstable,\n useOption_unstable,\n useInputListboxOptionStyles_unstable,\n} from '@fluentui-copilot/react-input-listbox';\n"],"names":["Option","optionClassNames","renderOption_unstable","useInputListboxOptionStyles_unstable","useOption_unstable","usePromptListboxFunctionality"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAmBEA,MAAM;eAANA,yBAAM;;IACNC,gBAAgB;eAAhBA,mCAAgB;;IAChBC,qBAAqB;eAArBA,wCAAqB;;IAErBC,oCAAoC;eAApCA,uDAAoC;;IADpCC,kBAAkB;eAAlBA,qCAAkB;;IAtBXC,6BAA6B;eAA7BA,8DAA6B;;;iDAAQ;mCAwBvC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-copilot/react-prompt-listbox",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "PromptListbox for input components using EditorInput.",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@fluentui-copilot/chat-input-plugins": "^0.
|
|
16
|
-
"@fluentui-copilot/react-chat-input-plugins": "^0.
|
|
17
|
-
"@fluentui-copilot/react-editor-input": "^0.
|
|
18
|
-
"@fluentui-copilot/react-input-listbox": "^0.
|
|
19
|
-
"@fluentui-copilot/react-prompt-input": "^0.
|
|
20
|
-
"@fluentui-copilot/react-provider": "^0.
|
|
15
|
+
"@fluentui-copilot/chat-input-plugins": "^0.5.0",
|
|
16
|
+
"@fluentui-copilot/react-chat-input-plugins": "^0.5.1",
|
|
17
|
+
"@fluentui-copilot/react-editor-input": "^0.5.1",
|
|
18
|
+
"@fluentui-copilot/react-input-listbox": "^0.4.0",
|
|
19
|
+
"@fluentui-copilot/react-prompt-input": "^0.10.0",
|
|
20
|
+
"@fluentui-copilot/react-provider": "^0.12.0",
|
|
21
21
|
"@fluentui-copilot/react-text-editor": "^0.4.1",
|
|
22
22
|
"@fluentui-copilot/text-editor": "^0.3.1",
|
|
23
23
|
"@fluentui-copilot/tokens": "^0.3.11",
|
package/lib/PromptListbox.js
DELETED
package/lib/PromptListbox.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["PromptListbox.ts"],"sourcesContent":["export type { PromptListboxContextValues, PromptListboxProps, PromptListboxSlots, PromptListboxState } from './components/PromptListbox/index';\nexport { PromptListbox, promptListboxClassNames, renderPromptListbox_unstable, usePromptListboxStyles_unstable, usePromptListbox_unstable } from './components/PromptListbox/index';\n"],"names":["PromptListbox","promptListboxClassNames","renderPromptListbox_unstable","usePromptListboxStyles_unstable","usePromptListbox_unstable"],"rangeMappings":"","mappings":"AACA,SAASA,aAAa,EAAEC,uBAAuB,EAAEC,4BAA4B,EAAEC,+BAA+B,EAAEC,yBAAyB,QAAQ,mCAAmC"}
|
package/lib/PromptOption.js
DELETED
package/lib/PromptOption.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["PromptOption.ts"],"sourcesContent":["export type { PromptOptionProps, PromptOptionSlots, PromptOptionState } from './components/PromptOption/index';\nexport { PromptOption, promptOptionClassNames, renderPromptOption_unstable, usePromptOptionStyles_unstable, usePromptOption_unstable } from './components/PromptOption/index';\n"],"names":["PromptOption","promptOptionClassNames","renderPromptOption_unstable","usePromptOptionStyles_unstable","usePromptOption_unstable"],"rangeMappings":"","mappings":"AACA,SAASA,YAAY,EAAEC,sBAAsB,EAAEC,2BAA2B,EAAEC,8BAA8B,EAAEC,wBAAwB,QAAQ,kCAAkC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { usePromptListbox_unstable } from './usePromptListbox';
|
|
3
|
-
import { renderPromptListbox_unstable } from './renderPromptListbox';
|
|
4
|
-
import { usePromptListboxStyles_unstable } from './usePromptListboxStyles.styles';
|
|
5
|
-
import { usePromptListboxContextValues } from './usePromptListboxContextValues';
|
|
6
|
-
/**@deprecated - use InputListbox instead */
|
|
7
|
-
export const PromptListbox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
8
|
-
const state = usePromptListbox_unstable(props, ref);
|
|
9
|
-
const contextValues = usePromptListboxContextValues(state);
|
|
10
|
-
usePromptListboxStyles_unstable(state);
|
|
11
|
-
return renderPromptListbox_unstable(state, contextValues);
|
|
12
|
-
});
|
|
13
|
-
PromptListbox.displayName = 'PromptListbox';
|
|
14
|
-
//# sourceMappingURL=PromptListbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["PromptListbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePromptListbox_unstable } from './usePromptListbox';\nimport { renderPromptListbox_unstable } from './renderPromptListbox';\nimport { usePromptListboxStyles_unstable } from './usePromptListboxStyles.styles';\nimport { usePromptListboxContextValues } from './usePromptListboxContextValues';\nimport type { PromptListboxProps } from './PromptListbox.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n/**@deprecated - use InputListbox instead */\nexport const PromptListbox: ForwardRefComponent<PromptListboxProps> = React.forwardRef((props, ref) => {\n const state = usePromptListbox_unstable(props, ref);\n const contextValues = usePromptListboxContextValues(state);\n\n usePromptListboxStyles_unstable(state);\n return renderPromptListbox_unstable(state, contextValues);\n});\n\nPromptListbox.displayName = 'PromptListbox';\n"],"names":["React","usePromptListbox_unstable","renderPromptListbox_unstable","usePromptListboxStyles_unstable","usePromptListboxContextValues","PromptListbox","forwardRef","props","ref","state","contextValues","displayName"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,4BAA4B,QAAQ,wBAAwB;AACrE,SAASC,+BAA+B,QAAQ,kCAAkC;AAClF,SAASC,6BAA6B,QAAQ,kCAAkC;AAIhF,0CAA0C,GAC1C,OAAO,MAAMC,8BAAyDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,QAAQR,0BAA0BM,OAAOC;IAC/C,MAAME,gBAAgBN,8BAA8BK;IAEpDN,gCAAgCM;IAChC,OAAOP,6BAA6BO,OAAOC;AAC7C,GAAG;AAEHL,cAAcM,WAAW,GAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["PromptListbox.types.ts"],"sourcesContent":["import type { ActiveDescendantContextValue } from '@fluentui/react-aria';\nimport type {\n ComboboxProps,\n ComponentProps,\n ComponentState,\n Listbox,\n ListboxContextValue,\n PortalProps,\n Slot,\n} from '@fluentui/react-components';\nimport type { PromptListboxContextState } from './usePromptListboxContextValues';\nimport type { OptionCollectionState } from '../utils/OptionCollection.types';\nimport type { SelectionState } from '../utils/Selection.types';\n\nexport type PromptListboxSlots = {\n root: Slot<typeof Listbox>;\n};\n\n/**\n * PromptListbox Props\n */\nexport type PromptListboxProps = Omit<ComponentProps<PromptListboxSlots>, 'multiselect'> &\n Pick<PortalProps, 'mountNode'> &\n OptionCollectionState &\n SelectionState &\n Pick<PromptListboxContextState, 'activeDescendantController'> &\n Pick<ComboboxProps, 'onActiveOptionChange'> & {\n /**\n * Whether to listbox should be rendered.\n *\n * @default false\n */\n open?: boolean;\n /**\n * Whether to render the listbox inline or in a portal.\n *\n * @default false\n */\n inlinePopup?: boolean;\n };\n\n/**\n * State used in rendering PromptListbox\n */\nexport type PromptListboxState = ComponentState<PromptListboxSlots> &\n PromptListboxContextState &\n Required<Pick<PromptListboxProps, 'open' | 'inlinePopup'>> &\n Pick<PromptListboxProps, 'mountNode'>;\n\nexport type PromptListboxContextValues = {\n listbox: ListboxContextValue;\n activeDescendant: ActiveDescendantContextValue;\n};\n"],"names":[],"rangeMappings":"","mappings":"AAiDA,WAGE"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { PromptListbox } from './PromptListbox';
|
|
2
|
-
export { renderPromptListbox_unstable } from './renderPromptListbox';
|
|
3
|
-
export { usePromptListbox_unstable } from './usePromptListbox';
|
|
4
|
-
export { promptListboxClassNames, usePromptListboxStyles_unstable } from './usePromptListboxStyles.styles';
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export { PromptListbox } from './PromptListbox';\nexport type { PromptListboxContextValues, PromptListboxProps, PromptListboxSlots, PromptListboxState } from './PromptListbox.types';\nexport { renderPromptListbox_unstable } from './renderPromptListbox';\nexport { usePromptListbox_unstable } from './usePromptListbox';\nexport { promptListboxClassNames, usePromptListboxStyles_unstable } from './usePromptListboxStyles.styles';\n"],"names":["PromptListbox","renderPromptListbox_unstable","usePromptListbox_unstable","promptListboxClassNames","usePromptListboxStyles_unstable"],"rangeMappings":";;;","mappings":"AAAA,SAASA,aAAa,QAAQ,kBAAkB;AAEhD,SAASC,4BAA4B,QAAQ,wBAAwB;AACrE,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,uBAAuB,EAAEC,+BAA+B,QAAQ,kCAAkC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
-
import { assertSlots, ListboxProvider, Portal } from '@fluentui/react-components';
|
|
3
|
-
import { ActiveDescendantContextProvider } from '@fluentui/react-aria';
|
|
4
|
-
/**
|
|
5
|
-
* Render the final JSX of PromptListbox
|
|
6
|
-
*/
|
|
7
|
-
export const renderPromptListbox_unstable = (state, contextValues) => {
|
|
8
|
-
assertSlots(state);
|
|
9
|
-
const {
|
|
10
|
-
open
|
|
11
|
-
} = state;
|
|
12
|
-
return /*#__PURE__*/_jsx(ListboxProvider, {
|
|
13
|
-
value: contextValues.listbox,
|
|
14
|
-
children: /*#__PURE__*/_jsx(ActiveDescendantContextProvider, {
|
|
15
|
-
value: contextValues.activeDescendant,
|
|
16
|
-
children: /*#__PURE__*/_jsx("span", {
|
|
17
|
-
"aria-owns": open ? state.root.id : undefined,
|
|
18
|
-
children: open && (state.inlinePopup ? /*#__PURE__*/_jsx(state.root, {}) : /*#__PURE__*/_jsx(Portal, {
|
|
19
|
-
mountNode: state.mountNode,
|
|
20
|
-
children: /*#__PURE__*/_jsx(state.root, {})
|
|
21
|
-
}))
|
|
22
|
-
})
|
|
23
|
-
})
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=renderPromptListbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["renderPromptListbox.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots, ListboxProvider, Portal } from '@fluentui/react-components';\nimport { ActiveDescendantContextProvider } from '@fluentui/react-aria';\nimport type { PromptListboxState, PromptListboxSlots, PromptListboxContextValues } from './PromptListbox.types';\n\n/**\n * Render the final JSX of PromptListbox\n */\nexport const renderPromptListbox_unstable = (state: PromptListboxState, contextValues: PromptListboxContextValues) => {\n assertSlots<PromptListboxSlots>(state);\n const { open } = state;\n\n return (\n <ListboxProvider value={contextValues.listbox}>\n <ActiveDescendantContextProvider value={contextValues.activeDescendant}>\n <span aria-owns={open ? state.root.id : undefined}>\n {open &&\n (state.inlinePopup ? (\n <state.root />\n ) : (\n <Portal mountNode={state.mountNode}>\n <state.root />\n </Portal>\n ))}\n </span>\n </ActiveDescendantContextProvider>\n </ListboxProvider>\n );\n};\n"],"names":["assertSlots","ListboxProvider","Portal","ActiveDescendantContextProvider","renderPromptListbox_unstable","state","contextValues","open","value","listbox","activeDescendant","span","aria-owns","root","id","undefined","inlinePopup","mountNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,EAAEC,eAAe,EAAEC,MAAM,QAAQ,6BAA6B;AAClF,SAASC,+BAA+B,QAAQ,uBAAuB;AAGvE;;CAEC,GACD,OAAO,MAAMC,+BAA+B,CAACC,OAA2BC;IACtEN,YAAgCK;IAChC,MAAM,EAAEE,IAAI,EAAE,GAAGF;IAEjB,qBACE,KAACJ;QAAgBO,OAAOF,cAAcG,OAAO;kBAC3C,cAAA,KAACN;YAAgCK,OAAOF,cAAcI,gBAAgB;sBACpE,cAAA,KAACC;gBAAKC,aAAWL,OAAOF,MAAMQ,IAAI,CAACC,EAAE,GAAGC;0BACrCR,QACEF,CAAAA,MAAMW,WAAW,iBAChB,KAACX,MAAMQ,IAAI,sBAEX,KAACX;oBAAOe,WAAWZ,MAAMY,SAAS;8BAChC,cAAA,KAACZ,MAAMQ,IAAI;kBAEf;;;;AAKZ,EAAE"}
|