@fluentui/react-tabster 0.0.0-nightly-20220623-0419.1 → 0.0.0-nightly-20220629-1444.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,42 +2,143 @@
2
2
  "name": "@fluentui/react-tabster",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 23 Jun 2022 04:31:23 GMT",
6
- "tag": "@fluentui/react-tabster_v0.0.0-nightly-20220623-0419.1",
7
- "version": "0.0.0-nightly-20220623-0419.1",
5
+ "date": "Wed, 29 Jun 2022 14:56:21 GMT",
6
+ "tag": "@fluentui/react-tabster_v0.0.0-nightly-20220629-1444.1",
7
+ "version": "0.0.0-nightly-20220629-1444.1",
8
8
  "comments": {
9
- "none": [
9
+ "prerelease": [
10
+ {
11
+ "author": "email not defined",
12
+ "package": "@fluentui/react-tabster",
13
+ "commit": "not available",
14
+ "comment": "Release nightly v9"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-tabster",
19
+ "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20220629-1444.1",
20
+ "commit": "69fd45674774a9e2e90bb9fcb472a7d0b13aeafd"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-tabster",
25
+ "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20220629-1444.1",
26
+ "commit": "69fd45674774a9e2e90bb9fcb472a7d0b13aeafd"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-tabster",
31
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20220629-1444.1",
32
+ "commit": "69fd45674774a9e2e90bb9fcb472a7d0b13aeafd"
33
+ }
34
+ ]
35
+ }
36
+ },
37
+ {
38
+ "date": "Tue, 28 Jun 2022 17:39:53 GMT",
39
+ "tag": "@fluentui/react-tabster_v9.0.1",
40
+ "version": "9.0.1",
41
+ "comments": {
42
+ "patch": [
10
43
  {
11
44
  "author": "lingfangao@hotmail.com",
12
45
  "package": "@fluentui/react-tabster",
13
- "commit": "2da2d47e3dac6f8f4396ab112ab80b1dd34cc9ac",
14
- "comment": "Bump cypress to v10"
46
+ "commit": "3deda1fbbfb6ac2b1ad150d4dc6343f1f7fda85b",
47
+ "comment": "fix: Use caret dependency range for Griffel"
15
48
  }
16
- ],
49
+ ]
50
+ }
51
+ },
52
+ {
53
+ "date": "Tue, 28 Jun 2022 15:13:17 GMT",
54
+ "tag": "@fluentui/react-tabster_v9.0.0",
55
+ "version": "9.0.0",
56
+ "comments": {
17
57
  "prerelease": [
58
+ {
59
+ "author": "lingfangao@hotmail.com",
60
+ "package": "@fluentui/react-tabster",
61
+ "commit": "2da4428ae7d6e464c538b7ed10e425ce0e531144",
62
+ "comment": "chore: Mark teams-prg owned APIs with @internal"
63
+ },
18
64
  {
19
65
  "author": "Humberto.Morimoto@microsoft.com",
20
66
  "package": "@fluentui/react-tabster",
21
67
  "commit": "09f58dcbef2306875046261dc0b7821283ccc287",
22
68
  "comment": "chore: Using ::before and ::after instead of :before and :after."
23
69
  },
70
+ {
71
+ "author": "lingfangao@hotmail.com",
72
+ "package": "@fluentui/react-tabster",
73
+ "commit": "675acea49c97f10837ddee9b8c4350ca27750125",
74
+ "comment": "Bump Griffel dependencies"
75
+ },
76
+ {
77
+ "author": "lingfangao@hotmail.com",
78
+ "package": "@fluentui/react-tabster",
79
+ "commit": "e0aabd850b15adf9c151ebd4e332f7c50ad6cfdf",
80
+ "comment": "Update 9.0.0-rc dependencies to use caret range"
81
+ },
82
+ {
83
+ "author": "lingfangao@hotmail.com",
84
+ "package": "@fluentui/react-tabster",
85
+ "commit": "02ee30f8ef173f3a1d2c0c73bcdaef8abae5c055",
86
+ "comment": "feat: Add new `legacyTrapFocus` option to `useModalAttributes`"
87
+ }
88
+ ],
89
+ "none": [
90
+ {
91
+ "author": "lingfangao@hotmail.com",
92
+ "package": "@fluentui/react-tabster",
93
+ "commit": "2da2d47e3dac6f8f4396ab112ab80b1dd34cc9ac",
94
+ "comment": "Bump cypress to v10"
95
+ }
96
+ ],
97
+ "patch": [
98
+ {
99
+ "author": "lingfangao@hotmail.com",
100
+ "package": "@fluentui/react-tabster",
101
+ "commit": "c7b1348bdad7aa883c29bfbc96ef2a32e6ebc7dd",
102
+ "comment": "feat: Initial 9.0.0 release"
103
+ },
24
104
  {
25
105
  "author": "beachball",
26
106
  "package": "@fluentui/react-tabster",
27
- "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20220623-0419.1",
28
- "commit": "9df169f017c97b7fe34f7b7618e4a29baf38b22b"
107
+ "comment": "Bump @fluentui/react-shared-contexts to v9.0.0",
108
+ "commit": "ba6c5d651559b91c815429c9a9357c4d5a390f3e"
29
109
  },
30
110
  {
31
111
  "author": "beachball",
32
112
  "package": "@fluentui/react-tabster",
33
- "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20220623-0419.1",
34
- "commit": "9df169f017c97b7fe34f7b7618e4a29baf38b22b"
113
+ "comment": "Bump @fluentui/react-theme to v9.0.0",
114
+ "commit": "ba6c5d651559b91c815429c9a9357c4d5a390f3e"
115
+ },
116
+ {
117
+ "author": "beachball",
118
+ "package": "@fluentui/react-tabster",
119
+ "comment": "Bump @fluentui/react-utilities to v9.0.0",
120
+ "commit": "ba6c5d651559b91c815429c9a9357c4d5a390f3e"
121
+ }
122
+ ]
123
+ }
124
+ },
125
+ {
126
+ "date": "Thu, 23 Jun 2022 14:25:31 GMT",
127
+ "tag": "@fluentui/react-tabster_v9.0.0-rc.14",
128
+ "version": "9.0.0-rc.14",
129
+ "comments": {
130
+ "prerelease": [
131
+ {
132
+ "author": "beachball",
133
+ "package": "@fluentui/react-tabster",
134
+ "comment": "Bump @fluentui/react-shared-contexts to v9.0.0-rc.11",
135
+ "commit": "b00790b7a0ea1473d8c3cc49c7ca0088002957ed"
35
136
  },
36
137
  {
37
138
  "author": "beachball",
38
139
  "package": "@fluentui/react-tabster",
39
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20220623-0419.1",
40
- "commit": "9df169f017c97b7fe34f7b7618e4a29baf38b22b"
140
+ "comment": "Bump @fluentui/react-theme to v9.0.0-rc.10",
141
+ "commit": "b00790b7a0ea1473d8c3cc49c7ca0088002957ed"
41
142
  }
42
143
  ]
43
144
  }
package/CHANGELOG.md CHANGED
@@ -1,20 +1,59 @@
1
1
  # Change Log - @fluentui/react-tabster
2
2
 
3
- This log was last generated on Thu, 23 Jun 2022 04:31:23 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 29 Jun 2022 14:56:21 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20220623-0419.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v0.0.0-nightly-20220623-0419.1)
7
+ ## [0.0.0-nightly-20220629-1444.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v0.0.0-nightly-20220629-1444.1)
8
8
 
