@fluentui/react-tabster 0.0.0-nightly-20220309-0417.1 → 0.0.0-nightly-20220314-0419.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 +16 -10
- package/CHANGELOG.md +9 -8
- package/dist/react-tabster.d.ts +1 -1
- package/lib/hooks/useFocusIndicatorStyle.d.ts +1 -1
- package/lib/hooks/useFocusIndicatorStyle.js +7 -8
- package/lib/hooks/useFocusIndicatorStyle.js.map +1 -1
- package/lib-commonjs/hooks/useFocusIndicatorStyle.d.ts +1 -1
- package/lib-commonjs/hooks/useFocusIndicatorStyle.js +8 -8
- package/lib-commonjs/hooks/useFocusIndicatorStyle.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.json
CHANGED
@@ -2,34 +2,40 @@
|
|
2
2
|
"name": "@fluentui/react-tabster",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
6
|
-
"tag": "@fluentui/react-tabster_v0.0.0-nightly-
|
7
|
-
"version": "0.0.0-nightly-
|
5
|
+
"date": "Mon, 14 Mar 2022 04:29:23 GMT",
|
6
|
+
"tag": "@fluentui/react-tabster_v0.0.0-nightly-20220314-0419.1",
|
7
|
+
"version": "0.0.0-nightly-20220314-0419.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": "not available",
|
14
14
|
"comment": "Release nightly v9"
|
15
15
|
},
|
16
|
+
{
|
17
|
+
"author": "olfedias@microsoft.com",
|
18
|
+
"package": "@fluentui/react-tabster",
|
19
|
+
"commit": "829295c714ac9ff8063f5e086513574ad2e7990b",
|
20
|
+
"comment": "fix styles in getFocusOutlineStyles()"
|
21
|
+
},
|
16
22
|
{
|
17
23
|
"author": "beachball",
|
18
24
|
"package": "@fluentui/react-tabster",
|
19
|
-
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-
|
20
|
-
"commit": "
|
25
|
+
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20220314-0419.1",
|
26
|
+
"commit": "beb5c46f1c6605a128e9eecbeb156151afbfaebd"
|
21
27
|
},
|
22
28
|
{
|
23
29
|
"author": "beachball",
|
24
30
|
"package": "@fluentui/react-tabster",
|
25
|
-
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-
|
26
|
-
"commit": "
|
31
|
+
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20220314-0419.1",
|
32
|
+
"commit": "beb5c46f1c6605a128e9eecbeb156151afbfaebd"
|
27
33
|
},
|
28
34
|
{
|
29
35
|
"author": "beachball",
|
30
36
|
"package": "@fluentui/react-tabster",
|
31
|
-
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-
|
32
|
-
"commit": "
|
37
|
+
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20220314-0419.1",
|
38
|
+
"commit": "beb5c46f1c6605a128e9eecbeb156151afbfaebd"
|
33
39
|
}
|
34
40
|
],
|
35
41
|
"none": [
|
package/CHANGELOG.md
CHANGED
@@ -1,20 +1,21 @@
|
|
1
1
|
# Change Log - @fluentui/react-tabster
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Mon, 14 Mar 2022 04:29:23 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
-
## [0.0.0-nightly-
|
7
|
+
## [0.0.0-nightly-20220314-0419.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v0.0.0-nightly-20220314-0419.1)
|
8
8
|
|
9
|
-
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.0.0-rc.5..@fluentui/react-tabster_v0.0.0-nightly-
|
9
|
+
Mon, 14 Mar 2022 04:29:23 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.0.0-rc.5..@fluentui/react-tabster_v0.0.0-nightly-20220314-0419.1)
|
11
11
|
|
12
12
|
### Changes
|
13
13
|
|
14
|
-
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/
|
15
|
-
-
|
16
|
-
- Bump @fluentui/react-
|
17
|
-
- Bump @fluentui/react-
|
14
|
+
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by email not defined)
|
15
|
+
- fix styles in getFocusOutlineStyles() ([PR #22070](https://github.com/microsoft/fluentui/pull/22070) by olfedias@microsoft.com)
|
16
|
+
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20220314-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/beb5c46f1c6605a128e9eecbeb156151afbfaebd) by beachball)
|
17
|
+
- Bump @fluentui/react-theme to v0.0.0-nightly-20220314-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/beb5c46f1c6605a128e9eecbeb156151afbfaebd) by beachball)
|
18
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly-20220314-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/beb5c46f1c6605a128e9eecbeb156151afbfaebd) by beachball)
|
18
19
|
|
19
20
|
## [9.0.0-rc.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.0.0-rc.5)
|
20
21
|
|
package/dist/react-tabster.d.ts
CHANGED
@@ -7,6 +7,7 @@ import { Types } from 'tabster';
|
|
7
7
|
* Should be used only when @see createFocusOutlineStyle does not fit requirements
|
8
8
|
*
|
9
9
|
* @param style - styling applied on focus, defaults to @see getDefaultFocusOutlineStyes
|
10
|
+
* @param options - Configure the style of the focus outline
|
10
11
|
*/
|
11
12
|
export declare const createCustomFocusIndicatorStyle: (style: GriffelStyle, options?: CreateFocusIndicatorStyleRuleOptions) => GriffelStyle;
|
12
13
|
|
@@ -18,7 +19,6 @@ export declare interface CreateFocusIndicatorStyleRuleOptions {
|
|
18
19
|
* NOTE: The element with the focus outline needs to have `position: relative` so that the
|
19
20
|
* pseudo element can be properly positioned.
|
20
21
|
*
|
21
|
-
* @param theme - Theme used in @see makeStyles
|
22
22
|
* @param options - Configure the style of the focus outline
|
23
23
|
* @returns focus outline styles object for @see makeStyles
|
24
24
|
*/
|
@@ -17,7 +17,6 @@ export interface CreateFocusIndicatorStyleRuleOptions {
|
|
17
17
|
* NOTE: The element with the focus outline needs to have `position: relative` so that the
|
18
18
|
* pseudo element can be properly positioned.
|
19
19
|
*
|
20
|
-
* @param theme - Theme used in @see makeStyles
|
21
20
|
* @param options - Configure the style of the focus outline
|
22
21
|
* @returns focus outline styles object for @see makeStyles
|
23
22
|
*/
|
@@ -29,5 +28,6 @@ export declare const createFocusOutlineStyle: (options?: {
|
|
29
28
|
* Should be used only when @see createFocusOutlineStyle does not fit requirements
|
30
29
|
*
|
31
30
|
* @param style - styling applied on focus, defaults to @see getDefaultFocusOutlineStyes
|
31
|
+
* @param options - Configure the style of the focus outline
|
32
32
|
*/
|
33
33
|
export declare const createCustomFocusIndicatorStyle: (style: GriffelStyle, options?: CreateFocusIndicatorStyleRuleOptions) => GriffelStyle;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { tokens } from '@fluentui/react-theme';
|
2
2
|
import { KEYBOARD_NAV_SELECTOR } from '../symbols';
|
3
|
+
import { shorthands } from '@griffel/react';
|
3
4
|
/**
|
4
5
|
* NOTE: the element with the focus outline needs to have `position: relative` so that the
|
5
6
|
* pseudo element can be properly positioned.
|
@@ -21,18 +22,16 @@ const getFocusOutlineStyles = options => {
|
|
21
22
|
const outlineOffsetBottom = ((_b = outlineOffset) === null || _b === void 0 ? void 0 : _b.bottom) || outlineOffset;
|
22
23
|
const outlineOffsetLeft = ((_c = outlineOffset) === null || _c === void 0 ? void 0 : _c.left) || outlineOffset;
|
23
24
|
const outlineOffsetRight = ((_d = outlineOffset) === null || _d === void 0 ? void 0 : _d.right) || outlineOffset;
|
24
|
-
return {
|
25
|
-
borderColor: 'transparent',
|
25
|
+
return { ...shorthands.borderColor('transparent'),
|
26
26
|
':after': {
|
27
27
|
content: '""',
|
28
28
|
position: 'absolute',
|
29
29
|
pointerEvents: 'none',
|
30
|
-
boxSizing: 'outline-box',
|
31
30
|
zIndex: 1,
|
32
|
-
borderStyle
|
33
|
-
borderWidth
|
34
|
-
borderRadius
|
35
|
-
borderColor
|
31
|
+
...shorthands.borderStyle('solid'),
|
32
|
+
...shorthands.borderWidth(outlineWidth),
|
33
|
+
...shorthands.borderRadius(outlineRadius),
|
34
|
+
...shorthands.borderColor(outlineColor),
|
36
35
|
top: !outlineOffset ? `-${outlineWidth}` : `calc(0px - ${outlineWidth} - ${outlineOffsetTop})`,
|
37
36
|
bottom: !outlineOffset ? `-${outlineWidth}` : `calc(0px - ${outlineWidth} - ${outlineOffsetBottom})`,
|
38
37
|
left: !outlineOffset ? `-${outlineWidth}` : `calc(0px - ${outlineWidth} - ${outlineOffsetLeft})`,
|
@@ -48,7 +47,6 @@ const defaultOptions = {
|
|
48
47
|
* NOTE: The element with the focus outline needs to have `position: relative` so that the
|
49
48
|
* pseudo element can be properly positioned.
|
50
49
|
*
|
51
|
-
* @param theme - Theme used in @see makeStyles
|
52
50
|
* @param options - Configure the style of the focus outline
|
53
51
|
* @returns focus outline styles object for @see makeStyles
|
54
52
|
*/
|
@@ -73,6 +71,7 @@ export const createFocusOutlineStyle = (options = {
|
|
73
71
|
* Should be used only when @see createFocusOutlineStyle does not fit requirements
|
74
72
|
*
|
75
73
|
* @param style - styling applied on focus, defaults to @see getDefaultFocusOutlineStyes
|
74
|
+
* @param options - Configure the style of the focus outline
|
76
75
|
*/
|
77
76
|
|
78
77
|
export const createCustomFocusIndicatorStyle = (style, options = defaultOptions) => ({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["hooks/useFocusIndicatorStyle.ts"],"names":[],"mappings":"AAAA,SAAS,MAAT,QAAuB,uBAAvB;AACA,SAAS,qBAAT,QAAsC,YAAtC;AAeA;;;;;;AAMG;;AACH,MAAM,qB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B;AAChB,IAAA,YAAY,EAAE;AADE,GADA;AAIlB,GAAC,GAAG,qBAAqB,KAAK,OAAO,CAAC,QAAR,IAAoB,cAAc,CAAC,QAAQ,EAAzE,GAA8E;AAJ5D,CAH2B,CAAxC","sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { KEYBOARD_NAV_SELECTOR } from '../symbols';\nimport { shorthands } from '@griffel/react';\nimport type { GriffelStyle } from '@griffel/react';\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};\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, outlineOffset, outlineWidth } = options;\n\n const outlineOffsetTop = (outlineOffset as FocusOutlineOffset)?.top || outlineOffset;\n const outlineOffsetBottom = (outlineOffset as FocusOutlineOffset)?.bottom || outlineOffset;\n const outlineOffsetLeft = (outlineOffset as FocusOutlineOffset)?.left || outlineOffset;\n const outlineOffsetRight = (outlineOffset as FocusOutlineOffset)?.right || outlineOffset;\n\n return {\n ...shorthands.borderColor('transparent'),\n ':after': {\n content: '\"\"',\n position: 'absolute',\n pointerEvents: 'none',\n zIndex: 1,\n\n ...shorthands.borderStyle('solid'),\n ...shorthands.borderWidth(outlineWidth),\n ...shorthands.borderRadius(outlineRadius),\n ...shorthands.borderColor(outlineColor),\n\n top: !outlineOffset ? `-${outlineWidth}` : `calc(0px - ${outlineWidth} - ${outlineOffsetTop})`,\n bottom: !outlineOffset ? `-${outlineWidth}` : `calc(0px - ${outlineWidth} - ${outlineOffsetBottom})`,\n left: !outlineOffset ? `-${outlineWidth}` : `calc(0px - ${outlineWidth} - ${outlineOffsetLeft})`,\n right: !outlineOffset ? `-${outlineWidth}` : `calc(0px - ${outlineWidth} - ${outlineOffsetRight})`,\n },\n };\n};\n\nexport interface CreateFocusIndicatorStyleRuleOptions {\n selector?: 'focus' | 'focus-within';\n}\n\nconst defaultOptions: CreateFocusIndicatorStyleRuleOptions = {\n selector: 'focus',\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 options: {\n style: Partial<FocusOutlineStyleOptions>;\n } & CreateFocusIndicatorStyleRuleOptions = { style: {}, ...defaultOptions },\n): GriffelStyle => ({\n ':focus-visible': {\n outlineStyle: 'none',\n },\n [`${KEYBOARD_NAV_SELECTOR} :${options.selector || defaultOptions.selector}`]: getFocusOutlineStyles({\n outlineColor: tokens.colorStrokeFocus2,\n outlineRadius: tokens.borderRadiusMedium,\n // FIXME: tokens.strokeWidthThick causes some weird bugs\n outlineWidth: '2px',\n ...options.style,\n }),\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 getDefaultFocusOutlineStyes\n * @param options - Configure the style of the focus outline\n */\nexport const createCustomFocusIndicatorStyle = (\n style: GriffelStyle,\n options: CreateFocusIndicatorStyleRuleOptions = defaultOptions,\n): GriffelStyle => ({\n ':focus-visible': {\n outlineStyle: 'none',\n },\n [`${KEYBOARD_NAV_SELECTOR} :${options.selector || defaultOptions.selector}`]: style,\n});\n"],"sourceRoot":"../src/"}
|
@@ -17,7 +17,6 @@ export interface CreateFocusIndicatorStyleRuleOptions {
|
|
17
17
|
* NOTE: The element with the focus outline needs to have `position: relative` so that the
|
18
18
|
* pseudo element can be properly positioned.
|
19
19
|
*
|
20
|
-
* @param theme - Theme used in @see makeStyles
|
21
20
|
* @param options - Configure the style of the focus outline
|
22
21
|
* @returns focus outline styles object for @see makeStyles
|
23
22
|
*/
|
@@ -29,5 +28,6 @@ export declare const createFocusOutlineStyle: (options?: {
|
|
29
28
|
* Should be used only when @see createFocusOutlineStyle does not fit requirements
|
30
29
|
*
|
31
30
|
* @param style - styling applied on focus, defaults to @see getDefaultFocusOutlineStyes
|
31
|
+
* @param options - Configure the style of the focus outline
|
32
32
|
*/
|
33
33
|
export declare const createCustomFocusIndicatorStyle: (style: GriffelStyle, options?: CreateFocusIndicatorStyleRuleOptions) => GriffelStyle;
|
@@ -8,6 +8,8 @@ exports.createCustomFocusIndicatorStyle = exports.createFocusOutlineStyle = void
|
|
8
8
|
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
9
9
|
|
10
10
|
const symbols_1 = /*#__PURE__*/require("../symbols");
|
11
|
+
|
12
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
11
13
|
/**
|
12
14
|
* NOTE: the element with the focus outline needs to have `position: relative` so that the
|
13
15
|
* pseudo element can be properly positioned.
|
@@ -30,18 +32,16 @@ const getFocusOutlineStyles = options => {
|
|
30
32
|
const outlineOffsetBottom = ((_b = outlineOffset) === null || _b === void 0 ? void 0 : _b.bottom) || outlineOffset;
|
31
33
|
const outlineOffsetLeft = ((_c = outlineOffset) === null || _c === void 0 ? void 0 : _c.left) || outlineOffset;
|
32
34
|
const outlineOffsetRight = ((_d = outlineOffset) === null || _d === void 0 ? void 0 : _d.right) || outlineOffset;
|
33
|
-
return {
|
34
|
-
borderColor: 'transparent',
|
35
|
+
return { ...react_1.shorthands.borderColor('transparent'),
|
35
36
|
':after': {
|
36
37
|
content: '""',
|
37
38
|
position: 'absolute',
|
38
39
|
pointerEvents: 'none',
|
39
|
-
boxSizing: 'outline-box',
|
40
40
|
zIndex: 1,
|
41
|
-
borderStyle
|
42
|
-
borderWidth
|
43
|
-
borderRadius
|
44
|
-
borderColor
|
41
|
+
...react_1.shorthands.borderStyle('solid'),
|
42
|
+
...react_1.shorthands.borderWidth(outlineWidth),
|
43
|
+
...react_1.shorthands.borderRadius(outlineRadius),
|
44
|
+
...react_1.shorthands.borderColor(outlineColor),
|
45
45
|
top: !outlineOffset ? `-${outlineWidth}` : `calc(0px - ${outlineWidth} - ${outlineOffsetTop})`,
|
46
46
|
bottom: !outlineOffset ? `-${outlineWidth}` : `calc(0px - ${outlineWidth} - ${outlineOffsetBottom})`,
|
47
47
|
left: !outlineOffset ? `-${outlineWidth}` : `calc(0px - ${outlineWidth} - ${outlineOffsetLeft})`,
|
@@ -57,7 +57,6 @@ const defaultOptions = {
|
|
57
57
|
* NOTE: The element with the focus outline needs to have `position: relative` so that the
|
58
58
|
* pseudo element can be properly positioned.
|
59
59
|
*
|
60
|
-
* @param theme - Theme used in @see makeStyles
|
61
60
|
* @param options - Configure the style of the focus outline
|
62
61
|
* @returns focus outline styles object for @see makeStyles
|
63
62
|
*/
|
@@ -84,6 +83,7 @@ exports.createFocusOutlineStyle = createFocusOutlineStyle;
|
|
84
83
|
* Should be used only when @see createFocusOutlineStyle does not fit requirements
|
85
84
|
*
|
86
85
|
* @param style - styling applied on focus, defaults to @see getDefaultFocusOutlineStyes
|
86
|
+
* @param options - Configure the style of the focus outline
|
87
87
|
*/
|
88
88
|
|
89
89
|
const createCustomFocusIndicatorStyle = (style, options = defaultOptions) => ({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["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,
|
1
|
+
{"version":3,"sources":["hooks/useFocusIndicatorStyle.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,SAA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GAAgD,cAFH,MAG3B;AAClB,oBAAkB;AAChB,IAAA,YAAY,EAAE;AADE,GADA;AAIlB,GAAC,GAAG,SAAA,CAAA,qBAAqB,KAAK,OAAO,CAAC,QAAR,IAAoB,cAAc,CAAC,QAAQ,EAAzE,GAA8E;AAJ5D,CAH2B,CAAxC;;AAAM,OAAA,CAAA,+BAAA,GAA+B,+BAA/B","sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { KEYBOARD_NAV_SELECTOR } from '../symbols';\nimport { shorthands } from '@griffel/react';\nimport type { GriffelStyle } from '@griffel/react';\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};\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, outlineOffset, outlineWidth } = options;\n\n const outlineOffsetTop = (outlineOffset as FocusOutlineOffset)?.top || outlineOffset;\n const outlineOffsetBottom = (outlineOffset as FocusOutlineOffset)?.bottom || outlineOffset;\n const outlineOffsetLeft = (outlineOffset as FocusOutlineOffset)?.left || outlineOffset;\n const outlineOffsetRight = (outlineOffset as FocusOutlineOffset)?.right || outlineOffset;\n\n return {\n ...shorthands.borderColor('transparent'),\n ':after': {\n content: '\"\"',\n position: 'absolute',\n pointerEvents: 'none',\n zIndex: 1,\n\n ...shorthands.borderStyle('solid'),\n ...shorthands.borderWidth(outlineWidth),\n ...shorthands.borderRadius(outlineRadius),\n ...shorthands.borderColor(outlineColor),\n\n top: !outlineOffset ? `-${outlineWidth}` : `calc(0px - ${outlineWidth} - ${outlineOffsetTop})`,\n bottom: !outlineOffset ? `-${outlineWidth}` : `calc(0px - ${outlineWidth} - ${outlineOffsetBottom})`,\n left: !outlineOffset ? `-${outlineWidth}` : `calc(0px - ${outlineWidth} - ${outlineOffsetLeft})`,\n right: !outlineOffset ? `-${outlineWidth}` : `calc(0px - ${outlineWidth} - ${outlineOffsetRight})`,\n },\n };\n};\n\nexport interface CreateFocusIndicatorStyleRuleOptions {\n selector?: 'focus' | 'focus-within';\n}\n\nconst defaultOptions: CreateFocusIndicatorStyleRuleOptions = {\n selector: 'focus',\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 options: {\n style: Partial<FocusOutlineStyleOptions>;\n } & CreateFocusIndicatorStyleRuleOptions = { style: {}, ...defaultOptions },\n): GriffelStyle => ({\n ':focus-visible': {\n outlineStyle: 'none',\n },\n [`${KEYBOARD_NAV_SELECTOR} :${options.selector || defaultOptions.selector}`]: getFocusOutlineStyles({\n outlineColor: tokens.colorStrokeFocus2,\n outlineRadius: tokens.borderRadiusMedium,\n // FIXME: tokens.strokeWidthThick causes some weird bugs\n outlineWidth: '2px',\n ...options.style,\n }),\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 getDefaultFocusOutlineStyes\n * @param options - Configure the style of the focus outline\n */\nexport const createCustomFocusIndicatorStyle = (\n style: GriffelStyle,\n options: CreateFocusIndicatorStyleRuleOptions = defaultOptions,\n): GriffelStyle => ({\n ':focus-visible': {\n outlineStyle: 'none',\n },\n [`${KEYBOARD_NAV_SELECTOR} :${options.selector || defaultOptions.selector}`]: style,\n});\n"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-tabster",
|
3
|
-
"version": "0.0.0-nightly-
|
3
|
+
"version": "0.0.0-nightly-20220314-0419.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",
|
@@ -30,9 +30,9 @@
|
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
32
|
"@griffel/react": "1.0.0",
|
33
|
-
"@fluentui/react-shared-contexts": "0.0.0-nightly-
|
34
|
-
"@fluentui/react-theme": "0.0.0-nightly-
|
35
|
-
"@fluentui/react-utilities": "0.0.0-nightly-
|
33
|
+
"@fluentui/react-shared-contexts": "0.0.0-nightly-20220314-0419.1",
|
34
|
+
"@fluentui/react-theme": "0.0.0-nightly-20220314-0419.1",
|
35
|
+
"@fluentui/react-utilities": "0.0.0-nightly-20220314-0419.1",
|
36
36
|
"keyborg": "^1.1.0",
|
37
37
|
"tabster": "^1.1.1",
|
38
38
|
"tslib": "^2.1.0"
|