@fluentui/react-tag-picker 9.7.4 → 9.7.6

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 CHANGED
@@ -1,12 +1,53 @@
1
1
  # Change Log - @fluentui/react-tag-picker
2
2
 
3
- This log was last generated on Thu, 07 Aug 2025 09:59:09 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 08 Sep 2025 12:41:23 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.7.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-tag-picker_v9.7.6)
8
+
9
+ Mon, 08 Sep 2025 12:41:23 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tag-picker_v9.7.5..@fluentui/react-tag-picker_v9.7.6)
11
+
12
+ ### Patches
13
+
14
+ - fix: react 19 type issues ([PR #34864](https://github.com/microsoft/fluentui/pull/34864) by dmytrokirpa@microsoft.com)
15
+ - chore: extend peer dependencies versions to support React 19 ([PR #35145](https://github.com/microsoft/fluentui/pull/35145) by dmytrokirpa@microsoft.com)
16
+ - chore: enforce explicit module boundary types ([PR #35080](https://github.com/microsoft/fluentui/pull/35080) by dmytrokirpa@microsoft.com)
17
+ - Bump @fluentui/react-jsx-runtime to v9.2.0 ([commit](https://github.com/microsoft/fluentui/commit/17af11b3c9f4cac2beeaf4342a81c1f08e95fd29) by beachball)
18
+ - Bump @fluentui/react-shared-contexts to v9.25.1 ([commit](https://github.com/microsoft/fluentui/commit/17af11b3c9f4cac2beeaf4342a81c1f08e95fd29) by beachball)
19
+ - Bump @fluentui/react-utilities to v9.24.1 ([commit](https://github.com/microsoft/fluentui/commit/17af11b3c9f4cac2beeaf4342a81c1f08e95fd29) by beachball)
20
+ - Bump @fluentui/react-portal to v9.8.2 ([commit](https://github.com/microsoft/fluentui/commit/17af11b3c9f4cac2beeaf4342a81c1f08e95fd29) by beachball)
21
+ - Bump @fluentui/react-tabster to v9.26.5 ([commit](https://github.com/microsoft/fluentui/commit/17af11b3c9f4cac2beeaf4342a81c1f08e95fd29) by beachball)
22
+ - Bump @fluentui/react-aria to v9.17.0 ([commit](https://github.com/microsoft/fluentui/commit/17af11b3c9f4cac2beeaf4342a81c1f08e95fd29) by beachball)
23
+ - Bump @fluentui/react-combobox to v9.16.6 ([commit](https://github.com/microsoft/fluentui/commit/17af11b3c9f4cac2beeaf4342a81c1f08e95fd29) by beachball)
24
+ - Bump @fluentui/react-tags to v9.7.6 ([commit](https://github.com/microsoft/fluentui/commit/17af11b3c9f4cac2beeaf4342a81c1f08e95fd29) by beachball)
25
+ - Bump @fluentui/react-context-selector to v9.2.7 ([commit](https://github.com/microsoft/fluentui/commit/17af11b3c9f4cac2beeaf4342a81c1f08e95fd29) by beachball)
26
+ - Bump @fluentui/react-positioning to v9.20.5 ([commit](https://github.com/microsoft/fluentui/commit/17af11b3c9f4cac2beeaf4342a81c1f08e95fd29) by beachball)
27
+ - Bump @fluentui/react-field to v9.4.5 ([commit](https://github.com/microsoft/fluentui/commit/17af11b3c9f4cac2beeaf4342a81c1f08e95fd29) by beachball)
28
+
29
+ ## [9.7.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-tag-picker_v9.7.5)
30
+
31
+ Thu, 21 Aug 2025 12:25:21 GMT
32
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tag-picker_v9.7.4..@fluentui/react-tag-picker_v9.7.5)
33
+
34
+ ### Patches
35
+
36
+ - Bump @fluentui/react-jsx-runtime to v9.1.6 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
37
+ - Bump @fluentui/react-shared-contexts to v9.25.0 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
38
+ - Bump @fluentui/react-utilities to v9.24.0 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
39
+ - Bump @fluentui/react-portal to v9.8.1 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
40
+ - Bump @fluentui/react-tabster to v9.26.4 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
41
+ - Bump @fluentui/react-aria to v9.16.4 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
42
+ - Bump @fluentui/react-combobox to v9.16.5 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
43
+ - Bump @fluentui/react-tags to v9.7.5 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
44
+ - Bump @fluentui/react-context-selector to v9.2.6 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
45
+ - Bump @fluentui/react-positioning to v9.20.4 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
46
+ - Bump @fluentui/react-field to v9.4.4 ([commit](https://github.com/microsoft/fluentui/commit/884c695de4f736774c224fa33b2e410bf42752b0) by beachball)
47
+
7
48
  ## [9.7.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-tag-picker_v9.7.4)
8
49
 
9
- Thu, 07 Aug 2025 09:59:09 GMT
50
+ Thu, 07 Aug 2025 10:03:28 GMT
10
51
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tag-picker_v9.7.3..@fluentui/react-tag-picker_v9.7.4)
11
52
 
12
53
  ### Patches
package/dist/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- /// <reference types="react" />
2
-
3
1
  import type { ActiveDescendantContextValue } from '@fluentui/react-aria';
4
2
  import { ComboboxBaseState } from '@fluentui/react-combobox';
5
3
  import { ComboboxProps } from '@fluentui/react-combobox';
@@ -36,29 +34,29 @@ export declare const renderTagPicker_unstable: (state: TagPickerState, contexts:
36
34
  /**
37
35
  * Render the final JSX of PickerButton
38
36
  */
39
- export declare const renderTagPickerButton_unstable: (state: TagPickerButtonState) => JSX.Element;
37
+ export declare const renderTagPickerButton_unstable: (state: TagPickerButtonState) => JSXElement;
40
38
 
41
39
  /**
42
40
  * Render the final JSX of PickerControl
43
41
  */
44
- export declare const renderTagPickerControl_unstable: (state: TagPickerControlState) => JSX.Element;
42
+ export declare const renderTagPickerControl_unstable: (state: TagPickerControlState) => JSXElement;
45
43
 
46
- export declare function renderTagPickerGroup_unstable(state: TagPickerGroupState, contexts: TagGroupContextValues): JSX.Element | null;
44
+ export declare function renderTagPickerGroup_unstable(state: TagPickerGroupState, contexts: TagGroupContextValues): JSXElement | null;
47
45
 
48
46
  /**
49
47
  * Render the final JSX of TagPickerInput
50
48
  */
51
- export declare const renderTagPickerInput_unstable: (state: TagPickerInputState) => JSX.Element;
49
+ export declare const renderTagPickerInput_unstable: (state: TagPickerInputState) => JSXElement;
52
50
 
53
51
  /**
54
52
  * Render the final JSX of TagPickerList
55
53
  */
56
- export declare const renderTagPickerList_unstable: (state: TagPickerListState) => JSX.Element;
54
+ export declare const renderTagPickerList_unstable: (state: TagPickerListState) => JSXElement;
57
55
 
58
56
  /**
59
57
  * Render the final JSX of TagPickerOption
60
58
  */
61
- export declare const renderTagPickerOption_unstable: (state: TagPickerOptionState) => JSX.Element;
59
+ export declare const renderTagPickerOption_unstable: (state: TagPickerOptionState) => JSXElement;
62
60
 
63
61
  /**
64
62
  * Render the final JSX of TagPickerOptionGroup
@@ -98,12 +96,12 @@ export declare type TagPickerButtonState = ComponentState<TagPickerButtonSlots>
98
96
  };
99
97
 
100
98
  export declare interface TagPickerContextValue extends Pick<ComboboxBaseState, 'open' | 'clearSelection' | 'getOptionById' | 'selectedOptions' | 'selectOption' | 'setHasFocus' | 'setOpen' | 'setValue' | 'value' | 'appearance' | 'disabled'> {
101
- triggerRef: React_2.RefObject<HTMLInputElement | HTMLButtonElement>;
102
- popoverRef: React_2.RefObject<HTMLDivElement>;
99
+ triggerRef: React_2.RefObject<HTMLInputElement | HTMLButtonElement | null>;
100
+ popoverRef: React_2.RefObject<HTMLDivElement | null>;
103
101
  popoverId: string;
104
- targetRef: React_2.RefObject<HTMLDivElement>;
105
- secondaryActionRef: React_2.RefObject<HTMLSpanElement>;
106
- tagPickerGroupRef: React_2.RefObject<HTMLDivElement>;
102
+ targetRef: React_2.RefObject<HTMLDivElement | null>;
103
+ secondaryActionRef: React_2.RefObject<HTMLSpanElement | null>;
104
+ tagPickerGroupRef: React_2.RefObject<HTMLDivElement | null>;
107
105
  size: TagPickerSize;
108
106
  noPopover?: boolean;
109
107
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/TagPickerButton/renderTagPickerButton.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { TagPickerButtonState, TagPickerButtonSlots } from './TagPickerButton.types';\n\n/**\n * Render the final JSX of PickerButton\n */\nexport const renderTagPickerButton_unstable = (state: TagPickerButtonState) => {\n assertSlots<TagPickerButtonSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderTagPickerButton_unstable","state","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,iCAAiC,CAACC;IAC7CF,YAAkCE;IAElC,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
1
+ {"version":3,"sources":["../src/components/TagPickerButton/renderTagPickerButton.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { TagPickerButtonState, TagPickerButtonSlots } from './TagPickerButton.types';\n\n/**\n * Render the final JSX of PickerButton\n */\nexport const renderTagPickerButton_unstable = (state: TagPickerButtonState): JSXElement => {\n assertSlots<TagPickerButtonSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderTagPickerButton_unstable","state","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,iCAAiC,CAACC;IAC7CF,YAAkCE;IAElC,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/TagPickerControl/renderTagPickerControl.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type {\n TagPickerControlState,\n TagPickerControlSlots,\n TagPickerControlInternalSlots,\n} from './TagPickerControl.types';\n\n/**\n * Render the final JSX of PickerControl\n */\nexport const renderTagPickerControl_unstable = (state: TagPickerControlState) => {\n assertSlots<TagPickerControlSlots & TagPickerControlInternalSlots>(state);\n\n return (\n <state.root>\n {state.root.children}\n {state.aside && (\n <state.aside>\n {state.secondaryAction && <state.secondaryAction />}\n {state.expandIcon && <state.expandIcon />}\n </state.aside>\n )}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderTagPickerControl_unstable","state","root","children","aside","secondaryAction","expandIcon"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAOxD;;CAEC,GACD,OAAO,MAAMC,kCAAkC,CAACC;IAC9CF,YAAmEE;IAEnE,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAMC,IAAI,CAACC,QAAQ;YACnBF,MAAMG,KAAK,kBACV,MAACH,MAAMG,KAAK;;oBACTH,MAAMI,eAAe,kBAAI,KAACJ,MAAMI,eAAe;oBAC/CJ,MAAMK,UAAU,kBAAI,KAACL,MAAMK,UAAU;;;;;AAKhD,EAAE"}
1
+ {"version":3,"sources":["../src/components/TagPickerControl/renderTagPickerControl.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type {\n TagPickerControlState,\n TagPickerControlSlots,\n TagPickerControlInternalSlots,\n} from './TagPickerControl.types';\n\n/**\n * Render the final JSX of PickerControl\n */\nexport const renderTagPickerControl_unstable = (state: TagPickerControlState): JSXElement => {\n assertSlots<TagPickerControlSlots & TagPickerControlInternalSlots>(state);\n\n return (\n <state.root>\n {state.root.children}\n {state.aside && (\n <state.aside>\n {state.secondaryAction && <state.secondaryAction />}\n {state.expandIcon && <state.expandIcon />}\n </state.aside>\n )}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderTagPickerControl_unstable","state","root","children","aside","secondaryAction","expandIcon"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAQxD;;CAEC,GACD,OAAO,MAAMC,kCAAkC,CAACC;IAC9CF,YAAmEE;IAEnE,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAMC,IAAI,CAACC,QAAQ;YACnBF,MAAMG,KAAK,kBACV,MAACH,MAAMG,KAAK;;oBACTH,MAAMI,eAAe,kBAAI,KAACJ,MAAMI,eAAe;oBAC/CJ,MAAMK,UAAU,kBAAI,KAACL,MAAMK,UAAU;;;;;AAKhD,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/TagPickerGroup/renderTagPickerGroup.ts"],"sourcesContent":["import { TagPickerGroupState } from './TagPickerGroup.types';\nimport { renderTagGroup_unstable, type TagGroupContextValues } from '@fluentui/react-tags';\n\nexport function renderTagPickerGroup_unstable(state: TagPickerGroupState, contexts: TagGroupContextValues) {\n if (!state.hasSelectedOptions) {\n return null;\n }\n\n return renderTagGroup_unstable(state, contexts);\n}\n"],"names":["renderTagGroup_unstable","renderTagPickerGroup_unstable","state","contexts","hasSelectedOptions"],"mappings":"AACA,SAASA,uBAAuB,QAAoC,uBAAuB;AAE3F,OAAO,SAASC,8BAA8BC,KAA0B,EAAEC,QAA+B;IACvG,IAAI,CAACD,MAAME,kBAAkB,EAAE;QAC7B,OAAO;IACT;IAEA,OAAOJ,wBAAwBE,OAAOC;AACxC"}
1
+ {"version":3,"sources":["../src/components/TagPickerGroup/renderTagPickerGroup.ts"],"sourcesContent":["import type { JSXElement } from '@fluentui/react-utilities';\nimport { TagPickerGroupState } from './TagPickerGroup.types';\nimport { renderTagGroup_unstable, type TagGroupContextValues } from '@fluentui/react-tags';\n\nexport function renderTagPickerGroup_unstable(\n state: TagPickerGroupState,\n contexts: TagGroupContextValues,\n): JSXElement | null {\n if (!state.hasSelectedOptions) {\n return null;\n }\n\n return renderTagGroup_unstable(state, contexts);\n}\n"],"names":["renderTagGroup_unstable","renderTagPickerGroup_unstable","state","contexts","hasSelectedOptions"],"mappings":"AAEA,SAASA,uBAAuB,QAAoC,uBAAuB;AAE3F,OAAO,SAASC,8BACdC,KAA0B,EAC1BC,QAA+B;IAE/B,IAAI,CAACD,MAAME,kBAAkB,EAAE;QAC7B,OAAO;IACT;IAEA,OAAOJ,wBAAwBE,OAAOC;AACxC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/TagPickerInput/renderTagPickerInput.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { TagPickerInputState, TagPickerInputSlots } from './TagPickerInput.types';\n\n/**\n * Render the final JSX of TagPickerInput\n */\nexport const renderTagPickerInput_unstable = (state: TagPickerInputState) => {\n assertSlots<TagPickerInputSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderTagPickerInput_unstable","state","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAACC;IAC5CF,YAAiCE;IAEjC,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
1
+ {"version":3,"sources":["../src/components/TagPickerInput/renderTagPickerInput.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { TagPickerInputState, TagPickerInputSlots } from './TagPickerInput.types';\n\n/**\n * Render the final JSX of TagPickerInput\n */\nexport const renderTagPickerInput_unstable = (state: TagPickerInputState): JSXElement => {\n assertSlots<TagPickerInputSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderTagPickerInput_unstable","state","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAACC;IAC5CF,YAAiCE;IAEjC,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/TagPickerList/renderTagPickerList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { TagPickerListState, TagPickerListSlots } from './TagPickerList.types';\n\n/**\n * Render the final JSX of TagPickerList\n */\nexport const renderTagPickerList_unstable = (state: TagPickerListState) => {\n assertSlots<TagPickerListSlots>(state);\n return <state.root />;\n};\n"],"names":["assertSlots","renderTagPickerList_unstable","state","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,+BAA+B,CAACC;IAC3CF,YAAgCE;IAChC,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
1
+ {"version":3,"sources":["../src/components/TagPickerList/renderTagPickerList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { TagPickerListState, TagPickerListSlots } from './TagPickerList.types';\n\n/**\n * Render the final JSX of TagPickerList\n */\nexport const renderTagPickerList_unstable = (state: TagPickerListState): JSXElement => {\n assertSlots<TagPickerListSlots>(state);\n return <state.root />;\n};\n"],"names":["assertSlots","renderTagPickerList_unstable","state","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,+BAA+B,CAACC;IAC3CF,YAAgCE;IAChC,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/TagPickerOption/renderTagPickerOption.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { TagPickerOptionState, TagPickerOptionSlots } from './TagPickerOption.types';\n\n/**\n * Render the final JSX of TagPickerOption\n */\nexport const renderTagPickerOption_unstable = (state: TagPickerOptionState) => {\n assertSlots<TagPickerOptionSlots>(state);\n\n return (\n <state.root>\n {state.media && <state.media />}\n {state.root.children}\n {state.secondaryContent && <state.secondaryContent />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderTagPickerOption_unstable","state","root","media","children","secondaryContent"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,iCAAiC,CAACC;IAC7CF,YAAkCE;IAElC,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,KAAK,kBAAI,KAACF,MAAME,KAAK;YAC3BF,MAAMC,IAAI,CAACE,QAAQ;YACnBH,MAAMI,gBAAgB,kBAAI,KAACJ,MAAMI,gBAAgB;;;AAGxD,EAAE"}
1
+ {"version":3,"sources":["../src/components/TagPickerOption/renderTagPickerOption.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { TagPickerOptionState, TagPickerOptionSlots } from './TagPickerOption.types';\n\n/**\n * Render the final JSX of TagPickerOption\n */\nexport const renderTagPickerOption_unstable = (state: TagPickerOptionState): JSXElement => {\n assertSlots<TagPickerOptionSlots>(state);\n\n return (\n <state.root>\n {state.media && <state.media />}\n {state.root.children}\n {state.secondaryContent && <state.secondaryContent />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderTagPickerOption_unstable","state","root","media","children","secondaryContent"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,iCAAiC,CAACC;IAC7CF,YAAkCE;IAElC,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,KAAK,kBAAI,KAACF,MAAME,KAAK;YAC3BF,MAAMC,IAAI,CAACE,QAAQ;YACnBH,MAAMI,gBAAgB,kBAAI,KAACJ,MAAMI,gBAAgB;;;AAGxD,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/contexts/TagPickerContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { ContextSelector, createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { TagPickerSize } from '../components/TagPicker/TagPicker.types';\nimport { ComboboxBaseState } from '@fluentui/react-combobox';\n\nexport interface TagPickerContextValue\n extends Pick<\n ComboboxBaseState,\n | 'open'\n | 'clearSelection'\n | 'getOptionById'\n | 'selectedOptions'\n | 'selectOption'\n | 'setHasFocus'\n | 'setOpen'\n | 'setValue'\n | 'value'\n | 'appearance'\n | 'disabled'\n > {\n triggerRef: React.RefObject<HTMLInputElement | HTMLButtonElement>;\n popoverRef: React.RefObject<HTMLDivElement>;\n popoverId: string;\n targetRef: React.RefObject<HTMLDivElement>;\n secondaryActionRef: React.RefObject<HTMLSpanElement>;\n tagPickerGroupRef: React.RefObject<HTMLDivElement>;\n size: TagPickerSize;\n noPopover?: boolean;\n}\n\n/**\n * @internal\n */\nexport const tagPickerContextDefaultValue: TagPickerContextValue = {\n triggerRef: React.createRef<HTMLInputElement>(),\n popoverRef: React.createRef<HTMLDivElement>(),\n targetRef: React.createRef<HTMLDivElement>(),\n tagPickerGroupRef: React.createRef<HTMLDivElement>(),\n secondaryActionRef: React.createRef<HTMLDivElement>(),\n open: false,\n clearSelection: () => null,\n getOptionById: () => undefined,\n selectedOptions: [],\n selectOption: () => null,\n setHasFocus: () => null,\n setOpen: () => null,\n setValue: () => null,\n value: undefined,\n popoverId: '',\n size: 'medium',\n appearance: 'outline',\n disabled: false,\n};\n\nconst TagPickerContext = createContext<TagPickerContextValue | undefined>(undefined);\n\nexport const TagPickerContextProvider = TagPickerContext.Provider;\nexport const useTagPickerContext_unstable = <T>(selector: ContextSelector<TagPickerContextValue, T>) =>\n useContextSelector(TagPickerContext, (ctx = tagPickerContextDefaultValue) => selector(ctx));\n"],"names":["React","createContext","useContextSelector","tagPickerContextDefaultValue","triggerRef","createRef","popoverRef","targetRef","tagPickerGroupRef","secondaryActionRef","open","clearSelection","getOptionById","undefined","selectedOptions","selectOption","setHasFocus","setOpen","setValue","value","popoverId","size","appearance","disabled","TagPickerContext","TagPickerContextProvider","Provider","useTagPickerContext_unstable","selector","ctx"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAA0BC,aAAa,EAAEC,kBAAkB,QAAQ,mCAAmC;AA6BtG;;CAEC,GACD,OAAO,MAAMC,+BAAsD;IACjEC,YAAYJ,MAAMK,SAAS;IAC3BC,YAAYN,MAAMK,SAAS;IAC3BE,WAAWP,MAAMK,SAAS;IAC1BG,mBAAmBR,MAAMK,SAAS;IAClCI,oBAAoBT,MAAMK,SAAS;IACnCK,MAAM;IACNC,gBAAgB,IAAM;IACtBC,eAAe,IAAMC;IACrBC,iBAAiB,EAAE;IACnBC,cAAc,IAAM;IACpBC,aAAa,IAAM;IACnBC,SAAS,IAAM;IACfC,UAAU,IAAM;IAChBC,OAAON;IACPO,WAAW;IACXC,MAAM;IACNC,YAAY;IACZC,UAAU;AACZ,EAAE;AAEF,MAAMC,mBAAmBvB,cAAiDY;AAE1E,OAAO,MAAMY,2BAA2BD,iBAAiBE,QAAQ,CAAC;AAClE,OAAO,MAAMC,+BAA+B,CAAIC,WAC9C1B,mBAAmBsB,kBAAkB,CAACK,MAAM1B,4BAA4B,GAAKyB,SAASC,MAAM"}
1
+ {"version":3,"sources":["../src/contexts/TagPickerContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { ContextSelector, createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { TagPickerSize } from '../components/TagPicker/TagPicker.types';\nimport { ComboboxBaseState } from '@fluentui/react-combobox';\n\nexport interface TagPickerContextValue\n extends Pick<\n ComboboxBaseState,\n | 'open'\n | 'clearSelection'\n | 'getOptionById'\n | 'selectedOptions'\n | 'selectOption'\n | 'setHasFocus'\n | 'setOpen'\n | 'setValue'\n | 'value'\n | 'appearance'\n | 'disabled'\n > {\n triggerRef: React.RefObject<HTMLInputElement | HTMLButtonElement | null>;\n popoverRef: React.RefObject<HTMLDivElement | null>;\n popoverId: string;\n targetRef: React.RefObject<HTMLDivElement | null>;\n secondaryActionRef: React.RefObject<HTMLSpanElement | null>;\n tagPickerGroupRef: React.RefObject<HTMLDivElement | null>;\n size: TagPickerSize;\n noPopover?: boolean;\n}\n\n/**\n * @internal\n */\nexport const tagPickerContextDefaultValue: TagPickerContextValue = {\n triggerRef: React.createRef<HTMLInputElement>(),\n popoverRef: React.createRef<HTMLDivElement>(),\n targetRef: React.createRef<HTMLDivElement>(),\n tagPickerGroupRef: React.createRef<HTMLDivElement>(),\n secondaryActionRef: React.createRef<HTMLDivElement>(),\n open: false,\n clearSelection: () => null,\n getOptionById: () => undefined,\n selectedOptions: [],\n selectOption: () => null,\n setHasFocus: () => null,\n setOpen: () => null,\n setValue: () => null,\n value: undefined,\n popoverId: '',\n size: 'medium',\n appearance: 'outline',\n disabled: false,\n};\n\nconst TagPickerContext = createContext<TagPickerContextValue | undefined>(undefined);\n\nexport const TagPickerContextProvider = TagPickerContext.Provider;\nexport const useTagPickerContext_unstable = <T>(selector: ContextSelector<TagPickerContextValue, T>): T =>\n useContextSelector(TagPickerContext, (ctx = tagPickerContextDefaultValue) => selector(ctx));\n"],"names":["React","createContext","useContextSelector","tagPickerContextDefaultValue","triggerRef","createRef","popoverRef","targetRef","tagPickerGroupRef","secondaryActionRef","open","clearSelection","getOptionById","undefined","selectedOptions","selectOption","setHasFocus","setOpen","setValue","value","popoverId","size","appearance","disabled","TagPickerContext","TagPickerContextProvider","Provider","useTagPickerContext_unstable","selector","ctx"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAA0BC,aAAa,EAAEC,kBAAkB,QAAQ,mCAAmC;AA6BtG;;CAEC,GACD,OAAO,MAAMC,+BAAsD;IACjEC,YAAYJ,MAAMK,SAAS;IAC3BC,YAAYN,MAAMK,SAAS;IAC3BE,WAAWP,MAAMK,SAAS;IAC1BG,mBAAmBR,MAAMK,SAAS;IAClCI,oBAAoBT,MAAMK,SAAS;IACnCK,MAAM;IACNC,gBAAgB,IAAM;IACtBC,eAAe,IAAMC;IACrBC,iBAAiB,EAAE;IACnBC,cAAc,IAAM;IACpBC,aAAa,IAAM;IACnBC,SAAS,IAAM;IACfC,UAAU,IAAM;IAChBC,OAAON;IACPO,WAAW;IACXC,MAAM;IACNC,YAAY;IACZC,UAAU;AACZ,EAAE;AAEF,MAAMC,mBAAmBvB,cAAiDY;AAE1E,OAAO,MAAMY,2BAA2BD,iBAAiBE,QAAQ,CAAC;AAClE,OAAO,MAAMC,+BAA+B,CAAIC,WAC9C1B,mBAAmBsB,kBAAkB,CAACK,MAAM1B,4BAA4B,GAAKyB,SAASC,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/useExpandLabel.ts"],"sourcesContent":["import * as React from 'react';\nimport { useTagPickerContext_unstable } from '../contexts/TagPickerContext';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { TagPickerControlState } from '../TagPickerControl';\n\nexport function useExpandLabel(options: { tagPickerId: string; state: Pick<TagPickerControlState, 'expandIcon'> }) {\n const { tagPickerId, state } = options;\n const { targetDocument } = useFluent();\n const triggerRef = useTagPickerContext_unstable(ctx => ctx.triggerRef);\n const expandIconRef = React.useRef<HTMLSpanElement>(null);\n\n const hasExpandIcon = !!state.expandIcon;\n const {\n 'aria-label': expandIconAriaLabel,\n 'aria-labelledby': expandIconAriaLabelledby,\n id: expandIconId,\n } = state.expandIcon || {};\n\n // If aria-label or aria-labelledby changes, recalculate aria-label and aria-labelledby for the expandIcon\n // The expandIcon's label is calculated based on the input's label\n // TODO: investigate ways to enforce client to provide a label rather than need to calculate it\n const getExpandLabel = React.useCallback(\n (ariaLabel?: string | null, ariaLabelledBy?: string | null) => {\n let expandAriaLabel = undefined;\n let expandAriaLabelledBy = undefined;\n let expandId = undefined;\n\n if (hasExpandIcon) {\n const hasExpandLabel = expandIconAriaLabel || expandIconAriaLabelledby;\n // If there is no explicit aria-label, calculate default accName attribute for expandIcon button,\n // using the following steps:\n // 1. If there is an aria-label, it is \"Open [aria-label]\"\n // 2. If there is an aria-labelledby, it is \"Open [aria-labelledby target]\" (using aria-labelledby + ids)\n // 3. If there is no aria-label/ledby attr, it falls back to \"Open\"\n // We can't fall back to a label/htmlFor name because of https://github.com/w3c/accname/issues/179\n const defaultOpenString = 'Open'; // this is english-only since it is the fallback\n if (!hasExpandLabel) {\n if (ariaLabelledBy) {\n expandAriaLabel = defaultOpenString;\n expandId = expandIconId ?? `${tagPickerId}-chevron`;\n expandAriaLabelledBy = `${expandId} ${ariaLabelledBy}`;\n } else if (ariaLabel) {\n expandAriaLabel = `${defaultOpenString} ${ariaLabel}`;\n } else {\n expandAriaLabel = defaultOpenString;\n }\n }\n }\n\n return { expandAriaLabel, expandAriaLabelledBy, expandId };\n },\n [expandIconAriaLabel, expandIconAriaLabelledby, expandIconId, hasExpandIcon, tagPickerId],\n );\n\n const setExpandLabel = React.useCallback(() => {\n const inputAriaLabel = triggerRef.current?.getAttribute('aria-label');\n const inputAriaLabelledBy = triggerRef.current?.getAttribute('aria-labelledby');\n\n const { expandAriaLabel, expandAriaLabelledBy, expandId } = getExpandLabel(inputAriaLabel, inputAriaLabelledBy);\n\n if (expandAriaLabelledBy) {\n expandIconRef.current?.setAttribute('aria-labelledby', expandAriaLabelledBy);\n }\n if (expandAriaLabel) {\n expandIconRef.current?.setAttribute('aria-label', expandAriaLabel);\n }\n if (expandId) {\n expandIconRef.current?.setAttribute('id', expandId);\n }\n }, [getExpandLabel, triggerRef]);\n\n React.useEffect(() => {\n const hasExpandLabel = expandIconAriaLabel || expandIconAriaLabelledby;\n if (!targetDocument?.defaultView || !triggerRef.current || !hasExpandIcon || hasExpandLabel) {\n return;\n }\n\n const win = targetDocument.defaultView;\n\n // On first render, calculate the default aria-label and aria-labelledby for the expandIcon\n setExpandLabel();\n\n const observer = new win.MutationObserver(setExpandLabel);\n observer.observe(triggerRef.current, {\n attributes: true,\n attributeFilter: ['aria-label', 'aria-labelledby'],\n });\n\n return () => observer.disconnect();\n }, [\n getExpandLabel,\n setExpandLabel,\n expandIconAriaLabel,\n expandIconAriaLabelledby,\n hasExpandIcon,\n tagPickerId,\n triggerRef,\n targetDocument,\n ]);\n\n return expandIconRef;\n}\n"],"names":["React","useTagPickerContext_unstable","useFluent_unstable","useFluent","useExpandLabel","options","tagPickerId","state","targetDocument","triggerRef","ctx","expandIconRef","useRef","hasExpandIcon","expandIcon","expandIconAriaLabel","expandIconAriaLabelledby","id","expandIconId","getExpandLabel","useCallback","ariaLabel","ariaLabelledBy","expandAriaLabel","undefined","expandAriaLabelledBy","expandId","hasExpandLabel","defaultOpenString","setExpandLabel","inputAriaLabel","current","getAttribute","inputAriaLabelledBy","setAttribute","useEffect","defaultView","win","observer","MutationObserver","observe","attributes","attributeFilter","disconnect"],"mappings":"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"}
1
+ {"version":3,"sources":["../src/utils/useExpandLabel.ts"],"sourcesContent":["import * as React from 'react';\nimport { useTagPickerContext_unstable } from '../contexts/TagPickerContext';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { TagPickerControlState } from '../TagPickerControl';\n\nexport function useExpandLabel(options: {\n tagPickerId: string;\n state: Pick<TagPickerControlState, 'expandIcon'>;\n}): React.RefObject<HTMLSpanElement | null> {\n const { tagPickerId, state } = options;\n const { targetDocument } = useFluent();\n const triggerRef = useTagPickerContext_unstable(ctx => ctx.triggerRef);\n const expandIconRef = React.useRef<HTMLSpanElement | null>(null);\n\n const hasExpandIcon = !!state.expandIcon;\n const {\n 'aria-label': expandIconAriaLabel,\n 'aria-labelledby': expandIconAriaLabelledby,\n id: expandIconId,\n } = state.expandIcon || {};\n\n // If aria-label or aria-labelledby changes, recalculate aria-label and aria-labelledby for the expandIcon\n // The expandIcon's label is calculated based on the input's label\n // TODO: investigate ways to enforce client to provide a label rather than need to calculate it\n const getExpandLabel = React.useCallback(\n (ariaLabel?: string | null, ariaLabelledBy?: string | null) => {\n let expandAriaLabel = undefined;\n let expandAriaLabelledBy = undefined;\n let expandId = undefined;\n\n if (hasExpandIcon) {\n const hasExpandLabel = expandIconAriaLabel || expandIconAriaLabelledby;\n // If there is no explicit aria-label, calculate default accName attribute for expandIcon button,\n // using the following steps:\n // 1. If there is an aria-label, it is \"Open [aria-label]\"\n // 2. If there is an aria-labelledby, it is \"Open [aria-labelledby target]\" (using aria-labelledby + ids)\n // 3. If there is no aria-label/ledby attr, it falls back to \"Open\"\n // We can't fall back to a label/htmlFor name because of https://github.com/w3c/accname/issues/179\n const defaultOpenString = 'Open'; // this is english-only since it is the fallback\n if (!hasExpandLabel) {\n if (ariaLabelledBy) {\n expandAriaLabel = defaultOpenString;\n expandId = expandIconId ?? `${tagPickerId}-chevron`;\n expandAriaLabelledBy = `${expandId} ${ariaLabelledBy}`;\n } else if (ariaLabel) {\n expandAriaLabel = `${defaultOpenString} ${ariaLabel}`;\n } else {\n expandAriaLabel = defaultOpenString;\n }\n }\n }\n\n return { expandAriaLabel, expandAriaLabelledBy, expandId };\n },\n [expandIconAriaLabel, expandIconAriaLabelledby, expandIconId, hasExpandIcon, tagPickerId],\n );\n\n const setExpandLabel = React.useCallback(() => {\n const inputAriaLabel = triggerRef.current?.getAttribute('aria-label');\n const inputAriaLabelledBy = triggerRef.current?.getAttribute('aria-labelledby');\n\n const { expandAriaLabel, expandAriaLabelledBy, expandId } = getExpandLabel(inputAriaLabel, inputAriaLabelledBy);\n\n if (expandAriaLabelledBy) {\n expandIconRef.current?.setAttribute('aria-labelledby', expandAriaLabelledBy);\n }\n if (expandAriaLabel) {\n expandIconRef.current?.setAttribute('aria-label', expandAriaLabel);\n }\n if (expandId) {\n expandIconRef.current?.setAttribute('id', expandId);\n }\n }, [getExpandLabel, triggerRef]);\n\n React.useEffect(() => {\n const hasExpandLabel = expandIconAriaLabel || expandIconAriaLabelledby;\n if (!targetDocument?.defaultView || !triggerRef.current || !hasExpandIcon || hasExpandLabel) {\n return;\n }\n\n const win = targetDocument.defaultView;\n\n // On first render, calculate the default aria-label and aria-labelledby for the expandIcon\n setExpandLabel();\n\n const observer = new win.MutationObserver(setExpandLabel);\n observer.observe(triggerRef.current, {\n attributes: true,\n attributeFilter: ['aria-label', 'aria-labelledby'],\n });\n\n return () => observer.disconnect();\n }, [\n getExpandLabel,\n setExpandLabel,\n expandIconAriaLabel,\n expandIconAriaLabelledby,\n hasExpandIcon,\n tagPickerId,\n triggerRef,\n targetDocument,\n ]);\n\n return expandIconRef;\n}\n"],"names":["React","useTagPickerContext_unstable","useFluent_unstable","useFluent","useExpandLabel","options","tagPickerId","state","targetDocument","triggerRef","ctx","expandIconRef","useRef","hasExpandIcon","expandIcon","expandIconAriaLabel","expandIconAriaLabelledby","id","expandIconId","getExpandLabel","useCallback","ariaLabel","ariaLabelledBy","expandAriaLabel","undefined","expandAriaLabelledBy","expandId","hasExpandLabel","defaultOpenString","setExpandLabel","inputAriaLabel","current","getAttribute","inputAriaLabelledBy","setAttribute","useEffect","defaultView","win","observer","MutationObserver","observe","attributes","attributeFilter","disconnect"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/useTagPickerFilter.tsx"],"sourcesContent":["import * as React from 'react';\nimport { TagPickerOption } from '../TagPickerOption';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\ntype UseTagPickerFilterConfig = {\n query: string;\n options: string[];\n /**\n * Provides a custom filter for the option.\n * By default the filter will check if the option includes the query.\n */\n filter?: (option: string, index: number) => boolean;\n\n /** Provides an element to be displayed when there are no options. */\n noOptionsElement: JSXElement;\n\n /** Provides a custom render for the option. */\n renderOption?: (option: string) => JSXElement;\n};\n\nfunction defaultRenderOption(option: string) {\n return (\n <TagPickerOption value={option} key={option}>\n {option}\n </TagPickerOption>\n );\n}\n\nexport function useTagPickerFilter({\n filter: filterOverride,\n noOptionsElement,\n renderOption = defaultRenderOption,\n query,\n options,\n}: UseTagPickerFilterConfig) {\n const defaultFilter = React.useCallback(\n (option: string) => {\n const trimmedQuery = query.trim();\n if (trimmedQuery === '') {\n return true;\n }\n return option.toLowerCase().includes(trimmedQuery.toLowerCase());\n },\n [query],\n );\n const filter = filterOverride ?? defaultFilter;\n const filteredOptions = React.useMemo(\n () =>\n options.reduce<JSXElement[]>((accumulator, option, index) => {\n if (filter(option, index)) {\n accumulator.push(renderOption(option));\n }\n return accumulator;\n }, []),\n [options, renderOption, filter],\n );\n\n return filteredOptions.length === 0\n ? [noOptionsElement.key ? noOptionsElement : React.cloneElement(noOptionsElement, { key: 'no-options' })]\n : filteredOptions;\n}\n"],"names":["React","TagPickerOption","defaultRenderOption","option","value","key","useTagPickerFilter","filter","filterOverride","noOptionsElement","renderOption","query","options","defaultFilter","useCallback","trimmedQuery","trim","toLowerCase","includes","filteredOptions","useMemo","reduce","accumulator","index","push","length","cloneElement"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,eAAe,QAAQ,qBAAqB;AAmBrD,SAASC,oBAAoBC,MAAc;IACzC,qBACE,oBAACF;QAAgBG,OAAOD;QAAQE,KAAKF;OAClCA;AAGP;AAEA,OAAO,SAASG,mBAAmB,EACjCC,QAAQC,cAAc,EACtBC,gBAAgB,EAChBC,eAAeR,mBAAmB,EAClCS,KAAK,EACLC,OAAO,EACkB;IACzB,MAAMC,gBAAgBb,MAAMc,WAAW,CACrC,CAACX;QACC,MAAMY,eAAeJ,MAAMK,IAAI;QAC/B,IAAID,iBAAiB,IAAI;YACvB,OAAO;QACT;QACA,OAAOZ,OAAOc,WAAW,GAAGC,QAAQ,CAACH,aAAaE,WAAW;IAC/D,GACA;QAACN;KAAM;IAET,MAAMJ,SAASC,2BAAAA,4BAAAA,iBAAkBK;IACjC,MAAMM,kBAAkBnB,MAAMoB,OAAO,CACnC,IACER,QAAQS,MAAM,CAAe,CAACC,aAAanB,QAAQoB;YACjD,IAAIhB,OAAOJ,QAAQoB,QAAQ;gBACzBD,YAAYE,IAAI,CAACd,aAAaP;YAChC;YACA,OAAOmB;QACT,GAAG,EAAE,GACP;QAACV;QAASF;QAAcH;KAAO;IAGjC,OAAOY,gBAAgBM,MAAM,KAAK,IAC9B;QAAChB,iBAAiBJ,GAAG,GAAGI,iCAAmBT,MAAM0B,YAAY,CAACjB,kBAAkB;YAAEJ,KAAK;QAAa;KAAG,GACvGc;AACN"}
1
+ {"version":3,"sources":["../src/utils/useTagPickerFilter.tsx"],"sourcesContent":["import * as React from 'react';\nimport { TagPickerOption } from '../TagPickerOption';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\ntype UseTagPickerFilterConfig = {\n query: string;\n options: string[];\n /**\n * Provides a custom filter for the option.\n * By default the filter will check if the option includes the query.\n */\n filter?: (option: string, index: number) => boolean;\n\n /** Provides an element to be displayed when there are no options. */\n noOptionsElement: JSXElement;\n\n /** Provides a custom render for the option. */\n renderOption?: (option: string) => JSXElement;\n};\n\nfunction defaultRenderOption(option: string) {\n return (\n <TagPickerOption value={option} key={option}>\n {option}\n </TagPickerOption>\n );\n}\n\nexport function useTagPickerFilter({\n filter: filterOverride,\n noOptionsElement,\n renderOption = defaultRenderOption,\n query,\n options,\n}: UseTagPickerFilterConfig): JSXElement[] {\n const defaultFilter = React.useCallback(\n (option: string) => {\n const trimmedQuery = query.trim();\n if (trimmedQuery === '') {\n return true;\n }\n return option.toLowerCase().includes(trimmedQuery.toLowerCase());\n },\n [query],\n );\n const filter = filterOverride ?? defaultFilter;\n const filteredOptions = React.useMemo(\n () =>\n options.reduce<JSXElement[]>((accumulator, option, index) => {\n if (filter(option, index)) {\n accumulator.push(renderOption(option));\n }\n return accumulator;\n }, []),\n [options, renderOption, filter],\n );\n\n return filteredOptions.length === 0\n ? [noOptionsElement.key ? noOptionsElement : React.cloneElement(noOptionsElement, { key: 'no-options' })]\n : filteredOptions;\n}\n"],"names":["React","TagPickerOption","defaultRenderOption","option","value","key","useTagPickerFilter","filter","filterOverride","noOptionsElement","renderOption","query","options","defaultFilter","useCallback","trimmedQuery","trim","toLowerCase","includes","filteredOptions","useMemo","reduce","accumulator","index","push","length","cloneElement"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,eAAe,QAAQ,qBAAqB;AAmBrD,SAASC,oBAAoBC,MAAc;IACzC,qBACE,oBAACF;QAAgBG,OAAOD;QAAQE,KAAKF;OAClCA;AAGP;AAEA,OAAO,SAASG,mBAAmB,EACjCC,QAAQC,cAAc,EACtBC,gBAAgB,EAChBC,eAAeR,mBAAmB,EAClCS,KAAK,EACLC,OAAO,EACkB;IACzB,MAAMC,gBAAgBb,MAAMc,WAAW,CACrC,CAACX;QACC,MAAMY,eAAeJ,MAAMK,IAAI;QAC/B,IAAID,iBAAiB,IAAI;YACvB,OAAO;QACT;QACA,OAAOZ,OAAOc,WAAW,GAAGC,QAAQ,CAACH,aAAaE,WAAW;IAC/D,GACA;QAACN;KAAM;IAET,MAAMJ,SAASC,2BAAAA,4BAAAA,iBAAkBK;IACjC,MAAMM,kBAAkBnB,MAAMoB,OAAO,CACnC,IACER,QAAQS,MAAM,CAAe,CAACC,aAAanB,QAAQoB;YACjD,IAAIhB,OAAOJ,QAAQoB,QAAQ;gBACzBD,YAAYE,IAAI,CAACd,aAAaP;YAChC;YACA,OAAOmB;QACT,GAAG,EAAE,GACP;QAACV;QAASF;QAAcH;KAAO;IAGjC,OAAOY,gBAAgBM,MAAM,KAAK,IAC9B;QAAChB,iBAAiBJ,GAAG,GAAGI,iCAAmBT,MAAM0B,YAAY,CAACjB,kBAAkB;YAAEJ,KAAK;QAAa;KAAG,GACvGc;AACN"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/TagPickerButton/renderTagPickerButton.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { TagPickerButtonState, TagPickerButtonSlots } from './TagPickerButton.types';\n\n/**\n * Render the final JSX of PickerButton\n */\nexport const renderTagPickerButton_unstable = (state: TagPickerButtonState) => {\n assertSlots<TagPickerButtonSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderTagPickerButton_unstable","state","root"],"mappings":";;;;;;;;;;4BACA,gDAAiD;gCAErB,4BAA4B;AAMjD,MAAMC,iCAAiC,CAACC;QAC7CF,2BAAAA,EAAkCE;IAElC,OAAA,WAAA,OAAO,eAAA,EAACA,MAAMC,IAAI,EAAA,CAAA;AACpB,EAAE"}
1
+ {"version":3,"sources":["../src/components/TagPickerButton/renderTagPickerButton.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { TagPickerButtonState, TagPickerButtonSlots } from './TagPickerButton.types';\n\n/**\n * Render the final JSX of PickerButton\n */\nexport const renderTagPickerButton_unstable = (state: TagPickerButtonState): JSXElement => {\n assertSlots<TagPickerButtonSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderTagPickerButton_unstable","state","root"],"mappings":";;;;;;;;;;4BACA,gDAAiD;gCAErB,4BAA4B;AAOjD,MAAMC,iCAAiC,CAACC;QAC7CF,2BAAAA,EAAkCE;IAElC,OAAA,WAAA,OAAO,eAAA,EAACA,MAAMC,IAAI,EAAA,CAAA;AACpB,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/TagPickerControl/renderTagPickerControl.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type {\n TagPickerControlState,\n TagPickerControlSlots,\n TagPickerControlInternalSlots,\n} from './TagPickerControl.types';\n\n/**\n * Render the final JSX of PickerControl\n */\nexport const renderTagPickerControl_unstable = (state: TagPickerControlState) => {\n assertSlots<TagPickerControlSlots & TagPickerControlInternalSlots>(state);\n\n return (\n <state.root>\n {state.root.children}\n {state.aside && (\n <state.aside>\n {state.secondaryAction && <state.secondaryAction />}\n {state.expandIcon && <state.expandIcon />}\n </state.aside>\n )}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderTagPickerControl_unstable","state","root","children","aside","secondaryAction","expandIcon"],"mappings":";;;;+BAaaC;;;;;;4BAZb,iCAAiD;gCAErB,4BAA4B;AAUjD,wCAAwC,CAACC;QAC9CF,2BAAAA,EAAmEE;IAEnE,OAAA,WAAA,OACE,gBAAA,EAACA,MAAMC,IAAI,EAAA;;YACRD,MAAMC,IAAI,CAACC,QAAQ;YACnBF,MAAMG,KAAK,IAAA,WAAA,OACV,gBAAA,EAACH,MAAMG,KAAK,EAAA;;oBACTH,MAAMI,eAAe,IAAA,WAAA,OAAI,eAAA,EAACJ,MAAMI,eAAe,EAAA,CAAA;oBAC/CJ,MAAMK,UAAU,IAAA,WAAA,OAAI,eAAA,EAACL,MAAMK,UAAU,EAAA,CAAA;;;;;AAKhD,EAAE"}
1
+ {"version":3,"sources":["../src/components/TagPickerControl/renderTagPickerControl.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type {\n TagPickerControlState,\n TagPickerControlSlots,\n TagPickerControlInternalSlots,\n} from './TagPickerControl.types';\n\n/**\n * Render the final JSX of PickerControl\n */\nexport const renderTagPickerControl_unstable = (state: TagPickerControlState): JSXElement => {\n assertSlots<TagPickerControlSlots & TagPickerControlInternalSlots>(state);\n\n return (\n <state.root>\n {state.root.children}\n {state.aside && (\n <state.aside>\n {state.secondaryAction && <state.secondaryAction />}\n {state.expandIcon && <state.expandIcon />}\n </state.aside>\n )}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderTagPickerControl_unstable","state","root","children","aside","secondaryAction","expandIcon"],"mappings":";;;;+BAcaC;;;;;;4BAbb,iCAAiD;gCAErB,4BAA4B;AAWjD,wCAAwC,CAACC;QAC9CF,2BAAAA,EAAmEE;IAEnE,OAAA,WAAA,OACE,gBAAA,EAACA,MAAMC,IAAI,EAAA;;YACRD,MAAMC,IAAI,CAACC,QAAQ;YACnBF,MAAMG,KAAK,IAAA,WAAA,OACV,gBAAA,EAACH,MAAMG,KAAK,EAAA;;oBACTH,MAAMI,eAAe,IAAA,WAAA,OAAI,eAAA,EAACJ,MAAMI,eAAe,EAAA,CAAA;oBAC/CJ,MAAMK,UAAU,IAAA,WAAA,OAAI,eAAA,EAACL,MAAMK,UAAU,EAAA,CAAA;;;;;AAKhD,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/TagPickerGroup/renderTagPickerGroup.ts"],"sourcesContent":["import { TagPickerGroupState } from './TagPickerGroup.types';\nimport { renderTagGroup_unstable, type TagGroupContextValues } from '@fluentui/react-tags';\n\nexport function renderTagPickerGroup_unstable(state: TagPickerGroupState, contexts: TagGroupContextValues) {\n if (!state.hasSelectedOptions) {\n return null;\n }\n\n return renderTagGroup_unstable(state, contexts);\n}\n"],"names":["renderTagGroup_unstable","renderTagPickerGroup_unstable","state","contexts","hasSelectedOptions"],"mappings":";;;;;;;;;;2BACoE,uBAAuB;AAEpF,SAASC,8BAA8BC,KAA0B,EAAEC,QAA+B;IACvG,IAAI,CAACD,MAAME,kBAAkB,EAAE;QAC7B,OAAO;IACT;IAEA,WAAOJ,kCAAAA,EAAwBE,OAAOC;AACxC"}
1
+ {"version":3,"sources":["../src/components/TagPickerGroup/renderTagPickerGroup.ts"],"sourcesContent":["import type { JSXElement } from '@fluentui/react-utilities';\nimport { TagPickerGroupState } from './TagPickerGroup.types';\nimport { renderTagGroup_unstable, type TagGroupContextValues } from '@fluentui/react-tags';\n\nexport function renderTagPickerGroup_unstable(\n state: TagPickerGroupState,\n contexts: TagGroupContextValues,\n): JSXElement | null {\n if (!state.hasSelectedOptions) {\n return null;\n }\n\n return renderTagGroup_unstable(state, contexts);\n}\n"],"names":["renderTagGroup_unstable","renderTagPickerGroup_unstable","state","contexts","hasSelectedOptions"],"mappings":";;;;;;;;;;2BAEoE,uBAAuB;AAEpF,SAASC,8BACdC,KAA0B,EAC1BC,QAA+B;IAE/B,IAAI,CAACD,MAAME,kBAAkB,EAAE;QAC7B,OAAO;IACT;IAEA,WAAOJ,kCAAAA,EAAwBE,OAAOC;AACxC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/TagPickerInput/renderTagPickerInput.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { TagPickerInputState, TagPickerInputSlots } from './TagPickerInput.types';\n\n/**\n * Render the final JSX of TagPickerInput\n */\nexport const renderTagPickerInput_unstable = (state: TagPickerInputState) => {\n assertSlots<TagPickerInputSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderTagPickerInput_unstable","state","root"],"mappings":";;;;;;;;;;4BACA,gDAAiD;gCAErB,4BAA4B;AAMjD,MAAMC,gCAAgC,CAACC;QAC5CF,2BAAAA,EAAiCE;IAEjC,OAAA,WAAA,OAAO,eAAA,EAACA,MAAMC,IAAI,EAAA,CAAA;AACpB,EAAE"}
1
+ {"version":3,"sources":["../src/components/TagPickerInput/renderTagPickerInput.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { TagPickerInputState, TagPickerInputSlots } from './TagPickerInput.types';\n\n/**\n * Render the final JSX of TagPickerInput\n */\nexport const renderTagPickerInput_unstable = (state: TagPickerInputState): JSXElement => {\n assertSlots<TagPickerInputSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderTagPickerInput_unstable","state","root"],"mappings":";;;;;;;;;;4BACA,gDAAiD;gCAErB,4BAA4B;AAOjD,MAAMC,gCAAgC,CAACC;QAC5CF,2BAAAA,EAAiCE;IAEjC,OAAA,WAAA,OAAO,eAAA,EAACA,MAAMC,IAAI,EAAA,CAAA;AACpB,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/TagPickerList/renderTagPickerList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { TagPickerListState, TagPickerListSlots } from './TagPickerList.types';\n\n/**\n * Render the final JSX of TagPickerList\n */\nexport const renderTagPickerList_unstable = (state: TagPickerListState) => {\n assertSlots<TagPickerListSlots>(state);\n return <state.root />;\n};\n"],"names":["assertSlots","renderTagPickerList_unstable","state","root"],"mappings":";;;;;;;;;;4BACA,gDAAiD;gCAErB,4BAA4B;AAMjD,MAAMC,+BAA+B,CAACC;QAC3CF,2BAAAA,EAAgCE;IAChC,OAAA,WAAA,OAAO,eAAA,EAACA,MAAMC,IAAI,EAAA,CAAA;AACpB,EAAE"}
1
+ {"version":3,"sources":["../src/components/TagPickerList/renderTagPickerList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { TagPickerListState, TagPickerListSlots } from './TagPickerList.types';\n\n/**\n * Render the final JSX of TagPickerList\n */\nexport const renderTagPickerList_unstable = (state: TagPickerListState): JSXElement => {\n assertSlots<TagPickerListSlots>(state);\n return <state.root />;\n};\n"],"names":["assertSlots","renderTagPickerList_unstable","state","root"],"mappings":";;;;;;;;;;4BACA,gDAAiD;gCAErB,4BAA4B;AAOjD,MAAMC,+BAA+B,CAACC;QAC3CF,2BAAAA,EAAgCE;IAChC,OAAA,WAAA,OAAO,eAAA,EAACA,MAAMC,IAAI,EAAA,CAAA;AACpB,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/TagPickerOption/renderTagPickerOption.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { TagPickerOptionState, TagPickerOptionSlots } from './TagPickerOption.types';\n\n/**\n * Render the final JSX of TagPickerOption\n */\nexport const renderTagPickerOption_unstable = (state: TagPickerOptionState) => {\n assertSlots<TagPickerOptionSlots>(state);\n\n return (\n <state.root>\n {state.media && <state.media />}\n {state.root.children}\n {state.secondaryContent && <state.secondaryContent />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderTagPickerOption_unstable","state","root","media","children","secondaryContent"],"mappings":";;;;+BASaC;;;;;;4BARb,iCAAiD;gCAErB,4BAA4B;AAMjD,uCAAuC,CAACC;QAC7CF,2BAAAA,EAAkCE;IAElC,OAAA,WAAA,OACE,gBAAA,EAACA,MAAMC,IAAI,EAAA;;YACRD,MAAME,KAAK,IAAA,WAAA,OAAI,eAAA,EAACF,MAAME,KAAK,EAAA,CAAA;YAC3BF,MAAMC,IAAI,CAACE,QAAQ;YACnBH,MAAMI,gBAAgB,IAAA,WAAA,OAAI,eAAA,EAACJ,MAAMI,gBAAgB,EAAA,CAAA;;;AAGxD,EAAE"}
1
+ {"version":3,"sources":["../src/components/TagPickerOption/renderTagPickerOption.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { TagPickerOptionState, TagPickerOptionSlots } from './TagPickerOption.types';\n\n/**\n * Render the final JSX of TagPickerOption\n */\nexport const renderTagPickerOption_unstable = (state: TagPickerOptionState): JSXElement => {\n assertSlots<TagPickerOptionSlots>(state);\n\n return (\n <state.root>\n {state.media && <state.media />}\n {state.root.children}\n {state.secondaryContent && <state.secondaryContent />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderTagPickerOption_unstable","state","root","media","children","secondaryContent"],"mappings":";;;;+BAUaC;;;;;;4BATb,iCAAiD;gCAErB,4BAA4B;AAOjD,uCAAuC,CAACC;QAC7CF,2BAAAA,EAAkCE;IAElC,OAAA,WAAA,OACE,gBAAA,EAACA,MAAMC,IAAI,EAAA;;YACRD,MAAME,KAAK,IAAA,WAAA,OAAI,eAAA,EAACF,MAAME,KAAK,EAAA,CAAA;YAC3BF,MAAMC,IAAI,CAACE,QAAQ;YACnBH,MAAMI,gBAAgB,IAAA,WAAA,OAAI,eAAA,EAACJ,MAAMI,gBAAgB,EAAA,CAAA;;;AAGxD,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/contexts/TagPickerContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { ContextSelector, createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { TagPickerSize } from '../components/TagPicker/TagPicker.types';\nimport { ComboboxBaseState } from '@fluentui/react-combobox';\n\nexport interface TagPickerContextValue\n extends Pick<\n ComboboxBaseState,\n | 'open'\n | 'clearSelection'\n | 'getOptionById'\n | 'selectedOptions'\n | 'selectOption'\n | 'setHasFocus'\n | 'setOpen'\n | 'setValue'\n | 'value'\n | 'appearance'\n | 'disabled'\n > {\n triggerRef: React.RefObject<HTMLInputElement | HTMLButtonElement>;\n popoverRef: React.RefObject<HTMLDivElement>;\n popoverId: string;\n targetRef: React.RefObject<HTMLDivElement>;\n secondaryActionRef: React.RefObject<HTMLSpanElement>;\n tagPickerGroupRef: React.RefObject<HTMLDivElement>;\n size: TagPickerSize;\n noPopover?: boolean;\n}\n\n/**\n * @internal\n */\nexport const tagPickerContextDefaultValue: TagPickerContextValue = {\n triggerRef: React.createRef<HTMLInputElement>(),\n popoverRef: React.createRef<HTMLDivElement>(),\n targetRef: React.createRef<HTMLDivElement>(),\n tagPickerGroupRef: React.createRef<HTMLDivElement>(),\n secondaryActionRef: React.createRef<HTMLDivElement>(),\n open: false,\n clearSelection: () => null,\n getOptionById: () => undefined,\n selectedOptions: [],\n selectOption: () => null,\n setHasFocus: () => null,\n setOpen: () => null,\n setValue: () => null,\n value: undefined,\n popoverId: '',\n size: 'medium',\n appearance: 'outline',\n disabled: false,\n};\n\nconst TagPickerContext = createContext<TagPickerContextValue | undefined>(undefined);\n\nexport const TagPickerContextProvider = TagPickerContext.Provider;\nexport const useTagPickerContext_unstable = <T>(selector: ContextSelector<TagPickerContextValue, T>) =>\n useContextSelector(TagPickerContext, (ctx = tagPickerContextDefaultValue) => selector(ctx));\n"],"names":["React","createContext","useContextSelector","tagPickerContextDefaultValue","triggerRef","createRef","popoverRef","targetRef","tagPickerGroupRef","secondaryActionRef","open","clearSelection","getOptionById","undefined","selectedOptions","selectOption","setHasFocus","setOpen","setValue","value","popoverId","size","appearance","disabled","TagPickerContext","TagPickerContextProvider","Provider","useTagPickerContext_unstable","selector","ctx"],"mappings":";;;;;;;;;;;4BAwDayB;;;IAvBAtB,4BAAAA;;;gCAwBAwB;;;;;iEAzDU,QAAQ;sCACoC,mCAAmC;AAgC/F,qCAA4D;IACjEvB,0BAAYJ,OAAMK,SAAS;IAC3BC,0BAAYN,OAAMK,SAAS;IAC3BE,yBAAWP,OAAMK,SAAS;IAC1BG,iCAAmBR,OAAMK,SAAS;IAClCI,kCAAoBT,OAAMK,SAAS;IACnCK,MAAM;IACNC,gBAAgB,IAAM;IACtBC,eAAe,IAAMC;IACrBC,iBAAiB,EAAE;IACnBC,cAAc,IAAM;IACpBC,aAAa,IAAM;IACnBC,SAAS,IAAM;IACfC,UAAU,IAAM;IAChBC,OAAON;IACPO,WAAW;IACXC,MAAM;IACNC,YAAY;IACZC,UAAU;AACZ,EAAE;AAEF,MAAMC,uBAAmBvB,mCAAAA,EAAiDY;AAEnE,MAAMY,2BAA2BD,iBAAiBE,QAAQ,CAAC;AAC3D,MAAMC,+BAA+B,CAAIC,eAC9C1B,wCAAAA,EAAmBsB,kBAAkB,CAACK,MAAM1B,4BAA4B,GAAKyB,SAASC,MAAM"}
1
+ {"version":3,"sources":["../src/contexts/TagPickerContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { ContextSelector, createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { TagPickerSize } from '../components/TagPicker/TagPicker.types';\nimport { ComboboxBaseState } from '@fluentui/react-combobox';\n\nexport interface TagPickerContextValue\n extends Pick<\n ComboboxBaseState,\n | 'open'\n | 'clearSelection'\n | 'getOptionById'\n | 'selectedOptions'\n | 'selectOption'\n | 'setHasFocus'\n | 'setOpen'\n | 'setValue'\n | 'value'\n | 'appearance'\n | 'disabled'\n > {\n triggerRef: React.RefObject<HTMLInputElement | HTMLButtonElement | null>;\n popoverRef: React.RefObject<HTMLDivElement | null>;\n popoverId: string;\n targetRef: React.RefObject<HTMLDivElement | null>;\n secondaryActionRef: React.RefObject<HTMLSpanElement | null>;\n tagPickerGroupRef: React.RefObject<HTMLDivElement | null>;\n size: TagPickerSize;\n noPopover?: boolean;\n}\n\n/**\n * @internal\n */\nexport const tagPickerContextDefaultValue: TagPickerContextValue = {\n triggerRef: React.createRef<HTMLInputElement>(),\n popoverRef: React.createRef<HTMLDivElement>(),\n targetRef: React.createRef<HTMLDivElement>(),\n tagPickerGroupRef: React.createRef<HTMLDivElement>(),\n secondaryActionRef: React.createRef<HTMLDivElement>(),\n open: false,\n clearSelection: () => null,\n getOptionById: () => undefined,\n selectedOptions: [],\n selectOption: () => null,\n setHasFocus: () => null,\n setOpen: () => null,\n setValue: () => null,\n value: undefined,\n popoverId: '',\n size: 'medium',\n appearance: 'outline',\n disabled: false,\n};\n\nconst TagPickerContext = createContext<TagPickerContextValue | undefined>(undefined);\n\nexport const TagPickerContextProvider = TagPickerContext.Provider;\nexport const useTagPickerContext_unstable = <T>(selector: ContextSelector<TagPickerContextValue, T>): T =>\n useContextSelector(TagPickerContext, (ctx = tagPickerContextDefaultValue) => selector(ctx));\n"],"names":["React","createContext","useContextSelector","tagPickerContextDefaultValue","triggerRef","createRef","popoverRef","targetRef","tagPickerGroupRef","secondaryActionRef","open","clearSelection","getOptionById","undefined","selectedOptions","selectOption","setHasFocus","setOpen","setValue","value","popoverId","size","appearance","disabled","TagPickerContext","TagPickerContextProvider","Provider","useTagPickerContext_unstable","selector","ctx"],"mappings":";;;;;;;;;;;4BAwDayB;;;IAvBAtB,4BAAAA;;;gCAwBAwB;;;;;iEAzDU,QAAQ;sCACoC,mCAAmC;AAgC/F,qCAA4D;IACjEvB,0BAAYJ,OAAMK,SAAS;IAC3BC,0BAAYN,OAAMK,SAAS;IAC3BE,yBAAWP,OAAMK,SAAS;IAC1BG,iCAAmBR,OAAMK,SAAS;IAClCI,kCAAoBT,OAAMK,SAAS;IACnCK,MAAM;IACNC,gBAAgB,IAAM;IACtBC,eAAe,IAAMC;IACrBC,iBAAiB,EAAE;IACnBC,cAAc,IAAM;IACpBC,aAAa,IAAM;IACnBC,SAAS,IAAM;IACfC,UAAU,IAAM;IAChBC,OAAON;IACPO,WAAW;IACXC,MAAM;IACNC,YAAY;IACZC,UAAU;AACZ,EAAE;AAEF,MAAMC,uBAAmBvB,mCAAAA,EAAiDY;AAEnE,MAAMY,2BAA2BD,iBAAiBE,QAAQ,CAAC;AAC3D,MAAMC,+BAA+B,CAAIC,eAC9C1B,wCAAAA,EAAmBsB,kBAAkB,CAACK,MAAM1B,4BAA4B,GAAKyB,SAASC,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/useExpandLabel.ts"],"sourcesContent":["import * as React from 'react';\nimport { useTagPickerContext_unstable } from '../contexts/TagPickerContext';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { TagPickerControlState } from '../TagPickerControl';\n\nexport function useExpandLabel(options: { tagPickerId: string; state: Pick<TagPickerControlState, 'expandIcon'> }) {\n const { tagPickerId, state } = options;\n const { targetDocument } = useFluent();\n const triggerRef = useTagPickerContext_unstable(ctx => ctx.triggerRef);\n const expandIconRef = React.useRef<HTMLSpanElement>(null);\n\n const hasExpandIcon = !!state.expandIcon;\n const {\n 'aria-label': expandIconAriaLabel,\n 'aria-labelledby': expandIconAriaLabelledby,\n id: expandIconId,\n } = state.expandIcon || {};\n\n // If aria-label or aria-labelledby changes, recalculate aria-label and aria-labelledby for the expandIcon\n // The expandIcon's label is calculated based on the input's label\n // TODO: investigate ways to enforce client to provide a label rather than need to calculate it\n const getExpandLabel = React.useCallback(\n (ariaLabel?: string | null, ariaLabelledBy?: string | null) => {\n let expandAriaLabel = undefined;\n let expandAriaLabelledBy = undefined;\n let expandId = undefined;\n\n if (hasExpandIcon) {\n const hasExpandLabel = expandIconAriaLabel || expandIconAriaLabelledby;\n // If there is no explicit aria-label, calculate default accName attribute for expandIcon button,\n // using the following steps:\n // 1. If there is an aria-label, it is \"Open [aria-label]\"\n // 2. If there is an aria-labelledby, it is \"Open [aria-labelledby target]\" (using aria-labelledby + ids)\n // 3. If there is no aria-label/ledby attr, it falls back to \"Open\"\n // We can't fall back to a label/htmlFor name because of https://github.com/w3c/accname/issues/179\n const defaultOpenString = 'Open'; // this is english-only since it is the fallback\n if (!hasExpandLabel) {\n if (ariaLabelledBy) {\n expandAriaLabel = defaultOpenString;\n expandId = expandIconId ?? `${tagPickerId}-chevron`;\n expandAriaLabelledBy = `${expandId} ${ariaLabelledBy}`;\n } else if (ariaLabel) {\n expandAriaLabel = `${defaultOpenString} ${ariaLabel}`;\n } else {\n expandAriaLabel = defaultOpenString;\n }\n }\n }\n\n return { expandAriaLabel, expandAriaLabelledBy, expandId };\n },\n [expandIconAriaLabel, expandIconAriaLabelledby, expandIconId, hasExpandIcon, tagPickerId],\n );\n\n const setExpandLabel = React.useCallback(() => {\n const inputAriaLabel = triggerRef.current?.getAttribute('aria-label');\n const inputAriaLabelledBy = triggerRef.current?.getAttribute('aria-labelledby');\n\n const { expandAriaLabel, expandAriaLabelledBy, expandId } = getExpandLabel(inputAriaLabel, inputAriaLabelledBy);\n\n if (expandAriaLabelledBy) {\n expandIconRef.current?.setAttribute('aria-labelledby', expandAriaLabelledBy);\n }\n if (expandAriaLabel) {\n expandIconRef.current?.setAttribute('aria-label', expandAriaLabel);\n }\n if (expandId) {\n expandIconRef.current?.setAttribute('id', expandId);\n }\n }, [getExpandLabel, triggerRef]);\n\n React.useEffect(() => {\n const hasExpandLabel = expandIconAriaLabel || expandIconAriaLabelledby;\n if (!targetDocument?.defaultView || !triggerRef.current || !hasExpandIcon || hasExpandLabel) {\n return;\n }\n\n const win = targetDocument.defaultView;\n\n // On first render, calculate the default aria-label and aria-labelledby for the expandIcon\n setExpandLabel();\n\n const observer = new win.MutationObserver(setExpandLabel);\n observer.observe(triggerRef.current, {\n attributes: true,\n attributeFilter: ['aria-label', 'aria-labelledby'],\n });\n\n return () => observer.disconnect();\n }, [\n getExpandLabel,\n setExpandLabel,\n expandIconAriaLabel,\n expandIconAriaLabelledby,\n hasExpandIcon,\n tagPickerId,\n triggerRef,\n targetDocument,\n ]);\n\n return expandIconRef;\n}\n"],"names":["React","useTagPickerContext_unstable","useFluent_unstable","useFluent","useExpandLabel","options","tagPickerId","state","targetDocument","triggerRef","ctx","expandIconRef","useRef","hasExpandIcon","expandIcon","expandIconAriaLabel","expandIconAriaLabelledby","id","expandIconId","getExpandLabel","useCallback","ariaLabel","ariaLabelledBy","expandAriaLabel","undefined","expandAriaLabelledBy","expandId","hasExpandLabel","defaultOpenString","setExpandLabel","inputAriaLabel","current","getAttribute","inputAriaLabelledBy","setAttribute","useEffect","defaultView","win","observer","MutationObserver","observe","attributes","attributeFilter","disconnect"],"mappings":"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"}
1
+ {"version":3,"sources":["../src/utils/useExpandLabel.ts"],"sourcesContent":["import * as React from 'react';\nimport { useTagPickerContext_unstable } from '../contexts/TagPickerContext';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { TagPickerControlState } from '../TagPickerControl';\n\nexport function useExpandLabel(options: {\n tagPickerId: string;\n state: Pick<TagPickerControlState, 'expandIcon'>;\n}): React.RefObject<HTMLSpanElement | null> {\n const { tagPickerId, state } = options;\n const { targetDocument } = useFluent();\n const triggerRef = useTagPickerContext_unstable(ctx => ctx.triggerRef);\n const expandIconRef = React.useRef<HTMLSpanElement | null>(null);\n\n const hasExpandIcon = !!state.expandIcon;\n const {\n 'aria-label': expandIconAriaLabel,\n 'aria-labelledby': expandIconAriaLabelledby,\n id: expandIconId,\n } = state.expandIcon || {};\n\n // If aria-label or aria-labelledby changes, recalculate aria-label and aria-labelledby for the expandIcon\n // The expandIcon's label is calculated based on the input's label\n // TODO: investigate ways to enforce client to provide a label rather than need to calculate it\n const getExpandLabel = React.useCallback(\n (ariaLabel?: string | null, ariaLabelledBy?: string | null) => {\n let expandAriaLabel = undefined;\n let expandAriaLabelledBy = undefined;\n let expandId = undefined;\n\n if (hasExpandIcon) {\n const hasExpandLabel = expandIconAriaLabel || expandIconAriaLabelledby;\n // If there is no explicit aria-label, calculate default accName attribute for expandIcon button,\n // using the following steps:\n // 1. If there is an aria-label, it is \"Open [aria-label]\"\n // 2. If there is an aria-labelledby, it is \"Open [aria-labelledby target]\" (using aria-labelledby + ids)\n // 3. If there is no aria-label/ledby attr, it falls back to \"Open\"\n // We can't fall back to a label/htmlFor name because of https://github.com/w3c/accname/issues/179\n const defaultOpenString = 'Open'; // this is english-only since it is the fallback\n if (!hasExpandLabel) {\n if (ariaLabelledBy) {\n expandAriaLabel = defaultOpenString;\n expandId = expandIconId ?? `${tagPickerId}-chevron`;\n expandAriaLabelledBy = `${expandId} ${ariaLabelledBy}`;\n } else if (ariaLabel) {\n expandAriaLabel = `${defaultOpenString} ${ariaLabel}`;\n } else {\n expandAriaLabel = defaultOpenString;\n }\n }\n }\n\n return { expandAriaLabel, expandAriaLabelledBy, expandId };\n },\n [expandIconAriaLabel, expandIconAriaLabelledby, expandIconId, hasExpandIcon, tagPickerId],\n );\n\n const setExpandLabel = React.useCallback(() => {\n const inputAriaLabel = triggerRef.current?.getAttribute('aria-label');\n const inputAriaLabelledBy = triggerRef.current?.getAttribute('aria-labelledby');\n\n const { expandAriaLabel, expandAriaLabelledBy, expandId } = getExpandLabel(inputAriaLabel, inputAriaLabelledBy);\n\n if (expandAriaLabelledBy) {\n expandIconRef.current?.setAttribute('aria-labelledby', expandAriaLabelledBy);\n }\n if (expandAriaLabel) {\n expandIconRef.current?.setAttribute('aria-label', expandAriaLabel);\n }\n if (expandId) {\n expandIconRef.current?.setAttribute('id', expandId);\n }\n }, [getExpandLabel, triggerRef]);\n\n React.useEffect(() => {\n const hasExpandLabel = expandIconAriaLabel || expandIconAriaLabelledby;\n if (!targetDocument?.defaultView || !triggerRef.current || !hasExpandIcon || hasExpandLabel) {\n return;\n }\n\n const win = targetDocument.defaultView;\n\n // On first render, calculate the default aria-label and aria-labelledby for the expandIcon\n setExpandLabel();\n\n const observer = new win.MutationObserver(setExpandLabel);\n observer.observe(triggerRef.current, {\n attributes: true,\n attributeFilter: ['aria-label', 'aria-labelledby'],\n });\n\n return () => observer.disconnect();\n }, [\n getExpandLabel,\n setExpandLabel,\n expandIconAriaLabel,\n expandIconAriaLabelledby,\n hasExpandIcon,\n tagPickerId,\n triggerRef,\n targetDocument,\n ]);\n\n return expandIconRef;\n}\n"],"names":["React","useTagPickerContext_unstable","useFluent_unstable","useFluent","useExpandLabel","options","tagPickerId","state","targetDocument","triggerRef","ctx","expandIconRef","useRef","hasExpandIcon","expandIcon","expandIconAriaLabel","expandIconAriaLabelledby","id","expandIconId","getExpandLabel","useCallback","ariaLabel","ariaLabelledBy","expandAriaLabel","undefined","expandAriaLabelledBy","expandId","hasExpandLabel","defaultOpenString","setExpandLabel","inputAriaLabel","current","getAttribute","inputAriaLabelledBy","setAttribute","useEffect","defaultView","win","observer","MutationObserver","observe","attributes","attributeFilter","disconnect"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/useTagPickerFilter.tsx"],"sourcesContent":["import * as React from 'react';\nimport { TagPickerOption } from '../TagPickerOption';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\ntype UseTagPickerFilterConfig = {\n query: string;\n options: string[];\n /**\n * Provides a custom filter for the option.\n * By default the filter will check if the option includes the query.\n */\n filter?: (option: string, index: number) => boolean;\n\n /** Provides an element to be displayed when there are no options. */\n noOptionsElement: JSXElement;\n\n /** Provides a custom render for the option. */\n renderOption?: (option: string) => JSXElement;\n};\n\nfunction defaultRenderOption(option: string) {\n return (\n <TagPickerOption value={option} key={option}>\n {option}\n </TagPickerOption>\n );\n}\n\nexport function useTagPickerFilter({\n filter: filterOverride,\n noOptionsElement,\n renderOption = defaultRenderOption,\n query,\n options,\n}: UseTagPickerFilterConfig) {\n const defaultFilter = React.useCallback(\n (option: string) => {\n const trimmedQuery = query.trim();\n if (trimmedQuery === '') {\n return true;\n }\n return option.toLowerCase().includes(trimmedQuery.toLowerCase());\n },\n [query],\n );\n const filter = filterOverride ?? defaultFilter;\n const filteredOptions = React.useMemo(\n () =>\n options.reduce<JSXElement[]>((accumulator, option, index) => {\n if (filter(option, index)) {\n accumulator.push(renderOption(option));\n }\n return accumulator;\n }, []),\n [options, renderOption, filter],\n );\n\n return filteredOptions.length === 0\n ? [noOptionsElement.key ? noOptionsElement : React.cloneElement(noOptionsElement, { key: 'no-options' })]\n : filteredOptions;\n}\n"],"names":["React","TagPickerOption","defaultRenderOption","option","value","key","useTagPickerFilter","filter","filterOverride","noOptionsElement","renderOption","query","options","defaultFilter","useCallback","trimmedQuery","trim","toLowerCase","includes","filteredOptions","useMemo","reduce","accumulator","index","push","length","cloneElement"],"mappings":";;;;+BA4BgBM;;;;;;;iEA5BO,QAAQ;iCACC,qBAAqB;AAmBrD,SAASJ,oBAAoBC,MAAc;IACzC,OAAA,WAAA,GACE,OAAA,aAAA,CAACF,gCAAAA,EAAAA;QAAgBG,OAAOD;QAAQE,KAAKF;OAClCA;AAGP;AAEO,4BAA4B,EACjCI,QAAQC,cAAc,EACtBC,gBAAgB,EAChBC,eAAeR,mBAAmB,EAClCS,KAAK,EACLC,OAAO,EACkB;IACzB,MAAMC,gBAAgBb,OAAMc,WAAW,CACrC,CAACX;QACC,MAAMY,eAAeJ,MAAMK,IAAI;QAC/B,IAAID,iBAAiB,IAAI;YACvB,OAAO;QACT;QACA,OAAOZ,OAAOc,WAAW,GAAGC,QAAQ,CAACH,aAAaE,WAAW;IAC/D,GACA;QAACN;KAAM;IAET,MAAMJ,SAASC,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,iBAAkBK;IACjC,MAAMM,kBAAkBnB,OAAMoB,OAAO,CACnC,IACER,QAAQS,MAAM,CAAe,CAACC,aAAanB,QAAQoB;YACjD,IAAIhB,OAAOJ,QAAQoB,QAAQ;gBACzBD,YAAYE,IAAI,CAACd,aAAaP;YAChC;YACA,OAAOmB;QACT,GAAG,EAAE,GACP;QAACV;QAASF;QAAcH;KAAO;IAGjC,OAAOY,gBAAgBM,MAAM,KAAK,IAC9B;QAAChB,iBAAiBJ,GAAG,GAAGI,mBAAAA,WAAAA,GAAmBT,OAAM0B,YAAY,CAACjB,kBAAkB;YAAEJ,KAAK;QAAa;KAAG,GACvGc;AACN"}
1
+ {"version":3,"sources":["../src/utils/useTagPickerFilter.tsx"],"sourcesContent":["import * as React from 'react';\nimport { TagPickerOption } from '../TagPickerOption';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\ntype UseTagPickerFilterConfig = {\n query: string;\n options: string[];\n /**\n * Provides a custom filter for the option.\n * By default the filter will check if the option includes the query.\n */\n filter?: (option: string, index: number) => boolean;\n\n /** Provides an element to be displayed when there are no options. */\n noOptionsElement: JSXElement;\n\n /** Provides a custom render for the option. */\n renderOption?: (option: string) => JSXElement;\n};\n\nfunction defaultRenderOption(option: string) {\n return (\n <TagPickerOption value={option} key={option}>\n {option}\n </TagPickerOption>\n );\n}\n\nexport function useTagPickerFilter({\n filter: filterOverride,\n noOptionsElement,\n renderOption = defaultRenderOption,\n query,\n options,\n}: UseTagPickerFilterConfig): JSXElement[] {\n const defaultFilter = React.useCallback(\n (option: string) => {\n const trimmedQuery = query.trim();\n if (trimmedQuery === '') {\n return true;\n }\n return option.toLowerCase().includes(trimmedQuery.toLowerCase());\n },\n [query],\n );\n const filter = filterOverride ?? defaultFilter;\n const filteredOptions = React.useMemo(\n () =>\n options.reduce<JSXElement[]>((accumulator, option, index) => {\n if (filter(option, index)) {\n accumulator.push(renderOption(option));\n }\n return accumulator;\n }, []),\n [options, renderOption, filter],\n );\n\n return filteredOptions.length === 0\n ? [noOptionsElement.key ? noOptionsElement : React.cloneElement(noOptionsElement, { key: 'no-options' })]\n : filteredOptions;\n}\n"],"names":["React","TagPickerOption","defaultRenderOption","option","value","key","useTagPickerFilter","filter","filterOverride","noOptionsElement","renderOption","query","options","defaultFilter","useCallback","trimmedQuery","trim","toLowerCase","includes","filteredOptions","useMemo","reduce","accumulator","index","push","length","cloneElement"],"mappings":";;;;+BA4BgBM;;;;;;;iEA5BO,QAAQ;iCACC,qBAAqB;AAmBrD,SAASJ,oBAAoBC,MAAc;IACzC,OAAA,WAAA,GACE,OAAA,aAAA,CAACF,gCAAAA,EAAAA;QAAgBG,OAAOD;QAAQE,KAAKF;OAClCA;AAGP;AAEO,4BAA4B,EACjCI,QAAQC,cAAc,EACtBC,gBAAgB,EAChBC,eAAeR,mBAAmB,EAClCS,KAAK,EACLC,OAAO,EACkB;IACzB,MAAMC,gBAAgBb,OAAMc,WAAW,CACrC,CAACX;QACC,MAAMY,eAAeJ,MAAMK,IAAI;QAC/B,IAAID,iBAAiB,IAAI;YACvB,OAAO;QACT;QACA,OAAOZ,OAAOc,WAAW,GAAGC,QAAQ,CAACH,aAAaE,WAAW;IAC/D,GACA;QAACN;KAAM;IAET,MAAMJ,SAASC,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,iBAAkBK;IACjC,MAAMM,kBAAkBnB,OAAMoB,OAAO,CACnC,IACER,QAAQS,MAAM,CAAe,CAACC,aAAanB,QAAQoB;YACjD,IAAIhB,OAAOJ,QAAQoB,QAAQ;gBACzBD,YAAYE,IAAI,CAACd,aAAaP;YAChC;YACA,OAAOmB;QACT,GAAG,EAAE,GACP;QAACV;QAASF;QAAcH;KAAO;IAGjC,OAAOY,gBAAgBM,MAAM,KAAK,IAC9B;QAAChB,iBAAiBJ,GAAG,GAAGI,mBAAAA,WAAAA,GAAmBT,OAAM0B,YAAY,CAACjB,kBAAkB;YAAEJ,KAAK;QAAa;KAAG,GACvGc;AACN"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-tag-picker",
3
- "version": "9.7.4",
3
+ "version": "9.7.6",
4
4
  "description": "FluentUI TagPicker component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -28,28 +28,28 @@
28
28
  "@fluentui/scripts-cypress": "*"
29
29
  },
30
30
  "dependencies": {
31
- "@fluentui/react-jsx-runtime": "^9.1.5",
32
- "@fluentui/react-shared-contexts": "^9.24.1",
31
+ "@fluentui/react-jsx-runtime": "^9.2.0",
32
+ "@fluentui/react-shared-contexts": "^9.25.1",
33
33
  "@fluentui/react-theme": "^9.2.0",
34
- "@fluentui/react-utilities": "^9.23.2",
35
- "@fluentui/react-portal": "^9.8.0",
36
- "@fluentui/react-tabster": "^9.26.3",
37
- "@fluentui/react-aria": "^9.16.3",
34
+ "@fluentui/react-utilities": "^9.24.1",
35
+ "@fluentui/react-portal": "^9.8.2",
36
+ "@fluentui/react-tabster": "^9.26.5",
37
+ "@fluentui/react-aria": "^9.17.0",
38
38
  "@fluentui/react-icons": "^2.0.245",
39
- "@fluentui/react-combobox": "^9.16.4",
40
- "@fluentui/react-tags": "^9.7.4",
41
- "@fluentui/react-context-selector": "^9.2.5",
42
- "@fluentui/react-positioning": "^9.20.3",
39
+ "@fluentui/react-combobox": "^9.16.6",
40
+ "@fluentui/react-tags": "^9.7.6",
41
+ "@fluentui/react-context-selector": "^9.2.7",
42
+ "@fluentui/react-positioning": "^9.20.5",
43
43
  "@fluentui/keyboard-keys": "^9.0.8",
44
- "@fluentui/react-field": "^9.4.3",
44
+ "@fluentui/react-field": "^9.4.5",
45
45
  "@griffel/react": "^1.5.22",
46
46
  "@swc/helpers": "^0.5.1"
47
47
  },
48
48
  "peerDependencies": {
49
- "@types/react": ">=16.14.0 <19.0.0",
50
- "@types/react-dom": ">=16.9.0 <19.0.0",
51
- "react": ">=16.14.0 <19.0.0",
52
- "react-dom": ">=16.14.0 <19.0.0"
49
+ "@types/react": ">=16.14.0 <20.0.0",
50
+ "@types/react-dom": ">=16.9.0 <20.0.0",
51
+ "react": ">=16.14.0 <20.0.0",
52
+ "react-dom": ">=16.14.0 <20.0.0"
53
53
  },
54
54
  "exports": {
55
55
  ".": {