@atlaskit/top-layer 0.12.2 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/entry-points/focus.js +6 -4
  3. package/dist/cjs/entry-points/use-anchor-position-at-point.js +12 -0
  4. package/dist/cjs/focus/get-first-focusable.js +19 -0
  5. package/dist/cjs/focus/get-focusables.js +30 -0
  6. package/dist/cjs/focus/get-last-focusable.js +19 -0
  7. package/dist/cjs/focus/get-next-focusable.js +43 -0
  8. package/dist/cjs/focus/is-in-same-layer.js +23 -0
  9. package/dist/cjs/focus/is-nested-layer-focused.js +32 -0
  10. package/dist/cjs/focus/selectors.js +19 -0
  11. package/dist/cjs/focus/types.js +1 -0
  12. package/dist/cjs/internal/role-to-aria-has-popup.js +37 -0
  13. package/dist/cjs/internal/role-types.js +1 -97
  14. package/dist/cjs/internal/should-focus-into-popover.js +19 -0
  15. package/dist/cjs/internal/use-anchor-position-at-point.js +127 -0
  16. package/dist/cjs/internal/use-anchor-position.js +7 -3
  17. package/dist/cjs/internal/use-focus-wrap.js +8 -5
  18. package/dist/cjs/internal/use-initial-focus.js +4 -4
  19. package/dist/cjs/placement-map/index.js +2 -2
  20. package/dist/cjs/placement-map/legacy-placements.js +2 -101
  21. package/dist/cjs/placement-map/placement-mapping.js +103 -0
  22. package/dist/cjs/popup/popup-content.js +4 -3
  23. package/dist/cjs/use-arrow-navigation/use-arrow-navigation.js +7 -5
  24. package/dist/es2019/entry-points/focus.js +3 -1
  25. package/dist/es2019/entry-points/use-anchor-position-at-point.js +1 -0
  26. package/dist/es2019/focus/get-first-focusable.js +14 -0
  27. package/dist/es2019/focus/get-focusables.js +19 -0
  28. package/dist/es2019/focus/get-last-focusable.js +14 -0
  29. package/dist/es2019/focus/get-next-focusable.js +38 -0
  30. package/dist/es2019/focus/is-in-same-layer.js +18 -0
  31. package/dist/es2019/focus/is-nested-layer-focused.js +28 -0
  32. package/dist/es2019/focus/selectors.js +11 -0
  33. package/dist/es2019/focus/types.js +0 -0
  34. package/dist/es2019/internal/role-to-aria-has-popup.js +32 -0
  35. package/dist/es2019/internal/role-types.js +0 -92
  36. package/dist/es2019/internal/should-focus-into-popover.js +14 -0
  37. package/dist/es2019/internal/use-anchor-position-at-point.js +122 -0
  38. package/dist/es2019/internal/use-anchor-position.js +6 -3
  39. package/dist/es2019/internal/use-focus-wrap.js +4 -1
  40. package/dist/es2019/internal/use-initial-focus.js +1 -1
  41. package/dist/es2019/placement-map/index.js +1 -1
  42. package/dist/es2019/placement-map/legacy-placements.js +1 -100
  43. package/dist/es2019/placement-map/placement-mapping.js +97 -0
  44. package/dist/es2019/popup/popup-content.js +2 -1
  45. package/dist/es2019/use-arrow-navigation/use-arrow-navigation.js +3 -1
  46. package/dist/esm/entry-points/focus.js +3 -1
  47. package/dist/esm/entry-points/use-anchor-position-at-point.js +1 -0
  48. package/dist/esm/focus/get-first-focusable.js +13 -0
  49. package/dist/esm/focus/get-focusables.js +24 -0
  50. package/dist/esm/focus/get-last-focusable.js +13 -0
  51. package/dist/esm/focus/get-next-focusable.js +37 -0
  52. package/dist/esm/focus/is-in-same-layer.js +17 -0
  53. package/dist/esm/focus/is-nested-layer-focused.js +27 -0
  54. package/dist/esm/focus/selectors.js +13 -0
  55. package/dist/esm/focus/types.js +0 -0
  56. package/dist/esm/internal/role-to-aria-has-popup.js +31 -0
  57. package/dist/esm/internal/role-types.js +0 -90
  58. package/dist/esm/internal/should-focus-into-popover.js +13 -0
  59. package/dist/esm/internal/use-anchor-position-at-point.js +122 -0
  60. package/dist/esm/internal/use-anchor-position.js +7 -3
  61. package/dist/esm/internal/use-focus-wrap.js +4 -1
  62. package/dist/esm/internal/use-initial-focus.js +1 -1
  63. package/dist/esm/placement-map/index.js +1 -1
  64. package/dist/esm/placement-map/legacy-placements.js +1 -100
  65. package/dist/esm/placement-map/placement-mapping.js +97 -0
  66. package/dist/esm/popup/popup-content.js +2 -1
  67. package/dist/esm/use-arrow-navigation/use-arrow-navigation.js +3 -1
  68. package/dist/types/entry-points/focus.d.ts +4 -2
  69. package/dist/types/entry-points/use-anchor-position-at-point.d.ts +1 -0
  70. package/dist/types/focus/get-first-focusable.d.ts +8 -0
  71. package/dist/types/focus/get-focusables.d.ts +13 -0
  72. package/dist/types/focus/get-last-focusable.d.ts +8 -0
  73. package/dist/types/focus/get-next-focusable.d.ts +13 -0
  74. package/dist/types/focus/is-in-same-layer.d.ts +8 -0
  75. package/dist/types/focus/is-nested-layer-focused.d.ts +8 -0
  76. package/dist/types/focus/selectors.d.ts +4 -0
  77. package/dist/types/focus/types.d.ts +5 -0
  78. package/dist/types/internal/role-to-aria-has-popup.d.ts +13 -0
  79. package/dist/types/internal/role-types.d.ts +0 -19
  80. package/dist/types/internal/should-focus-into-popover.d.ts +8 -0
  81. package/dist/types/internal/use-anchor-position-at-point.d.ts +62 -0
  82. package/dist/types/internal/use-anchor-position.d.ts +6 -1
  83. package/dist/types/placement-map/index.d.ts +1 -1
  84. package/dist/types/placement-map/legacy-placements.d.ts +0 -12
  85. package/dist/types/placement-map/placement-mapping.d.ts +13 -0
  86. package/dist/types/use-arrow-navigation/use-arrow-navigation.d.ts +1 -1
  87. package/dist/types-ts4.5/entry-points/focus.d.ts +4 -2
  88. package/dist/types-ts4.5/entry-points/use-anchor-position-at-point.d.ts +1 -0
  89. package/dist/types-ts4.5/focus/get-first-focusable.d.ts +8 -0
  90. package/dist/types-ts4.5/focus/get-focusables.d.ts +13 -0
  91. package/dist/types-ts4.5/focus/get-last-focusable.d.ts +8 -0
  92. package/dist/types-ts4.5/focus/get-next-focusable.d.ts +13 -0
  93. package/dist/types-ts4.5/focus/is-in-same-layer.d.ts +8 -0
  94. package/dist/types-ts4.5/focus/is-nested-layer-focused.d.ts +8 -0
  95. package/dist/types-ts4.5/focus/selectors.d.ts +4 -0
  96. package/dist/types-ts4.5/focus/types.d.ts +5 -0
  97. package/dist/types-ts4.5/internal/role-to-aria-has-popup.d.ts +13 -0
  98. package/dist/types-ts4.5/internal/role-types.d.ts +0 -19
  99. package/dist/types-ts4.5/internal/should-focus-into-popover.d.ts +8 -0
  100. package/dist/types-ts4.5/internal/use-anchor-position-at-point.d.ts +62 -0
  101. package/dist/types-ts4.5/internal/use-anchor-position.d.ts +6 -1
  102. package/dist/types-ts4.5/placement-map/index.d.ts +1 -1
  103. package/dist/types-ts4.5/placement-map/legacy-placements.d.ts +0 -12
  104. package/dist/types-ts4.5/placement-map/placement-mapping.d.ts +13 -0
  105. package/dist/types-ts4.5/use-arrow-navigation/use-arrow-navigation.d.ts +1 -1
  106. package/package.json +1 -1
  107. package/use-anchor-position-at-point/package.json +17 -0
  108. package/dist/cjs/focus/focus.js +0 -169
  109. package/dist/cjs/focus/index.js +0 -24
  110. package/dist/es2019/focus/focus.js +0 -158
  111. package/dist/es2019/focus/index.js +0 -1
  112. package/dist/esm/focus/focus.js +0 -160
  113. package/dist/esm/focus/index.js +0 -1
  114. package/dist/types/focus/focus.d.ts +0 -50
  115. package/dist/types/focus/index.d.ts +0 -2
  116. package/dist/types-ts4.5/focus/focus.d.ts +0 -50
  117. package/dist/types-ts4.5/focus/index.d.ts +0 -2
