@fluentui/react-tabster 9.22.9 → 9.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/CHANGELOG.md +30 -2
  2. package/dist/index.d.ts +7 -2
  3. package/lib/focus/constants.js.map +1 -1
  4. package/lib/focus/createCustomFocusIndicatorStyle.js.map +1 -1
  5. package/lib/focus/createFocusOutlineStyle.js.map +1 -1
  6. package/lib/focus/focusVisiblePolyfill.js.map +1 -1
  7. package/lib/focus/focusWithinPolyfill.js.map +1 -1
  8. package/lib/focus/index.js +4 -4
  9. package/lib/focus/index.js.map +1 -1
  10. package/lib/hooks/index.js +17 -16
  11. package/lib/hooks/index.js.map +1 -1
  12. package/lib/hooks/useArrowNavigationGroup.js.map +1 -1
  13. package/lib/hooks/useFocusFinders.js.map +1 -1
  14. package/lib/hooks/useFocusObserved.js.map +1 -1
  15. package/lib/hooks/useFocusVisible.js.map +1 -1
  16. package/lib/hooks/useFocusWithin.js.map +1 -1
  17. package/lib/hooks/useFocusableGroup.js.map +1 -1
  18. package/lib/hooks/useFocusedElementChange.js.map +1 -1
  19. package/lib/hooks/useIsNavigatingWithKeyboard.js +15 -0
  20. package/lib/hooks/useIsNavigatingWithKeyboard.js.map +1 -0
  21. package/lib/hooks/useKeyboardNavAttribute.js +4 -4
  22. package/lib/hooks/useKeyboardNavAttribute.js.map +1 -1
  23. package/lib/hooks/useKeyborgRef.js.map +1 -1
  24. package/lib/hooks/useMergeTabsterAttributes.js.map +1 -1
  25. package/lib/hooks/useModalAttributes.js.map +1 -1
  26. package/lib/hooks/useObservedElement.js.map +1 -1
  27. package/lib/hooks/useOnKeyboardNavigationChange.js.map +1 -1
  28. package/lib/hooks/useRestoreFocus.js.map +1 -1
  29. package/lib/hooks/useSetKeyboardNavigation.js.map +1 -1
  30. package/lib/hooks/useTabster.js.map +1 -1
  31. package/lib/hooks/useTabsterAttributes.js.map +1 -1
  32. package/lib/hooks/useUncontrolledFocus.js.map +1 -1
  33. package/lib/index.js +1 -1
  34. package/lib/index.js.map +1 -1
  35. package/lib/tabster-types-6.0.1-do-not-use.js.map +1 -1
  36. package/lib-commonjs/focus/constants.js.map +1 -1
  37. package/lib-commonjs/focus/createCustomFocusIndicatorStyle.js.map +1 -1
  38. package/lib-commonjs/focus/createFocusOutlineStyle.js.map +1 -1
  39. package/lib-commonjs/focus/focusVisiblePolyfill.js.map +1 -1
  40. package/lib-commonjs/focus/focusWithinPolyfill.js.map +1 -1
  41. package/lib-commonjs/focus/index.js +24 -5
  42. package/lib-commonjs/focus/index.js.map +1 -1
  43. package/lib-commonjs/hooks/index.js +79 -17
  44. package/lib-commonjs/hooks/index.js.map +1 -1
  45. package/lib-commonjs/hooks/useArrowNavigationGroup.js +2 -1
  46. package/lib-commonjs/hooks/useArrowNavigationGroup.js.map +1 -1
  47. package/lib-commonjs/hooks/useFocusFinders.js.map +1 -1
  48. package/lib-commonjs/hooks/useFocusObserved.js.map +1 -1
  49. package/lib-commonjs/hooks/useFocusVisible.js.map +1 -1
  50. package/lib-commonjs/hooks/useFocusWithin.js.map +1 -1
  51. package/lib-commonjs/hooks/useFocusableGroup.js.map +1 -1
  52. package/lib-commonjs/hooks/useFocusedElementChange.js.map +1 -1
  53. package/lib-commonjs/hooks/useIsNavigatingWithKeyboard.js +23 -0
  54. package/lib-commonjs/hooks/useIsNavigatingWithKeyboard.js.map +1 -0
  55. package/lib-commonjs/hooks/useKeyboardNavAttribute.js +5 -4
  56. package/lib-commonjs/hooks/useKeyboardNavAttribute.js.map +1 -1
  57. package/lib-commonjs/hooks/useKeyborgRef.js.map +1 -1
  58. package/lib-commonjs/hooks/useMergeTabsterAttributes.js +2 -1
  59. package/lib-commonjs/hooks/useMergeTabsterAttributes.js.map +1 -1
  60. package/lib-commonjs/hooks/useModalAttributes.js.map +1 -1
  61. package/lib-commonjs/hooks/useObservedElement.js.map +1 -1
  62. package/lib-commonjs/hooks/useOnKeyboardNavigationChange.js.map +1 -1
  63. package/lib-commonjs/hooks/useRestoreFocus.js.map +1 -1
  64. package/lib-commonjs/hooks/useSetKeyboardNavigation.js.map +1 -1
  65. package/lib-commonjs/hooks/useTabster.js.map +1 -1
  66. package/lib-commonjs/hooks/useTabsterAttributes.js.map +1 -1
  67. package/lib-commonjs/hooks/useUncontrolledFocus.js.map +1 -1
  68. package/lib-commonjs/index.js +8 -3
  69. package/lib-commonjs/index.js.map +1 -1
  70. package/lib-commonjs/tabster-types-6.0.1-do-not-use.js.map +1 -1
  71. package/package.json +5 -19
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { useArrowNavigationGroup, useFocusableGroup, useFocusFinders, useFocusVisible, useFocusWithin, useKeyboardNavAttribute, useModalAttributes, useTabsterAttributes, useObservedElement, useFocusObserved, useMergedTabsterAttributes_unstable, useRestoreFocusSource, useRestoreFocusTarget, useUncontrolledFocus, useOnKeyboardNavigationChange, useSetKeyboardNavigation, useFocusedElementChange } from './hooks/index';
1
+ export { useArrowNavigationGroup, useFocusableGroup, useFocusFinders, useFocusVisible, useFocusWithin, useKeyboardNavAttribute, useModalAttributes, useTabsterAttributes, useObservedElement, useFocusObserved, useMergedTabsterAttributes_unstable, useRestoreFocusSource, useRestoreFocusTarget, useUncontrolledFocus, useOnKeyboardNavigationChange, useIsNavigatingWithKeyboard, useSetKeyboardNavigation, useFocusedElementChange } from './hooks/index';
2
2
  export { createCustomFocusIndicatorStyle, createFocusOutlineStyle } from './focus/index';
3
3
  export { applyFocusVisiblePolyfill } from './focus/index';
