@fluentui/react-button 9.1.12 → 9.1.14
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +81 -1
- package/CHANGELOG.md +26 -2
- package/lib/components/Button/Button.js +3 -2
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Button/renderButton.js +6 -4
- package/lib/components/Button/renderButton.js.map +1 -1
- package/lib/components/Button/useButton.js +0 -1
- package/lib/components/Button/useButton.js.map +1 -1
- package/lib/components/Button/useButtonStyles.js +309 -315
- package/lib/components/Button/useButtonStyles.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.js +3 -2
- package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/renderCompoundButton.js +10 -6
- package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButton.js +4 -5
- package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.js +124 -129
- package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +3 -2
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/renderMenuButton.js +6 -4
- package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButton.js +2 -3
- package/lib/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButtonStyles.js +61 -67
- package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.js +3 -2
- package/lib/components/SplitButton/SplitButton.js.map +1 -1
- package/lib/components/SplitButton/renderSplitButton.js +6 -4
- package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButton.js +2 -4
- package/lib/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButtonStyles.js +56 -62
- package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.js +3 -2
- package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButton.js +0 -1
- package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.js +246 -249
- package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/useToggleState.js +4 -3
- package/lib/utils/useToggleState.js.map +1 -1
- package/lib-commonjs/Button.js +0 -2
- package/lib-commonjs/Button.js.map +1 -1
- package/lib-commonjs/CompoundButton.js +0 -2
- package/lib-commonjs/CompoundButton.js.map +1 -1
- package/lib-commonjs/MenuButton.js +0 -2
- package/lib-commonjs/MenuButton.js.map +1 -1
- package/lib-commonjs/SplitButton.js +0 -2
- package/lib-commonjs/SplitButton.js.map +1 -1
- package/lib-commonjs/ToggleButton.js +0 -2
- package/lib-commonjs/ToggleButton.js.map +1 -1
- package/lib-commonjs/components/Button/Button.js +3 -7
- package/lib-commonjs/components/Button/Button.js.map +1 -1
- package/lib-commonjs/components/Button/Button.types.js.map +1 -1
- package/lib-commonjs/components/Button/index.js +0 -6
- package/lib-commonjs/components/Button/index.js.map +1 -1
- package/lib-commonjs/components/Button/renderButton.js +6 -8
- package/lib-commonjs/components/Button/renderButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButton.js +0 -5
- package/lib-commonjs/components/Button/useButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.js +309 -321
- package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.js +3 -7
- package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.types.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/index.js +0 -7
- package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +10 -10
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js +4 -9
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +124 -134
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.js +3 -7
- package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.types.js.map +1 -1
- package/lib-commonjs/components/MenuButton/index.js +0 -7
- package/lib-commonjs/components/MenuButton/index.js.map +1 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.js +6 -8
- package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButton.js +2 -9
- package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +61 -73
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.js +3 -7
- package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -1
- package/lib-commonjs/components/SplitButton/index.js +0 -7
- package/lib-commonjs/components/SplitButton/index.js.map +1 -1
- package/lib-commonjs/components/SplitButton/renderSplitButton.js +6 -8
- package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButton.js +2 -9
- package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +56 -67
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.js +3 -7
- package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.types.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/index.js +0 -7
- package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js +0 -2
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButton.js +0 -5
- package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +246 -256
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib-commonjs/index.js +0 -12
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/index.js +0 -2
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/useToggleState.js +4 -7
- package/lib-commonjs/utils/useToggleState.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,87 @@
|
|
2
2
|
"name": "@fluentui/react-button",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Mon, 09 Jan 2023 14:31:49 GMT",
|
6
|
+
"tag": "@fluentui/react-button_v9.1.14",
|
7
|
+
"version": "9.1.14",
|
8
|
+
"comments": {
|
9
|
+
"patch": [
|
10
|
+
{
|
11
|
+
"author": "beachball",
|
12
|
+
"package": "@fluentui/react-button",
|
13
|
+
"comment": "Bump @fluentui/react-aria to v9.3.5",
|
14
|
+
"commit": "26f0364b3837056ee8e0df42a7932c298c68290e"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "beachball",
|
18
|
+
"package": "@fluentui/react-button",
|
19
|
+
"comment": "Bump @fluentui/react-tabster to v9.3.6",
|
20
|
+
"commit": "26f0364b3837056ee8e0df42a7932c298c68290e"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"author": "beachball",
|
24
|
+
"package": "@fluentui/react-button",
|
25
|
+
"comment": "Bump @fluentui/react-utilities to v9.4.0",
|
26
|
+
"commit": "26f0364b3837056ee8e0df42a7932c298c68290e"
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"date": "Wed, 04 Jan 2023 01:40:53 GMT",
|
33
|
+
"tag": "@fluentui/react-button_v9.1.13",
|
34
|
+
"version": "9.1.13",
|
35
|
+
"comments": {
|
36
|
+
"none": [
|
37
|
+
{
|
38
|
+
"author": "martinhochel@microsoft.com",
|
39
|
+
"package": "@fluentui/react-button",
|
40
|
+
"commit": "194b0cf0cc27c1c1233aa945f09b3ad29778d8ca",
|
41
|
+
"comment": "chore(scripts): use for @fluentui/scripts version within all package.json"
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"author": "martinhochel@microsoft.com",
|
45
|
+
"package": "@fluentui/react-button",
|
46
|
+
"commit": "4ec2b998b294d6d9c3196d3d82893bdd97d0c105",
|
47
|
+
"comment": "chore(scripts): move index.ts to to follow sub-folder domain packaging"
|
48
|
+
}
|
49
|
+
],
|
50
|
+
"patch": [
|
51
|
+
{
|
52
|
+
"author": "olfedias@microsoft.com",
|
53
|
+
"package": "@fluentui/react-button",
|
54
|
+
"commit": "2c38f1e4ae07b2b60df596efe11015a68f166dbf",
|
55
|
+
"comment": "chore: Update Griffel to latest version"
|
56
|
+
},
|
57
|
+
{
|
58
|
+
"author": "beachball",
|
59
|
+
"package": "@fluentui/react-button",
|
60
|
+
"comment": "Bump @fluentui/react-aria to v9.3.4",
|
61
|
+
"commit": "3e322d15529451be153e97298873253e21af4082"
|
62
|
+
},
|
63
|
+
{
|
64
|
+
"author": "beachball",
|
65
|
+
"package": "@fluentui/react-button",
|
66
|
+
"comment": "Bump @fluentui/react-tabster to v9.3.5",
|
67
|
+
"commit": "3e322d15529451be153e97298873253e21af4082"
|
68
|
+
},
|
69
|
+
{
|
70
|
+
"author": "beachball",
|
71
|
+
"package": "@fluentui/react-button",
|
72
|
+
"comment": "Bump @fluentui/react-utilities to v9.3.1",
|
73
|
+
"commit": "3e322d15529451be153e97298873253e21af4082"
|
74
|
+
},
|
75
|
+
{
|
76
|
+
"author": "beachball",
|
77
|
+
"package": "@fluentui/react-button",
|
78
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.19",
|
79
|
+
"commit": "3e322d15529451be153e97298873253e21af4082"
|
80
|
+
}
|
81
|
+
]
|
82
|
+
}
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"date": "Wed, 21 Dec 2022 10:20:33 GMT",
|
6
86
|
"tag": "@fluentui/react-button_v9.1.12",
|
7
87
|
"version": "9.1.12",
|
8
88
|
"comments": {
|
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,36 @@
|
|
1
1
|
# Change Log - @fluentui/react-button
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Mon, 09 Jan 2023 14:31:49 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.1.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.1.14)
|
8
|
+
|
9
|
+
Mon, 09 Jan 2023 14:31:49 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.1.13..@fluentui/react-button_v9.1.14)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- Bump @fluentui/react-aria to v9.3.5 ([PR #26257](https://github.com/microsoft/fluentui/pull/26257) by beachball)
|
15
|
+
- Bump @fluentui/react-tabster to v9.3.6 ([PR #26257](https://github.com/microsoft/fluentui/pull/26257) by beachball)
|
16
|
+
- Bump @fluentui/react-utilities to v9.4.0 ([PR #26257](https://github.com/microsoft/fluentui/pull/26257) by beachball)
|
17
|
+
|
18
|
+
## [9.1.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.1.13)
|
19
|
+
|
20
|
+
Wed, 04 Jan 2023 01:40:53 GMT
|
21
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.1.12..@fluentui/react-button_v9.1.13)
|
22
|
+
|
23
|
+
### Patches
|
24
|
+
|
25
|
+
- chore: Update Griffel to latest version ([PR #26045](https://github.com/microsoft/fluentui/pull/26045) by olfedias@microsoft.com)
|
26
|
+
- Bump @fluentui/react-aria to v9.3.4 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
|
27
|
+
- Bump @fluentui/react-tabster to v9.3.5 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
|
28
|
+
- Bump @fluentui/react-utilities to v9.3.1 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
|
29
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.19 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
|
30
|
+
|
7
31
|
## [9.1.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.1.12)
|
8
32
|
|
9
|
-
Wed, 21 Dec 2022 10:
|
33
|
+
Wed, 21 Dec 2022 10:20:33 GMT
|
10
34
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.1.11..@fluentui/react-button_v9.1.12)
|
11
35
|
|
12
36
|
### Patches
|
@@ -5,11 +5,12 @@ import { useButtonStyles_unstable } from './useButtonStyles';
|
|
5
5
|
/**
|
6
6
|
* Buttons give people a way to trigger an action.
|
7
7
|
*/
|
8
|
-
|
9
8
|
export const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
10
9
|
const state = useButton_unstable(props, ref);
|
11
10
|
useButtonStyles_unstable(state);
|
12
|
-
return renderButton_unstable(state);
|
11
|
+
return renderButton_unstable(state);
|
12
|
+
// Casting is required due to lack of distributive union to support unions on @types/react
|
13
13
|
});
|
14
|
+
|
14
15
|
Button.displayName = 'Button';
|
15
16
|
//# sourceMappingURL=Button.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,qBAAqB,QAAQ,gBAAgB;AACtD,SAASC,kBAAkB,QAAQ,aAAa;AAChD,SAASC,wBAAwB,QAAQ,mBAAmB;AAI5D;;;AAGA,OAAO,MAAMC,MAAM,gBAAqCJ,KAAK,CAACK,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACtF,MAAMC,KAAK,GAAGN,kBAAkB,CAACI,KAAK,EAAEC,GAAG,CAAC;EAE5CJ,wBAAwB,CAACK,KAAK,CAAC;EAE/B,OAAOP,qBAAqB,CAACO,KAAK,CAAC;EACnC;AACF,CAAC,CAAqC;;AAEtCJ,MAAM,CAACK,WAAW,GAAG,QAAQ","names":["React","renderButton_unstable","useButton_unstable","useButtonStyles_unstable","Button","forwardRef","props","ref","state","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/Button/Button.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderButton_unstable } from './renderButton';\nimport { useButton_unstable } from './useButton';\nimport { useButtonStyles_unstable } from './useButtonStyles';\nimport type { ButtonProps } from './Button.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Buttons give people a way to trigger an action.\n */\nexport const Button: ForwardRefComponent<ButtonProps> = React.forwardRef((props, ref) => {\n const state = useButton_unstable(props, ref);\n\n useButtonStyles_unstable(state);\n\n return renderButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<ButtonProps>;\n\nButton.displayName = 'Button';\n"]}
|
@@ -3,7 +3,6 @@ import { getSlots } from '@fluentui/react-utilities';
|
|
3
3
|
/**
|
4
4
|
* Renders a Button component by passing the state defined props to the appropriate slots.
|
5
5
|
*/
|
6
|
-
|
7
6
|
export const renderButton_unstable = state => {
|
8
7
|
const {
|
9
8
|
slots,
|
@@ -13,9 +12,12 @@ export const renderButton_unstable = state => {
|
|
13
12
|
iconOnly,
|
14
13
|
iconPosition
|
15
14
|
} = state;
|
16
|
-
return /*#__PURE__*/React.createElement(slots.root, {
|
17
|
-
|
18
|
-
}
|
15
|
+
return /*#__PURE__*/React.createElement(slots.root, {
|
16
|
+
...slotProps.root
|
17
|
+
}, iconPosition !== 'after' && slots.icon && /*#__PURE__*/React.createElement(slots.icon, {
|
18
|
+
...slotProps.icon
|
19
|
+
}), !iconOnly && state.root.children, iconPosition === 'after' && slots.icon && /*#__PURE__*/React.createElement(slots.icon, {
|
20
|
+
...slotProps.icon
|
19
21
|
}));
|
20
22
|
};
|
21
23
|
//# sourceMappingURL=renderButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,qBAAqB,GAAIC,KAAkB,IAAI;EAC1D,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAcE,KAAK,CAAC;EACzD,MAAM;IAAEG,QAAQ;IAAEC;EAAY,CAAE,GAAGJ,KAAK;EAExC,oBACEH,oBAACI,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAC3BD,YAAY,KAAK,OAAO,IAAIH,KAAK,CAACK,IAAI,iBAAIT,oBAACI,KAAK,CAACK,IAAI;IAAA,GAAKJ,SAAS,CAACI;EAAI,EAAI,EAC5E,CAACH,QAAQ,IAAIH,KAAK,CAACK,IAAI,CAACE,QAAQ,EAChCH,YAAY,KAAK,OAAO,IAAIH,KAAK,CAACK,IAAI,iBAAIT,oBAACI,KAAK,CAACK,IAAI;IAAA,GAAKJ,SAAS,CAACI;EAAI,EAAI,CAClE;AAEjB,CAAC","names":["React","getSlots","renderButton_unstable","state","slots","slotProps","iconOnly","iconPosition","root","icon","children"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/Button/renderButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { ButtonSlots, ButtonState } from './Button.types';\n\n/**\n * Renders a Button component by passing the state defined props to the appropriate slots.\n */\nexport const renderButton_unstable = (state: ButtonState) => {\n const { slots, slotProps } = getSlots<ButtonSlots>(state);\n const { iconOnly, iconPosition } = state;\n\n return (\n <slots.root {...slotProps.root}>\n {iconPosition !== 'after' && slots.icon && <slots.icon {...slotProps.icon} />}\n {!iconOnly && state.root.children}\n {iconPosition === 'after' && slots.icon && <slots.icon {...slotProps.icon} />}\n </slots.root>\n );\n};\n"]}
|
@@ -5,7 +5,6 @@ import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utiliti
|
|
5
5
|
* @param props - User provided props to the Button component.
|
6
6
|
* @param ref - User provided ref to be passed to the Button component.
|
7
7
|
*/
|
8
|
-
|
9
8
|
export const useButton_unstable = (props, ref) => {
|
10
9
|
const {
|
11
10
|
appearance = 'secondary',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"AACA,SAA8BA,sBAAsB,QAAQ,sBAAsB;AAClF,SAASC,qBAAqB,EAAEC,gBAAgB,QAAQ,2BAA2B;AAGnF;;;;;AAKA,OAAO,MAAMC,kBAAkB,GAAG,CAChCC,KAAkB,EAClBC,GAAqD,KACtC;EACf,MAAM;IACJC,UAAU,GAAG,WAAW;IACxBC,EAAE,GAAG,QAAQ;IACbC,QAAQ,GAAG,KAAK;IAChBC,iBAAiB,GAAG,KAAK;IACzBC,IAAI;IACJC,YAAY,GAAG,QAAQ;IACvBC,KAAK,GAAG,SAAS;IACjBC,IAAI,GAAG;EAAQ,CAChB,GAAGT,KAAK;EACT,MAAMU,aAAa,GAAGZ,gBAAgB,CAACQ,IAAI,CAAC;EAE5C,OAAO;IACL;IACAJ,UAAU;IACVE,QAAQ;IACRC,iBAAiB;IACjBE,YAAY;IACZC,KAAK;IACLC,IAAI;IAEJ;IACAE,QAAQ,EAAEC,OAAO,CAAC,cAAa,aAAbF,aAAa,uBAAbA,aAAa,CAAEG,QAAQ,KAAI,CAACb,KAAK,CAACa,QAAQ,CAAC;IAE7D;IACAC,UAAU,EAAE;MACVC,IAAI,EAAE,QAAQ;MACdT,IAAI,EAAE;KACP;IAEDS,IAAI,EAAElB,qBAAqB,CACzBM,EAAE,EACFP,sBAAsB,CAA2BI,KAAK,EAAE;MACtDgB,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAE;QACZhB,GAAG,EAAEA,GAAuD;QAC5DiB,IAAI,EAAE;;KAET,CAAC,CACH;IACDZ,IAAI,EAAEI;GACP;AACH,CAAC","names":["useARIAButtonShorthand","getNativeElementProps","resolveShorthand","useButton_unstable","props","ref","appearance","as","disabled","disabledFocusable","icon","iconPosition","shape","size","iconShorthand","iconOnly","Boolean","children","components","root","required","defaultProps","type"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/Button/useButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { ARIAButtonSlotProps, useARIAButtonShorthand } from '@fluentui/react-aria';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\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 {\n appearance = 'secondary',\n as = 'button',\n disabled = false,\n disabledFocusable = false,\n icon,\n iconPosition = 'before',\n shape = 'rounded',\n size = 'medium',\n } = props;\n const iconShorthand = resolveShorthand(icon);\n\n return {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n iconPosition,\n shape,\n size,\n\n // State calculated from a set of props\n iconOnly: Boolean(iconShorthand?.children && !props.children),\n\n // Slots definition\n components: {\n root: 'button',\n icon: 'span',\n },\n\n root: getNativeElementProps(\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 icon: iconShorthand,\n };\n};\n"]}
|