@@ -1,158 +0,0 @@
1
- /**
2
- * Focusable element selectors and navigation helpers.
3
- *
4
- * Uses CSS selectors to discover focusable elements within a container,
5
- * avoiding the need for a manual registration system. Disabled elements
6
- * (both HTML `disabled` attribute and `aria-disabled="true"`) and elements
7
- * with `tabindex="-1"` are excluded automatically.
8
- *
9
- * All public functions accept an optional `filter` callback to further
10
- * restrict which focusable elements are included.
11
- */
12
-
13
- import { getDocument } from '@atlaskit/browser-apis';
14
- const selectors = (() => {
15
- // Common exclusion filter applied to every selector.
16
- const not = ':not([tabindex="-1"]):not([aria-disabled="true"]):not([aria-hidden="true"])';
17
- const notDisabled = `:not([disabled])${not}`;
18
- const focusable = [`a[href]${not}`, `area[href]${not}`, `input${notDisabled}:not([type="hidden"])`, `select${notDisabled}`, `textarea${notDisabled}`, `button${notDisabled}`, `iframe${not}`, `audio[controls]${not}`, `video[controls]${not}`, `[contenteditable]:not([contenteditable="false"])${not}`, `[tabindex]${notDisabled}${not}`];
19
- return {
20
- focusable: focusable.join(','),
21
- // Build the `:focus` selector
22
- focused: focusable.map(selector => `${selector}:focus`).join(',')
23
- };
24
- })();
25
- const topLayerSelector = '[popover], dialog, [role="dialog"], [role="alertdialog"]';
26
-
27
- /**
28
- * Returns true when `element` and `container` resolve to the same nearest
29
- * top-layer host (or both resolve to `null`, meaning the document layer).
30
- */
31
- function isInSameLayer({
32
- element,
33
- container
34
- }) {
35
- const elementLayer = element.closest(topLayerSelector);
36
- const containerLayer = container.closest(topLayerSelector);
37
- // Both elements are in the "document" layer
38
- if (!elementLayer && !containerLayer) {
39
- return true;
40
- }
41
- return elementLayer === containerLayer;
42
- }
43
-
44
- /**
45
- * Returns `true` when `document.activeElement` is inside a nested top-layer
46
- * descendant of `container` (a `[popover]`, `<dialog>`, `[role="dialog"]` or
47
- * `[role="alertdialog"]` that is itself a descendant of `container`).
48
- */
49
- export function isNestedLayerFocused({
50
- container
51
- }) {
52
- var _getDocument;
53
- const focused = (_getDocument = getDocument()) === null || _getDocument === void 0 ? void 0 : _getDocument.activeElement;
54
- if (!(focused instanceof HTMLElement)) {
55
- return false;
56
- }
57
-
58
- // Cannot be in a nested layer if it is not in the container
59
- if (!container.contains(focused)) {
60
- return false;
61
- }
62
-
63
- // If not in the same layer, must be in a nested layer
64
- return !isInSameLayer({
65
- element: focused,
66
- container
67
- });
68
- }
69
-
70
- /**
71
- * An optional callback to restrict which focusable elements are included.
72
- * Return `true` to include the element, `false` to skip it.
73
- */
74
-
75
- /**
76
- * Returns all focusable HTMLElements within the container, optionally filtered.
77
- *
78
- * Focusables that belong to a nested top-layer scope (a `[popover]` or
79
- * `<dialog>` descendant of the container) are excluded - those elements
80
- * are owned by the inner layer's focus management. The container itself
81
- * is allowed to be a popover/dialog; only nested ones are filtered.
82
- */
83
- function getFocusables({
84
- container,
85
- filter
86
- }) {
87
- return Array.from(container.querySelectorAll(selectors.focusable)).filter(element => element instanceof HTMLElement).filter(element => isInSameLayer({
88
- element,
89
- container
90
- })).filter(element => !filter || filter(element, container));
91
- }
92
-
93
- /**
94
- * Returns the first focusable element within the container.
95
- */
96
- // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
97
- export function getFirstFocusable({
98
- container,
99
- filter
100
- }) {
101
- const items = getFocusables({
102
- container,
103
- filter
104
- });
105
- return items.length > 0 ? items[0] : null;
106
- }
107
-
108
- /**
109
- * Returns the last focusable element within the container.
110
- */
111
- // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
112
- export function getLastFocusable({
113
- container,
114
- filter
115
- }) {
116
- const items = getFocusables({
117
- container,
118
- filter
119
- });
120
- return items.length > 0 ? items[items.length - 1] : null;
121
- }
122
-
123
- /**
124
- * Returns the next focusable element in the given direction relative to the
125
- * currently focused element within the container. Wraps around at both ends.
126
- *
127
- * Returns `null` if there is no focused element within the container or if
128
- * the focused element is not in the list of focusable elements.
129
- */
130
- // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
131
- export function getNextFocusable({
132
- container,
133
- direction,
134
- filter
135
- }) {
136
- var _all$nextIndex;
137
- const all = getFocusables({
138
- container,
139
- filter
140
- });
141
- const current = container.querySelector(selectors.focused);
142
- if (!(current instanceof HTMLElement)) {
143
- return null;
144
- }
145
- const index = all.indexOf(current);
146
- if (index === -1) {
147
- return null;
148
- }
149
- const nextIndex = (() => {
150
- if (direction === 'forwards') {
151
- return (index + 1) % all.length;
152
- }
153
- const proposed = index - 1;
154
- // if going into negative numbers, loop back to the last item
155
- return proposed < 0 ? all.length - 1 : proposed;
156
- })();
157
- return (_all$nextIndex = all[nextIndex]) !== null && _all$nextIndex !== void 0 ? _all$nextIndex : null;
158
- }
@@ -1 +0,0 @@
1
- export { getFirstFocusable, getLastFocusable, getNextFocusable } from './focus';
@@ -1,160 +0,0 @@
1
- /**
2
- * Focusable element selectors and navigation helpers.
3
- *
4
- * Uses CSS selectors to discover focusable elements within a container,
5
- * avoiding the need for a manual registration system. Disabled elements
6
- * (both HTML `disabled` attribute and `aria-disabled="true"`) and elements
7
- * with `tabindex="-1"` are excluded automatically.
8
- *
9
- * All public functions accept an optional `filter` callback to further
10
- * restrict which focusable elements are included.
11
- */
12
-
13
- import { getDocument } from '@atlaskit/browser-apis';
14
- var selectors = function () {
15
- // Common exclusion filter applied to every selector.
16
- var not = ':not([tabindex="-1"]):not([aria-disabled="true"]):not([aria-hidden="true"])';
17
- var notDisabled = ":not([disabled])".concat(not);
18
- var focusable = ["a[href]".concat(not), "area[href]".concat(not), "input".concat(notDisabled, ":not([type=\"hidden\"])"), "select".concat(notDisabled), "textarea".concat(notDisabled), "button".concat(notDisabled), "iframe".concat(not), "audio[controls]".concat(not), "video[controls]".concat(not), "[contenteditable]:not([contenteditable=\"false\"])".concat(not), "[tabindex]".concat(notDisabled).concat(not)];
19
- return {
20
- focusable: focusable.join(','),
21
- // Build the `:focus` selector
22
- focused: focusable.map(function (selector) {
23
- return "".concat(selector, ":focus");
24
- }).join(',')
25
- };
26
- }();
27
- var topLayerSelector = '[popover], dialog, [role="dialog"], [role="alertdialog"]';
28
-
29
- /**
30
- * Returns true when `element` and `container` resolve to the same nearest
31
- * top-layer host (or both resolve to `null`, meaning the document layer).
32
- */
33
- function isInSameLayer(_ref) {
34
- var element = _ref.element,
35
- container = _ref.container;
36
- var elementLayer = element.closest(topLayerSelector);
37
- var containerLayer = container.closest(topLayerSelector);
38
- // Both elements are in the "document" layer
39
- if (!elementLayer && !containerLayer) {
40
- return true;
41
- }
42
- return elementLayer === containerLayer;
43
- }
44
-
45
- /**
46
- * Returns `true` when `document.activeElement` is inside a nested top-layer
47
- * descendant of `container` (a `[popover]`, `<dialog>`, `[role="dialog"]` or
48
- * `[role="alertdialog"]` that is itself a descendant of `container`).
49
- */
50
- export function isNestedLayerFocused(_ref2) {
51
- var _getDocument;
52
- var container = _ref2.container;
53
- var focused = (_getDocument = getDocument()) === null || _getDocument === void 0 ? void 0 : _getDocument.activeElement;
54
- if (!(focused instanceof HTMLElement)) {
55
- return false;
56
- }
57
-
58
- // Cannot be in a nested layer if it is not in the container
59
- if (!container.contains(focused)) {
60
- return false;
61
- }
62
-
63
- // If not in the same layer, must be in a nested layer
64
- return !isInSameLayer({
65
- element: focused,
66
- container: container
67
- });
68
- }
69
-
70
- /**
71
- * An optional callback to restrict which focusable elements are included.
72
- * Return `true` to include the element, `false` to skip it.
73
- */
74
-
75
- /**
76
- * Returns all focusable HTMLElements within the container, optionally filtered.
77
- *
78
- * Focusables that belong to a nested top-layer scope (a `[popover]` or
79
- * `<dialog>` descendant of the container) are excluded - those elements
80
- * are owned by the inner layer's focus management. The container itself
81
- * is allowed to be a popover/dialog; only nested ones are filtered.
82
- */
83
- function getFocusables(_ref3) {
84
- var container = _ref3.container,
85
- filter = _ref3.filter;
86
- return Array.from(container.querySelectorAll(selectors.focusable)).filter(function (element) {
87
- return element instanceof HTMLElement;
88
- }).filter(function (element) {
89
- return isInSameLayer({
90
- element: element,
91
- container: container
92
- });
93
- }).filter(function (element) {
94
- return !filter || filter(element, container);
95
- });
96
- }
97
-
98
- /**
99
- * Returns the first focusable element within the container.
100
- */
101
- // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
102
- export function getFirstFocusable(_ref4) {
103
- var container = _ref4.container,
104
- filter = _ref4.filter;
105
- var items = getFocusables({
106
- container: container,
107
- filter: filter
108
- });
109
- return items.length > 0 ? items[0] : null;
110
- }
111
-
112
- /**
113
- * Returns the last focusable element within the container.
114
- */
115
- // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
116
- export function getLastFocusable(_ref5) {
117
- var container = _ref5.container,
118
- filter = _ref5.filter;
119
- var items = getFocusables({
120
- container: container,
121
- filter: filter
122
- });
123
- return items.length > 0 ? items[items.length - 1] : null;
124
- }
125
-
126
- /**
127
- * Returns the next focusable element in the given direction relative to the
128
- * currently focused element within the container. Wraps around at both ends.
129
- *
130
- * Returns `null` if there is no focused element within the container or if
131
- * the focused element is not in the list of focusable elements.
132
- */
133
- // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
134
- export function getNextFocusable(_ref6) {
135
- var _all$nextIndex;
136
- var container = _ref6.container,
137
- direction = _ref6.direction,
138
- filter = _ref6.filter;
139
- var all = getFocusables({
140
- container: container,
141
- filter: filter
142
- });
143
- var current = container.querySelector(selectors.focused);
144
- if (!(current instanceof HTMLElement)) {
145
- return null;
146
- }
147
- var index = all.indexOf(current);
148
- if (index === -1) {
149
- return null;
150
- }
151
- var nextIndex = function () {
152
- if (direction === 'forwards') {
153
- return (index + 1) % all.length;
154
- }
155
- var proposed = index - 1;
156
- // if going into negative numbers, loop back to the last item
157
- return proposed < 0 ? all.length - 1 : proposed;
158
- }();
159
- return (_all$nextIndex = all[nextIndex]) !== null && _all$nextIndex !== void 0 ? _all$nextIndex : null;
160
- }
@@ -1 +0,0 @@
1
- export { getFirstFocusable, getLastFocusable, getNextFocusable } from './focus';
@@ -1,50 +0,0 @@
1
- /**
2
- * Focusable element selectors and navigation helpers.
3
- *
4
- * Uses CSS selectors to discover focusable elements within a container,
5
- * avoiding the need for a manual registration system. Disabled elements
6
- * (both HTML `disabled` attribute and `aria-disabled="true"`) and elements
7
- * with `tabindex="-1"` are excluded automatically.
8
- *
9
- * All public functions accept an optional `filter` callback to further
10
- * restrict which focusable elements are included.
11
- */
12
- /**
13
- * Returns `true` when `document.activeElement` is inside a nested top-layer
14
- * descendant of `container` (a `[popover]`, `<dialog>`, `[role="dialog"]` or
15
- * `[role="alertdialog"]` that is itself a descendant of `container`).
16
- */
17
- export declare function isNestedLayerFocused({ container }: {
18
- container: HTMLElement;
19
- }): boolean;
20
- /**
21
- * An optional callback to restrict which focusable elements are included.
22
- * Return `true` to include the element, `false` to skip it.
23
- */
24
- export type TFocusableFilter = (element: HTMLElement, container: HTMLElement) => boolean;
25
- /**
26
- * Returns the first focusable element within the container.
27
- */
28
- export declare function getFirstFocusable({ container, filter, }: {
29
- container: HTMLElement;
30
- filter?: TFocusableFilter;
31
- }): HTMLElement | null;
32
- /**
33
- * Returns the last focusable element within the container.
34
- */
35
- export declare function getLastFocusable({ container, filter, }: {
36
- container: HTMLElement;
37
- filter?: TFocusableFilter;
38
- }): HTMLElement | null;
39
- /**
40
- * Returns the next focusable element in the given direction relative to the
41
- * currently focused element within the container. Wraps around at both ends.
42
- *
43
- * Returns `null` if there is no focused element within the container or if
44
- * the focused element is not in the list of focusable elements.
45
- */
46
- export declare function getNextFocusable({ container, direction, filter, }: {
47
- container: HTMLElement;
48
- direction: 'forwards' | 'backwards';
49
- filter?: TFocusableFilter;
50
- }): HTMLElement | null;
@@ -1,2 +0,0 @@
1
- export { getFirstFocusable, getLastFocusable, getNextFocusable } from './focus';
2
- export type { TFocusableFilter } from './focus';
@@ -1,50 +0,0 @@
1
- /**
2
- * Focusable element selectors and navigation helpers.
3
- *
4
- * Uses CSS selectors to discover focusable elements within a container,
5
- * avoiding the need for a manual registration system. Disabled elements
6
- * (both HTML `disabled` attribute and `aria-disabled="true"`) and elements
7
- * with `tabindex="-1"` are excluded automatically.
8
- *
9
- * All public functions accept an optional `filter` callback to further
10
- * restrict which focusable elements are included.
11
- */
12
- /**
13
- * Returns `true` when `document.activeElement` is inside a nested top-layer
14
- * descendant of `container` (a `[popover]`, `<dialog>`, `[role="dialog"]` or
15
- * `[role="alertdialog"]` that is itself a descendant of `container`).
16
- */
17
- export declare function isNestedLayerFocused({ container }: {
18
- container: HTMLElement;
19
- }): boolean;
20
- /**
21
- * An optional callback to restrict which focusable elements are included.
22
- * Return `true` to include the element, `false` to skip it.
23
- */
24
- export type TFocusableFilter = (element: HTMLElement, container: HTMLElement) => boolean;
25
- /**
26
- * Returns the first focusable element within the container.
27
- */
28
- export declare function getFirstFocusable({ container, filter, }: {
29
- container: HTMLElement;
30
- filter?: TFocusableFilter;
31
- }): HTMLElement | null;
32
- /**
33
- * Returns the last focusable element within the container.
34
- */
35
- export declare function getLastFocusable({ container, filter, }: {
36
- container: HTMLElement;
37
- filter?: TFocusableFilter;
38
- }): HTMLElement | null;
39
- /**
40
- * Returns the next focusable element in the given direction relative to the
41
- * currently focused element within the container. Wraps around at both ends.
42
- *
43
- * Returns `null` if there is no focused element within the container or if
44
- * the focused element is not in the list of focusable elements.
45
- */
46
- export declare function getNextFocusable({ container, direction, filter, }: {
47
- container: HTMLElement;
48
- direction: 'forwards' | 'backwards';
49
- filter?: TFocusableFilter;
50
- }): HTMLElement | null;
@@ -1,2 +0,0 @@
1
- export { getFirstFocusable, getLastFocusable, getNextFocusable } from './focus';
2
- export type { TFocusableFilter } from './focus';