@fluentui/react-aria 9.3.35 → 9.3.37

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,49 @@
2
2
  "name": "@fluentui/react-aria",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 05 Sep 2023 15:35:07 GMT",
5
+ "date": "Tue, 26 Sep 2023 15:15:11 GMT",
6
+ "tag": "@fluentui/react-aria_v9.3.37",
7
+ "version": "9.3.37",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "martinhochel@microsoft.com",
12
+ "package": "@fluentui/react-aria",
13
+ "commit": "e61473fa10195f6ebf2308205c1e72e91b711831",
14
+ "comment": "fix: bump swc core to mitigate transpilation memory leaks"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-aria",
19
+ "comment": "Bump @fluentui/keyboard-keys to v9.0.5",
20
+ "commit": "e16520437e10cd824ac254dd797e32762b5de72d"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-aria",
25
+ "comment": "Bump @fluentui/react-utilities to v9.13.4",
26
+ "commit": "e16520437e10cd824ac254dd797e32762b5de72d"
27
+ }
28
+ ]
29
+ }
30
+ },
31
+ {
32
+ "date": "Wed, 06 Sep 2023 13:31:31 GMT",
33
+ "tag": "@fluentui/react-aria_v9.3.36",
34
+ "version": "9.3.36",
35
+ "comments": {
36
+ "patch": [
37
+ {
38
+ "author": "beachball",
39
+ "package": "@fluentui/react-aria",
40
+ "comment": "Bump @fluentui/react-utilities to v9.13.3",
41
+ "commit": "52532950407fd4d3664ec6aa337855214233813b"
42
+ }
43
+ ]
44
+ }
45
+ },
46
+ {
47
+ "date": "Tue, 05 Sep 2023 15:39:04 GMT",
6
48
  "tag": "@fluentui/react-aria_v9.3.35",
7
49
  "version": "9.3.35",
8
50
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,32 @@
1
1
  # Change Log - @fluentui/react-aria
2
2
 
3
- This log was last generated on Tue, 05 Sep 2023 15:35:07 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 26 Sep 2023 15:15:11 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.3.37](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.3.37)
8
+
9
+ Tue, 26 Sep 2023 15:15:11 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.3.36..@fluentui/react-aria_v9.3.37)
11
+
12
+ ### Patches
13
+
14
+ - fix: bump swc core to mitigate transpilation memory leaks ([PR #29253](https://github.com/microsoft/fluentui/pull/29253) by martinhochel@microsoft.com)
15
+ - Bump @fluentui/keyboard-keys to v9.0.5 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
16
+ - Bump @fluentui/react-utilities to v9.13.4 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
17
+
18
+ ## [9.3.36](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.3.36)
19
+
20
+ Wed, 06 Sep 2023 13:31:31 GMT
21
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.3.35..@fluentui/react-aria_v9.3.36)
22
+
23
+ ### Patches
24
+
25
+ - Bump @fluentui/react-utilities to v9.13.3 ([PR #29080](https://github.com/microsoft/fluentui/pull/29080) by beachball)
26
+
7
27
  ## [9.3.35](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.3.35)
8
28
 
9
- Tue, 05 Sep 2023 15:35:07 GMT
29
+ Tue, 05 Sep 2023 15:39:04 GMT
10
30
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.3.34..@fluentui/react-aria_v9.3.35)
11
31
 
12
32
  ### Patches
@@ -36,13 +36,11 @@ import * as React from 'react';
36
36
  ev.preventDefault();
37
37
  ev.stopPropagation();
38
38
  } else {
39
- var _onClick;
40
- (_onClick = onClick) === null || _onClick === void 0 ? void 0 : _onClick(ev);
39
+ onClick === null || onClick === void 0 ? void 0 : onClick(ev);
41
40
  }
42
41
  });
43
42
  const handleKeyDown = useEventCallback((ev)=>{
44
- var _onKeyDown;
45
- (_onKeyDown = onKeyDown) === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(ev);
43
+ onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(ev);
46
44
  if (ev.isDefaultPrevented()) {
47
45
  return;
48
46
  }
@@ -61,8 +59,7 @@ import * as React from 'react';
61
59
  }
62
60
  });