4
4
  import { dispatchGroupperMoveFocusEvent, dispatchMoverMoveFocusEvent, MoverMoveFocusEventName, MoverMoveFocusEvent, MoverKeys, GroupperMoveFocusEventName, GroupperMoveFocusEvent, GroupperMoveFocusActions, MoverMemorizedElementEventName, MoverMemorizedElementEvent, TabsterMoveFocusEventName, TabsterMoveFocusEvent } from 'tabster';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export {\n useArrowNavigationGroup,\n useFocusableGroup,\n useFocusFinders,\n useFocusVisible,\n useFocusWithin,\n useKeyboardNavAttribute,\n useModalAttributes,\n useTabsterAttributes,\n useObservedElement,\n useFocusObserved,\n useMergedTabsterAttributes_unstable,\n useRestoreFocusSource,\n useRestoreFocusTarget,\n useUncontrolledFocus,\n useOnKeyboardNavigationChange,\n useSetKeyboardNavigation,\n useFocusedElementChange,\n} from './hooks/index';\nexport type {\n UseArrowNavigationGroupOptions,\n UseFocusableGroupOptions,\n UseModalAttributesOptions,\n} from './hooks/index';\n\nexport { createCustomFocusIndicatorStyle, createFocusOutlineStyle } from './focus/index';\n\nexport type {\n CreateCustomFocusIndicatorStyleOptions,\n CreateFocusOutlineStyleOptions,\n FocusOutlineOffset,\n FocusOutlineStyleOptions,\n} from './focus/index';\n\nexport { applyFocusVisiblePolyfill } from './focus/index';\nimport {\n type Types,\n type EventsTypes,\n dispatchGroupperMoveFocusEvent,\n dispatchMoverMoveFocusEvent,\n MoverMoveFocusEventName,\n MoverMoveFocusEvent,\n MoverKeys,\n GroupperMoveFocusEventName,\n GroupperMoveFocusEvent,\n GroupperMoveFocusActions,\n MoverMemorizedElementEventName,\n MoverMemorizedElementEvent,\n TabsterMoveFocusEventName,\n TabsterMoveFocusEvent,\n} from 'tabster';\n\nexport type TabsterDOMAttribute = Types.TabsterDOMAttribute;\n\nexport type { KeyborgFocusInEvent } from 'keyborg';\nexport { KEYBORG_FOCUSIN } from 'keyborg';\n\n// WARNING! ATTENTION! Tabster.Types was exported from here by mistake. To avoid breaking changes,\n// we are putting a snapshot of Tabster.Types@6.0.1 and marking the entire export as deprecated.\n// eslint-disable-next-line @typescript-eslint/naming-convention\nimport * as TabsterTypes6_0_1_DoNotUse from './tabster-types-6.0.1-do-not-use';\nexport {\n /** @deprecated (Do not use! Exposed by mistake and will be removed in the next major version.) */\n TabsterTypes6_0_1_DoNotUse as TabsterTypes,\n /** @deprecated Use element.dispatchEvent(new GroupperMoveFocusEvent({ action: GroupperMoveFocusActions.Escape })) */\n // eslint-disable-next-line deprecation/deprecation\n dispatchGroupperMoveFocusEvent,\n /** @deprecated Use element.dispatchEvent(new MoverMoveFocusEvent({ key: MoverKeys.ArrowDown })) */\n // eslint-disable-next-line deprecation/deprecation\n dispatchMoverMoveFocusEvent,\n};\n\n/**\n * For all exports below, we don't do wildcard exports to keep Tabster API flexible. We export only required\n * parts when they are needed.\n */\n\nexport { MoverMoveFocusEventName, MoverMoveFocusEvent, MoverKeys };\nexport type MoverMoveFocusEventDetail = EventsTypes.MoverMoveFocusEventDetail;\n\nexport { GroupperMoveFocusEventName, GroupperMoveFocusEvent, GroupperMoveFocusActions };\nexport type GroupperMoveFocusEventDetail = EventsTypes.GroupperMoveFocusEventDetail;\n\nexport { MoverMemorizedElementEventName, MoverMemorizedElementEvent };\nexport type MoverMemorizedElementEventDetail = EventsTypes.MoverMemorizedElementEventDetail;\n\nexport { TabsterMoveFocusEventName, TabsterMoveFocusEvent };\nexport type TabsterMoveFocusEventDetail = EventsTypes.TabsterMoveFocusEventDetail;\n"],"names":["useArrowNavigationGroup","useFocusableGroup","useFocusFinders","useFocusVisible","useFocusWithin","useKeyboardNavAttribute","useModalAttributes","useTabsterAttributes","useObservedElement","useFocusObserved","useMergedTabsterAttributes_unstable","useRestoreFocusSource","useRestoreFocusTarget","useUncontrolledFocus","useOnKeyboardNavigationChange","useSetKeyboardNavigation","useFocusedElementChange","createCustomFocusIndicatorStyle","createFocusOutlineStyle","applyFocusVisiblePolyfill","dispatchGroupperMoveFocusEvent","dispatchMoverMoveFocusEvent","MoverMoveFocusEventName","MoverMoveFocusEvent","MoverKeys","GroupperMoveFocusEventName","GroupperMoveFocusEvent","GroupperMoveFocusActions","MoverMemorizedElementEventName","MoverMemorizedElementEvent","TabsterMoveFocusEventName","TabsterMoveFocusEvent","KEYBORG_FOCUSIN","TabsterTypes6_0_1_DoNotUse","TabsterTypes"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,uBAAuB,EACvBC,iBAAiB,EACjBC,eAAe,EACfC,eAAe,EACfC,cAAc,EACdC,uBAAuB,EACvBC,kBAAkB,EAClBC,oBAAoB,EACpBC,kBAAkB,EAClBC,gBAAgB,EAChBC,mCAAmC,EACnCC,qBAAqB,EACrBC,qBAAqB,EACrBC,oBAAoB,EACpBC,6BAA6B,EAC7BC,wBAAwB,EACxBC,uBAAuB,QAClB,gBAAgB;AAOvB,SAASC,+BAA+B,EAAEC,uBAAuB,QAAQ,gBAAgB;AASzF,SAASC,yBAAyB,QAAQ,gBAAgB;AAC1D,SAGEC,8BAA8B,EAC9BC,2BAA2B,EAC3BC,uBAAuB,EACvBC,mBAAmB,EACnBC,SAAS,EACTC,0BAA0B,EAC1BC,sBAAsB,EACtBC,wBAAwB,EACxBC,8BAA8B,EAC9BC,0BAA0B,EAC1BC,yBAAyB,EACzBC,qBAAqB,QAChB,UAAU;AAKjB,SAASC,eAAe,QAAQ,UAAU;AAE1C,kGAAkG;AAClG,gGAAgG;AAChG,gEAAgE;AAChE,YAAYC,gCAAgC,mCAAmC;AAC/E,SACE,iGAAiG,GACjGA,8BAA8BC,YAAY,EAC1C,mHAAmH,GACnH,mDAAmD;AACnDd,8BAA8B,EAC9B,iGAAiG,GACjG,mDAAmD;AACnDC,2BAA2B,GAC3B;AAEF;;;CAGC,GAED,SAASC,uBAAuB,EAAEC,mBAAmB,EAAEC,SAAS,GAAG;AAGnE,SAASC,0BAA0B,EAAEC,sBAAsB,EAAEC,wBAAwB,GAAG;AAGxF,SAASC,8BAA8B,EAAEC,0BAA0B,GAAG;AAGtE,SAASC,yBAAyB,EAAEC,qBAAqB,GAAG"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n useArrowNavigationGroup,\n useFocusableGroup,\n useFocusFinders,\n useFocusVisible,\n useFocusWithin,\n useKeyboardNavAttribute,\n useModalAttributes,\n useTabsterAttributes,\n useObservedElement,\n useFocusObserved,\n useMergedTabsterAttributes_unstable,\n useRestoreFocusSource,\n useRestoreFocusTarget,\n useUncontrolledFocus,\n useOnKeyboardNavigationChange,\n useIsNavigatingWithKeyboard,\n useSetKeyboardNavigation,\n useFocusedElementChange,\n} from './hooks/index';\nexport type {\n UseArrowNavigationGroupOptions,\n UseFocusableGroupOptions,\n UseModalAttributesOptions,\n} from './hooks/index';\n\nexport { createCustomFocusIndicatorStyle, createFocusOutlineStyle } from './focus/index';\n\nexport type {\n CreateCustomFocusIndicatorStyleOptions,\n CreateFocusOutlineStyleOptions,\n FocusOutlineOffset,\n FocusOutlineStyleOptions,\n} from './focus/index';\n\nexport { applyFocusVisiblePolyfill } from './focus/index';\nimport {\n type Types,\n type EventsTypes,\n dispatchGroupperMoveFocusEvent,\n dispatchMoverMoveFocusEvent,\n MoverMoveFocusEventName,\n MoverMoveFocusEvent,\n MoverKeys,\n GroupperMoveFocusEventName,\n GroupperMoveFocusEvent,\n GroupperMoveFocusActions,\n MoverMemorizedElementEventName,\n MoverMemorizedElementEvent,\n TabsterMoveFocusEventName,\n TabsterMoveFocusEvent,\n} from 'tabster';\n\nexport type TabsterDOMAttribute = Types.TabsterDOMAttribute;\n\nexport type { KeyborgFocusInEvent } from 'keyborg';\nexport { KEYBORG_FOCUSIN } from 'keyborg';\n\n// WARNING! ATTENTION! Tabster.Types was exported from here by mistake. To avoid breaking changes,\n// we are putting a snapshot of Tabster.Types@6.0.1 and marking the entire export as deprecated.\n// eslint-disable-next-line @typescript-eslint/naming-convention\nimport * as TabsterTypes6_0_1_DoNotUse from './tabster-types-6.0.1-do-not-use';\nexport {\n /** @deprecated (Do not use! Exposed by mistake and will be removed in the next major version.) */\n TabsterTypes6_0_1_DoNotUse as TabsterTypes,\n /** @deprecated Use element.dispatchEvent(new GroupperMoveFocusEvent({ action: GroupperMoveFocusActions.Escape })) */\n // eslint-disable-next-line deprecation/deprecation\n dispatchGroupperMoveFocusEvent,\n /** @deprecated Use element.dispatchEvent(new MoverMoveFocusEvent({ key: MoverKeys.ArrowDown })) */\n // eslint-disable-next-line deprecation/deprecation\n dispatchMoverMoveFocusEvent,\n};\n\n/**\n * For all exports below, we don't do wildcard exports to keep Tabster API flexible. We export only required\n * parts when they are needed.\n */\n\nexport { MoverMoveFocusEventName, MoverMoveFocusEvent, MoverKeys };\nexport type MoverMoveFocusEventDetail = EventsTypes.MoverMoveFocusEventDetail;\n\nexport { GroupperMoveFocusEventName, GroupperMoveFocusEvent, GroupperMoveFocusActions };\nexport type GroupperMoveFocusEventDetail = EventsTypes.GroupperMoveFocusEventDetail;\n\nexport { MoverMemorizedElementEventName, MoverMemorizedElementEvent };\nexport type MoverMemorizedElementEventDetail = EventsTypes.MoverMemorizedElementEventDetail;\n\nexport { TabsterMoveFocusEventName, TabsterMoveFocusEvent };\nexport type TabsterMoveFocusEventDetail = EventsTypes.TabsterMoveFocusEventDetail;\n"],"names":["useArrowNavigationGroup","useFocusableGroup","useFocusFinders","useFocusVisible","useFocusWithin","useKeyboardNavAttribute","useModalAttributes","useTabsterAttributes","useObservedElement","useFocusObserved","useMergedTabsterAttributes_unstable","useRestoreFocusSource","useRestoreFocusTarget","useUncontrolledFocus","useOnKeyboardNavigationChange","useIsNavigatingWithKeyboard","useSetKeyboardNavigation","useFocusedElementChange","createCustomFocusIndicatorStyle","createFocusOutlineStyle","applyFocusVisiblePolyfill","dispatchGroupperMoveFocusEvent","dispatchMoverMoveFocusEvent","MoverMoveFocusEventName","MoverMoveFocusEvent","MoverKeys","GroupperMoveFocusEventName","GroupperMoveFocusEvent","GroupperMoveFocusActions","MoverMemorizedElementEventName","MoverMemorizedElementEvent","TabsterMoveFocusEventName","TabsterMoveFocusEvent","KEYBORG_FOCUSIN","TabsterTypes6_0_1_DoNotUse","TabsterTypes"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,uBAAuB,EACvBC,iBAAiB,EACjBC,eAAe,EACfC,eAAe,EACfC,cAAc,EACdC,uBAAuB,EACvBC,kBAAkB,EAClBC,oBAAoB,EACpBC,kBAAkB,EAClBC,gBAAgB,EAChBC,mCAAmC,EACnCC,qBAAqB,EACrBC,qBAAqB,EACrBC,oBAAoB,EACpBC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,wBAAwB,EACxBC,uBAAuB,QAClB,gBAAgB;AAOvB,SAASC,+BAA+B,EAAEC,uBAAuB,QAAQ,gBAAgB;AASzF,SAASC,yBAAyB,QAAQ,gBAAgB;AAC1D,SAGEC,8BAA8B,EAC9BC,2BAA2B,EAC3BC,uBAAuB,EACvBC,mBAAmB,EACnBC,SAAS,EACTC,0BAA0B,EAC1BC,sBAAsB,EACtBC,wBAAwB,EACxBC,8BAA8B,EAC9BC,0BAA0B,EAC1BC,yBAAyB,EACzBC,qBAAqB,QAChB,UAAU;AAKjB,SAASC,eAAe,QAAQ,UAAU;AAE1C,kGAAkG;AAClG,gGAAgG;AAChG,gEAAgE;AAChE,YAAYC,gCAAgC,mCAAmC;AAC/E,SACE,iGAAiG,GACjGA,8BAA8BC,YAAY,EAC1C,mHAAmH,GACnH,mDAAmD;AACnDd,8BAA8B,EAC9B,iGAAiG,GACjG,mDAAmD;AACnDC,2BAA2B,GAC3B;AAEF;;;CAGC,GAED,SAASC,uBAAuB,EAAEC,mBAAmB,EAAEC,SAAS,GAAG;AAGnE,SAASC,0BAA0B,EAAEC,sBAAsB,EAAEC,wBAAwB,GAAG;AAGxF,SAASC,8BAA8B,EAAEC,0BAA0B,GAAG;AAGtE,SAASC,yBAAyB,EAAEC,qBAAqB,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["tabster-types-6.0.1-do-not-use.ts"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!\n * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!\n *\n * Do not use anything from this file. It is a snapshot of the older Tabster typings exposed by a mistake.\n * The exposed typings should have been removed, but we don't do it in minor versions to avoid breaking changes.\n * Everything reexported from this file as react-tabster/TabsterTypes is marked as deprecated and shouldn't\n * be used anywhre.\n *\n * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!\n * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!\n */\n\nexport const TabsterAttributeName = 'data-tabster';\nexport const TabsterDummyInputAttributeName = 'data-tabster-dummy';\nexport const DeloserEventName = 'tabster:deloser';\nexport const ModalizerActiveEventName = 'tabster:modalizer:active';\nexport const ModalizerInactiveEventName = 'tabster:modalizer:inactive';\nexport const ModalizerFocusInEventName = 'tabster:modalizer:focusin';\nexport const ModalizerFocusOutEventName = 'tabster:modalizer:focusout';\nexport const ModalizerBeforeFocusOutEventName = 'tabster:modalizer:beforefocusout';\nexport const MoverEventName = 'tabster:mover';\nexport const FocusInEventName = 'tabster:focusin';\nexport const FocusOutEventName = 'tabster:focusout';\n\n// Event to be triggered when Tabster wants to move focus as the result of\n// keyboard event. This allows to preventDefault() if you want to have\n// some custom logic.\nexport const MoveFocusEventName = 'tabster:movefocus';\n\n// Event that can be triggered by the application to programmatically move\n// focus inside Mover.\nexport const MoverMoveFocusEventName = 'tabster:mover:movefocus';\n// Event that can be triggered by the application to programmatically enter\n// or escape Groupper.\nexport const GroupperMoveFocusEventName = 'tabster:groupper:movefocus';\n\nexport const FocusableSelector = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '*[tabindex]',\n '*[contenteditable]',\n].join(', ');\n\n// Trigger move focus event on a Mover element.\nexport type MoverMoveFocusEvent = CustomEvent<{ key: MoverKey } | undefined>;\n\nexport interface GroupperMoveFocusActions {\n Enter: 1;\n Escape: 2;\n}\nexport type GroupperMoveFocusAction = GroupperMoveFocusActions[keyof GroupperMoveFocusActions];\nexport const GroupperMoveFocusActions: GroupperMoveFocusActions = {\n Enter: 1,\n Escape: 2,\n};\n\n// Enter or escape Groupper. Enter when `enter` is true, escape when `enter` is false.\nexport type GroupperMoveFocusEvent = CustomEvent<{ action: GroupperMoveFocusAction } | undefined>;\n\nexport type TabsterEventWithDetails<D> = CustomEvent<D | undefined>;\n\nexport interface TabsterMoveFocusEventDetails {\n by: 'mover' | 'groupper' | 'modalizer' | 'root';\n owner: HTMLElement; // Mover, Groupper, Modalizer or Root, the initiator.\n next: HTMLElement | null; // Next element to focus or null if Tabster wants to go outside of Root (i.e. to the address bar of the browser).\n relatedEvent?: KeyboardEvent; // The original keyboard event that triggered the move.\n}\n\nexport type TabsterMoveFocusEvent = TabsterEventWithDetails<TabsterMoveFocusEventDetails>;\n\nexport interface TabsterDOMAttribute {\n [TabsterAttributeName]: string | undefined;\n}\n\nexport interface TabsterCoreProps {\n autoRoot?: RootProps;\n /**\n * Allows all tab key presses under the tabster root to be controlled by tabster\n * @default true\n */\n controlTab?: boolean;\n /**\n * When controlTab is false, Root doesn't have dummy inputs by default.\n * This option allows to enable dummy inputs on Root.\n */\n rootDummyInputs?: boolean;\n /**\n * A callback that will be called for the uncontrolled areas when Tabster wants\n * to know is the uncontrolled element wants complete control (for example it\n * is trapping focus) and Tabster should not interfere with handling Tab.\n * If the callback returns undefined, then the default behaviour is to return\n * the uncontrolled.completely value from the element. If the callback returns\n * non-undefined value, the callback's value will dominate the element's\n * uncontrolled.completely value.\n */\n checkUncontrolledCompletely?: (\n element: HTMLElement,\n completely: boolean, // A uncontrolled.completely value from the element.\n ) => boolean | undefined;\n /**\n * @deprecated use checkUncontrolledCompletely.\n */\n checkUncontrolledTrappingFocus?: (element: HTMLElement) => boolean;\n /**\n * Custom getter for parent elements. Defaults to the default .parentElement call\n * Currently only used to detect tabster contexts\n */\n getParent?(el: Node): Node | null;\n /**\n * Ability to redefine all DOM API calls used by Tabster. For example, for\n * ShadowDOM support.\n */\n DOMAPI?: Partial<DOMAPI>;\n}\n\nexport interface DOMAPI {\n // TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\n // eslint-disable-next-line no-restricted-globals\n createMutationObserver: (callback: MutationCallback) => MutationObserver;\n createTreeWalker(doc: Document, root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker;\n getParentNode(node: Node | null | undefined): ParentNode | null;\n getParentElement(element: HTMLElement | null | undefined): HTMLElement | null;\n nodeContains(parent: Node | null | undefined, child: Node | null | undefined): boolean;\n getActiveElement(doc: Document): Element | null;\n querySelector(element: ParentNode, selector: string): Element | null;\n querySelectorAll(element: ParentNode, selector: string): Element[];\n getElementById(doc: Document, id: string): HTMLElement | null;\n getFirstChild(node: Node | null | undefined): ChildNode | null;\n getLastChild(node: Node | null | undefined): ChildNode | null;\n getNextSibling(node: Node | null | undefined): ChildNode | null;\n getPreviousSibling(node: Node | null | undefined): ChildNode | null;\n getFirstElementChild(element: Element | null | undefined): Element | null;\n getLastElementChild(element: Element | null | undefined): Element | null;\n getNextElementSibling(element: Element | null | undefined): Element | null;\n getPreviousElementSibling(element: Element | null | undefined): Element | null;\n appendChild(parent: Node, child: Node): Node;\n insertBefore(parent: Node, child: Node, referenceChild: Node | null): Node;\n getSelection(ref: Node): Selection | null;\n}\n\nexport type GetTabster = () => TabsterCore;\nexport type GetWindow = () => Window;\n\nexport type SubscribableCallback<A, B = undefined> = (val: A, details: B) => void;\n\nexport interface Disposable {\n /** @internal */\n dispose(): void;\n}\n\nexport interface Subscribable<A, B = undefined> {\n subscribe(callback: SubscribableCallback<A, B>): void;\n /** @internal */\n subscribeFirst(callback: SubscribableCallback<A, B>): void;\n unsubscribe(callback: SubscribableCallback<A, B>): void;\n}\n\nexport interface KeyboardNavigationState extends Subscribable<boolean>, Disposable {\n isNavigatingWithKeyboard(): boolean;\n setNavigatingWithKeyboard(isNavigatingWithKeyboard: boolean): void;\n}\n\nexport interface FocusedElementDetails {\n relatedTarget?: HTMLElement;\n isFocusedProgrammatically?: boolean;\n modalizerId?: string;\n}\n\nexport interface FocusedElementState extends Subscribable<HTMLElement | undefined, FocusedElementDetails>, Disposable {\n getFocusedElement(): HTMLElement | undefined;\n getLastFocusedElement(): HTMLElement | undefined;\n focus(element: HTMLElement, noFocusedProgrammaticallyFlag?: boolean, noAccessibleCheck?: boolean): boolean;\n focusDefault(container: HTMLElement): boolean;\n /** @internal */\n getFirstOrLastTabbable(\n isFirst: boolean,\n props: Pick<FindFocusableProps, 'container' | 'ignoreAccessibility'>,\n ): HTMLElement | undefined;\n focusFirst(props: FindFirstProps): boolean;\n focusLast(props: FindFirstProps): boolean;\n resetFocus(container: HTMLElement): boolean;\n}\n\nexport interface WeakHTMLElement<D = undefined> {\n get(): HTMLElement | undefined;\n getData(): D | undefined;\n}\n\nexport interface TabsterPart<P> {\n readonly id: string;\n getElement(): HTMLElement | undefined;\n getProps(): P;\n setProps(props: P): void;\n}\n\nexport interface TabsterPartWithFindNextTabbable {\n findNextTabbable(\n current?: HTMLElement,\n reference?: HTMLElement,\n isBackward?: boolean,\n ignoreAccessibility?: boolean,\n ): NextTabbable | null;\n}\n\nexport interface TabsterPartWithAcceptElement {\n acceptElement(element: HTMLElement, state: FocusableAcceptElementState): number | undefined;\n}\n\nexport interface ObservedElementProps {\n names: string[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n details?: any;\n}\n\nexport interface ObservedElementDetails extends ObservedElementProps {\n accessibility?: ObservedElementAccesibility;\n}\n\nexport interface ObservedElementAccesibilities {\n Any: 0;\n Accessible: 1;\n Focusable: 2;\n}\nexport type ObservedElementAccesibility = ObservedElementAccesibilities[keyof ObservedElementAccesibilities];\nexport const ObservedElementAccesibilities: ObservedElementAccesibilities = {\n Any: 0,\n Accessible: 1,\n Focusable: 2,\n};\n\nexport interface ObservedElementAsyncRequest<T> {\n result: Promise<T>;\n cancel(): void;\n}\n\ninterface ObservedElementAPIInternal {\n /** @internal */\n onObservedElementUpdate(element: HTMLElement): void;\n}\n\nexport interface ObservedElementAPI\n extends Subscribable<HTMLElement, ObservedElementDetails>,\n Disposable,\n ObservedElementAPIInternal {\n getElement(observedName: string, accessibility?: ObservedElementAccesibility): HTMLElement | null;\n waitElement(\n observedName: string,\n timeout: number,\n accessibility?: ObservedElementAccesibility,\n ): ObservedElementAsyncRequest<HTMLElement | null>;\n requestFocus(observedName: string, timeout: number): ObservedElementAsyncRequest<boolean>;\n}\n\nexport interface CrossOriginElement {\n readonly uid: string;\n readonly ownerId: string;\n readonly id?: string;\n readonly rootId?: string;\n readonly observedName?: string;\n readonly observedDetails?: string;\n focus(noFocusedProgrammaticallyFlag?: boolean, noAccessibleCheck?: boolean): Promise<boolean>;\n}\n\nexport interface CrossOriginSentTo {\n [id: string]: true;\n}\n\nexport interface CrossOriginTransactionTypes {\n Bootstrap: 1;\n FocusElement: 2;\n State: 3;\n GetElement: 4;\n RestoreFocusInDeloser: 5;\n Ping: 6;\n}\nexport type CrossOriginTransactionType = CrossOriginTransactionTypes[keyof CrossOriginTransactionTypes];\n\nexport interface CrossOriginTransactionData<I, O> {\n transaction: string;\n type: CrossOriginTransactionType;\n isResponse: boolean;\n timestamp: number;\n owner: string;\n sentto: CrossOriginSentTo;\n timeout?: number;\n target?: string;\n beginData?: I;\n endData?: O;\n}\n\nexport type CrossOriginTransactionSend = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: CrossOriginTransactionData<any, any>,\n) => void;\n\nexport interface CrossOriginMessage {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: CrossOriginTransactionData<any, any>;\n send: CrossOriginTransactionSend;\n}\n\nexport interface CrossOriginFocusedElementState\n extends Subscribable<CrossOriginElement | undefined, FocusedElementDetails>,\n Disposable {\n focus(\n element: CrossOriginElement,\n noFocusedProgrammaticallyFlag?: boolean,\n noAccessibleCheck?: boolean,\n ): Promise<boolean>;\n focusById(\n elementId: string,\n rootId?: string,\n noFocusedProgrammaticallyFlag?: boolean,\n noAccessibleCheck?: boolean,\n ): Promise<boolean>;\n focusByObservedName(\n observedName: string,\n timeout?: number,\n rootId?: string,\n noFocusedProgrammaticallyFlag?: boolean,\n noAccessibleCheck?: boolean,\n ): Promise<boolean>;\n}\n\nexport interface CrossOriginObservedElementState\n extends Subscribable<CrossOriginElement, ObservedElementProps>,\n Disposable {\n getElement(observedName: string, accessibility?: ObservedElementAccesibility): Promise<CrossOriginElement | null>;\n waitElement(\n observedName: string,\n timeout: number,\n accessibility?: ObservedElementAccesibility,\n ): Promise<CrossOriginElement | null>;\n requestFocus(observedName: string, timeout: number): Promise<boolean>;\n}\n\nexport interface CrossOriginAPI {\n focusedElement: CrossOriginFocusedElementState;\n observedElement: CrossOriginObservedElementState;\n\n setup(sendUp?: CrossOriginTransactionSend | null): (msg: CrossOriginMessage) => void;\n isSetUp(): boolean;\n dispose(): void;\n}\n\nexport interface OutlineProps {\n areaClass: string;\n outlineClass: string;\n outlineColor: string;\n outlineWidth: number;\n zIndex: number;\n}\n\nexport interface OutlinedElementProps {\n isIgnored?: boolean;\n}\n\nexport interface OutlineAPI extends Disposable {\n setup(props?: Partial<OutlineProps>): void;\n}\n\nexport interface DeloserElementActions {\n focusDefault: () => boolean;\n focusFirst: () => boolean;\n resetFocus: () => boolean;\n clearHistory: (preserveExisting?: boolean) => void;\n setSnapshot: (index: number) => void;\n isActive: () => boolean;\n}\n\nexport interface RestoreFocusOrders {\n History: 0;\n DeloserDefault: 1;\n RootDefault: 2;\n DeloserFirst: 3;\n RootFirst: 4;\n}\nexport type RestoreFocusOrder = RestoreFocusOrders[keyof RestoreFocusOrders];\nexport const RestoreFocusOrders: RestoreFocusOrders = {\n History: 0,\n DeloserDefault: 1,\n RootDefault: 2,\n DeloserFirst: 3,\n RootFirst: 4,\n};\n\nexport interface DeloserProps {\n restoreFocusOrder?: RestoreFocusOrder;\n noSelectorCheck?: boolean;\n}\n\nexport interface Deloser extends TabsterPart<DeloserProps> {\n readonly uid: string;\n dispose(): void;\n isActive(): boolean;\n setActive(active: boolean): void;\n getActions(): DeloserElementActions;\n setSnapshot(index: number): void;\n focusFirst(): boolean;\n unshift(element: HTMLElement): void;\n focusDefault(): boolean;\n resetFocus(): boolean;\n findAvailable(): HTMLElement | null;\n clearHistory(preserveExisting?: boolean): void;\n customFocusLostHandler(element: HTMLElement): boolean;\n}\n\nexport type DeloserConstructor = (element: HTMLElement, props: DeloserProps) => Deloser;\n\ninterface DeloserInterfaceInternal {\n /** @internal */\n createDeloser(element: HTMLElement, props: DeloserProps): Deloser;\n}\n\nexport interface DeloserAPI extends DeloserInterfaceInternal, Disposable {\n getActions(element: HTMLElement): DeloserElementActions | undefined;\n pause(): void;\n resume(restore?: boolean): void;\n}\n\nexport interface FocusableProps {\n isDefault?: boolean;\n isIgnored?: boolean;\n /**\n * Do not determine an element's focusability based on aria-disabled.\n */\n ignoreAriaDisabled?: boolean;\n /**\n * Exclude element (and all subelements) from Mover navigation.\n */\n excludeFromMover?: boolean;\n /**\n * Prevents tabster from handling the keydown event\n */\n ignoreKeydown?: {\n Tab?: boolean;\n Escape?: boolean;\n Enter?: boolean;\n ArrowUp?: boolean;\n ArrowDown?: boolean;\n ArrowLeft?: boolean;\n ArrowRight?: boolean;\n PageUp?: boolean;\n PageDown?: boolean;\n Home?: boolean;\n End?: boolean;\n };\n}\n\nexport interface FocusableAcceptElementState {\n container: HTMLElement;\n modalizerUserId?: string;\n currentCtx?: TabsterContext;\n from: HTMLElement;\n fromCtx?: TabsterContext;\n isBackward?: boolean;\n found?: boolean;\n foundElement?: HTMLElement;\n foundBackward?: HTMLElement;\n rejectElementsFrom?: HTMLElement;\n uncontrolled?: HTMLElement;\n acceptCondition: (el: HTMLElement) => boolean;\n hasCustomCondition?: boolean;\n includeProgrammaticallyFocusable?: boolean;\n ignoreAccessibility?: boolean;\n cachedGrouppers: {\n [id: string]: {\n isActive: boolean | undefined;\n first?: HTMLElement | null;\n };\n };\n isFindAll?: boolean;\n /**\n * A flag that indicates that some focusable elements were skipped\n * during the search and the found element is not the one the browser\n * would normally focus if the user pressed Tab.\n */\n skippedFocusable?: boolean;\n}\n\nexport interface FindFocusableProps {\n /**\n * The container used for the search.\n */\n container: HTMLElement;\n /**\n * The elemet to start from.\n */\n currentElement?: HTMLElement;\n /**\n * See `referenceElement` of GetTabsterContextOptions for description.\n */\n referenceElement?: HTMLElement;\n /**\n * Includes elements that can be focused programmatically.\n */\n includeProgrammaticallyFocusable?: boolean;\n /**\n * Ignore accessibility check.\n */\n ignoreAccessibility?: boolean;\n /**\n * Take active modalizer into account when searching for elements\n * (the elements out of active modalizer will not be returned).\n */\n useActiveModalizer?: boolean;\n /**\n * Search withing the specified modality, null for everything outside of modalizers, string within\n * a specific id, undefined for search within the current application state.\n */\n modalizerId?: string | null;\n /**\n * If true, find previous element instead of the next one.\n */\n isBackward?: boolean;\n /**\n * @param el - element visited.\n * @returns if an element should be accepted.\n */\n acceptCondition?(el: HTMLElement): boolean;\n /**\n * A callback that will be called for every focusable element found during findAll().\n * If false is returned from this callback, the search will stop.\n */\n onElement?: FindElementCallback;\n}\n\nexport interface FindFocusableOutputProps {\n /**\n * An output parameter. Will be true after the findNext/findPrev() call if some focusable\n * elements were skipped during the search and the result element not immediately next\n * focusable after the currentElement.\n */\n outOfDOMOrder?: boolean;\n /**\n * An output parameter. Will be true if the found element is uncontrolled.\n */\n uncontrolled?: HTMLElement | null;\n}\n\nexport type FindFirstProps = Pick<\n FindFocusableProps,\n 'container' | 'modalizerId' | 'includeProgrammaticallyFocusable' | 'useActiveModalizer' | 'ignoreAccessibility'\n>;\n\nexport type FindNextProps = Pick<\n FindFocusableProps,\n | 'currentElement'\n | 'referenceElement'\n | 'container'\n | 'modalizerId'\n | 'includeProgrammaticallyFocusable'\n | 'useActiveModalizer'\n | 'ignoreAccessibility'\n>;\n\nexport type FindDefaultProps = Pick<\n FindFocusableProps,\n 'container' | 'modalizerId' | 'includeProgrammaticallyFocusable' | 'useActiveModalizer' | 'ignoreAccessibility'\n>;\n\nexport type FindAllProps = Pick<\n FindFocusableProps,\n | 'container'\n | 'modalizerId'\n | 'currentElement'\n | 'isBackward'\n | 'includeProgrammaticallyFocusable'\n | 'useActiveModalizer'\n | 'acceptCondition'\n | 'ignoreAccessibility'\n | 'onElement'\n>;\n\n/**\n * A callback that is called for every found element during search. Returning false stops search.\n */\nexport type FindElementCallback = (element: HTMLElement) => boolean;\n\nexport interface FocusableAPI extends Disposable {\n getProps(element: HTMLElement): FocusableProps;\n\n isFocusable(\n element: HTMLElement,\n includeProgrammaticallyFocusable?: boolean,\n noVisibleCheck?: boolean,\n noAccessibleCheck?: boolean,\n ): boolean;\n isVisible(element: HTMLElement): boolean;\n isAccessible(element: HTMLElement): boolean;\n // find* return null when there is no element and undefined when there is an uncontrolled area.\n findFirst(options: FindFirstProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;\n findLast(options: FindFirstProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;\n findNext(options: FindNextProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;\n findPrev(options: FindNextProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;\n findDefault(options: FindDefaultProps, out?: FindFocusableOutputProps): HTMLElement | null;\n /**\n * @returns All focusables in a given context that satisfy an given condition\n */\n findAll(options: FindAllProps): HTMLElement[];\n findElement(options: FindFocusableProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;\n}\n\nexport interface DummyInputManager {\n moveOut: (backwards: boolean) => void;\n moveOutWithDefaultAction: (backwards: boolean, relatedEvent: KeyboardEvent) => void;\n}\n\nexport interface Visibilities {\n Invisible: 0;\n PartiallyVisible: 1;\n Visible: 2;\n}\nexport const Visibilities: Visibilities = {\n Invisible: 0,\n PartiallyVisible: 1,\n Visible: 2,\n};\nexport type Visibility = Visibilities[keyof Visibilities];\n\nexport interface MoverElementState {\n isCurrent: boolean | undefined; // Tri-state bool. Undefined when there is no current in the container.\n visibility: Visibility;\n}\n\nexport interface MoverDirections {\n Both: 0; // Default, both left/up keys move to the previous, right/down move to the next.\n Vertical: 1; // Only up/down arrows move to the next/previous.\n Horizontal: 2; // Only left/right arrows move to the next/previous.\n Grid: 3; // Two-dimentional movement depending on the visual placement.\n GridLinear: 4; // Two-dimentional movement depending on the visual placement. Allows linear movement.\n}\n\nexport const RestorerTypes = {\n Source: 0,\n Target: 1,\n} as const;\n\nexport type RestorerType = (typeof RestorerTypes)[keyof typeof RestorerTypes];\n\nexport const MoverDirections: MoverDirections = {\n Both: 0,\n Vertical: 1,\n Horizontal: 2,\n Grid: 3,\n GridLinear: 4,\n};\nexport type MoverDirection = MoverDirections[keyof MoverDirections];\n\nexport type NextTabbable = {\n element: HTMLElement | null | undefined;\n uncontrolled?: HTMLElement | null;\n outOfDOMOrder?: boolean;\n};\n\nexport interface MoverProps {\n direction?: MoverDirection;\n memorizeCurrent?: boolean;\n tabbable?: boolean;\n /**\n * Whether to allow cyclic navigation in the mover\n * Can only be applied if navigationType is MoverKeys.Arrows\n *\n * @defaultValue false\n */\n cyclic?: boolean;\n /**\n * In case we need a rich state of the elements inside a Mover,\n * we can track it. It takes extra resourses and might affect\n * performance when a Mover has many elements inside, so make sure\n * you use this prop when it is really needed.\n */\n trackState?: boolean;\n /**\n * When set to Visibility.Visible or Visibility.PartiallyVisible,\n * uses the visibility part of the trackState prop to be able to\n * go to first/last visible element (instead of first/last focusable\n * element in DOM) when tabbing from outside of the mover.\n */\n visibilityAware?: Visibility;\n /**\n * When true, Mover will try to locate a focusable with Focusable.isDefault\n * property as a prioritized element to focus. True by default.\n */\n hasDefault?: boolean;\n /**\n * A value between 0 and 1 that specifies the tolerance allowed\n * when testing for visibility.\n *\n * @example\n * an element of height 100px has 10px that are above the viewport\n * hidden by scroll. This element is a valid visible element to focus.\n *\n * @default 0.8\n */\n visibilityTolerance?: number;\n}\n\nexport type MoverEvent = TabsterEventWithDetails<MoverElementState>;\n\nexport interface Mover extends TabsterPart<MoverProps>, TabsterPartWithFindNextTabbable, TabsterPartWithAcceptElement {\n readonly id: string;\n readonly dummyManager: DummyInputManager | undefined;\n readonly visibilityTolerance: NonNullable<MoverProps['visibilityTolerance']>;\n dispose(): void;\n setCurrent(element: HTMLElement | undefined): void;\n getCurrent(): HTMLElement | null;\n getState(element: HTMLElement): MoverElementState | undefined;\n}\n\nexport type MoverConstructor = (tabster: TabsterCore, element: HTMLElement, props: MoverProps) => Mover;\n\ninterface MoverAPIInternal {\n /** @internal */\n createMover(element: HTMLElement, props: MoverProps, sys: SysProps | undefined): Mover;\n}\n\nexport interface MoverKeys {\n ArrowUp: 1;\n ArrowDown: 2;\n ArrowLeft: 3;\n ArrowRight: 4;\n PageUp: 5;\n PageDown: 6;\n Home: 7;\n End: 8;\n}\nexport type MoverKey = MoverKeys[keyof MoverKeys];\nexport const MoverKeys: MoverKeys = {\n ArrowUp: 1,\n ArrowDown: 2,\n ArrowLeft: 3,\n ArrowRight: 4,\n PageUp: 5,\n PageDown: 6,\n Home: 7,\n End: 8,\n};\n\nexport interface MoverAPI extends MoverAPIInternal, Disposable {\n /** @internal (will likely be exposed once the API is fully stable) */\n moveFocus(fromElement: HTMLElement, key: MoverKey): HTMLElement | null;\n}\n\nexport interface GroupperTabbabilities {\n Unlimited: 0;\n Limited: 1; // The tabbability is limited to the container and explicit Enter is needed to go inside.\n LimitedTrapFocus: 2; // The focus is limited as above, plus trapped when inside.\n}\nexport const GroupperTabbabilities: GroupperTabbabilities = {\n Unlimited: 0,\n Limited: 1,\n LimitedTrapFocus: 2,\n};\nexport type GroupperTabbability = GroupperTabbabilities[keyof GroupperTabbabilities];\n\nexport interface GroupperProps {\n tabbability?: GroupperTabbability;\n delegated?: boolean; // This allows to tweak the groupper behaviour for the cases when\n // the groupper container is not focusable and groupper has Limited or LimitedTrapFocus\n // tabbability. By default, the groupper will automatically become active once the focus\n // goes to first focusable element inside the groupper during tabbing. When true, the\n // groupper will become active only after Enter is pressed on first focusable element\n // inside the groupper.\n}\n\nexport interface Groupper\n extends TabsterPart<GroupperProps>,\n TabsterPartWithFindNextTabbable,\n TabsterPartWithAcceptElement {\n readonly id: string;\n readonly dummyManager: DummyInputManager | undefined;\n dispose(): void;\n makeTabbable(isUnlimited: boolean): void;\n isActive(noIfFirstIsFocused?: boolean): boolean | undefined; // Tri-state boolean, undefined when parent is not active, false when parent is active.\n setFirst(element: HTMLElement | undefined): void;\n getFirst(orContainer: boolean): HTMLElement | undefined;\n}\n\nexport type GroupperConstructor = (tabster: TabsterCore, element: HTMLElement, props: GroupperProps) => Groupper;\n\nexport interface GroupperAPIInternal {\n /** @internal */\n createGroupper(element: HTMLElement, props: GroupperProps, sys: SysProps | undefined): Groupper;\n /** @internal */\n handleKeyPress(element: HTMLElement, event: KeyboardEvent, fromModalizer?: boolean): void;\n}\n\nexport interface GroupperAPI extends GroupperAPIInternal, Disposable {\n /** @internal (will likely be exposed once the API is fully stable) */\n moveFocus(element: HTMLElement, action: GroupperMoveFocusAction): HTMLElement | null;\n}\n\nexport interface GroupperAPIInternal {\n forgetCurrentGrouppers(): void;\n}\n\nexport interface ModalizerProps {\n id: string;\n isOthersAccessible?: boolean;\n isAlwaysAccessible?: boolean;\n isNoFocusFirst?: boolean;\n isNoFocusDefault?: boolean;\n /** A focus trap variant, keeps focus inside the modal when tabbing */\n isTrapped?: boolean;\n}\n\nexport type ModalizerEventName =\n | typeof ModalizerActiveEventName\n | typeof ModalizerInactiveEventName\n | typeof ModalizerBeforeFocusOutEventName\n | typeof ModalizerFocusInEventName\n | typeof ModalizerFocusOutEventName;\n\nexport type ModalizerEventDetails = {\n id: string;\n element: HTMLElement;\n eventName: ModalizerEventName;\n};\n\nexport type ModalizerEvent = TabsterEventWithDetails<ModalizerEventDetails>;\n\nexport interface Modalizer extends TabsterPart<ModalizerProps>, TabsterPartWithFindNextTabbable {\n readonly userId: string;\n readonly dummyManager: DummyInputManager | undefined;\n /**\n * @returns - Whether the element is inside the modalizer\n */\n contains(element: HTMLElement): boolean;\n dispose(): void;\n isActive(): boolean;\n makeActive(isActive: boolean): void;\n focused(noIncrement?: boolean): number;\n triggerFocusEvent(eventName: ModalizerEventName, allElements: boolean): boolean;\n}\n\nexport type ModalizerConstructor = (tabster: TabsterCore, element: HTMLElement, props: ModalizerProps) => Modalizer;\n\nexport interface RootProps {\n restoreFocusOrder?: RestoreFocusOrder;\n}\n\nexport interface Root extends TabsterPart<RootProps> {\n /**@internal*/\n addDummyInputs(): void;\n\n readonly uid: string;\n dispose(): void;\n moveOutWithDefaultAction(backwards: boolean, relatedEvent: KeyboardEvent): void;\n}\n\nexport type RootConstructor = (tabster: TabsterCore, element: HTMLElement, props: RootProps) => Root;\n\nexport interface SysDummyInputsPositions {\n Auto: 0; // Tabster will place dummy inputs depending on the container tag name and on the default behaviour.\n Inside: 1; // Tabster will always place dummy inputs inside the container.\n Outside: 2; // Tabster will always place dummy inputs outside of the container.\n}\nexport const SysDummyInputsPositions: SysDummyInputsPositions = {\n Auto: 0,\n Inside: 1,\n Outside: 2,\n};\nexport type SysDummyInputsPosition = SysDummyInputsPositions[keyof SysDummyInputsPositions];\n/**\n * Ability to fine-tune Tabster internal behaviour in rare cases of need.\n * Normally, should not be used. A deep understanding of the intention and the effect\n * is required.\n */\nexport interface SysProps {\n /**\n * Force dummy input position outside or inside of the element.\n * By default (when undefined), the position is determined dynamically\n * (for example inside for <li> elements and outside for <table> elements,\n * plus a default Groupper/Mover/Modalizer implementation position).\n * Setting to true will force the dummy inputs to be always outside of the element,\n * setting to false will force the dummy inputs to be always inside.\n */\n dummyInputsPosition?: SysDummyInputsPosition;\n}\n\nexport interface GetTabsterContextOptions {\n /**\n * Should visit **all** element ancestors to verify if `dir='rtl'` is set\n */\n checkRtl?: boolean;\n /**\n * The element to start computing the context from. Useful when dealing\n * with nested structures. For example, if we have an element inside a groupper\n * inside another groupper, the `groupper` prop in this element's contexts will\n * be the inner groupper, but when we pass the inner groupper's parent element\n * as `referenceElement`, the context groupper will be the outer one. Having\n * this option simplifies searching for the next tabbable element in the\n * environment of nested movers and grouppers.\n */\n referenceElement?: HTMLElement;\n}\n\nexport type TabsterContextMoverGroupper = { isMover: true; mover: Mover } | { isMover: false; groupper: Groupper };\n\nexport interface TabsterContext {\n root: Root;\n modalizer?: Modalizer;\n groupper?: Groupper;\n mover?: Mover;\n groupperBeforeMover?: boolean;\n modalizerInGroupper?: Groupper;\n /**\n * Whether `dir='rtl'` is set on an ancestor\n */\n rtl?: boolean;\n excludedFromMover?: boolean;\n uncontrolled?: HTMLElement | null;\n ignoreKeydown: (e: KeyboardEvent) => boolean;\n}\n\nexport interface RootFocusEventDetails {\n element: HTMLElement;\n}\n\ninterface RootAPIInternal {\n /**@internal*/\n createRoot(element: HTMLElement, props: RootProps, sys: SysProps | undefined): Root;\n /**@internal*/\n onRoot(root: Root, removed?: boolean): void;\n /**@internal*/\n addDummyInputs(): void;\n}\n\nexport interface RootAPI extends Disposable, RootAPIInternal {\n eventTarget: EventTarget;\n}\n\nexport interface UncontrolledAPI {\n isUncontrolledCompletely(element: HTMLElement, completely: boolean): boolean;\n}\n\ninterface ModalizerAPIInternal extends TabsterPartWithAcceptElement {\n /** @internal */\n activeId: string | undefined; // currently active Modalizer user id.\n /** @internal */\n currentIsOthersAccessible: boolean | undefined; // isOthersAccessible value of the currently active Modalizer.\n /** @internal */\n activeElements: WeakHTMLElement<HTMLElement>[];\n /** @internal */\n createModalizer(element: HTMLElement, props: ModalizerProps, sys: SysProps | undefined): Modalizer;\n /**\n * Sets active modalizers.\n * When active, everything outside of the modalizers with the specific user\n * defined id gets `aria-hidden`.\n *\n * @param userId - user defined identifier or undefined (if nothing is modal).\n */\n /** @internal */\n setActive(modalizer: Modalizer | undefined): void;\n /** @internal */\n hiddenUpdate(): void;\n /** @internal */\n isAugmented(element: HTMLElement): boolean;\n}\n\nexport interface ModalizerAPI extends ModalizerAPIInternal, Disposable {\n /**\n * Activates a Modalizer and focuses the first or default element within\n *\n * @param elementFromModalizer - An element that belongs to a Modalizer\n * @param noFocusFirst - Do not focus on the first element in the Modalizer\n * @param noFocusDefault - Do not focus the default element in the Modalizre\n */\n focus(elementFromModalizer: HTMLElement, noFocusFirst?: boolean, noFocusDefault?: boolean): boolean;\n}\n\ninterface RestorerAPIInternal {\n /** @internal */\n createRestorer(element: HTMLElement, props: RestorerProps): Restorer;\n}\n\nexport interface RestorerAPI extends RestorerAPIInternal, Disposable {}\n\nexport interface Restorer extends Disposable, TabsterPart<RestorerProps> {}\n/**\n * A signature for the accessibleCheck callback from getModalizer().\n * It is called when active Modalizer sets aria-hidden on elements outsidef of it.\n *\n * @param element - The element that is about to receive aria-hidden.\n * @param activeModalizerElements - The container elements of the active modalizer.\n * @returns true if the element should remain accessible and should not receive\n * aria-hidden.\n */\nexport type ModalizerElementAccessibleCheck = (\n element: HTMLElement,\n activeModalizerElements?: HTMLElement[],\n) => boolean;\n\nexport interface UncontrolledProps {\n // Normally, even uncontrolled areas should not be completely uncontrolled\n // to be able to interact with the rest of the application properly.\n // For example, if an uncontrolled area implements something like\n // roving tabindex, it should be uncontrolled inside the area, but it\n // still should be able to be an organic part of the application.\n // However, in some cases, third party component might want to be able\n // to gain full control of the area, for example, if it implements\n // some custom trap focus logic.\n // `completely` indicates that uncontrolled area must gain full control over\n // Tab handling. If not set, Tabster might still handle Tab in the\n // uncontrolled area, when, for example, there is an inactive Modalizer\n // (that needs to be skipped) after the last focusable element of the\n // uncontrolled area.\n // WARNING: Use with caution, as it might break the normal keyboard navigation\n // between the uncontrolled area and the rest of the application.\n completely?: boolean;\n}\n\nexport interface DeloserOnElement {\n deloser: Deloser;\n}\n\nexport interface RootOnElement {\n root: Root;\n}\n\nexport interface ModalizerOnElement {\n modalizer: Modalizer;\n}\n\nexport interface RestorerOnElement {\n restorer: Restorer;\n}\n\nexport interface FocusableOnElement {\n focusable: FocusableProps;\n}\n\nexport interface MoverOnElement {\n mover: Mover;\n}\n\nexport interface GroupperOnElement {\n groupper: Groupper;\n}\n\nexport interface UncontrolledOnElement {\n uncontrolled: UncontrolledProps;\n}\n\nexport interface ObservedOnElement {\n observed: ObservedElementProps;\n}\n\nexport interface OutlineOnElement {\n outline: OutlinedElementProps;\n}\n\nexport interface SysOnElement {\n sys: SysProps;\n}\n\nexport interface RestorerProps {\n type: RestorerType;\n}\n\nexport type TabsterAttributeProps = Partial<{\n deloser: DeloserProps;\n root: RootProps;\n uncontrolled: UncontrolledProps;\n modalizer: ModalizerProps;\n focusable: FocusableProps;\n groupper: GroupperProps;\n mover: MoverProps;\n observed: ObservedElementProps;\n outline: OutlinedElementProps;\n sys: SysProps;\n restorer: RestorerProps;\n}>;\n\nexport interface TabsterAttributeOnElement {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n string: string;\n object: TabsterAttributeProps;\n}\n\nexport interface TabsterAugmentedAttributes {\n [name: string]: string | null;\n}\n\nexport type TabsterOnElement = Partial<\n RootOnElement &\n DeloserOnElement &\n ModalizerOnElement &\n FocusableOnElement &\n MoverOnElement &\n GroupperOnElement &\n ObservedOnElement &\n OutlineOnElement &\n UncontrolledOnElement &\n SysOnElement &\n RestorerOnElement\n>;\n\nexport interface OutlineElements {\n container: HTMLDivElement;\n left: HTMLDivElement;\n top: HTMLDivElement;\n right: HTMLDivElement;\n bottom: HTMLDivElement;\n}\n\nexport interface TabsterElementStorageEntry {\n tabster?: TabsterOnElement;\n attr?: TabsterAttributeOnElement;\n aug?: TabsterAugmentedAttributes;\n}\n\nexport interface TabsterElementStorage {\n [uid: string]: TabsterElementStorageEntry;\n}\n\nexport type DisposeFunc = () => void;\n\nexport interface InternalAPI {\n stopObserver(): void;\n resumeObserver(syncState: boolean): void;\n}\n\nexport interface DummyInputObserver {\n add(dummy: HTMLElement, callback: () => void): void;\n remove(dummy: HTMLElement): void;\n dispose(): void;\n domChanged?(parent: HTMLElement): void;\n updatePositions(\n compute: (scrollTopLeftCache: Map<HTMLElement, { scrollTop: number; scrollLeft: number } | null>) => () => void,\n ): void;\n}\n\ninterface TabsterCoreInternal {\n /** @internal */\n groupper?: GroupperAPI;\n /** @internal */\n mover?: MoverAPI;\n /** @internal */\n outline?: OutlineAPI;\n /** @internal */\n deloser?: DeloserAPI;\n /** @internal */\n modalizer?: ModalizerAPI;\n /** @internal */\n observedElement?: ObservedElementAPI;\n /** @internal */\n crossOrigin?: CrossOriginAPI;\n /** @internal */\n internal: InternalAPI;\n /** @internal */\n restorer?: RestorerAPI;\n\n /** @internal */\n _dummyObserver: DummyInputObserver;\n\n // The version of the tabster package this instance is on\n /** @internal */\n _version: string;\n\n // No operation flag for the debugging purposes\n /** @internal */\n _noop: boolean;\n\n /** @internal */\n storageEntry(element: HTMLElement, addremove?: boolean): TabsterElementStorageEntry | undefined;\n /** @internal */\n getWindow: GetWindow;\n\n /** @internal */\n createTabster(noRefCount?: boolean, props?: TabsterCoreProps): Tabster;\n /** @internal */\n disposeTabster(wrapper: Tabster, allInstances?: boolean): void;\n /** @internal */\n forceCleanup(): void;\n\n /** @internal */\n queueInit(callback: () => void): void;\n /** @internal */\n drainInitQueue(): void;\n /** @internal */\n getParent: (el: Node) => Node | null;\n}\n\nexport interface Tabster {\n keyboardNavigation: KeyboardNavigationState;\n focusedElement: FocusedElementState;\n focusable: FocusableAPI;\n root: RootAPI;\n uncontrolled: UncontrolledAPI;\n\n /** @internal */\n core: TabsterCore;\n}\n\nexport interface TabsterCore\n extends Pick<TabsterCoreProps, 'controlTab' | 'rootDummyInputs'>,\n Disposable,\n TabsterCoreInternal,\n Omit<Tabster, 'core'> {}\n\nexport interface TabsterCompat {\n attributeTransform?: <P>(old: P) => TabsterAttributeProps;\n}\n"],"names":["TabsterAttributeName","TabsterDummyInputAttributeName","DeloserEventName","ModalizerActiveEventName","ModalizerInactiveEventName","ModalizerFocusInEventName","ModalizerFocusOutEventName","ModalizerBeforeFocusOutEventName","MoverEventName","FocusInEventName","FocusOutEventName","MoveFocusEventName","MoverMoveFocusEventName","GroupperMoveFocusEventName","FocusableSelector","join","GroupperMoveFocusActions","Enter","Escape","ObservedElementAccesibilities","Any","Accessible","Focusable","RestoreFocusOrders","History","DeloserDefault","RootDefault","DeloserFirst","RootFirst","Visibilities","Invisible","PartiallyVisible","Visible","RestorerTypes","Source","Target","MoverDirections","Both","Vertical","Horizontal","Grid","GridLinear","MoverKeys","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End","GroupperTabbabilities","Unlimited","Limited","LimitedTrapFocus","SysDummyInputsPositions","Auto","Inside","Outside"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;CAGC,GAED;;;;;;;;;;;CAWC,GAED,OAAO,MAAMA,uBAAuB,eAAe;AACnD,OAAO,MAAMC,iCAAiC,qBAAqB;AACnE,OAAO,MAAMC,mBAAmB,kBAAkB;AAClD,OAAO,MAAMC,2BAA2B,2BAA2B;AACnE,OAAO,MAAMC,6BAA6B,6BAA6B;AACvE,OAAO,MAAMC,4BAA4B,4BAA4B;AACrE,OAAO,MAAMC,6BAA6B,6BAA6B;AACvE,OAAO,MAAMC,mCAAmC,mCAAmC;AACnF,OAAO,MAAMC,iBAAiB,gBAAgB;AAC9C,OAAO,MAAMC,mBAAmB,kBAAkB;AAClD,OAAO,MAAMC,oBAAoB,mBAAmB;AAEpD,0EAA0E;AAC1E,sEAAsE;AACtE,qBAAqB;AACrB,OAAO,MAAMC,qBAAqB,oBAAoB;AAEtD,0EAA0E;AAC1E,sBAAsB;AACtB,OAAO,MAAMC,0BAA0B,0BAA0B;AACjE,2EAA2E;AAC3E,sBAAsB;AACtB,OAAO,MAAMC,6BAA6B,6BAA6B;AAEvE,OAAO,MAAMC,oBAAoB;IAC/B;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAACC,IAAI,CAAC,MAAM;AAUb,OAAO,MAAMC,2BAAqD;IAChEC,OAAO;IACPC,QAAQ;AACV,EAAE;AA0KF,OAAO,MAAMC,gCAA+D;IAC1EC,KAAK;IACLC,YAAY;IACZC,WAAW;AACb,EAAE;AAsJF,OAAO,MAAMC,qBAAyC;IACpDC,SAAS;IACTC,gBAAgB;IAChBC,aAAa;IACbC,cAAc;IACdC,WAAW;AACb,EAAE;AAqOF,OAAO,MAAMC,eAA6B;IACxCC,WAAW;IACXC,kBAAkB;IAClBC,SAAS;AACX,EAAE;AAgBF,OAAO,MAAMC,gBAAgB;IAC3BC,QAAQ;IACRC,QAAQ;AACV,EAAW;AAIX,OAAO,MAAMC,kBAAmC;IAC9CC,MAAM;IACNC,UAAU;IACVC,YAAY;IACZC,MAAM;IACNC,YAAY;AACd,EAAE;AAkFF,OAAO,MAAMC,YAAuB;IAClCC,SAAS;IACTC,WAAW;IACXC,WAAW;IACXC,YAAY;IACZC,QAAQ;IACRC,UAAU;IACVC,MAAM;IACNC,KAAK;AACP,EAAE;AAYF,OAAO,MAAMC,wBAA+C;IAC1DC,WAAW;IACXC,SAAS;IACTC,kBAAkB;AACpB,EAAE;AAyGF,OAAO,MAAMC,0BAAmD;IAC9DC,MAAM;IACNC,QAAQ;IACRC,SAAS;AACX,EAAE"}