9
- Thu, 23 Jun 2022 04:31:23 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.0.0-rc.13..@fluentui/react-tabster_v0.0.0-nightly-20220623-0419.1)
9
+ Wed, 29 Jun 2022 14:56:21 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.0.1..@fluentui/react-tabster_v0.0.0-nightly-20220629-1444.1)
11
11
 
12
12
  ### Changes
13
13
 
14
+ - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by email not defined)
15
+ - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20220629-1444.1 ([commit](https://github.com/microsoft/fluentui/commit/69fd45674774a9e2e90bb9fcb472a7d0b13aeafd) by beachball)
16
+ - Bump @fluentui/react-theme to v0.0.0-nightly-20220629-1444.1 ([commit](https://github.com/microsoft/fluentui/commit/69fd45674774a9e2e90bb9fcb472a7d0b13aeafd) by beachball)
17
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20220629-1444.1 ([commit](https://github.com/microsoft/fluentui/commit/69fd45674774a9e2e90bb9fcb472a7d0b13aeafd) by beachball)
18
+
19
+ ## [9.0.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.0.1)
20
+
21
+ Tue, 28 Jun 2022 17:39:53 GMT
22
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.0.0..@fluentui/react-tabster_v9.0.1)
23
+
24
+ ### Patches
25
+
26
+ - fix: Use caret dependency range for Griffel ([PR #23754](https://github.com/microsoft/fluentui/pull/23754) by lingfangao@hotmail.com)
27
+
28
+ ## [9.0.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.0.0)
29
+
30
+ Tue, 28 Jun 2022 15:13:17 GMT
31
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.0.0-rc.14..@fluentui/react-tabster_v9.0.0)
32
+
33
+ ### Patches
34
+
35
+ - feat: Initial 9.0.0 release ([PR #23733](https://github.com/microsoft/fluentui/pull/23733) by lingfangao@hotmail.com)
36
+ - Bump @fluentui/react-shared-contexts to v9.0.0 ([commit](https://github.com/microsoft/fluentui/commit/ba6c5d651559b91c815429c9a9357c4d5a390f3e) by beachball)
37
+ - Bump @fluentui/react-theme to v9.0.0 ([commit](https://github.com/microsoft/fluentui/commit/ba6c5d651559b91c815429c9a9357c4d5a390f3e) by beachball)
38
+ - Bump @fluentui/react-utilities to v9.0.0 ([commit](https://github.com/microsoft/fluentui/commit/ba6c5d651559b91c815429c9a9357c4d5a390f3e) by beachball)
39
+
40
+ ### Changes
41
+
42
+ - chore: Mark teams-prg owned APIs with @internal ([PR #23689](https://github.com/microsoft/fluentui/pull/23689) by lingfangao@hotmail.com)
14
43
  - chore: Using ::before and ::after instead of :before and :after. ([PR #23469](https://github.com/microsoft/fluentui/pull/23469) by Humberto.Morimoto@microsoft.com)
15
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20220623-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/9df169f017c97b7fe34f7b7618e4a29baf38b22b) by beachball)
16
- - Bump @fluentui/react-theme to v0.0.0-nightly-20220623-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/9df169f017c97b7fe34f7b7618e4a29baf38b22b) by beachball)
17
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20220623-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/9df169f017c97b7fe34f7b7618e4a29baf38b22b) by beachball)
44
+ - Bump Griffel dependencies ([PR #23688](https://github.com/microsoft/fluentui/pull/23688) by lingfangao@hotmail.com)
45
+ - Update 9.0.0-rc dependencies to use caret range ([PR #23732](https://github.com/microsoft/fluentui/pull/23732) by lingfangao@hotmail.com)
46
+ - feat: Add new `legacyTrapFocus` option to `useModalAttributes` ([PR #23598](https://github.com/microsoft/fluentui/pull/23598) by lingfangao@hotmail.com)
47
+
48
+ ## [9.0.0-rc.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.0.0-rc.14)
49
+
50
+ Thu, 23 Jun 2022 14:25:31 GMT
51
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.0.0-rc.13..@fluentui/react-tabster_v9.0.0-rc.14)
52
+
53
+ ### Changes
54
+
55
+ - Bump @fluentui/react-shared-contexts to v9.0.0-rc.11 ([PR #23608](https://github.com/microsoft/fluentui/pull/23608) by beachball)
56
+ - Bump @fluentui/react-theme to v9.0.0-rc.10 ([PR #23608](https://github.com/microsoft/fluentui/pull/23608) by beachball)
18
57
 
19
58
  ## [9.0.0-rc.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.0.0-rc.13)
20
59
 
package/dist/index.d.ts CHANGED
@@ -113,9 +113,19 @@ export declare const useModalAttributes: (options?: UseModalAttributesOptions) =
113
113
 
114
114
  export declare interface UseModalAttributesOptions {
115
115
  /**
116
- * Traps focus inside the elements the attributes are applied
116
+ * Traps focus inside the elements the attributes are applied.
117
+ * Prefer this to `legacyTrapFocus`
118
+ * it forbids users to tab out of the focus trap into the actual browser.
117
119
  */
118
120
  trapFocus?: boolean;
121
+ /**
122
+ * Traps focus inside the elements the attributes are applied.
123
+ * This prop enables legacy behavior to match previous versions of Fluent and is not
124
+ * recommended for general use.
125
+ * Enabling `legacyTrapFocus` prevents users from tabbing out of the focus trap and into
126
+ * the actual browser. Prefer using `trapFocus` instead of this prop.
127
+ */
128
+ legacyTrapFocus?: boolean;
119
129
  /**
120
130
  * Always reachabled in Tab order
121
131
  */
@@ -123,6 +133,7 @@ export declare interface UseModalAttributesOptions {
123
133
  }
124
134
 
125
135
  /**
136
+ * @internal
126
137
  * Hook that returns tabster attributes while ensuring tabster exists
127
138
  */
128
139
  export declare const useTabsterAttributes: (props: Types.TabsterAttributeProps) => Types.TabsterDOMAttribute;
@@ -13,7 +13,8 @@ import { useTabster } from './useTabster';
13
13
  export const useModalAttributes = (options = {}) => {
14
14
  const {
15
15
  trapFocus,
16
- alwaysFocusable
16
+ alwaysFocusable,
17
+ legacyTrapFocus
17
18
  } = options;
18
19
  const tabster = useTabster(); // Initializes the modalizer and deloser APIs
19
20
 
@@ -28,7 +29,8 @@ export const useModalAttributes = (options = {}) => {
28
29
  modalizer: {
29
30
  id,
30
31
  isOthersAccessible: !trapFocus,
31
- isAlwaysAccessible: alwaysFocusable
32
+ isAlwaysAccessible: alwaysFocusable,
33
+ isTrapped: legacyTrapFocus
32
34
  }
33
35
  });
34
36
  const triggerAttributes = useTabsterAttributes({
@@ -1 +1 @@
1
- {"version":3,"sources":["hooks/useModalAttributes.ts"],"names":[],"mappings":"AAAA,SAAS,KAAT,QAAsB,2BAAtB;AACA,SAAS,oBAAT,QAAqC,wBAArC;AACA,SAAS,UAAT,EAAqB,YAArB,QAAgE,SAAhE;AACA,SAAS,UAAT,QAA2B,cAA3B;AAcA;;;;;;AAMG;;AACH,OAAO,MAAM,kBAAkB,GAAG,CAChC,OAAA,GAAqC,EADL,KAE8E;EAC9G,MAAM;IAAE,SAAF;IAAa;EAAb,IAAiC,OAAvC;EACA,MAAM,OAAO,GAAG,UAAU,EAA1B,CAF8G,CAG9G;;EACA,IAAI,OAAJ,EAAa;IACX,YAAY,CAAC,OAAD,CAAZ;IACA,UAAU,CAAC,OAAD,CAAV;EACD;;EAED,MAAM,EAAE,GAAG,KAAK,CAAC,QAAD,CAAhB;EACA,MAAM,eAAe,GAAG,oBAAoB,CAAC;IAC3C,OAAO,EAAE,EADkC;IAE3C,SAAS,EAAE;MAAE,EAAF;MAAM,kBAAkB,EAAE,CAAC,SAA3B;MAAsC,kBAAkB,EAAE;IAA1D;EAFgC,CAAD,CAA5C;EAKA,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;IAC7C,OAAO,EAAE;EADoC,CAAD,CAA9C;EAIA,OAAO;IAAE,eAAF;IAAmB;EAAnB,CAAP;AACD,CAtBM","sourcesContent":["import { useId } from '@fluentui/react-utilities';\nimport { useTabsterAttributes } from './useTabsterAttributes';\nimport { getDeloser, getModalizer, Types as TabsterTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n\nexport interface UseModalAttributesOptions {\n /**\n * Traps focus inside the elements the attributes are applied\n */\n trapFocus?: boolean;\n\n /**\n * Always reachabled in Tab order\n */\n alwaysFocusable?: boolean;\n}\n\n/**\n * Applies modal dialog behaviour through DOM attributes\n * Modal element will focus trap and hide other content on the page\n * The trigger element will be focused if focus is lost after the modal element is removed\n *\n * @returns DOM attributes to apply to the modal element and its trigger\n */\nexport const useModalAttributes = (\n options: UseModalAttributesOptions = {},\n): { modalAttributes: TabsterTypes.TabsterDOMAttribute; triggerAttributes: TabsterTypes.TabsterDOMAttribute } => {\n const { trapFocus, alwaysFocusable } = options;\n const tabster = useTabster();\n // Initializes the modalizer and deloser APIs\n if (tabster) {\n getModalizer(tabster);\n getDeloser(tabster);\n }\n\n const id = useId('modal-');\n const modalAttributes = useTabsterAttributes({\n deloser: {},\n modalizer: { id, isOthersAccessible: !trapFocus, isAlwaysAccessible: alwaysFocusable },\n });\n\n const triggerAttributes = useTabsterAttributes({\n deloser: {},\n });\n\n return { modalAttributes, triggerAttributes };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["hooks/useModalAttributes.ts"],"names":[],"mappings":"AAAA,SAAS,KAAT,QAAsB,2BAAtB;AACA,SAAS,oBAAT,QAAqC,wBAArC;AACA,SAAS,UAAT,EAAqB,YAArB,QAAgE,SAAhE;AACA,SAAS,UAAT,QAA2B,cAA3B;AAyBA;;;;;;AAMG;;AACH,OAAO,MAAM,kBAAkB,GAAG,CAChC,OAAA,GAAqC,EADL,KAE8E;EAC9G,MAAM;IAAE,SAAF;IAAa,eAAb;IAA8B;EAA9B,IAAkD,OAAxD;EACA,MAAM,OAAO,GAAG,UAAU,EAA1B,CAF8G,CAG9G;;EACA,IAAI,OAAJ,EAAa;IACX,YAAY,CAAC,OAAD,CAAZ;IACA,UAAU,CAAC,OAAD,CAAV;EACD;;EAED,MAAM,EAAE,GAAG,KAAK,CAAC,QAAD,CAAhB;EACA,MAAM,eAAe,GAAG,oBAAoB,CAAC;IAC3C,OAAO,EAAE,EADkC;IAE3C,SAAS,EAAE;MACT,EADS;MAET,kBAAkB,EAAE,CAAC,SAFZ;MAGT,kBAAkB,EAAE,eAHX;MAIT,SAAS,EAAE;IAJF;EAFgC,CAAD,CAA5C;EAUA,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;IAC7C,OAAO,EAAE;EADoC,CAAD,CAA9C;EAIA,OAAO;IAAE,eAAF;IAAmB;EAAnB,CAAP;AACD,CA3BM","sourcesContent":["import { useId } from '@fluentui/react-utilities';\nimport { useTabsterAttributes } from './useTabsterAttributes';\nimport { getDeloser, getModalizer, Types as TabsterTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n\nexport interface UseModalAttributesOptions {\n /**\n * Traps focus inside the elements the attributes are applied.\n * Prefer this to `legacyTrapFocus`\n * it forbids users to tab out of the focus trap into the actual browser.\n */\n trapFocus?: boolean;\n\n /**\n * Traps focus inside the elements the attributes are applied.\n * This prop enables legacy behavior to match previous versions of Fluent and is not\n * recommended for general use.\n * Enabling `legacyTrapFocus` prevents users from tabbing out of the focus trap and into\n * the actual browser. Prefer using `trapFocus` instead of this prop.\n */\n legacyTrapFocus?: boolean;\n\n /**\n * Always reachabled in Tab order\n */\n alwaysFocusable?: boolean;\n}\n\n/**\n * Applies modal dialog behaviour through DOM attributes\n * Modal element will focus trap and hide other content on the page\n * The trigger element will be focused if focus is lost after the modal element is removed\n *\n * @returns DOM attributes to apply to the modal element and its trigger\n */\nexport const useModalAttributes = (\n options: UseModalAttributesOptions = {},\n): { modalAttributes: TabsterTypes.TabsterDOMAttribute; triggerAttributes: TabsterTypes.TabsterDOMAttribute } => {\n const { trapFocus, alwaysFocusable, legacyTrapFocus } = options;\n const tabster = useTabster();\n // Initializes the modalizer and deloser APIs\n if (tabster) {\n getModalizer(tabster);\n getDeloser(tabster);\n }\n\n const id = useId('modal-');\n const modalAttributes = useTabsterAttributes({\n deloser: {},\n modalizer: {\n id,\n isOthersAccessible: !trapFocus,\n isAlwaysAccessible: alwaysFocusable,\n isTrapped: legacyTrapFocus,\n },\n });\n\n const triggerAttributes = useTabsterAttributes({\n deloser: {},\n });\n\n return { modalAttributes, triggerAttributes };\n};\n"],"sourceRoot":"../src/"}
@@ -1,6 +1,7 @@
1
1
  import { getTabsterAttribute } from 'tabster';
2
2
  import { useTabster } from './useTabster';
3
3
  /**
4
+ * @internal
4
5
  * Hook that returns tabster attributes while ensuring tabster exists
5
6
  */
6
7
 
@@ -1 +1 @@
1
- {"version":3,"sources":["hooks/useTabsterAttributes.ts"],"names":[],"mappings":"AAAA,SAAS,mBAAT,QAA2D,SAA3D;AACA,SAAS,UAAT,QAA2B,cAA3B;AAEA;;AAEG;;AACH,OAAO,MAAM,oBAAoB,GAAI,KAAD,IAAgF;EAClH;EACA;EACA,UAAU;EAEV,OAAO,mBAAmB,CAAC,KAAD,CAA1B;AACD,CANM","sourcesContent":["import { getTabsterAttribute, Types as TabsterTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n\n/**\n * Hook that returns tabster attributes while ensuring tabster exists\n */\nexport const useTabsterAttributes = (props: TabsterTypes.TabsterAttributeProps): TabsterTypes.TabsterDOMAttribute => {\n // A tabster instance is not necessary to generate tabster attributes\n // but calling the hook will ensure that a tabster instance exists internally and avoids consumers doing the same\n useTabster();\n\n return getTabsterAttribute(props);\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["hooks/useTabsterAttributes.ts"],"names":[],"mappings":"AAAA,SAAS,mBAAT,QAA2D,SAA3D;AACA,SAAS,UAAT,QAA2B,cAA3B;AAEA;;;AAGG;;AACH,OAAO,MAAM,oBAAoB,GAAI,KAAD,IAAgF;EAClH;EACA;EACA,UAAU;EAEV,OAAO,mBAAmB,CAAC,KAAD,CAA1B;AACD,CANM","sourcesContent":["import { getTabsterAttribute, Types as TabsterTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n\n/**\n * @internal\n * Hook that returns tabster attributes while ensuring tabster exists\n */\nexport const useTabsterAttributes = (props: TabsterTypes.TabsterAttributeProps): TabsterTypes.TabsterDOMAttribute => {\n // A tabster instance is not necessary to generate tabster attributes\n // but calling the hook will ensure that a tabster instance exists internally and avoids consumers doing the same\n useTabster();\n\n return getTabsterAttribute(props);\n};\n"],"sourceRoot":"../src/"}
@@ -24,7 +24,8 @@ const useTabster_1 = /*#__PURE__*/require("./useTabster");
24
24
  const useModalAttributes = (options = {}) => {
25
25
  const {
26
26
  trapFocus,
27
- alwaysFocusable
27
+ alwaysFocusable,
28
+ legacyTrapFocus
28
29
  } = options;
29
30
  const tabster = useTabster_1.useTabster(); // Initializes the modalizer and deloser APIs
30
31
 
@@ -39,7 +40,8 @@ const useModalAttributes = (options = {}) => {
39
40
  modalizer: {
40
41
  id,
41
42
  isOthersAccessible: !trapFocus,
42
- isAlwaysAccessible: alwaysFocusable
43
+ isAlwaysAccessible: alwaysFocusable,
44
+ isTrapped: legacyTrapFocus
43
45
  }
44
46
  });
45
47
  const triggerAttributes = useTabsterAttributes_1.useTabsterAttributes({
@@ -1 +1 @@
1
- {"version":3,"sources":["hooks/useModalAttributes.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,MAAA,SAAA,gBAAA,OAAA,CAAA,SAAA,CAAA;;AACA,MAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;AAcA;;;;;;AAMG;;;AACI,MAAM,kBAAkB,GAAG,CAChC,OAAA,GAAqC,EADL,KAE8E;EAC9G,MAAM;IAAE,SAAF;IAAa;EAAb,IAAiC,OAAvC;EACA,MAAM,OAAO,GAAG,YAAA,CAAA,UAAA,EAAhB,CAF8G,CAG9G;;EACA,IAAI,OAAJ,EAAa;IACX,SAAA,CAAA,YAAA,CAAa,OAAb;IACA,SAAA,CAAA,UAAA,CAAW,OAAX;EACD;;EAED,MAAM,EAAE,GAAG,iBAAA,CAAA,KAAA,CAAM,QAAN,CAAX;EACA,MAAM,eAAe,GAAG,sBAAA,CAAA,oBAAA,CAAqB;IAC3C,OAAO,EAAE,EADkC;IAE3C,SAAS,EAAE;MAAE,EAAF;MAAM,kBAAkB,EAAE,CAAC,SAA3B;MAAsC,kBAAkB,EAAE;IAA1D;EAFgC,CAArB,CAAxB;EAKA,MAAM,iBAAiB,GAAG,sBAAA,CAAA,oBAAA,CAAqB;IAC7C,OAAO,EAAE;EADoC,CAArB,CAA1B;EAIA,OAAO;IAAE,eAAF;IAAmB;EAAnB,CAAP;AACD,CAtBM;;AAAM,OAAA,CAAA,kBAAA,GAAkB,kBAAlB","sourcesContent":["import { useId } from '@fluentui/react-utilities';\nimport { useTabsterAttributes } from './useTabsterAttributes';\nimport { getDeloser, getModalizer, Types as TabsterTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n\nexport interface UseModalAttributesOptions {\n /**\n * Traps focus inside the elements the attributes are applied\n */\n trapFocus?: boolean;\n\n /**\n * Always reachabled in Tab order\n */\n alwaysFocusable?: boolean;\n}\n\n/**\n * Applies modal dialog behaviour through DOM attributes\n * Modal element will focus trap and hide other content on the page\n * The trigger element will be focused if focus is lost after the modal element is removed\n *\n * @returns DOM attributes to apply to the modal element and its trigger\n */\nexport const useModalAttributes = (\n options: UseModalAttributesOptions = {},\n): { modalAttributes: TabsterTypes.TabsterDOMAttribute; triggerAttributes: TabsterTypes.TabsterDOMAttribute } => {\n const { trapFocus, alwaysFocusable } = options;\n const tabster = useTabster();\n // Initializes the modalizer and deloser APIs\n if (tabster) {\n getModalizer(tabster);\n getDeloser(tabster);\n }\n\n const id = useId('modal-');\n const modalAttributes = useTabsterAttributes({\n deloser: {},\n modalizer: { id, isOthersAccessible: !trapFocus, isAlwaysAccessible: alwaysFocusable },\n });\n\n const triggerAttributes = useTabsterAttributes({\n deloser: {},\n });\n\n return { modalAttributes, triggerAttributes };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["hooks/useModalAttributes.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,MAAA,SAAA,gBAAA,OAAA,CAAA,SAAA,CAAA;;AACA,MAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;AAyBA;;;;;;AAMG;;;AACI,MAAM,kBAAkB,GAAG,CAChC,OAAA,GAAqC,EADL,KAE8E;EAC9G,MAAM;IAAE,SAAF;IAAa,eAAb;IAA8B;EAA9B,IAAkD,OAAxD;EACA,MAAM,OAAO,GAAG,YAAA,CAAA,UAAA,EAAhB,CAF8G,CAG9G;;EACA,IAAI,OAAJ,EAAa;IACX,SAAA,CAAA,YAAA,CAAa,OAAb;IACA,SAAA,CAAA,UAAA,CAAW,OAAX;EACD;;EAED,MAAM,EAAE,GAAG,iBAAA,CAAA,KAAA,CAAM,QAAN,CAAX;EACA,MAAM,eAAe,GAAG,sBAAA,CAAA,oBAAA,CAAqB;IAC3C,OAAO,EAAE,EADkC;IAE3C,SAAS,EAAE;MACT,EADS;MAET,kBAAkB,EAAE,CAAC,SAFZ;MAGT,kBAAkB,EAAE,eAHX;MAIT,SAAS,EAAE;IAJF;EAFgC,CAArB,CAAxB;EAUA,MAAM,iBAAiB,GAAG,sBAAA,CAAA,oBAAA,CAAqB;IAC7C,OAAO,EAAE;EADoC,CAArB,CAA1B;EAIA,OAAO;IAAE,eAAF;IAAmB;EAAnB,CAAP;AACD,CA3BM;;AAAM,OAAA,CAAA,kBAAA,GAAkB,kBAAlB","sourcesContent":["import { useId } from '@fluentui/react-utilities';\nimport { useTabsterAttributes } from './useTabsterAttributes';\nimport { getDeloser, getModalizer, Types as TabsterTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n\nexport interface UseModalAttributesOptions {\n /**\n * Traps focus inside the elements the attributes are applied.\n * Prefer this to `legacyTrapFocus`\n * it forbids users to tab out of the focus trap into the actual browser.\n */\n trapFocus?: boolean;\n\n /**\n * Traps focus inside the elements the attributes are applied.\n * This prop enables legacy behavior to match previous versions of Fluent and is not\n * recommended for general use.\n * Enabling `legacyTrapFocus` prevents users from tabbing out of the focus trap and into\n * the actual browser. Prefer using `trapFocus` instead of this prop.\n */\n legacyTrapFocus?: boolean;\n\n /**\n * Always reachabled in Tab order\n */\n alwaysFocusable?: boolean;\n}\n\n/**\n * Applies modal dialog behaviour through DOM attributes\n * Modal element will focus trap and hide other content on the page\n * The trigger element will be focused if focus is lost after the modal element is removed\n *\n * @returns DOM attributes to apply to the modal element and its trigger\n */\nexport const useModalAttributes = (\n options: UseModalAttributesOptions = {},\n): { modalAttributes: TabsterTypes.TabsterDOMAttribute; triggerAttributes: TabsterTypes.TabsterDOMAttribute } => {\n const { trapFocus, alwaysFocusable, legacyTrapFocus } = options;\n const tabster = useTabster();\n // Initializes the modalizer and deloser APIs\n if (tabster) {\n getModalizer(tabster);\n getDeloser(tabster);\n }\n\n const id = useId('modal-');\n const modalAttributes = useTabsterAttributes({\n deloser: {},\n modalizer: {\n id,\n isOthersAccessible: !trapFocus,\n isAlwaysAccessible: alwaysFocusable,\n isTrapped: legacyTrapFocus,\n },\n });\n\n const triggerAttributes = useTabsterAttributes({\n deloser: {},\n });\n\n return { modalAttributes, triggerAttributes };\n};\n"],"sourceRoot":"../src/"}
@@ -9,6 +9,7 @@ const tabster_1 = /*#__PURE__*/require("tabster");
9
9
 
10
10
  const useTabster_1 = /*#__PURE__*/require("./useTabster");
11
11
  /**
12
+ * @internal
12
13
  * Hook that returns tabster attributes while ensuring tabster exists
13
14
  */
14
15
 
@@ -1 +1 @@
1
- {"version":3,"sources":["hooks/useTabsterAttributes.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,SAAA,gBAAA,OAAA,CAAA,SAAA,CAAA;;AACA,MAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;AAEA;;AAEG;;;AACI,MAAM,oBAAoB,GAAI,KAAD,IAAgF;EAClH;EACA;EACA,YAAA,CAAA,UAAA;EAEA,OAAO,SAAA,CAAA,mBAAA,CAAoB,KAApB,CAAP;AACD,CANM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","sourcesContent":["import { getTabsterAttribute, Types as TabsterTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n\n/**\n * Hook that returns tabster attributes while ensuring tabster exists\n */\nexport const useTabsterAttributes = (props: TabsterTypes.TabsterAttributeProps): TabsterTypes.TabsterDOMAttribute => {\n // A tabster instance is not necessary to generate tabster attributes\n // but calling the hook will ensure that a tabster instance exists internally and avoids consumers doing the same\n useTabster();\n\n return getTabsterAttribute(props);\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["hooks/useTabsterAttributes.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,SAAA,gBAAA,OAAA,CAAA,SAAA,CAAA;;AACA,MAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;AAEA;;;AAGG;;;AACI,MAAM,oBAAoB,GAAI,KAAD,IAAgF;EAClH;EACA;EACA,YAAA,CAAA,UAAA;EAEA,OAAO,SAAA,CAAA,mBAAA,CAAoB,KAApB,CAAP;AACD,CANM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","sourcesContent":["import { getTabsterAttribute, Types as TabsterTypes } from 'tabster';\nimport { useTabster } from './useTabster';\n\n/**\n * @internal\n * Hook that returns tabster attributes while ensuring tabster exists\n */\nexport const useTabsterAttributes = (props: TabsterTypes.TabsterAttributeProps): TabsterTypes.TabsterDOMAttribute => {\n // A tabster instance is not necessary to generate tabster attributes\n // but calling the hook will ensure that a tabster instance exists internally and avoids consumers doing the same\n useTabster();\n\n return getTabsterAttribute(props);\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-20220623-0419.1",
3
+ "version": "0.0.0-nightly-20220629-1444.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,12 +31,12 @@
31
31
  "@fluentui/scripts": "^1.0.0"
32
32
  },
33
33
  "dependencies": {
34
- "@griffel/react": "1.1.0",
35
- "@fluentui/react-shared-contexts": "0.0.0-nightly-20220623-0419.1",
36
- "@fluentui/react-theme": "0.0.0-nightly-20220623-0419.1",
37
- "@fluentui/react-utilities": "0.0.0-nightly-20220623-0419.1",
34
+ "@griffel/react": "^1.2.0",
35
+ "@fluentui/react-shared-contexts": "^0.0.0-nightly-20220629-1444.1",
36
+ "@fluentui/react-theme": "^0.0.0-nightly-20220629-1444.1",
37
+ "@fluentui/react-utilities": "^0.0.0-nightly-20220629-1444.1",
38
38
  "keyborg": "^1.1.0",
39
- "tabster": "^1.4.0",
39
+ "tabster": "^1.4.2",
40
40
  "tslib": "^2.1.0"
41
41
  },
42
42
  "peerDependencies": {
@@ -47,9 +47,7 @@
47
47
  },
48
48
  "beachball": {
49
49
  "disallowedChangeTypes": [
50
- "major",
51
- "minor",
52
- "patch"
50
+ "major"
53
51
  ]
54
52
  },
55
53
  "exports": {