@fluentui/react-combobox 9.7.5 → 9.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +44 -5
  2. package/dist/index.d.ts +79 -14
  3. package/lib/components/Combobox/Combobox.types.js.map +1 -1
  4. package/lib/components/Combobox/renderCombobox.js +19 -11
  5. package/lib/components/Combobox/renderCombobox.js.map +1 -1
  6. package/lib/components/Combobox/useCombobox.js +12 -4
  7. package/lib/components/Combobox/useCombobox.js.map +1 -1
  8. package/lib/components/Combobox/useInputTriggerSlot.js +14 -12
  9. package/lib/components/Combobox/useInputTriggerSlot.js.map +1 -1
  10. package/lib/components/Dropdown/Dropdown.types.js.map +1 -1
  11. package/lib/components/Dropdown/renderDropdown.js +21 -13
  12. package/lib/components/Dropdown/renderDropdown.js.map +1 -1
  13. package/lib/components/Dropdown/useButtonTriggerSlot.js +51 -31
  14. package/lib/components/Dropdown/useButtonTriggerSlot.js.map +1 -1
  15. package/lib/components/Dropdown/useDropdown.js +14 -4
  16. package/lib/components/Dropdown/useDropdown.js.map +1 -1
  17. package/lib/components/Listbox/Listbox.types.js.map +1 -1
  18. package/lib/components/Listbox/renderListbox.js +7 -3
  19. package/lib/components/Listbox/renderListbox.js.map +1 -1
  20. package/lib/components/Listbox/useListbox.js +52 -44
  21. package/lib/components/Listbox/useListbox.js.map +1 -1
  22. package/lib/components/Option/Option.types.js.map +1 -1
  23. package/lib/components/Option/useOption.js +14 -24
  24. package/lib/components/Option/useOption.js.map +1 -1
  25. package/lib/components/Option/useOptionStyles.styles.js +27 -28
  26. package/lib/components/Option/useOptionStyles.styles.js.map +1 -1
  27. package/lib/contexts/ComboboxContext.js +9 -1
  28. package/lib/contexts/ComboboxContext.js.map +1 -1
  29. package/lib/contexts/ListboxContext.js +9 -4
  30. package/lib/contexts/ListboxContext.js.map +1 -1
  31. package/lib/contexts/useComboboxContextValues.js +22 -5
  32. package/lib/contexts/useComboboxContextValues.js.map +1 -1
  33. package/lib/contexts/useListboxContextValues.js +19 -10
  34. package/lib/contexts/useListboxContextValues.js.map +1 -1
  35. package/lib/index.js +2 -1
  36. package/lib/index.js.map +1 -1
  37. package/lib/utils/ComboboxBase.types.js.map +1 -1
  38. package/lib/utils/OptionCollection.types.js.map +1 -1
  39. package/lib/utils/Selection.types.js.map +1 -1
  40. package/lib/utils/dropdownKeyActions.js +0 -21
  41. package/lib/utils/dropdownKeyActions.js.map +1 -1
  42. package/lib/utils/useComboboxBaseState.js +60 -17
  43. package/lib/utils/useComboboxBaseState.js.map +1 -1
  44. package/lib/utils/useListboxSlot.js.map +1 -1
  45. package/lib/utils/useOptionCollection.js +18 -45
  46. package/lib/utils/useOptionCollection.js.map +1 -1
  47. package/lib/utils/useTriggerSlot.js +86 -33
  48. package/lib/utils/useTriggerSlot.js.map +1 -1
  49. package/lib-commonjs/components/Combobox/renderCombobox.js +19 -11
  50. package/lib-commonjs/components/Combobox/renderCombobox.js.map +1 -1
  51. package/lib-commonjs/components/Combobox/useCombobox.js +12 -4
  52. package/lib-commonjs/components/Combobox/useCombobox.js.map +1 -1
  53. package/lib-commonjs/components/Combobox/useInputTriggerSlot.js +14 -12
  54. package/lib-commonjs/components/Combobox/useInputTriggerSlot.js.map +1 -1
  55. package/lib-commonjs/components/Dropdown/renderDropdown.js +21 -13
  56. package/lib-commonjs/components/Dropdown/renderDropdown.js.map +1 -1
  57. package/lib-commonjs/components/Dropdown/useButtonTriggerSlot.js +51 -31
  58. package/lib-commonjs/components/Dropdown/useButtonTriggerSlot.js.map +1 -1
  59. package/lib-commonjs/components/Dropdown/useDropdown.js +14 -4
  60. package/lib-commonjs/components/Dropdown/useDropdown.js.map +1 -1
  61. package/lib-commonjs/components/Listbox/renderListbox.js +7 -3
  62. package/lib-commonjs/components/Listbox/renderListbox.js.map +1 -1
  63. package/lib-commonjs/components/Listbox/useListbox.js +49 -41
  64. package/lib-commonjs/components/Listbox/useListbox.js.map +1 -1
  65. package/lib-commonjs/components/Option/useOption.js +13 -23
  66. package/lib-commonjs/components/Option/useOption.js.map +1 -1
  67. package/lib-commonjs/components/Option/useOptionStyles.styles.js +85 -85
  68. package/lib-commonjs/components/Option/useOptionStyles.styles.js.map +1 -1
  69. package/lib-commonjs/contexts/ComboboxContext.js.map +1 -1
  70. package/lib-commonjs/contexts/ListboxContext.js +12 -2
  71. package/lib-commonjs/contexts/ListboxContext.js.map +1 -1
  72. package/lib-commonjs/contexts/useComboboxContextValues.js +23 -5
  73. package/lib-commonjs/contexts/useComboboxContextValues.js.map +1 -1
  74. package/lib-commonjs/contexts/useListboxContextValues.js +19 -9
  75. package/lib-commonjs/contexts/useListboxContextValues.js.map +1 -1
  76. package/lib-commonjs/index.js +4 -0
  77. package/lib-commonjs/index.js.map +1 -1
  78. package/lib-commonjs/utils/dropdownKeyActions.js +3 -30
  79. package/lib-commonjs/utils/dropdownKeyActions.js.map +1 -1
  80. package/lib-commonjs/utils/useComboboxBaseState.js +59 -16
  81. package/lib-commonjs/utils/useComboboxBaseState.js.map +1 -1
  82. package/lib-commonjs/utils/useOptionCollection.js +18 -45
  83. package/lib-commonjs/utils/useOptionCollection.js.map +1 -1
  84. package/lib-commonjs/utils/useTriggerSlot.js +84 -31
  85. package/lib-commonjs/utils/useTriggerSlot.js.map +1 -1
  86. package/package.json +10 -9
  87. package/lib/utils/useScrollOptionsIntoView.js +0 -29
  88. package/lib/utils/useScrollOptionsIntoView.js.map +0 -1
  89. package/lib-commonjs/utils/useScrollOptionsIntoView.js +0 -40
  90. package/lib-commonjs/utils/useScrollOptionsIntoView.js.map +0 -1
@@ -10,11 +10,15 @@ Object.defineProperty(exports, "renderListbox_unstable", {
10
10
  });
11
11
  const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
12
12
  const _reactutilities = require("@fluentui/react-utilities");
13
+ const _reactaria = require("@fluentui/react-aria");
13
14
  const _ListboxContext = require("../../contexts/ListboxContext");
14
15
  const renderListbox_unstable = (state, contextValues)=>{
15
16
  (0, _reactutilities.assertSlots)(state);
16
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_ListboxContext.ListboxContext.Provider, {
17
- value: contextValues.listbox,
18
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {})
17
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactaria.ActiveDescendantContextProvider, {
18
+ value: contextValues.activeDescendant,
19
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ListboxContext.ListboxContext.Provider, {
20
+ value: contextValues.listbox,
21
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {})
22
+ })
19
23
  });
