@fluentui/react-tabster 9.6.5 → 9.7.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.
- package/CHANGELOG.json +50 -1
- package/CHANGELOG.md +18 -2
- package/dist/index.d.ts +9 -4
- package/lib/focus/createCustomFocusIndicatorStyle.js +1 -8
- package/lib/focus/createCustomFocusIndicatorStyle.js.map +1 -1
- package/lib/focus/createFocusOutlineStyle.js +17 -8
- package/lib/focus/createFocusOutlineStyle.js.map +1 -1
- package/lib-commonjs/focus/createCustomFocusIndicatorStyle.js +1 -7
- package/lib-commonjs/focus/createCustomFocusIndicatorStyle.js.map +1 -1
- package/lib-commonjs/focus/createFocusOutlineStyle.js +16 -8
- package/lib-commonjs/focus/createFocusOutlineStyle.js.map +1 -1
- package/package.json +4 -4
- package/.swcrc +0 -30
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,56 @@
|
|
2
2
|
"name": "@fluentui/react-tabster",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Fri, 12 May 2023 20:22:22 GMT",
|
6
|
+
"tag": "@fluentui/react-tabster_v9.7.0",
|
7
|
+
"version": "9.7.0",
|
8
|
+
"comments": {
|
9
|
+
"none": [
|
10
|
+
{
|
11
|
+
"author": "martinhochel@microsoft.com",
|
12
|
+
"package": "@fluentui/react-tabster",
|
13
|
+
"commit": "dbda7fa69e3000aaf8dd4a061e254ebd35198b8e",
|
14
|
+
"comment": "fix: update npmignore files to fix npm8/node16 regression how npm publish works"
|
15
|
+
}
|
16
|
+
],
|
17
|
+
"patch": [
|
18
|
+
{
|
19
|
+
"author": "olfedias@microsoft.com",
|
20
|
+
"package": "@fluentui/react-tabster",
|
21
|
+
"commit": "c28decb23d191a0daaaf6d5d1832429715102129",
|
22
|
+
"comment": "chore: exclude .swcrc from being published"
|
23
|
+
}
|
24
|
+
],
|
25
|
+
"minor": [
|
26
|
+
{
|
27
|
+
"author": "sarah.higley@microsoft.com",
|
28
|
+
"package": "@fluentui/react-tabster",
|
29
|
+
"commit": "81b87f41557964f9c9f5601a3eec84434eb74f35",
|
30
|
+
"comment": "fix: move `outlineStyle: none` out of createCustomFocusIndicatorStyle and to createFocusOutlineStyle"
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"author": "beachball",
|
34
|
+
"package": "@fluentui/react-tabster",
|
35
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.4.0",
|
36
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"author": "beachball",
|
40
|
+
"package": "@fluentui/react-tabster",
|
41
|
+
"comment": "Bump @fluentui/react-theme to v9.1.8",
|
42
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"author": "beachball",
|
46
|
+
"package": "@fluentui/react-tabster",
|
47
|
+
"comment": "Bump @fluentui/react-utilities to v9.8.1",
|
48
|
+
"commit": "79c08ce5bbf6387b2b18ba4c3d2d5681e0177d4b"
|
49
|
+
}
|
50
|
+
]
|
51
|
+
}
|
52
|
+
},
|
53
|
+
{
|
54
|
+
"date": "Mon, 17 Apr 2023 17:54:02 GMT",
|
6
55
|
"tag": "@fluentui/react-tabster_v9.6.5",
|
7
56
|
"version": "9.6.5",
|
8
57
|
"comments": {
|
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,28 @@
|
|
1
1
|
# Change Log - @fluentui/react-tabster
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Fri, 12 May 2023 20:22:22 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.7.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.7.0)
|
8
|
+
|
9
|
+
Fri, 12 May 2023 20:22:22 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.6.5..@fluentui/react-tabster_v9.7.0)
|
11
|
+
|
12
|
+
### Minor changes
|
13
|
+
|
14
|
+
- fix: move `outlineStyle: none` out of createCustomFocusIndicatorStyle and to createFocusOutlineStyle ([PR #26089](https://github.com/microsoft/fluentui/pull/26089) by sarah.higley@microsoft.com)
|
15
|
+
- Bump @fluentui/react-shared-contexts to v9.4.0 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
16
|
+
- Bump @fluentui/react-theme to v9.1.8 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
17
|
+
- Bump @fluentui/react-utilities to v9.8.1 ([PR #27827](https://github.com/microsoft/fluentui/pull/27827) by beachball)
|
18
|
+
|
19
|
+
### Patches
|
20
|
+
|
21
|
+
- chore: exclude .swcrc from being published ([PR #27740](https://github.com/microsoft/fluentui/pull/27740) by olfedias@microsoft.com)
|
22
|
+
|
7
23
|
## [9.6.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.6.5)
|
8
24
|
|
9
|
-
Mon, 17 Apr 2023 17:
|
25
|
+
Mon, 17 Apr 2023 17:54:02 GMT
|
10
26
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.6.4..@fluentui/react-tabster_v9.6.5)
|
11
27
|
|
12
28
|
### Patches
|
package/dist/index.d.ts
CHANGED
@@ -18,7 +18,7 @@ export declare function applyFocusVisiblePolyfill(scope: HTMLElement, targetWind
|
|
18
18
|
* @param style - styling applied on focus, defaults to @see getDefaultFocusOutlineStyles
|
19
19
|
* @param options - Configure the style of the focus outline
|
20
20
|
*/
|
21
|
-
export declare function createCustomFocusIndicatorStyle<TStyle extends GriffelStyle | GriffelResetStyle>(style: TStyle, { selector
|
21
|
+
export declare function createCustomFocusIndicatorStyle<TStyle extends GriffelStyle | GriffelResetStyle>(style: TStyle, { selector }?: CreateCustomFocusIndicatorStyleOptions): TStyle extends GriffelStyle ? GriffelStyle : GriffelResetStyle;
|
22
22
|
|
23
23
|
export declare interface CreateCustomFocusIndicatorStyleOptions {
|
24
24
|
/**
|
@@ -29,7 +29,8 @@ export declare interface CreateCustomFocusIndicatorStyleOptions {
|
|
29
29
|
selector?: 'focus' | 'focus-within';
|
30
30
|
/**
|
31
31
|
* Enables the browser default outline style
|
32
|
-
* @
|
32
|
+
* @deprecated The custom focus indicator no longer affects outline styles. Outline is overridden
|
33
|
+
* in the default focus indicator function, `createFocusOutlineStyle`.
|
33
34
|
*/
|
34
35
|
enableOutline?: boolean;
|
35
36
|
}
|
@@ -41,10 +42,14 @@ export declare interface CreateCustomFocusIndicatorStyleOptions {
|
|
41
42
|
* @param options - Configure the style of the focus outline
|
42
43
|
* @returns focus outline styles object for @see makeStyles
|
43
44
|
*/
|
44
|
-
export declare const createFocusOutlineStyle: ({ selector, style, }?: CreateFocusOutlineStyleOptions) => GriffelStyle;
|
45
|
+
export declare const createFocusOutlineStyle: ({ enableOutline, selector, style, }?: CreateFocusOutlineStyleOptions) => GriffelStyle;
|
45
46
|
|
46
|
-
export declare interface CreateFocusOutlineStyleOptions extends CreateCustomFocusIndicatorStyleOptions {
|
47
|
+
export declare interface CreateFocusOutlineStyleOptions extends Omit<CreateCustomFocusIndicatorStyleOptions, 'enableOutline'> {
|
47
48
|
style?: Partial<FocusOutlineStyleOptions>;
|
49
|
+
/**
|
50
|
+
* Enables the browser default outline style
|
51
|
+
*/
|
52
|
+
enableOutline?: boolean;
|
48
53
|
}
|
49
54
|
|
50
55
|
export declare type FocusOutlineOffset = Record<'top' | 'bottom' | 'left' | 'right', string>;
|
@@ -7,16 +7,9 @@ import { defaultOptions, FOCUS_VISIBLE_ATTR, FOCUS_WITHIN_ATTR } from './constan
|
|
7
7
|
* @param options - Configure the style of the focus outline
|
8
8
|
*/
|
9
9
|
export function createCustomFocusIndicatorStyle(style, {
|
10
|
-
selector = defaultOptions.selector
|
11
|
-
enableOutline = false
|
10
|
+
selector = defaultOptions.selector
|
12
11
|
} = defaultOptions) {
|
13
12
|
return {
|
14
|
-
':focus': {
|
15
|
-
outlineStyle: enableOutline ? undefined : 'none'
|
16
|
-
},
|
17
|
-
':focus-visible': {
|
18
|
-
outlineStyle: enableOutline ? undefined : 'none'
|
19
|
-
},
|
20
13
|
...(selector === 'focus' && {
|
21
14
|
[`&[${FOCUS_VISIBLE_ATTR}]`]: style
|
22
15
|
}),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["defaultOptions","FOCUS_VISIBLE_ATTR","FOCUS_WITHIN_ATTR","createCustomFocusIndicatorStyle","style","selector"
|
1
|
+
{"version":3,"names":["defaultOptions","FOCUS_VISIBLE_ATTR","FOCUS_WITHIN_ATTR","createCustomFocusIndicatorStyle","style","selector"],"sources":["../../src/focus/createCustomFocusIndicatorStyle.ts"],"sourcesContent":["import { defaultOptions, FOCUS_VISIBLE_ATTR, FOCUS_WITHIN_ATTR } from './constants';\nimport { makeResetStyles } from '@griffel/react';\nimport type { GriffelStyle } from '@griffel/react';\n\n// TODO: Use the type directly from @griffel/react\n// https://github.com/microsoft/griffel/pull/278\ntype GriffelResetStyle = Parameters<typeof makeResetStyles>[0];\n\nexport interface CreateCustomFocusIndicatorStyleOptions {\n /**\n * Control if the indicator appears when the corresponding element is focused,\n * or any child is focused within the corresponding element.\n * @default 'focus'\n */\n selector?: 'focus' | 'focus-within';\n /**\n * Enables the browser default outline style\n * @deprecated The custom focus indicator no longer affects outline styles. Outline is overridden\n * in the default focus indicator function, `createFocusOutlineStyle`.\n */\n enableOutline?: boolean;\n}\n\n/**\n * Creates a style for @see makeStyles that includes the necessary selectors for focus.\n * Should be used only when @see createFocusOutlineStyle does not fit requirements\n *\n * @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 { selector = defaultOptions.selector }: CreateCustomFocusIndicatorStyleOptions = defaultOptions,\n): TStyle extends GriffelStyle ? GriffelStyle : GriffelResetStyle {\n return {\n ...(selector === 'focus' && {\n [`&[${FOCUS_VISIBLE_ATTR}]`]: style,\n }),\n ...(selector === 'focus-within' && {\n [`&[${FOCUS_WITHIN_ATTR}]:${selector}`]: style,\n }),\n };\n}\n"],"mappings":"AAAA,SAASA,cAAc,EAAEC,kBAAkB,EAAEC,iBAAiB,QAAQ;AAuBtE;;;;;;;AAOA,OAAO,SAASC,gCACdC,KAAa,EACb;EAAEC,QAAA,GAAWL,cAAA,CAAeK;AAAQ,CAA0C,GAAGL,cAAc,EAC/B;EAChE,OAAO;IACL,IAAIK,QAAA,KAAa,WAAW;MAC1B,CAAE,KAAIJ,kBAAmB,GAAE,GAAGG;IAChC,CAAC;IACD,IAAIC,QAAA,KAAa,kBAAkB;MACjC,CAAE,KAAIH,iBAAkB,KAAIG,QAAS,EAAC,GAAGD;IAC3C,CAAC;EACH;AACF"}
|
@@ -46,15 +46,24 @@ const getFocusOutlineStyles = options => {
|
|
46
46
|
* @returns focus outline styles object for @see makeStyles
|
47
47
|
*/
|
48
48
|
export const createFocusOutlineStyle = ({
|
49
|
+
enableOutline = false,
|
49
50
|
selector = defaultOptions.selector,
|
50
51
|
style = defaultOptions.style
|
51
|
-
} = defaultOptions) =>
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
}
|
58
|
-
|
52
|
+
} = defaultOptions) => ({
|
53
|
+
':focus': {
|
54
|
+
outlineStyle: enableOutline ? undefined : 'none'
|
55
|
+
},
|
56
|
+
':focus-visible': {
|
57
|
+
outlineStyle: enableOutline ? undefined : 'none'
|
58
|
+
},
|
59
|
+
...createCustomFocusIndicatorStyle(getFocusOutlineStyles({
|
60
|
+
outlineColor: tokens.colorStrokeFocus2,
|
61
|
+
outlineRadius: tokens.borderRadiusMedium,
|
62
|
+
// FIXME: tokens.strokeWidthThick causes some weird bugs
|
63
|
+
outlineWidth: '2px',
|
64
|
+
...style
|
65
|
+
}), {
|
66
|
+
selector
|
67
|
+
})
|
59
68
|
});
|
60
69
|
//# sourceMappingURL=createFocusOutlineStyle.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["tokens","shorthands","createCustomFocusIndicatorStyle","defaultOptions","getFocusOutlineStyles","options","outlineRadius","outlineColor","outlineOffset","outlineWidth","outlineOffsetTop","top","outlineOffsetBottom","bottom","outlineOffsetLeft","left","outlineOffsetRight","right","borderColor","content","position","pointerEvents","zIndex","borderStyle","borderWidth","borderRadius","createFocusOutlineStyle","selector","style","colorStrokeFocus2","borderRadiusMedium"],"sources":["../../src/focus/createFocusOutlineStyle.ts"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { shorthands } from '@griffel/react';\nimport type { GriffelStyle } from '@griffel/react';\nimport {\n createCustomFocusIndicatorStyle,\n CreateCustomFocusIndicatorStyleOptions,\n} from './createCustomFocusIndicatorStyle';\nimport { defaultOptions } from './constants';\n\nexport type FocusOutlineOffset = Record<'top' | 'bottom' | 'left' | 'right', string>;\nexport type FocusOutlineStyleOptions = {\n /**\n * Only property not supported by the native CSS `outline`, if this is no longer needed\n * we can just go native instead\n */\n outlineRadius: string;\n outlineColor: string;\n outlineWidth: string;\n outlineOffset?: string | FocusOutlineOffset;\n};\nexport interface CreateFocusOutlineStyleOptions extends CreateCustomFocusIndicatorStyleOptions {\n style?: Partial<FocusOutlineStyleOptions>;\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\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 selector = defaultOptions.selector,\n style = defaultOptions.style,\n}: CreateFocusOutlineStyleOptions = defaultOptions): GriffelStyle
|
1
|
+
{"version":3,"names":["tokens","shorthands","createCustomFocusIndicatorStyle","defaultOptions","getFocusOutlineStyles","options","outlineRadius","outlineColor","outlineOffset","outlineWidth","outlineOffsetTop","top","outlineOffsetBottom","bottom","outlineOffsetLeft","left","outlineOffsetRight","right","borderColor","content","position","pointerEvents","zIndex","borderStyle","borderWidth","borderRadius","createFocusOutlineStyle","enableOutline","selector","style","outlineStyle","undefined","colorStrokeFocus2","borderRadiusMedium"],"sources":["../../src/focus/createFocusOutlineStyle.ts"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { shorthands } from '@griffel/react';\nimport type { GriffelStyle } from '@griffel/react';\nimport {\n createCustomFocusIndicatorStyle,\n CreateCustomFocusIndicatorStyleOptions,\n} from './createCustomFocusIndicatorStyle';\nimport { defaultOptions } from './constants';\n\nexport type FocusOutlineOffset = Record<'top' | 'bottom' | 'left' | 'right', string>;\nexport type FocusOutlineStyleOptions = {\n /**\n * Only property not supported by the native CSS `outline`, if this is no longer needed\n * we can just go native instead\n */\n outlineRadius: string;\n outlineColor: string;\n outlineWidth: string;\n outlineOffset?: string | FocusOutlineOffset;\n};\nexport interface CreateFocusOutlineStyleOptions extends Omit<CreateCustomFocusIndicatorStyleOptions, 'enableOutline'> {\n style?: Partial<FocusOutlineStyleOptions>;\n\n /**\n * Enables the browser default outline style\n */\n enableOutline?: boolean;\n}\n\n/**\n * 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\n/**\n * NOTE: The element with the focus outline needs to have `position: relative` so that the\n * pseudo element can be properly positioned.\n *\n * @param options - Configure the style of the focus outline\n * @returns focus outline styles object for @see makeStyles\n */\nexport const createFocusOutlineStyle = ({\n enableOutline = false,\n selector = defaultOptions.selector,\n style = defaultOptions.style,\n}: CreateFocusOutlineStyleOptions = defaultOptions): GriffelStyle => ({\n ':focus': {\n outlineStyle: enableOutline ? undefined : 'none',\n },\n ':focus-visible': {\n outlineStyle: enableOutline ? undefined : 'none',\n },\n\n ...createCustomFocusIndicatorStyle(\n getFocusOutlineStyles({\n outlineColor: tokens.colorStrokeFocus2,\n outlineRadius: tokens.borderRadiusMedium,\n // FIXME: tokens.strokeWidthThick causes some weird bugs\n outlineWidth: '2px',\n ...style,\n }),\n { selector },\n ),\n});\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ;AACvB,SAASC,UAAU,QAAQ;AAE3B,SACEC,+BAA+B,QAE1B;AACP,SAASC,cAAc,QAAQ;AAsB/B;;;;;;;AAOA,MAAMC,qBAAA,GAAyBC,OAAA,IAAoD;EACjF,MAAM;IAAEC,aAAA;IAAeC,YAAA;IAAcC,aAAA;IAAeC;EAAY,CAAE,GAAGJ,OAAA;EAErE,MAAMK,gBAAA,GAAmB,CAAAF,aAAC,aAAAA,aAAA,cAAD,SAAAA,aAAC,CAAsCG,GAAG,KAAIH,aAAA;EACvE,MAAMI,mBAAA,GAAsB,CAAAJ,aAAC,aAAAA,aAAA,cAAD,SAAAA,aAAC,CAAsCK,MAAM,KAAIL,aAAA;EAC7E,MAAMM,iBAAA,GAAoB,CAAAN,aAAC,aAAAA,aAAA,cAAD,SAAAA,aAAC,CAAsCO,IAAI,KAAIP,aAAA;EACzE,MAAMQ,kBAAA,GAAqB,CAAAR,aAAC,aAAAA,aAAA,cAAD,SAAAA,aAAC,CAAsCS,KAAK,KAAIT,aAAA;EAE3E,OAAO;IACL,GAAGP,UAAA,CAAWiB,WAAW,CAAC,cAAc;IAC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 +7,8 @@ Object.defineProperty(exports, "createCustomFocusIndicatorStyle", {
|
|
7
7
|
get: ()=>createCustomFocusIndicatorStyle
|
8
8
|
});
|
9
9
|
const _constants = require("./constants");
|
10
|
-
function createCustomFocusIndicatorStyle(style, { selector =_constants.defaultOptions.selector
|
10
|
+
function createCustomFocusIndicatorStyle(style, { selector =_constants.defaultOptions.selector } = _constants.defaultOptions) {
|
11
11
|
return {
|
12
|
-
':focus': {
|
13
|
-
outlineStyle: enableOutline ? undefined : 'none'
|
14
|
-
},
|
15
|
-
':focus-visible': {
|
16
|
-
outlineStyle: enableOutline ? undefined : 'none'
|
17
|
-
},
|
18
12
|
...selector === 'focus' && {
|
19
13
|
[`&[${_constants.FOCUS_VISIBLE_ATTR}]`]: style
|
20
14
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../lib/focus/createCustomFocusIndicatorStyle.js"],"sourcesContent":["import { defaultOptions, FOCUS_VISIBLE_ATTR, FOCUS_WITHIN_ATTR } from './constants';\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(style, {\n selector = defaultOptions.selector
|
1
|
+
{"version":3,"sources":["../../lib/focus/createCustomFocusIndicatorStyle.js"],"sourcesContent":["import { defaultOptions, FOCUS_VISIBLE_ATTR, FOCUS_WITHIN_ATTR } from './constants';\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(style, {\n selector = defaultOptions.selector\n} = defaultOptions) {\n return {\n ...(selector === 'focus' && {\n [`&[${FOCUS_VISIBLE_ATTR}]`]: style\n }),\n ...(selector === 'focus-within' && {\n [`&[${FOCUS_WITHIN_ATTR}]:${selector}`]: style\n })\n };\n}\n//# sourceMappingURL=createCustomFocusIndicatorStyle.js.map"],"names":["createCustomFocusIndicatorStyle","style","selector","defaultOptions","FOCUS_VISIBLE_ATTR","FOCUS_WITHIN_ATTR"],"mappings":";;;;+BAQgBA;;aAAAA;;2BARsD;AAQ/D,SAASA,gCAAgCC,KAAK,EAAE,EACrDC,UAAWC,yBAAc,CAACD,QAAQ,CAAA,EACnC,GAAGC,yBAAc,EAAE;IAClB,OAAO;QACL,GAAID,aAAa,WAAW;YAC1B,CAAC,CAAC,EAAE,EAAEE,6BAAkB,CAAC,CAAC,CAAC,CAAC,EAAEH;QAChC,CAAC;QACD,GAAIC,aAAa,kBAAkB;YACjC,CAAC,CAAC,EAAE,EAAEG,4BAAiB,CAAC,EAAE,EAAEH,SAAS,CAAC,CAAC,EAAED;QAC3C,CAAC;IACH;AACF,EACA,2DAA2D"}
|
@@ -40,14 +40,22 @@ const _constants = require("./constants");
|
|
40
40
|
}
|
41
41
|
};
|
42
42
|
};
|
43
|
-
const createFocusOutlineStyle = ({ selector =_constants.defaultOptions.selector , style =_constants.defaultOptions.style } = _constants.defaultOptions)=>(
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
43
|
+
const createFocusOutlineStyle = ({ enableOutline =false , selector =_constants.defaultOptions.selector , style =_constants.defaultOptions.style } = _constants.defaultOptions)=>({
|
44
|
+
':focus': {
|
45
|
+
outlineStyle: enableOutline ? undefined : 'none'
|
46
|
+
},
|
47
|
+
':focus-visible': {
|
48
|
+
outlineStyle: enableOutline ? undefined : 'none'
|
49
|
+
},
|
50
|
+
...(0, _createCustomFocusIndicatorStyle.createCustomFocusIndicatorStyle)(getFocusOutlineStyles({
|
51
|
+
outlineColor: _reactTheme.tokens.colorStrokeFocus2,
|
52
|
+
outlineRadius: _reactTheme.tokens.borderRadiusMedium,
|
53
|
+
// FIXME: tokens.strokeWidthThick causes some weird bugs
|
54
|
+
outlineWidth: '2px',
|
55
|
+
...style
|
56
|
+
}), {
|
57
|
+
selector
|
58
|
+
})
|
51
59
|
}); //# sourceMappingURL=createFocusOutlineStyle.js.map
|
52
60
|
|
53
61
|
//# sourceMappingURL=createFocusOutlineStyle.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../lib/focus/createFocusOutlineStyle.js"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { shorthands } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from './createCustomFocusIndicatorStyle';\nimport { defaultOptions } from './constants';\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 => {\n const {\n outlineRadius,\n outlineColor,\n outlineOffset,\n outlineWidth\n } = options;\n const outlineOffsetTop = (outlineOffset === null || outlineOffset === void 0 ? void 0 : outlineOffset.top) || outlineOffset;\n const outlineOffsetBottom = (outlineOffset === null || outlineOffset === void 0 ? void 0 : outlineOffset.bottom) || outlineOffset;\n const outlineOffsetLeft = (outlineOffset === null || outlineOffset === void 0 ? void 0 : outlineOffset.left) || outlineOffset;\n const outlineOffsetRight = (outlineOffset === null || outlineOffset === void 0 ? void 0 : outlineOffset.right) || outlineOffset;\n return {\n ...shorthands.borderColor('transparent'),\n '::after': {\n content: '\"\"',\n position: 'absolute',\n pointerEvents: 'none',\n zIndex: 1,\n ...shorthands.borderStyle('solid'),\n ...shorthands.borderWidth(outlineWidth),\n ...shorthands.borderRadius(outlineRadius),\n ...shorthands.borderColor(outlineColor),\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/**\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 selector = defaultOptions.selector,\n style = defaultOptions.style\n} = defaultOptions) => createCustomFocusIndicatorStyle(getFocusOutlineStyles({\n
|
1
|
+
{"version":3,"sources":["../../lib/focus/createFocusOutlineStyle.js"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { shorthands } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from './createCustomFocusIndicatorStyle';\nimport { defaultOptions } from './constants';\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 => {\n const {\n outlineRadius,\n outlineColor,\n outlineOffset,\n outlineWidth\n } = options;\n const outlineOffsetTop = (outlineOffset === null || outlineOffset === void 0 ? void 0 : outlineOffset.top) || outlineOffset;\n const outlineOffsetBottom = (outlineOffset === null || outlineOffset === void 0 ? void 0 : outlineOffset.bottom) || outlineOffset;\n const outlineOffsetLeft = (outlineOffset === null || outlineOffset === void 0 ? void 0 : outlineOffset.left) || outlineOffset;\n const outlineOffsetRight = (outlineOffset === null || outlineOffset === void 0 ? void 0 : outlineOffset.right) || outlineOffset;\n return {\n ...shorthands.borderColor('transparent'),\n '::after': {\n content: '\"\"',\n position: 'absolute',\n pointerEvents: 'none',\n zIndex: 1,\n ...shorthands.borderStyle('solid'),\n ...shorthands.borderWidth(outlineWidth),\n ...shorthands.borderRadius(outlineRadius),\n ...shorthands.borderColor(outlineColor),\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/**\n * NOTE: The element with the focus outline needs to have `position: relative` so that the\n * pseudo element can be properly positioned.\n *\n * @param options - Configure the style of the focus outline\n * @returns focus outline styles object for @see makeStyles\n */\nexport const createFocusOutlineStyle = ({\n enableOutline = false,\n selector = defaultOptions.selector,\n style = defaultOptions.style\n} = defaultOptions) => ({\n ':focus': {\n outlineStyle: enableOutline ? undefined : 'none'\n },\n ':focus-visible': {\n outlineStyle: enableOutline ? undefined : 'none'\n },\n ...createCustomFocusIndicatorStyle(getFocusOutlineStyles({\n outlineColor: tokens.colorStrokeFocus2,\n outlineRadius: tokens.borderRadiusMedium,\n // FIXME: tokens.strokeWidthThick causes some weird bugs\n outlineWidth: '2px',\n ...style\n }), {\n selector\n })\n});\n//# sourceMappingURL=createFocusOutlineStyle.js.map"],"names":["createFocusOutlineStyle","getFocusOutlineStyles","options","outlineRadius","outlineColor","outlineOffset","outlineWidth","outlineOffsetTop","top","outlineOffsetBottom","bottom","outlineOffsetLeft","left","outlineOffsetRight","right","shorthands","borderColor","content","position","pointerEvents","zIndex","borderStyle","borderWidth","borderRadius","enableOutline","selector","defaultOptions","style","outlineStyle","undefined","createCustomFocusIndicatorStyle","tokens","colorStrokeFocus2","borderRadiusMedium"],"mappings":";;;;+BA+CaA;;aAAAA;;4BA/CU;uBACI;iDACqB;2BACjB;AAC/B;;;;;;CAMC,GACD,MAAMC,wBAAwBC,CAAAA,UAAW;IACvC,MAAM,EACJC,cAAa,EACbC,aAAY,EACZC,cAAa,EACbC,aAAY,EACb,GAAGJ;IACJ,MAAMK,mBAAmB,AAACF,CAAAA,kBAAkB,IAAI,IAAIA,kBAAkB,KAAK,IAAI,KAAK,IAAIA,cAAcG,GA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CAAA,EACrBC,UAAWC,yBAAc,CAACD,QAAQ,CAAA,EAClCE,OAAQD,yBAAc,CAACC,KAAK,CAAA,EAC7B,GAAGD,yBAAc,GAAM,CAAA;QACtB,UAAU;YACRE,cAAcJ,gBAAgBK,YAAY,MAAM;QAClD;QACA,kBAAkB;YAChBD,cAAcJ,gBAAgBK,YAAY,MAAM;QAClD;QACA,GAAGC,IAAAA,gEAA+B,EAAC7B,sBAAsB;YACvDG,cAAc2B,kBAAM,CAACC,iBAAiB;YACtC7B,eAAe4B,kBAAM,CAACE,kBAAkB;YACxC,wDAAwD;YACxD3B,cAAc;YACd,GAAGqB,KAAK;QACV,IAAI;YACFF;QACF,EAAE;IACJ,CAAA,GACA,mDAAmD"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-tabster",
|
3
|
-
"version": "9.
|
3
|
+
"version": "9.7.0",
|
4
4
|
"description": "Utilities for focus management and facade for tabster",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -31,9 +31,9 @@
|
|
31
31
|
},
|
32
32
|
"dependencies": {
|
33
33
|
"@griffel/react": "^1.5.2",
|
34
|
-
"@fluentui/react-shared-contexts": "^9.
|
35
|
-
"@fluentui/react-theme": "^9.1.
|
36
|
-
"@fluentui/react-utilities": "^9.8.
|
34
|
+
"@fluentui/react-shared-contexts": "^9.4.0",
|
35
|
+
"@fluentui/react-theme": "^9.1.8",
|
36
|
+
"@fluentui/react-utilities": "^9.8.1",
|
37
37
|
"@swc/helpers": "^0.4.14",
|
38
38
|
"keyborg": "^2.0.0",
|
39
39
|
"tabster": "^4.1.1"
|
package/.swcrc
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"$schema": "https://json.schemastore.org/swcrc",
|
3
|
-
"exclude": [
|
4
|
-
"/testing",
|
5
|
-
"/**/*.cy.ts",
|
6
|
-
"/**/*.cy.tsx",
|
7
|
-
"/**/*.spec.ts",
|
8
|
-
"/**/*.spec.tsx",
|
9
|
-
"/**/*.test.ts",
|
10
|
-
"/**/*.test.tsx"
|
11
|
-
],
|
12
|
-
"jsc": {
|
13
|
-
"parser": {
|
14
|
-
"syntax": "typescript",
|
15
|
-
"tsx": true,
|
16
|
-
"decorators": false,
|
17
|
-
"dynamicImport": false
|
18
|
-
},
|
19
|
-
"externalHelpers": true,
|
20
|
-
"transform": {
|
21
|
-
"react": {
|
22
|
-
"runtime": "classic",
|
23
|
-
"useSpread": true
|
24
|
-
}
|
25
|
-
},
|
26
|
-
"target": "es2019"
|
27
|
-
},
|
28
|
-
"minify": false,
|
29
|
-
"sourceMaps": true
|
30
|
-
}
|