@fluentui/react-tabster 0.0.0-nightly-20220624-0419.1 → 0.0.0-nightly-20220704-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 CHANGED
@@ -2,9 +2,57 @@
2
2
  "name": "@fluentui/react-tabster",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 24 Jun 2022 04:33:21 GMT",
6
- "tag": "@fluentui/react-tabster_v0.0.0-nightly-20220624-0419.1",
7
- "version": "0.0.0-nightly-20220624-0419.1",
5
+ "date": "Mon, 04 Jul 2022 04:31:26 GMT",
6
+ "tag": "@fluentui/react-tabster_v0.0.0-nightly-20220704-0419.1",
7
+ "version": "0.0.0-nightly-20220704-0419.1",
8
+ "comments": {
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-20220704-0419.1",
20
+ "commit": "2027db0e86db3d94fe6f7c7c55734098c014dfbf"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-tabster",
25
+ "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20220704-0419.1",
26
+ "commit": "2027db0e86db3d94fe6f7c7c55734098c014dfbf"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-tabster",
31
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20220704-0419.1",
32
+ "commit": "2027db0e86db3d94fe6f7c7c55734098c014dfbf"
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": [
43
+ {
44
+ "author": "lingfangao@hotmail.com",
45
+ "package": "@fluentui/react-tabster",
46
+ "commit": "3deda1fbbfb6ac2b1ad150d4dc6343f1f7fda85b",
47
+ "comment": "fix: Use caret dependency range for Griffel"
48
+ }
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",
8
56
  "comments": {
9
57
  "prerelease": [
10
58
  {
@@ -25,31 +73,72 @@
25
73
  "commit": "675acea49c97f10837ddee9b8c4350ca27750125",
26
74
  "comment": "Bump Griffel dependencies"
27
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
+ },
28
104
  {
29
105
  "author": "beachball",
30
106
  "package": "@fluentui/react-tabster",
31
- "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20220624-0419.1",
32
- "commit": "5197053e8e0ad04d319248954fcfa61d4f63b97a"
107
+ "comment": "Bump @fluentui/react-shared-contexts to v9.0.0",
108
+ "commit": "ba6c5d651559b91c815429c9a9357c4d5a390f3e"
33
109
  },
34
110
  {
35
111
  "author": "beachball",
36
112
  "package": "@fluentui/react-tabster",
37
- "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20220624-0419.1",
38
- "commit": "5197053e8e0ad04d319248954fcfa61d4f63b97a"
113
+ "comment": "Bump @fluentui/react-theme to v9.0.0",
114
+ "commit": "ba6c5d651559b91c815429c9a9357c4d5a390f3e"
39
115
  },
40
116
  {
41
117
  "author": "beachball",
42
118
  "package": "@fluentui/react-tabster",
43
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20220624-0419.1",
44
- "commit": "5197053e8e0ad04d319248954fcfa61d4f63b97a"
119
+ "comment": "Bump @fluentui/react-utilities to v9.0.0",
120
+ "commit": "ba6c5d651559b91c815429c9a9357c4d5a390f3e"
45
121
  }
46
- ],
47
- "none": [
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": [
48
131
  {
49
- "author": "lingfangao@hotmail.com",
132
+ "author": "beachball",
50
133
  "package": "@fluentui/react-tabster",
51
- "commit": "2da2d47e3dac6f8f4396ab112ab80b1dd34cc9ac",
52
- "comment": "Bump cypress to v10"
134
+ "comment": "Bump @fluentui/react-shared-contexts to v9.0.0-rc.11",
135
+ "commit": "b00790b7a0ea1473d8c3cc49c7ca0088002957ed"
136
+ },
137
+ {
138
+ "author": "beachball",
139
+ "package": "@fluentui/react-tabster",
140
+ "comment": "Bump @fluentui/react-theme to v9.0.0-rc.10",
141
+ "commit": "b00790b7a0ea1473d8c3cc49c7ca0088002957ed"
53
142
  }
54
143
  ]
55
144
  }
package/CHANGELOG.md CHANGED
@@ -1,22 +1,59 @@
1
1
  # Change Log - @fluentui/react-tabster
2
2
 
3
- This log was last generated on Fri, 24 Jun 2022 04:33:21 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 04 Jul 2022 04:31:26 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20220624-0419.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v0.0.0-nightly-20220624-0419.1)
7
+ ## [0.0.0-nightly-20220704-0419.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v0.0.0-nightly-20220704-0419.1)
8
8
 
9
- Fri, 24 Jun 2022 04:33:21 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-20220624-0419.1)
9
+ Mon, 04 Jul 2022 04:31:26 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.0.1..@fluentui/react-tabster_v0.0.0-nightly-20220704-0419.1)
11
+
12
+ ### Changes
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-20220704-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/2027db0e86db3d94fe6f7c7c55734098c014dfbf) by beachball)
16
+ - Bump @fluentui/react-theme to v0.0.0-nightly-20220704-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/2027db0e86db3d94fe6f7c7c55734098c014dfbf) by beachball)
17
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20220704-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/2027db0e86db3d94fe6f7c7c55734098c014dfbf) 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)
11
39
 
12
40
  ### Changes
13
41
 
14
42
  - chore: Mark teams-prg owned APIs with @internal ([PR #23689](https://github.com/microsoft/fluentui/pull/23689) by lingfangao@hotmail.com)
15
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)
16
44
  - Bump Griffel dependencies ([PR #23688](https://github.com/microsoft/fluentui/pull/23688) by lingfangao@hotmail.com)
17
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20220624-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/5197053e8e0ad04d319248954fcfa61d4f63b97a) by beachball)
18
- - Bump @fluentui/react-theme to v0.0.0-nightly-20220624-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/5197053e8e0ad04d319248954fcfa61d4f63b97a) by beachball)
19
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20220624-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/5197053e8e0ad04d319248954fcfa61d4f63b97a) by beachball)
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)
20
57
 
21
58
  ## [9.0.0-rc.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.0.0-rc.13)
22
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
  */
@@ -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/"}
@@ -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/"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-tabster",
3
- "version": "0.0.0-nightly-20220624-0419.1",
3
+ "version": "0.0.0-nightly-20220704-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",
@@ -31,12 +31,12 @@
31
31
  "@fluentui/scripts": "^1.0.0"
32
32
  },
33
33
  "dependencies": {
34
- "@griffel/react": "1.2.0",
35
- "@fluentui/react-shared-contexts": "0.0.0-nightly-20220624-0419.1",
36
- "@fluentui/react-theme": "0.0.0-nightly-20220624-0419.1",
37
- "@fluentui/react-utilities": "0.0.0-nightly-20220624-0419.1",
34
+ "@griffel/react": "^1.2.0",
35
+ "@fluentui/react-shared-contexts": "^0.0.0-nightly-20220704-0419.1",
36
+ "@fluentui/react-theme": "^0.0.0-nightly-20220704-0419.1",
37
+ "@fluentui/react-utilities": "^0.0.0-nightly-20220704-0419.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": {