@fluentui/react-tabster 9.3.1 → 9.3.3
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 +67 -1
- package/CHANGELOG.md +26 -2
- package/dist/index.d.ts +5 -2
- package/lib/focus/constants.js +1 -1
- package/lib/focus/constants.js.map +1 -1
- package/lib/focus/createCustomFocusIndicatorStyle.js +18 -16
- package/lib/focus/createCustomFocusIndicatorStyle.js.map +1 -1
- package/lib-amd/focus/constants.js +1 -1
- package/lib-amd/focus/constants.js.map +1 -1
- package/lib-amd/focus/createCustomFocusIndicatorStyle.js +5 -5
- package/lib-amd/focus/createCustomFocusIndicatorStyle.js.map +1 -1
- package/lib-commonjs/focus/constants.js +1 -1
- package/lib-commonjs/focus/constants.js.map +1 -1
- package/lib-commonjs/focus/createCustomFocusIndicatorStyle.js +18 -16
- package/lib-commonjs/focus/createCustomFocusIndicatorStyle.js.map +1 -1
- package/package.json +4 -6
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,73 @@
|
|
2
2
|
"name": "@fluentui/react-tabster",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Tue, 20 Dec 2022 14:55:56 GMT",
|
6
|
+
"tag": "@fluentui/react-tabster_v9.3.3",
|
7
|
+
"version": "9.3.3",
|
8
|
+
"comments": {
|
9
|
+
"patch": [
|
10
|
+
{
|
11
|
+
"author": "tristan.watanabe@gmail.com",
|
12
|
+
"package": "@fluentui/react-tabster",
|
13
|
+
"commit": "49c1f3477d8f69760616b9d1fa7e32b81b6ca18e",
|
14
|
+
"comment": "chore: Migrate to new package structure."
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "beachball",
|
18
|
+
"package": "@fluentui/react-tabster",
|
19
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.1.3",
|
20
|
+
"commit": "e7530bc179fd0e303448083c76a4af41a0e15322"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"author": "beachball",
|
24
|
+
"package": "@fluentui/react-tabster",
|
25
|
+
"comment": "Bump @fluentui/react-theme to v9.1.4",
|
26
|
+
"commit": "e7530bc179fd0e303448083c76a4af41a0e15322"
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"author": "beachball",
|
30
|
+
"package": "@fluentui/react-tabster",
|
31
|
+
"comment": "Bump @fluentui/react-utilities to v9.3.0",
|
32
|
+
"commit": "e7530bc179fd0e303448083c76a4af41a0e15322"
|
33
|
+
}
|
34
|
+
]
|
35
|
+
}
|
36
|
+
},
|
37
|
+
{
|
38
|
+
"date": "Mon, 05 Dec 2022 18:29:35 GMT",
|
39
|
+
"tag": "@fluentui/react-tabster_v9.3.2",
|
40
|
+
"version": "9.3.2",
|
41
|
+
"comments": {
|
42
|
+
"patch": [
|
43
|
+
{
|
44
|
+
"author": "lingfangao@hotmail.com",
|
45
|
+
"package": "@fluentui/react-tabster",
|
46
|
+
"commit": "6f450a1713c40d5429306ab1f6d76bc19e65c295",
|
47
|
+
"comment": "fix: focus-within attribute no longer the same as focus-visible"
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"author": "olfedias@microsoft.com",
|
51
|
+
"package": "@fluentui/react-tabster",
|
52
|
+
"commit": "076ac58a921376c6ee488f10e610dc05095acbf3",
|
53
|
+
"comment": "fix: allow GriffelResetStyle to be passed to createCustomFocusIndicatorStyle"
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"author": "beachball",
|
57
|
+
"package": "@fluentui/react-tabster",
|
58
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.1.2",
|
59
|
+
"commit": "4c29542a51bf068e171690cc8e59c14489883912"
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"author": "beachball",
|
63
|
+
"package": "@fluentui/react-tabster",
|
64
|
+
"comment": "Bump @fluentui/react-theme to v9.1.3",
|
65
|
+
"commit": "4c29542a51bf068e171690cc8e59c14489883912"
|
66
|
+
}
|
67
|
+
]
|
68
|
+
}
|
69
|
+
},
|
70
|
+
{
|
71
|
+
"date": "Thu, 17 Nov 2022 23:05:49 GMT",
|
6
72
|
"tag": "@fluentui/react-tabster_v9.3.1",
|
7
73
|
"version": "9.3.1",
|
8
74
|
"comments": {
|
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,36 @@
|
|
1
1
|
# Change Log - @fluentui/react-tabster
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Tue, 20 Dec 2022 14:55:56 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.3.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.3.3)
|
8
|
+
|
9
|
+
Tue, 20 Dec 2022 14:55:56 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.3.2..@fluentui/react-tabster_v9.3.3)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- chore: Migrate to new package structure. ([PR #25833](https://github.com/microsoft/fluentui/pull/25833) by tristan.watanabe@gmail.com)
|
15
|
+
- Bump @fluentui/react-shared-contexts to v9.1.3 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
|
16
|
+
- Bump @fluentui/react-theme to v9.1.4 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
|
17
|
+
- Bump @fluentui/react-utilities to v9.3.0 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
|
18
|
+
|
19
|
+
## [9.3.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.3.2)
|
20
|
+
|
21
|
+
Mon, 05 Dec 2022 18:29:35 GMT
|
22
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.3.1..@fluentui/react-tabster_v9.3.2)
|
23
|
+
|
24
|
+
### Patches
|
25
|
+
|
26
|
+
- fix: focus-within attribute no longer the same as focus-visible ([PR #25790](https://github.com/microsoft/fluentui/pull/25790) by lingfangao@hotmail.com)
|
27
|
+
- fix: allow GriffelResetStyle to be passed to createCustomFocusIndicatorStyle ([PR #25216](https://github.com/microsoft/fluentui/pull/25216) by olfedias@microsoft.com)
|
28
|
+
- Bump @fluentui/react-shared-contexts to v9.1.2 ([PR #25798](https://github.com/microsoft/fluentui/pull/25798) by beachball)
|
29
|
+
- Bump @fluentui/react-theme to v9.1.3 ([PR #25798](https://github.com/microsoft/fluentui/pull/25798) by beachball)
|
30
|
+
|
7
31
|
## [9.3.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.3.1)
|
8
32
|
|
9
|
-
Thu, 17 Nov 2022 23:
|
33
|
+
Thu, 17 Nov 2022 23:05:49 GMT
|
10
34
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.3.0..@fluentui/react-tabster_v9.3.1)
|
11
35
|
|
12
36
|
### Patches
|
package/dist/index.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import type { GriffelStyle } from '@griffel/react';
|
2
|
+
import { makeResetStyles } from '@griffel/react';
|
2
3
|
import * as React_2 from 'react';
|
3
4
|
import type { RefObject } from 'react';
|
4
5
|
import { Types } from 'tabster';
|
@@ -14,10 +15,10 @@ export declare function applyFocusVisiblePolyfill(scope: HTMLElement, win: Windo
|
|
14
15
|
* Creates a style for @see makeStyles that includes the necessary selectors for focus.
|
15
16
|
* Should be used only when @see createFocusOutlineStyle does not fit requirements
|
16
17
|
*
|
17
|
-
* @param style - styling applied on focus, defaults to @see
|
18
|
+
* @param style - styling applied on focus, defaults to @see getDefaultFocusOutlineStyles
|
18
19
|
* @param options - Configure the style of the focus outline
|
19
20
|
*/
|
20
|
-
export declare
|
21
|
+
export declare function createCustomFocusIndicatorStyle<TStyle extends GriffelStyle | GriffelResetStyle>(style: TStyle, { selector, enableOutline, }?: CreateCustomFocusIndicatorStyleOptions): TStyle extends GriffelStyle ? GriffelStyle : GriffelResetStyle;
|
21
22
|
|
22
23
|
export declare interface CreateCustomFocusIndicatorStyleOptions {
|
23
24
|
selector?: 'focus' | 'focus-within';
|
@@ -54,6 +55,8 @@ export declare type FocusOutlineStyleOptions = {
|
|
54
55
|
outlineOffset?: string | FocusOutlineOffset;
|
55
56
|
};
|
56
57
|
|
58
|
+
declare type GriffelResetStyle = Parameters<typeof makeResetStyles>[0];
|
59
|
+
|
57
60
|
/**
|
58
61
|
* A hook that returns the necessary tabster attributes to support arrow key navigation
|
59
62
|
* @param options - Options to configure keyboard navigation
|
package/lib/focus/constants.js
CHANGED
@@ -9,7 +9,7 @@ export const FOCUS_VISIBLE_ATTR = 'data-fui-focus-visible';
|
|
9
9
|
* @internal
|
10
10
|
*/
|
11
11
|
|
12
|
-
export const FOCUS_WITHIN_ATTR = 'data-fui-focus-
|
12
|
+
export const FOCUS_WITHIN_ATTR = 'data-fui-focus-within';
|
13
13
|
export const defaultOptions = {
|
14
14
|
style: {},
|
15
15
|
selector: 'focus'
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-tabster/src/focus/constants.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,sBAAsB,GAAG,mBAA/B;AACP,OAAO,MAAM,qBAAqB,GAAG,YAAY,sBAAsB,IAAhE;AAEP;;AAEG;;AACH,OAAO,MAAM,kBAAkB,GAAG,wBAA3B;AAEP;;AAEG;;AACH,OAAO,MAAM,iBAAiB,GAAG,
|
1
|
+
{"version":3,"sources":["packages/react-components/react-tabster/src/focus/constants.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,sBAAsB,GAAG,mBAA/B;AACP,OAAO,MAAM,qBAAqB,GAAG,YAAY,sBAAsB,IAAhE;AAEP;;AAEG;;AACH,OAAO,MAAM,kBAAkB,GAAG,wBAA3B;AAEP;;AAEG;;AACH,OAAO,MAAM,iBAAiB,GAAG,uBAA1B;AACP,OAAO,MAAM,cAAc,GAAG;EAC5B,KAAK,EAAE,EADqB;EAE5B,QAAQ,EAAE;AAFkB,CAAvB","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} as const;\n"],"sourceRoot":"../src/"}
|
@@ -3,25 +3,27 @@ import { defaultOptions, FOCUS_VISIBLE_ATTR, FOCUS_WITHIN_ATTR } from './constan
|
|
3
3
|
* Creates a style for @see makeStyles that includes the necessary selectors for focus.
|
4
4
|
* Should be used only when @see createFocusOutlineStyle does not fit requirements
|
5
5
|
*
|
6
|
-
* @param style - styling applied on focus, defaults to @see
|
6
|
+
* @param style - styling applied on focus, defaults to @see getDefaultFocusOutlineStyles
|
7
7
|
* @param options - Configure the style of the focus outline
|
8
8
|
*/
|
9
9
|
|
10
|
-
export
|
10
|
+
export function createCustomFocusIndicatorStyle(style, {
|
11
11
|
selector = defaultOptions.selector,
|
12
12
|
enableOutline = false
|
13
|
-
} = defaultOptions)
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
})
|
13
|
+
} = defaultOptions) {
|
14
|
+
return {
|
15
|
+
':focus': {
|
16
|
+
outlineStyle: enableOutline ? undefined : 'none'
|
17
|
+
},
|
18
|
+
':focus-visible': {
|
19
|
+
outlineStyle: enableOutline ? undefined : 'none'
|
20
|
+
},
|
21
|
+
...(selector === 'focus' && {
|
22
|
+
[`&[${FOCUS_VISIBLE_ATTR}]`]: style
|
23
|
+
}),
|
24
|
+
...(selector === 'focus-within' && {
|
25
|
+
[`&[${FOCUS_WITHIN_ATTR}]:${selector}`]: style
|
26
|
+
})
|
27
|
+
};
|
28
|
+
}
|
27
29
|
//# sourceMappingURL=createCustomFocusIndicatorStyle.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-tabster/src/focus/createCustomFocusIndicatorStyle.ts"],"names":[],"mappings":"AAAA,SAAS,cAAT,EAAyB,kBAAzB,EAA6C,iBAA7C,QAAsE,aAAtE;
|
1
|
+
{"version":3,"sources":["packages/react-components/react-tabster/src/focus/createCustomFocusIndicatorStyle.ts"],"names":[],"mappings":"AAAA,SAAS,cAAT,EAAyB,kBAAzB,EAA6C,iBAA7C,QAAsE,aAAtE;AAiBA;;;;;;AAMG;;AACH,OAAM,SAAU,+BAAV,CACJ,KADI,EAEJ;EACE,QAAQ,GAAG,cAAc,CAAC,QAD5B;EAEE,aAAa,GAAG;AAFlB,IAG4C,cALxC,EAKsD;EAE1D,OAAO;IACL,UAAU;MACR,YAAY,EAAE,aAAa,GAAG,SAAH,GAAe;IADlC,CADL;IAIL,kBAAkB;MAChB,YAAY,EAAE,aAAa,GAAG,SAAH,GAAe;IAD1B,CAJb;IAQL,IAAI,QAAQ,KAAK,OAAb,IAAwB;MAC1B,CAAC,KAAK,kBAAkB,GAAxB,GAA8B;IADJ,CAA5B,CARK;IAWL,IAAI,QAAQ,KAAK,cAAb,IAA+B;MACjC,CAAC,KAAK,iBAAiB,KAAK,QAAQ,EAApC,GAAyC;IADR,CAAnC;EAXK,CAAP;AAeD","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 selector?: 'focus' | 'focus-within';\n /**\n * Enables the browser default outline style\n * @default false\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 * @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 = defaultOptions.selector,\n enableOutline = false,\n }: CreateCustomFocusIndicatorStyleOptions = defaultOptions,\n): TStyle extends GriffelStyle ? GriffelStyle : GriffelResetStyle {\n return {\n ':focus': {\n outlineStyle: enableOutline ? undefined : 'none',\n },\n ':focus-visible': {\n outlineStyle: enableOutline ? undefined : 'none',\n },\n\n ...(selector === 'focus' && {\n [`&[${FOCUS_VISIBLE_ATTR}]`]: style,\n }),\n ...(selector === 'focus-within' && {\n [`&[${FOCUS_WITHIN_ATTR}]:${selector}`]: style,\n }),\n };\n}\n"],"sourceRoot":"../src/"}
|
@@ -11,7 +11,7 @@ define(["require", "exports"], function (require, exports) {
|
|
11
11
|
/**
|
12
12
|
* @internal
|
13
13
|
*/
|
14
|
-
exports.FOCUS_WITHIN_ATTR = 'data-fui-focus-
|
14
|
+
exports.FOCUS_WITHIN_ATTR = 'data-fui-focus-within';
|
15
15
|
exports.defaultOptions = {
|
16
16
|
style: {},
|
17
17
|
selector: 'focus',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-tabster/src/focus/constants.ts"],"names":[],"mappings":";;;;IAAa,QAAA,sBAAsB,GAAG,mBAA4B,CAAC;IACtD,QAAA,qBAAqB,GAAG,cAAY,8BAAsB,OAAa,CAAC;IAErF;;OAEG;IACU,QAAA,kBAAkB,GAAG,wBAAwB,CAAC;IAE3D;;OAEG;IACU,QAAA,iBAAiB,GAAG,
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-tabster/src/focus/constants.ts"],"names":[],"mappings":";;;;IAAa,QAAA,sBAAsB,GAAG,mBAA4B,CAAC;IACtD,QAAA,qBAAqB,GAAG,cAAY,8BAAsB,OAAa,CAAC;IAErF;;OAEG;IACU,QAAA,kBAAkB,GAAG,wBAAwB,CAAC;IAE3D;;OAEG;IACU,QAAA,iBAAiB,GAAG,uBAAuB,CAAC;IAC5C,QAAA,cAAc,GAAG;QAC5B,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,OAAO;KACT,CAAC","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} as const;\n"]}
|
@@ -6,13 +6,13 @@ define(["require", "exports", "tslib", "./constants"], function (require, export
|
|
6
6
|
* Creates a style for @see makeStyles that includes the necessary selectors for focus.
|
7
7
|
* Should be used only when @see createFocusOutlineStyle does not fit requirements
|
8
8
|
*
|
9
|
-
* @param style - styling applied on focus, defaults to @see
|
9
|
+
* @param style - styling applied on focus, defaults to @see getDefaultFocusOutlineStyles
|
10
10
|
* @param options - Configure the style of the focus outline
|
11
11
|
*/
|
12
|
-
|
12
|
+
function createCustomFocusIndicatorStyle(style, _a) {
|
13
13
|
var _b, _c;
|
14
14
|
var _d = _a === void 0 ? constants_1.defaultOptions : _a, _e = _d.selector, selector = _e === void 0 ? constants_1.defaultOptions.selector : _e, _f = _d.enableOutline, enableOutline = _f === void 0 ? false : _f;
|
15
|
-
return
|
15
|
+
return tslib_1.__assign(tslib_1.__assign({ ':focus': {
|
16
16
|
outlineStyle: enableOutline ? undefined : 'none',
|
17
17
|
}, ':focus-visible': {
|
18
18
|
outlineStyle: enableOutline ? undefined : 'none',
|
@@ -20,8 +20,8 @@ define(["require", "exports", "tslib", "./constants"], function (require, export
|
|
20
20
|
_b["&[" + constants_1.FOCUS_VISIBLE_ATTR + "]"] = style,
|
21
21
|
_b))), (selector === 'focus-within' && (_c = {},
|
22
22
|
_c["&[" + constants_1.FOCUS_WITHIN_ATTR + "]:" + selector] = style,
|
23
|
-
_c)))
|
24
|
-
}
|
23
|
+
_c)));
|
24
|
+
}
|
25
25
|
exports.createCustomFocusIndicatorStyle = createCustomFocusIndicatorStyle;
|
26
26
|
});
|
27
27
|
//# sourceMappingURL=createCustomFocusIndicatorStyle.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createCustomFocusIndicatorStyle.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-tabster/src/focus/createCustomFocusIndicatorStyle.ts"],"names":[],"mappings":";;;;
|
1
|
+
{"version":3,"file":"createCustomFocusIndicatorStyle.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-tabster/src/focus/createCustomFocusIndicatorStyle.ts"],"names":[],"mappings":";;;;IAiBA;;;;;;OAMG;IACH,SAAgB,+BAA+B,CAC7C,KAAa,EACb,EAG0D;;YAH1D,qBAG4C,0BAAc,KAAA,EAFxD,gBAAkC,EAAlC,QAAQ,mBAAG,0BAAc,CAAC,QAAQ,KAAA,EAClC,qBAAqB,EAArB,aAAa,mBAAG,KAAK,KAAA;QAGvB,2CACE,QAAQ,EAAE;gBACR,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;aACjD,EACD,gBAAgB,EAAE;gBAChB,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;aACjD,IAEE,CAAC,QAAQ,KAAK,OAAO;YACtB,GAAC,OAAK,8BAAkB,MAAG,IAAG,KAAK;eACpC,CAAC,GACC,CAAC,QAAQ,KAAK,cAAc;YAC7B,GAAC,OAAK,6BAAiB,UAAK,QAAU,IAAG,KAAK;eAC/C,CAAC,EACF;IACJ,CAAC;IAtBD,0EAsBC","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 selector?: 'focus' | 'focus-within';\n /**\n * Enables the browser default outline style\n * @default false\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 * @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 = defaultOptions.selector,\n enableOutline = false,\n }: CreateCustomFocusIndicatorStyleOptions = defaultOptions,\n): TStyle extends GriffelStyle ? GriffelStyle : GriffelResetStyle {\n return {\n ':focus': {\n outlineStyle: enableOutline ? undefined : 'none',\n },\n ':focus-visible': {\n outlineStyle: enableOutline ? undefined : 'none',\n },\n\n ...(selector === 'focus' && {\n [`&[${FOCUS_VISIBLE_ATTR}]`]: style,\n }),\n ...(selector === 'focus-within' && {\n [`&[${FOCUS_WITHIN_ATTR}]:${selector}`]: style,\n }),\n };\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-tabster/src/focus/constants.ts"],"names":[],"mappings":";;;;;;AAAa,OAAA,CAAA,sBAAA,GAAyB,mBAAzB;AACA,OAAA,CAAA,qBAAA,GAAwB,YAAY,OAAA,CAAA,sBAAsB,IAA1D;AAEb;;AAEG;;AACU,OAAA,CAAA,kBAAA,GAAqB,wBAArB;AAEb;;AAEG;;AACU,OAAA,CAAA,iBAAA,GAAoB,
|
1
|
+
{"version":3,"sources":["packages/react-components/react-tabster/src/focus/constants.ts"],"names":[],"mappings":";;;;;;AAAa,OAAA,CAAA,sBAAA,GAAyB,mBAAzB;AACA,OAAA,CAAA,qBAAA,GAAwB,YAAY,OAAA,CAAA,sBAAsB,IAA1D;AAEb;;AAEG;;AACU,OAAA,CAAA,kBAAA,GAAqB,wBAArB;AAEb;;AAEG;;AACU,OAAA,CAAA,iBAAA,GAAoB,uBAApB;AACA,OAAA,CAAA,cAAA,GAAiB;EAC5B,KAAK,EAAE,EADqB;EAE5B,QAAQ,EAAE;AAFkB,CAAjB","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} as const;\n"],"sourceRoot":"../src/"}
|
@@ -10,28 +10,30 @@ const constants_1 = /*#__PURE__*/require("./constants");
|
|
10
10
|
* Creates a style for @see makeStyles that includes the necessary selectors for focus.
|
11
11
|
* Should be used only when @see createFocusOutlineStyle does not fit requirements
|
12
12
|
*
|
13
|
-
* @param style - styling applied on focus, defaults to @see
|
13
|
+
* @param style - styling applied on focus, defaults to @see getDefaultFocusOutlineStyles
|
14
14
|
* @param options - Configure the style of the focus outline
|
15
15
|
*/
|
16
16
|
|
17
17
|
|
18
|
-
|
18
|
+
function createCustomFocusIndicatorStyle(style, {
|
19
19
|
selector = constants_1.defaultOptions.selector,
|
20
20
|
enableOutline = false
|
21
|
-
} = constants_1.defaultOptions)
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
})
|
21
|
+
} = constants_1.defaultOptions) {
|
22
|
+
return {
|
23
|
+
':focus': {
|
24
|
+
outlineStyle: enableOutline ? undefined : 'none'
|
25
|
+
},
|
26
|
+
':focus-visible': {
|
27
|
+
outlineStyle: enableOutline ? undefined : 'none'
|
28
|
+
},
|
29
|
+
...(selector === 'focus' && {
|
30
|
+
[`&[${constants_1.FOCUS_VISIBLE_ATTR}]`]: style
|
31
|
+
}),
|
32
|
+
...(selector === 'focus-within' && {
|
33
|
+
[`&[${constants_1.FOCUS_WITHIN_ATTR}]:${selector}`]: style
|
34
|
+
})
|
35
|
+
};
|
36
|
+
}
|
35
37
|
|
36
38
|
exports.createCustomFocusIndicatorStyle = createCustomFocusIndicatorStyle;
|
37
39
|
//# sourceMappingURL=createCustomFocusIndicatorStyle.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-tabster/src/focus/createCustomFocusIndicatorStyle.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,WAAA,gBAAA,OAAA,CAAA,aAAA,CAAA;
|
1
|
+
{"version":3,"sources":["packages/react-components/react-tabster/src/focus/createCustomFocusIndicatorStyle.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,WAAA,gBAAA,OAAA,CAAA,aAAA,CAAA;AAiBA;;;;;;AAMG;;;AACH,SAAgB,+BAAhB,CACE,KADF,EAEE;EACE,QAAQ,GAAG,WAAA,CAAA,cAAA,CAAe,QAD5B;EAEE,aAAa,GAAG;AAFlB,IAG4C,WAAA,CAAA,cAL9C,EAK4D;EAE1D,OAAO;IACL,UAAU;MACR,YAAY,EAAE,aAAa,GAAG,SAAH,GAAe;IADlC,CADL;IAIL,kBAAkB;MAChB,YAAY,EAAE,aAAa,GAAG,SAAH,GAAe;IAD1B,CAJb;IAQL,IAAI,QAAQ,KAAK,OAAb,IAAwB;MAC1B,CAAC,KAAK,WAAA,CAAA,kBAAkB,GAAxB,GAA8B;IADJ,CAA5B,CARK;IAWL,IAAI,QAAQ,KAAK,cAAb,IAA+B;MACjC,CAAC,KAAK,WAAA,CAAA,iBAAiB,KAAK,QAAQ,EAApC,GAAyC;IADR,CAAnC;EAXK,CAAP;AAeD;;AAtBD,OAAA,CAAA,+BAAA,GAAA,+BAAA","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 selector?: 'focus' | 'focus-within';\n /**\n * Enables the browser default outline style\n * @default false\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 * @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 = defaultOptions.selector,\n enableOutline = false,\n }: CreateCustomFocusIndicatorStyleOptions = defaultOptions,\n): TStyle extends GriffelStyle ? GriffelStyle : GriffelResetStyle {\n return {\n ':focus': {\n outlineStyle: enableOutline ? undefined : 'none',\n },\n ':focus-visible': {\n outlineStyle: enableOutline ? undefined : 'none',\n },\n\n ...(selector === 'focus' && {\n [`&[${FOCUS_VISIBLE_ATTR}]`]: style,\n }),\n ...(selector === 'focus-within' && {\n [`&[${FOCUS_WITHIN_ATTR}]:${selector}`]: style,\n }),\n };\n}\n"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-tabster",
|
3
|
-
"version": "9.3.
|
3
|
+
"version": "9.3.3",
|
4
4
|
"description": "Utilities for focus management and facade for tabster",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -19,9 +19,7 @@
|
|
19
19
|
"e2e:local": "cypress open --component",
|
20
20
|
"just": "just-scripts",
|
21
21
|
"lint": "just-scripts lint",
|
22
|
-
"storybook": "start-storybook",
|
23
22
|
"test": "jest --passWithNoTests",
|
24
|
-
"start": "yarn storybook",
|
25
23
|
"type-check": "tsc -b tsconfig.json",
|
26
24
|
"generate-api": "tsc -p ./tsconfig.lib.json --emitDeclarationOnly && just-scripts api-extractor"
|
27
25
|
},
|
@@ -31,9 +29,9 @@
|
|
31
29
|
},
|
32
30
|
"dependencies": {
|
33
31
|
"@griffel/react": "^1.4.2",
|
34
|
-
"@fluentui/react-shared-contexts": "^9.1.
|
35
|
-
"@fluentui/react-theme": "^9.1.
|
36
|
-
"@fluentui/react-utilities": "^9.
|
32
|
+
"@fluentui/react-shared-contexts": "^9.1.3",
|
33
|
+
"@fluentui/react-theme": "^9.1.4",
|
34
|
+
"@fluentui/react-utilities": "^9.3.0",
|
37
35
|
"keyborg": "^1.2.1",
|
38
36
|
"tabster": "^3.0.4",
|
39
37
|
"tslib": "^2.1.0"
|