1
+ {"version":3,"sources":["../src/tabster-types-6.0.1-do-not-use.ts"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!\n * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!\n *\n * Do not use anything from this file. It is a snapshot of the older Tabster typings exposed by a mistake.\n * The exposed typings should have been removed, but we don't do it in minor versions to avoid breaking changes.\n * Everything reexported from this file as react-tabster/TabsterTypes is marked as deprecated and shouldn't\n * be used anywhre.\n *\n * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!\n * WARNING! ATTENTION! WARNING! ATTENTION! WARNING! ATTENTION!\n */\n\nexport const TabsterAttributeName = 'data-tabster';\nexport const TabsterDummyInputAttributeName = 'data-tabster-dummy';\nexport const DeloserEventName = 'tabster:deloser';\nexport const ModalizerActiveEventName = 'tabster:modalizer:active';\nexport const ModalizerInactiveEventName = 'tabster:modalizer:inactive';\nexport const ModalizerFocusInEventName = 'tabster:modalizer:focusin';\nexport const ModalizerFocusOutEventName = 'tabster:modalizer:focusout';\nexport const ModalizerBeforeFocusOutEventName = 'tabster:modalizer:beforefocusout';\nexport const MoverEventName = 'tabster:mover';\nexport const FocusInEventName = 'tabster:focusin';\nexport const FocusOutEventName = 'tabster:focusout';\n\n// Event to be triggered when Tabster wants to move focus as the result of\n// keyboard event. This allows to preventDefault() if you want to have\n// some custom logic.\nexport const MoveFocusEventName = 'tabster:movefocus';\n\n// Event that can be triggered by the application to programmatically move\n// focus inside Mover.\nexport const MoverMoveFocusEventName = 'tabster:mover:movefocus';\n// Event that can be triggered by the application to programmatically enter\n// or escape Groupper.\nexport const GroupperMoveFocusEventName = 'tabster:groupper:movefocus';\n\nexport const FocusableSelector = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '*[tabindex]',\n '*[contenteditable]',\n].join(', ');\n\n// Trigger move focus event on a Mover element.\nexport type MoverMoveFocusEvent = CustomEvent<{ key: MoverKey } | undefined>;\n\nexport interface GroupperMoveFocusActions {\n Enter: 1;\n Escape: 2;\n}\nexport type GroupperMoveFocusAction = GroupperMoveFocusActions[keyof GroupperMoveFocusActions];\nexport const GroupperMoveFocusActions: GroupperMoveFocusActions = {\n Enter: 1,\n Escape: 2,\n};\n\n// Enter or escape Groupper. Enter when `enter` is true, escape when `enter` is false.\nexport type GroupperMoveFocusEvent = CustomEvent<{ action: GroupperMoveFocusAction } | undefined>;\n\nexport type TabsterEventWithDetails<D> = CustomEvent<D | undefined>;\n\nexport interface TabsterMoveFocusEventDetails {\n by: 'mover' | 'groupper' | 'modalizer' | 'root';\n owner: HTMLElement; // Mover, Groupper, Modalizer or Root, the initiator.\n next: HTMLElement | null; // Next element to focus or null if Tabster wants to go outside of Root (i.e. to the address bar of the browser).\n relatedEvent?: KeyboardEvent; // The original keyboard event that triggered the move.\n}\n\nexport type TabsterMoveFocusEvent = TabsterEventWithDetails<TabsterMoveFocusEventDetails>;\n\nexport interface TabsterDOMAttribute {\n [TabsterAttributeName]: string | undefined;\n}\n\nexport interface TabsterCoreProps {\n autoRoot?: RootProps;\n /**\n * Allows all tab key presses under the tabster root to be controlled by tabster\n * @default true\n */\n controlTab?: boolean;\n /**\n * When controlTab is false, Root doesn't have dummy inputs by default.\n * This option allows to enable dummy inputs on Root.\n */\n rootDummyInputs?: boolean;\n /**\n * A callback that will be called for the uncontrolled areas when Tabster wants\n * to know is the uncontrolled element wants complete control (for example it\n * is trapping focus) and Tabster should not interfere with handling Tab.\n * If the callback returns undefined, then the default behaviour is to return\n * the uncontrolled.completely value from the element. If the callback returns\n * non-undefined value, the callback's value will dominate the element's\n * uncontrolled.completely value.\n */\n checkUncontrolledCompletely?: (\n element: HTMLElement,\n completely: boolean, // A uncontrolled.completely value from the element.\n ) => boolean | undefined;\n /**\n * @deprecated use checkUncontrolledCompletely.\n */\n checkUncontrolledTrappingFocus?: (element: HTMLElement) => boolean;\n /**\n * Custom getter for parent elements. Defaults to the default .parentElement call\n * Currently only used to detect tabster contexts\n */\n getParent?(el: Node): Node | null;\n /**\n * Ability to redefine all DOM API calls used by Tabster. For example, for\n * ShadowDOM support.\n */\n DOMAPI?: Partial<DOMAPI>;\n}\n\nexport interface DOMAPI {\n // TODO: exclude types from this lint rule: https://github.com/microsoft/fluentui/issues/31286\n\n createMutationObserver: (callback: MutationCallback) => MutationObserver;\n createTreeWalker(doc: Document, root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker;\n getParentNode(node: Node | null | undefined): ParentNode | null;\n getParentElement(element: HTMLElement | null | undefined): HTMLElement | null;\n nodeContains(parent: Node | null | undefined, child: Node | null | undefined): boolean;\n getActiveElement(doc: Document): Element | null;\n querySelector(element: ParentNode, selector: string): Element | null;\n querySelectorAll(element: ParentNode, selector: string): Element[];\n getElementById(doc: Document, id: string): HTMLElement | null;\n getFirstChild(node: Node | null | undefined): ChildNode | null;\n getLastChild(node: Node | null | undefined): ChildNode | null;\n getNextSibling(node: Node | null | undefined): ChildNode | null;\n getPreviousSibling(node: Node | null | undefined): ChildNode | null;\n getFirstElementChild(element: Element | null | undefined): Element | null;\n getLastElementChild(element: Element | null | undefined): Element | null;\n getNextElementSibling(element: Element | null | undefined): Element | null;\n getPreviousElementSibling(element: Element | null | undefined): Element | null;\n appendChild(parent: Node, child: Node): Node;\n insertBefore(parent: Node, child: Node, referenceChild: Node | null): Node;\n getSelection(ref: Node): Selection | null;\n}\n\nexport type GetTabster = () => TabsterCore;\nexport type GetWindow = () => Window;\n\nexport type SubscribableCallback<A, B = undefined> = (val: A, details: B) => void;\n\nexport interface Disposable {\n /** @internal */\n dispose(): void;\n}\n\nexport interface Subscribable<A, B = undefined> {\n subscribe(callback: SubscribableCallback<A, B>): void;\n /** @internal */\n subscribeFirst(callback: SubscribableCallback<A, B>): void;\n unsubscribe(callback: SubscribableCallback<A, B>): void;\n}\n\nexport interface KeyboardNavigationState extends Subscribable<boolean>, Disposable {\n isNavigatingWithKeyboard(): boolean;\n setNavigatingWithKeyboard(isNavigatingWithKeyboard: boolean): void;\n}\n\nexport interface FocusedElementDetails {\n relatedTarget?: HTMLElement;\n isFocusedProgrammatically?: boolean;\n modalizerId?: string;\n}\n\nexport interface FocusedElementState extends Subscribable<HTMLElement | undefined, FocusedElementDetails>, Disposable {\n getFocusedElement(): HTMLElement | undefined;\n getLastFocusedElement(): HTMLElement | undefined;\n focus(element: HTMLElement, noFocusedProgrammaticallyFlag?: boolean, noAccessibleCheck?: boolean): boolean;\n focusDefault(container: HTMLElement): boolean;\n /** @internal */\n getFirstOrLastTabbable(\n isFirst: boolean,\n props: Pick<FindFocusableProps, 'container' | 'ignoreAccessibility'>,\n ): HTMLElement | undefined;\n focusFirst(props: FindFirstProps): boolean;\n focusLast(props: FindFirstProps): boolean;\n resetFocus(container: HTMLElement): boolean;\n}\n\nexport interface WeakHTMLElement<D = undefined> {\n get(): HTMLElement | undefined;\n getData(): D | undefined;\n}\n\nexport interface TabsterPart<P> {\n readonly id: string;\n getElement(): HTMLElement | undefined;\n getProps(): P;\n setProps(props: P): void;\n}\n\nexport interface TabsterPartWithFindNextTabbable {\n findNextTabbable(\n current?: HTMLElement,\n reference?: HTMLElement,\n isBackward?: boolean,\n ignoreAccessibility?: boolean,\n ): NextTabbable | null;\n}\n\nexport interface TabsterPartWithAcceptElement {\n acceptElement(element: HTMLElement, state: FocusableAcceptElementState): number | undefined;\n}\n\nexport interface ObservedElementProps {\n names: string[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n details?: any;\n}\n\nexport interface ObservedElementDetails extends ObservedElementProps {\n accessibility?: ObservedElementAccesibility;\n}\n\nexport interface ObservedElementAccesibilities {\n Any: 0;\n Accessible: 1;\n Focusable: 2;\n}\nexport type ObservedElementAccesibility = ObservedElementAccesibilities[keyof ObservedElementAccesibilities];\nexport const ObservedElementAccesibilities: ObservedElementAccesibilities = {\n Any: 0,\n Accessible: 1,\n Focusable: 2,\n};\n\nexport interface ObservedElementAsyncRequest<T> {\n result: Promise<T>;\n cancel(): void;\n}\n\ninterface ObservedElementAPIInternal {\n /** @internal */\n onObservedElementUpdate(element: HTMLElement): void;\n}\n\nexport interface ObservedElementAPI\n extends Subscribable<HTMLElement, ObservedElementDetails>,\n Disposable,\n ObservedElementAPIInternal {\n getElement(observedName: string, accessibility?: ObservedElementAccesibility): HTMLElement | null;\n waitElement(\n observedName: string,\n timeout: number,\n accessibility?: ObservedElementAccesibility,\n ): ObservedElementAsyncRequest<HTMLElement | null>;\n requestFocus(observedName: string, timeout: number): ObservedElementAsyncRequest<boolean>;\n}\n\nexport interface CrossOriginElement {\n readonly uid: string;\n readonly ownerId: string;\n readonly id?: string;\n readonly rootId?: string;\n readonly observedName?: string;\n readonly observedDetails?: string;\n focus(noFocusedProgrammaticallyFlag?: boolean, noAccessibleCheck?: boolean): Promise<boolean>;\n}\n\nexport interface CrossOriginSentTo {\n [id: string]: true;\n}\n\nexport interface CrossOriginTransactionTypes {\n Bootstrap: 1;\n FocusElement: 2;\n State: 3;\n GetElement: 4;\n RestoreFocusInDeloser: 5;\n Ping: 6;\n}\nexport type CrossOriginTransactionType = CrossOriginTransactionTypes[keyof CrossOriginTransactionTypes];\n\nexport interface CrossOriginTransactionData<I, O> {\n transaction: string;\n type: CrossOriginTransactionType;\n isResponse: boolean;\n timestamp: number;\n owner: string;\n sentto: CrossOriginSentTo;\n timeout?: number;\n target?: string;\n beginData?: I;\n endData?: O;\n}\n\nexport type CrossOriginTransactionSend = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: CrossOriginTransactionData<any, any>,\n) => void;\n\nexport interface CrossOriginMessage {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data: CrossOriginTransactionData<any, any>;\n send: CrossOriginTransactionSend;\n}\n\nexport interface CrossOriginFocusedElementState\n extends Subscribable<CrossOriginElement | undefined, FocusedElementDetails>,\n Disposable {\n focus(\n element: CrossOriginElement,\n noFocusedProgrammaticallyFlag?: boolean,\n noAccessibleCheck?: boolean,\n ): Promise<boolean>;\n focusById(\n elementId: string,\n rootId?: string,\n noFocusedProgrammaticallyFlag?: boolean,\n noAccessibleCheck?: boolean,\n ): Promise<boolean>;\n focusByObservedName(\n observedName: string,\n timeout?: number,\n rootId?: string,\n noFocusedProgrammaticallyFlag?: boolean,\n noAccessibleCheck?: boolean,\n ): Promise<boolean>;\n}\n\nexport interface CrossOriginObservedElementState\n extends Subscribable<CrossOriginElement, ObservedElementProps>,\n Disposable {\n getElement(observedName: string, accessibility?: ObservedElementAccesibility): Promise<CrossOriginElement | null>;\n waitElement(\n observedName: string,\n timeout: number,\n accessibility?: ObservedElementAccesibility,\n ): Promise<CrossOriginElement | null>;\n requestFocus(observedName: string, timeout: number): Promise<boolean>;\n}\n\nexport interface CrossOriginAPI {\n focusedElement: CrossOriginFocusedElementState;\n observedElement: CrossOriginObservedElementState;\n\n setup(sendUp?: CrossOriginTransactionSend | null): (msg: CrossOriginMessage) => void;\n isSetUp(): boolean;\n dispose(): void;\n}\n\nexport interface OutlineProps {\n areaClass: string;\n outlineClass: string;\n outlineColor: string;\n outlineWidth: number;\n zIndex: number;\n}\n\nexport interface OutlinedElementProps {\n isIgnored?: boolean;\n}\n\nexport interface OutlineAPI extends Disposable {\n setup(props?: Partial<OutlineProps>): void;\n}\n\nexport interface DeloserElementActions {\n focusDefault: () => boolean;\n focusFirst: () => boolean;\n resetFocus: () => boolean;\n clearHistory: (preserveExisting?: boolean) => void;\n setSnapshot: (index: number) => void;\n isActive: () => boolean;\n}\n\nexport interface RestoreFocusOrders {\n History: 0;\n DeloserDefault: 1;\n RootDefault: 2;\n DeloserFirst: 3;\n RootFirst: 4;\n}\nexport type RestoreFocusOrder = RestoreFocusOrders[keyof RestoreFocusOrders];\nexport const RestoreFocusOrders: RestoreFocusOrders = {\n History: 0,\n DeloserDefault: 1,\n RootDefault: 2,\n DeloserFirst: 3,\n RootFirst: 4,\n};\n\nexport interface DeloserProps {\n restoreFocusOrder?: RestoreFocusOrder;\n noSelectorCheck?: boolean;\n}\n\nexport interface Deloser extends TabsterPart<DeloserProps> {\n readonly uid: string;\n dispose(): void;\n isActive(): boolean;\n setActive(active: boolean): void;\n getActions(): DeloserElementActions;\n setSnapshot(index: number): void;\n focusFirst(): boolean;\n unshift(element: HTMLElement): void;\n focusDefault(): boolean;\n resetFocus(): boolean;\n findAvailable(): HTMLElement | null;\n clearHistory(preserveExisting?: boolean): void;\n customFocusLostHandler(element: HTMLElement): boolean;\n}\n\nexport type DeloserConstructor = (element: HTMLElement, props: DeloserProps) => Deloser;\n\ninterface DeloserInterfaceInternal {\n /** @internal */\n createDeloser(element: HTMLElement, props: DeloserProps): Deloser;\n}\n\nexport interface DeloserAPI extends DeloserInterfaceInternal, Disposable {\n getActions(element: HTMLElement): DeloserElementActions | undefined;\n pause(): void;\n resume(restore?: boolean): void;\n}\n\nexport interface FocusableProps {\n isDefault?: boolean;\n isIgnored?: boolean;\n /**\n * Do not determine an element's focusability based on aria-disabled.\n */\n ignoreAriaDisabled?: boolean;\n /**\n * Exclude element (and all subelements) from Mover navigation.\n */\n excludeFromMover?: boolean;\n /**\n * Prevents tabster from handling the keydown event\n */\n ignoreKeydown?: {\n Tab?: boolean;\n Escape?: boolean;\n Enter?: boolean;\n ArrowUp?: boolean;\n ArrowDown?: boolean;\n ArrowLeft?: boolean;\n ArrowRight?: boolean;\n PageUp?: boolean;\n PageDown?: boolean;\n Home?: boolean;\n End?: boolean;\n };\n}\n\nexport interface FocusableAcceptElementState {\n container: HTMLElement;\n modalizerUserId?: string;\n currentCtx?: TabsterContext;\n from: HTMLElement;\n fromCtx?: TabsterContext;\n isBackward?: boolean;\n found?: boolean;\n foundElement?: HTMLElement;\n foundBackward?: HTMLElement;\n rejectElementsFrom?: HTMLElement;\n uncontrolled?: HTMLElement;\n acceptCondition: (el: HTMLElement) => boolean;\n hasCustomCondition?: boolean;\n includeProgrammaticallyFocusable?: boolean;\n ignoreAccessibility?: boolean;\n cachedGrouppers: {\n [id: string]: {\n isActive: boolean | undefined;\n first?: HTMLElement | null;\n };\n };\n isFindAll?: boolean;\n /**\n * A flag that indicates that some focusable elements were skipped\n * during the search and the found element is not the one the browser\n * would normally focus if the user pressed Tab.\n */\n skippedFocusable?: boolean;\n}\n\nexport interface FindFocusableProps {\n /**\n * The container used for the search.\n */\n container: HTMLElement;\n /**\n * The elemet to start from.\n */\n currentElement?: HTMLElement;\n /**\n * See `referenceElement` of GetTabsterContextOptions for description.\n */\n referenceElement?: HTMLElement;\n /**\n * Includes elements that can be focused programmatically.\n */\n includeProgrammaticallyFocusable?: boolean;\n /**\n * Ignore accessibility check.\n */\n ignoreAccessibility?: boolean;\n /**\n * Take active modalizer into account when searching for elements\n * (the elements out of active modalizer will not be returned).\n */\n useActiveModalizer?: boolean;\n /**\n * Search withing the specified modality, null for everything outside of modalizers, string within\n * a specific id, undefined for search within the current application state.\n */\n modalizerId?: string | null;\n /**\n * If true, find previous element instead of the next one.\n */\n isBackward?: boolean;\n /**\n * @param el - element visited.\n * @returns if an element should be accepted.\n */\n acceptCondition?(el: HTMLElement): boolean;\n /**\n * A callback that will be called for every focusable element found during findAll().\n * If false is returned from this callback, the search will stop.\n */\n onElement?: FindElementCallback;\n}\n\nexport interface FindFocusableOutputProps {\n /**\n * An output parameter. Will be true after the findNext/findPrev() call if some focusable\n * elements were skipped during the search and the result element not immediately next\n * focusable after the currentElement.\n */\n outOfDOMOrder?: boolean;\n /**\n * An output parameter. Will be true if the found element is uncontrolled.\n */\n uncontrolled?: HTMLElement | null;\n}\n\nexport type FindFirstProps = Pick<\n FindFocusableProps,\n 'container' | 'modalizerId' | 'includeProgrammaticallyFocusable' | 'useActiveModalizer' | 'ignoreAccessibility'\n>;\n\nexport type FindNextProps = Pick<\n FindFocusableProps,\n | 'currentElement'\n | 'referenceElement'\n | 'container'\n | 'modalizerId'\n | 'includeProgrammaticallyFocusable'\n | 'useActiveModalizer'\n | 'ignoreAccessibility'\n>;\n\nexport type FindDefaultProps = Pick<\n FindFocusableProps,\n 'container' | 'modalizerId' | 'includeProgrammaticallyFocusable' | 'useActiveModalizer' | 'ignoreAccessibility'\n>;\n\nexport type FindAllProps = Pick<\n FindFocusableProps,\n | 'container'\n | 'modalizerId'\n | 'currentElement'\n | 'isBackward'\n | 'includeProgrammaticallyFocusable'\n | 'useActiveModalizer'\n | 'acceptCondition'\n | 'ignoreAccessibility'\n | 'onElement'\n>;\n\n/**\n * A callback that is called for every found element during search. Returning false stops search.\n */\nexport type FindElementCallback = (element: HTMLElement) => boolean;\n\nexport interface FocusableAPI extends Disposable {\n getProps(element: HTMLElement): FocusableProps;\n\n isFocusable(\n element: HTMLElement,\n includeProgrammaticallyFocusable?: boolean,\n noVisibleCheck?: boolean,\n noAccessibleCheck?: boolean,\n ): boolean;\n isVisible(element: HTMLElement): boolean;\n isAccessible(element: HTMLElement): boolean;\n // find* return null when there is no element and undefined when there is an uncontrolled area.\n findFirst(options: FindFirstProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;\n findLast(options: FindFirstProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;\n findNext(options: FindNextProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;\n findPrev(options: FindNextProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;\n findDefault(options: FindDefaultProps, out?: FindFocusableOutputProps): HTMLElement | null;\n /**\n * @returns All focusables in a given context that satisfy an given condition\n */\n findAll(options: FindAllProps): HTMLElement[];\n findElement(options: FindFocusableProps, out?: FindFocusableOutputProps): HTMLElement | null | undefined;\n}\n\nexport interface DummyInputManager {\n moveOut: (backwards: boolean) => void;\n moveOutWithDefaultAction: (backwards: boolean, relatedEvent: KeyboardEvent) => void;\n}\n\nexport interface Visibilities {\n Invisible: 0;\n PartiallyVisible: 1;\n Visible: 2;\n}\nexport const Visibilities: Visibilities = {\n Invisible: 0,\n PartiallyVisible: 1,\n Visible: 2,\n};\nexport type Visibility = Visibilities[keyof Visibilities];\n\nexport interface MoverElementState {\n isCurrent: boolean | undefined; // Tri-state bool. Undefined when there is no current in the container.\n visibility: Visibility;\n}\n\nexport interface MoverDirections {\n Both: 0; // Default, both left/up keys move to the previous, right/down move to the next.\n Vertical: 1; // Only up/down arrows move to the next/previous.\n Horizontal: 2; // Only left/right arrows move to the next/previous.\n Grid: 3; // Two-dimentional movement depending on the visual placement.\n GridLinear: 4; // Two-dimentional movement depending on the visual placement. Allows linear movement.\n}\n\nexport const RestorerTypes = {\n Source: 0,\n Target: 1,\n} as const;\n\nexport type RestorerType = (typeof RestorerTypes)[keyof typeof RestorerTypes];\n\nexport const MoverDirections: MoverDirections = {\n Both: 0,\n Vertical: 1,\n Horizontal: 2,\n Grid: 3,\n GridLinear: 4,\n};\nexport type MoverDirection = MoverDirections[keyof MoverDirections];\n\nexport type NextTabbable = {\n element: HTMLElement | null | undefined;\n uncontrolled?: HTMLElement | null;\n outOfDOMOrder?: boolean;\n};\n\nexport interface MoverProps {\n direction?: MoverDirection;\n memorizeCurrent?: boolean;\n tabbable?: boolean;\n /**\n * Whether to allow cyclic navigation in the mover\n * Can only be applied if navigationType is MoverKeys.Arrows\n *\n * @defaultValue false\n */\n cyclic?: boolean;\n /**\n * In case we need a rich state of the elements inside a Mover,\n * we can track it. It takes extra resourses and might affect\n * performance when a Mover has many elements inside, so make sure\n * you use this prop when it is really needed.\n */\n trackState?: boolean;\n /**\n * When set to Visibility.Visible or Visibility.PartiallyVisible,\n * uses the visibility part of the trackState prop to be able to\n * go to first/last visible element (instead of first/last focusable\n * element in DOM) when tabbing from outside of the mover.\n */\n visibilityAware?: Visibility;\n /**\n * When true, Mover will try to locate a focusable with Focusable.isDefault\n * property as a prioritized element to focus. True by default.\n */\n hasDefault?: boolean;\n /**\n * A value between 0 and 1 that specifies the tolerance allowed\n * when testing for visibility.\n *\n * @example\n * an element of height 100px has 10px that are above the viewport\n * hidden by scroll. This element is a valid visible element to focus.\n *\n * @default 0.8\n */\n visibilityTolerance?: number;\n}\n\nexport type MoverEvent = TabsterEventWithDetails<MoverElementState>;\n\nexport interface Mover extends TabsterPart<MoverProps>, TabsterPartWithFindNextTabbable, TabsterPartWithAcceptElement {\n readonly id: string;\n readonly dummyManager: DummyInputManager | undefined;\n readonly visibilityTolerance: NonNullable<MoverProps['visibilityTolerance']>;\n dispose(): void;\n setCurrent(element: HTMLElement | undefined): void;\n getCurrent(): HTMLElement | null;\n getState(element: HTMLElement): MoverElementState | undefined;\n}\n\nexport type MoverConstructor = (tabster: TabsterCore, element: HTMLElement, props: MoverProps) => Mover;\n\ninterface MoverAPIInternal {\n /** @internal */\n createMover(element: HTMLElement, props: MoverProps, sys: SysProps | undefined): Mover;\n}\n\nexport interface MoverKeys {\n ArrowUp: 1;\n ArrowDown: 2;\n ArrowLeft: 3;\n ArrowRight: 4;\n PageUp: 5;\n PageDown: 6;\n Home: 7;\n End: 8;\n}\nexport type MoverKey = MoverKeys[keyof MoverKeys];\nexport const MoverKeys: MoverKeys = {\n ArrowUp: 1,\n ArrowDown: 2,\n ArrowLeft: 3,\n ArrowRight: 4,\n PageUp: 5,\n PageDown: 6,\n Home: 7,\n End: 8,\n};\n\nexport interface MoverAPI extends MoverAPIInternal, Disposable {\n /** @internal (will likely be exposed once the API is fully stable) */\n moveFocus(fromElement: HTMLElement, key: MoverKey): HTMLElement | null;\n}\n\nexport interface GroupperTabbabilities {\n Unlimited: 0;\n Limited: 1; // The tabbability is limited to the container and explicit Enter is needed to go inside.\n LimitedTrapFocus: 2; // The focus is limited as above, plus trapped when inside.\n}\nexport const GroupperTabbabilities: GroupperTabbabilities = {\n Unlimited: 0,\n Limited: 1,\n LimitedTrapFocus: 2,\n};\nexport type GroupperTabbability = GroupperTabbabilities[keyof GroupperTabbabilities];\n\nexport interface GroupperProps {\n tabbability?: GroupperTabbability;\n delegated?: boolean; // This allows to tweak the groupper behaviour for the cases when\n // the groupper container is not focusable and groupper has Limited or LimitedTrapFocus\n // tabbability. By default, the groupper will automatically become active once the focus\n // goes to first focusable element inside the groupper during tabbing. When true, the\n // groupper will become active only after Enter is pressed on first focusable element\n // inside the groupper.\n}\n\nexport interface Groupper\n extends TabsterPart<GroupperProps>,\n TabsterPartWithFindNextTabbable,\n TabsterPartWithAcceptElement {\n readonly id: string;\n readonly dummyManager: DummyInputManager | undefined;\n dispose(): void;\n makeTabbable(isUnlimited: boolean): void;\n isActive(noIfFirstIsFocused?: boolean): boolean | undefined; // Tri-state boolean, undefined when parent is not active, false when parent is active.\n setFirst(element: HTMLElement | undefined): void;\n getFirst(orContainer: boolean): HTMLElement | undefined;\n}\n\nexport type GroupperConstructor = (tabster: TabsterCore, element: HTMLElement, props: GroupperProps) => Groupper;\n\nexport interface GroupperAPIInternal {\n /** @internal */\n createGroupper(element: HTMLElement, props: GroupperProps, sys: SysProps | undefined): Groupper;\n /** @internal */\n handleKeyPress(element: HTMLElement, event: KeyboardEvent, fromModalizer?: boolean): void;\n}\n\nexport interface GroupperAPI extends GroupperAPIInternal, Disposable {\n /** @internal (will likely be exposed once the API is fully stable) */\n moveFocus(element: HTMLElement, action: GroupperMoveFocusAction): HTMLElement | null;\n}\n\nexport interface GroupperAPIInternal {\n forgetCurrentGrouppers(): void;\n}\n\nexport interface ModalizerProps {\n id: string;\n isOthersAccessible?: boolean;\n isAlwaysAccessible?: boolean;\n isNoFocusFirst?: boolean;\n isNoFocusDefault?: boolean;\n /** A focus trap variant, keeps focus inside the modal when tabbing */\n isTrapped?: boolean;\n}\n\nexport type ModalizerEventName =\n | typeof ModalizerActiveEventName\n | typeof ModalizerInactiveEventName\n | typeof ModalizerBeforeFocusOutEventName\n | typeof ModalizerFocusInEventName\n | typeof ModalizerFocusOutEventName;\n\nexport type ModalizerEventDetails = {\n id: string;\n element: HTMLElement;\n eventName: ModalizerEventName;\n};\n\nexport type ModalizerEvent = TabsterEventWithDetails<ModalizerEventDetails>;\n\nexport interface Modalizer extends TabsterPart<ModalizerProps>, TabsterPartWithFindNextTabbable {\n readonly userId: string;\n readonly dummyManager: DummyInputManager | undefined;\n /**\n * @returns - Whether the element is inside the modalizer\n */\n contains(element: HTMLElement): boolean;\n dispose(): void;\n isActive(): boolean;\n makeActive(isActive: boolean): void;\n focused(noIncrement?: boolean): number;\n triggerFocusEvent(eventName: ModalizerEventName, allElements: boolean): boolean;\n}\n\nexport type ModalizerConstructor = (tabster: TabsterCore, element: HTMLElement, props: ModalizerProps) => Modalizer;\n\nexport interface RootProps {\n restoreFocusOrder?: RestoreFocusOrder;\n}\n\nexport interface Root extends TabsterPart<RootProps> {\n /**@internal*/\n addDummyInputs(): void;\n\n readonly uid: string;\n dispose(): void;\n moveOutWithDefaultAction(backwards: boolean, relatedEvent: KeyboardEvent): void;\n}\n\nexport type RootConstructor = (tabster: TabsterCore, element: HTMLElement, props: RootProps) => Root;\n\nexport interface SysDummyInputsPositions {\n Auto: 0; // Tabster will place dummy inputs depending on the container tag name and on the default behaviour.\n Inside: 1; // Tabster will always place dummy inputs inside the container.\n Outside: 2; // Tabster will always place dummy inputs outside of the container.\n}\nexport const SysDummyInputsPositions: SysDummyInputsPositions = {\n Auto: 0,\n Inside: 1,\n Outside: 2,\n};\nexport type SysDummyInputsPosition = SysDummyInputsPositions[keyof SysDummyInputsPositions];\n/**\n * Ability to fine-tune Tabster internal behaviour in rare cases of need.\n * Normally, should not be used. A deep understanding of the intention and the effect\n * is required.\n */\nexport interface SysProps {\n /**\n * Force dummy input position outside or inside of the element.\n * By default (when undefined), the position is determined dynamically\n * (for example inside for <li> elements and outside for <table> elements,\n * plus a default Groupper/Mover/Modalizer implementation position).\n * Setting to true will force the dummy inputs to be always outside of the element,\n * setting to false will force the dummy inputs to be always inside.\n */\n dummyInputsPosition?: SysDummyInputsPosition;\n}\n\nexport interface GetTabsterContextOptions {\n /**\n * Should visit **all** element ancestors to verify if `dir='rtl'` is set\n */\n checkRtl?: boolean;\n /**\n * The element to start computing the context from. Useful when dealing\n * with nested structures. For example, if we have an element inside a groupper\n * inside another groupper, the `groupper` prop in this element's contexts will\n * be the inner groupper, but when we pass the inner groupper's parent element\n * as `referenceElement`, the context groupper will be the outer one. Having\n * this option simplifies searching for the next tabbable element in the\n * environment of nested movers and grouppers.\n */\n referenceElement?: HTMLElement;\n}\n\nexport type TabsterContextMoverGroupper = { isMover: true; mover: Mover } | { isMover: false; groupper: Groupper };\n\nexport interface TabsterContext {\n root: Root;\n modalizer?: Modalizer;\n groupper?: Groupper;\n mover?: Mover;\n groupperBeforeMover?: boolean;\n modalizerInGroupper?: Groupper;\n /**\n * Whether `dir='rtl'` is set on an ancestor\n */\n rtl?: boolean;\n excludedFromMover?: boolean;\n uncontrolled?: HTMLElement | null;\n ignoreKeydown: (e: KeyboardEvent) => boolean;\n}\n\nexport interface RootFocusEventDetails {\n element: HTMLElement;\n}\n\ninterface RootAPIInternal {\n /**@internal*/\n createRoot(element: HTMLElement, props: RootProps, sys: SysProps | undefined): Root;\n /**@internal*/\n onRoot(root: Root, removed?: boolean): void;\n /**@internal*/\n addDummyInputs(): void;\n}\n\nexport interface RootAPI extends Disposable, RootAPIInternal {\n eventTarget: EventTarget;\n}\n\nexport interface UncontrolledAPI {\n isUncontrolledCompletely(element: HTMLElement, completely: boolean): boolean;\n}\n\ninterface ModalizerAPIInternal extends TabsterPartWithAcceptElement {\n /** @internal */\n activeId: string | undefined; // currently active Modalizer user id.\n /** @internal */\n currentIsOthersAccessible: boolean | undefined; // isOthersAccessible value of the currently active Modalizer.\n /** @internal */\n activeElements: WeakHTMLElement<HTMLElement>[];\n /** @internal */\n createModalizer(element: HTMLElement, props: ModalizerProps, sys: SysProps | undefined): Modalizer;\n /**\n * Sets active modalizers.\n * When active, everything outside of the modalizers with the specific user\n * defined id gets `aria-hidden`.\n *\n * @param userId - user defined identifier or undefined (if nothing is modal).\n */\n /** @internal */\n setActive(modalizer: Modalizer | undefined): void;\n /** @internal */\n hiddenUpdate(): void;\n /** @internal */\n isAugmented(element: HTMLElement): boolean;\n}\n\nexport interface ModalizerAPI extends ModalizerAPIInternal, Disposable {\n /**\n * Activates a Modalizer and focuses the first or default element within\n *\n * @param elementFromModalizer - An element that belongs to a Modalizer\n * @param noFocusFirst - Do not focus on the first element in the Modalizer\n * @param noFocusDefault - Do not focus the default element in the Modalizre\n */\n focus(elementFromModalizer: HTMLElement, noFocusFirst?: boolean, noFocusDefault?: boolean): boolean;\n}\n\ninterface RestorerAPIInternal {\n /** @internal */\n createRestorer(element: HTMLElement, props: RestorerProps): Restorer;\n}\n\nexport interface RestorerAPI extends RestorerAPIInternal, Disposable {}\n\nexport interface Restorer extends Disposable, TabsterPart<RestorerProps> {}\n/**\n * A signature for the accessibleCheck callback from getModalizer().\n * It is called when active Modalizer sets aria-hidden on elements outsidef of it.\n *\n * @param element - The element that is about to receive aria-hidden.\n * @param activeModalizerElements - The container elements of the active modalizer.\n * @returns true if the element should remain accessible and should not receive\n * aria-hidden.\n */\nexport type ModalizerElementAccessibleCheck = (\n element: HTMLElement,\n activeModalizerElements?: HTMLElement[],\n) => boolean;\n\nexport interface UncontrolledProps {\n // Normally, even uncontrolled areas should not be completely uncontrolled\n // to be able to interact with the rest of the application properly.\n // For example, if an uncontrolled area implements something like\n // roving tabindex, it should be uncontrolled inside the area, but it\n // still should be able to be an organic part of the application.\n // However, in some cases, third party component might want to be able\n // to gain full control of the area, for example, if it implements\n // some custom trap focus logic.\n // `completely` indicates that uncontrolled area must gain full control over\n // Tab handling. If not set, Tabster might still handle Tab in the\n // uncontrolled area, when, for example, there is an inactive Modalizer\n // (that needs to be skipped) after the last focusable element of the\n // uncontrolled area.\n // WARNING: Use with caution, as it might break the normal keyboard navigation\n // between the uncontrolled area and the rest of the application.\n completely?: boolean;\n}\n\nexport interface DeloserOnElement {\n deloser: Deloser;\n}\n\nexport interface RootOnElement {\n root: Root;\n}\n\nexport interface ModalizerOnElement {\n modalizer: Modalizer;\n}\n\nexport interface RestorerOnElement {\n restorer: Restorer;\n}\n\nexport interface FocusableOnElement {\n focusable: FocusableProps;\n}\n\nexport interface MoverOnElement {\n mover: Mover;\n}\n\nexport interface GroupperOnElement {\n groupper: Groupper;\n}\n\nexport interface UncontrolledOnElement {\n uncontrolled: UncontrolledProps;\n}\n\nexport interface ObservedOnElement {\n observed: ObservedElementProps;\n}\n\nexport interface OutlineOnElement {\n outline: OutlinedElementProps;\n}\n\nexport interface SysOnElement {\n sys: SysProps;\n}\n\nexport interface RestorerProps {\n type: RestorerType;\n}\n\nexport type TabsterAttributeProps = Partial<{\n deloser: DeloserProps;\n root: RootProps;\n uncontrolled: UncontrolledProps;\n modalizer: ModalizerProps;\n focusable: FocusableProps;\n groupper: GroupperProps;\n mover: MoverProps;\n observed: ObservedElementProps;\n outline: OutlinedElementProps;\n sys: SysProps;\n restorer: RestorerProps;\n}>;\n\nexport interface TabsterAttributeOnElement {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n string: string;\n object: TabsterAttributeProps;\n}\n\nexport interface TabsterAugmentedAttributes {\n [name: string]: string | null;\n}\n\nexport type TabsterOnElement = Partial<\n RootOnElement &\n DeloserOnElement &\n ModalizerOnElement &\n FocusableOnElement &\n MoverOnElement &\n GroupperOnElement &\n ObservedOnElement &\n OutlineOnElement &\n UncontrolledOnElement &\n SysOnElement &\n RestorerOnElement\n>;\n\nexport interface OutlineElements {\n container: HTMLDivElement;\n left: HTMLDivElement;\n top: HTMLDivElement;\n right: HTMLDivElement;\n bottom: HTMLDivElement;\n}\n\nexport interface TabsterElementStorageEntry {\n tabster?: TabsterOnElement;\n attr?: TabsterAttributeOnElement;\n aug?: TabsterAugmentedAttributes;\n}\n\nexport interface TabsterElementStorage {\n [uid: string]: TabsterElementStorageEntry;\n}\n\nexport type DisposeFunc = () => void;\n\nexport interface InternalAPI {\n stopObserver(): void;\n resumeObserver(syncState: boolean): void;\n}\n\nexport interface DummyInputObserver {\n add(dummy: HTMLElement, callback: () => void): void;\n remove(dummy: HTMLElement): void;\n dispose(): void;\n domChanged?(parent: HTMLElement): void;\n updatePositions(\n compute: (scrollTopLeftCache: Map<HTMLElement, { scrollTop: number; scrollLeft: number } | null>) => () => void,\n ): void;\n}\n\ninterface TabsterCoreInternal {\n /** @internal */\n groupper?: GroupperAPI;\n /** @internal */\n mover?: MoverAPI;\n /** @internal */\n outline?: OutlineAPI;\n /** @internal */\n deloser?: DeloserAPI;\n /** @internal */\n modalizer?: ModalizerAPI;\n /** @internal */\n observedElement?: ObservedElementAPI;\n /** @internal */\n crossOrigin?: CrossOriginAPI;\n /** @internal */\n internal: InternalAPI;\n /** @internal */\n restorer?: RestorerAPI;\n\n /** @internal */\n _dummyObserver: DummyInputObserver;\n\n // The version of the tabster package this instance is on\n /** @internal */\n _version: string;\n\n // No operation flag for the debugging purposes\n /** @internal */\n _noop: boolean;\n\n /** @internal */\n storageEntry(element: HTMLElement, addremove?: boolean): TabsterElementStorageEntry | undefined;\n /** @internal */\n getWindow: GetWindow;\n\n /** @internal */\n createTabster(noRefCount?: boolean, props?: TabsterCoreProps): Tabster;\n /** @internal */\n disposeTabster(wrapper: Tabster, allInstances?: boolean): void;\n /** @internal */\n forceCleanup(): void;\n\n /** @internal */\n queueInit(callback: () => void): void;\n /** @internal */\n drainInitQueue(): void;\n /** @internal */\n getParent: (el: Node) => Node | null;\n}\n\nexport interface Tabster {\n keyboardNavigation: KeyboardNavigationState;\n focusedElement: FocusedElementState;\n focusable: FocusableAPI;\n root: RootAPI;\n uncontrolled: UncontrolledAPI;\n\n /** @internal */\n core: TabsterCore;\n}\n\nexport interface TabsterCore\n extends Pick<TabsterCoreProps, 'controlTab' | 'rootDummyInputs'>,\n Disposable,\n TabsterCoreInternal,\n Omit<Tabster, 'core'> {}\n\nexport interface TabsterCompat {\n attributeTransform?: <P>(old: P) => TabsterAttributeProps;\n}\n"],"names":["TabsterAttributeName","TabsterDummyInputAttributeName","DeloserEventName","ModalizerActiveEventName","ModalizerInactiveEventName","ModalizerFocusInEventName","ModalizerFocusOutEventName","ModalizerBeforeFocusOutEventName","MoverEventName","FocusInEventName","FocusOutEventName","MoveFocusEventName","MoverMoveFocusEventName","GroupperMoveFocusEventName","FocusableSelector","join","GroupperMoveFocusActions","Enter","Escape","ObservedElementAccesibilities","Any","Accessible","Focusable","RestoreFocusOrders","History","DeloserDefault","RootDefault","DeloserFirst","RootFirst","Visibilities","Invisible","PartiallyVisible","Visible","RestorerTypes","Source","Target","MoverDirections","Both","Vertical","Horizontal","Grid","GridLinear","MoverKeys","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End","GroupperTabbabilities","Unlimited","Limited","LimitedTrapFocus","SysDummyInputsPositions","Auto","Inside","Outside"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;CAGC,GAED;;;;;;;;;;;CAWC,GAED,OAAO,MAAMA,uBAAuB,eAAe;AACnD,OAAO,MAAMC,iCAAiC,qBAAqB;AACnE,OAAO,MAAMC,mBAAmB,kBAAkB;AAClD,OAAO,MAAMC,2BAA2B,2BAA2B;AACnE,OAAO,MAAMC,6BAA6B,6BAA6B;AACvE,OAAO,MAAMC,4BAA4B,4BAA4B;AACrE,OAAO,MAAMC,6BAA6B,6BAA6B;AACvE,OAAO,MAAMC,mCAAmC,mCAAmC;AACnF,OAAO,MAAMC,iBAAiB,gBAAgB;AAC9C,OAAO,MAAMC,mBAAmB,kBAAkB;AAClD,OAAO,MAAMC,oBAAoB,mBAAmB;AAEpD,0EAA0E;AAC1E,sEAAsE;AACtE,qBAAqB;AACrB,OAAO,MAAMC,qBAAqB,oBAAoB;AAEtD,0EAA0E;AAC1E,sBAAsB;AACtB,OAAO,MAAMC,0BAA0B,0BAA0B;AACjE,2EAA2E;AAC3E,sBAAsB;AACtB,OAAO,MAAMC,6BAA6B,6BAA6B;AAEvE,OAAO,MAAMC,oBAAoB;IAC/B;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAACC,IAAI,CAAC,MAAM;AAUb,OAAO,MAAMC,2BAAqD;IAChEC,OAAO;IACPC,QAAQ;AACV,EAAE;AA0KF,OAAO,MAAMC,gCAA+D;IAC1EC,KAAK;IACLC,YAAY;IACZC,WAAW;AACb,EAAE;AAsJF,OAAO,MAAMC,qBAAyC;IACpDC,SAAS;IACTC,gBAAgB;IAChBC,aAAa;IACbC,cAAc;IACdC,WAAW;AACb,EAAE;AAqOF,OAAO,MAAMC,eAA6B;IACxCC,WAAW;IACXC,kBAAkB;IAClBC,SAAS;AACX,EAAE;AAgBF,OAAO,MAAMC,gBAAgB;IAC3BC,QAAQ;IACRC,QAAQ;AACV,EAAW;AAIX,OAAO,MAAMC,kBAAmC;IAC9CC,MAAM;IACNC,UAAU;IACVC,YAAY;IACZC,MAAM;IACNC,YAAY;AACd,EAAE;AAkFF,OAAO,MAAMC,YAAuB;IAClCC,SAAS;IACTC,WAAW;IACXC,WAAW;IACXC,YAAY;IACZC,QAAQ;IACRC,UAAU;IACVC,MAAM;IACNC,KAAK;AACP,EAAE;AAYF,OAAO,MAAMC,wBAA+C;IAC1DC,WAAW;IACXC,SAAS;IACTC,kBAAkB;AACpB,EAAE;AAyGF,OAAO,MAAMC,0BAAmD;IAC9DC,MAAM;IACNC,QAAQ;IACRC,SAAS;AACX,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["constants.ts"],"sourcesContent":["export const KEYBOARD_NAV_ATTRIBUTE = 'data-keyboard-nav' as const;\nexport const KEYBOARD_NAV_SELECTOR = `:global([${KEYBOARD_NAV_ATTRIBUTE}])` as const;\n\n/**\n * @internal\n */\nexport const FOCUS_VISIBLE_ATTR = 'data-fui-focus-visible';\n\n/**\n * @internal\n */\nexport const FOCUS_WITHIN_ATTR = 'data-fui-focus-within';\nexport const defaultOptions = {\n style: {},\n selector: 'focus',\n customizeSelector: (selector: string) => selector,\n} as const;\n"],"names":["FOCUS_VISIBLE_ATTR","FOCUS_WITHIN_ATTR","KEYBOARD_NAV_ATTRIBUTE","KEYBOARD_NAV_SELECTOR","defaultOptions","style","selector","customizeSelector"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAMaA,kBAAAA;eAAAA;;IAKAC,iBAAAA;eAAAA;;IAXAC,sBAAAA;eAAAA;;IACAC,qBAAAA;eAAAA;;IAWAC,cAAAA;eAAAA;;;AAZN,MAAMF,yBAAyB;AAC/B,MAAMC,wBAAwB,CAAC,SAAS,EAAED,uBAAuB,EAAE,CAAC;AAKpE,MAAMF,qBAAqB;AAK3B,MAAMC,oBAAoB;AAC1B,MAAMG,iBAAiB;IAC5BC,OAAO,CAAC;IACRC,UAAU;IACVC,mBAAmB,CAACD,WAAqBA;AAC3C"}
1
+ {"version":3,"sources":["../src/focus/constants.ts"],"sourcesContent":["export const KEYBOARD_NAV_ATTRIBUTE = 'data-keyboard-nav' as const;\nexport const KEYBOARD_NAV_SELECTOR = `:global([${KEYBOARD_NAV_ATTRIBUTE}])` as const;\n\n/**\n * @internal\n */\nexport const FOCUS_VISIBLE_ATTR = 'data-fui-focus-visible';\n\n/**\n * @internal\n */\nexport const FOCUS_WITHIN_ATTR = 'data-fui-focus-within';\nexport const defaultOptions = {\n style: {},\n selector: 'focus',\n customizeSelector: (selector: string) => selector,\n} as const;\n"],"names":["FOCUS_VISIBLE_ATTR","FOCUS_WITHIN_ATTR","KEYBOARD_NAV_ATTRIBUTE","KEYBOARD_NAV_SELECTOR","defaultOptions","style","selector","customizeSelector"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAMaA,kBAAkB;eAAlBA;;IAKAC,iBAAiB;eAAjBA;;IAXAC,sBAAsB;eAAtBA;;IACAC,qBAAqB;eAArBA;;IAWAC,cAAc;eAAdA;;;AAZN,MAAMF,yBAAyB;AAC/B,MAAMC,wBAAwB,CAAC,SAAS,EAAED,uBAAuB,EAAE,CAAC;AAKpE,MAAMF,qBAAqB;AAK3B,MAAMC,oBAAoB;AAC1B,MAAMG,iBAAiB;IAC5BC,OAAO,CAAC;IACRC,UAAU;IACVC,mBAAmB,CAACD,WAAqBA;AAC3C"}
@@ -1 +1 @@
1
- {"version":3,"sources":["createCustomFocusIndicatorStyle.ts"],"sourcesContent":["import { defaultOptions, FOCUS_VISIBLE_ATTR, FOCUS_WITHIN_ATTR } from './constants';\nimport { makeResetStyles } from '@griffel/react';\nimport type { GriffelStyle } from '@griffel/react';\n\n// TODO: Use the type directly from @griffel/react\n// https://github.com/microsoft/griffel/pull/278\ntype GriffelResetStyle = Parameters<typeof makeResetStyles>[0];\n\nexport interface CreateCustomFocusIndicatorStyleOptions {\n /**\n * Control if the indicator appears when the corresponding element is focused,\n * or any child is focused within the corresponding element.\n * @default 'focus'\n * @alias selectorType\n */\n selector?: 'focus' | 'focus-within';\n /**\n * Customizes the selector provided based on the selector type.\n */\n customizeSelector?: (selector: string) => string;\n /**\n * Enables the browser default outline style\n * @deprecated The custom focus indicator no longer affects outline styles. Outline is overridden\n * in the default focus indicator function, `createFocusOutlineStyle`.\n */\n enableOutline?: boolean;\n}\n\n/**\n * Creates a style for @see makeStyles that includes the necessary selectors for focus.\n * Should be used only when @see createFocusOutlineStyle does not fit requirements\n *\n * If you're using `createCustomFocusIndicatorStyle` instead of `createFocusOutlineStyle`\n * keep in mind that the default outline style is not going to be removed\n * (as it is in `createFocusOutlineStyle`),\n * and is your responsibility to manually remove it from your styles.\n *\n * @example\n * ```ts\n * // Link styles\n * const useStyles = makeStyles({\n focusIndicator: createCustomFocusIndicatorStyle({\n textDecorationColor: tokens.colorStrokeFocus2,\n textDecorationLine: 'underline',\n textDecorationStyle: 'double',\n outlineStyle: 'none',\n }),\n // Common styles.\n root: {\n // ❗️ DO NOT FORGET TO REMOVE THE DEFAULT OUTLINE STYLE\n ':focus-visible': {\n outlineStyle: 'none',\n },\n * ```\n *\n * @param style - styling applied on focus, defaults to @see getDefaultFocusOutlineStyles\n * @param options - Configure the style of the focus outline\n */\nexport function createCustomFocusIndicatorStyle<TStyle extends GriffelStyle | GriffelResetStyle>(\n style: TStyle,\n {\n selector: selectorType = defaultOptions.selector,\n customizeSelector = defaultOptions.customizeSelector,\n }: CreateCustomFocusIndicatorStyleOptions = defaultOptions,\n): TStyle extends GriffelStyle ? GriffelStyle : GriffelResetStyle {\n return { [customizeSelector(createBaseSelector(selectorType))]: style };\n}\n\nfunction createBaseSelector(selectorType: 'focus' | 'focus-within'): string {\n switch (selectorType) {\n case 'focus':\n return `&[${FOCUS_VISIBLE_ATTR}]`;\n case 'focus-within':\n return `&[${FOCUS_WITHIN_ATTR}]:focus-within`;\n }\n}\n"],"names":["createCustomFocusIndicatorStyle","style","selector","selectorType","defaultOptions","customizeSelector","createBaseSelector","FOCUS_VISIBLE_ATTR","FOCUS_WITHIN_ATTR"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA0DgBA;;;eAAAA;;;2BA1DsD;AA0D/D,SAASA,gCACdC,KAAa,EACb,EACEC,UAAUC,eAAeC,yBAAAA,CAAeF,QAAQ,EAChDG,oBAAoBD,yBAAAA,CAAeC,iBAAiB,EACb,GAAGD,yBAAc;IAE1D,OAAO;QAAE,CAACC,kBAAkBC,mBAAmBH,eAAe,EAAEF;IAAM;AACxE;AAEA,SAASK,mBAAmBH,YAAsC;IAChE,OAAQA;QACN,KAAK;YACH,OAAO,CAAC,EAAE,EAAEI,6BAAAA,CAAmB,CAAC,CAAC;QACnC,KAAK;YACH,OAAO,CAAC,EAAE,EAAEC,4BAAAA,CAAkB,cAAc,CAAC;IACjD;AACF"}
1
+ {"version":3,"sources":["../src/focus/createCustomFocusIndicatorStyle.ts"],"sourcesContent":["import { defaultOptions, FOCUS_VISIBLE_ATTR, FOCUS_WITHIN_ATTR } from './constants';\nimport { makeResetStyles } from '@griffel/react';\nimport type { GriffelStyle } from '@griffel/react';\n\n// TODO: Use the type directly from @griffel/react\n// https://github.com/microsoft/griffel/pull/278\ntype GriffelResetStyle = Parameters<typeof makeResetStyles>[0];\n\nexport interface CreateCustomFocusIndicatorStyleOptions {\n /**\n * Control if the indicator appears when the corresponding element is focused,\n * or any child is focused within the corresponding element.\n * @default 'focus'\n * @alias selectorType\n */\n selector?: 'focus' | 'focus-within';\n /**\n * Customizes the selector provided based on the selector type.\n */\n customizeSelector?: (selector: string) => string;\n /**\n * Enables the browser default outline style\n * @deprecated The custom focus indicator no longer affects outline styles. Outline is overridden\n * in the default focus indicator function, `createFocusOutlineStyle`.\n */\n enableOutline?: boolean;\n}\n\n/**\n * Creates a style for @see makeStyles that includes the necessary selectors for focus.\n * Should be used only when @see createFocusOutlineStyle does not fit requirements\n *\n * If you're using `createCustomFocusIndicatorStyle` instead of `createFocusOutlineStyle`\n * keep in mind that the default outline style is not going to be removed\n * (as it is in `createFocusOutlineStyle`),\n * and is your responsibility to manually remove it from your styles.\n *\n * @example\n * ```ts\n * // Link styles\n * const useStyles = makeStyles({\n focusIndicator: createCustomFocusIndicatorStyle({\n textDecorationColor: tokens.colorStrokeFocus2,\n textDecorationLine: 'underline',\n textDecorationStyle: 'double',\n outlineStyle: 'none',\n }),\n // Common styles.\n root: {\n // ❗️ DO NOT FORGET TO REMOVE THE DEFAULT OUTLINE STYLE\n ':focus-visible': {\n outlineStyle: 'none',\n },\n * ```\n *\n * @param style - styling applied on focus, defaults to @see getDefaultFocusOutlineStyles\n * @param options - Configure the style of the focus outline\n */\nexport function createCustomFocusIndicatorStyle<TStyle extends GriffelStyle | GriffelResetStyle>(\n style: TStyle,\n {\n selector: selectorType = defaultOptions.selector,\n customizeSelector = defaultOptions.customizeSelector,\n }: CreateCustomFocusIndicatorStyleOptions = defaultOptions,\n): TStyle extends GriffelStyle ? GriffelStyle : GriffelResetStyle {\n return { [customizeSelector(createBaseSelector(selectorType))]: style };\n}\n\nfunction createBaseSelector(selectorType: 'focus' | 'focus-within'): string {\n switch (selectorType) {\n case 'focus':\n return `&[${FOCUS_VISIBLE_ATTR}]`;\n case 'focus-within':\n return `&[${FOCUS_WITHIN_ATTR}]:focus-within`;\n }\n}\n"],"names":["createCustomFocusIndicatorStyle","style","selector","selectorType","defaultOptions","customizeSelector","createBaseSelector","FOCUS_VISIBLE_ATTR","FOCUS_WITHIN_ATTR"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA0DgBA;;;eAAAA;;;2BA1DsD;AA0D/D,SAASA,gCACdC,KAAa,EACb,EACEC,UAAUC,eAAeC,yBAAc,CAACF,QAAQ,EAChDG,oBAAoBD,yBAAc,CAACC,iBAAiB,EACb,GAAGD,yBAAc;IAE1D,OAAO;QAAE,CAACC,kBAAkBC,mBAAmBH,eAAe,EAAEF;IAAM;AACxE;AAEA,SAASK,mBAAmBH,YAAsC;IAChE,OAAQA;QACN,KAAK;YACH,OAAO,CAAC,EAAE,EAAEI,6BAAkB,CAAC,CAAC,CAAC;QACnC,KAAK;YACH,OAAO,CAAC,EAAE,EAAEC,4BAAiB,CAAC,cAAc,CAAC;IACjD;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["createFocusOutlineStyle.ts"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { shorthands } from '@griffel/react';\nimport type { GriffelStyle } from '@griffel/react';\nimport {\n createCustomFocusIndicatorStyle,\n CreateCustomFocusIndicatorStyleOptions,\n} from './createCustomFocusIndicatorStyle';\nimport { defaultOptions } from './constants';\n\nexport type FocusOutlineOffset = Record<'top' | 'bottom' | 'left' | 'right', string>;\nexport type FocusOutlineStyleOptions = {\n /**\n * Only property not supported by the native CSS `outline`, if this is no longer needed\n * we can just go native instead\n */\n outlineRadius: string;\n outlineColor: string;\n outlineWidth: string;\n outlineOffset?: string | FocusOutlineOffset;\n};\nexport interface CreateFocusOutlineStyleOptions extends Omit<CreateCustomFocusIndicatorStyleOptions, 'enableOutline'> {\n style?: Partial<FocusOutlineStyleOptions>;\n\n /**\n * Enables the browser default outline style\n */\n enableOutline?: boolean;\n}\n\n/**\n * Get the position of the focus outline\n *\n * @param options - Configures the style of the focus outline\n * @param position - The position of the focus outline\n * @returns CSS value for the position of the focus outline\n */\nfunction getOutlinePosition(\n { outlineWidth, outlineOffset }: FocusOutlineStyleOptions,\n position: 'top' | 'bottom' | 'left' | 'right',\n) {\n const offsetValue = (outlineOffset as FocusOutlineOffset)?.[position] || outlineOffset;\n\n if (!outlineOffset) {\n return `calc(${outlineWidth} * -1)`;\n }\n\n return `calc(0px - ${outlineWidth} - ${offsetValue})`;\n}\n\n/**\n * NOTE: the element with the focus outline needs to have `position: relative` so that the\n * pseudo element can be properly positioned.\n *\n * @param options - Configures the style of the focus outline\n * @returns focus outline styles object\n */\nconst getFocusOutlineStyles = (options: FocusOutlineStyleOptions): GriffelStyle => {\n const { outlineRadius, outlineColor, outlineWidth } = options;\n\n return {\n ...shorthands.borderColor('transparent'),\n '@media (forced-colors: active)': {\n '::after': {\n ...shorthands.borderColor('Highlight'),\n },\n },\n '::after': {\n content: '\"\"',\n position: 'absolute',\n pointerEvents: 'none',\n zIndex: 1,\n\n border: `${outlineWidth} solid ${outlineColor}`,\n borderRadius: outlineRadius,\n\n top: getOutlinePosition(options, 'top'),\n right: getOutlinePosition(options, 'right'),\n bottom: getOutlinePosition(options, 'bottom'),\n left: getOutlinePosition(options, 'left'),\n },\n };\n};\n\n/**\n * NOTE: The element with the focus outline needs to have `position: relative` so that the\n * pseudo element can be properly positioned.\n *\n * @param options - Configure the style of the focus outline\n * @returns focus outline styles object for @see makeStyles\n */\nexport const createFocusOutlineStyle = ({\n enableOutline = false,\n selector = defaultOptions.selector,\n customizeSelector,\n style = defaultOptions.style,\n}: CreateFocusOutlineStyleOptions = defaultOptions): GriffelStyle => ({\n ':focus': {\n outlineStyle: enableOutline ? undefined : 'none',\n },\n ':focus-visible': {\n outlineStyle: enableOutline ? undefined : 'none',\n },\n\n ...createCustomFocusIndicatorStyle(\n getFocusOutlineStyles({\n outlineColor: tokens.colorStrokeFocus2,\n outlineRadius: tokens.borderRadiusMedium,\n // FIXME: tokens.strokeWidthThick causes some weird bugs\n outlineWidth: '2px',\n ...style,\n }),\n { selector, customizeSelector },\n ),\n});\n"],"names":["createFocusOutlineStyle","getOutlinePosition","outlineWidth","outlineOffset","position","offsetValue","getFocusOutlineStyles","options","outlineRadius","outlineColor","shorthands","borderColor","content","pointerEvents","zIndex","border","borderRadius","top","right","bottom","left","enableOutline","selector","defaultOptions","customizeSelector","style","outlineStyle","undefined","createCustomFocusIndicatorStyle","tokens","colorStrokeFocus2","borderRadiusMedium"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA0FaA;;;eAAAA;;;4BA1FU;uBACI;iDAKpB;2BACwB;AAsB/B;;;;;;CAMC,GACD,SAASC,mBACP,EAAEC,YAAY,EAAEC,aAAa,EAA4B,EACzDC,QAA6C;IAE7C,MAAMC,cAAc,AAACF,CAAAA,kBAAAA,QAAAA,kBAAAA,KAAAA,IAAAA,KAAAA,IAADA,aAAuC,CAACC,SAAS,AAATA,KAAaD;IAEzE,IAAI,CAACA,eAAe;QAClB,OAAO,CAAC,KAAK,EAAED,aAAa,MAAM,CAAC;IACrC;IAEA,OAAO,CAAC,WAAW,EAAEA,aAAa,GAAG,EAAEG,YAAY,CAAC,CAAC;AACvD;AAEA;;;;;;CAMC,GACD,MAAMC,wBAAwB,CAACC;IAC7B,MAAM,EAAEC,aAAa,EAAEC,YAAY,EAAEP,YAAY,EAAE,GAAGK;IAEtD,OAAO;QACL,GAAGG,iBAAAA,CAAWC,WAAW,CAAC,cAAc;QACxC,kCAAkC;YAChC,WAAW;gBACT,GAAGD,iBAAAA,CAAWC,WAAW,CAAC,YAAY;YACxC;QACF;QACA,WAAW;YACTC,SAAS;YACTR,UAAU;YACVS,eAAe;YACfC,QAAQ;YAERC,QAAQ,CAAC,EAAEb,aAAa,OAAO,EAAEO,aAAa,CAAC;YAC/CO,cAAcR;YAEdS,KAAKhB,mBAAmBM,SAAS;YACjCW,OAAOjB,mBAAmBM,SAAS;YACnCY,QAAQlB,mBAAmBM,SAAS;YACpCa,MAAMnB,mBAAmBM,SAAS;QACpC;IACF;AACF;AASO,MAAMP,0BAA0B,CAAC,EACtCqB,gBAAgB,KAAK,EACrBC,WAAWC,yBAAAA,CAAeD,QAAQ,EAClCE,iBAAiB,EACjBC,QAAQF,yBAAAA,CAAeE,KAAK,EACG,GAAGF,yBAAc,GAAoB,CAAA;QACpE,UAAU;YACRG,cAAcL,gBAAgBM,YAAY;QAC5C;QACA,kBAAkB;YAChBD,cAAcL,gBAAgBM,YAAY;QAC5C;QAEA,GAAGC,IAAAA,gEAAAA,EACDtB,sBAAsB;YACpBG,cAAcoB,kBAAAA,CAAOC,iBAAiB;YACtCtB,eAAeqB,kBAAAA,CAAOE,kBAAkB;YACxC,wDAAwD;YACxD7B,cAAc;YACd,GAAGuB,KAAK;QACV,IACA;YAAEH;YAAUE;QAAkB,EAC/B;IACH,CAAA"}
1
+ {"version":3,"sources":["../src/focus/createFocusOutlineStyle.ts"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { shorthands } from '@griffel/react';\nimport type { GriffelStyle } from '@griffel/react';\nimport {\n createCustomFocusIndicatorStyle,\n CreateCustomFocusIndicatorStyleOptions,\n} from './createCustomFocusIndicatorStyle';\nimport { defaultOptions } from './constants';\n\nexport type FocusOutlineOffset = Record<'top' | 'bottom' | 'left' | 'right', string>;\nexport type FocusOutlineStyleOptions = {\n /**\n * Only property not supported by the native CSS `outline`, if this is no longer needed\n * we can just go native instead\n */\n outlineRadius: string;\n outlineColor: string;\n outlineWidth: string;\n outlineOffset?: string | FocusOutlineOffset;\n};\nexport interface CreateFocusOutlineStyleOptions extends Omit<CreateCustomFocusIndicatorStyleOptions, 'enableOutline'> {\n style?: Partial<FocusOutlineStyleOptions>;\n\n /**\n * Enables the browser default outline style\n */\n enableOutline?: boolean;\n}\n\n/**\n * Get the position of the focus outline\n *\n * @param options - Configures the style of the focus outline\n * @param position - The position of the focus outline\n * @returns CSS value for the position of the focus outline\n */\nfunction getOutlinePosition(\n { outlineWidth, outlineOffset }: FocusOutlineStyleOptions,\n position: 'top' | 'bottom' | 'left' | 'right',\n) {\n const offsetValue = (outlineOffset as FocusOutlineOffset)?.[position] || outlineOffset;\n\n if (!outlineOffset) {\n return `calc(${outlineWidth} * -1)`;\n }\n\n return `calc(0px - ${outlineWidth} - ${offsetValue})`;\n}\n\n/**\n * NOTE: the element with the focus outline needs to have `position: relative` so that the\n * pseudo element can be properly positioned.\n *\n * @param options - Configures the style of the focus outline\n * @returns focus outline styles object\n */\nconst getFocusOutlineStyles = (options: FocusOutlineStyleOptions): GriffelStyle => {\n const { outlineRadius, outlineColor, outlineWidth } = options;\n\n return {\n ...shorthands.borderColor('transparent'),\n '@media (forced-colors: active)': {\n '::after': {\n ...shorthands.borderColor('Highlight'),\n },\n },\n '::after': {\n content: '\"\"',\n position: 'absolute',\n pointerEvents: 'none',\n zIndex: 1,\n\n border: `${outlineWidth} solid ${outlineColor}`,\n borderRadius: outlineRadius,\n\n top: getOutlinePosition(options, 'top'),\n right: getOutlinePosition(options, 'right'),\n bottom: getOutlinePosition(options, 'bottom'),\n left: getOutlinePosition(options, 'left'),\n },\n };\n};\n\n/**\n * NOTE: The element with the focus outline needs to have `position: relative` so that the\n * pseudo element can be properly positioned.\n *\n * @param options - Configure the style of the focus outline\n * @returns focus outline styles object for @see makeStyles\n */\nexport const createFocusOutlineStyle = ({\n enableOutline = false,\n selector = defaultOptions.selector,\n customizeSelector,\n style = defaultOptions.style,\n}: CreateFocusOutlineStyleOptions = defaultOptions): GriffelStyle => ({\n ':focus': {\n outlineStyle: enableOutline ? undefined : 'none',\n },\n ':focus-visible': {\n outlineStyle: enableOutline ? undefined : 'none',\n },\n\n ...createCustomFocusIndicatorStyle(\n getFocusOutlineStyles({\n outlineColor: tokens.colorStrokeFocus2,\n outlineRadius: tokens.borderRadiusMedium,\n // FIXME: tokens.strokeWidthThick causes some weird bugs\n outlineWidth: '2px',\n ...style,\n }),\n { selector, customizeSelector },\n ),\n});\n"],"names":["createFocusOutlineStyle","getOutlinePosition","outlineWidth","outlineOffset","position","offsetValue","getFocusOutlineStyles","options","outlineRadius","outlineColor","shorthands","borderColor","content","pointerEvents","zIndex","border","borderRadius","top","right","bottom","left","enableOutline","selector","defaultOptions","customizeSelector","style","outlineStyle","undefined","createCustomFocusIndicatorStyle","tokens","colorStrokeFocus2","borderRadiusMedium"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA0FaA;;;eAAAA;;;4BA1FU;uBACI;iDAKpB;2BACwB;AAsB/B;;;;;;CAMC,GACD,SAASC,mBACP,EAAEC,YAAY,EAAEC,aAAa,EAA4B,EACzDC,QAA6C;IAE7C,MAAMC,cAAc,CAACF,0BAAAA,oCAAD,AAACA,aAAsC,CAACC,SAAS,KAAID;IAEzE,IAAI,CAACA,eAAe;QAClB,OAAO,CAAC,KAAK,EAAED,aAAa,MAAM,CAAC;IACrC;IAEA,OAAO,CAAC,WAAW,EAAEA,aAAa,GAAG,EAAEG,YAAY,CAAC,CAAC;AACvD;AAEA;;;;;;CAMC,GACD,MAAMC,wBAAwB,CAACC;IAC7B,MAAM,EAAEC,aAAa,EAAEC,YAAY,EAAEP,YAAY,EAAE,GAAGK;IAEtD,OAAO;QACL,GAAGG,iBAAU,CAACC,WAAW,CAAC,cAAc;QACxC,kCAAkC;YAChC,WAAW;gBACT,GAAGD,iBAAU,CAACC,WAAW,CAAC,YAAY;YACxC;QACF;QACA,WAAW;YACTC,SAAS;YACTR,UAAU;YACVS,eAAe;YACfC,QAAQ;YAERC,QAAQ,CAAC,EAAEb,aAAa,OAAO,EAAEO,aAAa,CAAC;YAC/CO,cAAcR;YAEdS,KAAKhB,mBAAmBM,SAAS;YACjCW,OAAOjB,mBAAmBM,SAAS;YACnCY,QAAQlB,mBAAmBM,SAAS;YACpCa,MAAMnB,mBAAmBM,SAAS;QACpC;IACF;AACF;AASO,MAAMP,0BAA0B,CAAC,EACtCqB,gBAAgB,KAAK,EACrBC,WAAWC,yBAAc,CAACD,QAAQ,EAClCE,iBAAiB,EACjBC,QAAQF,yBAAc,CAACE,KAAK,EACG,GAAGF,yBAAc,GAAoB,CAAA;QACpE,UAAU;YACRG,cAAcL,gBAAgBM,YAAY;QAC5C;QACA,kBAAkB;YAChBD,cAAcL,gBAAgBM,YAAY;QAC5C;QAEA,GAAGC,IAAAA,gEAA+B,EAChCtB,sBAAsB;YACpBG,cAAcoB,kBAAM,CAACC,iBAAiB;YACtCtB,eAAeqB,kBAAM,CAACE,kBAAkB;YACxC,wDAAwD;YACxD7B,cAAc;YACd,GAAGuB,KAAK;QACV,IACA;YAAEH;YAAUE;QAAkB,EAC/B;IACH,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["focusVisiblePolyfill.ts"],"sourcesContent":["import { isHTMLElement } from '@fluentui/react-utilities';\nimport { KEYBORG_FOCUSIN, KeyborgFocusInEvent, createKeyborg, disposeKeyborg } from 'keyborg';\n\nimport { FOCUS_VISIBLE_ATTR } from './constants';\n\n/**\n * Because `addEventListener` type override falls back to 2nd definition (evt name is unknown string literal)\n * evt is being typed as a base class of MouseEvent -> `Event`.\n * This type is used to override `listener` calls to make TS happy\n */\ntype ListenerOverride = (evt: Event) => void;\n\ntype FocusVisibleState = {\n /**\n * Current element with focus visible in state\n */\n current: HTMLElement | undefined;\n};\n\ntype HTMLElementWithFocusVisibleScope = {\n focusVisible: boolean | undefined;\n} & HTMLElement;\n\n/**\n * @internal\n * @param scope - Applies the ponyfill to all DOM children\n * @param targetWindow - window\n */\nexport function applyFocusVisiblePolyfill(scope: HTMLElement, targetWindow: Window): () => void {\n if (alreadyInScope(scope)) {\n // Focus visible polyfill already applied at this scope\n return () => undefined;\n }\n\n const state: FocusVisibleState = {\n current: undefined,\n };\n\n const keyborg = createKeyborg(targetWindow);\n\n function registerElementIfNavigating(el: EventTarget | HTMLElement | null) {\n if (keyborg.isNavigatingWithKeyboard() && isHTMLElement(el)) {\n state.current = el;\n el.setAttribute(FOCUS_VISIBLE_ATTR, '');\n }\n }\n\n function disposeCurrentElement() {\n if (state.current) {\n state.current.removeAttribute(FOCUS_VISIBLE_ATTR);\n state.current = undefined;\n }\n }\n\n // When navigation mode changes remove the focus-visible selector\n keyborg.subscribe(isNavigatingWithKeyboard => {\n if (!isNavigatingWithKeyboard) {\n disposeCurrentElement();\n }\n });\n\n // Keyborg's focusin event is delegated so it's only registered once on the window\n // and contains metadata about the focus event\n const keyborgListener = (e: KeyborgFocusInEvent) => {\n disposeCurrentElement();\n const target = e.composedPath()[0];\n registerElementIfNavigating(target);\n };\n\n // Make sure that when focus leaves the scope, the focus visible class is removed\n const blurListener = (e: FocusEvent) => {\n if (!e.relatedTarget || (isHTMLElement(e.relatedTarget) && !scope.contains(e.relatedTarget))) {\n disposeCurrentElement();\n }\n };\n\n scope.addEventListener(KEYBORG_FOCUSIN, keyborgListener as ListenerOverride);\n scope.addEventListener('focusout', blurListener);\n (scope as HTMLElementWithFocusVisibleScope).focusVisible = true;\n\n if (scope.contains(targetWindow.document.activeElement)) {\n registerElementIfNavigating(targetWindow.document.activeElement);\n }\n\n // Return disposer\n return () => {\n disposeCurrentElement();\n\n scope.removeEventListener(KEYBORG_FOCUSIN, keyborgListener as ListenerOverride);\n scope.removeEventListener('focusout', blurListener);\n delete (scope as HTMLElementWithFocusVisibleScope).focusVisible;\n\n disposeKeyborg(keyborg);\n };\n}\n\nfunction alreadyInScope(el: HTMLElement | null | undefined): boolean {\n if (!el) {\n return false;\n }\n\n if ((el as HTMLElementWithFocusVisibleScope).focusVisible) {\n return true;\n }\n\n return alreadyInScope(el?.parentElement);\n}\n"],"names":["applyFocusVisiblePolyfill","scope","targetWindow","alreadyInScope","undefined","state","current","keyborg","createKeyborg","registerElementIfNavigating","el","isNavigatingWithKeyboard","isHTMLElement","setAttribute","FOCUS_VISIBLE_ATTR","disposeCurrentElement","removeAttribute","subscribe","keyborgListener","e","target","composedPath","blurListener","relatedTarget","contains","addEventListener","KEYBORG_FOCUSIN","focusVisible","document","activeElement","removeEventListener","disposeKeyborg","parentElement"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA4BgBA;;;eAAAA;;;gCA5Bc;yBACsD;2BAEjD;AAyB5B,SAASA,0BAA0BC,KAAkB,EAAEC,YAAoB;IAChF,IAAIC,eAAeF,QAAQ;QACzB,uDAAuD;QACvD,OAAO,IAAMG;IACf;IAEA,MAAMC,QAA2B;QAC/BC,SAASF;IACX;IAEA,MAAMG,UAAUC,IAAAA,sBAAAA,EAAcN;IAE9B,SAASO,4BAA4BC,EAAoC;QACvE,IAAIH,QAAQI,wBAAwB,MAAMC,IAAAA,6BAAAA,EAAcF,KAAK;YAC3DL,MAAMC,OAAO,GAAGI;YAChBA,GAAGG,YAAY,CAACC,6BAAAA,EAAoB;QACtC;IACF;IAEA,SAASC;QACP,IAAIV,MAAMC,OAAO,EAAE;YACjBD,MAAMC,OAAO,CAACU,eAAe,CAACF,6BAAAA;YAC9BT,MAAMC,OAAO,GAAGF;QAClB;IACF;IAEA,iEAAiE;IACjEG,QAAQU,SAAS,CAACN,CAAAA;QAChB,IAAI,CAACA,0BAA0B;YAC7BI;QACF;IACF;IAEA,kFAAkF;IAClF,8CAA8C;IAC9C,MAAMG,kBAAkB,CAACC;QACvBJ;QACA,MAAMK,SAASD,EAAEE,YAAY,EAAE,CAAC,EAAE;QAClCZ,4BAA4BW;IAC9B;IAEA,iFAAiF;IACjF,MAAME,eAAe,CAACH;QACpB,IAAI,CAACA,EAAEI,aAAa,IAAKX,IAAAA,6BAAAA,EAAcO,EAAEI,aAAa,KAAK,CAACtB,MAAMuB,QAAQ,CAACL,EAAEI,aAAa,GAAI;YAC5FR;QACF;IACF;IAEAd,MAAMwB,gBAAgB,CAACC,wBAAAA,EAAiBR;IACxCjB,MAAMwB,gBAAgB,CAAC,YAAYH;IAClCrB,MAA2C0B,YAAY,GAAG;IAE3D,IAAI1B,MAAMuB,QAAQ,CAACtB,aAAa0B,QAAQ,CAACC,aAAa,GAAG;QACvDpB,4BAA4BP,aAAa0B,QAAQ,CAACC,aAAa;IACjE;IAEA,kBAAkB;IAClB,OAAO;QACLd;QAEAd,MAAM6B,mBAAmB,CAACJ,wBAAAA,EAAiBR;QAC3CjB,MAAM6B,mBAAmB,CAAC,YAAYR;QACtC,OAAOrB,MAA4C0B,YAAY;QAE/DI,IAAAA,uBAAAA,EAAexB;IACjB;AACF;AAEA,SAASJ,eAAeO,EAAkC;IACxD,IAAI,CAACA,IAAI;QACP,OAAO;IACT;IAEA,IAAIA,GAAyCiB,YAAY,EAAE;QACzD,OAAO;IACT;IAEA,OAAOxB,eAAeO,OAAAA,QAAAA,OAAAA,KAAAA,IAAAA,KAAAA,IAAAA,GAAIsB,aAAa;AACzC"}
1
+ {"version":3,"sources":["../src/focus/focusVisiblePolyfill.ts"],"sourcesContent":["import { isHTMLElement } from '@fluentui/react-utilities';\nimport { KEYBORG_FOCUSIN, KeyborgFocusInEvent, createKeyborg, disposeKeyborg } from 'keyborg';\n\nimport { FOCUS_VISIBLE_ATTR } from './constants';\n\n/**\n * Because `addEventListener` type override falls back to 2nd definition (evt name is unknown string literal)\n * evt is being typed as a base class of MouseEvent -> `Event`.\n * This type is used to override `listener` calls to make TS happy\n */\ntype ListenerOverride = (evt: Event) => void;\n\ntype FocusVisibleState = {\n /**\n * Current element with focus visible in state\n */\n current: HTMLElement | undefined;\n};\n\ntype HTMLElementWithFocusVisibleScope = {\n focusVisible: boolean | undefined;\n} & HTMLElement;\n\n/**\n * @internal\n * @param scope - Applies the ponyfill to all DOM children\n * @param targetWindow - window\n */\nexport function applyFocusVisiblePolyfill(scope: HTMLElement, targetWindow: Window): () => void {\n if (alreadyInScope(scope)) {\n // Focus visible polyfill already applied at this scope\n return () => undefined;\n }\n\n const state: FocusVisibleState = {\n current: undefined,\n };\n\n const keyborg = createKeyborg(targetWindow);\n\n function registerElementIfNavigating(el: EventTarget | HTMLElement | null) {\n if (keyborg.isNavigatingWithKeyboard() && isHTMLElement(el)) {\n state.current = el;\n el.setAttribute(FOCUS_VISIBLE_ATTR, '');\n }\n }\n\n function disposeCurrentElement() {\n if (state.current) {\n state.current.removeAttribute(FOCUS_VISIBLE_ATTR);\n state.current = undefined;\n }\n }\n\n // When navigation mode changes remove the focus-visible selector\n keyborg.subscribe(isNavigatingWithKeyboard => {\n if (!isNavigatingWithKeyboard) {\n disposeCurrentElement();\n }\n });\n\n // Keyborg's focusin event is delegated so it's only registered once on the window\n // and contains metadata about the focus event\n const keyborgListener = (e: KeyborgFocusInEvent) => {\n disposeCurrentElement();\n const target = e.composedPath()[0];\n registerElementIfNavigating(target);\n };\n\n // Make sure that when focus leaves the scope, the focus visible class is removed\n const blurListener = (e: FocusEvent) => {\n if (!e.relatedTarget || (isHTMLElement(e.relatedTarget) && !scope.contains(e.relatedTarget))) {\n disposeCurrentElement();\n }\n };\n\n scope.addEventListener(KEYBORG_FOCUSIN, keyborgListener as ListenerOverride);\n scope.addEventListener('focusout', blurListener);\n (scope as HTMLElementWithFocusVisibleScope).focusVisible = true;\n\n if (scope.contains(targetWindow.document.activeElement)) {\n registerElementIfNavigating(targetWindow.document.activeElement);\n }\n\n // Return disposer\n return () => {\n disposeCurrentElement();\n\n scope.removeEventListener(KEYBORG_FOCUSIN, keyborgListener as ListenerOverride);\n scope.removeEventListener('focusout', blurListener);\n delete (scope as HTMLElementWithFocusVisibleScope).focusVisible;\n\n disposeKeyborg(keyborg);\n };\n}\n\nfunction alreadyInScope(el: HTMLElement | null | undefined): boolean {\n if (!el) {\n return false;\n }\n\n if ((el as HTMLElementWithFocusVisibleScope).focusVisible) {\n return true;\n }\n\n return alreadyInScope(el?.parentElement);\n}\n"],"names":["applyFocusVisiblePolyfill","scope","targetWindow","alreadyInScope","undefined","state","current","keyborg","createKeyborg","registerElementIfNavigating","el","isNavigatingWithKeyboard","isHTMLElement","setAttribute","FOCUS_VISIBLE_ATTR","disposeCurrentElement","removeAttribute","subscribe","keyborgListener","e","target","composedPath","blurListener","relatedTarget","contains","addEventListener","KEYBORG_FOCUSIN","focusVisible","document","activeElement","removeEventListener","disposeKeyborg","parentElement"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA4BgBA;;;eAAAA;;;gCA5Bc;yBACsD;2BAEjD;AAyB5B,SAASA,0BAA0BC,KAAkB,EAAEC,YAAoB;IAChF,IAAIC,eAAeF,QAAQ;QACzB,uDAAuD;QACvD,OAAO,IAAMG;IACf;IAEA,MAAMC,QAA2B;QAC/BC,SAASF;IACX;IAEA,MAAMG,UAAUC,IAAAA,sBAAa,EAACN;IAE9B,SAASO,4BAA4BC,EAAoC;QACvE,IAAIH,QAAQI,wBAAwB,MAAMC,IAAAA,6BAAa,EAACF,KAAK;YAC3DL,MAAMC,OAAO,GAAGI;YAChBA,GAAGG,YAAY,CAACC,6BAAkB,EAAE;QACtC;IACF;IAEA,SAASC;QACP,IAAIV,MAAMC,OAAO,EAAE;YACjBD,MAAMC,OAAO,CAACU,eAAe,CAACF,6BAAkB;YAChDT,MAAMC,OAAO,GAAGF;QAClB;IACF;IAEA,iEAAiE;IACjEG,QAAQU,SAAS,CAACN,CAAAA;QAChB,IAAI,CAACA,0BAA0B;YAC7BI;QACF;IACF;IAEA,kFAAkF;IAClF,8CAA8C;IAC9C,MAAMG,kBAAkB,CAACC;QACvBJ;QACA,MAAMK,SAASD,EAAEE,YAAY,EAAE,CAAC,EAAE;QAClCZ,4BAA4BW;IAC9B;IAEA,iFAAiF;IACjF,MAAME,eAAe,CAACH;QACpB,IAAI,CAACA,EAAEI,aAAa,IAAKX,IAAAA,6BAAa,EAACO,EAAEI,aAAa,KAAK,CAACtB,MAAMuB,QAAQ,CAACL,EAAEI,aAAa,GAAI;YAC5FR;QACF;IACF;IAEAd,MAAMwB,gBAAgB,CAACC,wBAAe,EAAER;IACxCjB,MAAMwB,gBAAgB,CAAC,YAAYH;IAClCrB,MAA2C0B,YAAY,GAAG;IAE3D,IAAI1B,MAAMuB,QAAQ,CAACtB,aAAa0B,QAAQ,CAACC,aAAa,GAAG;QACvDpB,4BAA4BP,aAAa0B,QAAQ,CAACC,aAAa;IACjE;IAEA,kBAAkB;IAClB,OAAO;QACLd;QAEAd,MAAM6B,mBAAmB,CAACJ,wBAAe,EAAER;QAC3CjB,MAAM6B,mBAAmB,CAAC,YAAYR;QACtC,OAAO,AAACrB,MAA2C0B,YAAY;QAE/DI,IAAAA,uBAAc,EAACxB;IACjB;AACF;AAEA,SAASJ,eAAeO,EAAkC;IACxD,IAAI,CAACA,IAAI;QACP,OAAO;IACT;IAEA,IAAI,AAACA,GAAwCiB,YAAY,EAAE;QACzD,OAAO;IACT;IAEA,OAAOxB,eAAeO,eAAAA,yBAAAA,GAAIsB,aAAa;AACzC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["focusWithinPolyfill.ts"],"sourcesContent":["import { KEYBORG_FOCUSIN, KeyborgFocusInEvent, createKeyborg, disposeKeyborg } from 'keyborg';\nimport { FOCUS_WITHIN_ATTR } from './constants';\n\n/**\n * Because `addEventListener` type override falls back to 2nd definition (evt name is unknown string literal)\n * evt is being typed as a base class of MouseEvent -> `Event`.\n * This type is used to override `listener` calls to make TS happy\n */\ntype ListenerOverride = (evt: Event) => void;\n\n/**\n * A ponyfill that allows `:focus-within` to support visibility based on keyboard/mouse navigation\n * like `:focus-visible` https://github.com/WICG/focus-visible/issues/151\n * @returns ref to the element that uses `:focus-within` styles\n */\nexport function applyFocusWithinPolyfill(element: HTMLElement, win: Window): () => void {\n const keyborg = createKeyborg(win);\n\n // When navigation mode changes to mouse, remove the focus-within selector\n keyborg.subscribe(isNavigatingWithKeyboard => {\n if (!isNavigatingWithKeyboard) {\n removeFocusWithinClass(element);\n }\n });\n\n // Keyborg's focusin event is delegated so it's only registered once on the window\n // and contains metadata about the focus event\n const keyborgListener = (e: KeyborgFocusInEvent) => {\n if (keyborg.isNavigatingWithKeyboard() && isHTMLElement(e.target)) {\n // Griffel can't create chained global styles so use the parent element for now\n applyFocusWithinClass(element);\n }\n };\n\n // Make sure that when focus leaves the scope, the focus within class is removed\n const blurListener = (e: FocusEvent) => {\n if (!e.relatedTarget || (isHTMLElement(e.relatedTarget) && !element.contains(e.relatedTarget))) {\n removeFocusWithinClass(element);\n }\n };\n\n element.addEventListener(KEYBORG_FOCUSIN, keyborgListener as ListenerOverride);\n element.addEventListener('focusout', blurListener);\n\n // Return disposer\n return () => {\n element.removeEventListener(KEYBORG_FOCUSIN, keyborgListener as ListenerOverride);\n element.removeEventListener('focusout', blurListener);\n disposeKeyborg(keyborg);\n };\n}\n\nfunction applyFocusWithinClass(el: HTMLElement) {\n el.setAttribute(FOCUS_WITHIN_ATTR, '');\n}\n\nfunction removeFocusWithinClass(el: HTMLElement) {\n el.removeAttribute(FOCUS_WITHIN_ATTR);\n}\n\nfunction isHTMLElement(target: EventTarget | null): target is HTMLElement {\n if (!target) {\n return false;\n }\n return Boolean(target && typeof target === 'object' && 'classList' in target && 'contains' in target);\n}\n"],"names":["applyFocusWithinPolyfill","element","win","keyborg","createKeyborg","subscribe","isNavigatingWithKeyboard","removeFocusWithinClass","keyborgListener","e","isHTMLElement","target","applyFocusWithinClass","blurListener","relatedTarget","contains","addEventListener","KEYBORG_FOCUSIN","removeEventListener","disposeKeyborg","el","setAttribute","FOCUS_WITHIN_ATTR","removeAttribute","Boolean"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAegBA;;;eAAAA;;;yBAfoE;2BAClD;AAc3B,SAASA,yBAAyBC,OAAoB,EAAEC,GAAW;IACxE,MAAMC,UAAUC,IAAAA,sBAAAA,EAAcF;IAE9B,0EAA0E;IAC1EC,QAAQE,SAAS,CAACC,CAAAA;QAChB,IAAI,CAACA,0BAA0B;YAC7BC,uBAAuBN;QACzB;IACF;IAEA,kFAAkF;IAClF,8CAA8C;IAC9C,MAAMO,kBAAkB,CAACC;QACvB,IAAIN,QAAQG,wBAAwB,MAAMI,cAAcD,EAAEE,MAAM,GAAG;YACjE,+EAA+E;YAC/EC,sBAAsBX;QACxB;IACF;IAEA,gFAAgF;IAChF,MAAMY,eAAe,CAACJ;QACpB,IAAI,CAACA,EAAEK,aAAa,IAAKJ,cAAcD,EAAEK,aAAa,KAAK,CAACb,QAAQc,QAAQ,CAACN,EAAEK,aAAa,GAAI;YAC9FP,uBAAuBN;QACzB;IACF;IAEAA,QAAQe,gBAAgB,CAACC,wBAAAA,EAAiBT;IAC1CP,QAAQe,gBAAgB,CAAC,YAAYH;IAErC,kBAAkB;IAClB,OAAO;QACLZ,QAAQiB,mBAAmB,CAACD,wBAAAA,EAAiBT;QAC7CP,QAAQiB,mBAAmB,CAAC,YAAYL;QACxCM,IAAAA,uBAAAA,EAAehB;IACjB;AACF;AAEA,SAASS,sBAAsBQ,EAAe;IAC5CA,GAAGC,YAAY,CAACC,4BAAAA,EAAmB;AACrC;AAEA,SAASf,uBAAuBa,EAAe;IAC7CA,GAAGG,eAAe,CAACD,4BAAAA;AACrB;AAEA,SAASZ,cAAcC,MAA0B;IAC/C,IAAI,CAACA,QAAQ;QACX,OAAO;IACT;IACA,OAAOa,QAAQb,UAAU,OAAOA,WAAW,YAAY,eAAeA,UAAU,cAAcA;AAChG"}
1
+ {"version":3,"sources":["../src/focus/focusWithinPolyfill.ts"],"sourcesContent":["import { KEYBORG_FOCUSIN, KeyborgFocusInEvent, createKeyborg, disposeKeyborg } from 'keyborg';\nimport { FOCUS_WITHIN_ATTR } from './constants';\n\n/**\n * Because `addEventListener` type override falls back to 2nd definition (evt name is unknown string literal)\n * evt is being typed as a base class of MouseEvent -> `Event`.\n * This type is used to override `listener` calls to make TS happy\n */\ntype ListenerOverride = (evt: Event) => void;\n\n/**\n * A ponyfill that allows `:focus-within` to support visibility based on keyboard/mouse navigation\n * like `:focus-visible` https://github.com/WICG/focus-visible/issues/151\n * @returns ref to the element that uses `:focus-within` styles\n */\nexport function applyFocusWithinPolyfill(element: HTMLElement, win: Window): () => void {\n const keyborg = createKeyborg(win);\n\n // When navigation mode changes to mouse, remove the focus-within selector\n keyborg.subscribe(isNavigatingWithKeyboard => {\n if (!isNavigatingWithKeyboard) {\n removeFocusWithinClass(element);\n }\n });\n\n // Keyborg's focusin event is delegated so it's only registered once on the window\n // and contains metadata about the focus event\n const keyborgListener = (e: KeyborgFocusInEvent) => {\n if (keyborg.isNavigatingWithKeyboard() && isHTMLElement(e.target)) {\n // Griffel can't create chained global styles so use the parent element for now\n applyFocusWithinClass(element);\n }\n };\n\n // Make sure that when focus leaves the scope, the focus within class is removed\n const blurListener = (e: FocusEvent) => {\n if (!e.relatedTarget || (isHTMLElement(e.relatedTarget) && !element.contains(e.relatedTarget))) {\n removeFocusWithinClass(element);\n }\n };\n\n element.addEventListener(KEYBORG_FOCUSIN, keyborgListener as ListenerOverride);\n element.addEventListener('focusout', blurListener);\n\n // Return disposer\n return () => {\n element.removeEventListener(KEYBORG_FOCUSIN, keyborgListener as ListenerOverride);\n element.removeEventListener('focusout', blurListener);\n disposeKeyborg(keyborg);\n };\n}\n\nfunction applyFocusWithinClass(el: HTMLElement) {\n el.setAttribute(FOCUS_WITHIN_ATTR, '');\n}\n\nfunction removeFocusWithinClass(el: HTMLElement) {\n el.removeAttribute(FOCUS_WITHIN_ATTR);\n}\n\nfunction isHTMLElement(target: EventTarget | null): target is HTMLElement {\n if (!target) {\n return false;\n }\n return Boolean(target && typeof target === 'object' && 'classList' in target && 'contains' in target);\n}\n"],"names":["applyFocusWithinPolyfill","element","win","keyborg","createKeyborg","subscribe","isNavigatingWithKeyboard","removeFocusWithinClass","keyborgListener","e","isHTMLElement","target","applyFocusWithinClass","blurListener","relatedTarget","contains","addEventListener","KEYBORG_FOCUSIN","removeEventListener","disposeKeyborg","el","setAttribute","FOCUS_WITHIN_ATTR","removeAttribute","Boolean"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAegBA;;;eAAAA;;;yBAfoE;2BAClD;AAc3B,SAASA,yBAAyBC,OAAoB,EAAEC,GAAW;IACxE,MAAMC,UAAUC,IAAAA,sBAAa,EAACF;IAE9B,0EAA0E;IAC1EC,QAAQE,SAAS,CAACC,CAAAA;QAChB,IAAI,CAACA,0BAA0B;YAC7BC,uBAAuBN;QACzB;IACF;IAEA,kFAAkF;IAClF,8CAA8C;IAC9C,MAAMO,kBAAkB,CAACC;QACvB,IAAIN,QAAQG,wBAAwB,MAAMI,cAAcD,EAAEE,MAAM,GAAG;YACjE,+EAA+E;YAC/EC,sBAAsBX;QACxB;IACF;IAEA,gFAAgF;IAChF,MAAMY,eAAe,CAACJ;QACpB,IAAI,CAACA,EAAEK,aAAa,IAAKJ,cAAcD,EAAEK,aAAa,KAAK,CAACb,QAAQc,QAAQ,CAACN,EAAEK,aAAa,GAAI;YAC9FP,uBAAuBN;QACzB;IACF;IAEAA,QAAQe,gBAAgB,CAACC,wBAAe,EAAET;IAC1CP,QAAQe,gBAAgB,CAAC,YAAYH;IAErC,kBAAkB;IAClB,OAAO;QACLZ,QAAQiB,mBAAmB,CAACD,wBAAe,EAAET;QAC7CP,QAAQiB,mBAAmB,CAAC,YAAYL;QACxCM,IAAAA,uBAAc,EAAChB;IACjB;AACF;AAEA,SAASS,sBAAsBQ,EAAe;IAC5CA,GAAGC,YAAY,CAACC,4BAAiB,EAAE;AACrC;AAEA,SAASf,uBAAuBa,EAAe;IAC7CA,GAAGG,eAAe,CAACD,4BAAiB;AACtC;AAEA,SAASZ,cAAcC,MAA0B;IAC/C,IAAI,CAACA,QAAQ;QACX,OAAO;IACT;IACA,OAAOa,QAAQb,UAAU,OAAOA,WAAW,YAAY,eAAeA,UAAU,cAAcA;AAChG"}
@@ -2,8 +2,27 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _export_star = require("@swc/helpers/_/_export_star");
6
- _export_star._(require("./createCustomFocusIndicatorStyle"), exports);
7
- _export_star._(require("./createFocusOutlineStyle"), exports);
8
- _export_star._(require("./focusVisiblePolyfill"), exports);
9
- _export_star._(require("./focusWithinPolyfill"), exports);
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ applyFocusVisiblePolyfill: function() {
13
+ return _focusVisiblePolyfill.applyFocusVisiblePolyfill;
14
+ },
15
+ applyFocusWithinPolyfill: function() {
16
+ return _focusWithinPolyfill.applyFocusWithinPolyfill;
17
+ },
18
+ createCustomFocusIndicatorStyle: function() {
19
+ return _createCustomFocusIndicatorStyle.createCustomFocusIndicatorStyle;
20
+ },
21
+ createFocusOutlineStyle: function() {
22
+ return _createFocusOutlineStyle.createFocusOutlineStyle;
23
+ }
24
+ });
25
+ const _createCustomFocusIndicatorStyle = require("./createCustomFocusIndicatorStyle");
26
+ const _createFocusOutlineStyle = require("./createFocusOutlineStyle");
27
+ const _focusVisiblePolyfill = require("./focusVisiblePolyfill");
28
+ const _focusWithinPolyfill = require("./focusWithinPolyfill");
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './createCustomFocusIndicatorStyle';\nexport * from './createFocusOutlineStyle';\nexport * from './focusVisiblePolyfill';\nexport * from './focusWithinPolyfill';\n"],"names":[],"rangeMappings":";;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["../src/focus/index.ts"],"sourcesContent":["export type { CreateCustomFocusIndicatorStyleOptions } from './createCustomFocusIndicatorStyle';\nexport { createCustomFocusIndicatorStyle } from './createCustomFocusIndicatorStyle';\nexport type {\n CreateFocusOutlineStyleOptions,\n FocusOutlineOffset,\n FocusOutlineStyleOptions,\n} from './createFocusOutlineStyle';\nexport { createFocusOutlineStyle } from './createFocusOutlineStyle';\nexport { applyFocusVisiblePolyfill } from './focusVisiblePolyfill';\nexport { applyFocusWithinPolyfill } from './focusWithinPolyfill';\n"],"names":["applyFocusVisiblePolyfill","applyFocusWithinPolyfill","createCustomFocusIndicatorStyle","createFocusOutlineStyle"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAQSA,yBAAyB;eAAzBA,+CAAyB;;IACzBC,wBAAwB;eAAxBA,6CAAwB;;IARxBC,+BAA+B;eAA/BA,gEAA+B;;IAM/BC,uBAAuB;eAAvBA,gDAAuB;;;iDANgB;yCAMR;sCACE;qCACD"}
@@ -2,20 +2,82 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _export_star = require("@swc/helpers/_/_export_star");
6
- _export_star._(require("./useArrowNavigationGroup"), exports);
7
- _export_star._(require("./useFocusableGroup"), exports);
8
- _export_star._(require("./useFocusFinders"), exports);
9
- _export_star._(require("./useFocusVisible"), exports);
10
- _export_star._(require("./useFocusWithin"), exports);
11
- _export_star._(require("./useKeyboardNavAttribute"), exports);
12
- _export_star._(require("./useOnKeyboardNavigationChange"), exports);
13
- _export_star._(require("./useModalAttributes"), exports);
14
- _export_star._(require("./useTabsterAttributes"), exports);
15
- _export_star._(require("./useObservedElement"), exports);
16
- _export_star._(require("./useMergeTabsterAttributes"), exports);
17
- _export_star._(require("./useFocusObserved"), exports);
18
- _export_star._(require("./useRestoreFocus"), exports);
19
- _export_star._(require("./useUncontrolledFocus"), exports);
20
- _export_star._(require("./useSetKeyboardNavigation"), exports);
21
- _export_star._(require("./useFocusedElementChange"), exports);
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ useArrowNavigationGroup: function() {
13
+ return _useArrowNavigationGroup.useArrowNavigationGroup;
14
+ },
15
+ useFocusFinders: function() {
16
+ return _useFocusFinders.useFocusFinders;
17
+ },
18
+ useFocusObserved: function() {
19
+ return _useFocusObserved.useFocusObserved;
20
+ },
21
+ useFocusVisible: function() {
22
+ return _useFocusVisible.useFocusVisible;
23
+ },
24
+ useFocusWithin: function() {
25
+ return _useFocusWithin.useFocusWithin;
26
+ },
27
+ useFocusableGroup: function() {
28
+ return _useFocusableGroup.useFocusableGroup;
29
+ },
30
+ useFocusedElementChange: function() {
31
+ return _useFocusedElementChange.useFocusedElementChange;
32
+ },
33
+ useIsNavigatingWithKeyboard: function() {
34
+ return _useIsNavigatingWithKeyboard.useIsNavigatingWithKeyboard;
35
+ },
36
+ useKeyboardNavAttribute: function() {
37
+ return _useKeyboardNavAttribute.useKeyboardNavAttribute;
38
+ },
39
+ useMergedTabsterAttributes_unstable: function() {
40
+ return _useMergeTabsterAttributes.useMergedTabsterAttributes_unstable;
41
+ },
42
+ useModalAttributes: function() {
43
+ return _useModalAttributes.useModalAttributes;
44
+ },
45
+ useObservedElement: function() {
46
+ return _useObservedElement.useObservedElement;
47
+ },
48
+ useOnKeyboardNavigationChange: function() {
49
+ return _useOnKeyboardNavigationChange.useOnKeyboardNavigationChange;
50
+ },
51
+ useRestoreFocusSource: function() {
52
+ return _useRestoreFocus.useRestoreFocusSource;
53
+ },
54
+ useRestoreFocusTarget: function() {
55
+ return _useRestoreFocus.useRestoreFocusTarget;
56
+ },
57
+ useSetKeyboardNavigation: function() {
58
+ return _useSetKeyboardNavigation.useSetKeyboardNavigation;
59
+ },
60
+ useTabsterAttributes: function() {
61
+ return _useTabsterAttributes.useTabsterAttributes;
62
+ },
63
+ useUncontrolledFocus: function() {
64
+ return _useUncontrolledFocus.useUncontrolledFocus;
65
+ }
66
+ });
67
+ const _useArrowNavigationGroup = require("./useArrowNavigationGroup");
68
+ const _useFocusableGroup = require("./useFocusableGroup");
69
+ const _useFocusFinders = require("./useFocusFinders");
70
+ const _useFocusVisible = require("./useFocusVisible");
71
+ const _useFocusWithin = require("./useFocusWithin");
72
+ const _useKeyboardNavAttribute = require("./useKeyboardNavAttribute");
73
+ const _useOnKeyboardNavigationChange = require("./useOnKeyboardNavigationChange");
74
+ const _useModalAttributes = require("./useModalAttributes");
75
+ const _useTabsterAttributes = require("./useTabsterAttributes");
76
+ const _useObservedElement = require("./useObservedElement");
77
+ const _useMergeTabsterAttributes = require("./useMergeTabsterAttributes");
78
+ const _useFocusObserved = require("./useFocusObserved");
79
+ const _useRestoreFocus = require("./useRestoreFocus");
80
+ const _useUncontrolledFocus = require("./useUncontrolledFocus");
81
+ const _useIsNavigatingWithKeyboard = require("./useIsNavigatingWithKeyboard");
82
+ const _useSetKeyboardNavigation = require("./useSetKeyboardNavigation");
83
+ const _useFocusedElementChange = require("./useFocusedElementChange");
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './useArrowNavigationGroup';\nexport * from './useFocusableGroup';\nexport * from './useFocusFinders';\nexport * from './useFocusVisible';\nexport * from './useFocusWithin';\nexport * from './useKeyboardNavAttribute';\nexport * from './useOnKeyboardNavigationChange';\nexport * from './useModalAttributes';\nexport * from './useTabsterAttributes';\nexport * from './useObservedElement';\nexport * from './useMergeTabsterAttributes';\nexport * from './useFocusObserved';\nexport * from './useRestoreFocus';\nexport * from './useUncontrolledFocus';\nexport * from './useSetKeyboardNavigation';\nexport * from './useFocusedElementChange';\n"],"names":[],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["../src/hooks/index.ts"],"sourcesContent":["export type { UseArrowNavigationGroupOptions } from './useArrowNavigationGroup';\nexport { useArrowNavigationGroup } from './useArrowNavigationGroup';\nexport type { UseFocusableGroupOptions } from './useFocusableGroup';\nexport { useFocusableGroup } from './useFocusableGroup';\nexport { useFocusFinders } from './useFocusFinders';\nexport { useFocusVisible } from './useFocusVisible';\nexport { useFocusWithin } from './useFocusWithin';\nexport { useKeyboardNavAttribute } from './useKeyboardNavAttribute';\nexport { useOnKeyboardNavigationChange } from './useOnKeyboardNavigationChange';\nexport type { UseModalAttributesOptions } from './useModalAttributes';\nexport { useModalAttributes } from './useModalAttributes';\nexport { useTabsterAttributes } from './useTabsterAttributes';\nexport { useObservedElement } from './useObservedElement';\nexport { useMergedTabsterAttributes_unstable } from './useMergeTabsterAttributes';\nexport { useFocusObserved } from './useFocusObserved';\nexport { useRestoreFocusSource, useRestoreFocusTarget } from './useRestoreFocus';\nexport { useUncontrolledFocus } from './useUncontrolledFocus';\nexport { useIsNavigatingWithKeyboard } from './useIsNavigatingWithKeyboard';\nexport { useSetKeyboardNavigation } from './useSetKeyboardNavigation';\nexport { useFocusedElementChange } from './useFocusedElementChange';\n"],"names":["useArrowNavigationGroup","useFocusFinders","useFocusObserved","useFocusVisible","useFocusWithin","useFocusableGroup","useFocusedElementChange","useIsNavigatingWithKeyboard","useKeyboardNavAttribute","useMergedTabsterAttributes_unstable","useModalAttributes","useObservedElement","useOnKeyboardNavigationChange","useRestoreFocusSource","useRestoreFocusTarget","useSetKeyboardNavigation","useTabsterAttributes","useUncontrolledFocus"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACSA,uBAAuB;eAAvBA,gDAAuB;;IAGvBC,eAAe;eAAfA,gCAAe;;IAUfC,gBAAgB;eAAhBA,kCAAgB;;IAThBC,eAAe;eAAfA,gCAAe;;IACfC,cAAc;eAAdA,8BAAc;;IAHdC,iBAAiB;eAAjBA,oCAAiB;;IAgBjBC,uBAAuB;eAAvBA,gDAAuB;;IAFvBC,2BAA2B;eAA3BA,wDAA2B;;IAV3BC,uBAAuB;eAAvBA,gDAAuB;;IAMvBC,mCAAmC;eAAnCA,8DAAmC;;IAHnCC,kBAAkB;eAAlBA,sCAAkB;;IAElBC,kBAAkB;eAAlBA,sCAAkB;;IAJlBC,6BAA6B;eAA7BA,4DAA6B;;IAO7BC,qBAAqB;eAArBA,sCAAqB;;IAAEC,qBAAqB;eAArBA,sCAAqB;;IAG5CC,wBAAwB;eAAxBA,kDAAwB;;IAPxBC,oBAAoB;eAApBA,0CAAoB;;IAKpBC,oBAAoB;eAApBA,0CAAoB;;;yCAfW;mCAEN;iCACF;iCACA;gCACD;yCACS;+CACM;oCAEX;sCACE;oCACF;2CACiB;kCACnB;iCAC4B;sCACxB;6CACO;0CACH;yCACD"}
@@ -12,7 +12,8 @@ const _tabster = require("tabster");
12
12
  const _useTabsterAttributes = require("./useTabsterAttributes");
13
13
  const _useTabster = require("./useTabster");
14
14
  const useArrowNavigationGroup = (options = {})=>{
15
- const { circular, axis, memorizeCurrent = true, tabbable, ignoreDefaultKeydown, unstable_hasDefault } = options;
15
+ const { circular, axis, memorizeCurrent = true, tabbable, ignoreDefaultKeydown, // eslint-disable-next-line @typescript-eslint/naming-convention
16
+ unstable_hasDefault } = options;
16
17
  const tabster = (0, _useTabster.useTabster)();
17
18
  if (tabster) {
18
19
  (0, _tabster.getMover)(tabster);
@@ -1 +1 @@
1
- {"version":3,"sources":["useArrowNavigationGroup.ts"],"sourcesContent":["import { Types, getMover, MoverDirections } from 'tabster';\nimport { useTabsterAttributes } from './useTabsterAttributes';\nimport { useTabster } from './useTabster';\n\nexport interface UseArrowNavigationGroupOptions {\n /**\n * Focus will navigate vertically, horizontally or in both directions (grid), defaults to horizontally\n * @defaultValue vertical\n */\n axis?: 'vertical' | 'horizontal' | 'grid' | 'grid-linear' | 'both';\n /**\n * Focus will cycle to the first/last elements of the group without stopping\n */\n circular?: boolean;\n /**\n * Last focused element in the group will be remembered and focused (if still\n * available) when tabbing from outside of the group\n * @default true\n */\n memorizeCurrent?: boolean;\n /**\n * Allow tabbing within the arrow navigation group items.\n */\n tabbable?: boolean;\n /**\n * Tabster should ignore default handling of keydown events\n */\n ignoreDefaultKeydown?: Types.FocusableProps['ignoreKeydown'];\n /**\n * The default focusable item in the group will be an element with Focusable.isDefault property.\n * Note that there is no way in \\@fluentui/react-tabster to set default focusable element,\n * and this option is currently for internal testing purposes only.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_hasDefault?: boolean;\n}\n\n/**\n * A hook that returns the necessary tabster attributes to support arrow key navigation\n * @param options - Options to configure keyboard navigation\n */\nexport const useArrowNavigationGroup = (options: UseArrowNavigationGroupOptions = {}): Types.TabsterDOMAttribute => {\n const {\n circular,\n axis,\n memorizeCurrent = true,\n tabbable,\n ignoreDefaultKeydown,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_hasDefault,\n } = options;\n const tabster = useTabster();\n\n if (tabster) {\n getMover(tabster);\n }\n\n return useTabsterAttributes({\n mover: {\n cyclic: !!circular,\n direction: axisToMoverDirection(axis ?? 'vertical'),\n memorizeCurrent,\n tabbable,\n hasDefault: unstable_hasDefault,\n },\n ...(ignoreDefaultKeydown && {\n focusable: {\n ignoreKeydown: ignoreDefaultKeydown,\n },\n }),\n });\n};\n\nfunction axisToMoverDirection(axis: UseArrowNavigationGroupOptions['axis']): Types.MoverDirection {\n switch (axis) {\n case 'horizontal':\n return MoverDirections.Horizontal;\n case 'grid':\n return MoverDirections.Grid;\n case 'grid-linear':\n return MoverDirections.GridLinear;\n case 'both':\n return MoverDirections.Both;\n\n case 'vertical':\n default:\n return MoverDirections.Vertical;\n }\n}\n"],"names":["useArrowNavigationGroup","options","circular","axis","memorizeCurrent","tabbable","ignoreDefaultKeydown","unstable_hasDefault","tabster","useTabster","getMover","useTabsterAttributes","mover","cyclic","direction","axisToMoverDirection","hasDefault","focusable","ignoreKeydown","MoverDirections","Horizontal","Grid","GridLinear","Both","Vertical"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAyCaA;;;eAAAA;;;yBAzCoC;sCACZ;4BACV;AAuCpB,MAAMA,0BAA0B,CAACC,UAA0C,CAAC,CAAC;IAClF,MAAM,EACJC,QAAQ,EACRC,IAAI,EACJC,kBAAkB,IAAI,EACtBC,QAAQ,EACRC,oBAAoB,EAEpBC,mBAAmB,EACpB,GAAGN;IACJ,MAAMO,UAAUC,IAAAA,sBAAAA;IAEhB,IAAID,SAAS;QACXE,IAAAA,iBAAAA,EAASF;IACX;IAEA,OAAOG,IAAAA,0CAAAA,EAAqB;QAC1BC,OAAO;YACLC,QAAQ,CAAC,CAACX;YACVY,WAAWC,qBAAqBZ,SAAAA,QAAAA,SAAAA,KAAAA,IAAAA,OAAQ;YACxCC;YACAC;YACAW,YAAYT;QACd;QACA,GAAID,wBAAwB;YAC1BW,WAAW;gBACTC,eAAeZ;YACjB;QACF,CAAC;IACH;AACF;AAEA,SAASS,qBAAqBZ,IAA4C;IACxE,OAAQA;QACN,KAAK;YACH,OAAOgB,wBAAAA,CAAgBC,UAAU;QACnC,KAAK;YACH,OAAOD,wBAAAA,CAAgBE,IAAI;QAC7B,KAAK;YACH,OAAOF,wBAAAA,CAAgBG,UAAU;QACnC,KAAK;YACH,OAAOH,wBAAAA,CAAgBI,IAAI;QAE7B,KAAK;QACL;YACE,OAAOJ,wBAAAA,CAAgBK,QAAQ;IACnC;AACF"}
1
+ {"version":3,"sources":["../src/hooks/useArrowNavigationGroup.ts"],"sourcesContent":["import { Types, getMover, MoverDirections } from 'tabster';\nimport { useTabsterAttributes } from './useTabsterAttributes';\nimport { useTabster } from './useTabster';\n\nexport interface UseArrowNavigationGroupOptions {\n /**\n * Focus will navigate vertically, horizontally or in both directions (grid), defaults to horizontally\n * @defaultValue vertical\n */\n axis?: 'vertical' | 'horizontal' | 'grid' | 'grid-linear' | 'both';\n /**\n * Focus will cycle to the first/last elements of the group without stopping\n */\n circular?: boolean;\n /**\n * Last focused element in the group will be remembered and focused (if still\n * available) when tabbing from outside of the group\n * @default true\n */\n memorizeCurrent?: boolean;\n /**\n * Allow tabbing within the arrow navigation group items.\n */\n tabbable?: boolean;\n /**\n * Tabster should ignore default handling of keydown events\n */\n ignoreDefaultKeydown?: Types.FocusableProps['ignoreKeydown'];\n /**\n * The default focusable item in the group will be an element with Focusable.isDefault property.\n * Note that there is no way in \\@fluentui/react-tabster to set default focusable element,\n * and this option is currently for internal testing purposes only.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_hasDefault?: boolean;\n}\n\n/**\n * A hook that returns the necessary tabster attributes to support arrow key navigation\n * @param options - Options to configure keyboard navigation\n */\nexport const useArrowNavigationGroup = (options: UseArrowNavigationGroupOptions = {}): Types.TabsterDOMAttribute => {\n const {\n circular,\n axis,\n memorizeCurrent = true,\n tabbable,\n ignoreDefaultKeydown,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_hasDefault,\n } = options;\n const tabster = useTabster();\n\n if (tabster) {\n getMover(tabster);\n }\n\n return useTabsterAttributes({\n mover: {\n cyclic: !!circular,\n direction: axisToMoverDirection(axis ?? 'vertical'),\n memorizeCurrent,\n tabbable,\n hasDefault: unstable_hasDefault,\n },\n ...(ignoreDefaultKeydown && {\n focusable: {\n ignoreKeydown: ignoreDefaultKeydown,\n },\n }),\n });\n};\n\nfunction axisToMoverDirection(axis: UseArrowNavigationGroupOptions['axis']): Types.MoverDirection {\n switch (axis) {\n case 'horizontal':\n return MoverDirections.Horizontal;\n case 'grid':\n return MoverDirections.Grid;\n case 'grid-linear':\n return MoverDirections.GridLinear;\n case 'both':\n return MoverDirections.Both;\n\n case 'vertical':\n default:\n return MoverDirections.Vertical;\n }\n}\n"],"names":["useArrowNavigationGroup","options","circular","axis","memorizeCurrent","tabbable","ignoreDefaultKeydown","unstable_hasDefault","tabster","useTabster","getMover","useTabsterAttributes","mover","cyclic","direction","axisToMoverDirection","hasDefault","focusable","ignoreKeydown","MoverDirections","Horizontal","Grid","GridLinear","Both","Vertical"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAyCaA;;;eAAAA;;;yBAzCoC;sCACZ;4BACV;AAuCpB,MAAMA,0BAA0B,CAACC,UAA0C,CAAC,CAAC;IAClF,MAAM,EACJC,QAAQ,EACRC,IAAI,EACJC,kBAAkB,IAAI,EACtBC,QAAQ,EACRC,oBAAoB,EACpB,gEAAgE;IAChEC,mBAAmB,EACpB,GAAGN;IACJ,MAAMO,UAAUC,IAAAA,sBAAU;IAE1B,IAAID,SAAS;QACXE,IAAAA,iBAAQ,EAACF;IACX;IAEA,OAAOG,IAAAA,0CAAoB,EAAC;QAC1BC,OAAO;YACLC,QAAQ,CAAC,CAACX;YACVY,WAAWC,qBAAqBZ,iBAAAA,kBAAAA,OAAQ;YACxCC;YACAC;YACAW,YAAYT;QACd;QACA,GAAID,wBAAwB;YAC1BW,WAAW;gBACTC,eAAeZ;YACjB;QACF,CAAC;IACH;AACF;AAEA,SAASS,qBAAqBZ,IAA4C;IACxE,OAAQA;QACN,KAAK;YACH,OAAOgB,wBAAe,CAACC,UAAU;QACnC,KAAK;YACH,OAAOD,wBAAe,CAACE,IAAI;QAC7B,KAAK;YACH,OAAOF,wBAAe,CAACG,UAAU;QACnC,KAAK;YACH,OAAOH,wBAAe,CAACI,IAAI;QAE7B,KAAK;QACL;YACE,OAAOJ,wBAAe,CAACK,QAAQ;IACnC;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useFocusFinders.ts"],"sourcesContent":["import * as React from 'react';\nimport { Types as TabsterTypes } from 'tabster';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useTabster } from './useTabster';\n\n/**\n * Returns a set of helper functions that will traverse focusable elements in the context of a root DOM element\n */\nexport const useFocusFinders = () => {\n const tabster = useTabster();\n const { targetDocument } = useFluent();\n\n // Narrow props for now and let need dictate additional props in the future\n const findAllFocusable = React.useCallback(\n (container: HTMLElement, acceptCondition?: (el: HTMLElement) => boolean) =>\n tabster?.focusable.findAll({ container, acceptCondition }) || [],\n [tabster],\n );\n\n const findFirstFocusable = React.useCallback(\n (container: HTMLElement) => tabster?.focusable.findFirst({ container }),\n [tabster],\n );\n\n const findLastFocusable = React.useCallback(\n (container: HTMLElement) => tabster?.focusable.findLast({ container }),\n [tabster],\n );\n\n const findNextFocusable = React.useCallback(\n (currentElement: HTMLElement, options: Pick<Partial<TabsterTypes.FindNextProps>, 'container'> = {}) => {\n if (!tabster || !targetDocument) {\n return null;\n }\n\n const { container = targetDocument.body } = options;\n\n return tabster.focusable.findNext({ currentElement, container });\n },\n [tabster, targetDocument],\n );\n\n const findPrevFocusable = React.useCallback(\n (currentElement: HTMLElement, options: Pick<Partial<TabsterTypes.FindNextProps>, 'container'> = {}) => {\n if (!tabster || !targetDocument) {\n return null;\n }\n\n const { container = targetDocument.body } = options;\n\n return tabster.focusable.findPrev({ currentElement, container });\n },\n [tabster, targetDocument],\n );\n\n return {\n findAllFocusable,\n findFirstFocusable,\n findLastFocusable,\n findNextFocusable,\n findPrevFocusable,\n };\n};\n"],"names":["useFocusFinders","tabster","useTabster","targetDocument","useFluent","findAllFocusable","React","useCallback","container","acceptCondition","focusable","findAll","findFirstFocusable","findFirst","findLastFocusable","findLast","findNextFocusable","currentElement","options","body","findNext","findPrevFocusable","findPrev"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;qCAEyB;4BACrB;AAKpB,MAAMA,kBAAkB;IAC7B,MAAMC,UAAUC,IAAAA,sBAAAA;IAChB,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAAA;IAE3B,2EAA2E;IAC3E,MAAMC,mBAAmBC,OAAMC,WAAW,CACxC,CAACC,WAAwBC,kBACvBR,CAAAA,YAAAA,QAAAA,YAAAA,KAAAA,IAAAA,KAAAA,IAAAA,QAASS,SAAS,CAACC,OAAO,CAAC;YAAEH;YAAWC;QAAgB,EAAA,KAAM,EAAE,EAClE;QAACR;KAAQ;IAGX,MAAMW,qBAAqBN,OAAMC,WAAW,CAC1C,CAACC,YAA2BP,YAAAA,QAAAA,YAAAA,KAAAA,IAAAA,KAAAA,IAAAA,QAASS,SAAS,CAACG,SAAS,CAAC;YAAEL;QAAU,IACrE;QAACP;KAAQ;IAGX,MAAMa,oBAAoBR,OAAMC,WAAW,CACzC,CAACC,YAA2BP,YAAAA,QAAAA,YAAAA,KAAAA,IAAAA,KAAAA,IAAAA,QAASS,SAAS,CAACK,QAAQ,CAAC;YAAEP;QAAU,IACpE;QAACP;KAAQ;IAGX,MAAMe,oBAAoBV,OAAMC,WAAW,CACzC,CAACU,gBAA6BC,UAAkE,CAAC,CAAC;QAChG,IAAI,CAACjB,WAAW,CAACE,gBAAgB;YAC/B,OAAO;QACT;QAEA,MAAM,EAAEK,YAAYL,eAAegB,IAAI,EAAE,GAAGD;QAE5C,OAAOjB,QAAQS,SAAS,CAACU,QAAQ,CAAC;YAAEH;YAAgBT;QAAU;IAChE,GACA;QAACP;QAASE;KAAe;IAG3B,MAAMkB,oBAAoBf,OAAMC,WAAW,CACzC,CAACU,gBAA6BC,UAAkE,CAAC,CAAC;QAChG,IAAI,CAACjB,WAAW,CAACE,gBAAgB;YAC/B,OAAO;QACT;QAEA,MAAM,EAAEK,YAAYL,eAAegB,IAAI,EAAE,GAAGD;QAE5C,OAAOjB,QAAQS,SAAS,CAACY,QAAQ,CAAC;YAAEL;YAAgBT;QAAU;IAChE,GACA;QAACP;QAASE;KAAe;IAG3B,OAAO;QACLE;QACAO;QACAE;QACAE;QACAK;IACF;AACF"}
1
+ {"version":3,"sources":["../src/hooks/useFocusFinders.ts"],"sourcesContent":["import * as React from 'react';\nimport { Types as TabsterTypes } from 'tabster';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useTabster } from './useTabster';\n\n/**\n * Returns a set of helper functions that will traverse focusable elements in the context of a root DOM element\n */\nexport const useFocusFinders = () => {\n const tabster = useTabster();\n const { targetDocument } = useFluent();\n\n // Narrow props for now and let need dictate additional props in the future\n const findAllFocusable = React.useCallback(\n (container: HTMLElement, acceptCondition?: (el: HTMLElement) => boolean) =>\n tabster?.focusable.findAll({ container, acceptCondition }) || [],\n [tabster],\n );\n\n const findFirstFocusable = React.useCallback(\n (container: HTMLElement) => tabster?.focusable.findFirst({ container }),\n [tabster],\n );\n\n const findLastFocusable = React.useCallback(\n (container: HTMLElement) => tabster?.focusable.findLast({ container }),\n [tabster],\n );\n\n const findNextFocusable = React.useCallback(\n (currentElement: HTMLElement, options: Pick<Partial<TabsterTypes.FindNextProps>, 'container'> = {}) => {\n if (!tabster || !targetDocument) {\n return null;\n }\n\n const { container = targetDocument.body } = options;\n\n return tabster.focusable.findNext({ currentElement, container });\n },\n [tabster, targetDocument],\n );\n\n const findPrevFocusable = React.useCallback(\n (currentElement: HTMLElement, options: Pick<Partial<TabsterTypes.FindNextProps>, 'container'> = {}) => {\n if (!tabster || !targetDocument) {\n return null;\n }\n\n const { container = targetDocument.body } = options;\n\n return tabster.focusable.findPrev({ currentElement, container });\n },\n [tabster, targetDocument],\n );\n\n return {\n findAllFocusable,\n findFirstFocusable,\n findLastFocusable,\n findNextFocusable,\n findPrevFocusable,\n };\n};\n"],"names":["useFocusFinders","tabster","useTabster","targetDocument","useFluent","findAllFocusable","React","useCallback","container","acceptCondition","focusable","findAll","findFirstFocusable","findFirst","findLastFocusable","findLast","findNextFocusable","currentElement","options","body","findNext","findPrevFocusable","findPrev"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;qCAEyB;4BACrB;AAKpB,MAAMA,kBAAkB;IAC7B,MAAMC,UAAUC,IAAAA,sBAAU;IAC1B,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAS;IAEpC,2EAA2E;IAC3E,MAAMC,mBAAmBC,OAAMC,WAAW,CACxC,CAACC,WAAwBC,kBACvBR,CAAAA,oBAAAA,8BAAAA,QAASS,SAAS,CAACC,OAAO,CAAC;YAAEH;YAAWC;QAAgB,OAAM,EAAE,EAClE;QAACR;KAAQ;IAGX,MAAMW,qBAAqBN,OAAMC,WAAW,CAC1C,CAACC,YAA2BP,oBAAAA,8BAAAA,QAASS,SAAS,CAACG,SAAS,CAAC;YAAEL;QAAU,IACrE;QAACP;KAAQ;IAGX,MAAMa,oBAAoBR,OAAMC,WAAW,CACzC,CAACC,YAA2BP,oBAAAA,8BAAAA,QAASS,SAAS,CAACK,QAAQ,CAAC;YAAEP;QAAU,IACpE;QAACP;KAAQ;IAGX,MAAMe,oBAAoBV,OAAMC,WAAW,CACzC,CAACU,gBAA6BC,UAAkE,CAAC,CAAC;QAChG,IAAI,CAACjB,WAAW,CAACE,gBAAgB;YAC/B,OAAO;QACT;QAEA,MAAM,EAAEK,YAAYL,eAAegB,IAAI,EAAE,GAAGD;QAE5C,OAAOjB,QAAQS,SAAS,CAACU,QAAQ,CAAC;YAAEH;YAAgBT;QAAU;IAChE,GACA;QAACP;QAASE;KAAe;IAG3B,MAAMkB,oBAAoBf,OAAMC,WAAW,CACzC,CAACU,gBAA6BC,UAAkE,CAAC,CAAC;QAChG,IAAI,CAACjB,WAAW,CAACE,gBAAgB;YAC/B,OAAO;QACT;QAEA,MAAM,EAAEK,YAAYL,eAAegB,IAAI,EAAE,GAAGD;QAE5C,OAAOjB,QAAQS,SAAS,CAACY,QAAQ,CAAC;YAAEL;YAAgBT;QAAU;IAChE,GACA;QAACP;QAASE;KAAe;IAG3B,OAAO;QACLE;QACAO;QACAE;QACAE;QACAK;IACF;AACF"}