@fluentui/react-tabster 0.0.0-nightlycbf184efa720211222.1 → 0.0.0-nightlyecca467a8920220110.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +24 -12
- package/CHANGELOG.md +11 -9
- package/dist/react-tabster.d.ts +6 -8
- package/lib/hooks/useFocusFinders.d.ts +3 -2
- package/lib/hooks/useFocusFinders.js +6 -4
- package/lib/hooks/useFocusFinders.js.map +1 -1
- package/lib/hooks/useFocusIndicatorStyle.d.ts +5 -6
- package/lib/hooks/useFocusIndicatorStyle.js +9 -8
- package/lib/hooks/useFocusIndicatorStyle.js.map +1 -1
- package/lib-commonjs/hooks/useFocusFinders.d.ts +3 -2
- package/lib-commonjs/hooks/useFocusFinders.js +6 -4
- package/lib-commonjs/hooks/useFocusFinders.js.map +1 -1
- package/lib-commonjs/hooks/useFocusIndicatorStyle.d.ts +5 -6
- package/lib-commonjs/hooks/useFocusIndicatorStyle.js +10 -8
- package/lib-commonjs/hooks/useFocusIndicatorStyle.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.json
CHANGED
@@ -2,17 +2,23 @@
|
|
2
2
|
"name": "@fluentui/react-tabster",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
6
|
-
"tag": "@fluentui/react-tabster_v0.0.0-
|
7
|
-
"version": "0.0.0-
|
5
|
+
"date": "Mon, 10 Jan 2022 04:15:29 GMT",
|
6
|
+
"tag": "@fluentui/react-tabster_v0.0.0-nightlyecca467a8920220110.1",
|
7
|
+
"version": "0.0.0-nightlyecca467a8920220110.1",
|
8
8
|
"comments": {
|
9
9
|
"prerelease": [
|
10
10
|
{
|
11
11
|
"author": "email not defined",
|
12
12
|
"package": "@fluentui/react-tabster",
|
13
|
-
"commit": "
|
13
|
+
"commit": "0e3456c586480a46e3664c6acc9d28cbef8bd814",
|
14
14
|
"comment": "Release nightly v9"
|
15
15
|
},
|
16
|
+
{
|
17
|
+
"author": "lingfangao@hotmail.com",
|
18
|
+
"package": "@fluentui/react-tabster",
|
19
|
+
"commit": "95a6a32cbffa9d86d6017cf8e0204d4b459ef370",
|
20
|
+
"comment": "feat: Support `options` for `findNextFocusable` and `findPrevFocusable` focus finders"
|
21
|
+
},
|
16
22
|
{
|
17
23
|
"author": "lingfangao@hotmail.com",
|
18
24
|
"package": "@fluentui/react-tabster",
|
@@ -25,6 +31,12 @@
|
|
25
31
|
"commit": "a76afe26daad901ff5458ffdda7e66e600d5bcac",
|
26
32
|
"comment": "use new types from makeStyles core"
|
27
33
|
},
|
34
|
+
{
|
35
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
36
|
+
"package": "@fluentui/react-tabster",
|
37
|
+
"commit": "38c8bed2c707014688ae2ae689033fa36ef23075",
|
38
|
+
"comment": "react-tabster: Replacing use of functions in makeStyles with direct use of tokens."
|
39
|
+
},
|
28
40
|
{
|
29
41
|
"author": "olfedias@microsoft.com",
|
30
42
|
"package": "@fluentui/react-tabster",
|
@@ -34,26 +46,26 @@
|
|
34
46
|
{
|
35
47
|
"author": "beachball",
|
36
48
|
"package": "@fluentui/react-tabster",
|
37
|
-
"comment": "Bump @fluentui/react-make-styles to v0.0.0-
|
38
|
-
"commit": "
|
49
|
+
"comment": "Bump @fluentui/react-make-styles to v0.0.0-nightlyecca467a8920220110.1",
|
50
|
+
"commit": "0e3456c586480a46e3664c6acc9d28cbef8bd814"
|
39
51
|
},
|
40
52
|
{
|
41
53
|
"author": "beachball",
|
42
54
|
"package": "@fluentui/react-tabster",
|
43
|
-
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-
|
44
|
-
"commit": "
|
55
|
+
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightlyecca467a8920220110.1",
|
56
|
+
"commit": "0e3456c586480a46e3664c6acc9d28cbef8bd814"
|
45
57
|
},
|
46
58
|
{
|
47
59
|
"author": "beachball",
|
48
60
|
"package": "@fluentui/react-tabster",
|
49
|
-
"comment": "Bump @fluentui/react-utilities to v0.0.0-
|
50
|
-
"commit": "
|
61
|
+
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightlyecca467a8920220110.1",
|
62
|
+
"commit": "0e3456c586480a46e3664c6acc9d28cbef8bd814"
|
51
63
|
},
|
52
64
|
{
|
53
65
|
"author": "beachball",
|
54
66
|
"package": "@fluentui/react-tabster",
|
55
|
-
"comment": "Bump @fluentui/babel-make-styles to v0.0.0-
|
56
|
-
"commit": "
|
67
|
+
"comment": "Bump @fluentui/babel-make-styles to v0.0.0-nightlyecca467a8920220110.1",
|
68
|
+
"commit": "0e3456c586480a46e3664c6acc9d28cbef8bd814"
|
57
69
|
}
|
58
70
|
],
|
59
71
|
"none": [
|
package/CHANGELOG.md
CHANGED
@@ -1,24 +1,26 @@
|
|
1
1
|
# Change Log - @fluentui/react-tabster
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Mon, 10 Jan 2022 04:15:29 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
-
## [0.0.0-
|
7
|
+
## [0.0.0-nightlyecca467a8920220110.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v0.0.0-nightlyecca467a8920220110.1)
|
8
8
|
|
9
|
-
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.0.0-beta.5..@fluentui/react-tabster_v0.0.0-
|
9
|
+
Mon, 10 Jan 2022 04:15:29 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.0.0-beta.5..@fluentui/react-tabster_v0.0.0-nightlyecca467a8920220110.1)
|
11
11
|
|
12
12
|
### Changes
|
13
13
|
|
14
|
-
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/
|
14
|
+
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/0e3456c586480a46e3664c6acc9d28cbef8bd814) by email not defined)
|
15
|
+
- feat: Support `options` for `findNextFocusable` and `findPrevFocusable` focus finders ([PR #21095](https://github.com/microsoft/fluentui/pull/21095) by lingfangao@hotmail.com)
|
15
16
|
- chore: Bump tabster and keyborg versions ([PR #20889](https://github.com/microsoft/fluentui/pull/20889) by lingfangao@hotmail.com)
|
16
17
|
- use new types from makeStyles core ([PR #20786](https://github.com/microsoft/fluentui/pull/20786) by olfedias@microsoft.com)
|
18
|
+
- react-tabster: Replacing use of functions in makeStyles with direct use of tokens. ([PR #21035](https://github.com/microsoft/fluentui/pull/21035) by Humberto.Morimoto@microsoft.com)
|
17
19
|
- update styles to not use CSS shorthands ([PR #20842](https://github.com/microsoft/fluentui/pull/20842) by olfedias@microsoft.com)
|
18
|
-
- Bump @fluentui/react-make-styles to v0.0.0-
|
19
|
-
- Bump @fluentui/react-shared-contexts to v0.0.0-
|
20
|
-
- Bump @fluentui/react-utilities to v0.0.0-
|
21
|
-
- Bump @fluentui/babel-make-styles to v0.0.0-
|
20
|
+
- Bump @fluentui/react-make-styles to v0.0.0-nightlyecca467a8920220110.1 ([commit](https://github.com/microsoft/fluentui/commit/0e3456c586480a46e3664c6acc9d28cbef8bd814) by beachball)
|
21
|
+
- Bump @fluentui/react-shared-contexts to v0.0.0-nightlyecca467a8920220110.1 ([commit](https://github.com/microsoft/fluentui/commit/0e3456c586480a46e3664c6acc9d28cbef8bd814) by beachball)
|
22
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightlyecca467a8920220110.1 ([commit](https://github.com/microsoft/fluentui/commit/0e3456c586480a46e3664c6acc9d28cbef8bd814) by beachball)
|
23
|
+
- Bump @fluentui/babel-make-styles to v0.0.0-nightlyecca467a8920220110.1 ([commit](https://github.com/microsoft/fluentui/commit/0e3456c586480a46e3664c6acc9d28cbef8bd814) by beachball)
|
22
24
|
|
23
25
|
## [9.0.0-beta.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.0.0-beta.5)
|
24
26
|
|
package/dist/react-tabster.d.ts
CHANGED
@@ -1,16 +1,14 @@
|
|
1
1
|
import type { MakeStylesStyle } from '@fluentui/react-make-styles';
|
2
|
-
import type { MakeStylesStyleRule } from '@fluentui/react-make-styles';
|
3
2
|
import type { RefObject } from 'react';
|
4
|
-
import type { Theme } from '@fluentui/react-theme';
|
5
3
|
import { Types } from 'tabster';
|
6
4
|
|
7
5
|
/**
|
8
|
-
* Creates a style
|
6
|
+
* Creates a style for @see makeStyles that includes the necessary selectors for focus.
|
9
7
|
* Should be used only when @see createFocusOutlineStyle does not fit requirements
|
10
8
|
*
|
11
|
-
* @param
|
9
|
+
* @param style - styling applied on focus, defaults to @see getDefaultFocusOutlineStyes
|
12
10
|
*/
|
13
|
-
export declare const createCustomFocusIndicatorStyle: (
|
11
|
+
export declare const createCustomFocusIndicatorStyle: (style: MakeStylesStyle, options?: CreateFocusIndicatorStyleRuleOptions) => MakeStylesStyle;
|
14
12
|
|
15
13
|
export declare interface CreateFocusIndicatorStyleRuleOptions {
|
16
14
|
selector?: 'focus' | 'focus-within';
|
@@ -24,7 +22,7 @@ export declare interface CreateFocusIndicatorStyleRuleOptions {
|
|
24
22
|
* @param options - Configure the style of the focus outline
|
25
23
|
* @returns focus outline styles object for @see makeStyles
|
26
24
|
*/
|
27
|
-
export declare const createFocusOutlineStyle: (
|
25
|
+
export declare const createFocusOutlineStyle: (options?: {
|
28
26
|
style: Partial<FocusOutlineStyleOptions>;
|
29
27
|
} & CreateFocusIndicatorStyleRuleOptions) => MakeStylesStyle;
|
30
28
|
|
@@ -84,8 +82,8 @@ export declare const useFocusFinders: () => {
|
|
84
82
|
findAllFocusable: (container: HTMLElement, acceptCondition: (el: HTMLElement) => boolean) => HTMLElement[];
|
85
83
|
findFirstFocusable: (container: HTMLElement) => HTMLElement | null | undefined;
|
86
84
|
findLastFocusable: (container: HTMLElement) => HTMLElement | null | undefined;
|
87
|
-
findNextFocusable: (currentElement: HTMLElement) => HTMLElement | null | undefined;
|
88
|
-
findPrevFocusable: (currentElement: HTMLElement) => HTMLElement | null | undefined;
|
85
|
+
findNextFocusable: (currentElement: HTMLElement, options?: Pick<Types.FindNextProps, 'container'>) => HTMLElement | null | undefined;
|
86
|
+
findPrevFocusable: (currentElement: HTMLElement, options?: Pick<Types.FindNextProps, 'container'>) => HTMLElement | null | undefined;
|
89
87
|
};
|
90
88
|
|
91
89
|
/**
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { Types as TabsterTypes } from 'tabster';
|
1
2
|
/**
|
2
3
|
* Returns a set of helper functions that will traverse focusable elements in the context of a root DOM element
|
3
4
|
*/
|
@@ -5,6 +6,6 @@ export declare const useFocusFinders: () => {
|
|
5
6
|
findAllFocusable: (container: HTMLElement, acceptCondition: (el: HTMLElement) => boolean) => HTMLElement[];
|
6
7
|
findFirstFocusable: (container: HTMLElement) => HTMLElement | null | undefined;
|
7
8
|
findLastFocusable: (container: HTMLElement) => HTMLElement | null | undefined;
|
8
|
-
findNextFocusable: (currentElement: HTMLElement) => HTMLElement | null | undefined;
|
9
|
-
findPrevFocusable: (currentElement: HTMLElement) => HTMLElement | null | undefined;
|
9
|
+
findNextFocusable: (currentElement: HTMLElement, options?: Pick<TabsterTypes.FindNextProps, 'container'>) => HTMLElement | null | undefined;
|
10
|
+
findPrevFocusable: (currentElement: HTMLElement, options?: Pick<TabsterTypes.FindNextProps, 'container'>) => HTMLElement | null | undefined;
|
10
11
|
};
|
@@ -17,11 +17,13 @@ export const useFocusFinders = () => {
|
|
17
17
|
const findLastFocusable = React.useCallback(container => tabster === null || tabster === void 0 ? void 0 : tabster.focusable.findLast({
|
18
18
|
container
|
19
19
|
}), [tabster]);
|
20
|
-
const findNextFocusable = React.useCallback(currentElement => tabster === null || tabster === void 0 ? void 0 : tabster.focusable.findNext({
|
21
|
-
currentElement
|
20
|
+
const findNextFocusable = React.useCallback((currentElement, options = {}) => tabster === null || tabster === void 0 ? void 0 : tabster.focusable.findNext({
|
21
|
+
currentElement,
|
22
|
+
...options
|
22
23
|
}), [tabster]);
|
23
|
-
const findPrevFocusable = React.useCallback(currentElement => tabster === null || tabster === void 0 ? void 0 : tabster.focusable.findPrev({
|
24
|
-
currentElement
|
24
|
+
const findPrevFocusable = React.useCallback((currentElement, options = {}) => tabster === null || tabster === void 0 ? void 0 : tabster.focusable.findPrev({
|
25
|
+
currentElement,
|
26
|
+
...options
|
25
27
|
}), [tabster]);
|
26
28
|
return {
|
27
29
|
findAllFocusable,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/useFocusFinders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;
|
1
|
+
{"version":3,"sources":["../../src/hooks/useFocusFinders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,SAAS,UAAT,QAA2B,cAA3B;AAEA;;AAEG;;AACH,OAAO,MAAM,eAAe,GAAG,MAAK;AAClC,QAAM,OAAO,GAAG,UAAU,EAA1B,CADkC,CAGlC;;AACA,QAAM,gBAAgB,GAAG,KAAK,CAAC,WAAN,CACvB,CAAC,SAAD,EAAyB,eAAzB,KACE,CAAA,OAAO,KAAA,IAAP,IAAA,OAAO,KAAA,KAAA,CAAP,GAAO,KAAA,CAAP,GAAA,OAAO,CAAE,SAAT,CAAmB,OAAnB,CAA2B;AAAE,IAAA,SAAF;AAAa,IAAA;AAAb,GAA3B,CAAA,KAA8D,EAFzC,EAGvB,CAAC,OAAD,CAHuB,CAAzB;AAMA,QAAM,kBAAkB,GAAG,KAAK,CAAC,WAAN,CACxB,SAAD,IAA4B,OAAO,KAAA,IAAP,IAAA,OAAO,KAAA,KAAA,CAAP,GAAO,KAAA,CAAP,GAAA,OAAO,CAAE,SAAT,CAAmB,SAAnB,CAA6B;AAAE,IAAA;AAAF,GAA7B,CADH,EAEzB,CAAC,OAAD,CAFyB,CAA3B;AAKA,QAAM,iBAAiB,GAAG,KAAK,CAAC,WAAN,CAAmB,SAAD,IAA4B,OAAO,KAAA,IAAP,IAAA,OAAO,KAAA,KAAA,CAAP,GAAO,KAAA,CAAP,GAAA,OAAO,CAAE,SAAT,CAAmB,QAAnB,CAA4B;AAAE,IAAA;AAAF,GAA5B,CAA9C,EAA0F,CAClH,OADkH,CAA1F,CAA1B;AAIA,QAAM,iBAAiB,GAAG,KAAK,CAAC,WAAN,CACxB,CAAC,cAAD,EAA8B,OAAA,GAAyD,EAAvF,KACE,OAAO,KAAA,IAAP,IAAA,OAAO,KAAA,KAAA,CAAP,GAAO,KAAA,CAAP,GAAA,OAAO,CAAE,SAAT,CAAmB,QAAnB,CAA4B;AAAE,IAAA,cAAF;AAAkB,OAAG;AAArB,GAA5B,CAFsB,EAGxB,CAAC,OAAD,CAHwB,CAA1B;AAMA,QAAM,iBAAiB,GAAG,KAAK,CAAC,WAAN,CACxB,CAAC,cAAD,EAA8B,OAAA,GAAyD,EAAvF,KACE,OAAO,KAAA,IAAP,IAAA,OAAO,KAAA,KAAA,CAAP,GAAO,KAAA,CAAP,GAAA,OAAO,CAAE,SAAT,CAAmB,QAAnB,CAA4B;AAAE,IAAA,cAAF;AAAkB,OAAG;AAArB,GAA5B,CAFsB,EAGxB,CAAC,OAAD,CAHwB,CAA1B;AAMA,SAAO;AACL,IAAA,gBADK;AAEL,IAAA,kBAFK;AAGL,IAAA,iBAHK;AAIL,IAAA,iBAJK;AAKL,IAAA;AALK,GAAP;AAOD,CAtCM","sourceRoot":""}
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import type {
|
2
|
-
import type { MakeStylesStyle, MakeStylesStyleRule } from '@fluentui/react-make-styles';
|
1
|
+
import type { MakeStylesStyle } from '@fluentui/react-make-styles';
|
3
2
|
export declare type FocusOutlineOffset = Record<'top' | 'bottom' | 'left' | 'right', string>;
|
4
3
|
export declare type FocusOutlineStyleOptions = {
|
5
4
|
/**
|
@@ -22,13 +21,13 @@ export interface CreateFocusIndicatorStyleRuleOptions {
|
|
22
21
|
* @param options - Configure the style of the focus outline
|
23
22
|
* @returns focus outline styles object for @see makeStyles
|
24
23
|
*/
|
25
|
-
export declare const createFocusOutlineStyle: (
|
24
|
+
export declare const createFocusOutlineStyle: (options?: {
|
26
25
|
style: Partial<FocusOutlineStyleOptions>;
|
27
26
|
} & CreateFocusIndicatorStyleRuleOptions) => MakeStylesStyle;
|
28
27
|
/**
|
29
|
-
* Creates a style
|
28
|
+
* Creates a style for @see makeStyles that includes the necessary selectors for focus.
|
30
29
|
* Should be used only when @see createFocusOutlineStyle does not fit requirements
|
31
30
|
*
|
32
|
-
* @param
|
31
|
+
* @param style - styling applied on focus, defaults to @see getDefaultFocusOutlineStyes
|
33
32
|
*/
|
34
|
-
export declare const createCustomFocusIndicatorStyle: (
|
33
|
+
export declare const createCustomFocusIndicatorStyle: (style: MakeStylesStyle, options?: CreateFocusIndicatorStyleRuleOptions) => MakeStylesStyle;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { tokens } from '@fluentui/react-theme';
|
1
2
|
import { KEYBOARD_NAV_SELECTOR } from '../symbols';
|
2
3
|
/**
|
3
4
|
* NOTE: the element with the focus outline needs to have `position: relative` so that the
|
@@ -52,7 +53,7 @@ const defaultOptions = {
|
|
52
53
|
* @returns focus outline styles object for @see makeStyles
|
53
54
|
*/
|
54
55
|
|
55
|
-
export const createFocusOutlineStyle = (
|
56
|
+
export const createFocusOutlineStyle = (options = {
|
56
57
|
style: {},
|
57
58
|
...defaultOptions
|
58
59
|
}) => ({
|
@@ -60,24 +61,24 @@ export const createFocusOutlineStyle = (theme, options = {
|
|
60
61
|
outlineStyle: 'none'
|
61
62
|
},
|
62
63
|
[`${KEYBOARD_NAV_SELECTOR} :${options.selector || defaultOptions.selector}`]: getFocusOutlineStyles({
|
63
|
-
outlineColor:
|
64
|
-
outlineRadius:
|
65
|
-
// FIXME:
|
64
|
+
outlineColor: tokens.colorStrokeFocus2,
|
65
|
+
outlineRadius: tokens.borderRadiusMedium,
|
66
|
+
// FIXME: tokens.strokeWidthThick causes some weird bugs
|
66
67
|
outlineWidth: '2px',
|
67
68
|
...options.style
|
68
69
|
})
|
69
70
|
});
|
70
71
|
/**
|
71
|
-
* Creates a style
|
72
|
+
* Creates a style for @see makeStyles that includes the necessary selectors for focus.
|
72
73
|
* Should be used only when @see createFocusOutlineStyle does not fit requirements
|
73
74
|
*
|
74
|
-
* @param
|
75
|
+
* @param style - styling applied on focus, defaults to @see getDefaultFocusOutlineStyes
|
75
76
|
*/
|
76
77
|
|
77
|
-
export const createCustomFocusIndicatorStyle = (
|
78
|
+
export const createCustomFocusIndicatorStyle = (style, options = defaultOptions) => ({
|
78
79
|
':focus-visible': {
|
79
80
|
outlineStyle: 'none'
|
80
81
|
},
|
81
|
-
[`${KEYBOARD_NAV_SELECTOR} :${options.selector || defaultOptions.selector}`]:
|
82
|
+
[`${KEYBOARD_NAV_SELECTOR} :${options.selector || defaultOptions.selector}`]: style
|
82
83
|
});
|
83
84
|
//# sourceMappingURL=useFocusIndicatorStyle.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/useFocusIndicatorStyle.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../src/hooks/useFocusIndicatorStyle.ts"],"names":[],"mappings":"AAAA,SAAS,MAAT,QAAuB,uBAAvB;AACA,SAAS,qBAAT,QAAsC,YAAtC;AAeA;;;;;;AAMG;;AACH,MAAM,qBAAqB,GAAI,OAAD,IAAsC;;;AAClE,QAAM;AAAE,IAAA,aAAF;AAAiB,IAAA,YAAjB;AAA+B,IAAA,aAA/B;AAA8C,IAAA;AAA9C,MAA+D,OAArE;AAEA,QAAM,gBAAgB,GAAG,CAAA,CAAA,EAAA,GAAC,aAAD,MAAqC,IAArC,IAAqC,EAAA,KAAA,KAAA,CAArC,GAAqC,KAAA,CAArC,GAAqC,EAAA,CAAE,GAAvC,KAA8C,aAAvE;AACA,QAAM,mBAAmB,GAAG,CAAA,CAAA,EAAA,GAAC,aAAD,MAAqC,IAArC,IAAqC,EAAA,KAAA,KAAA,CAArC,GAAqC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M,uBAAuB,GAAG,CACrC,OAAA,GAE2C;AAAE,EAAA,KAAK,EAAE,EAAT;AAAa,KAAG;AAAhB,CAHN,MAIhB;AACrB,oBAAkB;AAChB,IAAA,YAAY,EAAE;AADE,GADG;AAIrB,GAAC,GAAG,qBAAqB,KAAK,OAAO,CAAC,QAAR,IAAoB,cAAc,CAAC,QAAQ,EAAzE,GAA8E,qBAAqB,CAAC;AAClG,IAAA,YAAY,EAAE,MAAM,CAAC,iBAD6E;AAElG,IAAA,aAAa,EAAE,MAAM,CAAC,kBAF4E;AAGlG;AACA,IAAA,YAAY,EAAE,KAJoF;AAKlG,OAAG,OAAO,CAAC;AALuF,GAAD;AAJ9E,CAJgB,CAAhC;AAiBP;;;;;AAKG;;AACH,OAAO,MAAM,+BAA+B,GAAG,CAC7C,KAD6C,EAE7C,OAAA,GAAgD,cAFH,MAGxB;AACrB,oBAAkB;AAChB,IAAA,YAAY,EAAE;AADE,GADG;AAIrB,GAAC,GAAG,qBAAqB,KAAK,OAAO,CAAC,QAAR,IAAoB,cAAc,CAAC,QAAQ,EAAzE,GAA8E;AAJzD,CAHwB,CAAxC","sourceRoot":""}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { Types as TabsterTypes } from 'tabster';
|
1
2
|
/**
|
2
3
|
* Returns a set of helper functions that will traverse focusable elements in the context of a root DOM element
|
3
4
|
*/
|
@@ -5,6 +6,6 @@ export declare const useFocusFinders: () => {
|
|
5
6
|
findAllFocusable: (container: HTMLElement, acceptCondition: (el: HTMLElement) => boolean) => HTMLElement[];
|
6
7
|
findFirstFocusable: (container: HTMLElement) => HTMLElement | null | undefined;
|
7
8
|
findLastFocusable: (container: HTMLElement) => HTMLElement | null | undefined;
|
8
|
-
findNextFocusable: (currentElement: HTMLElement) => HTMLElement | null | undefined;
|
9
|
-
findPrevFocusable: (currentElement: HTMLElement) => HTMLElement | null | undefined;
|
9
|
+
findNextFocusable: (currentElement: HTMLElement, options?: Pick<TabsterTypes.FindNextProps, 'container'>) => HTMLElement | null | undefined;
|
10
|
+
findPrevFocusable: (currentElement: HTMLElement, options?: Pick<TabsterTypes.FindNextProps, 'container'>) => HTMLElement | null | undefined;
|
10
11
|
};
|
@@ -26,11 +26,13 @@ const useFocusFinders = () => {
|
|
26
26
|
const findLastFocusable = React.useCallback(container => tabster === null || tabster === void 0 ? void 0 : tabster.focusable.findLast({
|
27
27
|
container
|
28
28
|
}), [tabster]);
|
29
|
-
const findNextFocusable = React.useCallback(currentElement => tabster === null || tabster === void 0 ? void 0 : tabster.focusable.findNext({
|
30
|
-
currentElement
|
29
|
+
const findNextFocusable = React.useCallback((currentElement, options = {}) => tabster === null || tabster === void 0 ? void 0 : tabster.focusable.findNext({
|
30
|
+
currentElement,
|
31
|
+
...options
|
31
32
|
}), [tabster]);
|
32
|
-
const findPrevFocusable = React.useCallback(currentElement => tabster === null || tabster === void 0 ? void 0 : tabster.focusable.findPrev({
|
33
|
-
currentElement
|
33
|
+
const findPrevFocusable = React.useCallback((currentElement, options = {}) => tabster === null || tabster === void 0 ? void 0 : tabster.focusable.findPrev({
|
34
|
+
currentElement,
|
35
|
+
...options
|
34
36
|
}), [tabster]);
|
35
37
|
return {
|
36
38
|
findAllFocusable,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/useFocusFinders.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;
|
1
|
+
{"version":3,"sources":["../../src/hooks/useFocusFinders.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAEA,MAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;AAEA;;AAEG;;;AACI,MAAM,eAAe,GAAG,MAAK;AAClC,QAAM,OAAO,GAAG,YAAA,CAAA,UAAA,EAAhB,CADkC,CAGlC;;AACA,QAAM,gBAAgB,GAAG,KAAK,CAAC,WAAN,CACvB,CAAC,SAAD,EA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AAAkB,OAAG;AAArB,GAA5B,CAFsB,EAGxB,CAAC,OAAD,CAHwB,CAA1B;AAMA,SAAO;AACL,IAAA,gBADK;AAEL,IAAA,kBAFK;AAGL,IAAA,iBAHK;AAIL,IAAA,iBAJK;AAKL,IAAA;AALK,GAAP;AAOD,CAtCM;;AAAM,OAAA,CAAA,eAAA,GAAe,eAAf","sourceRoot":""}
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import type {
|
2
|
-
import type { MakeStylesStyle, MakeStylesStyleRule } from '@fluentui/react-make-styles';
|
1
|
+
import type { MakeStylesStyle } from '@fluentui/react-make-styles';
|
3
2
|
export declare type FocusOutlineOffset = Record<'top' | 'bottom' | 'left' | 'right', string>;
|
4
3
|
export declare type FocusOutlineStyleOptions = {
|
5
4
|
/**
|
@@ -22,13 +21,13 @@ export interface CreateFocusIndicatorStyleRuleOptions {
|
|
22
21
|
* @param options - Configure the style of the focus outline
|
23
22
|
* @returns focus outline styles object for @see makeStyles
|
24
23
|
*/
|
25
|
-
export declare const createFocusOutlineStyle: (
|
24
|
+
export declare const createFocusOutlineStyle: (options?: {
|
26
25
|
style: Partial<FocusOutlineStyleOptions>;
|
27
26
|
} & CreateFocusIndicatorStyleRuleOptions) => MakeStylesStyle;
|
28
27
|
/**
|
29
|
-
* Creates a style
|
28
|
+
* Creates a style for @see makeStyles that includes the necessary selectors for focus.
|
30
29
|
* Should be used only when @see createFocusOutlineStyle does not fit requirements
|
31
30
|
*
|
32
|
-
* @param
|
31
|
+
* @param style - styling applied on focus, defaults to @see getDefaultFocusOutlineStyes
|
33
32
|
*/
|
34
|
-
export declare const createCustomFocusIndicatorStyle: (
|
33
|
+
export declare const createCustomFocusIndicatorStyle: (style: MakeStylesStyle, options?: CreateFocusIndicatorStyleRuleOptions) => MakeStylesStyle;
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.createCustomFocusIndicatorStyle = exports.createFocusOutlineStyle = void 0;
|
7
7
|
|
8
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
9
|
+
|
8
10
|
const symbols_1 = /*#__PURE__*/require("../symbols");
|
9
11
|
/**
|
10
12
|
* NOTE: the element with the focus outline needs to have `position: relative` so that the
|
@@ -60,7 +62,7 @@ const defaultOptions = {
|
|
60
62
|
* @returns focus outline styles object for @see makeStyles
|
61
63
|
*/
|
62
64
|
|
63
|
-
const createFocusOutlineStyle = (
|
65
|
+
const createFocusOutlineStyle = (options = {
|
64
66
|
style: {},
|
65
67
|
...defaultOptions
|
66
68
|
}) => ({
|
@@ -68,9 +70,9 @@ const createFocusOutlineStyle = (theme, options = {
|
|
68
70
|
outlineStyle: 'none'
|
69
71
|
},
|
70
72
|
[`${symbols_1.KEYBOARD_NAV_SELECTOR} :${options.selector || defaultOptions.selector}`]: getFocusOutlineStyles({
|
71
|
-
outlineColor:
|
72
|
-
outlineRadius:
|
73
|
-
// FIXME:
|
73
|
+
outlineColor: react_theme_1.tokens.colorStrokeFocus2,
|
74
|
+
outlineRadius: react_theme_1.tokens.borderRadiusMedium,
|
75
|
+
// FIXME: tokens.strokeWidthThick causes some weird bugs
|
74
76
|
outlineWidth: '2px',
|
75
77
|
...options.style
|
76
78
|
})
|
@@ -78,17 +80,17 @@ const createFocusOutlineStyle = (theme, options = {
|
|
78
80
|
|
79
81
|
exports.createFocusOutlineStyle = createFocusOutlineStyle;
|
80
82
|
/**
|
81
|
-
* Creates a style
|
83
|
+
* Creates a style for @see makeStyles that includes the necessary selectors for focus.
|
82
84
|
* Should be used only when @see createFocusOutlineStyle does not fit requirements
|
83
85
|
*
|
84
|
-
* @param
|
86
|
+
* @param style - styling applied on focus, defaults to @see getDefaultFocusOutlineStyes
|
85
87
|
*/
|
86
88
|
|
87
|
-
const createCustomFocusIndicatorStyle = (
|
89
|
+
const createCustomFocusIndicatorStyle = (style, options = defaultOptions) => ({
|
88
90
|
':focus-visible': {
|
89
91
|
outlineStyle: 'none'
|
90
92
|
},
|
91
|
-
[`${symbols_1.KEYBOARD_NAV_SELECTOR} :${options.selector || defaultOptions.selector}`]:
|
93
|
+
[`${symbols_1.KEYBOARD_NAV_SELECTOR} :${options.selector || defaultOptions.selector}`]: style
|
92
94
|
});
|
93
95
|
|
94
96
|
exports.createCustomFocusIndicatorStyle = createCustomFocusIndicatorStyle;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/useFocusIndicatorStyle.ts"],"names":[],"mappings":";;;;;;;
|
1
|
+
{"version":3,"sources":["../../src/hooks/useFocusIndicatorStyle.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,SAAA,gBAAA,OAAA,CAAA,YAAA,CAAA;AAeA;;;;;;AAMG;;;AACH,MAAM,qBAAqB,GAAI,OAAD,IAAsC;;;AAClE,QAAM;AAAE,IAAA,aAAF;AAAiB,IAAA,YAAjB;AAA+B,IAAA,aAA/B;AAA8C,IAAA;AAA9C,MAA+D,OAArE;AAEA,QAAM,gBAAgB,GAAG,CAAA,CAAA,EAAA,GAAC,aAAD,MAAqC,IAArC,IAAqC,EAAA,KAAA,KAAA,CAArC,GAAqC,KAAA,CAArC,GAAqC,EAAA,CAAE,GAAvC,KAA8C,aAAvE;AACA,QAAM,mBAAmB,GAAG,CAAA,CAAA,EAAA,GAAC,aAAD,MAAqC,IAArC,IAAqC,EAAA,KAAA,KAAA,CAArC,GAAqC,KAAA,CAArC,GAAqC,EAAA,CAAE,MAAvC,KAAiD,aAA7E;AACA,QAAM,iBAAiB,GAAG,CAAA,CAAA,EAAA,GAAC,aAAD,MAAqC,IAArC,IAAqC,EAAA,KAAA,KAAA,CAArC,GAAqC,KAAA,CAArC,GAAqC,EAAA,CAAE,IAAvC,KAA+C,aAAzE;AACA,QAAM,kBAAkB,GAAG,CAAA,CAAA,EAAA,GAAC,aAAD,MAAqC,IAArC,IAAqC,EAAA,KAAA,KAAA,CAArC,G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;AAElG,IAAA,aAAa,EAAE,aAAA,CAAA,MAAA,CAAO,kBAF4E;AAGlG;AACA,IAAA,YAAY,EAAE,KAJoF;AAKlG,OAAG,OAAO,CAAC;AALuF,GAAD;AAJ9E,CAJgB,CAAhC;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB;AAiBb;;;;;AAKG;;AACI,MAAM,+BAA+B,GAAG,CAC7C,KAD6C,EAE7C,OAAA,GAAgD,cAFH,MAGxB;AACrB,oBAAkB;AAChB,IAAA,YAAY,EAAE;AADE,GADG;AAIrB,GAAC,GAAG,SAAA,CAAA,qBAAqB,KAAK,OAAO,CAAC,QAAR,IAAoB,cAAc,CAAC,QAAQ,EAAzE,GAA8E;AAJzD,CAHwB,CAAxC;;AAAM,OAAA,CAAA,+BAAA,GAA+B,+BAA/B","sourceRoot":""}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-tabster",
|
3
|
-
"version": "0.0.0-
|
3
|
+
"version": "0.0.0-nightlyecca467a8920220110.1",
|
4
4
|
"description": "Utilities for focus management and facade for tabster",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -33,12 +33,12 @@
|
|
33
33
|
"react": "16.8.6",
|
34
34
|
"react-dom": "16.8.6",
|
35
35
|
"react-test-renderer": "^16.3.0",
|
36
|
-
"@fluentui/babel-make-styles": "0.0.0-
|
36
|
+
"@fluentui/babel-make-styles": "0.0.0-nightlyecca467a8920220110.1"
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
|
-
"@fluentui/react-make-styles": "0.0.0-
|
40
|
-
"@fluentui/react-shared-contexts": "0.0.0-
|
41
|
-
"@fluentui/react-utilities": "0.0.0-
|
39
|
+
"@fluentui/react-make-styles": "0.0.0-nightlyecca467a8920220110.1",
|
40
|
+
"@fluentui/react-shared-contexts": "0.0.0-nightlyecca467a8920220110.1",
|
41
|
+
"@fluentui/react-utilities": "0.0.0-nightlyecca467a8920220110.1",
|
42
42
|
"keyborg": "^1.1.0-alpha.4",
|
43
43
|
"tabster": "^1.1.0-alpha.4",
|
44
44
|
"tslib": "^2.1.0"
|