20
24
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["renderListbox.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { ListboxContext } from '../../contexts/ListboxContext';\n/**\n * Render the final JSX of Listbox\n */ export const renderListbox_unstable = (state, contextValues)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsx(ListboxContext.Provider, {\n value: contextValues.listbox,\n children: /*#__PURE__*/ _jsx(state.root, {})\n });\n};\n"],"names":["renderListbox_unstable","state","contextValues","assertSlots","_jsx","ListboxContext","Provider","value","listbox","children","root"],"mappings":";;;;+BAKiBA;;;eAAAA;;;4BALa;gCACF;gCACG;AAGpB,MAAMA,yBAAyB,CAACC,OAAOC;IAC9CC,IAAAA,2BAAW,EAACF;IACZ,OAAO,WAAW,GAAGG,IAAAA,eAAI,EAACC,8BAAc,CAACC,QAAQ,EAAE;QAC/CC,OAAOL,cAAcM,OAAO;QAC5BC,UAAU,WAAW,GAAGL,IAAAA,eAAI,EAACH,MAAMS,IAAI,EAAE,CAAC;IAC9C;AACJ"}
1
+ {"version":3,"sources":["renderListbox.js"],"sourcesContent":[" import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { ActiveDescendantContextProvider } from '@fluentui/react-aria';\nimport { ListboxContext } from '../../contexts/ListboxContext';\n/**\n * Render the final JSX of Listbox\n */ export const renderListbox_unstable = (state, contextValues)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsx(ActiveDescendantContextProvider, {\n value: contextValues.activeDescendant,\n children: /*#__PURE__*/ _jsx(ListboxContext.Provider, {\n value: contextValues.listbox,\n children: /*#__PURE__*/ _jsx(state.root, {})\n })\n });\n};\n"],"names":["renderListbox_unstable","state","contextValues","assertSlots","_jsx","ActiveDescendantContextProvider","value","activeDescendant","children","ListboxContext","Provider","listbox","root"],"mappings":";;;;+BAMiBA;;;eAAAA;;;4BANa;gCACF;2BACoB;gCACjB;AAGpB,MAAMA,yBAAyB,CAACC,OAAOC;IAC9CC,IAAAA,2BAAW,EAACF;IACZ,OAAO,WAAW,GAAGG,IAAAA,eAAI,EAACC,0CAA+B,EAAE;QACvDC,OAAOJ,cAAcK,gBAAgB;QACrCC,UAAU,WAAW,GAAGJ,IAAAA,eAAI,EAACK,8BAAc,CAACC,QAAQ,EAAE;YAClDJ,OAAOJ,cAAcS,OAAO;YAC5BH,UAAU,WAAW,GAAGJ,IAAAA,eAAI,EAACH,MAAMW,IAAI,EAAE,CAAC;QAC9C;IACJ;AACJ"}
@@ -12,65 +12,76 @@ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildc
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
13
  const _reactutilities = require("@fluentui/react-utilities");
14
14
  const _reactcontextselector = require("@fluentui/react-context-selector");
15
+ const _reactaria = require("@fluentui/react-aria");
15
16
  const _dropdownKeyActions = require("../../utils/dropdownKeyActions");
16
17
  const _useOptionCollection = require("../../utils/useOptionCollection");
17
- const _useScrollOptionsIntoView = require("../../utils/useScrollOptionsIntoView");
18
18
  const _useSelection = require("../../utils/useSelection");
