@fluentui/react-tabster 9.1.3 → 9.2.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 CHANGED
@@ -2,7 +2,108 @@
2
2
  "name": "@fluentui/react-tabster",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 13 Oct 2022 10:59:39 GMT",
5
+ "date": "Wed, 02 Nov 2022 11:55:05 GMT",
6
+ "tag": "@fluentui/react-tabster_v9.2.1",
7
+ "version": "9.2.1",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "marcosvmmoura@gmail.com",
12
+ "package": "@fluentui/react-tabster",
13
+ "commit": "dd1a128086fc22c5402f5e8ddbaeaad181803289",
14
+ "comment": "make allowCondition a optional parameter for findAllFocusable function"
15
+ },
16
+ {
17
+ "author": "olfedias@microsoft.com",
18
+ "package": "@fluentui/react-tabster",
19
+ "commit": "c619ba066f11a8654e95375314824ba6b81b003e",
20
+ "comment": "chore: Update Griffel to latest version"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-tabster",
25
+ "comment": "Bump @fluentui/react-shared-contexts to v9.1.0",
26
+ "commit": "393a7b169155997a97a6ce1ad36ee3eafc6f461b"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-tabster",
31
+ "comment": "Bump @fluentui/react-utilities to v9.2.0",
32
+ "commit": "393a7b169155997a97a6ce1ad36ee3eafc6f461b"
33
+ }
34
+ ]
35
+ }
36
+ },
37
+ {
38
+ "date": "Tue, 25 Oct 2022 00:35:37 GMT",
39
+ "tag": "@fluentui/react-tabster_v9.2.0",
40
+ "version": "9.2.0",
41
+ "comments": {
42
+ "none": [
43
+ {
44
+ "author": "miroslav.stastny@microsoft.com",
45
+ "package": "@fluentui/react-tabster",
46
+ "commit": "6ced976a8d0e6a0e2e207da8fe0eb810e2bd19bc",
47
+ "comment": "Update package readme"
48
+ }
49
+ ]
50
+ }
51
+ },
52
+ {
53
+ "date": "Thu, 20 Oct 2022 08:39:51 GMT",
54
+ "tag": "@fluentui/react-tabster_v9.2.0",
55
+ "version": "9.2.0",
56
+ "comments": {
57
+ "patch": [
58
+ {
59
+ "author": "mgodbolt@microsoft.com",
60
+ "package": "@fluentui/react-tabster",
61
+ "commit": "17096b3137d9d3e7c7443ddc3ce0738b2910a334",
62
+ "comment": "chore: Bump peer deps to support React 18"
63
+ },
64
+ {
65
+ "author": "olfedias@microsoft.com",
66
+ "package": "@fluentui/react-tabster",
67
+ "commit": "06865dada128321804646582f564ee86d835d174",
68
+ "comment": "chore: Update Griffel to latest version"
69
+ },
70
+ {
71
+ "author": "lingfangao@hotmail.com",
72
+ "package": "@fluentui/react-tabster",
73
+ "commit": "bd212e73e6a6e3c92495b793c6e682c24f27b6db",
74
+ "comment": "feat: Disabling default browser outline should be an option"
75
+ }
76
+ ],
77
+ "minor": [
78
+ {
79
+ "author": "lingfangao@hotmail.com",
80
+ "package": "@fluentui/react-tabster",
81
+ "commit": "433209a6b5e8adb7619d3658c1606ec8adb02745",
82
+ "comment": "feat: Bump tabster to 3.0.4"
83
+ },
84
+ {
85
+ "author": "beachball",
86
+ "package": "@fluentui/react-tabster",
87
+ "comment": "Bump @fluentui/react-shared-contexts to v9.0.2",
88
+ "commit": "5ea1372675d910d76cf1b9cbd74d05b7c4e8fcbc"
89
+ },
90
+ {
91
+ "author": "beachball",
92
+ "package": "@fluentui/react-tabster",
93
+ "comment": "Bump @fluentui/react-theme to v9.1.1",
94
+ "commit": "5ea1372675d910d76cf1b9cbd74d05b7c4e8fcbc"
95
+ },
96
+ {
97
+ "author": "beachball",
98
+ "package": "@fluentui/react-tabster",
99
+ "comment": "Bump @fluentui/react-utilities to v9.1.2",
100
+ "commit": "5ea1372675d910d76cf1b9cbd74d05b7c4e8fcbc"
101
+ }
102
+ ]
103
+ }
104
+ },
105
+ {
106
+ "date": "Thu, 13 Oct 2022 11:03:02 GMT",
6
107
  "tag": "@fluentui/react-tabster_v9.1.3",
7
108
  "version": "9.1.3",
8
109
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,42 @@
1
1
  # Change Log - @fluentui/react-tabster
2
2
 
3
- This log was last generated on Thu, 13 Oct 2022 10:59:39 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 02 Nov 2022 11:55:05 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.2.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.2.1)
8
+
9
+ Wed, 02 Nov 2022 11:55:05 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.2.0..@fluentui/react-tabster_v9.2.1)
11
+
12
+ ### Patches
13
+
14
+ - make allowCondition a optional parameter for findAllFocusable function ([PR #25416](https://github.com/microsoft/fluentui/pull/25416) by marcosvmmoura@gmail.com)
15
+ - chore: Update Griffel to latest version ([PR #25412](https://github.com/microsoft/fluentui/pull/25412) by olfedias@microsoft.com)
16
+ - Bump @fluentui/react-shared-contexts to v9.1.0 ([PR #25456](https://github.com/microsoft/fluentui/pull/25456) by beachball)
17
+ - Bump @fluentui/react-utilities to v9.2.0 ([PR #25456](https://github.com/microsoft/fluentui/pull/25456) by beachball)
18
+
19
+ ## [9.2.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.2.0)
20
+
21
+ Thu, 20 Oct 2022 08:39:51 GMT
22
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.1.3..@fluentui/react-tabster_v9.2.0)
23
+
24
+ ### Minor changes
25
+
26
+ - feat: Bump tabster to 3.0.4 ([PR #25294](https://github.com/microsoft/fluentui/pull/25294) by lingfangao@hotmail.com)
27
+ - Bump @fluentui/react-shared-contexts to v9.0.2 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
28
+ - Bump @fluentui/react-theme to v9.1.1 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
29
+ - Bump @fluentui/react-utilities to v9.1.2 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
30
+
31
+ ### Patches
32
+
33
+ - chore: Bump peer deps to support React 18 ([PR #24972](https://github.com/microsoft/fluentui/pull/24972) by mgodbolt@microsoft.com)
34
+ - chore: Update Griffel to latest version ([PR #25212](https://github.com/microsoft/fluentui/pull/25212) by olfedias@microsoft.com)
35
+ - feat: Disabling default browser outline should be an option ([PR #25202](https://github.com/microsoft/fluentui/pull/25202) by lingfangao@hotmail.com)
36
+
7
37
  ## [9.1.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.1.3)
8
38
 
9
- Thu, 13 Oct 2022 10:59:39 GMT
39
+ Thu, 13 Oct 2022 11:03:02 GMT
10
40
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.1.2..@fluentui/react-tabster_v9.1.3)
11
41
 
12
42
  ### Patches
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @fluentui/react-tabster
2
2
 
3
- **Tabster components for [Fluent UI React](https://developer.microsoft.com/en-us/fluentui)**
3
+ **Tabster components for [Fluent UI React](https://react.fluentui.dev)**
4
4
 
5
5
  Library for focus management that leverages [tabster](https://github.com/microsoft/tabster).
6
6
 
package/dist/index.d.ts CHANGED
@@ -17,10 +17,15 @@ export declare function applyFocusVisiblePolyfill(scope: HTMLElement, win: Windo
17
17
  * @param style - styling applied on focus, defaults to @see getDefaultFocusOutlineStyes
18
18
  * @param options - Configure the style of the focus outline
19
19
  */
20
- export declare const createCustomFocusIndicatorStyle: (style: GriffelStyle, { selector }?: CreateCustomFocusIndicatorStyleOptions) => GriffelStyle;
20
+ export declare const createCustomFocusIndicatorStyle: (style: GriffelStyle, { selector, enableOutline, }?: CreateCustomFocusIndicatorStyleOptions) => GriffelStyle;
21
21
 
22
22
  export declare interface CreateCustomFocusIndicatorStyleOptions {
23
23
  selector?: 'focus' | 'focus-within';
24
+ /**
25
+ * Enables the browser default outline style
26
+ * @default false
27
+ */
28
+ enableOutline?: boolean;
24
29
  }
25
30
 
26
31
  /**
@@ -97,7 +102,7 @@ export declare interface UseFocusableGroupOptions {
97
102
  * Returns a set of helper functions that will traverse focusable elements in the context of a root DOM element
98
103
  */
99
104
  export declare const useFocusFinders: () => {
100
- findAllFocusable: (container: HTMLElement, acceptCondition: (el: HTMLElement) => boolean) => HTMLElement[];
105
+ findAllFocusable: (container: HTMLElement, acceptCondition?: ((el: HTMLElement) => boolean) | undefined) => HTMLElement[];
101
106
  findFirstFocusable: (container: HTMLElement) => HTMLElement | null | undefined;
102
107
  findLastFocusable: (container: HTMLElement) => HTMLElement | null | undefined;
103
108
  findNextFocusable: (currentElement: HTMLElement, options?: Pick<Types.FindNextProps, 'container'>) => HTMLElement | null | undefined;
@@ -8,13 +8,14 @@ import { defaultOptions, FOCUS_VISIBLE_ATTR, FOCUS_WITHIN_ATTR } from './constan
8
8
  */
9
9
 
10
10
  export const createCustomFocusIndicatorStyle = (style, {
11
- selector = defaultOptions.selector
11
+ selector = defaultOptions.selector,
12
+ enableOutline = false
12
13
  } = defaultOptions) => ({
13
14
  ':focus': {
14
- outlineStyle: 'none'
15
+ outlineStyle: enableOutline ? undefined : 'none'
15
16
  },
16
17
  ':focus-visible': {
17
- outlineStyle: 'none'
18
+ outlineStyle: enableOutline ? undefined : 'none'
18
19
  },
19
20
  ...(selector === 'focus' && {
20
21
  [`&[${FOCUS_VISIBLE_ATTR}]`]: style
@@ -1 +1 @@
1
- {"version":3,"sources":["focus/createCustomFocusIndicatorStyle.ts"],"names":[],"mappings":"AAAA,SAAS,cAAT,EAAyB,kBAAzB,EAA6C,iBAA7C,QAAsE,aAAtE;AAOA;;;;;;AAMG;;AACH,OAAO,MAAM,+BAA+B,GAAG,CAC7C,KAD6C,EAE7C;EAAE,QAAQ,GAAG,cAAc,CAAC;AAA5B,IAAiF,cAFpC,MAG3B;EAClB,UAAU;IACR,YAAY,EAAE;EADN,CADQ;EAIlB,kBAAkB;IAChB,YAAY,EAAE;EADE,CAJA;EAQlB,IAAI,QAAQ,KAAK,OAAb,IAAwB;IAC1B,CAAC,KAAK,kBAAkB,GAAxB,GAA8B;EADJ,CAA5B,CARkB;EAWlB,IAAI,QAAQ,KAAK,cAAb,IAA+B;IACjC,CAAC,KAAK,iBAAiB,KAAK,QAAQ,EAApC,GAAyC;EADR,CAAnC;AAXkB,CAH2B,CAAxC","sourcesContent":["import { defaultOptions, FOCUS_VISIBLE_ATTR, FOCUS_WITHIN_ATTR } from './constants';\nimport type { GriffelStyle } from '@griffel/react';\n\nexport interface CreateCustomFocusIndicatorStyleOptions {\n selector?: 'focus' | 'focus-within';\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 { selector = defaultOptions.selector }: CreateCustomFocusIndicatorStyleOptions = defaultOptions,\n): GriffelStyle => ({\n ':focus': {\n outlineStyle: 'none',\n },\n ':focus-visible': {\n outlineStyle: '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"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["focus/createCustomFocusIndicatorStyle.ts"],"names":[],"mappings":"AAAA,SAAS,cAAT,EAAyB,kBAAzB,EAA6C,iBAA7C,QAAsE,aAAtE;AAYA;;;;;;AAMG;;AACH,OAAO,MAAM,+BAA+B,GAAG,CAC7C,KAD6C,EAE7C;EACE,QAAQ,GAAG,cAAc,CAAC,QAD5B;EAEE,aAAa,GAAG;AAFlB,IAG4C,cALC,MAM3B;EAClB,UAAU;IACR,YAAY,EAAE,aAAa,GAAG,SAAH,GAAe;EADlC,CADQ;EAIlB,kBAAkB;IAChB,YAAY,EAAE,aAAa,GAAG,SAAH,GAAe;EAD1B,CAJA;EAQlB,IAAI,QAAQ,KAAK,OAAb,IAAwB;IAC1B,CAAC,KAAK,kBAAkB,GAAxB,GAA8B;EADJ,CAA5B,CARkB;EAWlB,IAAI,QAAQ,KAAK,cAAb,IAA+B;IACjC,CAAC,KAAK,iBAAiB,KAAK,QAAQ,EAApC,GAAyC;EADR,CAAnC;AAXkB,CAN2B,CAAxC","sourcesContent":["import { defaultOptions, FOCUS_VISIBLE_ATTR, FOCUS_WITHIN_ATTR } from './constants';\nimport type { GriffelStyle } from '@griffel/react';\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 getDefaultFocusOutlineStyes\n * @param options - Configure the style of the focus outline\n */\nexport const createCustomFocusIndicatorStyle = (\n style: GriffelStyle,\n {\n selector = defaultOptions.selector,\n enableOutline = false,\n }: CreateCustomFocusIndicatorStyleOptions = defaultOptions,\n): GriffelStyle => ({\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"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["hooks/useFocusFinders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,SAAS,UAAT,QAA2B,cAA3B;AAEA;;AAEG;;AACH,OAAO,MAAM,eAAe,GAAG,MAAK;EAClC,MAAM,OAA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CAAP,GAAA,OAAO,CAAE,SAAT,CAAmB,QAAnB,CAA4B;IAAE,cAAF;IAAkB,GAAG;EAArB,CAA5B,CAFsB,EAGxB,CAAC,OAAD,CAHwB,CAA1B;EAMA,OAAO;IACL,gBADK;IAEL,kBAFK;IAGL,iBAHK;IAIL,iBAJK;IAKL;EALK,CAAP;AAOD,CAtCM","sourcesContent":["import * as React from 'react';\nimport { Types as TabsterTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n\n/**\n * Returns a set of helper functions that will traverse focusable elements in the context of a root DOM element\n */\nexport const useFocusFinders = () => {\n const tabster = useTabster();\n\n // Narrow props for now and let need dictate additional props in the future\n const findAllFocusable = React.useCallback(\n (container: HTMLElement, acceptCondition: (el: HTMLElement) => boolean) =>\n tabster?.focusable.findAll({ container, acceptCondition }) || [],\n [tabster],\n );\n\n const findFirstFocusable = React.useCallback(\n (container: HTMLElement) => tabster?.focusable.findFirst({ container }),\n [tabster],\n );\n\n const findLastFocusable = React.useCallback((container: HTMLElement) => tabster?.focusable.findLast({ container }), [\n tabster,\n ]);\n\n const findNextFocusable = React.useCallback(\n (currentElement: HTMLElement, options: Pick<TabsterTypes.FindNextProps, 'container'> = {}) =>\n tabster?.focusable.findNext({ currentElement, ...options }),\n [tabster],\n );\n\n const findPrevFocusable = React.useCallback(\n (currentElement: HTMLElement, options: Pick<TabsterTypes.FindNextProps, 'container'> = {}) =>\n tabster?.focusable.findPrev({ currentElement, ...options }),\n [tabster],\n );\n\n return {\n findAllFocusable,\n findFirstFocusable,\n findLastFocusable,\n findNextFocusable,\n findPrevFocusable,\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["hooks/useFocusFinders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,SAAS,UAAT,QAA2B,cAA3B;AAEA;;AAEG;;AACH,OAAO,MAAM,eAAe,GAAG,MAAK;EAClC,MAAM,OAAO,GAAG,UAAU,EAA1B,CADkC,CAG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AAmB,QAAnB,CAA4B;IAAE,cAAF;IAAkB,GAAG;EAArB,CAA5B,CAFsB,EAGxB,CAAC,OAAD,CAHwB,CAA1B;EAMA,OAAO;IACL,gBADK;IAEL,kBAFK;IAGL,iBAHK;IAIL,iBAJK;IAKL;EALK,CAAP;AAOD,CAtCM","sourcesContent":["import * as React from 'react';\nimport { Types as TabsterTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n\n/**\n * Returns a set of helper functions that will traverse focusable elements in the context of a root DOM element\n */\nexport const useFocusFinders = () => {\n const tabster = useTabster();\n\n // Narrow props for now and let need dictate additional props in the future\n const findAllFocusable = React.useCallback(\n (container: HTMLElement, acceptCondition?: (el: HTMLElement) => boolean) =>\n tabster?.focusable.findAll({ container, acceptCondition }) || [],\n [tabster],\n );\n\n const findFirstFocusable = React.useCallback(\n (container: HTMLElement) => tabster?.focusable.findFirst({ container }),\n [tabster],\n );\n\n const findLastFocusable = React.useCallback((container: HTMLElement) => tabster?.focusable.findLast({ container }), [\n tabster,\n ]);\n\n const findNextFocusable = React.useCallback(\n (currentElement: HTMLElement, options: Pick<TabsterTypes.FindNextProps, 'container'> = {}) =>\n tabster?.focusable.findNext({ currentElement, ...options }),\n [tabster],\n );\n\n const findPrevFocusable = React.useCallback(\n (currentElement: HTMLElement, options: Pick<TabsterTypes.FindNextProps, 'container'> = {}) =>\n tabster?.focusable.findPrev({ currentElement, ...options }),\n [tabster],\n );\n\n return {\n findAllFocusable,\n findFirstFocusable,\n findLastFocusable,\n findNextFocusable,\n findPrevFocusable,\n };\n};\n"],"sourceRoot":"../src/"}
@@ -16,13 +16,14 @@ const constants_1 = /*#__PURE__*/require("./constants");
16
16
 
17
17
 
18
18
  const createCustomFocusIndicatorStyle = (style, {
19
- selector = constants_1.defaultOptions.selector
19
+ selector = constants_1.defaultOptions.selector,
20
+ enableOutline = false
20
21
  } = constants_1.defaultOptions) => ({
21
22
  ':focus': {
22
- outlineStyle: 'none'
23
+ outlineStyle: enableOutline ? undefined : 'none'
23
24
  },
24
25
  ':focus-visible': {
25
- outlineStyle: 'none'
26
+ outlineStyle: enableOutline ? undefined : 'none'
26
27
  },
27
28
  ...(selector === 'focus' && {
28
29
  [`&[${constants_1.FOCUS_VISIBLE_ATTR}]`]: style
@@ -1 +1 @@
1
- {"version":3,"sources":["focus/createCustomFocusIndicatorStyle.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,WAAA,gBAAA,OAAA,CAAA,aAAA,CAAA;AAOA;;;;;;AAMG;;;AACI,MAAM,+BAA+B,GAAG,CAC7C,KAD6C,EAE7C;EAAE,QAAQ,GAAG,WAAA,CAAA,cAAA,CAAe;AAA5B,IAAiF,WAAA,CAAA,cAFpC,MAG3B;EAClB,UAAU;IACR,YAAY,EAAE;EADN,CADQ;EAIlB,kBAAkB;IAChB,YAAY,EAAE;EADE,CAJA;EAQlB,IAAI,QAAQ,KAAK,OAAb,IAAwB;IAC1B,CAAC,KAAK,WAAA,CAAA,kBAAkB,GAAxB,GAA8B;EADJ,CAA5B,CARkB;EAWlB,IAAI,QAAQ,KAAK,cAAb,IAA+B;IACjC,CAAC,KAAK,WAAA,CAAA,iBAAiB,KAAK,QAAQ,EAApC,GAAyC;EADR,CAAnC;AAXkB,CAH2B,CAAxC;;AAAM,OAAA,CAAA,+BAAA,GAA+B,+BAA/B","sourcesContent":["import { defaultOptions, FOCUS_VISIBLE_ATTR, FOCUS_WITHIN_ATTR } from './constants';\nimport type { GriffelStyle } from '@griffel/react';\n\nexport interface CreateCustomFocusIndicatorStyleOptions {\n selector?: 'focus' | 'focus-within';\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 { selector = defaultOptions.selector }: CreateCustomFocusIndicatorStyleOptions = defaultOptions,\n): GriffelStyle => ({\n ':focus': {\n outlineStyle: 'none',\n },\n ':focus-visible': {\n outlineStyle: '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"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["focus/createCustomFocusIndicatorStyle.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,WAAA,gBAAA,OAAA,CAAA,aAAA,CAAA;AAYA;;;;;;AAMG;;;AACI,MAAM,+BAA+B,GAAG,CAC7C,KAD6C,EAE7C;EACE,QAAQ,GAAG,WAAA,CAAA,cAAA,CAAe,QAD5B;EAEE,aAAa,GAAG;AAFlB,IAG4C,WAAA,CAAA,cALC,MAM3B;EAClB,UAAU;IACR,YAAY,EAAE,aAAa,GAAG,SAAH,GAAe;EADlC,CADQ;EAIlB,kBAAkB;IAChB,YAAY,EAAE,aAAa,GAAG,SAAH,GAAe;EAD1B,CAJA;EAQlB,IAAI,QAAQ,KAAK,OAAb,IAAwB;IAC1B,CAAC,KAAK,WAAA,CAAA,kBAAkB,GAAxB,GAA8B;EADJ,CAA5B,CARkB;EAWlB,IAAI,QAAQ,KAAK,cAAb,IAA+B;IACjC,CAAC,KAAK,WAAA,CAAA,iBAAiB,KAAK,QAAQ,EAApC,GAAyC;EADR,CAAnC;AAXkB,CAN2B,CAAxC;;AAAM,OAAA,CAAA,+BAAA,GAA+B,+BAA/B","sourcesContent":["import { defaultOptions, FOCUS_VISIBLE_ATTR, FOCUS_WITHIN_ATTR } from './constants';\nimport type { GriffelStyle } from '@griffel/react';\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 getDefaultFocusOutlineStyes\n * @param options - Configure the style of the focus outline\n */\nexport const createCustomFocusIndicatorStyle = (\n style: GriffelStyle,\n {\n selector = defaultOptions.selector,\n enableOutline = false,\n }: CreateCustomFocusIndicatorStyleOptions = defaultOptions,\n): GriffelStyle => ({\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"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["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;EAClC,MAAM,OAAO,GAAG,YAAA,CAAA,UAAA,EAAhB,CADkC,CAGlC;;EACA,MAAM,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;IAAE,SAAF;IAAa;EAAb,CAA3B,CAAA,KAA8D,EAFzC,EAGvB,CAAC,OAAD,CAHuB,CAAzB;EAMA,MAAM,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;IAAE;EAAF,CAA7B,CADH,EAEzB,CAAC,OAAD,CAFyB,CAA3B;EAKA,MAAM,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;IAAE;EAAF,CAA5B,CAA9C,EAA0F,CAClH,OADkH,CAA1F,CAA1B;EAIA,MAAM,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;IAAE,cAAF;IAAkB,GAAG;EAArB,CAA5B,CAFsB,EAGxB,CAAC,OAAD,CAHwB,CAA1B;EAMA,MAAM,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;IAAE,cAAF;IAAkB,GAAG;EAArB,CAA5B,CAFsB,EAGxB,CAAC,OAAD,CAHwB,CAA1B;EAMA,OAAO;IACL,gBADK;IAEL,kBAFK;IAGL,iBAHK;IAIL,iBAJK;IAKL;EALK,CAAP;AAOD,CAtCM;;AAAM,OAAA,CAAA,eAAA,GAAe,eAAf","sourcesContent":["import * as React from 'react';\nimport { Types as TabsterTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n\n/**\n * Returns a set of helper functions that will traverse focusable elements in the context of a root DOM element\n */\nexport const useFocusFinders = () => {\n const tabster = useTabster();\n\n // Narrow props for now and let need dictate additional props in the future\n const findAllFocusable = React.useCallback(\n (container: HTMLElement, acceptCondition: (el: HTMLElement) => boolean) =>\n tabster?.focusable.findAll({ container, acceptCondition }) || [],\n [tabster],\n );\n\n const findFirstFocusable = React.useCallback(\n (container: HTMLElement) => tabster?.focusable.findFirst({ container }),\n [tabster],\n );\n\n const findLastFocusable = React.useCallback((container: HTMLElement) => tabster?.focusable.findLast({ container }), [\n tabster,\n ]);\n\n const findNextFocusable = React.useCallback(\n (currentElement: HTMLElement, options: Pick<TabsterTypes.FindNextProps, 'container'> = {}) =>\n tabster?.focusable.findNext({ currentElement, ...options }),\n [tabster],\n );\n\n const findPrevFocusable = React.useCallback(\n (currentElement: HTMLElement, options: Pick<TabsterTypes.FindNextProps, 'container'> = {}) =>\n tabster?.focusable.findPrev({ currentElement, ...options }),\n [tabster],\n );\n\n return {\n findAllFocusable,\n findFirstFocusable,\n findLastFocusable,\n findNextFocusable,\n findPrevFocusable,\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["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;EAClC,MAAM,OAAO,GAAG,YAAA,CAAA,UAAA,EAAhB,CADkC,CAGlC;;EACA,MAAM,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;IAAE,SAAF;IAAa;EAAb,CAA3B,CAAA,KAA8D,EAFzC,EAGvB,CAAC,OAAD,CAHuB,CAAzB;EAMA,MAAM,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;IAAE;EAAF,CAA7B,CADH,EAEzB,CAAC,OAAD,CAFyB,CAA3B;EAKA,MAAM,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;IAAE;EAAF,CAA5B,CAA9C,EAA0F,CAClH,OADkH,CAA1F,CAA1B;EAIA,MAAM,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;IAAE,cAAF;IAAkB,GAAG;EAArB,CAA5B,CAFsB,EAGxB,CAAC,OAAD,CAHwB,CAA1B;EAMA,MAAM,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;IAAE,cAAF;IAAkB,GAAG;EAArB,CAA5B,CAFsB,EAGxB,CAAC,OAAD,CAHwB,CAA1B;EAMA,OAAO;IACL,gBADK;IAEL,kBAFK;IAGL,iBAHK;IAIL,iBAJK;IAKL;EALK,CAAP;AAOD,CAtCM;;AAAM,OAAA,CAAA,eAAA,GAAe,eAAf","sourcesContent":["import * as React from 'react';\nimport { Types as TabsterTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n\n/**\n * Returns a set of helper functions that will traverse focusable elements in the context of a root DOM element\n */\nexport const useFocusFinders = () => {\n const tabster = useTabster();\n\n // Narrow props for now and let need dictate additional props in the future\n const findAllFocusable = React.useCallback(\n (container: HTMLElement, acceptCondition?: (el: HTMLElement) => boolean) =>\n tabster?.focusable.findAll({ container, acceptCondition }) || [],\n [tabster],\n );\n\n const findFirstFocusable = React.useCallback(\n (container: HTMLElement) => tabster?.focusable.findFirst({ container }),\n [tabster],\n );\n\n const findLastFocusable = React.useCallback((container: HTMLElement) => tabster?.focusable.findLast({ container }), [\n tabster,\n ]);\n\n const findNextFocusable = React.useCallback(\n (currentElement: HTMLElement, options: Pick<TabsterTypes.FindNextProps, 'container'> = {}) =>\n tabster?.focusable.findNext({ currentElement, ...options }),\n [tabster],\n );\n\n const findPrevFocusable = React.useCallback(\n (currentElement: HTMLElement, options: Pick<TabsterTypes.FindNextProps, 'container'> = {}) =>\n tabster?.focusable.findPrev({ currentElement, ...options }),\n [tabster],\n );\n\n return {\n findAllFocusable,\n findFirstFocusable,\n findLastFocusable,\n findNextFocusable,\n findPrevFocusable,\n };\n};\n"],"sourceRoot":"../src/"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-tabster",
3
- "version": "9.1.3",
3
+ "version": "9.2.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",
@@ -31,19 +31,19 @@
31
31
  "@fluentui/scripts": "^1.0.0"
32
32
  },
33
33
  "dependencies": {
34
- "@griffel/react": "^1.4.0",
35
- "@fluentui/react-shared-contexts": "^9.0.1",
36
- "@fluentui/react-theme": "^9.1.0",
37
- "@fluentui/react-utilities": "^9.1.1",
34
+ "@griffel/react": "^1.4.2",
35
+ "@fluentui/react-shared-contexts": "^9.1.0",
36
+ "@fluentui/react-theme": "^9.1.1",
37
+ "@fluentui/react-utilities": "^9.2.0",
38
38
  "keyborg": "^1.2.1",
39
- "tabster": "^2.1.2",
39
+ "tabster": "^3.0.4",
40
40
  "tslib": "^2.1.0"
41
41
  },
42
42
  "peerDependencies": {
43
- "@types/react": ">=16.8.0 <18.0.0",
44
- "@types/react-dom": ">=16.8.0 <18.0.0",
45
- "react": ">=16.8.0 <18.0.0",
46
- "react-dom": ">=16.8.0 <18.0.0"
43
+ "@types/react": ">=16.8.0 <19.0.0",
44
+ "@types/react-dom": ">=16.8.0 <19.0.0",
45
+ "react": ">=16.8.0 <19.0.0",
46
+ "react-dom": ">=16.8.0 <19.0.0"
47
47
  },
48
48
  "beachball": {
49
49
  "disallowedChangeTypes": [