@fluentui/react-button 9.3.58 → 9.3.59

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,21 +1,35 @@
1
1
  # Change Log - @fluentui/react-button
2
2
 
3
- This log was last generated on Thu, 14 Dec 2023 09:51:37 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 18 Dec 2023 14:36:10 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.3.59](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.3.59)
8
+
9
+ Mon, 18 Dec 2023 14:36:10 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.3.58..@fluentui/react-button_v9.3.59)
11
+
12
+ ### Patches
13
+
14
+ - chore: adopts useARIAButtonProps instead of deprecated method useARIAButtonShorthand ([PR #29735](https://github.com/microsoft/fluentui/pull/29735) by bernardo.sunderhus@gmail.com)
15
+ - Bump @fluentui/react-aria to v9.6.0 ([PR #30099](https://github.com/microsoft/fluentui/pull/30099) by beachball)
16
+ - Bump @fluentui/react-jsx-runtime to v9.0.22 ([PR #30099](https://github.com/microsoft/fluentui/pull/30099) by beachball)
17
+ - Bump @fluentui/react-shared-contexts to v9.13.2 ([PR #30099](https://github.com/microsoft/fluentui/pull/30099) by beachball)
18
+ - Bump @fluentui/react-tabster to v9.16.0 ([PR #30099](https://github.com/microsoft/fluentui/pull/30099) by beachball)
19
+ - Bump @fluentui/react-utilities to v9.15.4 ([PR #30099](https://github.com/microsoft/fluentui/pull/30099) by beachball)
20
+
7
21
  ## [9.3.58](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.3.58)
8
22
 
9
- Thu, 14 Dec 2023 09:51:37 GMT
23
+ Thu, 14 Dec 2023 09:58:46 GMT
10
24
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.3.57..@fluentui/react-button_v9.3.58)
11
25
 
12
26
  ### Patches
13
27
 
14
- - Bump @fluentui/react-aria to v9.5.0 ([commit](https://github.com/microsoft/fluentui/commit/80a1b02be2fbbdde916ac87fbf760e442a2295c4) by beachball)
15
- - Bump @fluentui/react-jsx-runtime to v9.0.21 ([commit](https://github.com/microsoft/fluentui/commit/80a1b02be2fbbdde916ac87fbf760e442a2295c4) by beachball)
16
- - Bump @fluentui/react-shared-contexts to v9.13.1 ([commit](https://github.com/microsoft/fluentui/commit/80a1b02be2fbbdde916ac87fbf760e442a2295c4) by beachball)
17
- - Bump @fluentui/react-tabster to v9.15.1 ([commit](https://github.com/microsoft/fluentui/commit/80a1b02be2fbbdde916ac87fbf760e442a2295c4) by beachball)
18
- - Bump @fluentui/react-utilities to v9.15.3 ([commit](https://github.com/microsoft/fluentui/commit/80a1b02be2fbbdde916ac87fbf760e442a2295c4) by beachball)
28
+ - Bump @fluentui/react-aria to v9.5.0 ([PR #30056](https://github.com/microsoft/fluentui/pull/30056) by beachball)
29
+ - Bump @fluentui/react-jsx-runtime to v9.0.21 ([PR #30056](https://github.com/microsoft/fluentui/pull/30056) by beachball)
30
+ - Bump @fluentui/react-shared-contexts to v9.13.1 ([PR #30056](https://github.com/microsoft/fluentui/pull/30056) by beachball)
31
+ - Bump @fluentui/react-tabster to v9.15.1 ([PR #30056](https://github.com/microsoft/fluentui/pull/30056) by beachball)
32
+ - Bump @fluentui/react-utilities to v9.15.3 ([PR #30056](https://github.com/microsoft/fluentui/pull/30056) by beachball)
19
33
 
20
34
  ## [9.3.57](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.3.57)
21
35
 
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { useARIAButtonShorthand } from '@fluentui/react-aria';
2
+ import { useARIAButtonProps } from '@fluentui/react-aria';
3
3
  import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
4
4
  import { useButtonContext } from '../../contexts/ButtonContext';
5
5
  /**
@@ -25,14 +25,12 @@ import { useButtonContext } from '../../contexts/ButtonContext';
25
25
  root: 'button',
26
26
  icon: 'span'
27
27
  },
28
- root: slot.always(getIntrinsicElementProps(as, useARIAButtonShorthand(props, {
29
- required: true,
28
+ root: slot.always(getIntrinsicElementProps(as, useARIAButtonProps(props.as, props)), {
29
+ elementType: 'button',
30
30
  defaultProps: {
31
31
  ref: ref,
32
32
  type: 'button'
33
33
  }
34
- })), {
35
- elementType: 'button'
36
34
  }),
37
35
  icon: iconShorthand
38
36
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["useButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { ARIAButtonSlotProps, useARIAButtonShorthand } from '@fluentui/react-aria';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useButtonContext } from '../../contexts/ButtonContext';\nimport type { ButtonProps, ButtonState } from './Button.types';\n\n/**\n * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.\n * @param props - User provided props to the Button component.\n * @param ref - User provided ref to be passed to the Button component.\n */\nexport const useButton_unstable = (\n props: ButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ButtonState => {\n const { size: contextSize } = useButtonContext();\n const {\n appearance = 'secondary',\n as = 'button',\n disabled = false,\n disabledFocusable = false,\n icon,\n iconPosition = 'before',\n shape = 'rounded',\n size = contextSize ?? 'medium',\n } = props;\n const iconShorthand = slot.optional(icon, { elementType: 'span' });\n return {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n iconPosition,\n shape,\n size, // State calculated from a set of props\n iconOnly: Boolean(iconShorthand?.children && !props.children), // Slots definition\n components: { root: 'button', icon: 'span' },\n root: slot.always(\n getIntrinsicElementProps(\n as,\n useARIAButtonShorthand<ARIAButtonSlotProps<'a'>>(props, {\n required: true,\n defaultProps: {\n ref: ref as React.Ref<HTMLButtonElement & HTMLAnchorElement>,\n type: 'button',\n },\n }),\n ),\n { elementType: 'button' },\n ),\n icon: iconShorthand,\n };\n};\n"],"names":["React","useARIAButtonShorthand","getIntrinsicElementProps","slot","useButtonContext","useButton_unstable","props","ref","size","contextSize","appearance","as","disabled","disabledFocusable","icon","iconPosition","shape","iconShorthand","optional","elementType","iconOnly","Boolean","children","components","root","always","required","defaultProps","type"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAA8BC,sBAAsB,QAAQ,uBAAuB;AACnF,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAC3E,SAASC,gBAAgB,QAAQ,+BAA+B;AAGhE;;;;CAIC,GACD,OAAO,MAAMC,qBAAqB,CAChCC,OACAC;IAEA,MAAM,EAAEC,MAAMC,WAAW,EAAE,GAAGL;IAC9B,MAAM,EACJM,aAAa,WAAW,EACxBC,KAAK,QAAQ,EACbC,WAAW,KAAK,EAChBC,oBAAoB,KAAK,EACzBC,IAAI,EACJC,eAAe,QAAQ,EACvBC,QAAQ,SAAS,EACjBR,OAAOC,wBAAAA,yBAAAA,cAAe,QAAQ,EAC/B,GAAGH;IACJ,MAAMW,gBAAgBd,KAAKe,QAAQ,CAACJ,MAAM;QAAEK,aAAa;IAAO;IAChE,OAAO;QACL,gCAAgC;QAChCT;QACAE;QACAC;QACAE;QACAC;QACAR;QACAY,UAAUC,QAAQJ,CAAAA,0BAAAA,oCAAAA,cAAeK,QAAQ,KAAI,CAAChB,MAAMgB,QAAQ;QAC5DC,YAAY;YAAEC,MAAM;YAAUV,MAAM;QAAO;QAC3CU,MAAMrB,KAAKsB,MAAM,CACfvB,yBACES,IACAV,uBAAiDK,OAAO;YACtDoB,UAAU;YACVC,cAAc;gBACZpB,KAAKA;gBACLqB,MAAM;YACR;QACF,KAEF;YAAET,aAAa;QAAS;QAE1BL,MAAMG;IACR;AACF,EAAE"}
1
+ {"version":3,"sources":["useButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { ARIAButtonSlotProps, useARIAButtonProps } from '@fluentui/react-aria';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useButtonContext } from '../../contexts/ButtonContext';\nimport type { ButtonProps, ButtonState } from './Button.types';\n\n/**\n * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.\n * @param props - User provided props to the Button component.\n * @param ref - User provided ref to be passed to the Button component.\n */\nexport const useButton_unstable = (\n props: ButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ButtonState => {\n const { size: contextSize } = useButtonContext();\n const {\n appearance = 'secondary',\n as = 'button',\n disabled = false,\n disabledFocusable = false,\n icon,\n iconPosition = 'before',\n shape = 'rounded',\n size = contextSize ?? 'medium',\n } = props;\n const iconShorthand = slot.optional(icon, { elementType: 'span' });\n return {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n iconPosition,\n shape,\n size, // State calculated from a set of props\n iconOnly: Boolean(iconShorthand?.children && !props.children), // Slots definition\n components: { root: 'button', icon: 'span' },\n root: slot.always<ARIAButtonSlotProps<'a'>>(getIntrinsicElementProps(as, useARIAButtonProps(props.as, props)), {\n elementType: 'button',\n defaultProps: {\n ref: ref as React.Ref<HTMLButtonElement & HTMLAnchorElement>,\n type: 'button',\n },\n }),\n icon: iconShorthand,\n };\n};\n"],"names":["React","useARIAButtonProps","getIntrinsicElementProps","slot","useButtonContext","useButton_unstable","props","ref","size","contextSize","appearance","as","disabled","disabledFocusable","icon","iconPosition","shape","iconShorthand","optional","elementType","iconOnly","Boolean","children","components","root","always","defaultProps","type"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAA8BC,kBAAkB,QAAQ,uBAAuB;AAC/E,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAC3E,SAASC,gBAAgB,QAAQ,+BAA+B;AAGhE;;;;CAIC,GACD,OAAO,MAAMC,qBAAqB,CAChCC,OACAC;IAEA,MAAM,EAAEC,MAAMC,WAAW,EAAE,GAAGL;IAC9B,MAAM,EACJM,aAAa,WAAW,EACxBC,KAAK,QAAQ,EACbC,WAAW,KAAK,EAChBC,oBAAoB,KAAK,EACzBC,IAAI,EACJC,eAAe,QAAQ,EACvBC,QAAQ,SAAS,EACjBR,OAAOC,wBAAAA,yBAAAA,cAAe,QAAQ,EAC/B,GAAGH;IACJ,MAAMW,gBAAgBd,KAAKe,QAAQ,CAACJ,MAAM;QAAEK,aAAa;IAAO;IAChE,OAAO;QACL,gCAAgC;QAChCT;QACAE;QACAC;QACAE;QACAC;QACAR;QACAY,UAAUC,QAAQJ,CAAAA,0BAAAA,oCAAAA,cAAeK,QAAQ,KAAI,CAAChB,MAAMgB,QAAQ;QAC5DC,YAAY;YAAEC,MAAM;YAAUV,MAAM;QAAO;QAC3CU,MAAMrB,KAAKsB,MAAM,CAA2BvB,yBAAyBS,IAAIV,mBAAmBK,MAAMK,EAAE,EAAEL,SAAS;YAC7Ga,aAAa;YACbO,cAAc;gBACZnB,KAAKA;gBACLoB,MAAM;YACR;QACF;QACAb,MAAMG;IACR;AACF,EAAE"}
@@ -32,14 +32,12 @@ const useButton_unstable = (props, ref)=>{
32
32
  root: 'button',
33
33
  icon: 'span'
34
34
  },
35
- root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)(as, (0, _reactaria.useARIAButtonShorthand)(props, {
36
- required: true,
35
+ root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)(as, (0, _reactaria.useARIAButtonProps)(props.as, props)), {
36
+ elementType: 'button',
37
37
  defaultProps: {
38
38
  ref: ref,
39
39
  type: 'button'
40
40
  }
41
- })), {
42
- elementType: 'button'
43
41
  }),
44
42
  icon: iconShorthand
45
43
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["useButton.js"],"sourcesContent":["import * as React from 'react';\nimport { useARIAButtonShorthand } from '@fluentui/react-aria';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useButtonContext } from '../../contexts/ButtonContext';\n/**\n * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.\n * @param props - User provided props to the Button component.\n * @param ref - User provided ref to be passed to the Button component.\n */ export const useButton_unstable = (props, ref)=>{\n const { size: contextSize } = useButtonContext();\n const { appearance = 'secondary', as = 'button', disabled = false, disabledFocusable = false, icon, iconPosition = 'before', shape = 'rounded', size = contextSize !== null && contextSize !== void 0 ? contextSize : 'medium' } = props;\n const iconShorthand = slot.optional(icon, {\n elementType: 'span'\n });\n return {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n iconPosition,\n shape,\n size,\n iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !props.children),\n components: {\n root: 'button',\n icon: 'span'\n },\n root: slot.always(getIntrinsicElementProps(as, useARIAButtonShorthand(props, {\n required: true,\n defaultProps: {\n ref: ref,\n type: 'button'\n }\n })), {\n elementType: 'button'\n }),\n icon: iconShorthand\n };\n};\n"],"names":["useButton_unstable","props","ref","size","contextSize","useButtonContext","appearance","as","disabled","disabledFocusable","icon","iconPosition","shape","iconShorthand","slot","optional","elementType","iconOnly","Boolean","children","components","root","always","getIntrinsicElementProps","useARIAButtonShorthand","required","defaultProps","type"],"mappings":";;;;+BAQiBA;;;eAAAA;;;;iEARM;2BACgB;gCACQ;+BACd;AAKtB,MAAMA,qBAAqB,CAACC,OAAOC;IAC1C,MAAM,EAAEC,MAAMC,WAAW,EAAE,GAAGC,IAAAA,+BAAgB;IAC9C,MAAM,EAAEC,aAAa,WAAW,EAAEC,KAAK,QAAQ,EAAEC,WAAW,KAAK,EAAEC,oBAAoB,KAAK,EAAEC,IAAI,EAAEC,eAAe,QAAQ,EAAEC,QAAQ,SAAS,EAAET,OAAOC,gBAAgB,QAAQA,gBAAgB,KAAK,IAAIA,cAAc,QAAQ,EAAE,GAAGH;IACnO,MAAMY,gBAAgBC,oBAAI,CAACC,QAAQ,CAACL,MAAM;QACtCM,aAAa;IACjB;IACA,OAAO;QACH,gCAAgC;QAChCV;QACAE;QACAC;QACAE;QACAC;QACAT;QACAc,UAAUC,QAAQ,AAACL,CAAAA,kBAAkB,QAAQA,kBAAkB,KAAK,IAAI,KAAK,IAAIA,cAAcM,QAAQ,AAAD,KAAM,CAAClB,MAAMkB,QAAQ;QAC3HC,YAAY;YACRC,MAAM;YACNX,MAAM;QACV;QACAW,MAAMP,oBAAI,CAACQ,MAAM,CAACC,IAAAA,wCAAwB,EAAChB,IAAIiB,IAAAA,iCAAsB,EAACvB,OAAO;YACzEwB,UAAU;YACVC,cAAc;gBACVxB,KAAKA;gBACLyB,MAAM;YACV;QACJ,KAAK;YACDX,aAAa;QACjB;QACAN,MAAMG;IACV;AACJ"}
1
+ {"version":3,"sources":["useButton.js"],"sourcesContent":["import * as React from 'react';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useButtonContext } from '../../contexts/ButtonContext';\n/**\n * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.\n * @param props - User provided props to the Button component.\n * @param ref - User provided ref to be passed to the Button component.\n */ export const useButton_unstable = (props, ref)=>{\n const { size: contextSize } = useButtonContext();\n const { appearance = 'secondary', as = 'button', disabled = false, disabledFocusable = false, icon, iconPosition = 'before', shape = 'rounded', size = contextSize !== null && contextSize !== void 0 ? contextSize : 'medium' } = props;\n const iconShorthand = slot.optional(icon, {\n elementType: 'span'\n });\n return {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n iconPosition,\n shape,\n size,\n iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !props.children),\n components: {\n root: 'button',\n icon: 'span'\n },\n root: slot.always(getIntrinsicElementProps(as, useARIAButtonProps(props.as, props)), {\n elementType: 'button',\n defaultProps: {\n ref: ref,\n type: 'button'\n }\n }),\n icon: iconShorthand\n };\n};\n"],"names":["useButton_unstable","props","ref","size","contextSize","useButtonContext","appearance","as","disabled","disabledFocusable","icon","iconPosition","shape","iconShorthand","slot","optional","elementType","iconOnly","Boolean","children","components","root","always","getIntrinsicElementProps","useARIAButtonProps","defaultProps","type"],"mappings":";;;;+BAQiBA;;;eAAAA;;;;iEARM;2BACY;gCACY;+BACd;AAKtB,MAAMA,qBAAqB,CAACC,OAAOC;IAC1C,MAAM,EAAEC,MAAMC,WAAW,EAAE,GAAGC,IAAAA,+BAAgB;IAC9C,MAAM,EAAEC,aAAa,WAAW,EAAEC,KAAK,QAAQ,EAAEC,WAAW,KAAK,EAAEC,oBAAoB,KAAK,EAAEC,IAAI,EAAEC,eAAe,QAAQ,EAAEC,QAAQ,SAAS,EAAET,OAAOC,gBAAgB,QAAQA,gBAAgB,KAAK,IAAIA,cAAc,QAAQ,EAAE,GAAGH;IACnO,MAAMY,gBAAgBC,oBAAI,CAACC,QAAQ,CAACL,MAAM;QACtCM,aAAa;IACjB;IACA,OAAO;QACH,gCAAgC;QAChCV;QACAE;QACAC;QACAE;QACAC;QACAT;QACAc,UAAUC,QAAQ,AAACL,CAAAA,kBAAkB,QAAQA,kBAAkB,KAAK,IAAI,KAAK,IAAIA,cAAcM,QAAQ,AAAD,KAAM,CAAClB,MAAMkB,QAAQ;QAC3HC,YAAY;YACRC,MAAM;YACNX,MAAM;QACV;QACAW,MAAMP,oBAAI,CAACQ,MAAM,CAACC,IAAAA,wCAAwB,EAAChB,IAAIiB,IAAAA,6BAAkB,EAACvB,MAAMM,EAAE,EAAEN,SAAS;YACjFe,aAAa;YACbS,cAAc;gBACVvB,KAAKA;gBACLwB,MAAM;YACV;QACJ;QACAhB,MAAMG;IACV;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-button",
3
- "version": "9.3.58",
3
+ "version": "9.3.59",
4
4
  "description": "Fluent UI React Button component.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -35,13 +35,13 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@fluentui/keyboard-keys": "^9.0.7",
38
- "@fluentui/react-aria": "^9.5.0",
38
+ "@fluentui/react-aria": "^9.6.0",
39
39
  "@fluentui/react-icons": "^2.0.217",
40
- "@fluentui/react-jsx-runtime": "^9.0.21",
41
- "@fluentui/react-shared-contexts": "^9.13.1",
42
- "@fluentui/react-tabster": "^9.15.1",
40
+ "@fluentui/react-jsx-runtime": "^9.0.22",
41
+ "@fluentui/react-shared-contexts": "^9.13.2",
42
+ "@fluentui/react-tabster": "^9.16.0",
43
43
  "@fluentui/react-theme": "^9.1.16",
44
- "@fluentui/react-utilities": "^9.15.3",
44
+ "@fluentui/react-utilities": "^9.15.4",
45
45
  "@griffel/react": "^1.5.14",
46
46
  "@swc/helpers": "^0.5.1"
47
47
  },