@fluentui/react-tabster 9.3.6 → 9.4.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 CHANGED
@@ -2,7 +2,45 @@
2
2
  "name": "@fluentui/react-tabster",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 09 Jan 2023 14:31:48 GMT",
5
+ "date": "Wed, 18 Jan 2023 16:30:58 GMT",
6
+ "tag": "@fluentui/react-tabster_v9.4.0",
7
+ "version": "9.4.0",
8
+ "comments": {
9
+ "minor": [
10
+ {
11
+ "author": "yuanboxue@microsoft.com",
12
+ "package": "@fluentui/react-tabster",
13
+ "commit": "2dd64b998750525c3e6a4c1652c33305d772ada7",
14
+ "comment": "feat: add modalizer id to `useModalAttributes` option"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Mon, 16 Jan 2023 08:38:49 GMT",
21
+ "tag": "@fluentui/react-tabster_v9.3.7",
22
+ "version": "9.3.7",
23
+ "comments": {
24
+ "none": [
25
+ {
26
+ "author": "martinhochel@microsoft.com",
27
+ "package": "@fluentui/react-tabster",
28
+ "commit": "64bb45980d68de1219c6b36a7db5363f0a9cff9f",
29
+ "comment": "chore: migrate to packaged scripts"
30
+ }
31
+ ],
32
+ "patch": [
33
+ {
34
+ "author": "beachball",
35
+ "package": "@fluentui/react-tabster",
36
+ "comment": "Bump @fluentui/react-shared-contexts to v9.1.5",
37
+ "commit": "a870d8360e47f3ea03358c4e75e89e08a74845d7"
38
+ }
39
+ ]
40
+ }
41
+ },
42
+ {
43
+ "date": "Mon, 09 Jan 2023 14:35:01 GMT",
6
44
  "tag": "@fluentui/react-tabster_v9.3.6",
7
45
  "version": "9.3.6",
8
46
  "comments": {
@@ -19,7 +57,7 @@
19
57
  "author": "beachball",
20
58
  "package": "@fluentui/react-tabster",
21
59
  "comment": "Bump @fluentui/react-utilities to v9.4.0",
22
- "commit": "26f0364b3837056ee8e0df42a7932c298c68290e"
60
+ "commit": "d246e70eba59a37ec311dbf933b0745d34cb700d"
23
61
  }
24
62
  ]
25
63
  }
package/CHANGELOG.md CHANGED
@@ -1,17 +1,35 @@
1
1
  # Change Log - @fluentui/react-tabster
2
2
 
3
- This log was last generated on Mon, 09 Jan 2023 14:31:48 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 18 Jan 2023 16:30:58 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.4.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.4.0)
8
+
9
+ Wed, 18 Jan 2023 16:30:58 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.3.7..@fluentui/react-tabster_v9.4.0)
11
+
12
+ ### Minor changes
13
+
14
+ - feat: add modalizer id to `useModalAttributes` option ([PR #26387](https://github.com/microsoft/fluentui/pull/26387) by yuanboxue@microsoft.com)
15
+
16
+ ## [9.3.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.3.7)
17
+
18
+ Mon, 16 Jan 2023 08:38:49 GMT
19
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.3.6..@fluentui/react-tabster_v9.3.7)
20
+
21
+ ### Patches
22
+
23
+ - Bump @fluentui/react-shared-contexts to v9.1.5 ([commit](https://github.com/microsoft/fluentui/commit/a870d8360e47f3ea03358c4e75e89e08a74845d7) by beachball)
24
+
7
25
  ## [9.3.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.3.6)
8
26
 
9
- Mon, 09 Jan 2023 14:31:48 GMT
27
+ Mon, 09 Jan 2023 14:35:01 GMT
10
28
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-tabster_v9.3.5..@fluentui/react-tabster_v9.3.6)
11
29
 
12
30
  ### Patches
13
31
 
14
- - Bump @fluentui/react-utilities to v9.4.0 ([PR #26257](https://github.com/microsoft/fluentui/pull/26257) by beachball)
32
+ - Bump @fluentui/react-utilities to v9.4.0 ([PR #26255](https://github.com/microsoft/fluentui/pull/26255) by beachball)
15
33
 
16
34
  ## [9.3.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-tabster_v9.3.5)
17
35
 
package/dist/index.d.ts CHANGED
@@ -159,6 +159,10 @@ export declare interface UseModalAttributesOptions {
159
159
  * Always reachabled in Tab order
160
160
  */
161
161
  alwaysFocusable?: boolean;
162
+ /**
163
+ * Id to use for the modalizer. An id will be generated if not provided.
164
+ */
165
+ id?: string;
162
166
  }
163
167
 
164
168
  /**
@@ -21,7 +21,7 @@ export const useModalAttributes = (options = {}) => {
21
21
  getModalizer(tabster);
22
22
  getDeloser(tabster);
23
23
  }
24
- const id = useId('modal-');
24
+ const id = useId('modal-', options.id);
25
25
  const modalAttributes = useTabsterAttributes({
26
26
  deloser: {},
27
27
  modalizer: {
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,SAASA,KAAK,QAAQ,2BAA2B;AACjD,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,UAAU,EAAEC,YAAY,QAA+B,SAAS;AACzE,SAASC,UAAU,QAAQ,cAAc;AAyBzC;;;;;;;AAOA,OAAO,MAAMC,kBAAkB,GAAG,CAChCC,UAAqC,EAAE,KACuE;EAC9G,MAAM;IAAEC,SAAS;IAAEC,eAAe;IAAEC;EAAe,CAAE,GAAGH,OAAO;EAC/D,MAAMI,OAAO,GAAGN,UAAU,EAAE;EAC5B;EACA,IAAIM,OAAO,EAAE;IACXP,YAAY,CAACO,OAAO,CAAC;IACrBR,UAAU,CAACQ,OAAO,CAAC;;EAGrB,MAAMC,EAAE,GAAGX,KAAK,CAAC,QAAQ,CAAC;EAC1B,MAAMY,eAAe,GAAGX,oBAAoB,CAAC;IAC3CY,OAAO,EAAE,EAAE;IACXC,SAAS,EAAE;MACTH,EAAE;MACFI,kBAAkB,EAAE,CAACR,SAAS;MAC9BS,kBAAkB,EAAER,eAAe;MACnCS,SAAS,EAAER;;GAEd,CAAC;EAEF,MAAMS,iBAAiB,GAAGjB,oBAAoB,CAAC;IAC7CY,OAAO,EAAE;GACV,CAAC;EAEF,OAAO;IAAED,eAAe;IAAEM;EAAiB,CAAE;AAC/C,CAAC","names":["useId","useTabsterAttributes","getDeloser","getModalizer","useTabster","useModalAttributes","options","trapFocus","alwaysFocusable","legacyTrapFocus","tabster","id","modalAttributes","deloser","modalizer","isOthersAccessible","isAlwaysAccessible","isTrapped","triggerAttributes"],"sourceRoot":"../src/","sources":["packages/react-components/react-tabster/src/hooks/useModalAttributes.ts"],"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"]}
1
+ {"version":3,"mappings":"AAAA,SAASA,KAAK,QAAQ,2BAA2B;AACjD,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,UAAU,EAAEC,YAAY,QAA+B,SAAS;AACzE,SAASC,UAAU,QAAQ,cAAc;AA8BzC;;;;;;;AAOA,OAAO,MAAMC,kBAAkB,GAAG,CAChCC,UAAqC,EAAE,KACuE;EAC9G,MAAM;IAAEC,SAAS;IAAEC,eAAe;IAAEC;EAAe,CAAE,GAAGH,OAAO;EAC/D,MAAMI,OAAO,GAAGN,UAAU,EAAE;EAC5B;EACA,IAAIM,OAAO,EAAE;IACXP,YAAY,CAACO,OAAO,CAAC;IACrBR,UAAU,CAACQ,OAAO,CAAC;;EAGrB,MAAMC,EAAE,GAAGX,KAAK,CAAC,QAAQ,EAAEM,OAAO,CAACK,EAAE,CAAC;EACtC,MAAMC,eAAe,GAAGX,oBAAoB,CAAC;IAC3CY,OAAO,EAAE,EAAE;IACXC,SAAS,EAAE;MACTH,EAAE;MACFI,kBAAkB,EAAE,CAACR,SAAS;MAC9BS,kBAAkB,EAAER,eAAe;MACnCS,SAAS,EAAER;;GAEd,CAAC;EAEF,MAAMS,iBAAiB,GAAGjB,oBAAoB,CAAC;IAC7CY,OAAO,EAAE;GACV,CAAC;EAEF,OAAO;IAAED,eAAe;IAAEM;EAAiB,CAAE;AAC/C,CAAC","names":["useId","useTabsterAttributes","getDeloser","getModalizer","useTabster","useModalAttributes","options","trapFocus","alwaysFocusable","legacyTrapFocus","tabster","id","modalAttributes","deloser","modalizer","isOthersAccessible","isAlwaysAccessible","isTrapped","triggerAttributes"],"sourceRoot":"../src/","sources":["packages/react-components/react-tabster/src/hooks/useModalAttributes.ts"],"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 * Id to use for the modalizer. An id will be generated if not provided.\n */\n id?: string;\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-', options.id);\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"]}
@@ -18,7 +18,7 @@ define(["require", "exports", "@fluentui/react-utilities", "./useTabsterAttribut
18
18
  tabster_1.getModalizer(tabster);
19
19
  tabster_1.getDeloser(tabster);
20
20
  }
21
- var id = react_utilities_1.useId('modal-');
21
+ var id = react_utilities_1.useId('modal-', options.id);
22
22
  var modalAttributes = useTabsterAttributes_1.useTabsterAttributes({
23
23
  deloser: {},
24
24
  modalizer: {
@@ -1 +1 @@
1
- {"version":3,"file":"useModalAttributes.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-tabster/src/hooks/useModalAttributes.ts"],"names":[],"mappings":";;;;IA4BA;;;;;;OAMG;IACI,IAAM,kBAAkB,GAAG,UAChC,OAAuC;QAAvC,wBAAA,EAAA,YAAuC;QAE/B,IAAA,SAAS,GAAuC,OAAO,UAA9C,EAAE,eAAe,GAAsB,OAAO,gBAA7B,EAAE,eAAe,GAAK,OAAO,gBAAZ,CAAa;QAChE,IAAM,OAAO,GAAG,uBAAU,EAAE,CAAC;QAC7B,6CAA6C;QAC7C,IAAI,OAAO,EAAE;YACX,sBAAY,CAAC,OAAO,CAAC,CAAC;YACtB,oBAAU,CAAC,OAAO,CAAC,CAAC;SACrB;QAED,IAAM,EAAE,GAAG,uBAAK,CAAC,QAAQ,CAAC,CAAC;QAC3B,IAAM,eAAe,GAAG,2CAAoB,CAAC;YAC3C,OAAO,EAAE,EAAE;YACX,SAAS,EAAE;gBACT,EAAE,IAAA;gBACF,kBAAkB,EAAE,CAAC,SAAS;gBAC9B,kBAAkB,EAAE,eAAe;gBACnC,SAAS,EAAE,eAAe;aAC3B;SACF,CAAC,CAAC;QAEH,IAAM,iBAAiB,GAAG,2CAAoB,CAAC;YAC7C,OAAO,EAAE,EAAE;SACZ,CAAC,CAAC;QAEH,OAAO,EAAE,eAAe,iBAAA,EAAE,iBAAiB,mBAAA,EAAE,CAAC;IAChD,CAAC,CAAC;IA3BW,QAAA,kBAAkB,sBA2B7B","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"]}
1
+ {"version":3,"file":"useModalAttributes.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-tabster/src/hooks/useModalAttributes.ts"],"names":[],"mappings":";;;;IAiCA;;;;;;OAMG;IACI,IAAM,kBAAkB,GAAG,UAChC,OAAuC;QAAvC,wBAAA,EAAA,YAAuC;QAE/B,IAAA,SAAS,GAAuC,OAAO,UAA9C,EAAE,eAAe,GAAsB,OAAO,gBAA7B,EAAE,eAAe,GAAK,OAAO,gBAAZ,CAAa;QAChE,IAAM,OAAO,GAAG,uBAAU,EAAE,CAAC;QAC7B,6CAA6C;QAC7C,IAAI,OAAO,EAAE;YACX,sBAAY,CAAC,OAAO,CAAC,CAAC;YACtB,oBAAU,CAAC,OAAO,CAAC,CAAC;SACrB;QAED,IAAM,EAAE,GAAG,uBAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QACvC,IAAM,eAAe,GAAG,2CAAoB,CAAC;YAC3C,OAAO,EAAE,EAAE;YACX,SAAS,EAAE;gBACT,EAAE,IAAA;gBACF,kBAAkB,EAAE,CAAC,SAAS;gBAC9B,kBAAkB,EAAE,eAAe;gBACnC,SAAS,EAAE,eAAe;aAC3B;SACF,CAAC,CAAC;QAEH,IAAM,iBAAiB,GAAG,2CAAoB,CAAC;YAC7C,OAAO,EAAE,EAAE;SACZ,CAAC,CAAC;QAEH,OAAO,EAAE,eAAe,iBAAA,EAAE,iBAAiB,mBAAA,EAAE,CAAC;IAChD,CAAC,CAAC;IA3BW,QAAA,kBAAkB,sBA2B7B","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 * Id to use for the modalizer. An id will be generated if not provided.\n */\n id?: string;\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-', options.id);\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"]}
@@ -27,7 +27,7 @@ const useModalAttributes = (options = {}) => {
27
27
  tabster_1.getModalizer(tabster);
28
28
  tabster_1.getDeloser(tabster);
29
29
  }
30
- const id = react_utilities_1.useId('modal-');
30
+ const id = react_utilities_1.useId('modal-', options.id);
31
31
  const modalAttributes = useTabsterAttributes_1.useTabsterAttributes({
32
32
  deloser: {},
33
33
  modalizer: {
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAyBA;;;;;;;AAOO,MAAMA,kBAAkB,GAAG,CAChCC,UAAqC,EAAE,KACuE;EAC9G,MAAM;IAAEC,SAAS;IAAEC,eAAe;IAAEC;EAAe,CAAE,GAAGH,OAAO;EAC/D,MAAMI,OAAO,GAAGC,uBAAU,EAAE;EAC5B;EACA,IAAID,OAAO,EAAE;IACXE,sBAAY,CAACF,OAAO,CAAC;IACrBE,oBAAU,CAACF,OAAO,CAAC;;EAGrB,MAAMG,EAAE,GAAGC,uBAAK,CAAC,QAAQ,CAAC;EAC1B,MAAMC,eAAe,GAAGC,2CAAoB,CAAC;IAC3CC,OAAO,EAAE,EAAE;IACXC,SAAS,EAAE;MACTL,EAAE;MACFM,kBAAkB,EAAE,CAACZ,SAAS;MAC9Ba,kBAAkB,EAAEZ,eAAe;MACnCa,SAAS,EAAEZ;;GAEd,CAAC;EAEF,MAAMa,iBAAiB,GAAGN,2CAAoB,CAAC;IAC7CC,OAAO,EAAE;GACV,CAAC;EAEF,OAAO;IAAEF,eAAe;IAAEO;EAAiB,CAAE;AAC/C,CAAC;AA3BYC,0BAAkB","names":["useModalAttributes","options","trapFocus","alwaysFocusable","legacyTrapFocus","tabster","useTabster_1","tabster_1","id","react_utilities_1","modalAttributes","useTabsterAttributes_1","deloser","modalizer","isOthersAccessible","isAlwaysAccessible","isTrapped","triggerAttributes","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-tabster/src/hooks/useModalAttributes.ts"],"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"]}
1
+ {"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AA8BA;;;;;;;AAOO,MAAMA,kBAAkB,GAAG,CAChCC,UAAqC,EAAE,KACuE;EAC9G,MAAM;IAAEC,SAAS;IAAEC,eAAe;IAAEC;EAAe,CAAE,GAAGH,OAAO;EAC/D,MAAMI,OAAO,GAAGC,uBAAU,EAAE;EAC5B;EACA,IAAID,OAAO,EAAE;IACXE,sBAAY,CAACF,OAAO,CAAC;IACrBE,oBAAU,CAACF,OAAO,CAAC;;EAGrB,MAAMG,EAAE,GAAGC,uBAAK,CAAC,QAAQ,EAAER,OAAO,CAACO,EAAE,CAAC;EACtC,MAAME,eAAe,GAAGC,2CAAoB,CAAC;IAC3CC,OAAO,EAAE,EAAE;IACXC,SAAS,EAAE;MACTL,EAAE;MACFM,kBAAkB,EAAE,CAACZ,SAAS;MAC9Ba,kBAAkB,EAAEZ,eAAe;MACnCa,SAAS,EAAEZ;;GAEd,CAAC;EAEF,MAAMa,iBAAiB,GAAGN,2CAAoB,CAAC;IAC7CC,OAAO,EAAE;GACV,CAAC;EAEF,OAAO;IAAEF,eAAe;IAAEO;EAAiB,CAAE;AAC/C,CAAC;AA3BYC,0BAAkB","names":["useModalAttributes","options","trapFocus","alwaysFocusable","legacyTrapFocus","tabster","useTabster_1","tabster_1","id","react_utilities_1","modalAttributes","useTabsterAttributes_1","deloser","modalizer","isOthersAccessible","isAlwaysAccessible","isTrapped","triggerAttributes","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-tabster/src/hooks/useModalAttributes.ts"],"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 * Id to use for the modalizer. An id will be generated if not provided.\n */\n id?: string;\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-', options.id);\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-tabster",
3
- "version": "9.3.6",
3
+ "version": "9.4.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",
@@ -25,11 +25,13 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@fluentui/eslint-plugin": "*",
28
- "@fluentui/scripts": "*"
28
+ "@fluentui/scripts-api-extractor": "*",
29
+ "@fluentui/scripts-cypress": "*",
30
+ "@fluentui/scripts-tasks": "*"
29
31
  },
30
32
  "dependencies": {
31
33
  "@griffel/react": "^1.5.2",
32
- "@fluentui/react-shared-contexts": "^9.1.4",
34
+ "@fluentui/react-shared-contexts": "^9.1.5",
33
35
  "@fluentui/react-theme": "^9.1.5",
34
36
  "@fluentui/react-utilities": "^9.4.0",
35
37
  "keyborg": "^1.2.1",