63
61
  const handleKeyUp = useEventCallback((ev)=>{
64
- var _onKeyUp;
65
- (_onKeyUp = onKeyUp) === null || _onKeyUp === void 0 ? void 0 : _onKeyUp(ev);
62
+ onKeyUp === null || onKeyUp === void 0 ? void 0 : onKeyUp(ev);
66
63
  if (ev.isDefaultPrevented()) {
67
64
  return;
68
65
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["useARIAButtonProps.ts"],"sourcesContent":["import { Enter, Space } from '@fluentui/keyboard-keys';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport type { ARIAButtonElementIntersection, ARIAButtonProps, ARIAButtonResultProps, ARIAButtonType } from './types';\n\n/**\n * @internal\n *\n * Button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec\n * for multiple scenarios of non native button elements. Ensuring 1st rule of ARIA for cases\n * where no attribute addition is required.\n *\n * @param type - the proper scenario to be interpreted by the hook.\n * 1. `button` - Minimal interference from the hook, as semantic button already supports most of the states\n * 2. `a` or `div` - Proper keyboard/mouse handling plus other support to ensure ARIA behavior\n * @param props - the props to be passed down the line to the desired element.\n * This hook will encapsulate proper properties, such as `onClick`, `onKeyDown`, `onKeyUp`, etc,.\n *\n * @example\n * ```tsx\n * const buttonProps = useARIAButtonProps('a', {\n * href: './some-route'\n * onClick: () => console.log('this should run both on click and Space and Enter')\n * })\n *\n * // ...\n *\n * return (\n * <a {...buttonProps}>This anchor will behave as a proper button</a>\n * )\n * ```\n */\nexport function useARIAButtonProps<Type extends ARIAButtonType, Props extends ARIAButtonProps<Type>>(\n type?: Type,\n props?: Props,\n): ARIAButtonResultProps<Type, Props> {\n const {\n disabled,\n disabledFocusable = false,\n ['aria-disabled']: ariaDisabled,\n onClick,\n onKeyDown,\n onKeyUp,\n ...rest\n } = props ?? {};\n\n const normalizedARIADisabled = typeof ariaDisabled === 'string' ? ariaDisabled === 'true' : ariaDisabled;\n\n const isDisabled = disabled || disabledFocusable || normalizedARIADisabled;\n\n const handleClick = useEventCallback((ev: React.MouseEvent<ARIAButtonElementIntersection>) => {\n if (isDisabled) {\n ev.preventDefault();\n ev.stopPropagation();\n } else {\n onClick?.(ev);\n }\n });\n\n const handleKeyDown = useEventCallback((ev: React.KeyboardEvent<ARIAButtonElementIntersection>) => {\n onKeyDown?.(ev);\n\n if (ev.isDefaultPrevented()) {\n return;\n }\n\n const key = ev.key;\n\n if (isDisabled && (key === Enter || key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n return;\n }\n\n if (key === Space) {\n ev.preventDefault();\n return;\n }\n\n // If enter is pressed, activate the button\n else if (key === Enter) {\n ev.preventDefault();\n ev.currentTarget.click();\n }\n });\n\n const handleKeyUp = useEventCallback((ev: React.KeyboardEvent<ARIAButtonElementIntersection>) => {\n onKeyUp?.(ev);\n\n if (ev.isDefaultPrevented()) {\n return;\n }\n\n const key = ev.key;\n\n if (isDisabled && (key === Enter || key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n return;\n }\n\n if (key === Space) {\n ev.preventDefault();\n ev.currentTarget.click();\n }\n });\n\n // If a <button> tag is to be rendered we just need to set disabled and aria-disabled correctly\n if (type === 'button' || type === undefined) {\n return {\n ...rest,\n disabled: disabled && !disabledFocusable,\n 'aria-disabled': disabledFocusable ? true : normalizedARIADisabled,\n // onclick should still use internal handler to ensure prevention if disabled\n // if disabledFocusable then there's no requirement for handlers as those events should not be propagated\n onClick: disabledFocusable ? undefined : handleClick,\n onKeyUp: disabledFocusable ? undefined : onKeyUp,\n onKeyDown: disabledFocusable ? undefined : onKeyDown,\n } as ARIAButtonResultProps<Type, Props>;\n }\n\n // If an <a> or <div> tag is to be rendered we have to remove disabled and type,\n // and set aria-disabled, role and tabIndex.\n else {\n const resultProps = {\n role: 'button',\n tabIndex: disabled && !disabledFocusable ? undefined : 0,\n ...rest,\n // If it's not a <button> than listeners are required even with disabledFocusable\n // Since you cannot assure the default behavior of the element\n // E.g: <a> will redirect on click\n onClick: handleClick,\n onKeyUp: handleKeyUp,\n onKeyDown: handleKeyDown,\n 'aria-disabled': disabled || disabledFocusable || normalizedARIADisabled,\n } as ARIAButtonResultProps<Type, Props>;\n\n if (type === 'a' && isDisabled) {\n (resultProps as ARIAButtonResultProps<'a', Props>).href = undefined;\n }\n\n return resultProps;\n }\n}\n"],"names":["Enter","Space","useEventCallback","React","useARIAButtonProps","type","props","disabled","disabledFocusable","ariaDisabled","onClick","onKeyDown","onKeyUp","rest","normalizedARIADisabled","isDisabled","handleClick","ev","preventDefault","stopPropagation","handleKeyDown","isDefaultPrevented","key","currentTarget","click","handleKeyUp","undefined","resultProps","role","tabIndex","href"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,0BAA0B;AACvD,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,YAAYC,WAAW,QAAQ;AAG/B;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BC,GACD,OAAO,SAASC,mBACdC,IAAW,EACXC,KAAa;IAEb,MAAM,EACJC,QAAQ,EACRC,oBAAoB,KAAK,EACzB,CAAC,gBAAgB,EAAEC,YAAY,EAC/BC,OAAO,EACPC,SAAS,EACTC,OAAO,EACP,GAAGC,MACJ,GAAGP,kBAAAA,mBAAAA,QAAS,CAAC;IAEd,MAAMQ,yBAAyB,OAAOL,iBAAiB,WAAWA,iBAAiB,SAASA;IAE5F,MAAMM,aAAaR,YAAYC,qBAAqBM;IAEpD,MAAME,cAAcd,iBAAiB,C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MAAMgB,cAAc;YAClBC,MAAM;YACNC,UAAUtB,YAAY,CAACC,oBAAoBkB,YAAY;YACvD,GAAGb,IAAI;YACP,iFAAiF;YACjF,8DAA8D;YAC9D,kCAAkC;YAClCH,SAASM;YACTJ,SAASa;YACTd,WAAWS;YACX,iBAAiBb,YAAYC,qBAAqBM;QACpD;QAEA,IAAIT,SAAS,OAAOU,YAAY;YAC7BY,YAAkDG,IAAI,GAAGJ;QAC5D;QAEA,OAAOC;IACT;AACF"}
1
+ {"version":3,"sources":["useARIAButtonProps.ts"],"sourcesContent":["import { Enter, Space } from '@fluentui/keyboard-keys';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport type { ARIAButtonElementIntersection, ARIAButtonProps, ARIAButtonResultProps, ARIAButtonType } from './types';\n\n/**\n * @internal\n *\n * Button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec\n * for multiple scenarios of non native button elements. Ensuring 1st rule of ARIA for cases\n * where no attribute addition is required.\n *\n * @param type - the proper scenario to be interpreted by the hook.\n * 1. `button` - Minimal interference from the hook, as semantic button already supports most of the states\n * 2. `a` or `div` - Proper keyboard/mouse handling plus other support to ensure ARIA behavior\n * @param props - the props to be passed down the line to the desired element.\n * This hook will encapsulate proper properties, such as `onClick`, `onKeyDown`, `onKeyUp`, etc,.\n *\n * @example\n * ```tsx\n * const buttonProps = useARIAButtonProps('a', {\n * href: './some-route'\n * onClick: () => console.log('this should run both on click and Space and Enter')\n * })\n *\n * // ...\n *\n * return (\n * <a {...buttonProps}>This anchor will behave as a proper button</a>\n * )\n * ```\n */\nexport function useARIAButtonProps<Type extends ARIAButtonType, Props extends ARIAButtonProps<Type>>(\n type?: Type,\n props?: Props,\n): ARIAButtonResultProps<Type, Props> {\n const {\n disabled,\n disabledFocusable = false,\n ['aria-disabled']: ariaDisabled,\n onClick,\n onKeyDown,\n onKeyUp,\n ...rest\n } = props ?? {};\n\n const normalizedARIADisabled = typeof ariaDisabled === 'string' ? ariaDisabled === 'true' : ariaDisabled;\n\n const isDisabled = disabled || disabledFocusable || normalizedARIADisabled;\n\n const handleClick = useEventCallback((ev: React.MouseEvent<ARIAButtonElementIntersection>) => {\n if (isDisabled) {\n ev.preventDefault();\n ev.stopPropagation();\n } else {\n onClick?.(ev);\n }\n });\n\n const handleKeyDown = useEventCallback((ev: React.KeyboardEvent<ARIAButtonElementIntersection>) => {\n onKeyDown?.(ev);\n\n if (ev.isDefaultPrevented()) {\n return;\n }\n\n const key = ev.key;\n\n if (isDisabled && (key === Enter || key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n return;\n }\n\n if (key === Space) {\n ev.preventDefault();\n return;\n }\n\n // If enter is pressed, activate the button\n else if (key === Enter) {\n ev.preventDefault();\n ev.currentTarget.click();\n }\n });\n\n const handleKeyUp = useEventCallback((ev: React.KeyboardEvent<ARIAButtonElementIntersection>) => {\n onKeyUp?.(ev);\n\n if (ev.isDefaultPrevented()) {\n return;\n }\n\n const key = ev.key;\n\n if (isDisabled && (key === Enter || key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n return;\n }\n\n if (key === Space) {\n ev.preventDefault();\n ev.currentTarget.click();\n }\n });\n\n // If a <button> tag is to be rendered we just need to set disabled and aria-disabled correctly\n if (type === 'button' || type === undefined) {\n return {\n ...rest,\n disabled: disabled && !disabledFocusable,\n 'aria-disabled': disabledFocusable ? true : normalizedARIADisabled,\n // onclick should still use internal handler to ensure prevention if disabled\n // if disabledFocusable then there's no requirement for handlers as those events should not be propagated\n onClick: disabledFocusable ? undefined : handleClick,\n onKeyUp: disabledFocusable ? undefined : onKeyUp,\n onKeyDown: disabledFocusable ? undefined : onKeyDown,\n } as ARIAButtonResultProps<Type, Props>;\n }\n\n // If an <a> or <div> tag is to be rendered we have to remove disabled and type,\n // and set aria-disabled, role and tabIndex.\n else {\n const resultProps = {\n role: 'button',\n tabIndex: disabled && !disabledFocusable ? undefined : 0,\n ...rest,\n // If it's not a <button> than listeners are required even with disabledFocusable\n // Since you cannot assure the default behavior of the element\n // E.g: <a> will redirect on click\n onClick: handleClick,\n onKeyUp: handleKeyUp,\n onKeyDown: handleKeyDown,\n 'aria-disabled': disabled || disabledFocusable || normalizedARIADisabled,\n } as ARIAButtonResultProps<Type, Props>;\n\n if (type === 'a' && isDisabled) {\n (resultProps as ARIAButtonResultProps<'a', Props>).href = undefined;\n }\n\n return resultProps;\n }\n}\n"],"names":["Enter","Space","useEventCallback","React","useARIAButtonProps","type","props","disabled","disabledFocusable","ariaDisabled","onClick","onKeyDown","onKeyUp","rest","normalizedARIADisabled","isDisabled","handleClick","ev","preventDefault","stopPropagation","handleKeyDown","isDefaultPrevented","key","currentTarget","click","handleKeyUp","undefined","resultProps","role","tabIndex","href"],"mappings":"AAAA,SAASA,KAAK,EAAEC,KAAK,QAAQ,0BAA0B;AACvD,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,YAAYC,WAAW,QAAQ;AAG/B;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BC,GACD,OAAO,SAASC,mBACdC,IAAW,EACXC,KAAa;IAEb,MAAM,EACJC,QAAQ,EACRC,oBAAoB,KAAK,EACzB,CAAC,gBAAgB,EAAEC,YAAY,EAC/BC,OAAO,EACPC,SAAS,EACTC,OAAO,EACP,GAAGC,MACJ,GAAGP,kBAAAA,mBAAAA,QAAS,CAAC;IAEd,MAAMQ,yBAAyB,OAAOL,iBAAiB,WAAWA,iBAAiB,SAASA;IAE5F,MAAMM,aAAaR,YAAYC,qBAAqBM;IAEpD,MAAME,cAAcd,iBAAiB,CAACe;QACpC,IAAIF,YAAY;YACdE,GAAGC,cAAc;YACjBD,GAAGE,eAAe;QACpB,OAAO;YACLT,oBAAAA,8BAAAA,QAAUO;QACZ;IACF;IAEA,MAAMG,gBAAgBlB,iBAAiB,CAACe;QACtCN,sBAAAA,gCAAAA,UAAYM;QAEZ,IAAIA,GAAGI,kBAAkB,IAAI;YAC3B;QACF;QAEA,MAAMC,MAAML,GAAGK,GAAG;QA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9 +9,8 @@ import { useARIAButtonProps } from './useARIAButtonProps';
9
9
  * for multiple scenarios of shorthand properties. Ensuring 1st rule of ARIA for cases
10
10
  * where no attribute addition is required.
11
11
  */ export const useARIAButtonShorthand = (value, options)=>{
12
- var _shorthand;
13
12
  const shorthand = resolveShorthand(value, options);
14
13
  var _shorthand_as;
15
- const shorthandARIAButton = useARIAButtonProps((_shorthand_as = (_shorthand = shorthand) === null || _shorthand === void 0 ? void 0 : _shorthand.as) !== null && _shorthand_as !== void 0 ? _shorthand_as : 'button', shorthand);
14
+ const shorthandARIAButton = useARIAButtonProps((_shorthand_as = shorthand === null || shorthand === void 0 ? void 0 : shorthand.as) !== null && _shorthand_as !== void 0 ? _shorthand_as : 'button', shorthand);
16
15
  return shorthand && shorthandARIAButton;
17
16
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["useARIAButtonShorthand.ts"],"sourcesContent":["import { resolveShorthand } from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from './useARIAButtonProps';\nimport type { ResolveShorthandFunction } from '@fluentui/react-utilities';\nimport type { ARIAButtonProps, ARIAButtonSlotProps, ARIAButtonType } from './types';\n\n/**\n * @internal\n *\n * This function expects to receive a slot, if `as` property is not desired use `useARIAButtonProps` instead\n *\n * Button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec\n * for multiple scenarios of shorthand properties. Ensuring 1st rule of ARIA for cases\n * where no attribute addition is required.\n */\nexport const useARIAButtonShorthand: ResolveShorthandFunction<ARIAButtonSlotProps> = (value, options) => {\n const shorthand = resolveShorthand(value, options);\n const shorthandARIAButton = useARIAButtonProps<ARIAButtonType, ARIAButtonProps>(shorthand?.as ?? 'button', shorthand);\n return shorthand && shorthandARIAButton;\n};\n"],"names":["resolveShorthand","useARIAButtonProps","useARIAButtonShorthand","value","options","shorthand","shorthandARIAButton","as"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,kBAAkB,QAAQ,uBAAuB;AAI1D;;;;;;;;CAQC,GACD,OAAO,MAAMC,yBAAwE,CAACC,OAAOC;QAEXC;IADhF,MAAMA,YAAYL,iBAAiBG,OAAOC;QACsCC;IAAhF,MAAMC,sBAAsBL,mBAAoDI,CAAAA,iBAAAA,aAAAA,uBAAAA,iCAAAA,WAAWE,EAAE,cAAbF,2BAAAA,gBAAiB,UAAUA;IAC3G,OAAOA,aAAaC;AACtB,EAAE"}
1
+ {"version":3,"sources":["useARIAButtonShorthand.ts"],"sourcesContent":["import { resolveShorthand } from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from './useARIAButtonProps';\nimport type { ResolveShorthandFunction } from '@fluentui/react-utilities';\nimport type { ARIAButtonProps, ARIAButtonSlotProps, ARIAButtonType } from './types';\n\n/**\n * @internal\n *\n * This function expects to receive a slot, if `as` property is not desired use `useARIAButtonProps` instead\n *\n * Button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec\n * for multiple scenarios of shorthand properties. Ensuring 1st rule of ARIA for cases\n * where no attribute addition is required.\n */\nexport const useARIAButtonShorthand: ResolveShorthandFunction<ARIAButtonSlotProps> = (value, options) => {\n const shorthand = resolveShorthand(value, options);\n const shorthandARIAButton = useARIAButtonProps<ARIAButtonType, ARIAButtonProps>(shorthand?.as ?? 'button', shorthand);\n return shorthand && shorthandARIAButton;\n};\n"],"names":["resolveShorthand","useARIAButtonProps","useARIAButtonShorthand","value","options","shorthand","shorthandARIAButton","as"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,kBAAkB,QAAQ,uBAAuB;AAI1D;;;;;;;;CAQC,GACD,OAAO,MAAMC,yBAAwE,CAACC,OAAOC;IAC3F,MAAMC,YAAYL,iBAAiBG,OAAOC;QACsCC;IAAhF,MAAMC,sBAAsBL,mBAAoDI,CAAAA,gBAAAA,sBAAAA,gCAAAA,UAAWE,EAAE,cAAbF,2BAAAA,gBAAiB,UAAUA;IAC3G,OAAOA,aAAaC;AACtB,EAAE"}
@@ -21,13 +21,11 @@ function useARIAButtonProps(type, props) {
21
21
  ev.preventDefault();
22
22
  ev.stopPropagation();
23
23
  } else {
24
- var _onClick;
25
- (_onClick = onClick) === null || _onClick === void 0 ? void 0 : _onClick(ev);
24
+ onClick === null || onClick === void 0 ? void 0 : onClick(ev);
26
25
  }
27
26
  });
28
27
  const handleKeyDown = (0, _reactutilities.useEventCallback)((ev)=>{
29
- var _onKeyDown;
30
- (_onKeyDown = onKeyDown) === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(ev);
28
+ onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(ev);
31
29
  if (ev.isDefaultPrevented()) {
32
30
  return;
33
31
  }
@@ -46,8 +44,7 @@ function useARIAButtonProps(type, props) {
46
44
  }
47
45
  });
48
46
  const handleKeyUp = (0, _reactutilities.useEventCallback)((ev)=>{
49
- var _onKeyUp;
50
- (_onKeyUp = onKeyUp) === null || _onKeyUp === void 0 ? void 0 : _onKeyUp(ev);
47
+ onKeyUp === null || onKeyUp === void 0 ? void 0 : onKeyUp(ev);
51
48
  if (ev.isDefaultPrevented()) {
52
49
  return;
53
50
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["useARIAButtonProps.js"],"sourcesContent":["import { Enter, Space } from '@fluentui/keyboard-keys';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport * as React from 'react';\n/**\n * @internal\n *\n * Button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec\n * for multiple scenarios of non native button elements. Ensuring 1st rule of ARIA for cases\n * where no attribute addition is required.\n *\n * @param type - the proper scenario to be interpreted by the hook.\n * 1. `button` - Minimal interference from the hook, as semantic button already supports most of the states\n * 2. `a` or `div` - Proper keyboard/mouse handling plus other support to ensure ARIA behavior\n * @param props - the props to be passed down the line to the desired element.\n * This hook will encapsulate proper properties, such as `onClick`, `onKeyDown`, `onKeyUp`, etc,.\n *\n * @example\n * ```tsx\n * const buttonProps = useARIAButtonProps('a', {\n * href: './some-route'\n * onClick: () => console.log('this should run both on click and Space and Enter')\n * })\n *\n * // ...\n *\n * return (\n * <a {...buttonProps}>This anchor will behave as a proper button</a>\n * )\n * ```\n */ export function useARIAButtonProps(type, props) {\n const { disabled, disabledFocusable = false, ['aria-disabled']: ariaDisabled, onClick, onKeyDown, onKeyUp, ...rest } = props !== null && props !== void 0 ? props : {};\n const normalizedARIADisabled = typeof ariaDisabled === 'string' ? ariaDisabled === 'true' : ariaDisabled;\n const isDisabled = disabled || disabledFocusable || normalizedARIADisabled;\n const handleClick = useEventCallback((ev)=>{\n if (isDisabled) {\n ev.preventDefault();\n ev.stopPropagation();\n } else {\n var _onClick;\n (_onClick = onClick) === null || _onClick === void 0 ? void 0 : _onClick(ev);\n }\n });\n const handleKeyDown = useEventCallback((ev)=>{\n var _onKeyDown;\n (_onKeyDown = onKeyDown) === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(ev);\n if (ev.isDefaultPrevented()) {\n return;\n }\n const key = ev.key;\n if (isDisabled && (key === Enter || key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n return;\n }\n if (key === Space) {\n ev.preventDefault();\n return;\n } else if (key === Enter) {\n ev.preventDefault();\n ev.currentTarget.click();\n }\n });\n const handleKeyUp = useEventCallback((ev)=>{\n var _onKeyUp;\n (_onKeyUp = onKeyUp) === null || _onKeyUp === void 0 ? void 0 : _onKeyUp(ev);\n if (ev.isDefaultPrevented()) {\n return;\n }\n const key = ev.key;\n if (isDisabled && (key === Enter || key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n return;\n }\n if (key === Space) {\n ev.preventDefault();\n ev.currentTarget.click();\n }\n });\n // If a <button> tag is to be rendered we just need to set disabled and aria-disabled correctly\n if (type === 'button' || type === undefined) {\n return {\n ...rest,\n disabled: disabled && !disabledFocusable,\n 'aria-disabled': disabledFocusable ? true : normalizedARIADisabled,\n // onclick should still use internal handler to ensure prevention if disabled\n // if disabledFocusable then there's no requirement for handlers as those events should not be propagated\n onClick: disabledFocusable ? undefined : handleClick,\n onKeyUp: disabledFocusable ? undefined : onKeyUp,\n onKeyDown: disabledFocusable ? undefined : onKeyDown\n };\n } else {\n const resultProps = {\n role: 'button',\n tabIndex: disabled && !disabledFocusable ? undefined : 0,\n ...rest,\n // If it's not a <button> than listeners are required even with disabledFocusable\n // Since you cannot assure the default behavior of the element\n // E.g: <a> will redirect on click\n onClick: handleClick,\n onKeyUp: handleKeyUp,\n onKeyDown: handleKeyDown,\n 'aria-disabled': disabled || disabledFocusable || normalizedARIADisabled\n };\n if (type === 'a' && isDisabled) {\n resultProps.href = undefined;\n }\n return resultProps;\n }\n}\n"],"names":["useARIAButtonProps","type","props","disabled","disabledFocusable","ariaDisabled","onClick","onKeyDown","onKeyUp","rest","normalizedARIADisabled","isDisabled","handleClick","useEventCallback","ev","preventDefault","stopPropagation","_onClick","handleKeyDown","_onKeyDown","isDefaultPrevented","key","Enter","Space","currentTarget","click","handleKeyUp","_onKeyUp","undefined","resultProps","role","tabIndex","href"],"mappings":";;;;+BA6BoBA;;;eAAAA;;;;8BA7BS;gCACI;iEACV;AA2BZ,SAASA,mBAAmBC,IAAI,EAAEC,KAAK;IAC9C,MAAM,EAAEC,QAAQ,EAAEC,oBAAoB,KAAK,EAAE,CAAC,gBAAgB,EAAEC,YAAY,EAAEC,OAAO,EAAEC,SAAS,EAAEC,OAAO,EAAE,GAAGC,MAAM,GAAGP,UAAU,QAAQA,UAAU,KAAK,IAAIA,QAAQ,CAAC;IACrK,MAAMQ,yBAAyB,OAAOL,iBAAiB,WAAWA,iBAAiB,SAASA;IAC5F,MAAMM,aAAaR,YAAYC,qBAAqBM;IACpD,MAAME,cAAcC,IAAAA,gCAAgB,EAAC,CAACC;QAClC,IAAIH,YAAY;YACZG,GAAGC,cAAc;YACjBD,GAAGE,eAAe;QACtB,OAAO;YACH,IAAIC;YACHA,CAAAA,WAAWX,OAAM,MAAO,QAAQW,aAAa,KAAK,IAAI,KAAK,IAAIA,SAASH;QAC7E;IACJ;IACA,MAAMI,gBAAgBL,IAAAA,g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AMsB,cAAc;YAChBC,MAAM;YACNC,UAAU5B,YAAY,CAACC,oBAAoBwB,YAAY;YACvD,GAAGnB,IAAI;YACP,iFAAiF;YACjF,8DAA8D;YAC9D,kCAAkC;YAClCH,SAASM;YACTJ,SAASkB;YACTnB,WAAWW;YACX,iBAAiBf,YAAYC,qBAAqBM;QACtD;QACA,IAAIT,SAAS,OAAOU,YAAY;YAC5BkB,YAAYG,IAAI,GAAGJ;QACvB;QACA,OAAOC;IACX;AACJ"}
1
+ {"version":3,"sources":["useARIAButtonProps.js"],"sourcesContent":["import { Enter, Space } from '@fluentui/keyboard-keys';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport * as React from 'react';\n/**\n * @internal\n *\n * Button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec\n * for multiple scenarios of non native button elements. Ensuring 1st rule of ARIA for cases\n * where no attribute addition is required.\n *\n * @param type - the proper scenario to be interpreted by the hook.\n * 1. `button` - Minimal interference from the hook, as semantic button already supports most of the states\n * 2. `a` or `div` - Proper keyboard/mouse handling plus other support to ensure ARIA behavior\n * @param props - the props to be passed down the line to the desired element.\n * This hook will encapsulate proper properties, such as `onClick`, `onKeyDown`, `onKeyUp`, etc,.\n *\n * @example\n * ```tsx\n * const buttonProps = useARIAButtonProps('a', {\n * href: './some-route'\n * onClick: () => console.log('this should run both on click and Space and Enter')\n * })\n *\n * // ...\n *\n * return (\n * <a {...buttonProps}>This anchor will behave as a proper button</a>\n * )\n * ```\n */ export function useARIAButtonProps(type, props) {\n const { disabled, disabledFocusable = false, ['aria-disabled']: ariaDisabled, onClick, onKeyDown, onKeyUp, ...rest } = props !== null && props !== void 0 ? props : {};\n const normalizedARIADisabled = typeof ariaDisabled === 'string' ? ariaDisabled === 'true' : ariaDisabled;\n const isDisabled = disabled || disabledFocusable || normalizedARIADisabled;\n const handleClick = useEventCallback((ev)=>{\n if (isDisabled) {\n ev.preventDefault();\n ev.stopPropagation();\n } else {\n onClick === null || onClick === void 0 ? void 0 : onClick(ev);\n }\n });\n const handleKeyDown = useEventCallback((ev)=>{\n onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(ev);\n if (ev.isDefaultPrevented()) {\n return;\n }\n const key = ev.key;\n if (isDisabled && (key === Enter || key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n return;\n }\n if (key === Space) {\n ev.preventDefault();\n return;\n } else if (key === Enter) {\n ev.preventDefault();\n ev.currentTarget.click();\n }\n });\n const handleKeyUp = useEventCallback((ev)=>{\n onKeyUp === null || onKeyUp === void 0 ? void 0 : onKeyUp(ev);\n if (ev.isDefaultPrevented()) {\n return;\n }\n const key = ev.key;\n if (isDisabled && (key === Enter || key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n return;\n }\n if (key === Space) {\n ev.preventDefault();\n ev.currentTarget.click();\n }\n });\n // If a <button> tag is to be rendered we just need to set disabled and aria-disabled correctly\n if (type === 'button' || type === undefined) {\n return {\n ...rest,\n disabled: disabled && !disabledFocusable,\n 'aria-disabled': disabledFocusable ? true : normalizedARIADisabled,\n // onclick should still use internal handler to ensure prevention if disabled\n // if disabledFocusable then there's no requirement for handlers as those events should not be propagated\n onClick: disabledFocusable ? undefined : handleClick,\n onKeyUp: disabledFocusable ? undefined : onKeyUp,\n onKeyDown: disabledFocusable ? undefined : onKeyDown\n };\n } else {\n const resultProps = {\n role: 'button',\n tabIndex: disabled && !disabledFocusable ? undefined : 0,\n ...rest,\n // If it's not a <button> than listeners are required even with disabledFocusable\n // Since you cannot assure the default behavior of the element\n // E.g: <a> will redirect on click\n onClick: handleClick,\n onKeyUp: handleKeyUp,\n onKeyDown: handleKeyDown,\n 'aria-disabled': disabled || disabledFocusable || normalizedARIADisabled\n };\n if (type === 'a' && isDisabled) {\n resultProps.href = undefined;\n }\n return resultProps;\n }\n}\n"],"names":["useARIAButtonProps","type","props","disabled","disabledFocusable","ariaDisabled","onClick","onKeyDown","onKeyUp","rest","normalizedARIADisabled","isDisabled","handleClick","useEventCallback","ev","preventDefault","stopPropagation","handleKeyDown","isDefaultPrevented","key","Enter","Space","currentTarget","click","handleKeyUp","undefined","resultProps","role","tabIndex","href"],"mappings":";;;;+BA6BoBA;;;eAAAA;;;;8BA7BS;gCACI;iEACV;AA2BZ,SAASA,mBAAmBC,IAAI,EAAEC,KAAK;IAC9C,MAAM,EAAEC,QAAQ,EAAEC,oBAAoB,KAAK,EAAE,CAAC,gBAAgB,EAAEC,YAAY,EAAEC,OAAO,EAAEC,SAAS,EAAEC,OAAO,EAAE,GAAGC,MAAM,GAAGP,UAAU,QAAQA,UAAU,KAAK,IAAIA,QAAQ,CAAC;IACrK,MAAMQ,yBAAyB,OAAOL,iBAAiB,WAAWA,iBAAiB,SAASA;IAC5F,MAAMM,aAAaR,YAAYC,qBAAqBM;IACpD,MAAME,cAAcC,IAAAA,gCAAgB,EAAC,CAACC;QAClC,IAAIH,YAAY;YACZG,GAAGC,cAAc;YACjBD,GAAGE,eAAe;QACtB,OAAO;YACHV,YAAY,QAAQA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQQ;QAC9D;IACJ;IACA,MAAMG,gBAAgBJ,IAAAA,gCAAgB,EAAC,CAACC;QACpCP,cAAc,QAAQA,cAAc,KAAK,IAAI,KAAK,IAAIA,UAAUO;QAChE,IAAIA,GAAGI,kBAAkB,IAAI;YACzB;QACJ;QACA,MAAMC,MAAML,GAAGK,GAAG;QAClB,IAAIR,cAAeQ,CAAAA,QAAQC,mBAAK,IAAID,QAAQE,mBAAK,AAAD,GAAI;YAChDP,GAAGC,cAAc;YACjBD,GAAGE,eAAe;YAClB;QACJ;QACA,IAAIG,QAAQE,mBAAK,EAAE;YACfP,GAAGC,cAAc;YACjB;QACJ,OAAO,IAAII,QAAQC,mBAAK,EAAE;YACtBN,GAAGC,cAAc;YACjBD,GAAGQ,aAAa,CAACC,KAAK;QAC1B;IACJ;IACA,MAAMC,cAAcX,IAAAA,gCAAgB,EAAC,CAACC;QAClCN,YAAY,QAAQA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQM;QAC1D,IAAIA,GAAGI,kBAAkB,IAAI;YACzB;QACJ;QACA,MAAMC,MAAML,GAAGK,GAAG;QAClB,IAAIR,cAAeQ,CAAAA,QAAQC,mBAAK,IAAID,QAAQE,mBAAK,AAAD,GAAI;YAChDP,GAAGC,cAAc;YACjBD,GAAGE,eAAe;YAClB;QACJ;QACA,IAAIG,QAAQE,mBAAK,EAAE;YACfP,GAAGC,cAAc;YACjBD,GAAGQ,aAAa,CAACC,KAAK;QAC1B;IACJ;IACA,+FAA+F;IAC/F,IAAItB,SAAS,YAAYA,SAASwB,WAAW;QACzC,OAAO;YACH,GAAGhB,IAAI;YACPN,UAAUA,YAAY,CAACC;YACvB,iBAAiBA,oBAAoB,OAAOM;YAC5C,6EAA6E;YAC7E,yGAAyG;YACzGJ,SAASF,oBAAoBqB,YAAYb;YACzCJ,SAASJ,oBAAoBqB,YAAYjB;YACzCD,WAAWH,oBAAoBqB,YAAYlB;QAC/C;IACJ,OAAO;QACH,MAAMmB,cAAc;YAChBC,MAAM;YACNC,UAAUzB,YAAY,CAACC,oBAAoBqB,YAAY;YACvD,GAAGhB,IAAI;YACP,iFAAiF;YACjF,8DAA8D;YAC9D,kCAAkC;YAClCH,SAASM;YACTJ,SAASgB;YACTjB,WAAWU;YACX,iBAAiBd,YAAYC,qBAAqBM;QACtD;QACA,IAAIT,SAAS,OAAOU,YAAY;YAC5Be,YAAYG,IAAI,GAAGJ;QACvB;QACA,OAAOC;IACX;AACJ"}
@@ -11,9 +11,8 @@ Object.defineProperty(exports, "useARIAButtonShorthand", {
11
11
  const _reactutilities = require("@fluentui/react-utilities");
12
12
  const _useARIAButtonProps = require("./useARIAButtonProps");
13
13
  const useARIAButtonShorthand = (value, options)=>{
14
- var _shorthand;
15
14
  const shorthand = (0, _reactutilities.resolveShorthand)(value, options);
16
15
  var _shorthand_as;
17
- const shorthandARIAButton = (0, _useARIAButtonProps.useARIAButtonProps)((_shorthand_as = (_shorthand = shorthand) === null || _shorthand === void 0 ? void 0 : _shorthand.as) !== null && _shorthand_as !== void 0 ? _shorthand_as : 'button', shorthand);
16
+ const shorthandARIAButton = (0, _useARIAButtonProps.useARIAButtonProps)((_shorthand_as = shorthand === null || shorthand === void 0 ? void 0 : shorthand.as) !== null && _shorthand_as !== void 0 ? _shorthand_as : 'button', shorthand);
18
17
  return shorthand && shorthandARIAButton;
19
18
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["useARIAButtonShorthand.js"],"sourcesContent":["import { resolveShorthand } from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from './useARIAButtonProps';\n/**\n * @internal\n *\n * This function expects to receive a slot, if `as` property is not desired use `useARIAButtonProps` instead\n *\n * Button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec\n * for multiple scenarios of shorthand properties. Ensuring 1st rule of ARIA for cases\n * where no attribute addition is required.\n */ export const useARIAButtonShorthand = (value, options)=>{\n var _shorthand;\n const shorthand = resolveShorthand(value, options);\n var _shorthand_as;\n const shorthandARIAButton = useARIAButtonProps((_shorthand_as = (_shorthand = shorthand) === null || _shorthand === void 0 ? void 0 : _shorthand.as) !== null && _shorthand_as !== void 0 ? _shorthand_as : 'button', shorthand);\n return shorthand && shorthandARIAButton;\n};\n"],"names":["useARIAButtonShorthand","value","options","_shorthand","shorthand","resolveShorthand","_shorthand_as","shorthandARIAButton","useARIAButtonProps","as"],"mappings":";;;;+BAUiBA;;;eAAAA;;;gCAVgB;oCACE;AASxB,MAAMA,yBAAyB,CAACC,OAAOC;IAC9C,IAAIC;IACJ,MAAMC,YAAYC,IAAAA,gCAAgB,EAACJ,OAAOC;IAC1C,IAAII;IACJ,MAAMC,sBAAsBC,IAAAA,sCAAkB,EAAC,AAACF,CAAAA,gBAAgB,AAACH,CAAAA,aAAaC,SAAQ,MAAO,QAAQD,eAAe,KAAK,IAAI,KAAK,IAAIA,WAAWM,EAAE,AAAD,MAAO,QAAQH,kBAAkB,KAAK,IAAIA,gBAAgB,UAAUF;IACtN,OAAOA,aAAaG;AACxB"}
1
+ {"version":3,"sources":["useARIAButtonShorthand.js"],"sourcesContent":["import { resolveShorthand } from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from './useARIAButtonProps';\n/**\n * @internal\n *\n * This function expects to receive a slot, if `as` property is not desired use `useARIAButtonProps` instead\n *\n * Button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec\n * for multiple scenarios of shorthand properties. Ensuring 1st rule of ARIA for cases\n * where no attribute addition is required.\n */ export const useARIAButtonShorthand = (value, options)=>{\n const shorthand = resolveShorthand(value, options);\n var _shorthand_as;\n const shorthandARIAButton = useARIAButtonProps((_shorthand_as = shorthand === null || shorthand === void 0 ? void 0 : shorthand.as) !== null && _shorthand_as !== void 0 ? _shorthand_as : 'button', shorthand);\n return shorthand && shorthandARIAButton;\n};\n"],"names":["useARIAButtonShorthand","value","options","shorthand","resolveShorthand","_shorthand_as","shorthandARIAButton","useARIAButtonProps","as"],"mappings":";;;;+BAUiBA;;;eAAAA;;;gCAVgB;oCACE;AASxB,MAAMA,yBAAyB,CAACC,OAAOC;IAC9C,MAAMC,YAAYC,IAAAA,gCAAgB,EAACH,OAAOC;IAC1C,IAAIG;IACJ,MAAMC,sBAAsBC,IAAAA,sCAAkB,EAAC,AAACF,CAAAA,gBAAgBF,cAAc,QAAQA,cAAc,KAAK,IAAI,KAAK,IAAIA,UAAUK,EAAE,AAAD,MAAO,QAAQH,kBAAkB,KAAK,IAAIA,gBAAgB,UAAUF;IACrM,OAAOA,aAAaG;AACxB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-aria",
3
- "version": "9.3.35",
3
+ "version": "9.3.37",
4
4
  "description": "React helper to ensure ARIA",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -31,8 +31,8 @@
31
31
  "@fluentui/scripts-tasks": "*"
32
32
  },
33
33
  "dependencies": {
34
- "@fluentui/keyboard-keys": "^9.0.4",
35
- "@fluentui/react-utilities": "^9.13.2",
34
+ "@fluentui/keyboard-keys": "^9.0.5",
35
+ "@fluentui/react-utilities": "^9.13.4",
36
36
  "@swc/helpers": "^0.5.1"
37
37
  },
38
38
  "peerDependencies": {