@fluentui/react-tag-picker 0.0.0-nightly-20240510-0407.1
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.md +189 -0
- package/LICENSE +15 -0
- package/README.md +68 -0
- package/Spec.md +208 -0
- package/dist/index.d.ts +453 -0
- package/lib/TagPicker.js +1 -0
- package/lib/TagPicker.js.map +1 -0
- package/lib/TagPickerButton.js +1 -0
- package/lib/TagPickerButton.js.map +1 -0
- package/lib/TagPickerControl.js +1 -0
- package/lib/TagPickerControl.js.map +1 -0
- package/lib/TagPickerGroup.js +1 -0
- package/lib/TagPickerGroup.js.map +1 -0
- package/lib/TagPickerInput.js +1 -0
- package/lib/TagPickerInput.js.map +1 -0
- package/lib/TagPickerList.js +1 -0
- package/lib/TagPickerList.js.map +1 -0
- package/lib/TagPickerOption.js +1 -0
- package/lib/TagPickerOption.js.map +1 -0
- package/lib/TagPickerOptionGroup.js +1 -0
- package/lib/TagPickerOptionGroup.js.map +1 -0
- package/lib/components/TagPicker/TagPicker.js +13 -0
- package/lib/components/TagPicker/TagPicker.js.map +1 -0
- package/lib/components/TagPicker/TagPicker.types.js +1 -0
- package/lib/components/TagPicker/TagPicker.types.js.map +1 -0
- package/lib/components/TagPicker/index.js +4 -0
- package/lib/components/TagPicker/index.js.map +1 -0
- package/lib/components/TagPicker/renderTagPicker.js +20 -0
- package/lib/components/TagPicker/renderTagPicker.js.map +1 -0
- package/lib/components/TagPicker/useTagPicker.js +123 -0
- package/lib/components/TagPicker/useTagPicker.js.map +1 -0
- package/lib/components/TagPicker/useTagPickerContextValues.js +41 -0
- package/lib/components/TagPicker/useTagPickerContextValues.js.map +1 -0
- package/lib/components/TagPickerButton/TagPickerButton.js +15 -0
- package/lib/components/TagPickerButton/TagPickerButton.js.map +1 -0
- package/lib/components/TagPickerButton/TagPickerButton.types.js +1 -0
- package/lib/components/TagPickerButton/TagPickerButton.types.js.map +1 -0
- package/lib/components/TagPickerButton/index.js +5 -0
- package/lib/components/TagPickerButton/index.js.map +1 -0
- package/lib/components/TagPickerButton/renderTagPickerButton.js +8 -0
- package/lib/components/TagPickerButton/renderTagPickerButton.js.map +1 -0
- package/lib/components/TagPickerButton/useTagPickerButton.js +54 -0
- package/lib/components/TagPickerButton/useTagPickerButton.js.map +1 -0
- package/lib/components/TagPickerButton/useTagPickerButtonStyles.styles.js +191 -0
- package/lib/components/TagPickerButton/useTagPickerButtonStyles.styles.js.map +1 -0
- package/lib/components/TagPickerControl/TagPickerControl.js +15 -0
- package/lib/components/TagPickerControl/TagPickerControl.js.map +1 -0
- package/lib/components/TagPickerControl/TagPickerControl.types.js +1 -0
- package/lib/components/TagPickerControl/TagPickerControl.types.js.map +1 -0
- package/lib/components/TagPickerControl/index.js +5 -0
- package/lib/components/TagPickerControl/index.js.map +1 -0
- package/lib/components/TagPickerControl/renderTagPickerControl.js +18 -0
- package/lib/components/TagPickerControl/renderTagPickerControl.js.map +1 -0
- package/lib/components/TagPickerControl/useTagPickerControl.js +101 -0
- package/lib/components/TagPickerControl/useTagPickerControl.js.map +1 -0
- package/lib/components/TagPickerControl/useTagPickerControlStyles.styles.js +262 -0
- package/lib/components/TagPickerControl/useTagPickerControlStyles.styles.js.map +1 -0
- package/lib/components/TagPickerGroup/TagPickerGroup.js +16 -0
- package/lib/components/TagPickerGroup/TagPickerGroup.js.map +1 -0
- package/lib/components/TagPickerGroup/TagPickerGroup.types.js +1 -0
- package/lib/components/TagPickerGroup/TagPickerGroup.types.js.map +1 -0
- package/lib/components/TagPickerGroup/index.js +5 -0
- package/lib/components/TagPickerGroup/index.js.map +1 -0
- package/lib/components/TagPickerGroup/renderTagPickerGroup.js +7 -0
- package/lib/components/TagPickerGroup/renderTagPickerGroup.js.map +1 -0
- package/lib/components/TagPickerGroup/useTagPickerGroup.js +62 -0
- package/lib/components/TagPickerGroup/useTagPickerGroup.js.map +1 -0
- package/lib/components/TagPickerGroup/useTagPickerGroupStyles.styles.js +53 -0
- package/lib/components/TagPickerGroup/useTagPickerGroupStyles.styles.js.map +1 -0
- package/lib/components/TagPickerInput/TagPickerInput.js +15 -0
- package/lib/components/TagPickerInput/TagPickerInput.js.map +1 -0
- package/lib/components/TagPickerInput/TagPickerInput.types.js +1 -0
- package/lib/components/TagPickerInput/TagPickerInput.types.js.map +1 -0
- package/lib/components/TagPickerInput/index.js +5 -0
- package/lib/components/TagPickerInput/index.js.map +1 -0
- package/lib/components/TagPickerInput/renderTagPickerInput.js +8 -0
- package/lib/components/TagPickerInput/renderTagPickerInput.js.map +1 -0
- package/lib/components/TagPickerInput/useTagPickerInput.js +137 -0
- package/lib/components/TagPickerInput/useTagPickerInput.js.map +1 -0
- package/lib/components/TagPickerInput/useTagPickerInputStyles.styles.js +60 -0
- package/lib/components/TagPickerInput/useTagPickerInputStyles.styles.js.map +1 -0
- package/lib/components/TagPickerList/TagPickerList.js +15 -0
- package/lib/components/TagPickerList/TagPickerList.js.map +1 -0
- package/lib/components/TagPickerList/TagPickerList.types.js +1 -0
- package/lib/components/TagPickerList/TagPickerList.types.js.map +1 -0
- package/lib/components/TagPickerList/index.js +5 -0
- package/lib/components/TagPickerList/index.js.map +1 -0
- package/lib/components/TagPickerList/renderTagPickerList.js +8 -0
- package/lib/components/TagPickerList/renderTagPickerList.js.map +1 -0
- package/lib/components/TagPickerList/useTagPickerList.js +39 -0
- package/lib/components/TagPickerList/useTagPickerList.js.map +1 -0
- package/lib/components/TagPickerList/useTagPickerListStyles.styles.js +33 -0
- package/lib/components/TagPickerList/useTagPickerListStyles.styles.js.map +1 -0
- package/lib/components/TagPickerOption/TagPickerOption.js +15 -0
- package/lib/components/TagPickerOption/TagPickerOption.js.map +1 -0
- package/lib/components/TagPickerOption/TagPickerOption.types.js +1 -0
- package/lib/components/TagPickerOption/TagPickerOption.types.js.map +1 -0
- package/lib/components/TagPickerOption/index.js +5 -0
- package/lib/components/TagPickerOption/index.js.map +1 -0
- package/lib/components/TagPickerOption/renderTagPickerOption.js +14 -0
- package/lib/components/TagPickerOption/renderTagPickerOption.js.map +1 -0
- package/lib/components/TagPickerOption/useTagPickerOption.js +35 -0
- package/lib/components/TagPickerOption/useTagPickerOption.js.map +1 -0
- package/lib/components/TagPickerOption/useTagPickerOptionStyles.styles.js +49 -0
- package/lib/components/TagPickerOption/useTagPickerOptionStyles.styles.js.map +1 -0
- package/lib/components/TagPickerOptionGroup/TagPickerOptionGroup.js +15 -0
- package/lib/components/TagPickerOptionGroup/TagPickerOptionGroup.js.map +1 -0
- package/lib/components/TagPickerOptionGroup/TagPickerOptionGroup.types.js +1 -0
- package/lib/components/TagPickerOptionGroup/TagPickerOptionGroup.types.js.map +1 -0
- package/lib/components/TagPickerOptionGroup/index.js +5 -0
- package/lib/components/TagPickerOptionGroup/index.js.map +1 -0
- package/lib/components/TagPickerOptionGroup/renderTagPickerOptionGroup.js +4 -0
- package/lib/components/TagPickerOptionGroup/renderTagPickerOptionGroup.js.map +1 -0
- package/lib/components/TagPickerOptionGroup/useTagPickerOptionGroup.js +11 -0
- package/lib/components/TagPickerOptionGroup/useTagPickerOptionGroup.js.map +1 -0
- package/lib/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.js +18 -0
- package/lib/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.js.map +1 -0
- package/lib/contexts/TagPickerContext.js +27 -0
- package/lib/contexts/TagPickerContext.js.map +1 -0
- package/lib/index.js +9 -0
- package/lib/index.js.map +1 -0
- package/lib/utils/tagPicker2Tag.js +32 -0
- package/lib/utils/tagPicker2Tag.js.map +1 -0
- package/lib/utils/tokens.js +6 -0
- package/lib/utils/tokens.js.map +1 -0
- package/lib/utils/useResizeObserverRef.js +22 -0
- package/lib/utils/useResizeObserverRef.js.map +1 -0
- package/lib/utils/useTagPickerFilter.js +35 -0
- package/lib/utils/useTagPickerFilter.js.map +1 -0
- package/lib-commonjs/TagPicker.js +6 -0
- package/lib-commonjs/TagPicker.js.map +1 -0
- package/lib-commonjs/TagPickerButton.js +6 -0
- package/lib-commonjs/TagPickerButton.js.map +1 -0
- package/lib-commonjs/TagPickerControl.js +6 -0
- package/lib-commonjs/TagPickerControl.js.map +1 -0
- package/lib-commonjs/TagPickerGroup.js +6 -0
- package/lib-commonjs/TagPickerGroup.js.map +1 -0
- package/lib-commonjs/TagPickerInput.js +6 -0
- package/lib-commonjs/TagPickerInput.js.map +1 -0
- package/lib-commonjs/TagPickerList.js +6 -0
- package/lib-commonjs/TagPickerList.js.map +1 -0
- package/lib-commonjs/TagPickerOption.js +6 -0
- package/lib-commonjs/TagPickerOption.js.map +1 -0
- package/lib-commonjs/TagPickerOptionGroup.js +6 -0
- package/lib-commonjs/TagPickerOptionGroup.js.map +1 -0
- package/lib-commonjs/components/TagPicker/TagPicker.js +21 -0
- package/lib-commonjs/components/TagPicker/TagPicker.js.map +1 -0
- package/lib-commonjs/components/TagPicker/TagPicker.types.js +4 -0
- package/lib-commonjs/components/TagPicker/TagPicker.types.js.map +1 -0
- package/lib-commonjs/components/TagPicker/index.js +9 -0
- package/lib-commonjs/components/TagPicker/index.js.map +1 -0
- package/lib-commonjs/components/TagPicker/renderTagPicker.js +29 -0
- package/lib-commonjs/components/TagPicker/renderTagPicker.js.map +1 -0
- package/lib-commonjs/components/TagPicker/useTagPicker.js +126 -0
- package/lib-commonjs/components/TagPicker/useTagPicker.js.map +1 -0
- package/lib-commonjs/components/TagPicker/useTagPickerContextValues.js +52 -0
- package/lib-commonjs/components/TagPicker/useTagPickerContextValues.js.map +1 -0
- package/lib-commonjs/components/TagPickerButton/TagPickerButton.js +23 -0
- package/lib-commonjs/components/TagPickerButton/TagPickerButton.js.map +1 -0
- package/lib-commonjs/components/TagPickerButton/TagPickerButton.types.js +4 -0
- package/lib-commonjs/components/TagPickerButton/TagPickerButton.types.js.map +1 -0
- package/lib-commonjs/components/TagPickerButton/index.js +10 -0
- package/lib-commonjs/components/TagPickerButton/index.js.map +1 -0
- package/lib-commonjs/components/TagPickerButton/renderTagPickerButton.js +16 -0
- package/lib-commonjs/components/TagPickerButton/renderTagPickerButton.js.map +1 -0
- package/lib-commonjs/components/TagPickerButton/useTagPickerButton.js +57 -0
- package/lib-commonjs/components/TagPickerButton/useTagPickerButton.js.map +1 -0
- package/lib-commonjs/components/TagPickerButton/useTagPickerButtonStyles.styles.js +453 -0
- package/lib-commonjs/components/TagPickerButton/useTagPickerButtonStyles.styles.js.map +1 -0
- package/lib-commonjs/components/TagPickerControl/TagPickerControl.js +23 -0
- package/lib-commonjs/components/TagPickerControl/TagPickerControl.js.map +1 -0
- package/lib-commonjs/components/TagPickerControl/TagPickerControl.types.js +6 -0
- package/lib-commonjs/components/TagPickerControl/TagPickerControl.types.js.map +1 -0
- package/lib-commonjs/components/TagPickerControl/index.js +10 -0
- package/lib-commonjs/components/TagPickerControl/index.js.map +1 -0
- package/lib-commonjs/components/TagPickerControl/renderTagPickerControl.js +26 -0
- package/lib-commonjs/components/TagPickerControl/renderTagPickerControl.js.map +1 -0
- package/lib-commonjs/components/TagPickerControl/useTagPickerControl.js +104 -0
- package/lib-commonjs/components/TagPickerControl/useTagPickerControl.js.map +1 -0
- package/lib-commonjs/components/TagPickerControl/useTagPickerControlStyles.styles.js +579 -0
- package/lib-commonjs/components/TagPickerControl/useTagPickerControlStyles.styles.js.map +1 -0
- package/lib-commonjs/components/TagPickerGroup/TagPickerGroup.js +24 -0
- package/lib-commonjs/components/TagPickerGroup/TagPickerGroup.js.map +1 -0
- package/lib-commonjs/components/TagPickerGroup/TagPickerGroup.types.js +4 -0
- package/lib-commonjs/components/TagPickerGroup/TagPickerGroup.types.js.map +1 -0
- package/lib-commonjs/components/TagPickerGroup/index.js +10 -0
- package/lib-commonjs/components/TagPickerGroup/index.js.map +1 -0
- package/lib-commonjs/components/TagPickerGroup/renderTagPickerGroup.js +17 -0
- package/lib-commonjs/components/TagPickerGroup/renderTagPickerGroup.js.map +1 -0
- package/lib-commonjs/components/TagPickerGroup/useTagPickerGroup.js +65 -0
- package/lib-commonjs/components/TagPickerGroup/useTagPickerGroup.js.map +1 -0
- package/lib-commonjs/components/TagPickerGroup/useTagPickerGroupStyles.styles.js +97 -0
- package/lib-commonjs/components/TagPickerGroup/useTagPickerGroupStyles.styles.js.map +1 -0
- package/lib-commonjs/components/TagPickerInput/TagPickerInput.js +23 -0
- package/lib-commonjs/components/TagPickerInput/TagPickerInput.js.map +1 -0
- package/lib-commonjs/components/TagPickerInput/TagPickerInput.types.js +4 -0
- package/lib-commonjs/components/TagPickerInput/TagPickerInput.types.js.map +1 -0
- package/lib-commonjs/components/TagPickerInput/index.js +10 -0
- package/lib-commonjs/components/TagPickerInput/index.js.map +1 -0
- package/lib-commonjs/components/TagPickerInput/renderTagPickerInput.js +16 -0
- package/lib-commonjs/components/TagPickerInput/renderTagPickerInput.js.map +1 -0
- package/lib-commonjs/components/TagPickerInput/useTagPickerInput.js +140 -0
- package/lib-commonjs/components/TagPickerInput/useTagPickerInput.js.map +1 -0
- package/lib-commonjs/components/TagPickerInput/useTagPickerInputStyles.styles.js +122 -0
- package/lib-commonjs/components/TagPickerInput/useTagPickerInputStyles.styles.js.map +1 -0
- package/lib-commonjs/components/TagPickerList/TagPickerList.js +23 -0
- package/lib-commonjs/components/TagPickerList/TagPickerList.js.map +1 -0
- package/lib-commonjs/components/TagPickerList/TagPickerList.types.js +4 -0
- package/lib-commonjs/components/TagPickerList/TagPickerList.types.js.map +1 -0
- package/lib-commonjs/components/TagPickerList/index.js +10 -0
- package/lib-commonjs/components/TagPickerList/index.js.map +1 -0
- package/lib-commonjs/components/TagPickerList/renderTagPickerList.js +16 -0
- package/lib-commonjs/components/TagPickerList/renderTagPickerList.js.map +1 -0
- package/lib-commonjs/components/TagPickerList/useTagPickerList.js +41 -0
- package/lib-commonjs/components/TagPickerList/useTagPickerList.js.map +1 -0
- package/lib-commonjs/components/TagPickerList/useTagPickerListStyles.styles.js +66 -0
- package/lib-commonjs/components/TagPickerList/useTagPickerListStyles.styles.js.map +1 -0
- package/lib-commonjs/components/TagPickerOption/TagPickerOption.js +23 -0
- package/lib-commonjs/components/TagPickerOption/TagPickerOption.js.map +1 -0
- package/lib-commonjs/components/TagPickerOption/TagPickerOption.types.js +6 -0
- package/lib-commonjs/components/TagPickerOption/TagPickerOption.types.js.map +1 -0
- package/lib-commonjs/components/TagPickerOption/index.js +10 -0
- package/lib-commonjs/components/TagPickerOption/index.js.map +1 -0
- package/lib-commonjs/components/TagPickerOption/renderTagPickerOption.js +22 -0
- package/lib-commonjs/components/TagPickerOption/renderTagPickerOption.js.map +1 -0
- package/lib-commonjs/components/TagPickerOption/useTagPickerOption.js +38 -0
- package/lib-commonjs/components/TagPickerOption/useTagPickerOption.js.map +1 -0
- package/lib-commonjs/components/TagPickerOption/useTagPickerOptionStyles.styles.js +69 -0
- package/lib-commonjs/components/TagPickerOption/useTagPickerOptionStyles.styles.js.map +1 -0
- package/lib-commonjs/components/TagPickerOptionGroup/TagPickerOptionGroup.js +23 -0
- package/lib-commonjs/components/TagPickerOptionGroup/TagPickerOptionGroup.js.map +1 -0
- package/lib-commonjs/components/TagPickerOptionGroup/TagPickerOptionGroup.types.js +4 -0
- package/lib-commonjs/components/TagPickerOptionGroup/TagPickerOptionGroup.types.js.map +1 -0
- package/lib-commonjs/components/TagPickerOptionGroup/index.js +10 -0
- package/lib-commonjs/components/TagPickerOptionGroup/index.js.map +1 -0
- package/lib-commonjs/components/TagPickerOptionGroup/renderTagPickerOptionGroup.js +12 -0
- package/lib-commonjs/components/TagPickerOptionGroup/renderTagPickerOptionGroup.js.map +1 -0
- package/lib-commonjs/components/TagPickerOptionGroup/useTagPickerOptionGroup.js +14 -0
- package/lib-commonjs/components/TagPickerOptionGroup/useTagPickerOptionGroup.js.map +1 -0
- package/lib-commonjs/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.js +32 -0
- package/lib-commonjs/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.js.map +1 -0
- package/lib-commonjs/contexts/TagPickerContext.js +47 -0
- package/lib-commonjs/contexts/TagPickerContext.js.map +1 -0
- package/lib-commonjs/index.js +138 -0
- package/lib-commonjs/index.js.map +1 -0
- package/lib-commonjs/utils/tagPicker2Tag.js +53 -0
- package/lib-commonjs/utils/tagPicker2Tag.js.map +1 -0
- package/lib-commonjs/utils/tokens.js +24 -0
- package/lib-commonjs/utils/tokens.js.map +1 -0
- package/lib-commonjs/utils/useResizeObserverRef.js +33 -0
- package/lib-commonjs/utils/useResizeObserverRef.js.map +1 -0
- package/lib-commonjs/utils/useTagPickerFilter.js +46 -0
- package/lib-commonjs/utils/useTagPickerFilter.js.map +1 -0
- package/package.json +75 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
|
|
3
|
+
import type { ActiveDescendantContextValue } from '@fluentui/react-aria';
|
|
4
|
+
import { ComboboxBaseState } from '@fluentui/react-combobox';
|
|
5
|
+
import { ComboboxProps } from '@fluentui/react-combobox';
|
|
6
|
+
import { ComboboxSlots } from '@fluentui/react-combobox';
|
|
7
|
+
import type { ComboboxState } from '@fluentui/react-combobox';
|
|
8
|
+
import { ComponentProps } from '@fluentui/react-utilities';
|
|
9
|
+
import { ComponentState } from '@fluentui/react-utilities';
|
|
10
|
+
import { DropdownProps } from '@fluentui/react-combobox';
|
|
11
|
+
import type { EventData } from '@fluentui/react-utilities';
|
|
12
|
+
import type { EventHandler } from '@fluentui/react-utilities';
|
|
13
|
+
import type { ExtractSlotProps } from '@fluentui/react-utilities';
|
|
14
|
+
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
|
15
|
+
import type { Listbox } from '@fluentui/react-combobox';
|
|
16
|
+
import type { ListboxContextValue } from '@fluentui/react-combobox';
|
|
17
|
+
import { OptionGroupProps } from '@fluentui/react-combobox';
|
|
18
|
+
import { OptionGroupSlots } from '@fluentui/react-combobox';
|
|
19
|
+
import { OptionGroupState } from '@fluentui/react-combobox';
|
|
20
|
+
import { OptionSlots } from '@fluentui/react-combobox';
|
|
21
|
+
import { OptionState } from '@fluentui/react-combobox';
|
|
22
|
+
import * as React_2 from 'react';
|
|
23
|
+
import { Slot } from '@fluentui/react-utilities';
|
|
24
|
+
import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
25
|
+
import { TagGroupContextValues } from '@fluentui/react-tags';
|
|
26
|
+
import type { TagGroupSlots } from '@fluentui/react-tags';
|
|
27
|
+
import type { TagGroupState } from '@fluentui/react-tags';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Render the final JSX of Picker
|
|
31
|
+
*/
|
|
32
|
+
export declare const renderTagPicker_unstable: (state: TagPickerState, contexts: TagPickerContextValues) => JSX.Element;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Render the final JSX of PickerButton
|
|
36
|
+
*/
|
|
37
|
+
export declare const renderTagPickerButton_unstable: (state: TagPickerButtonState) => JSX.Element;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Render the final JSX of PickerControl
|
|
41
|
+
*/
|
|
42
|
+
export declare const renderTagPickerControl_unstable: (state: TagPickerControlState) => JSX.Element;
|
|
43
|
+
|
|
44
|
+
export declare function renderTagPickerGroup_unstable(state: TagPickerGroupState, contexts: TagGroupContextValues): JSX.Element | null;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Render the final JSX of TagPickerInput
|
|
48
|
+
*/
|
|
49
|
+
export declare const renderTagPickerInput_unstable: (state: TagPickerInputState) => JSX.Element;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Render the final JSX of TagPickerList
|
|
53
|
+
*/
|
|
54
|
+
export declare const renderTagPickerList_unstable: (state: TagPickerListState) => JSX.Element;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Render the final JSX of TagPickerOption
|
|
58
|
+
*/
|
|
59
|
+
export declare const renderTagPickerOption_unstable: (state: TagPickerOptionState) => JSX.Element;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Render the final JSX of TagPickerOptionGroup
|
|
63
|
+
*/
|
|
64
|
+
export declare const renderTagPickerOptionGroup: (state: TagPickerOptionGroupState) => JSX.Element;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* TagPicker component -
|
|
68
|
+
* A TagPicker is a composite component that allows users to pick tags from a list of options.
|
|
69
|
+
*/
|
|
70
|
+
export declare const TagPicker: React_2.FC<TagPickerProps>;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* TagPickerButton component -
|
|
74
|
+
* A TagPickerButton is an alternative to TagPickerInput that does not include an input field.
|
|
75
|
+
*/
|
|
76
|
+
export declare const TagPickerButton: ForwardRefComponent<TagPickerButtonProps>;
|
|
77
|
+
|
|
78
|
+
export declare const tagPickerButtonClassNames: SlotClassNames<TagPickerButtonSlots>;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* PickerButton Props
|
|
82
|
+
*/
|
|
83
|
+
export declare type TagPickerButtonProps = ComponentProps<TagPickerButtonSlots> & Pick<DropdownProps, 'size' | 'appearance'> & {
|
|
84
|
+
disabled?: boolean;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export declare type TagPickerButtonSlots = {
|
|
88
|
+
root: Slot<'button'>;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* State used in rendering PickerButton
|
|
93
|
+
*/
|
|
94
|
+
export declare type TagPickerButtonState = ComponentState<TagPickerButtonSlots> & Pick<TagPickerContextValue, 'size'> & {
|
|
95
|
+
hasSelectedOption: boolean;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
declare interface TagPickerContextValue extends Pick<ComboboxBaseState, 'open' | 'clearSelection' | 'getOptionById' | 'selectedOptions' | 'selectOption' | 'setHasFocus' | 'setOpen' | 'setValue' | 'value' | 'appearance' | 'disabled'> {
|
|
99
|
+
triggerRef: React_2.RefObject<HTMLInputElement | HTMLButtonElement>;
|
|
100
|
+
popoverRef: React_2.RefObject<HTMLDivElement>;
|
|
101
|
+
popoverId: string;
|
|
102
|
+
targetRef: React_2.RefObject<HTMLDivElement>;
|
|
103
|
+
secondaryActionRef: React_2.RefObject<HTMLSpanElement>;
|
|
104
|
+
tagPickerGroupRef: React_2.RefObject<HTMLDivElement>;
|
|
105
|
+
size: TagPickerSize;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export declare type TagPickerContextValues = {
|
|
109
|
+
picker: TagPickerContextValue;
|
|
110
|
+
activeDescendant: ActiveDescendantContextValue;
|
|
111
|
+
listbox: ListboxContextValue;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* TagPickerControl component -
|
|
116
|
+
* A TagPickerControl is a composite component that controls actions and state for a TagPicker.
|
|
117
|
+
*/
|
|
118
|
+
export declare const TagPickerControl: ForwardRefComponent<TagPickerControlProps>;
|
|
119
|
+
|
|
120
|
+
export declare const tagPickerControlClassNames: SlotClassNames<TagPickerControlSlots & TagPickerControlInternalSlots>;
|
|
121
|
+
|
|
122
|
+
declare type TagPickerControlCSSProperties = React_2.CSSProperties & {
|
|
123
|
+
'--fui-TagPickerControl-aside-width'?: string | number;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
declare type TagPickerControlInternalSlots = {
|
|
127
|
+
aside?: NonNullable<Slot<'span'>>;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* PickerControl Props
|
|
132
|
+
*/
|
|
133
|
+
export declare type TagPickerControlProps = ComponentProps<Partial<TagPickerControlSlots>>;
|
|
134
|
+
|
|
135
|
+
export declare type TagPickerControlSlots = {
|
|
136
|
+
root: Slot<ExtractSlotProps<Slot<'div'> & {
|
|
137
|
+
style?: TagPickerControlCSSProperties;
|
|
138
|
+
}>>;
|
|
139
|
+
/**
|
|
140
|
+
* A secondary action should be a button-like element to be rendered right after
|
|
141
|
+
* the trigger responsible for opening/closing the tag picker popover.
|
|
142
|
+
*/
|
|
143
|
+
secondaryAction: Slot<'span'>;
|
|
144
|
+
} & Pick<ComboboxSlots, 'expandIcon'>;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* State used in rendering PickerControl
|
|
148
|
+
*/
|
|
149
|
+
export declare type TagPickerControlState = ComponentState<TagPickerControlSlots & TagPickerControlInternalSlots> & Pick<TagPickerContextValue, 'size' | 'appearance' | 'disabled'> & {
|
|
150
|
+
invalid: boolean;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* TagPickerGroup component -
|
|
155
|
+
* A TagPickerGroup is a composite component that allows users to group tags together.
|
|
156
|
+
*/
|
|
157
|
+
export declare const TagPickerGroup: ForwardRefComponent<TagPickerGroupProps>;
|
|
158
|
+
|
|
159
|
+
export declare const tagPickerGroupClassNames: SlotClassNames<TagPickerGroupSlots>;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* TagPickerGroup Props
|
|
163
|
+
*/
|
|
164
|
+
export declare type TagPickerGroupProps = ComponentProps<TagPickerGroupSlots>;
|
|
165
|
+
|
|
166
|
+
export declare type TagPickerGroupSlots = TagGroupSlots;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* State used in rendering TagPickerGroup
|
|
170
|
+
*/
|
|
171
|
+
export declare type TagPickerGroupState = TagGroupState & {
|
|
172
|
+
hasSelectedOptions: boolean;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* TagPickerInput component -
|
|
177
|
+
* A TagPickerInput is a composite component that allows users to query tags.
|
|
178
|
+
*/
|
|
179
|
+
export declare const TagPickerInput: ForwardRefComponent<TagPickerInputProps>;
|
|
180
|
+
|
|
181
|
+
export declare const tagPickerInputClassNames: SlotClassNames<TagPickerInputSlots>;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* TagPickerInput Props
|
|
185
|
+
*/
|
|
186
|
+
export declare type TagPickerInputProps = Omit<ComponentProps<Partial<TagPickerInputSlots>>, 'children' | 'size' | 'defaultValue'> & Pick<ComboboxProps, 'clearable' | 'appearance'> & {
|
|
187
|
+
disabled?: boolean;
|
|
188
|
+
value?: string;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export declare type TagPickerInputSlots = {
|
|
192
|
+
root: NonNullable<Slot<'input'>>;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* State used in rendering TagPickerInput
|
|
197
|
+
*/
|
|
198
|
+
export declare type TagPickerInputState = ComponentState<TagPickerInputSlots> & Pick<TagPickerContextValue, 'size' | 'disabled'>;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* TagPickerList component -
|
|
202
|
+
* A TagPickerList is a composite component that allows users to display a list of tag options to be selected.
|
|
203
|
+
*/
|
|
204
|
+
export declare const TagPickerList: ForwardRefComponent<TagPickerListProps>;
|
|
205
|
+
|
|
206
|
+
export declare const tagPickerListClassNames: SlotClassNames<TagPickerListSlots>;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* TagPickerList Props
|
|
210
|
+
*/
|
|
211
|
+
export declare type TagPickerListProps = ComponentProps<TagPickerListSlots>;
|
|
212
|
+
|
|
213
|
+
export declare type TagPickerListSlots = {
|
|
214
|
+
root: Slot<typeof Listbox>;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* State used in rendering TagPickerList
|
|
219
|
+
*/
|
|
220
|
+
export declare type TagPickerListState = ComponentState<TagPickerListSlots> & Pick<TagPickerContextValue, 'open'>;
|
|
221
|
+
|
|
222
|
+
export declare type TagPickerOnOpenChangeData = {
|
|
223
|
+
open: boolean;
|
|
224
|
+
} & (EventData<'click', React_2.MouseEvent<HTMLDivElement>> | EventData<'keydown', React_2.KeyboardEvent<HTMLDivElement>>);
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Event data for the `onOptionSelect` event.
|
|
228
|
+
*
|
|
229
|
+
* * value - The value of the selected option that triggered the event
|
|
230
|
+
* * selectedOptions - The list of selected options
|
|
231
|
+
*/
|
|
232
|
+
export declare type TagPickerOnOptionSelectData = {
|
|
233
|
+
value: string;
|
|
234
|
+
selectedOptions: string[];
|
|
235
|
+
} & (EventData<'click', React_2.MouseEvent<HTMLDivElement>> | EventData<'keydown', React_2.KeyboardEvent<HTMLDivElement>>);
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* TagPickerOption component -
|
|
239
|
+
* A TagPickerOption is a composite component that allows users to select tags.
|
|
240
|
+
*/
|
|
241
|
+
export declare const TagPickerOption: ForwardRefComponent<TagPickerOptionProps>;
|
|
242
|
+
|
|
243
|
+
export declare const tagPickerOptionClassNames: SlotClassNames<TagPickerOptionSlots>;
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* TagPickerOptionGroup component -
|
|
247
|
+
* A TagPickerOptionGroup is a composite component that allows users to group TagPickerOptions.
|
|
248
|
+
*/
|
|
249
|
+
export declare const TagPickerOptionGroup: ForwardRefComponent<TagPickerOptionGroupProps>;
|
|
250
|
+
|
|
251
|
+
export declare const tagPickerOptionGroupClassNames: SlotClassNames<TagPickerOptionGroupSlots>;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* TagPickerOptionGroup Props
|
|
255
|
+
*/
|
|
256
|
+
export declare type TagPickerOptionGroupProps = OptionGroupProps;
|
|
257
|
+
|
|
258
|
+
export declare type TagPickerOptionGroupSlots = OptionGroupSlots;
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* State used in rendering TagPickerOptionGroup
|
|
262
|
+
*/
|
|
263
|
+
export declare type TagPickerOptionGroupState = OptionGroupState;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* TagPickerOption Props
|
|
267
|
+
*/
|
|
268
|
+
export declare type TagPickerOptionProps = ComponentProps<TagPickerOptionSlots> & {
|
|
269
|
+
children: React_2.ReactNode;
|
|
270
|
+
value: string;
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
export declare type TagPickerOptionSlots = Pick<OptionSlots, 'root'> & {
|
|
274
|
+
media?: Slot<'div'>;
|
|
275
|
+
secondaryContent?: Slot<'span'>;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* State used in rendering TagPickerOption
|
|
280
|
+
*/
|
|
281
|
+
export declare type TagPickerOptionState = ComponentState<TagPickerOptionSlots> & Pick<OptionState, 'components' | 'root'>;
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Picker Props
|
|
285
|
+
*/
|
|
286
|
+
export declare type TagPickerProps = ComponentProps<TagPickerSlots> & Pick<ComboboxProps, 'positioning' | 'disabled' | 'defaultOpen' | 'selectedOptions' | 'defaultSelectedOptions' | 'open'> & Pick<Partial<TagPickerContextValue>, 'size' | 'appearance'> & {
|
|
287
|
+
onOpenChange?: EventHandler<TagPickerOnOpenChangeData>;
|
|
288
|
+
onOptionSelect?: EventHandler<TagPickerOnOptionSelectData>;
|
|
289
|
+
/**
|
|
290
|
+
* Can contain two children including a trigger and a popover
|
|
291
|
+
*/
|
|
292
|
+
children: [JSX.Element, JSX.Element] | JSX.Element;
|
|
293
|
+
/**
|
|
294
|
+
* TagPickers are rendered out of DOM order on `document.body` by default,
|
|
295
|
+
* use this to render the popover in DOM order
|
|
296
|
+
*
|
|
297
|
+
* @default false
|
|
298
|
+
*/
|
|
299
|
+
inline?: boolean;
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
export declare type TagPickerSize = 'medium' | 'large' | 'extra-large';
|
|
303
|
+
|
|
304
|
+
export declare type TagPickerSlots = {};
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* State used in rendering Picker
|
|
308
|
+
*/
|
|
309
|
+
export declare type TagPickerState = ComponentState<TagPickerSlots> & Pick<ComboboxState, 'open' | 'activeDescendantController' | 'mountNode' | 'onOptionClick' | 'registerOption' | 'selectedOptions' | 'selectOption' | 'value' | 'setValue' | 'setOpen' | 'setHasFocus' | 'appearance' | 'clearSelection' | 'getOptionById' | 'disabled'> & Pick<TagPickerContextValue, 'triggerRef' | 'secondaryActionRef' | 'popoverId' | 'popoverRef' | 'targetRef' | 'tagPickerGroupRef' | 'size'> & {
|
|
310
|
+
trigger: React_2.ReactNode;
|
|
311
|
+
popover?: React_2.ReactNode;
|
|
312
|
+
inline: boolean;
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Create the state required to render Picker.
|
|
317
|
+
*
|
|
318
|
+
* The returned state can be modified with hooks such as usePickerStyles_unstable,
|
|
319
|
+
* before being passed to renderPicker_unstable.
|
|
320
|
+
*
|
|
321
|
+
* @param props - props from this instance of Picker
|
|
322
|
+
*/
|
|
323
|
+
export declare const useTagPicker_unstable: (props: TagPickerProps) => TagPickerState;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Create the state required to render PickerButton.
|
|
327
|
+
*
|
|
328
|
+
* The returned state can be modified with hooks such as usePickerButtonStyles_unstable,
|
|
329
|
+
* before being passed to renderPickerButton_unstable.
|
|
330
|
+
*
|
|
331
|
+
* @param props - props from this instance of PickerButton
|
|
332
|
+
* @param ref - reference to root HTMLDivElement of PickerButton
|
|
333
|
+
*/
|
|
334
|
+
export declare const useTagPickerButton_unstable: (props: TagPickerButtonProps, ref: React_2.Ref<HTMLButtonElement>) => TagPickerButtonState;
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Apply styling to the PickerButton slots based on the state
|
|
338
|
+
*/
|
|
339
|
+
export declare const useTagPickerButtonStyles_unstable: (state: TagPickerButtonState) => TagPickerButtonState;
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Create the state required to render PickerControl.
|
|
343
|
+
*
|
|
344
|
+
* The returned state can be modified with hooks such as usePickerControlStyles_unstable,
|
|
345
|
+
* before being passed to renderPickerControl_unstable.
|
|
346
|
+
*
|
|
347
|
+
* @param props - props from this instance of PickerControl
|
|
348
|
+
* @param ref - reference to root HTMLDivElement of PickerControl
|
|
349
|
+
*/
|
|
350
|
+
export declare const useTagPickerControl_unstable: (props: TagPickerControlProps, ref: React_2.Ref<HTMLDivElement>) => TagPickerControlState;
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Apply styling to the PickerControl slots based on the state
|
|
354
|
+
*/
|
|
355
|
+
export declare const useTagPickerControlStyles_unstable: (state: TagPickerControlState) => TagPickerControlState;
|
|
356
|
+
|
|
357
|
+
export declare function useTagPickerFilter({ filter: filterOverride, noOptionsElement, renderOption, query, options, }: UseTagPickerFilterConfig): JSX.Element[];
|
|
358
|
+
|
|
359
|
+
declare type UseTagPickerFilterConfig = {
|
|
360
|
+
query: string;
|
|
361
|
+
options: string[];
|
|
362
|
+
/**
|
|
363
|
+
* Provides a custom filter for the option.
|
|
364
|
+
* By default the filter will check if the option includes the query.
|
|
365
|
+
*/
|
|
366
|
+
filter?: (option: string, index: number) => boolean;
|
|
367
|
+
/** Provides an element to be displayed when there are no options. */
|
|
368
|
+
noOptionsElement: JSX.Element;
|
|
369
|
+
/** Provides a custom render for the option. */
|
|
370
|
+
renderOption?: (option: string) => JSX.Element;
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Create the state required to render TagPickerGroup.
|
|
375
|
+
*
|
|
376
|
+
* The returned state can be modified with hooks such as usePickerTagGroupStyles_unstable,
|
|
377
|
+
* before being passed to renderPickerTagGroup_unstable.
|
|
378
|
+
*
|
|
379
|
+
* @param props - props from this instance of TagPickerGroup
|
|
380
|
+
* @param ref - reference to root HTMLDivElement of TagPickerGroup
|
|
381
|
+
*/
|
|
382
|
+
export declare const useTagPickerGroup_unstable: (props: TagPickerGroupProps, ref: React_2.Ref<HTMLDivElement>) => TagPickerGroupState;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Apply styling to the TagPickerGroup slots based on the state
|
|
386
|
+
*/
|
|
387
|
+
export declare const useTagPickerGroupStyles_unstable: (state: TagPickerGroupState) => TagPickerGroupState;
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Create the state required to render TagPickerInput.
|
|
391
|
+
*
|
|
392
|
+
* The returned state can be modified with hooks such as useTagPickerInputStyles_unstable,
|
|
393
|
+
* before being passed to renderTagPickerInput_unstable.
|
|
394
|
+
*
|
|
395
|
+
* @param props - props from this instance of TagPickerInput
|
|
396
|
+
* @param ref - reference to root HTMLDivElement of TagPickerInput
|
|
397
|
+
*/
|
|
398
|
+
export declare const useTagPickerInput_unstable: (props: TagPickerInputProps, ref: React_2.Ref<HTMLInputElement>) => TagPickerInputState;
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Apply styling to the TagPickerInput slots based on the state
|
|
402
|
+
*/
|
|
403
|
+
export declare const useTagPickerInputStyles_unstable: (state: TagPickerInputState) => TagPickerInputState;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Create the state required to render TagPickerList.
|
|
407
|
+
*
|
|
408
|
+
* The returned state can be modified with hooks such as useTagPickerListStyles_unstable,
|
|
409
|
+
* before being passed to renderTagPickerList_unstable.
|
|
410
|
+
*
|
|
411
|
+
* @param props - props from this instance of TagPickerList
|
|
412
|
+
* @param ref - reference to root HTMLDivElement of TagPickerList
|
|
413
|
+
*/
|
|
414
|
+
export declare const useTagPickerList_unstable: (props: TagPickerListProps, ref: React_2.Ref<HTMLDivElement>) => TagPickerListState;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Apply styling to the TagPickerList slots based on the state
|
|
418
|
+
*/
|
|
419
|
+
export declare const useTagPickerListStyles_unstable: (state: TagPickerListState) => TagPickerListState;
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Create the state required to render TagPickerOption.
|
|
423
|
+
*
|
|
424
|
+
* The returned state can be modified with hooks such as useTagPickerOptionStyles_unstable,
|
|
425
|
+
* before being passed to renderTagPickerOption_unstable.
|
|
426
|
+
*
|
|
427
|
+
* @param props - props from this instance of TagPickerOption
|
|
428
|
+
* @param ref - reference to root HTMLDivElement of TagPickerOption
|
|
429
|
+
*/
|
|
430
|
+
export declare const useTagPickerOption_unstable: (props: TagPickerOptionProps, ref: React_2.Ref<HTMLDivElement>) => TagPickerOptionState;
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Create the state required to render TagPickerOptionGroup.
|
|
434
|
+
*
|
|
435
|
+
* The returned state can be modified with hooks such as useTagPickerOptionGroupStyles_unstable,
|
|
436
|
+
* before being passed to renderTagPickerOptionGroup_unstable.
|
|
437
|
+
*
|
|
438
|
+
* @param props - props from this instance of TagPickerOptionGroup
|
|
439
|
+
* @param ref - reference to root HTMLDivElement of TagPickerOptionGroup
|
|
440
|
+
*/
|
|
441
|
+
export declare const useTagPickerOptionGroup: (props: TagPickerOptionGroupProps, ref: React_2.Ref<HTMLDivElement>) => TagPickerOptionGroupState;
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Apply styling to the TagPickerOptionGroup slots based on the state
|
|
445
|
+
*/
|
|
446
|
+
export declare const useTagPickerOptionGroupStyles: (state: TagPickerOptionGroupState) => TagPickerOptionGroupState;
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Apply styling to the TagPickerOption slots based on the state
|
|
450
|
+
*/
|
|
451
|
+
export declare const useTagPickerOptionStyles_unstable: (state: TagPickerOptionState) => TagPickerOptionState;
|
|
452
|
+
|
|
453
|
+
export { }
|
package/lib/TagPicker.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/TagPicker/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["TagPicker.ts"],"sourcesContent":["export * from './components/TagPicker/index';\n"],"names":[],"mappings":"AAAA,cAAc,+BAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/TagPickerButton/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["TagPickerButton.ts"],"sourcesContent":["export * from './components/TagPickerButton/index';\n"],"names":[],"mappings":"AAAA,cAAc,qCAAqC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/TagPickerControl/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["TagPickerControl.ts"],"sourcesContent":["export * from './components/TagPickerControl/index';\n"],"names":[],"mappings":"AAAA,cAAc,sCAAsC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/TagPickerGroup/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["TagPickerGroup.ts"],"sourcesContent":["export * from './components/TagPickerGroup/index';\n"],"names":[],"mappings":"AAAA,cAAc,oCAAoC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/TagPickerInput/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["TagPickerInput.ts"],"sourcesContent":["export * from './components/TagPickerInput/index';\n"],"names":[],"mappings":"AAAA,cAAc,oCAAoC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/TagPickerList/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["TagPickerList.ts"],"sourcesContent":["export * from './components/TagPickerList/index';\n"],"names":[],"mappings":"AAAA,cAAc,mCAAmC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/TagPickerOption/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["TagPickerOption.ts"],"sourcesContent":["export * from './components/TagPickerOption/index';\n"],"names":[],"mappings":"AAAA,cAAc,qCAAqC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/TagPickerOptionGroup/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["TagPickerOptionGroup.ts"],"sourcesContent":["export * from './components/TagPickerOptionGroup/index';\n"],"names":[],"mappings":"AAAA,cAAc,0CAA0C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useTagPicker_unstable } from './useTagPicker';
|
|
3
|
+
import { renderTagPicker_unstable } from './renderTagPicker';
|
|
4
|
+
import { useTagPickerContextValues } from './useTagPickerContextValues';
|
|
5
|
+
/**
|
|
6
|
+
* TagPicker component -
|
|
7
|
+
* A TagPicker is a composite component that allows users to pick tags from a list of options.
|
|
8
|
+
*/ export const TagPicker = /*#__PURE__*/ React.memo((props)=>{
|
|
9
|
+
const state = useTagPicker_unstable(props);
|
|
10
|
+
const contextValues = useTagPickerContextValues(state);
|
|
11
|
+
return renderTagPicker_unstable(state, contextValues);
|
|
12
|
+
});
|
|
13
|
+
TagPicker.displayName = 'TagPicker';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["TagPicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useTagPicker_unstable } from './useTagPicker';\nimport { renderTagPicker_unstable } from './renderTagPicker';\nimport type { TagPickerProps } from './TagPicker.types';\nimport { useTagPickerContextValues } from './useTagPickerContextValues';\n\n/**\n * TagPicker component -\n * A TagPicker is a composite component that allows users to pick tags from a list of options.\n */\nexport const TagPicker: React.FC<TagPickerProps> = React.memo(props => {\n const state = useTagPicker_unstable(props);\n const contextValues = useTagPickerContextValues(state);\n return renderTagPicker_unstable(state, contextValues);\n});\n\nTagPicker.displayName = 'TagPicker';\n"],"names":["React","useTagPicker_unstable","renderTagPicker_unstable","useTagPickerContextValues","TagPicker","memo","props","state","contextValues","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,oBAAoB;AAE7D,SAASC,yBAAyB,QAAQ,8BAA8B;AAExE;;;CAGC,GACD,OAAO,MAAMC,0BAAsCJ,MAAMK,IAAI,CAACC,CAAAA;IAC5D,MAAMC,QAAQN,sBAAsBK;IACpC,MAAME,gBAAgBL,0BAA0BI;IAChD,OAAOL,yBAAyBK,OAAOC;AACzC,GAAG;AAEHJ,UAAUK,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["TagPicker.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { ComponentProps, ComponentState, EventData, EventHandler } from '@fluentui/react-utilities';\nimport type { ComboboxProps, ComboboxState, ListboxContextValue } from '@fluentui/react-combobox';\nimport type { TagPickerContextValue } from '../../contexts/TagPickerContext';\nimport type { ActiveDescendantContextValue } from '@fluentui/react-aria';\n\nexport type TagPickerSlots = {};\n\nexport type TagPickerSize = 'medium' | 'large' | 'extra-large';\n\n/**\n * Event data for the `onOptionSelect` event.\n *\n * * value - The value of the selected option that triggered the event\n * * selectedOptions - The list of selected options\n */\nexport type TagPickerOnOptionSelectData = {\n value: string;\n selectedOptions: string[];\n} & (EventData<'click', React.MouseEvent<HTMLDivElement>> | EventData<'keydown', React.KeyboardEvent<HTMLDivElement>>);\n\nexport type TagPickerOnOpenChangeData = { open: boolean } & (\n | EventData<'click', React.MouseEvent<HTMLDivElement>>\n | EventData<'keydown', React.KeyboardEvent<HTMLDivElement>>\n);\n\n/**\n * Picker Props\n */\nexport type TagPickerProps = ComponentProps<TagPickerSlots> &\n Pick<\n ComboboxProps,\n 'positioning' | 'disabled' | 'defaultOpen' | 'selectedOptions' | 'defaultSelectedOptions' | 'open'\n > &\n Pick<Partial<TagPickerContextValue>, 'size' | 'appearance'> & {\n onOpenChange?: EventHandler<TagPickerOnOpenChangeData>;\n onOptionSelect?: EventHandler<TagPickerOnOptionSelectData>;\n\n /**\n * Can contain two children including a trigger and a popover\n */\n children: [JSX.Element, JSX.Element] | JSX.Element;\n /**\n * TagPickers are rendered out of DOM order on `document.body` by default,\n * use this to render the popover in DOM order\n *\n * @default false\n */\n inline?: boolean;\n };\n\n/**\n * State used in rendering Picker\n */\nexport type TagPickerState = ComponentState<TagPickerSlots> &\n Pick<\n ComboboxState,\n | 'open'\n | 'activeDescendantController'\n | 'mountNode'\n | 'onOptionClick'\n | 'registerOption'\n | 'selectedOptions'\n | 'selectOption'\n | 'value'\n | 'setValue'\n | 'setOpen'\n | 'setHasFocus'\n | 'appearance'\n | 'clearSelection'\n | 'getOptionById'\n | 'disabled'\n > &\n Pick<\n TagPickerContextValue,\n 'triggerRef' | 'secondaryActionRef' | 'popoverId' | 'popoverRef' | 'targetRef' | 'tagPickerGroupRef' | 'size'\n > & {\n trigger: React.ReactNode;\n popover?: React.ReactNode;\n inline: boolean;\n };\n\nexport type TagPickerContextValues = {\n picker: TagPickerContextValue;\n activeDescendant: ActiveDescendantContextValue;\n listbox: ListboxContextValue;\n};\n"],"names":[],"mappings":"AAAA,WAsFE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './TagPicker';\nexport * from './TagPicker.types';\nexport * from './renderTagPicker';\nexport * from './useTagPicker';\n"],"names":[],"mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,oBAAoB;AAClC,cAAc,oBAAoB;AAClC,cAAc,iBAAiB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ActiveDescendantContextProvider } from '@fluentui/react-aria';
|
|
3
|
+
import { ListboxProvider } from '@fluentui/react-combobox';
|
|
4
|
+
import { Portal } from '@fluentui/react-portal';
|
|
5
|
+
import { TagPickerContextProvider } from '../../contexts/TagPickerContext';
|
|
6
|
+
import { assertSlots } from '@fluentui/react-utilities';
|
|
7
|
+
/**
|
|
8
|
+
* Render the final JSX of Picker
|
|
9
|
+
*/ export const renderTagPicker_unstable = (state, contexts)=>{
|
|
10
|
+
assertSlots(state);
|
|
11
|
+
return /*#__PURE__*/ React.createElement(TagPickerContextProvider, {
|
|
12
|
+
value: contexts.picker
|
|
13
|
+
}, /*#__PURE__*/ React.createElement(ActiveDescendantContextProvider, {
|
|
14
|
+
value: contexts.activeDescendant
|
|
15
|
+
}, /*#__PURE__*/ React.createElement(ListboxProvider, {
|
|
16
|
+
value: contexts.listbox
|
|
17
|
+
}, state.trigger, state.inline ? state.popover : /*#__PURE__*/ React.createElement(Portal, {
|
|
18
|
+
mountNode: state.mountNode
|
|
19
|
+
}, state.popover))));
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderTagPicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { TagPickerState, TagPickerContextValues, TagPickerSlots } from './TagPicker.types';\nimport { ActiveDescendantContextProvider } from '@fluentui/react-aria';\nimport { ListboxProvider } from '@fluentui/react-combobox';\nimport { Portal } from '@fluentui/react-portal';\nimport { TagPickerContextProvider } from '../../contexts/TagPickerContext';\nimport { assertSlots } from '@fluentui/react-utilities';\n\n/**\n * Render the final JSX of Picker\n */\nexport const renderTagPicker_unstable = (state: TagPickerState, contexts: TagPickerContextValues) => {\n assertSlots<TagPickerSlots>(state);\n return (\n <TagPickerContextProvider value={contexts.picker}>\n <ActiveDescendantContextProvider value={contexts.activeDescendant}>\n <ListboxProvider value={contexts.listbox}>\n {state.trigger}\n {state.inline ? state.popover : <Portal mountNode={state.mountNode}>{state.popover}</Portal>}\n </ListboxProvider>\n </ActiveDescendantContextProvider>\n </TagPickerContextProvider>\n );\n};\n"],"names":["React","ActiveDescendantContextProvider","ListboxProvider","Portal","TagPickerContextProvider","assertSlots","renderTagPicker_unstable","state","contexts","value","picker","activeDescendant","listbox","trigger","inline","popover","mountNode"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,+BAA+B,QAAQ,uBAAuB;AACvE,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,wBAAwB,QAAQ,kCAAkC;AAC3E,SAASC,WAAW,QAAQ,4BAA4B;AAExD;;CAEC,GACD,OAAO,MAAMC,2BAA2B,CAACC,OAAuBC;IAC9DH,YAA4BE;IAC5B,qBACE,oBAACH;QAAyBK,OAAOD,SAASE,MAAM;qBAC9C,oBAACT;QAAgCQ,OAAOD,SAASG,gBAAgB;qBAC/D,oBAACT;QAAgBO,OAAOD,SAASI,OAAO;OACrCL,MAAMM,OAAO,EACbN,MAAMO,MAAM,GAAGP,MAAMQ,OAAO,iBAAG,oBAACZ;QAAOa,WAAWT,MAAMS,SAAS;OAAGT,MAAMQ,OAAO;AAK5F,EAAE"}
|