@fluentui/react-aria 9.0.0-alpha.40 → 9.0.0-alpha.45

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,109 @@
2
2
  "name": "@fluentui/react-aria",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 29 Sep 2021 08:05:12 GMT",
5
+ "date": "Tue, 05 Oct 2021 12:47:00 GMT",
6
+ "tag": "@fluentui/react-aria_v9.0.0-alpha.45",
7
+ "version": "9.0.0-alpha.45",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "beachball",
12
+ "package": "@fluentui/react-aria",
13
+ "comment": "Bump @fluentui/react-make-styles to v9.0.0-alpha.78",
14
+ "commit": "c41b8f8996acd5b970d894fc910cc4d661f8e3cb"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-aria",
19
+ "comment": "Bump @fluentui/jest-serializer-make-styles to v9.0.0-alpha.53",
20
+ "commit": "c41b8f8996acd5b970d894fc910cc4d661f8e3cb"
21
+ }
22
+ ]
23
+ }
24
+ },
25
+ {
26
+ "date": "Tue, 05 Oct 2021 09:28:07 GMT",
27
+ "tag": "@fluentui/react-aria_v9.0.0-alpha.44",
28
+ "version": "9.0.0-alpha.44",
29
+ "comments": {
30
+ "prerelease": [
31
+ {
32
+ "author": "beachball",
33
+ "package": "@fluentui/react-aria",
34
+ "comment": "Bump @fluentui/react-make-styles to v9.0.0-alpha.77",
35
+ "commit": "3b16677a03035dcf03c1297268b85c6d4bd3f839"
36
+ },
37
+ {
38
+ "author": "beachball",
39
+ "package": "@fluentui/react-aria",
40
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-alpha.56",
41
+ "commit": "3b16677a03035dcf03c1297268b85c6d4bd3f839"
42
+ },
43
+ {
44
+ "author": "beachball",
45
+ "package": "@fluentui/react-aria",
46
+ "comment": "Bump @fluentui/jest-serializer-make-styles to v9.0.0-alpha.52",
47
+ "commit": "3b16677a03035dcf03c1297268b85c6d4bd3f839"
48
+ }
49
+ ]
50
+ }
51
+ },
52
+ {
53
+ "date": "Fri, 01 Oct 2021 14:13:08 GMT",
54
+ "tag": "@fluentui/react-aria_v9.0.0-alpha.43",
55
+ "version": "9.0.0-alpha.43",
56
+ "comments": {
57
+ "prerelease": [
58
+ {
59
+ "author": "lingfangao@hotmail.com",
60
+ "package": "@fluentui/react-aria",
61
+ "comment": "Bump v9 prerelease versions to rerelease",
62
+ "commit": "4fa0856ad0353b787b8ae59229e6f64ef0719824"
63
+ },
64
+ {
65
+ "author": "beachball",
66
+ "package": "@fluentui/react-aria",
67
+ "comment": "Bump @fluentui/keyboard-keys to v9.0.0-alpha.5",
68
+ "commit": "4fa0856ad0353b787b8ae59229e6f64ef0719824"
69
+ },
70
+ {
71
+ "author": "beachball",
72
+ "package": "@fluentui/react-aria",
73
+ "comment": "Bump @fluentui/react-make-styles to v9.0.0-alpha.76",
74
+ "commit": "4fa0856ad0353b787b8ae59229e6f64ef0719824"
75
+ },
76
+ {
77
+ "author": "beachball",
78
+ "package": "@fluentui/react-aria",
79
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-alpha.55",
80
+ "commit": "4fa0856ad0353b787b8ae59229e6f64ef0719824"
81
+ },
82
+ {
83
+ "author": "beachball",
84
+ "package": "@fluentui/react-aria",
85
+ "comment": "Bump @fluentui/jest-serializer-make-styles to v9.0.0-alpha.51",
86
+ "commit": "4fa0856ad0353b787b8ae59229e6f64ef0719824"
87
+ }
88
+ ]
89
+ }
90
+ },
91
+ {
92
+ "date": "Fri, 01 Oct 2021 12:30:46 GMT",
93
+ "tag": "@fluentui/react-aria_v9.0.0-alpha.41",
94
+ "version": "9.0.0-alpha.41",
95
+ "comments": {
96
+ "prerelease": [
97
+ {
98
+ "author": "bsunderhus@microsoft.com",
99
+ "package": "@fluentui/react-aria",
100
+ "comment": "Removes disabled attribute when not required",
101
+ "commit": "c5f91bfccb65073eb01e4b4aa0b720bb6bf06b5d"
102
+ }
103
+ ]
104
+ }
105
+ },
106
+ {
107
+ "date": "Wed, 29 Sep 2021 08:06:11 GMT",
6
108
  "tag": "@fluentui/react-aria_v9.0.0-alpha.40",
7
109
  "version": "9.0.0-alpha.40",
8
110
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,55 @@
1
1
  # Change Log - @fluentui/react-aria
2
2
 
3
- This log was last generated on Wed, 29 Sep 2021 08:05:12 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 05 Oct 2021 12:47:00 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.0.0-alpha.45](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.0.0-alpha.45)
8
+
9
+ Tue, 05 Oct 2021 12:47:00 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.0.0-alpha.44..@fluentui/react-aria_v9.0.0-alpha.45)
11
+
12
+ ### Changes
13
+
14
+ - Bump @fluentui/react-make-styles to v9.0.0-alpha.78 ([PR #20108](https://github.com/microsoft/fluentui/pull/20108) by beachball)
15
+ - Bump @fluentui/jest-serializer-make-styles to v9.0.0-alpha.53 ([PR #20108](https://github.com/microsoft/fluentui/pull/20108) by beachball)
16
+
17
+ ## [9.0.0-alpha.44](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.0.0-alpha.44)
18
+
19
+ Tue, 05 Oct 2021 09:28:07 GMT
20
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.0.0-alpha.43..@fluentui/react-aria_v9.0.0-alpha.44)
21
+
22
+ ### Changes
23
+
24
+ - Bump @fluentui/react-make-styles to v9.0.0-alpha.77 ([PR #20081](https://github.com/microsoft/fluentui/pull/20081) by beachball)
25
+ - Bump @fluentui/react-utilities to v9.0.0-alpha.56 ([PR #20081](https://github.com/microsoft/fluentui/pull/20081) by beachball)
26
+ - Bump @fluentui/jest-serializer-make-styles to v9.0.0-alpha.52 ([PR #20081](https://github.com/microsoft/fluentui/pull/20081) by beachball)
27
+
28
+ ## [9.0.0-alpha.43](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.0.0-alpha.43)
29
+
30
+ Fri, 01 Oct 2021 14:13:08 GMT
31
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.0.0-alpha.41..@fluentui/react-aria_v9.0.0-alpha.43)
32
+
33
+ ### Changes
34
+
35
+ - Bump v9 prerelease versions to rerelease ([PR #20069](https://github.com/microsoft/fluentui/pull/20069) by lingfangao@hotmail.com)
36
+ - Bump @fluentui/keyboard-keys to v9.0.0-alpha.5 ([PR #20069](https://github.com/microsoft/fluentui/pull/20069) by beachball)
37
+ - Bump @fluentui/react-make-styles to v9.0.0-alpha.76 ([PR #20069](https://github.com/microsoft/fluentui/pull/20069) by beachball)
38
+ - Bump @fluentui/react-utilities to v9.0.0-alpha.55 ([PR #20069](https://github.com/microsoft/fluentui/pull/20069) by beachball)
39
+ - Bump @fluentui/jest-serializer-make-styles to v9.0.0-alpha.51 ([PR #20069](https://github.com/microsoft/fluentui/pull/20069) by beachball)
40
+
41
+ ## [9.0.0-alpha.41](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.0.0-alpha.41)
42
+
43
+ Fri, 01 Oct 2021 12:30:46 GMT
44
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.0.0-alpha.40..@fluentui/react-aria_v9.0.0-alpha.41)
45
+
46
+ ### Changes
47
+
48
+ - Removes disabled attribute when not required ([PR #18814](https://github.com/microsoft/fluentui/pull/18814) by bsunderhus@microsoft.com)
49
+
7
50
  ## [9.0.0-alpha.40](https://github.com/microsoft/fluentui/tree/@fluentui/react-aria_v9.0.0-alpha.40)
8
51
 
9
- Wed, 29 Sep 2021 08:05:12 GMT
52
+ Wed, 29 Sep 2021 08:06:11 GMT
10
53
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-aria_v9.0.0-alpha.39..@fluentui/react-aria_v9.0.0-alpha.40)
11
54
 
12
55
  ### Changes
@@ -4,22 +4,25 @@ import * as React_2 from 'react';
4
4
  import type { ResolveShorthandOptions } from '@fluentui/react-utilities';
5
5
  import type { ShorthandProps } from '@fluentui/react-utilities';
6
6
 
7
- export declare type ARIAButtonShorthandProps = IntrinsicShorthandProps<'button', 'div' | 'span' | 'a'>;
7
+ export declare type ARIAButtonShorthandProps = IntrinsicShorthandProps<'button', 'a'> & {
8
+ disabled?: boolean;
9
+ disabledFocusable?: boolean;
10
+ };
8
11
 
9
12
  /**
10
13
  * Merges disabled declaration with `aria-disabled`
11
14
  */
12
15
  export declare function mergeARIADisabled(shorthand: ObjectShorthandProps<{
13
- disabled?: boolean;
14
16
  'aria-disabled'?: string | boolean;
15
17
  children?: React_2.ReactNode;
18
+ disabled?: boolean;
16
19
  }>): boolean;
17
20
 
18
21
  /**
19
- * button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec
22
+ * Button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec
20
23
  * for multiple scenarios of shorthand properties. Ensuring 1st rule of ARIA for cases
21
- * where no attribute addition is required
24
+ * where no attribute addition is required.
22
25
  */
23
- export declare function useARIAButton<Required extends boolean = false>(value: ShorthandProps<ARIAButtonShorthandProps>, options?: ResolveShorthandOptions<ARIAButtonShorthandProps, Required>): Required extends false ? ARIAButtonShorthandProps | undefined : ARIAButtonShorthandProps;
26
+ export declare function useARIAButton<Required extends boolean = false>(shorthand: ShorthandProps<ARIAButtonShorthandProps>, options?: ResolveShorthandOptions<ARIAButtonShorthandProps, Required>): Required extends false ? ARIAButtonShorthandProps | undefined : ARIAButtonShorthandProps;
24
27
 
25
28
  export { }
@@ -1,8 +1,11 @@
1
1
  import type { IntrinsicShorthandProps, ResolveShorthandOptions, ShorthandProps } from '@fluentui/react-utilities';
2
- export declare type ARIAButtonShorthandProps = IntrinsicShorthandProps<'button', 'div' | 'span' | 'a'>;
2
+ export declare type ARIAButtonShorthandProps = IntrinsicShorthandProps<'button', 'a'> & {
3
+ disabled?: boolean;
4
+ disabledFocusable?: boolean;
5
+ };
3
6
  /**
4
- * button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec
7
+ * Button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec
5
8
  * for multiple scenarios of shorthand properties. Ensuring 1st rule of ARIA for cases
6
- * where no attribute addition is required
9
+ * where no attribute addition is required.
7
10
  */
8
- export declare function useARIAButton<Required extends boolean = false>(value: ShorthandProps<ARIAButtonShorthandProps>, options?: ResolveShorthandOptions<ARIAButtonShorthandProps, Required>): Required extends false ? ARIAButtonShorthandProps | undefined : ARIAButtonShorthandProps;
11
+ export declare function useARIAButton<Required extends boolean = false>(shorthand: ShorthandProps<ARIAButtonShorthandProps>, options?: ResolveShorthandOptions<ARIAButtonShorthandProps, Required>): Required extends false ? ARIAButtonShorthandProps | undefined : ARIAButtonShorthandProps;
@@ -1,100 +1,98 @@
1
1
  import { Enter, Space } from '@fluentui/keyboard-keys';
2
2
  import { resolveShorthand, useEventCallback } from '@fluentui/react-utilities';
3
- import { mergeARIADisabled } from '../utils/index';
4
3
  /**
5
- * button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec
4
+ * Button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec
6
5
  * for multiple scenarios of shorthand properties. Ensuring 1st rule of ARIA for cases
7
- * where no attribute addition is required
6
+ * where no attribute addition is required.
8
7
  */
9
8
 
10
- export function useARIAButton(value, options) {
11
- var shorthand = resolveShorthand(value, options);
9
+ export function useARIAButton(shorthand, options) {
10
+ var _a;
12
11
 
13
- var _a = shorthand || {},
14
- onClick = _a.onClick,
15
- onKeyDown = _a.onKeyDown,
16
- onKeyUp = _a.onKeyUp;
12
+ var shorthandProps = resolveShorthand(shorthand, options);
13
+
14
+ var _b = shorthandProps || {},
15
+ disabled = _b.disabled,
16
+ disabledFocusable = _b.disabledFocusable,
17
+ onClick = _b.onClick,
18
+ onKeyDown = _b.onKeyDown,
19
+ onKeyUp = _b.onKeyUp,
20
+ tabIndex = _b.tabIndex;
17
21
 
18
- var disabled = mergeARIADisabled(shorthand);
19
22
  var onClickHandler = useEventCallback(function (ev) {
20
- if (disabled) {
23
+ if (disabled || disabledFocusable) {
21
24
  ev.preventDefault();
22
25
  ev.stopPropagation();
23
26
  } else {
24
- if (typeof onClick === 'function') {
25
- onClick(ev);
26
- }
27
+ onClick === null || onClick === void 0 ? void 0 : onClick(ev);
27
28
  }
28
29
  });
29
30
  var onKeyDownHandler = useEventCallback(function (ev) {
30
- if (typeof onKeyDown === 'function') {
31
- onKeyDown(ev);
32
- }
31
+ onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(ev);
33
32
 
34
33
  if (ev.isDefaultPrevented()) {
35
34
  return;
36
35
  }
37
36
 
38
- if (disabled && (ev.key === Enter || ev.key === Space)) {
37
+ var key = ev.key;
38
+
39
+ if ((disabled || disabledFocusable) && (key === Enter || key === Space)) {
39
40
  ev.preventDefault();
40
41
  ev.stopPropagation();
41
42
  return;
42
43
  }
43
44
 
44
- if (ev.key === Space) {
45
+ if (key === Space) {
45
46
  ev.preventDefault();
46
47
  return;
47
48
  } // If enter is pressed, activate the button
48
- else if (ev.key === Enter) {
49
+ else if (key === Enter) {
49
50
  ev.preventDefault();
50
51
  ev.currentTarget.click();
51
52
  }
52
53
  });
53
54
  var onKeyupHandler = useEventCallback(function (ev) {
54
- if (typeof onKeyUp === 'function') {
55
- onKeyUp(ev);
56
- }
55
+ onKeyUp === null || onKeyUp === void 0 ? void 0 : onKeyUp(ev);
57
56
 
58
57
  if (ev.isDefaultPrevented()) {
59
58
  return;
60
59
  }
61
60
 
62
- if (disabled && (ev.key === Enter || ev.key === Space)) {
61
+ var key = ev.key;
62
+
63
+ if ((disabled || disabledFocusable) && (key === Enter || key === Space)) {
63
64
  ev.preventDefault();
64
65
  ev.stopPropagation();
65
66
  return;
66
67
  }
67
68
 
68
- if (ev.key === Space) {
69
+ if (key === Space) {
69
70
  ev.preventDefault();
70
71
  ev.currentTarget.click();
71
72
  }
72
73
  });
73
74
 
74
- if (shorthand) {
75
- if (shorthand.as === 'button' || shorthand.as === undefined) {
76
- return shorthand; // there's nothing to be done if as prop === 'button' or undefined
77
- }
75
+ if (shorthandProps) {
76
+ // If a <button> tag is to be rendered we just need to set disabled and aria-disabled correctly
77
+ if (shorthandProps.as === 'button' || shorthandProps.as === undefined) {
78
+ shorthandProps.disabled = disabled && !disabledFocusable;
79
+ shorthandProps['aria-disabled'] = disabledFocusable;
80
+ } // If an <a> tag is to be rendered we have to remove disabled and set aria-disabled, role and tabIndex as well as
81
+ // some event handlers.
82
+ else {
83
+ delete shorthandProps.disabled;
84
+ shorthandProps['aria-disabled'] = disabled || disabledFocusable;
85
+ shorthandProps.onClick = onClickHandler;
86
+ shorthandProps.onKeyDown = onKeyDownHandler;
87
+ shorthandProps.onKeyUp = onKeyupHandler;
88
+ shorthandProps.role = (_a = shorthandProps.role) !== null && _a !== void 0 ? _a : 'button';
89
+ shorthandProps.tabIndex = disabled && !disabledFocusable ? undefined : tabIndex !== null && tabIndex !== void 0 ? tabIndex : 0;
90
+ } // Remove non-DOM disabledFocusable prop
78
91
 
79
- if (!shorthand.hasOwnProperty('role')) {
80
- shorthand.role = 'button';
81
- }
82
-
83
- if (!shorthand.hasOwnProperty('aria-disabled')) {
84
- shorthand['aria-disabled'] = disabled;
85
- }
86
92
 
87
- shorthand.onClick = onClickHandler;
88
- shorthand.onKeyDown = onKeyDownHandler;
89
- shorthand.onKeyUp = onKeyupHandler; // Add keydown event handler for all other non-anchor elements.
90
-
91
- if (shorthand.as !== 'a') {
92
- if (!shorthand.hasOwnProperty('tabIndex')) {
93
- shorthand.tabIndex = disabled ? undefined : 0;
94
- }
95
- }
93
+ delete shorthandProps.disabledFocusable;
96
94
  }
97
95
 
98
- return shorthand;
96
+ return shorthandProps;
99
97
  }
100
98
  //# sourceMappingURL=useARIAButton.js.map
@@ -1 +1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,MAAI,cAAJ,EAAoB;AAClB;AACA,QAAI,cAAc,CAAC,EAAf,KAAsB,QAAtB,IAAkC,cAAc,CAAC,EAAf,KAAsB,SAA5D,EAAuE;AACrE,MAAA,cAAc,CAAC,QAAf,GAA0B,QAAQ,IAAI,CAAC,iBAAvC;AACA,MAAA,cAAc,CAAC,eAAD,CAAd,GAAkC,iBAAlC;AACD,KAHD,CAKA;AACA;AANA,SAOK;AACH,aAAO,cAAc,CAAC,QAAtB;AACA,MAAA,cAAc,CAAC,eAAD,CAAd,GAAkC,QAAQ,IAAI,iBAA9C;AACA,MAAA,cAAc,CAAC,OAAf,GAAyB,cAAzB;AACA,MAAA,cAAc,CAAC,SAAf,GAA2B,gBAA3B;AACA,MAAA,cAAc,CAAC,OAAf,GAAyB,cAAzB;AACA,MAAA,cAAc,CAAC,IAAf,GAAmB,CAAA,EAAA,GAAG,cAAc,CAAC,IAAlB,MAAsB,IAAtB,IAAsB,EAAA,KAAA,KAAA,CAAtB,GAAsB,EAAtB,GAA0B,QAA7C;AACA,MAAA,cAAc,CAAC,QAAf,GAA0B,QAAQ,IAAI,CAAC,iBAAb,GAAiC,SAAjC,GAA6C,QAAQ,KAAA,IAAR,IAAA,QAAQ,KAAA,KAAA,CAAR,GAAA,QAAA,GAAY,CAAnF;AACD,KAjBiB,CAmBlB;;;AACA,WAAO,cAAc,CAAC,iBAAtB;AACD;;AAED,SAAO,cAAP;AACD","sourceRoot":""}
@@ -4,7 +4,7 @@ import { ObjectShorthandProps } from '@fluentui/react-utilities';
4
4
  * Merges disabled declaration with `aria-disabled`
5
5
  */
6
6
  export declare function mergeARIADisabled(shorthand: ObjectShorthandProps<{
7
- disabled?: boolean;
8
7
  'aria-disabled'?: string | boolean;
9
8
  children?: React.ReactNode;
9
+ disabled?: boolean;
10
10
  }>): boolean;
@@ -2,9 +2,9 @@
2
2
  * Merges disabled declaration with `aria-disabled`
3
3
  */
4
4
  export function mergeARIADisabled(shorthand) {
5
- var _a, _b;
5
+ var _a;
6
6
 
7
- var disabled = (_b = (_a = shorthand.disabled) !== null && _a !== void 0 ? _a : shorthand['aria-disabled']) !== null && _b !== void 0 ? _b : undefined;
7
+ var disabled = (_a = shorthand.disabled) !== null && _a !== void 0 ? _a : shorthand['aria-disabled'];
8
8
 
9
9
  if (typeof disabled === 'string') {
10
10
  return disabled === 'false' ? false : true;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/mergeARIADisabled.ts"],"names":[],"mappings":"AAGA;;AAEG;AACH,OAAM,SAAU,iBAAV,CACJ,SADI,EAKF;;;AAEF,MAAM,QAAQ,GAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAG,SAAS,CAAC,QAAb,MAAqB,IAArB,IAAqB,EAAA,KAAA,KAAA,CAArB,GAAqB,EAArB,GAAyB,SAAS,CAAC,eAAD,CAAlC,MAAmD,IAAnD,IAAmD,EAAA,KAAA,KAAA,CAAnD,GAAmD,EAAnD,GAAuD,SAArE;;AACA,MAAI,OAAO,QAAP,KAAoB,QAAxB,EAAkC;AAChC,WAAO,QAAQ,KAAK,OAAb,GAAuB,KAAvB,GAA+B,IAAtC;AACD;;AACD,SAAO,QAAQ,KAAA,IAAR,IAAA,QAAQ,KAAA,KAAA,CAAR,GAAA,QAAA,GAAY,KAAnB;AACD","sourceRoot":""}
1
+ {"version":3,"sources":["../../src/utils/mergeARIADisabled.ts"],"names":[],"mappings":"AAGA;;AAEG;AACH,OAAM,SAAU,iBAAV,CACJ,SADI,EAKF;;;AAEF,MAAM,QAAQ,GAAA,CAAA,EAAA,GAAG,SAAS,CAAC,QAAb,MAAqB,IAArB,IAAqB,EAAA,KAAA,KAAA,CAArB,GAAqB,EAArB,GAAyB,SAAS,CAAC,eAAD,CAAhD;;AACA,MAAI,OAAO,QAAP,KAAoB,QAAxB,EAAkC;AAChC,WAAO,QAAQ,KAAK,OAAb,GAAuB,KAAvB,GAA+B,IAAtC;AACD;;AACD,SAAO,QAAQ,KAAA,IAAR,IAAA,QAAQ,KAAA,KAAA,CAAR,GAAA,QAAA,GAAY,KAAnB;AACD","sourceRoot":""}
@@ -1,8 +1,11 @@
1
1
  import type { IntrinsicShorthandProps, ResolveShorthandOptions, ShorthandProps } from '@fluentui/react-utilities';
2
- export declare type ARIAButtonShorthandProps = IntrinsicShorthandProps<'button', 'div' | 'span' | 'a'>;
2
+ export declare type ARIAButtonShorthandProps = IntrinsicShorthandProps<'button', 'a'> & {
3
+ disabled?: boolean;
4
+ disabledFocusable?: boolean;
5
+ };
3
6
  /**
4
- * button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec
7
+ * Button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec
5
8
  * for multiple scenarios of shorthand properties. Ensuring 1st rule of ARIA for cases
6
- * where no attribute addition is required
9
+ * where no attribute addition is required.
7
10
  */
8
- export declare function useARIAButton<Required extends boolean = false>(value: ShorthandProps<ARIAButtonShorthandProps>, options?: ResolveShorthandOptions<ARIAButtonShorthandProps, Required>): Required extends false ? ARIAButtonShorthandProps | undefined : ARIAButtonShorthandProps;
11
+ export declare function useARIAButton<Required extends boolean = false>(shorthand: ShorthandProps<ARIAButtonShorthandProps>, options?: ResolveShorthandOptions<ARIAButtonShorthandProps, Required>): Required extends false ? ARIAButtonShorthandProps | undefined : ARIAButtonShorthandProps;
@@ -8,104 +8,101 @@ exports.useARIAButton = void 0;
8
8
  var keyboard_keys_1 = /*#__PURE__*/require("@fluentui/keyboard-keys");
9
9
 
10
10
  var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
-
12
- var index_1 = /*#__PURE__*/require("../utils/index");
13
11
  /**
14
- * button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec
12
+ * Button keyboard handling, role, disabled and tabIndex implementation that ensures ARIA spec
15
13
  * for multiple scenarios of shorthand properties. Ensuring 1st rule of ARIA for cases
16
- * where no attribute addition is required
14
+ * where no attribute addition is required.
17
15
  */
18
16
 
19
17
 
20
- function useARIAButton(value, options) {
21
- var shorthand = react_utilities_1.resolveShorthand(value, options);
18
+ function useARIAButton(shorthand, options) {
19
+ var _a;
20
+
21
+ var shorthandProps = react_utilities_1.resolveShorthand(shorthand, options);
22
22
 
23
- var _a = shorthand || {},
24
- onClick = _a.onClick,
25
- onKeyDown = _a.onKeyDown,
26
- onKeyUp = _a.onKeyUp;
23
+ var _b = shorthandProps || {},
24
+ disabled = _b.disabled,
25
+ disabledFocusable = _b.disabledFocusable,
26
+ onClick = _b.onClick,
27
+ onKeyDown = _b.onKeyDown,
28
+ onKeyUp = _b.onKeyUp,
29
+ tabIndex = _b.tabIndex;
27
30
 
28
- var disabled = index_1.mergeARIADisabled(shorthand);
29
31
  var onClickHandler = react_utilities_1.useEventCallback(function (ev) {
30
- if (disabled) {
32
+ if (disabled || disabledFocusable) {
31
33
  ev.preventDefault();
32
34
  ev.stopPropagation();
33
35
  } else {
34
- if (typeof onClick === 'function') {
35
- onClick(ev);
36
- }
36
+ onClick === null || onClick === void 0 ? void 0 : onClick(ev);
37
37
  }
38
38
  });
39
39
  var onKeyDownHandler = react_utilities_1.useEventCallback(function (ev) {
40
- if (typeof onKeyDown === 'function') {
41
- onKeyDown(ev);
42
- }
40
+ onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(ev);
43
41
 
44
42
  if (ev.isDefaultPrevented()) {
45
43
  return;
46
44
  }
47
45
 
48
- if (disabled && (ev.key === keyboard_keys_1.Enter || ev.key === keyboard_keys_1.Space)) {
46
+ var key = ev.key;
47
+
48
+ if ((disabled || disabledFocusable) && (key === keyboard_keys_1.Enter || key === keyboard_keys_1.Space)) {
49
49
  ev.preventDefault();
50
50
  ev.stopPropagation();
51
51
  return;
52
52
  }
53
53
 
54
- if (ev.key === keyboard_keys_1.Space) {
54
+ if (key === keyboard_keys_1.Space) {
55
55
  ev.preventDefault();
56
56
  return;
57
57
  } // If enter is pressed, activate the button
58
- else if (ev.key === keyboard_keys_1.Enter) {
58
+ else if (key === keyboard_keys_1.Enter) {
59
59
  ev.preventDefault();
60
60
  ev.currentTarget.click();
61
61
  }
62
62
  });
63
63
  var onKeyupHandler = react_utilities_1.useEventCallback(function (ev) {
64
- if (typeof onKeyUp === 'function') {
65
- onKeyUp(ev);
66
- }
64
+ onKeyUp === null || onKeyUp === void 0 ? void 0 : onKeyUp(ev);
67
65
 
68
66
  if (ev.isDefaultPrevented()) {
69
67
  return;
70
68
  }
71
69
 
72
- if (disabled && (ev.key === keyboard_keys_1.Enter || ev.key === keyboard_keys_1.Space)) {
70
+ var key = ev.key;
71
+
72
+ if ((disabled || disabledFocusable) && (key === keyboard_keys_1.Enter || key === keyboard_keys_1.Space)) {
73
73
  ev.preventDefault();
74
74
  ev.stopPropagation();
75
75
  return;
76
76
  }
77
77
 
78
- if (ev.key === keyboard_keys_1.Space) {
78
+ if (key === keyboard_keys_1.Space) {
79
79
  ev.preventDefault();
80
80
  ev.currentTarget.click();
81
81
  }
82
82
  });
83
83
 
84
- if (shorthand) {
85
- if (shorthand.as === 'button' || shorthand.as === undefined) {
86
- return shorthand; // there's nothing to be done if as prop === 'button' or undefined
87
- }
88
-
89
- if (!shorthand.hasOwnProperty('role')) {
90
- shorthand.role = 'button';
91
- }
92
-
93
- if (!shorthand.hasOwnProperty('aria-disabled')) {
94
- shorthand['aria-disabled'] = disabled;
95
- }
96
-
97
- shorthand.onClick = onClickHandler;
98
- shorthand.onKeyDown = onKeyDownHandler;
99
- shorthand.onKeyUp = onKeyupHandler; // Add keydown event handler for all other non-anchor elements.
100
-
101
- if (shorthand.as !== 'a') {
102
- if (!shorthand.hasOwnProperty('tabIndex')) {
103
- shorthand.tabIndex = disabled ? undefined : 0;
104
- }
105
- }
84
+ if (shorthandProps) {
85
+ // If a <button> tag is to be rendered we just need to set disabled and aria-disabled correctly
86
+ if (shorthandProps.as === 'button' || shorthandProps.as === undefined) {
87
+ shorthandProps.disabled = disabled && !disabledFocusable;
88
+ shorthandProps['aria-disabled'] = disabledFocusable;
89
+ } // If an <a> tag is to be rendered we have to remove disabled and set aria-disabled, role and tabIndex as well as
90
+ // some event handlers.
91
+ else {
92
+ delete shorthandProps.disabled;
93
+ shorthandProps['aria-disabled'] = disabled || disabledFocusable;
94
+ shorthandProps.onClick = onClickHandler;
95
+ shorthandProps.onKeyDown = onKeyDownHandler;
96
+ shorthandProps.onKeyUp = onKeyupHandler;
97
+ shorthandProps.role = (_a = shorthandProps.role) !== null && _a !== void 0 ? _a : 'button';
98
+ shorthandProps.tabIndex = disabled && !disabledFocusable ? undefined : tabIndex !== null && tabIndex !== void 0 ? tabIndex : 0;
99
+ } // Remove non-DOM disabledFocusable prop
100
+
101
+
102
+ delete shorthandProps.disabledFocusable;
106
103
  }
107
104
 
108
- return shorthand;
105
+ return shorthandProps;
109
106
  }
110
107
 
111
108
  exports.useARIAButton = useARIAButton;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/hooks/useARIAButton.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,IAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;AAIA;;;;AAIG;;;AACH,SAAgB,aAAhB,CACE,KADF,EAEE,OAFF,EAEuE;AAErE,MAAM,SAAS,GAAG,iBAAA,CAAA,gBAAA,CAAiB,KAAjB,EAAwB,OAAxB,CAAlB;;AAEM,MAAA,EAAA,GAAmC,SAAS,IAAI,EAAhD;AAAA,MAAE,OAAO,GAAA,EAAA,CAAA,OAAT;AAAA,MAAW,SAAS,GAAA,EAAA,CAAA,SAApB;AAAA,MAAsB,OAAO,GAAA,EAAA,CAAA,OAA7B;;AAEN,MAAM,QAAQ,GAAG,OAAA,CAAA,iBAAA,CAAkB,SAAlB,CAAjB;AAEA,MAAM,cAAc,GAAwC,iBAAA,CAAA,gBAAA,CAAiB,UAAA,EAAA,EAAE;AAC7E,QAAI,QAAJ,EAAc;AACZ,MAAA,EAAE,CAA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AA,cAAc,CAAC,OAAf,GAAyB,cAAzB;AACA,MAAA,cAAc,CAAC,SAAf,GAA2B,gBAA3B;AACA,MAAA,cAAc,CAAC,OAAf,GAAyB,cAAzB;AACA,MAAA,cAAc,CAAC,IAAf,GAAmB,CAAA,EAAA,GAAG,cAAc,CAAC,IAAlB,MAAsB,IAAtB,IAAsB,EAAA,KAAA,KAAA,CAAtB,GAAsB,EAAtB,GAA0B,QAA7C;AACA,MAAA,cAAc,CAAC,QAAf,GAA0B,QAAQ,IAAI,CAAC,iBAAb,GAAiC,SAAjC,GAA6C,QAAQ,KAAA,IAAR,IAAA,QAAQ,KAAA,KAAA,CAAR,GAAA,QAAA,GAAY,CAAnF;AACD,KAjBiB,CAmBlB;;;AACA,WAAO,cAAc,CAAC,iBAAtB;AACD;;AAED,SAAO,cAAP;AACD;;AA1FD,OAAA,CAAA,aAAA,GAAA,aAAA","sourceRoot":""}
@@ -4,7 +4,7 @@ import { ObjectShorthandProps } from '@fluentui/react-utilities';
4
4
  * Merges disabled declaration with `aria-disabled`
5
5
  */
6
6
  export declare function mergeARIADisabled(shorthand: ObjectShorthandProps<{
7
- disabled?: boolean;
8
7
  'aria-disabled'?: string | boolean;
9
8
  children?: React.ReactNode;
9
+ disabled?: boolean;
10
10
  }>): boolean;
@@ -9,9 +9,9 @@ exports.mergeARIADisabled = void 0;
9
9
  */
10
10
 
11
11
  function mergeARIADisabled(shorthand) {
12
- var _a, _b;
12
+ var _a;
13
13
 
14
- var disabled = (_b = (_a = shorthand.disabled) !== null && _a !== void 0 ? _a : shorthand['aria-disabled']) !== null && _b !== void 0 ? _b : undefined;
14
+ var disabled = (_a = shorthand.disabled) !== null && _a !== void 0 ? _a : shorthand['aria-disabled'];
15
15
 
16
16
  if (typeof disabled === 'string') {
17
17
  return disabled === 'false' ? false : true;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/mergeARIADisabled.ts"],"names":[],"mappings":";;;;;;AAGA;;AAEG;;AACH,SAAgB,iBAAhB,CACE,SADF,EAKI;;;AAEF,MAAM,QAAQ,GAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAG,SAAS,CAAC,QAAb,MAAqB,IAArB,IAAqB,EAAA,KAAA,KAAA,CAArB,GAAqB,EAArB,GAAyB,SAAS,CAAC,eAAD,CAAlC,MAAmD,IAAnD,IAAmD,EAAA,KAAA,KAAA,CAAnD,GAAmD,EAAnD,GAAuD,SAArE;;AACA,MAAI,OAAO,QAAP,KAAoB,QAAxB,EAAkC;AAChC,WAAO,QAAQ,KAAK,OAAb,GAAuB,KAAvB,GAA+B,IAAtC;AACD;;AACD,SAAO,QAAQ,KAAA,IAAR,IAAA,QAAQ,KAAA,KAAA,CAAR,GAAA,QAAA,GAAY,KAAnB;AACD;;AAZD,OAAA,CAAA,iBAAA,GAAA,iBAAA","sourceRoot":""}
1
+ {"version":3,"sources":["../../src/utils/mergeARIADisabled.ts"],"names":[],"mappings":";;;;;;AAGA;;AAEG;;AACH,SAAgB,iBAAhB,CACE,SADF,EAKI;;;AAEF,MAAM,QAAQ,GAAA,CAAA,EAAA,GAAG,SAAS,CAAC,QAAb,MAAqB,IAArB,IAAqB,EAAA,KAAA,KAAA,CAArB,GAAqB,EAArB,GAAyB,SAAS,CAAC,eAAD,CAAhD;;AACA,MAAI,OAAO,QAAP,KAAoB,QAAxB,EAAkC;AAChC,WAAO,QAAQ,KAAK,OAAb,GAAuB,KAAvB,GAA+B,IAAtC;AACD;;AACD,SAAO,QAAQ,KAAA,IAAR,IAAA,QAAQ,KAAA,KAAA,CAAR,GAAA,QAAA,GAAY,KAAnB;AACD;;AAZD,OAAA,CAAA,iBAAA,GAAA,iBAAA","sourceRoot":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-aria",
3
- "version": "9.0.0-alpha.40",
3
+ "version": "9.0.0-alpha.45",
4
4
  "description": "React helper to ensure ARIA",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@fluentui/eslint-plugin": "*",
28
- "@fluentui/jest-serializer-make-styles": "9.0.0-alpha.49",
28
+ "@fluentui/jest-serializer-make-styles": "9.0.0-alpha.53",
29
29
  "@fluentui/react-conformance": "*",
30
30
  "@fluentui/scripts": "^1.0.0",
31
31
  "@types/enzyme": "3.10.3",
@@ -40,9 +40,9 @@
40
40
  "react-test-renderer": "^16.3.0"
41
41
  },
42
42
  "dependencies": {
43
- "@fluentui/keyboard-keys": "9.0.0-alpha.3",
44
- "@fluentui/react-make-styles": "9.0.0-alpha.74",
45
- "@fluentui/react-utilities": "9.0.0-alpha.53",
43
+ "@fluentui/keyboard-keys": "9.0.0-alpha.5",
44
+ "@fluentui/react-make-styles": "9.0.0-alpha.78",
45
+ "@fluentui/react-utilities": "9.0.0-alpha.56",
46
46
  "tslib": "^2.1.0"
47
47
  },
48
48
  "peerDependencies": {