19
- const _ComboboxContext = require("../../contexts/ComboboxContext");
19
+ const _useOptionStylesstyles = require("../Option/useOptionStyles.styles");
20
+ const _ListboxContext = require("../../contexts/ListboxContext");
21
+ // eslint-disable-next-line @typescript-eslint/naming-convention
22
+ const UNSAFE_noLongerUsed = {
23
+ activeOption: undefined,
24
+ focusVisible: false,
25
+ setActiveOption: ()=>null
26
+ };
20
27
  const useListbox_unstable = (props, ref)=>{
21
28
  const { multiselect } = props;
22
29
  const optionCollection = (0, _useOptionCollection.useOptionCollection)();
23
- const { getCount, getOptionAtIndex, getIndexOfId } = optionCollection;
30
+ const { getOptionById } = optionCollection;
31
+ const { listboxRef: activeDescendantListboxRef, activeParentRef, controller } = (0, _reactaria.useActiveDescendant)({
32
+ matchOption: (el)=>el.classList.contains(_useOptionStylesstyles.optionClassNames.root)
33
+ });
34
+ const activeDescendantContext = (0, _reactaria.useActiveDescendantContext)();
35
+ const activeDescendantController = (0, _reactaria.useHasParentActiveDescendantContext)() ? activeDescendantContext.controller : controller;
24
36
  const { clearSelection, selectedOptions, selectOption } = (0, _useSelection.useSelection)(props);
25
- const [activeOption, setActiveOption] = _react.useState();
26
- // track whether keyboard focus outline should be shown
27
- // tabster/keyborg doesn't work here, since the actual keyboard focus target doesn't move
28
- const [focusVisible, setFocusVisible] = _react.useState(false);
29
37
  const onKeyDown = (event)=>{
30
38
  const action = (0, _dropdownKeyActions.getDropdownActionFromKey)(event, {
31
39
  open: true
32
40
  });
33
- const maxIndex = getCount() - 1;
34
- const activeIndex = activeOption ? getIndexOfId(activeOption.id) : -1;
35
- let newIndex = activeIndex;
41
+ const activeOptionId = activeDescendantController.active();
42
+ const activeOption = activeOptionId ? getOptionById(activeOptionId) : null;
36
43
  switch(action){
44
+ case 'Next':
45
+ if (activeOption) {
46
+ activeDescendantController.next();
47
+ } else {
48
+ activeDescendantController.first();
49
+ }
50
+ break;
51
+ case 'Previous':
52
+ if (activeOption) {
53
+ activeDescendantController.prev();
54
+ } else {
55
+ activeDescendantController.first();
56
+ }
57
+ break;
58
+ case 'PageUp':
59
+ case 'First':
60
+ activeDescendantController.first();
61
+ break;
62
+ case 'PageDown':
63
+ case 'Last':
64
+ activeDescendantController.last();
65
+ break;
37
66
  case 'Select':
38
67
  case 'CloseSelect':
39
68
  activeOption && selectOption(event, activeOption);
40
69
  break;
41
- default:
42
- newIndex = (0, _dropdownKeyActions.getIndexFromAction)(action, activeIndex, maxIndex);
43
- }
44
- if (newIndex !== activeIndex) {
45
- // prevent default page scroll/keyboard action if the index changed
46
- event.preventDefault();
47
- setActiveOption(getOptionAtIndex(newIndex));
48
- setFocusVisible(true);
49
70
  }
50
71
  };
51
- const onMouseOver = (event)=>{
52
- setFocusVisible(false);
53
- };
54
72
  // get state from parent combobox, if it exists
55
- const hasComboboxContext = (0, _reactcontextselector.useHasParentContext)(_ComboboxContext.ComboboxContext);
56
- const comboboxActiveOption = (0, _reactcontextselector.useContextSelector)(_ComboboxContext.ComboboxContext, (ctx)=>ctx.activeOption);
57
- const comboboxFocusVisible = (0, _reactcontextselector.useContextSelector)(_ComboboxContext.ComboboxContext, (ctx)=>ctx.focusVisible);
58
- const comboboxSelectedOptions = (0, _reactcontextselector.useContextSelector)(_ComboboxContext.ComboboxContext, (ctx)=>ctx.selectedOptions);
59
- const comboboxSelectOption = (0, _reactcontextselector.useContextSelector)(_ComboboxContext.ComboboxContext, (ctx)=>ctx.selectOption);
60
- const comboboxSetActiveOption = (0, _reactcontextselector.useContextSelector)(_ComboboxContext.ComboboxContext, (ctx)=>ctx.setActiveOption);
73
+ const hasListboxContext = (0, _reactcontextselector.useHasParentContext)(_ListboxContext.ListboxContext);
74
+ const contextSelectedOptions = (0, _ListboxContext.useListboxContext_unstable)((ctx)=>ctx.selectedOptions);
75
+ const contextSelectOption = (0, _ListboxContext.useListboxContext_unstable)((ctx)=>ctx.selectOption);
61
76
  // without a parent combobox context, provide values directly from Listbox
62
- const optionContextValues = hasComboboxContext ? {
63
- activeOption: comboboxActiveOption,
64
- focusVisible: comboboxFocusVisible,
65
- selectedOptions: comboboxSelectedOptions,
66
- selectOption: comboboxSelectOption,
67
- setActiveOption: comboboxSetActiveOption
77
+ const optionContextValues = hasListboxContext ? {
78
+ selectedOptions: contextSelectedOptions,
79
+ selectOption: contextSelectOption,
80
+ ...UNSAFE_noLongerUsed
68
81
  } : {
69
- activeOption,
70
- focusVisible,
71
82
  selectedOptions,
72
83
  selectOption,
73
- setActiveOption
84
+ ...UNSAFE_noLongerUsed
74
85
  };
75
86
  const state = {
76
87
  components: {
@@ -80,9 +91,8 @@ const useListbox_unstable = (props, ref)=>{
80
91
  // FIXME:
81
92
  // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
82
93
  // but since it would be a breaking change to fix it, we are casting ref to it's proper type
83
- ref: ref,
94
+ ref: (0, _reactutilities.useMergedRefs)(ref, activeParentRef, activeDescendantListboxRef),
84
95
  role: multiselect ? 'menu' : 'listbox',
85
- 'aria-activedescendant': hasComboboxContext ? undefined : activeOption === null || activeOption === void 0 ? void 0 : activeOption.id,
86
96
  tabIndex: 0,
87
97
  ...props
88
98
  }), {
@@ -90,12 +100,10 @@ const useListbox_unstable = (props, ref)=>{
90
100
  }),
91
101
  multiselect,
92
102
  clearSelection,
103
+ activeDescendantController,
93
104
  ...optionCollection,
94
105
  ...optionContextValues
95
106
  };
96
- const scrollContainerRef = (0, _useScrollOptionsIntoView.useScrollOptionsIntoView)(state);
97
- state.root.ref = (0, _reactutilities.useMergedRefs)(state.root.ref, scrollContainerRef);
98
107
  state.root.onKeyDown = (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(state.root.onKeyDown, onKeyDown));
99
- state.root.onMouseOver = (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(state.root.onMouseOver, onMouseOver));
100
108
  return state;
101
109
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["useListbox.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, mergeCallbacks, useEventCallback, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useContextSelector, useHasParentContext } from '@fluentui/react-context-selector';\nimport { getDropdownActionFromKey, getIndexFromAction } from '../../utils/dropdownKeyActions';\nimport { useOptionCollection } from '../../utils/useOptionCollection';\nimport { useScrollOptionsIntoView } from '../../utils/useScrollOptionsIntoView';\nimport { useSelection } from '../../utils/useSelection';\nimport { ComboboxContext } from '../../contexts/ComboboxContext';\n/**\n * Create the state required to render Listbox.\n *\n * The returned state can be modified with hooks such as useListboxStyles_unstable,\n * before being passed to renderListbox_unstable.\n *\n * @param props - props from this instance of Listbox\n * @param ref - reference to root HTMLElement of Listbox\n */ export const useListbox_unstable = (props, ref)=>{\n const { multiselect } = props;\n const optionCollection = useOptionCollection();\n const { getCount, getOptionAtIndex, getIndexOfId } = optionCollection;\n const { clearSelection, selectedOptions, selectOption } = useSelection(props);\n const [activeOption, setActiveOption] = React.useState();\n // track whether keyboard focus outline should be shown\n // tabster/keyborg doesn't work here, since the actual keyboard focus target doesn't move\n const [focusVisible, setFocusVisible] = React.useState(false);\n const onKeyDown = (event)=>{\n const action = getDropdownActionFromKey(event, {\n open: true\n });\n const maxIndex = getCount() - 1;\n const activeIndex = activeOption ? getIndexOfId(activeOption.id) : -1;\n let newIndex = activeIndex;\n switch(action){\n case 'Select':\n case 'CloseSelect':\n activeOption && selectOption(event, activeOption);\n break;\n default:\n newIndex = getIndexFromAction(action, activeIndex, maxIndex);\n }\n if (newIndex !== activeIndex) {\n // prevent default page scroll/keyboard action if the index changed\n event.preventDefault();\n setActiveOption(getOptionAtIndex(newIndex));\n setFocusVisible(true);\n }\n };\n const onMouseOver = (event)=>{\n setFocusVisible(false);\n };\n // get state from parent combobox, if it exists\n const hasComboboxContext = useHasParentContext(ComboboxContext);\n const comboboxActiveOption = useContextSelector(ComboboxContext, (ctx)=>ctx.activeOption);\n const comboboxFocusVisible = useContextSelector(ComboboxContext, (ctx)=>ctx.focusVisible);\n const comboboxSelectedOptions = useContextSelector(ComboboxContext, (ctx)=>ctx.selectedOptions);\n const comboboxSelectOption = useContextSelector(ComboboxContext, (ctx)=>ctx.selectOption);\n const comboboxSetActiveOption = useContextSelector(ComboboxContext, (ctx)=>ctx.setActiveOption);\n // without a parent combobox context, provide values directly from Listbox\n const optionContextValues = hasComboboxContext ? {\n activeOption: comboboxActiveOption,\n focusVisible: comboboxFocusVisible,\n selectedOptions: comboboxSelectedOptions,\n selectOption: comboboxSelectOption,\n setActiveOption: comboboxSetActiveOption\n } : {\n activeOption,\n focusVisible,\n selectedOptions,\n selectOption,\n setActiveOption\n };\n const state = {\n components: {\n root: 'div'\n },\n root: slot.always(getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref,\n role: multiselect ? 'menu' : 'listbox',\n 'aria-activedescendant': hasComboboxContext ? undefined : activeOption === null || activeOption === void 0 ? void 0 : activeOption.id,\n tabIndex: 0,\n ...props\n }), {\n elementType: 'div'\n }),\n multiselect,\n clearSelection,\n ...optionCollection,\n ...optionContextValues\n };\n const scrollContainerRef = useScrollOptionsIntoView(state);\n state.root.ref = useMergedRefs(state.root.ref, scrollContainerRef);\n state.root.onKeyDown = useEventCallback(mergeCallbacks(state.root.onKeyDown, onKeyDown));\n state.root.onMouseOver = useEventCallback(mergeCallbacks(state.root.onMouseOver, onMouseOver));\n return state;\n};\n"],"names":["useListbox_unstable","props","ref","multiselect","optionCollection","useOptionCollection","getCount","getOptionAtIndex","getIndexOfId","clearSelection","selectedOptions","selectOption","useSelection","activeOption","setActiveOption","React","useState","focusVisible","setFocusVisible","onKeyDown","event","action","getDropdownActionFromKey","open","maxIndex","activeIndex","id","newIndex","getIndexFromAction","preventDefault","onMouseOver","hasComboboxContext","useHasParentContext","ComboboxContext","comboboxActiveOption","useContextSelector","ctx","comboboxFocusVisible","comboboxSelectedOptions","comboboxSelectOption","comboboxSetActiveOption","optionContextValues","state","components","root","slot","always","getIntrinsicElementProps","role","undefined","tabIndex","elementType","scrollContainerRef","use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B,IAAAA,gCAAgB,EAACC,IAAAA,8BAAc,EAACd,MAAME,IAAI,CAACd,WAAW,EAAEA;IACjF,OAAOY;AACX"}
1
+ {"version":3,"sources":["useListbox.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, mergeCallbacks, useEventCallback, slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { useHasParentContext } from '@fluentui/react-context-selector';\nimport { useActiveDescendant, useActiveDescendantContext, useHasParentActiveDescendantContext } from '@fluentui/react-aria';\nimport { getDropdownActionFromKey } from '../../utils/dropdownKeyActions';\nimport { useOptionCollection } from '../../utils/useOptionCollection';\nimport { useSelection } from '../../utils/useSelection';\nimport { optionClassNames } from '../Option/useOptionStyles.styles';\nimport { ListboxContext, useListboxContext_unstable } from '../../contexts/ListboxContext';\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst UNSAFE_noLongerUsed = {\n activeOption: undefined,\n focusVisible: false,\n setActiveOption: ()=>null\n};\n/**\n * Create the state required to render Listbox.\n *\n * The returned state can be modified with hooks such as useListboxStyles_unstable,\n * before being passed to renderListbox_unstable.\n *\n * @param props - props from this instance of Listbox\n * @param ref - reference to root HTMLElement of Listbox\n */ export const useListbox_unstable = (props, ref)=>{\n const { multiselect } = props;\n const optionCollection = useOptionCollection();\n const { getOptionById } = optionCollection;\n const { listboxRef: activeDescendantListboxRef, activeParentRef, controller } = useActiveDescendant({\n matchOption: (el)=>el.classList.contains(optionClassNames.root)\n });\n const activeDescendantContext = useActiveDescendantContext();\n const activeDescendantController = useHasParentActiveDescendantContext() ? activeDescendantContext.controller : controller;\n const { clearSelection, selectedOptions, selectOption } = useSelection(props);\n const onKeyDown = (event)=>{\n const action = getDropdownActionFromKey(event, {\n open: true\n });\n const activeOptionId = activeDescendantController.active();\n const activeOption = activeOptionId ? getOptionById(activeOptionId) : null;\n switch(action){\n case 'Next':\n if (activeOption) {\n activeDescendantController.next();\n } else {\n activeDescendantController.first();\n }\n break;\n case 'Previous':\n if (activeOption) {\n activeDescendantController.prev();\n } else {\n activeDescendantController.first();\n }\n break;\n case 'PageUp':\n case 'First':\n activeDescendantController.first();\n break;\n case 'PageDown':\n case 'Last':\n activeDescendantController.last();\n break;\n case 'Select':\n case 'CloseSelect':\n activeOption && selectOption(event, activeOption);\n break;\n }\n };\n // get state from parent combobox, if it exists\n const hasListboxContext = useHasParentContext(ListboxContext);\n const contextSelectedOptions = useListboxContext_unstable((ctx)=>ctx.selectedOptions);\n const contextSelectOption = useListboxContext_unstable((ctx)=>ctx.selectOption);\n // without a parent combobox context, provide values directly from Listbox\n const optionContextValues = hasListboxContext ? {\n selectedOptions: contextSelectedOptions,\n selectOption: contextSelectOption,\n ...UNSAFE_noLongerUsed\n } : {\n selectedOptions,\n selectOption,\n ...UNSAFE_noLongerUsed\n };\n const state = {\n components: {\n root: 'div'\n },\n root: slot.always(getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, activeParentRef, activeDescendantListboxRef),\n role: multiselect ? 'menu' : 'listbox',\n tabIndex: 0,\n ...props\n }), {\n elementType: 'div'\n }),\n multiselect,\n clearSelection,\n activeDescendantController,\n ...optionCollection,\n ...optionContextValues\n };\n state.root.onKeyDown = useEventCallback(mergeCallbacks(state.root.onKeyDown, onKeyDown));\n return state;\n};\n"],"names":["useListbox_unstable","UNSAFE_noLongerUsed","activeOption","undefined","focusVisible","setActiveOption","props","ref","multiselect","optionCollection","useOptionCollection","getOptionById","listboxRef","activeDescendantListboxRef","activeParentRef","controller","useActiveDescendant","matchOption","el","classList","contains","optionClassNames","root","activeDescendantContext","useActiveDescendantContext","activeDescendantController","useHasParentActiveDescendantContext","clearSelection","selectedOptions","selectOption","useSelection","onKeyDown","event","action","getDropdownActionFromKey","open","activeOptionId","active","next","first","prev","last","hasListboxContext","useHasParentContext","ListboxContext","contextSelectedOptions","useListboxContext_unstable","ctx","contextSelectOption","optionContextValues","state","components","slot","always","getIntrinsicElementProps","useMergedRefs","role","tabIndex","elementType","useEventCallback","mergeCallbacks"],"mappings":";;;;+BAuBiBA;;;eAAAA;;;;iEAvBM;gCACyE;sCAC5D;2BACiE;oCAC5D;qCACL;8BACP;uCACI;gCAC0B;AAC3D,gEAAgE;AAChE,MAAMC,sBAAsB;IACxBC,cAAcC;IACdC,cAAc;IACdC,iBAAiB,IAAI;AACzB;AASW,MAAML,sBAAsB,CAACM,OAAOC;IAC3C,MAAM,EAAEC,WAAW,EAAE,GAAGF;IACxB,MAAMG,mBAAmBC,IAAAA,wCAAmB;IAC5C,MAAM,EAAEC,aAAa,EAAE,GAAGF;IAC1B,MAAM,EAAEG,YAAYC,0BAA0B,EAAEC,eAAe,EAAEC,UAAU,EAAE,GAAGC,IAAAA,8BAAmB,EAAC;QAChGC,aAAa,CAACC,KAAKA,GAAGC,SAAS,CAACC,QAAQ,CAACC,uCAAgB,CAACC,IAAI;IAClE;IACA,MAAMC,0BAA0BC,IAAAA,qCAA0B;IAC1D,MAAMC,6BAA6BC,IAAAA,8CAAmC,MAAKH,wBAAwBR,UAAU,GAAGA;IAChH,MAAM,EAAEY,cAAc,EAAEC,eAAe,EAAEC,YAAY,EAAE,GAAGC,IAAAA,0BAAY,EAACxB;IACvE,MAAMyB,YAAY,CAACC;QACf,MAAMC,SAASC,IAAAA,4CAAwB,EAACF,OAAO;YAC3CG,MAAM;QACV;QACA,MAAMC,iBAAiBX,2BAA2BY,MAAM;QACxD,MAAMnC,eAAekC,iBAAiBzB,cAAcyB,kBAAkB;QACtE,OAAOH;YACH,KAAK;gBACD,IAAI/B,cAAc;oBACduB,2BAA2Ba,IAAI;gBACnC,OAAO;oBACHb,2BAA2Bc,KAAK;gBACpC;gBACA;YACJ,KAAK;gBACD,IAAIrC,cAAc;oBACduB,2BAA2Be,IAAI;gBACnC,OAAO;oBACHf,2BAA2Bc,KAAK;gBACpC;gBACA;YACJ,KAAK;YACL,KAAK;gBACDd,2BAA2Bc,KAAK;gBAChC;YACJ,KAAK;YACL,KAAK;gBACDd,2BAA2BgB,IAAI;gBAC/B;YACJ,KAAK;YACL,KAAK;gBACDvC,gBAAgB2B,aAAaG,OAAO9B;gBACpC;QACR;IACJ;IACA,+CAA+C;IAC/C,MAAMwC,oBAAoBC,IAAAA,yCAAmB,EAACC,8BAAc;IAC5D,MAAMC,yBAAyBC,IAAAA,0CAA0B,EAAC,CAACC,MAAMA,IAAInB,eAAe;IACpF,MAAMoB,sBAAsBF,IAAAA,0CAA0B,EAAC,CAACC,MAAMA,IAAIlB,YAAY;IAC9E,0EAA0E;IAC1E,MAAMoB,sBAAsBP,oBAAoB;QAC5Cd,iBAAiBiB;QACjBhB,cAAcmB;QACd,GAAG/C,mBAAmB;IAC1B,IAAI;QACA2B;QACAC;QACA,GAAG5B,mBAAmB;IAC1B;IACA,MAAMiD,QAAQ;QACVC,YAAY;YACR7B,MAAM;QACV;QACAA,MAAM8B,oBAAI,CAACC,MAAM,CAACC,IAAAA,wCAAwB,EAAC,OAAO;YAC9C,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5F/C,KAAKgD,IAAAA,6BAAa,EAAChD,KAAKO,iBAAiBD;YACzC2C,MAAMhD,cAAc,SAAS;YAC7BiD,UAAU;YACV,GAAGnD,KAAK;QACZ,IAAI;YACAoD,aAAa;QACjB;QACAlD;QACAmB;QACAF;QACA,GAAGhB,gBAAgB;QACnB,GAAGwC,mBAAmB;IAC1B;IACAC,MAAM5B,IAAI,CAACS,SAAS,GAAG4B,IAAAA,gCAAgB,EAACC,IAAAA,8BAAc,EAACV,MAAM5B,IAAI,CAACS,SAAS,EAAEA;IAC7E,OAAOmB;AACX"}
@@ -11,9 +11,8 @@ Object.defineProperty(exports, "useOption_unstable", {
11
11
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
13
  const _reactutilities = require("@fluentui/react-utilities");
14
- const _reactcontextselector = require("@fluentui/react-context-selector");
14
+ const _reactaria = require("@fluentui/react-aria");
15
15
  const _reacticons = require("@fluentui/react-icons");
16
- const _ComboboxContext = require("../../contexts/ComboboxContext");
17
16
  const _ListboxContext = require("../../contexts/ListboxContext");
18
17
  function getTextString(text, children) {
19
18
  if (text !== undefined) {
@@ -55,21 +54,15 @@ const useOption_unstable = (props, ref)=>{
55
54
  optionValue
56
55
  ]);
57
56
  // context values
58
- const focusVisible = (0, _reactcontextselector.useContextSelector)(_ListboxContext.ListboxContext, (ctx)=>ctx.focusVisible);
59
- const multiselect = (0, _reactcontextselector.useContextSelector)(_ListboxContext.ListboxContext, (ctx)=>ctx.multiselect);
60
- const registerOption = (0, _reactcontextselector.useContextSelector)(_ListboxContext.ListboxContext, (ctx)=>ctx.registerOption);
61
- const selected = (0, _reactcontextselector.useContextSelector)(_ListboxContext.ListboxContext, (ctx)=>{
57
+ const { controller: activeDescendantController } = (0, _reactaria.useActiveDescendantContext)();
58
+ const multiselect = (0, _ListboxContext.useListboxContext_unstable)((ctx)=>ctx.multiselect);
59
+ const registerOption = (0, _ListboxContext.useListboxContext_unstable)((ctx)=>ctx.registerOption);
60
+ const selected = (0, _ListboxContext.useListboxContext_unstable)((ctx)=>{
62
61
  const selectedOptions = ctx.selectedOptions;
63
62
  return !!optionValue && !!selectedOptions.find((o)=>o === optionValue);
64
63
  });
65
- const selectOption = (0, _reactcontextselector.useContextSelector)(_ListboxContext.ListboxContext, (ctx)=>ctx.selectOption);
66
- const setActiveOption = (0, _reactcontextselector.useContextSelector)(_ListboxContext.ListboxContext, (ctx)=>ctx.setActiveOption);
67
- const setOpen = (0, _reactcontextselector.useContextSelector)(_ComboboxContext.ComboboxContext, (ctx)=>ctx.setOpen);
68
- // current active option?
69
- const active = (0, _reactcontextselector.useContextSelector)(_ListboxContext.ListboxContext, (ctx)=>{
70
- var _ctx_activeOption, _ctx_activeOption1;
71
- return ((_ctx_activeOption = ctx.activeOption) === null || _ctx_activeOption === void 0 ? void 0 : _ctx_activeOption.id) !== undefined && ((_ctx_activeOption1 = ctx.activeOption) === null || _ctx_activeOption1 === void 0 ? void 0 : _ctx_activeOption1.id) === id;
72
- });
64
+ const selectOption = (0, _ListboxContext.useListboxContext_unstable)((ctx)=>ctx.selectOption);
65
+ const onOptionClick = (0, _ListboxContext.useListboxContext_unstable)((ctx)=>ctx.onOptionClick);
73
66
  // check icon
74
67
  let CheckIcon = /*#__PURE__*/ _react.createElement(_reacticons.CheckmarkFilled, null);
75
68
  if (multiselect) {
@@ -81,14 +74,10 @@ const useOption_unstable = (props, ref)=>{
81
74
  event.preventDefault();
82
75
  return;
83
76
  }
84
- // clicked option should always become active option
85
- setActiveOption(optionData);
86
- // close on option click for single-select options in a combobox
87
- if (!multiselect) {
88
- setOpen === null || setOpen === void 0 ? void 0 : setOpen(event, false);
89
- }
77
+ activeDescendantController.focus(id);
90
78
  // handle selection change
91
79
  selectOption(event, optionData);
80
+ onOptionClick(event);
92
81
  (_props_onClick = props.onClick) === null || _props_onClick === void 0 ? void 0 : _props_onClick.call(props, event);
93
82
  };
94
83
  // register option data with context
@@ -134,10 +123,11 @@ const useOption_unstable = (props, ref)=>{
134
123
  },
135
124
  elementType: 'span'
136
125
  }),
137
- active,
138
126
  disabled,
139
- focusVisible,
140
127
  multiselect,
141
- selected
128
+ selected,
129
+ // no longer used
130
+ focusVisible: false,
131
+ active: false
142
132
  };
143
133
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["useOption.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, useId, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useContextSelector } from '@fluentui/react-context-selector';\nimport { CheckmarkFilled, Checkmark12Filled } from '@fluentui/react-icons';\nimport { ComboboxContext } from '../../contexts/ComboboxContext';\nimport { ListboxContext } from '../../contexts/ListboxContext';\nfunction getTextString(text, children) {\n if (text !== undefined) {\n return text;\n }\n let textString = '';\n let hasNonStringChild = false;\n React.Children.forEach(children, (child)=>{\n if (typeof child === 'string') {\n textString += child;\n } else {\n hasNonStringChild = true;\n }\n });\n // warn if an Option has non-string children and no text prop\n if (hasNonStringChild) {\n // eslint-disable-next-line no-console\n console.warn('Provide a `text` prop to Option components when they contain non-string children.');\n }\n return textString;\n}\n/**\n * Create the state required to render Option.\n *\n * The returned state can be modified with hooks such as useOptionStyles_unstable,\n * before being passed to renderOption_unstable.\n *\n * @param props - props from this instance of Option\n * @param ref - reference to root HTMLElement of Option\n */ export const useOption_unstable = (props, ref)=>{\n const { children, disabled, text, value } = props;\n const optionRef = React.useRef(null);\n const optionText = getTextString(text, children);\n const optionValue = value !== null && value !== void 0 ? value : optionText;\n // use the id if provided, otherwise use a generated id\n const id = useId('fluent-option', props.id);\n // data used for context registration & events\n const optionData = React.useMemo(()=>({\n id,\n disabled,\n text: optionText,\n value: optionValue\n }), [\n id,\n disabled,\n optionText,\n optionValue\n ]);\n // context values\n const focusVisible = useContextSelector(ListboxContext, (ctx)=>ctx.focusVisible);\n const multiselect = useContextSelector(ListboxContext, (ctx)=>ctx.multiselect);\n const registerOption = useContextSelector(ListboxContext, (ctx)=>ctx.registerOption);\n const selected = useContextSelector(ListboxContext, (ctx)=>{\n const selectedOptions = ctx.selectedOptions;\n return !!optionValue && !!selectedOptions.find((o)=>o === optionValue);\n });\n const selectOption = useContextSelector(ListboxContext, (ctx)=>ctx.selectOption);\n const setActiveOption = useContextSelector(ListboxContext, (ctx)=>ctx.setActiveOption);\n const setOpen = useContextSelector(ComboboxContext, (ctx)=>ctx.setOpen);\n // current active option?\n const active = useContextSelector(ListboxContext, (ctx)=>{\n var _ctx_activeOption, _ctx_activeOption1;\n return ((_ctx_activeOption = ctx.activeOption) === null || _ctx_activeOption === void 0 ? void 0 : _ctx_activeOption.id) !== undefined && ((_ctx_activeOption1 = ctx.activeOption) === null || _ctx_activeOption1 === void 0 ? void 0 : _ctx_activeOption1.id) === id;\n });\n // check icon\n let CheckIcon = /*#__PURE__*/ React.createElement(CheckmarkFilled, null);\n if (multiselect) {\n CheckIcon = selected ? /*#__PURE__*/ React.createElement(Checkmark12Filled, null) : '';\n }\n const onClick = (event)=>{\n var _props_onClick;\n if (disabled) {\n event.preventDefault();\n return;\n }\n // clicked option should always become active option\n setActiveOption(optionData);\n // close on option click for single-select options in a combobox\n if (!multiselect) {\n setOpen === null || setOpen === void 0 ? void 0 : setOpen(event, false);\n }\n // handle selection change\n selectOption(event, optionData);\n (_props_onClick = props.onClick) === null || _props_onClick === void 0 ? void 0 : _props_onClick.call(props, event);\n };\n // register option data with context\n React.useEffect(()=>{\n if (id && optionRef.current) {\n return registerOption(optionData, optionRef.current);\n }\n }, [\n id,\n optionData,\n registerOption\n ]);\n const semanticProps = multiselect ? {\n role: 'menuitemcheckbox',\n 'aria-checked': selected\n } : {\n role: 'option',\n 'aria-selected': selected\n };\n return {\n components: {\n root: 'div',\n checkIcon: 'span'\n },\n root: slot.always(getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, optionRef),\n 'aria-disabled': disabled ? 'true' : undefined,\n id,\n ...semanticProps,\n ...props,\n onClick\n }), {\n elementType: 'div'\n }),\n checkIcon: slot.optional(props.checkIcon, {\n renderByDefault: true,\n defaultProps: {\n 'aria-hidden': 'true',\n children: CheckIcon\n },\n elementType: 'span'\n }),\n active,\n disabled,\n focusVisible,\n multiselect,\n selected\n };\n};\n"],"names":["useOption_unstable","getTextString","text","children","undefined","textString","hasNonStringChild","React","Children","forEach","child","console","warn","props","ref","disabled","value","optionRef","useRef","optionText","optionValue","id","useId","optionData","useMemo","focusVisible","useContextSelector","ListboxContext","ctx","multiselect","registerOption","selected","selectedOptions","find","o","selectOption","setActiveOption","setOpen","ComboboxContext","active","_ctx_activeOption","_ctx_activeOption1","activeOption","CheckIcon","createElement","CheckmarkFilled","Checkmark12Filled","onClick","event","_props_onClick","preventDefault","call","useEffect","current","semanticProps","role","components","root","checkIcon","slot","always","getIntrinsicElementProps","useMergedRefs","elementType","optional","renderByDefault","defaultProps"],"mappings":";;;;+BAkCiBA;;;eAAAA;;;;iEAlCM;gCAC8C;sCAClC;4BACgB;iCACnB;gCACD;AAC/B,SAASC,cAAcC,IAAI,EAAEC,QAAQ;IACjC,IAAID,SAASE,WAAW;QACpB,OAAOF;IACX;IACA,IAAIG,aAAa;IACjB,IAAIC,oBAAoB;IACxBC,OAAMC,QAAQ,CAACC,OAAO,CAACN,UAAU,CAACO;QAC9B,IAAI,OAAOA,UAAU,UAAU;YAC3BL,cAAcK;QAClB,OAAO;YACHJ,oBAAoB;QACxB;IACJ;IACA,6DAA6D;IAC7D,IAAIA,mBAAmB;QACnB,sCAAsC;QACtCK,QAAQC,IAAI,CAAC;IACjB;IACA,OAAOP;AACX;AASW,MAAML,qBAAqB,CAACa,OAAOC;IAC1C,MAAM,EAAEX,QAAQ,EAAEY,QAAQ,EAAEb,IAAI,EAAEc,KAAK,EAAE,GAAGH;IAC5C,MAAMI,YAAYV,OAAMW,MAAM,CAAC;IAC/B,MAAMC,aAAalB,cAAcC,MAAMC;IACvC,MAAMiB,cAAcJ,UAAU,QAAQA,UAAU,KAAK,IAAIA,QAAQG;IACjE,uDAAuD;IACvD,MAAME,KAAKC,IAAAA,qBAAK,EAAC,iBAAiBT,MAAMQ,EAAE;IAC1C,8CAA8C;IAC9C,MAAME,aAAahB,OAAMiB,OAAO,CAAC,IAAK,CAAA;YAC9BH;YACAN;YACAb,MAAMiB;YACNH,OAAOI;QACX,CAAA,GAAI;QACJC;QACAN;QACAI;QACAC;KACH;IACD,iBAAiB;IACjB,MAAMK,eAAeC,IAAAA,wCAAkB,EAACC,8BAAc,EAAE,CAACC,MAAMA,IAAIH,YAAY;IAC/E,MAAMI,cAAcH,IAAAA,wCAAkB,EAACC,8BAAc,EAAE,CAACC,MAAMA,IAAIC,WAAW;IAC7E,MAAMC,iBAA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;YACdQ,YAAY,QAAQA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQW,OAAO;QACrE;QACA,0BAA0B;QAC1Bb,aAAaa,OAAOzB;QACnB0B,CAAAA,iBAAiBpC,MAAMkC,OAAO,AAAD,MAAO,QAAQE,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeE,IAAI,CAACtC,OAAOmC;IACjH;IACA,oCAAoC;IACpCzC,OAAM6C,SAAS,CAAC;QACZ,IAAI/B,MAAMJ,UAAUoC,OAAO,EAAE;YACzB,OAAOvB,eAAeP,YAAYN,UAAUoC,OAAO;QACvD;IACJ,GAAG;QACChC;QACAE;QACAO;KACH;IACD,MAAMwB,gBAAgBzB,cAAc;QAChC0B,MAAM;QACN,gBAAgBxB;IACpB,IAAI;QACAwB,MAAM;QACN,iBAAiBxB;IACrB;IACA,OAAO;QACHyB,YAAY;YACRC,MAAM;YACNC,WAAW;QACf;QACAD,MAAME,oBAAI,CAACC,MAAM,CAACC,IAAAA,wCAAwB,EAAC,OAAO;YAC9C,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5F/C,KAAKgD,IAAAA,6BAAa,EAAChD,KAAKG;YACxB,iBAAiBF,WAAW,SAASX;YACrCiB;YACA,GAAGiC,aAAa;YAChB,GAAGzC,KAAK;YACRkC;QACJ,IAAI;YACAgB,aAAa;QACjB;QACAL,WAAWC,oBAAI,CAACK,QAAQ,CAACnD,MAAM6C,SAAS,EAAE;YACtCO,iBAAiB;YACjBC,cAAc;gBACV,eAAe;gBACf/D,UAAUwC;YACd;YACAoB,aAAa;QACjB;QACAxB;QACAxB;QACAU;QACAI;QACAE;IACJ;AACJ"}
1
+ {"version":3,"sources":["useOption.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, useId, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useActiveDescendantContext } from '@fluentui/react-aria';\nimport { CheckmarkFilled, Checkmark12Filled } from '@fluentui/react-icons';\nimport { useListboxContext_unstable } from '../../contexts/ListboxContext';\nfunction getTextString(text, children) {\n if (text !== undefined) {\n return text;\n }\n let textString = '';\n let hasNonStringChild = false;\n React.Children.forEach(children, (child)=>{\n if (typeof child === 'string') {\n textString += child;\n } else {\n hasNonStringChild = true;\n }\n });\n // warn if an Option has non-string children and no text prop\n if (hasNonStringChild) {\n // eslint-disable-next-line no-console\n console.warn('Provide a `text` prop to Option components when they contain non-string children.');\n }\n return textString;\n}\n/**\n * Create the state required to render Option.\n *\n * The returned state can be modified with hooks such as useOptionStyles_unstable,\n * before being passed to renderOption_unstable.\n *\n * @param props - props from this instance of Option\n * @param ref - reference to root HTMLElement of Option\n */ export const useOption_unstable = (props, ref)=>{\n const { children, disabled, text, value } = props;\n const optionRef = React.useRef(null);\n const optionText = getTextString(text, children);\n const optionValue = value !== null && value !== void 0 ? value : optionText;\n // use the id if provided, otherwise use a generated id\n const id = useId('fluent-option', props.id);\n // data used for context registration & events\n const optionData = React.useMemo(()=>({\n id,\n disabled,\n text: optionText,\n value: optionValue\n }), [\n id,\n disabled,\n optionText,\n optionValue\n ]);\n // context values\n const { controller: activeDescendantController } = useActiveDescendantContext();\n const multiselect = useListboxContext_unstable((ctx)=>ctx.multiselect);\n const registerOption = useListboxContext_unstable((ctx)=>ctx.registerOption);\n const selected = useListboxContext_unstable((ctx)=>{\n const selectedOptions = ctx.selectedOptions;\n return !!optionValue && !!selectedOptions.find((o)=>o === optionValue);\n });\n const selectOption = useListboxContext_unstable((ctx)=>ctx.selectOption);\n const onOptionClick = useListboxContext_unstable((ctx)=>ctx.onOptionClick);\n // check icon\n let CheckIcon = /*#__PURE__*/ React.createElement(CheckmarkFilled, null);\n if (multiselect) {\n CheckIcon = selected ? /*#__PURE__*/ React.createElement(Checkmark12Filled, null) : '';\n }\n const onClick = (event)=>{\n var _props_onClick;\n if (disabled) {\n event.preventDefault();\n return;\n }\n activeDescendantController.focus(id);\n // handle selection change\n selectOption(event, optionData);\n onOptionClick(event);\n (_props_onClick = props.onClick) === null || _props_onClick === void 0 ? void 0 : _props_onClick.call(props, event);\n };\n // register option data with context\n React.useEffect(()=>{\n if (id && optionRef.current) {\n return registerOption(optionData, optionRef.current);\n }\n }, [\n id,\n optionData,\n registerOption\n ]);\n const semanticProps = multiselect ? {\n role: 'menuitemcheckbox',\n 'aria-checked': selected\n } : {\n role: 'option',\n 'aria-selected': selected\n };\n return {\n components: {\n root: 'div',\n checkIcon: 'span'\n },\n root: slot.always(getIntrinsicElementProps('div', {\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, optionRef),\n 'aria-disabled': disabled ? 'true' : undefined,\n id,\n ...semanticProps,\n ...props,\n onClick\n }), {\n elementType: 'div'\n }),\n checkIcon: slot.optional(props.checkIcon, {\n renderByDefault: true,\n defaultProps: {\n 'aria-hidden': 'true',\n children: CheckIcon\n },\n elementType: 'span'\n }),\n disabled,\n multiselect,\n selected,\n // no longer used\n focusVisible: false,\n active: false\n };\n};\n"],"names":["useOption_unstable","getTextString","text","children","undefined","textString","hasNonStringChild","React","Children","forEach","child","console","warn","props","ref","disabled","value","optionRef","useRef","optionText","optionValue","id","useId","optionData","useMemo","controller","activeDescendantController","useActiveDescendantContext","multiselect","useListboxContext_unstable","ctx","registerOption","selected","selectedOptions","find","o","selectOption","onOptionClick","CheckIcon","createElement","CheckmarkFilled","Checkmark12Filled","onClick","event","_props_onClick","preventDefault","focus","call","useEffect","current","semanticProps","role","components","root","checkIcon","slot","always","getIntrinsicElementProps","useMergedRefs","elementType","optional","renderByDefault","defaultProps","focusVisible","active"],"mappings":";;;;+BAiCiBA;;;eAAAA;;;;iEAjCM;gCAC8C;2BAC1B;4BACQ;gCACR;AAC3C,SAASC,cAAcC,IAAI,EAAEC,QAAQ;IACjC,IAAID,SAASE,WAAW;QACpB,OAAOF;IACX;IACA,IAAIG,aAAa;IACjB,IAAIC,oBAAoB;IACxBC,OAAMC,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Aa;QACjB;QACA5C;QACAa;QACAI;QACA,iBAAiB;QACjB+B,cAAc;QACdC,QAAQ;IACZ;AACJ"}
@@ -86,65 +86,65 @@ const optionClassNames = {
86
86
  ]
87
87
  },
88
88
  active: {
89
- Bsft5z2: "f13zj6fq",
90
- E3zdtr: "f1mdlcz9",
91
- B80jsxd: "f1nwj1ja",
92
- t2ki1e: "ffmd2fr",
93
- Bm2nyyq: "f8rth92",
94
- Barhvk9: [
95
- "flthirb",
96
- "ftkbnf5"
97
- ],
98
- Bw17bha: "f1lh990p",
99
- vfts7: [
100
- "ftkbnf5",
101
- "flthirb"
102
- ],
103
- xrcqlc: "fc9v8v1",
104
- Ihftqj: [
105
- "f1mwfetb",
106
- "f18mat8f"
107
- ],
108
- Bcgy8vk: "f1cb6c3",
109
- Bhxzhr1: [
110
- "f18mat8f",
111
- "f1mwfetb"
112
- ],
113
- B3778ie: [
114
- "f1ibwz09",
115
- "f1kp91vd"
116
- ],
117
- d9w3h3: [
118
- "f1kp91vd",
119
- "f1ibwz09"
120
- ],
121
- Bl18szs: [
122
- "f1pix4dl",
123
- "f13nd1z4"
124
- ],
125
- B4j8arr: [
126
- "f13nd1z4",
127
- "f1pix4dl"
128
- ],
129
- B0n5ga8: "f1qw5sz7",
130
- s924m2: [
131
- "f19va7ni",
132
- "f1a9v3mw"
133
- ],
134
- B1q35kw: "fkkziue",
135
- Gp14am: [
136
- "f1a9v3mw",
137
- "f19va7ni"
138
- ],
139
- bn5sak: "f1a97anr",
140
- By385i5: "f5226zp",
141
- Eqx8gd: [
142
- "fa2bdqt",
143
- "fei6g0k"
144
- ],
145
- B1piin3: [
146
- "fei6g0k",
147
- "fa2bdqt"
89
+ Bowz1zl: "f11vrvdw",
90
+ oxogb1: "f17hxjb7",
91
+ Ix2sn8: "f1dha69c",
92
+ q7v32p: "f1lm7500",
93
+ Btq9bd3: "fuyp35s",
94
+ Bertapg: [
95
+ "f1a9nstl",
96
+ "fhk0hgg"
97
+ ],
98
+ b50fsz: "f1rdp6f1",
99
+ avt0cx: [
100
+ "fhk0hgg",
101
+ "f1a9nstl"
102
+ ],
103
+ Bqfxd14: "f1tj24la",
104
+ B53xpsf: [
105
+ "f1td3xda",
106
+ "f73totv"
107
+ ],
108
+ B1wzb3v: "f2ge7d1",
109
+ f0sref: [
110
+ "f73totv",
111
+ "f1td3xda"
112
+ ],
113
+ Bttcd12: [
114
+ "ftb4b3e",
115
+ "f1scq65d"
116
+ ],
117
+ Fffuxt: [
118
+ "f1scq65d",
119
+ "ftb4b3e"
120
+ ],
121
+ Bqougee: [
122
+ "f2me9eq",
123
+ "fgk4qqi"
124
+ ],
125
+ Beitzug: [
126
+ "fgk4qqi",
127
+ "f2me9eq"
128
+ ],
129
+ B39dzdd: "ffd7rjx",
130
+ Be3o27t: [
131
+ "fobu5kn",
132
+ "f1dbet5w"
133
+ ],
134
+ Bewtojm: "f1ap9jj5",
135
+ B37u8z8: [
136
+ "f1dbet5w",
137
+ "fobu5kn"
138
+ ],
139
+ Bhijsxg: "fwq15dy",
140
+ kktds4: "f1pb3wry",
141
+ Bmau3bo: [
142
+ "ftjv2f4",
143
+ "f1flhb1f"
144
+ ],
145
+ npektv: [
146
+ "f1flhb1f",
147
+ "ftjv2f4"
148
148
  ]
149
149
  },
150
150
  disabled: {
@@ -298,30 +298,30 @@ const optionClassNames = {
298
298
  ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}",
299
299
  ".f1tdddsa{padding-bottom:var(--spacingVerticalSNudge);}",
300
300
  ".f10pi13n{position:relative;}",
301
- ".f13zj6fq::after{content:\"\";}",
302
- ".f1mdlcz9::after{position:absolute;}",
303
- ".f1nwj1ja::after{pointer-events:none;}",
304
- ".ffmd2fr::after{z-index:1;}",
305
- ".f8rth92::after{border-top-style:solid;}",
306
- ".flthirb::after{border-right-style:solid;}",
307
- ".ftkbnf5::after{border-left-style:solid;}",
308
- ".f1lh990p::after{border-bottom-style:solid;}",
309
- ".fc9v8v1::after{border-top-width:2px;}",
310
- ".f1mwfetb::after{border-right-width:2px;}",
311
- ".f18mat8f::after{border-left-width:2px;}",
312
- ".f1cb6c3::after{border-bottom-width:2px;}",
313
- ".f1ibwz09::after{border-bottom-right-radius:var(--borderRadiusMedium);}",
314
- ".f1kp91vd::after{border-bottom-left-radius:var(--borderRadiusMedium);}",
315
- ".f1pix4dl::after{border-top-right-radius:var(--borderRadiusMedium);}",
316
- ".f13nd1z4::after{border-top-left-radius:var(--borderRadiusMedium);}",
317
- ".f1qw5sz7::after{border-top-color:var(--colorStrokeFocus2);}",
318
- ".f19va7ni::after{border-right-color:var(--colorStrokeFocus2);}",
319
- ".f1a9v3mw::after{border-left-color:var(--colorStrokeFocus2);}",
320
- ".fkkziue::after{border-bottom-color:var(--colorStrokeFocus2);}",
321
- ".f1a97anr::after{top:-2px;}",
322
- ".f5226zp::after{bottom:-2px;}",
323
- ".fa2bdqt::after{left:-2px;}",
324
- ".fei6g0k::after{right:-2px;}",
301
+ ".f11vrvdw[data-activedescendant-focusvisible]::after{content:\"\";}",
302
+ ".f17hxjb7[data-activedescendant-focusvisible]::after{position:absolute;}",
303
+ ".f1dha69c[data-activedescendant-focusvisible]::after{pointer-events:none;}",
304
+ ".f1lm7500[data-activedescendant-focusvisible]::after{z-index:1;}",
305
+ ".fuyp35s[data-activedescendant-focusvisible]::after{border-top-style:solid;}",
306
+ ".f1a9nstl[data-activedescendant-focusvisible]::after{border-right-style:solid;}",
307
+ ".fhk0hgg[data-activedescendant-focusvisible]::after{border-left-style:solid;}",
308
+ ".f1rdp6f1[data-activedescendant-focusvisible]::after{border-bottom-style:solid;}",
309
+ ".f1tj24la[data-activedescendant-focusvisible]::after{border-top-width:2px;}",
310
+ ".f1td3xda[data-activedescendant-focusvisible]::after{border-right-width:2px;}",
311
+ ".f73totv[data-activedescendant-focusvisible]::after{border-left-width:2px;}",
312
+ ".f2ge7d1[data-activedescendant-focusvisible]::after{border-bottom-width:2px;}",
313
+ ".ftb4b3e[data-activedescendant-focusvisible]::after{border-bottom-right-radius:var(--borderRadiusMedium);}",
314
+ ".f1scq65d[data-activedescendant-focusvisible]::after{border-bottom-left-radius:var(--borderRadiusMedium);}",
315
+ ".f2me9eq[data-activedescendant-focusvisible]::after{border-top-right-radius:var(--borderRadiusMedium);}",
316
+ ".fgk4qqi[data-activedescendant-focusvisible]::after{border-top-left-radius:var(--borderRadiusMedium);}",
317
+ ".ffd7rjx[data-activedescendant-focusvisible]::after{border-top-color:var(--colorStrokeFocus2);}",
318
+ ".fobu5kn[data-activedescendant-focusvisible]::after{border-right-color:var(--colorStrokeFocus2);}",
319
+ ".f1dbet5w[data-activedescendant-focusvisible]::after{border-left-color:var(--colorStrokeFocus2);}",
320
+ ".f1ap9jj5[data-activedescendant-focusvisible]::after{border-bottom-color:var(--colorStrokeFocus2);}",
321
+ ".fwq15dy[data-activedescendant-focusvisible]::after{top:-2px;}",
322
+ ".f1pb3wry[data-activedescendant-focusvisible]::after{bottom:-2px;}",
323
+ ".ftjv2f4[data-activedescendant-focusvisible]::after{left:-2px;}",
324
+ ".f1flhb1f[data-activedescendant-focusvisible]::after{right:-2px;}",
325
325
  ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}",
326
326
  ".fod5ikn{font-size:var(--fontSizeBase400);}",
327
327
  ".f18b9hdq{margin-left:calc(var(--spacingHorizontalXXS) * -1);}",
@@ -402,9 +402,9 @@ const optionClassNames = {
402
402
  ]
403
403
  });
404
404
  const useOptionStyles_unstable = (state)=>{
405
- const { active, disabled, focusVisible, multiselect, selected } = state;
405
+ const { disabled, multiselect, selected } = state;
406
406
  const styles = useStyles();
407
- state.root.className = (0, _react.mergeClasses)(optionClassNames.root, styles.root, active && focusVisible && styles.active, disabled && styles.disabled, selected && styles.selected, state.root.className);
407
+ state.root.className = (0, _react.mergeClasses)(optionClassNames.root, styles.root, styles.active, disabled && styles.disabled, selected && styles.selected, state.root.className);
408
408
  if (state.checkIcon) {
409
409
  state.checkIcon.className = (0, _react.mergeClasses)(optionClassNames.checkIcon, styles.checkIcon, multiselect && styles.multiselectCheck, selected && styles.selectedCheck, selected && multiselect && styles.selectedMultiselectCheck, disabled && styles.checkDisabled, disabled && multiselect && styles.multiselectCheckDisabled, state.checkIcon.className);
410
410
  }