@fluentui/react-button 9.3.40 → 9.3.43
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +154 -1
- package/CHANGELOG.md +47 -2
- package/lib/components/Button/useButton.js +1 -2
- package/lib/components/Button/useButton.js.map +1 -1
- package/lib/components/MenuButton/renderMenuButton.js +1 -2
- package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib/contexts/ButtonContext.js +4 -2
- package/lib/contexts/ButtonContext.js.map +1 -1
- package/lib-commonjs/components/Button/useButton.js +1 -2
- package/lib-commonjs/components/Button/useButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.js +1 -2
- package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib-commonjs/contexts/ButtonContext.js +4 -2
- package/lib-commonjs/contexts/ButtonContext.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,160 @@
|
|
2
2
|
"name": "@fluentui/react-button",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Tue, 26 Sep 2023 17:44:08 GMT",
|
6
|
+
"tag": "@fluentui/react-button_v9.3.43",
|
7
|
+
"version": "9.3.43",
|
8
|
+
"comments": {
|
9
|
+
"patch": [
|
10
|
+
{
|
11
|
+
"author": "yuanboxue@microsoft.com",
|
12
|
+
"package": "@fluentui/react-button",
|
13
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d",
|
14
|
+
"comment": "chore: trigger manual version bump after broken release"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "beachball",
|
18
|
+
"package": "@fluentui/react-button",
|
19
|
+
"comment": "Bump @fluentui/keyboard-keys to v9.0.6",
|
20
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"author": "beachball",
|
24
|
+
"package": "@fluentui/react-button",
|
25
|
+
"comment": "Bump @fluentui/react-aria to v9.3.38",
|
26
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"author": "beachball",
|
30
|
+
"package": "@fluentui/react-button",
|
31
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.12",
|
32
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"author": "beachball",
|
36
|
+
"package": "@fluentui/react-button",
|
37
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.9.1",
|
38
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"author": "beachball",
|
42
|
+
"package": "@fluentui/react-button",
|
43
|
+
"comment": "Bump @fluentui/react-tabster to v9.13.1",
|
44
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"author": "beachball",
|
48
|
+
"package": "@fluentui/react-button",
|
49
|
+
"comment": "Bump @fluentui/react-theme to v9.1.14",
|
50
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"author": "beachball",
|
54
|
+
"package": "@fluentui/react-button",
|
55
|
+
"comment": "Bump @fluentui/react-utilities to v9.13.5",
|
56
|
+
"commit": "05a23f6f5f331841c9ac9fb63764440c543f791d"
|
57
|
+
}
|
58
|
+
]
|
59
|
+
}
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"date": "Tue, 26 Sep 2023 15:32:04 GMT",
|
63
|
+
"tag": "@fluentui/react-button_v9.3.42",
|
64
|
+
"version": "9.3.42",
|
65
|
+
"comments": {
|
66
|
+
"patch": [
|
67
|
+
{
|
68
|
+
"author": "martinhochel@microsoft.com",
|
69
|
+
"package": "@fluentui/react-button",
|
70
|
+
"commit": "e61473fa10195f6ebf2308205c1e72e91b711831",
|
71
|
+
"comment": "fix: bump swc core to mitigate transpilation memory leaks"
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"author": "ololubek@microsoft.com",
|
75
|
+
"package": "@fluentui/react-button",
|
76
|
+
"commit": "a31e7394d9f169bc5aa55430a22cdc65425a1b49",
|
77
|
+
"comment": "chore: Update react-icons version to pick up IconDirectionContextProvider updated export"
|
78
|
+
},
|
79
|
+
{
|
80
|
+
"author": "beachball",
|
81
|
+
"package": "@fluentui/react-button",
|
82
|
+
"comment": "Bump @fluentui/keyboard-keys to v9.0.5",
|
83
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
84
|
+
},
|
85
|
+
{
|
86
|
+
"author": "beachball",
|
87
|
+
"package": "@fluentui/react-button",
|
88
|
+
"comment": "Bump @fluentui/react-aria to v9.3.37",
|
89
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
90
|
+
},
|
91
|
+
{
|
92
|
+
"author": "beachball",
|
93
|
+
"package": "@fluentui/react-button",
|
94
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.11",
|
95
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
96
|
+
},
|
97
|
+
{
|
98
|
+
"author": "beachball",
|
99
|
+
"package": "@fluentui/react-button",
|
100
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.9.0",
|
101
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
102
|
+
},
|
103
|
+
{
|
104
|
+
"author": "beachball",
|
105
|
+
"package": "@fluentui/react-button",
|
106
|
+
"comment": "Bump @fluentui/react-tabster to v9.13.0",
|
107
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
108
|
+
},
|
109
|
+
{
|
110
|
+
"author": "beachball",
|
111
|
+
"package": "@fluentui/react-button",
|
112
|
+
"comment": "Bump @fluentui/react-theme to v9.1.13",
|
113
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
114
|
+
},
|
115
|
+
{
|
116
|
+
"author": "beachball",
|
117
|
+
"package": "@fluentui/react-button",
|
118
|
+
"comment": "Bump @fluentui/react-utilities to v9.13.4",
|
119
|
+
"commit": "e16520437e10cd824ac254dd797e32762b5de72d"
|
120
|
+
}
|
121
|
+
]
|
122
|
+
}
|
123
|
+
},
|
124
|
+
{
|
125
|
+
"date": "Wed, 20 Sep 2023 17:47:35 GMT",
|
126
|
+
"tag": "@fluentui/react-button_v9.3.41",
|
127
|
+
"version": "9.3.41",
|
128
|
+
"comments": {
|
129
|
+
"patch": [
|
130
|
+
{
|
131
|
+
"author": "martinhochel@microsoft.com",
|
132
|
+
"package": "@fluentui/react-button",
|
133
|
+
"commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0",
|
134
|
+
"comment": "chore: trigger manual version bump after broken release"
|
135
|
+
},
|
136
|
+
{
|
137
|
+
"author": "beachball",
|
138
|
+
"package": "@fluentui/react-button",
|
139
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.10",
|
140
|
+
"commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0"
|
141
|
+
},
|
142
|
+
{
|
143
|
+
"author": "beachball",
|
144
|
+
"package": "@fluentui/react-button",
|
145
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.8.1",
|
146
|
+
"commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0"
|
147
|
+
},
|
148
|
+
{
|
149
|
+
"author": "beachball",
|
150
|
+
"package": "@fluentui/react-button",
|
151
|
+
"comment": "Bump @fluentui/react-tabster to v9.12.11",
|
152
|
+
"commit": "41d0ed0376ad79f1f5f5c4c7487515a1c6be35f0"
|
153
|
+
}
|
154
|
+
]
|
155
|
+
}
|
156
|
+
},
|
157
|
+
{
|
158
|
+
"date": "Wed, 20 Sep 2023 14:59:53 GMT",
|
6
159
|
"tag": "@fluentui/react-button_v9.3.40",
|
7
160
|
"version": "9.3.40",
|
8
161
|
"comments": {
|
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,57 @@
|
|
1
1
|
# Change Log - @fluentui/react-button
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Tue, 26 Sep 2023 17:44:08 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.3.43](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.3.43)
|
8
|
+
|
9
|
+
Tue, 26 Sep 2023 17:44:08 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.3.42..@fluentui/react-button_v9.3.43)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- chore: trigger manual version bump after broken release ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by yuanboxue@microsoft.com)
|
15
|
+
- Bump @fluentui/keyboard-keys to v9.0.6 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
16
|
+
- Bump @fluentui/react-aria to v9.3.38 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
17
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.12 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
18
|
+
- Bump @fluentui/react-shared-contexts to v9.9.1 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
19
|
+
- Bump @fluentui/react-tabster to v9.13.1 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
20
|
+
- Bump @fluentui/react-theme to v9.1.14 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
21
|
+
- Bump @fluentui/react-utilities to v9.13.5 ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by beachball)
|
22
|
+
|
23
|
+
## [9.3.42](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.3.42)
|
24
|
+
|
25
|
+
Tue, 26 Sep 2023 15:32:04 GMT
|
26
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.3.41..@fluentui/react-button_v9.3.42)
|
27
|
+
|
28
|
+
### Patches
|
29
|
+
|
30
|
+
- fix: bump swc core to mitigate transpilation memory leaks ([PR #29253](https://github.com/microsoft/fluentui/pull/29253) by martinhochel@microsoft.com)
|
31
|
+
- chore: Update react-icons version to pick up IconDirectionContextProvider updated export ([PR #29151](https://github.com/microsoft/fluentui/pull/29151) by ololubek@microsoft.com)
|
32
|
+
- Bump @fluentui/keyboard-keys to v9.0.5 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
33
|
+
- Bump @fluentui/react-aria to v9.3.37 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
34
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.11 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
35
|
+
- Bump @fluentui/react-shared-contexts to v9.9.0 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
36
|
+
- Bump @fluentui/react-tabster to v9.13.0 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
37
|
+
- Bump @fluentui/react-theme to v9.1.13 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
38
|
+
- Bump @fluentui/react-utilities to v9.13.4 ([PR #29300](https://github.com/microsoft/fluentui/pull/29300) by beachball)
|
39
|
+
|
40
|
+
## [9.3.41](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.3.41)
|
41
|
+
|
42
|
+
Wed, 20 Sep 2023 17:47:35 GMT
|
43
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.3.40..@fluentui/react-button_v9.3.41)
|
44
|
+
|
45
|
+
### Patches
|
46
|
+
|
47
|
+
- chore: trigger manual version bump after broken release ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by martinhochel@microsoft.com)
|
48
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.10 ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by beachball)
|
49
|
+
- Bump @fluentui/react-shared-contexts to v9.8.1 ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by beachball)
|
50
|
+
- Bump @fluentui/react-tabster to v9.12.11 ([PR #29197](https://github.com/microsoft/fluentui/pull/29197) by beachball)
|
51
|
+
|
7
52
|
## [9.3.40](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.3.40)
|
8
53
|
|
9
|
-
Wed, 20 Sep 2023 14:
|
54
|
+
Wed, 20 Sep 2023 14:59:53 GMT
|
10
55
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.3.39..@fluentui/react-button_v9.3.40)
|
11
56
|
|
12
57
|
### Patches
|
@@ -7,7 +7,6 @@ import { useButtonContext } from '../../contexts/ButtonContext';
|
|
7
7
|
* @param props - User provided props to the Button component.
|
8
8
|
* @param ref - User provided ref to be passed to the Button component.
|
9
9
|
*/ export const useButton_unstable = (props, ref)=>{
|
10
|
-
var _iconShorthand;
|
11
10
|
const { size: contextSize } = useButtonContext();
|
12
11
|
const { appearance = 'secondary', as = 'button', disabled = false, disabledFocusable = false, icon, iconPosition = 'before', shape = 'rounded', size = contextSize !== null && contextSize !== void 0 ? contextSize : 'medium' } = props;
|
13
12
|
const iconShorthand = slot.optional(icon, {
|
@@ -21,7 +20,7 @@ import { useButtonContext } from '../../contexts/ButtonContext';
|
|
21
20
|
iconPosition,
|
22
21
|
shape,
|
23
22
|
size,
|
24
|
-
iconOnly: Boolean((
|
23
|
+
iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !props.children),
|
25
24
|
components: {
|
26
25
|
root: 'button',
|
27
26
|
icon: 'span'
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { ARIAButtonSlotProps, useARIAButtonShorthand } from '@fluentui/react-aria';\nimport { getNativeElementProps, 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 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 { elementType: 'button' },\n ),\n icon: iconShorthand,\n };\n};\n"],"names":["React","useARIAButtonShorthand","getNativeElementProps","slot","useButtonContext","useButton_unstable","props","ref","
|
1
|
+
{"version":3,"sources":["useButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { ARIAButtonSlotProps, useARIAButtonShorthand } from '@fluentui/react-aria';\nimport { getNativeElementProps, 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 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 { elementType: 'button' },\n ),\n icon: iconShorthand,\n };\n};\n"],"names":["React","useARIAButtonShorthand","getNativeElementProps","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,qBAAqB,EAAEC,IAAI,QAAQ,4BAA4B;AACxE,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,sBACES,IACAV,uBAAiDK,OAAO;YACtDoB,UAAU;YACVC,cAAc;gBACZpB,KAAKA;gBACLqB,MAAM;YACR;QACF,KAEF;YAAET,aAAa;QAAS;QAE1BL,MAAMG;IACR;AACF,EAAE"}
|
@@ -3,14 +3,13 @@ import { assertSlots } from '@fluentui/react-utilities';
|
|
3
3
|
/**
|
4
4
|
* Renders a MenuButton component by passing the state defined props to the appropriate slots.
|
5
5
|
*/ export const renderMenuButton_unstable = (state)=>{
|
6
|
-
var _icon;
|
7
6
|
assertSlots(state);
|
8
7
|
const { icon, iconOnly } = state;
|
9
8
|
return /*#__PURE__*/ _jsxs(state.root, {
|
10
9
|
children: [
|
11
10
|
state.icon && /*#__PURE__*/ _jsx(state.icon, {}),
|
12
11
|
!iconOnly && state.root.children,
|
13
|
-
(!iconOnly || !(
|
12
|
+
(!iconOnly || !(icon === null || icon === void 0 ? void 0 : icon.children)) && state.menuIcon && /*#__PURE__*/ _jsx(state.menuIcon, {})
|
14
13
|
]
|
15
14
|
});
|
16
15
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["renderMenuButton.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { MenuButtonSlots, MenuButtonState } from './MenuButton.types';\n\n/**\n * Renders a MenuButton component by passing the state defined props to the appropriate slots.\n */\nexport const renderMenuButton_unstable = (state: MenuButtonState) => {\n assertSlots<MenuButtonSlots>(state);\n const { icon, iconOnly } = state;\n\n return (\n <state.root>\n {state.icon && <state.icon />}\n {!iconOnly && state.root.children}\n {(!iconOnly || !icon?.children) && state.menuIcon && <state.menuIcon />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderMenuButton_unstable","state","icon","iconOnly","root","children","menuIcon"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,4BAA4B,CAACC;
|
1
|
+
{"version":3,"sources":["renderMenuButton.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { MenuButtonSlots, MenuButtonState } from './MenuButton.types';\n\n/**\n * Renders a MenuButton component by passing the state defined props to the appropriate slots.\n */\nexport const renderMenuButton_unstable = (state: MenuButtonState) => {\n assertSlots<MenuButtonSlots>(state);\n const { icon, iconOnly } = state;\n\n return (\n <state.root>\n {state.icon && <state.icon />}\n {!iconOnly && state.root.children}\n {(!iconOnly || !icon?.children) && state.menuIcon && <state.menuIcon />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderMenuButton_unstable","state","icon","iconOnly","root","children","menuIcon"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,4BAA4B,CAACC;IACxCF,YAA6BE;IAC7B,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGF;IAE3B,qBACE,MAACA,MAAMG,IAAI;;YACRH,MAAMC,IAAI,kBAAI,KAACD,MAAMC,IAAI;YACzB,CAACC,YAAYF,MAAMG,IAAI,CAACC,QAAQ;YAC/B,CAAA,CAACF,YAAY,EAACD,iBAAAA,2BAAAA,KAAMG,QAAQ,CAAD,KAAMJ,MAAMK,QAAQ,kBAAI,KAACL,MAAMK,QAAQ;;;AAG1E,EAAE"}
|
@@ -5,8 +5,10 @@ const buttonContextDefaultValue = {};
|
|
5
5
|
* @internal
|
6
6
|
* Internal context provider used to update default values between internal components
|
7
7
|
*/ export const ButtonContextProvider = buttonContext.Provider;
|
8
|
-
var _React_useContext;
|
9
8
|
/**
|
10
9
|
* @internal
|
11
10
|
* Internal context hook used to update default values between internal components
|
12
|
-
*/ export const useButtonContext = ()=>
|
11
|
+
*/ export const useButtonContext = ()=>{
|
12
|
+
var _React_useContext;
|
13
|
+
return (_React_useContext = React.useContext(buttonContext)) !== null && _React_useContext !== void 0 ? _React_useContext : buttonContextDefaultValue;
|
14
|
+
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["ButtonContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { ButtonSize } from '../components/Button/Button.types';\n\nconst buttonContext = React.createContext<ButtonContextValue | undefined>(undefined);\n\n/**\n * @internal\n * Internal context value used to update default values between internal components\n */\nexport interface ButtonContextValue {\n size?: ButtonSize;\n}\n\nconst buttonContextDefaultValue: ButtonContextValue = {};\n\n/**\n * @internal\n * Internal context provider used to update default values between internal components\n */\nexport const ButtonContextProvider = buttonContext.Provider;\n\n/**\n * @internal\n * Internal context hook used to update default values between internal components\n */\nexport const useButtonContext = () => React.useContext(buttonContext) ?? buttonContextDefaultValue;\n"],"names":["React","buttonContext","createContext","undefined","buttonContextDefaultValue","ButtonContextProvider","Provider","useButtonContext","useContext"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAG/B,MAAMC,gBAAgBD,MAAME,aAAa,CAAiCC;AAU1E,MAAMC,4BAAgD,CAAC;AAEvD;;;CAGC,GACD,OAAO,MAAMC,wBAAwBJ,cAAcK,QAAQ,CAAC;
|
1
|
+
{"version":3,"sources":["ButtonContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { ButtonSize } from '../components/Button/Button.types';\n\nconst buttonContext = React.createContext<ButtonContextValue | undefined>(undefined);\n\n/**\n * @internal\n * Internal context value used to update default values between internal components\n */\nexport interface ButtonContextValue {\n size?: ButtonSize;\n}\n\nconst buttonContextDefaultValue: ButtonContextValue = {};\n\n/**\n * @internal\n * Internal context provider used to update default values between internal components\n */\nexport const ButtonContextProvider = buttonContext.Provider;\n\n/**\n * @internal\n * Internal context hook used to update default values between internal components\n */\nexport const useButtonContext = () => React.useContext(buttonContext) ?? buttonContextDefaultValue;\n"],"names":["React","buttonContext","createContext","undefined","buttonContextDefaultValue","ButtonContextProvider","Provider","useButtonContext","useContext"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAG/B,MAAMC,gBAAgBD,MAAME,aAAa,CAAiCC;AAU1E,MAAMC,4BAAgD,CAAC;AAEvD;;;CAGC,GACD,OAAO,MAAMC,wBAAwBJ,cAAcK,QAAQ,CAAC;AAE5D;;;CAGC,GACD,OAAO,MAAMC,mBAAmB;QAAMP;WAAAA,CAAAA,oBAAAA,MAAMQ,UAAU,CAACP,4BAAjBD,+BAAAA,oBAAmCI;AAAwB,EAAE"}
|
@@ -14,7 +14,6 @@ const _reactaria = require("@fluentui/react-aria");
|
|
14
14
|
const _reactutilities = require("@fluentui/react-utilities");
|
15
15
|
const _ButtonContext = require("../../contexts/ButtonContext");
|
16
16
|
const useButton_unstable = (props, ref)=>{
|
17
|
-
var _iconShorthand;
|
18
17
|
const { size: contextSize } = (0, _ButtonContext.useButtonContext)();
|
19
18
|
const { appearance = 'secondary', as = 'button', disabled = false, disabledFocusable = false, icon, iconPosition = 'before', shape = 'rounded', size = contextSize !== null && contextSize !== void 0 ? contextSize : 'medium' } = props;
|
20
19
|
const iconShorthand = _reactutilities.slot.optional(icon, {
|
@@ -28,7 +27,7 @@ const useButton_unstable = (props, ref)=>{
|
|
28
27
|
iconPosition,
|
29
28
|
shape,
|
30
29
|
size,
|
31
|
-
iconOnly: Boolean((
|
30
|
+
iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !props.children),
|
32
31
|
components: {
|
33
32
|
root: 'button',
|
34
33
|
icon: 'span'
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useButton.js"],"sourcesContent":["import * as React from 'react';\nimport { useARIAButtonShorthand } from '@fluentui/react-aria';\nimport { getNativeElementProps, 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
|
1
|
+
{"version":3,"sources":["useButton.js"],"sourcesContent":["import * as React from 'react';\nimport { useARIAButtonShorthand } from '@fluentui/react-aria';\nimport { getNativeElementProps, 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(getNativeElementProps(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","getNativeElementProps","useARIAButtonShorthand","required","defaultProps","type"],"mappings":";;;;+BAQiBA;;;eAAAA;;;;iEARM;2BACgB;gCACK;+BACX;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,qCAAqB,EAAChB,IAAIiB,IAAAA,iCAAsB,EAACvB,OAAO;YACtEwB,UAAU;YACVC,cAAc;gBACVxB,KAAKA;gBACLyB,MAAM;YACV;QACJ,KAAK;YACDX,aAAa;QACjB;QACAN,MAAMG;IACV;AACJ"}
|
@@ -11,14 +11,13 @@ Object.defineProperty(exports, "renderMenuButton_unstable", {
|
|
11
11
|
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
12
12
|
const _reactutilities = require("@fluentui/react-utilities");
|
13
13
|
const renderMenuButton_unstable = (state)=>{
|
14
|
-
var _icon;
|
15
14
|
(0, _reactutilities.assertSlots)(state);
|
16
15
|
const { icon, iconOnly } = state;
|
17
16
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
|
18
17
|
children: [
|
19
18
|
state.icon && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.icon, {}),
|
20
19
|
!iconOnly && state.root.children,
|
21
|
-
(!iconOnly || !(
|
20
|
+
(!iconOnly || !(icon === null || icon === void 0 ? void 0 : icon.children)) && state.menuIcon && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.menuIcon, {})
|
22
21
|
]
|
23
22
|
});
|
24
23
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["renderMenuButton.js"],"sourcesContent":[" import { jsx as _jsx, jsxs as _jsxs } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Renders a MenuButton component by passing the state defined props to the appropriate slots.\n */ export const renderMenuButton_unstable = (state)=>{\n
|
1
|
+
{"version":3,"sources":["renderMenuButton.js"],"sourcesContent":[" import { jsx as _jsx, jsxs as _jsxs } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Renders a MenuButton component by passing the state defined props to the appropriate slots.\n */ export const renderMenuButton_unstable = (state)=>{\n assertSlots(state);\n const { icon, iconOnly } = state;\n return /*#__PURE__*/ _jsxs(state.root, {\n children: [\n state.icon && /*#__PURE__*/ _jsx(state.icon, {}),\n !iconOnly && state.root.children,\n (!iconOnly || !(icon === null || icon === void 0 ? void 0 : icon.children)) && state.menuIcon && /*#__PURE__*/ _jsx(state.menuIcon, {})\n ]\n });\n};\n"],"names":["renderMenuButton_unstable","state","assertSlots","icon","iconOnly","_jsxs","root","children","_jsx","menuIcon"],"mappings":";;;;+BAIiBA;;;eAAAA;;;4BAJ4B;gCACjB;AAGjB,MAAMA,4BAA4B,CAACC;IAC1CC,IAAAA,2BAAW,EAACD;IACZ,MAAM,EAAEE,IAAI,EAAEC,QAAQ,EAAE,GAAGH;IAC3B,OAAO,WAAW,GAAGI,IAAAA,gBAAK,EAACJ,MAAMK,IAAI,EAAE;QACnCC,UAAU;YACNN,MAAME,IAAI,IAAI,WAAW,GAAGK,IAAAA,eAAI,EAACP,MAAME,IAAI,EAAE,CAAC;YAC9C,CAACC,YAAYH,MAAMK,IAAI,CAACC,QAAQ;YAC/B,CAAA,CAACH,YAAY,CAAED,CAAAA,SAAS,QAAQA,SAAS,KAAK,IAAI,KAAK,IAAIA,KAAKI,QAAQ,AAAD,CAAC,KAAMN,MAAMQ,QAAQ,IAAI,WAAW,GAAGD,IAAAA,eAAI,EAACP,MAAMQ,QAAQ,EAAE,CAAC;SACxI;IACL;AACJ"}
|
@@ -21,5 +21,7 @@ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
21
21
|
const buttonContext = /*#__PURE__*/ _react.createContext(undefined);
|
22
22
|
const buttonContextDefaultValue = {};
|
23
23
|
const ButtonContextProvider = buttonContext.Provider;
|
24
|
-
|
25
|
-
|
24
|
+
const useButtonContext = ()=>{
|
25
|
+
var _React_useContext;
|
26
|
+
return (_React_useContext = _react.useContext(buttonContext)) !== null && _React_useContext !== void 0 ? _React_useContext : buttonContextDefaultValue;
|
27
|
+
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["ButtonContext.js"],"sourcesContent":["import * as React from 'react';\nconst buttonContext = React.createContext(undefined);\nconst buttonContextDefaultValue = {};\n/**\n * @internal\n * Internal context provider used to update default values between internal components\n */ export const ButtonContextProvider = buttonContext.Provider;\
|
1
|
+
{"version":3,"sources":["ButtonContext.js"],"sourcesContent":["import * as React from 'react';\nconst buttonContext = React.createContext(undefined);\nconst buttonContextDefaultValue = {};\n/**\n * @internal\n * Internal context provider used to update default values between internal components\n */ export const ButtonContextProvider = buttonContext.Provider;\n/**\n * @internal\n * Internal context hook used to update default values between internal components\n */ export const useButtonContext = ()=>{\n var _React_useContext;\n return (_React_useContext = React.useContext(buttonContext)) !== null && _React_useContext !== void 0 ? _React_useContext : buttonContextDefaultValue;\n};\n"],"names":["ButtonContextProvider","useButtonContext","buttonContext","React","createContext","undefined","buttonContextDefaultValue","Provider","_React_useContext","useContext"],"mappings":";;;;;;;;;;;IAMiBA,qBAAqB;eAArBA;;IAIAC,gBAAgB;eAAhBA;;;;iEAVM;AACvB,MAAMC,8BAAgBC,OAAMC,aAAa,CAACC;AAC1C,MAAMC,4BAA4B,CAAC;AAIxB,MAAMN,wBAAwBE,cAAcK,QAAQ;AAIpD,MAAMN,mBAAmB;IAChC,IAAIO;IACJ,OAAO,AAACA,CAAAA,oBAAoBL,OAAMM,UAAU,CAACP,cAAa,MAAO,QAAQM,sBAAsB,KAAK,IAAIA,oBAAoBF;AAChI"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-button",
|
3
|
-
"version": "9.3.
|
3
|
+
"version": "9.3.43",
|
4
4
|
"description": "Fluent UI React Button component.",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -34,14 +34,14 @@
|
|
34
34
|
"@fluentui/scripts-tasks": "*"
|
35
35
|
},
|
36
36
|
"dependencies": {
|
37
|
-
"@fluentui/keyboard-keys": "^9.0.
|
38
|
-
"@fluentui/react-aria": "^9.3.
|
39
|
-
"@fluentui/react-icons": "^2.0.
|
40
|
-
"@fluentui/react-jsx-runtime": "^9.0.
|
41
|
-
"@fluentui/react-shared-contexts": "^9.
|
42
|
-
"@fluentui/react-tabster": "^9.
|
43
|
-
"@fluentui/react-theme": "^9.1.
|
44
|
-
"@fluentui/react-utilities": "^9.13.
|
37
|
+
"@fluentui/keyboard-keys": "^9.0.6",
|
38
|
+
"@fluentui/react-aria": "^9.3.38",
|
39
|
+
"@fluentui/react-icons": "^2.0.217",
|
40
|
+
"@fluentui/react-jsx-runtime": "^9.0.12",
|
41
|
+
"@fluentui/react-shared-contexts": "^9.9.1",
|
42
|
+
"@fluentui/react-tabster": "^9.13.1",
|
43
|
+
"@fluentui/react-theme": "^9.1.14",
|
44
|
+
"@fluentui/react-utilities": "^9.13.5",
|
45
45
|
"@griffel/react": "^1.5.14",
|
46
46
|
"@swc/helpers": "^0.5.1"
|
47
47
|
},
|