@fluentui/react-button 0.0.0-nightly-20230317-1454.1 → 0.0.0-nightly-20230322-0439.1
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/.swcrc +2 -11
- package/CHANGELOG.json +86 -17
- package/CHANGELOG.md +29 -11
- package/lib/Button.js +1 -1
- package/lib/CompoundButton.js +1 -1
- package/lib/MenuButton.js +1 -1
- package/lib/SplitButton.js +1 -1
- package/lib/ToggleButton.js +1 -1
- package/lib/components/Button/Button.js +6 -6
- package/lib/components/Button/index.js +4 -4
- package/lib/components/Button/renderButton.js +3 -3
- package/lib/components/Button/useButton.js +13 -13
- package/lib/components/Button/useButton.js.map +1 -1
- package/lib/components/Button/useButtonStyles.js +14 -14
- package/lib/components/CompoundButton/CompoundButton.js +6 -6
- package/lib/components/CompoundButton/index.js +5 -5
- package/lib/components/CompoundButton/renderCompoundButton.js +3 -3
- package/lib/components/CompoundButton/useCompoundButton.js +9 -8
- package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.js +7 -7
- package/lib/components/MenuButton/MenuButton.js +6 -6
- package/lib/components/MenuButton/index.js +5 -5
- package/lib/components/MenuButton/renderMenuButton.js +3 -3
- package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButton.js +9 -8
- package/lib/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButtonStyles.js +10 -10
- package/lib/components/SplitButton/SplitButton.js +6 -6
- package/lib/components/SplitButton/index.js +5 -5
- package/lib/components/SplitButton/renderSplitButton.js +2 -2
- package/lib/components/SplitButton/useSplitButton.js +14 -14
- package/lib/components/SplitButton/useSplitButtonStyles.js +6 -6
- package/lib/components/ToggleButton/ToggleButton.js +6 -6
- package/lib/components/ToggleButton/index.js +5 -5
- package/lib/components/ToggleButton/renderToggleButton.js +1 -1
- package/lib/components/ToggleButton/useToggleButton.js +3 -3
- package/lib/components/ToggleButton/useToggleButtonStyles.js +9 -9
- package/lib/contexts/ButtonContext.js +3 -2
- package/lib/contexts/ButtonContext.js.map +1 -1
- package/lib/contexts/index.js +1 -1
- package/lib/index.js +7 -7
- package/lib/utils/index.js +1 -1
- package/lib/utils/useToggleState.js +4 -4
- package/lib-commonjs/Button.js.map +1 -1
- package/lib-commonjs/CompoundButton.js.map +1 -1
- package/lib-commonjs/MenuButton.js.map +1 -1
- package/lib-commonjs/SplitButton.js.map +1 -1
- package/lib-commonjs/ToggleButton.js.map +1 -1
- package/lib-commonjs/components/Button/Button.js +1 -1
- package/lib-commonjs/components/Button/Button.js.map +1 -1
- package/lib-commonjs/components/Button/index.js.map +1 -1
- package/lib-commonjs/components/Button/renderButton.js +1 -1
- package/lib-commonjs/components/Button/renderButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButton.js +5 -5
- package/lib-commonjs/components/Button/useButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.js +10 -10
- package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.js +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +1 -1
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js +6 -5
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +4 -4
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.js +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/index.js.map +1 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.js +1 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButton.js +5 -4
- package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +6 -6
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.js +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/index.js.map +1 -1
- package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButton.js +7 -7
- package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +3 -3
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.js +1 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +4 -4
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib-commonjs/contexts/ButtonContext.js +2 -1
- package/lib-commonjs/contexts/ButtonContext.js.map +1 -1
- package/lib-commonjs/contexts/index.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/useToggleState.js +2 -2
- package/lib-commonjs/utils/useToggleState.js.map +1 -1
- package/package.json +10 -9
package/.swcrc
CHANGED
@@ -1,15 +1,5 @@
|
|
1
1
|
{
|
2
2
|
"$schema": "https://json.schemastore.org/swcrc",
|
3
|
-
"env": {
|
4
|
-
"targets": {
|
5
|
-
"chrome": "84",
|
6
|
-
"edge": "84",
|
7
|
-
"firefox": "75",
|
8
|
-
"opera": "73",
|
9
|
-
"safari": "14.1"
|
10
|
-
},
|
11
|
-
"bugfixes": true
|
12
|
-
},
|
13
3
|
"exclude": [
|
14
4
|
"/testing",
|
15
5
|
"/**/*.cy.ts",
|
@@ -32,7 +22,8 @@
|
|
32
22
|
"runtime": "classic",
|
33
23
|
"useSpread": true
|
34
24
|
}
|
35
|
-
}
|
25
|
+
},
|
26
|
+
"target": "es2019"
|
36
27
|
},
|
37
28
|
"minify": false,
|
38
29
|
"sourceMaps": true
|
package/CHANGELOG.json
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
"name": "@fluentui/react-button",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
6
|
-
"tag": "@fluentui/react-button_v0.0.0-nightly-
|
7
|
-
"version": "0.0.0-nightly-
|
5
|
+
"date": "Wed, 22 Mar 2023 04:46:39 GMT",
|
6
|
+
"tag": "@fluentui/react-button_v0.0.0-nightly-20230322-0439.1",
|
7
|
+
"version": "0.0.0-nightly-20230322-0439.1",
|
8
8
|
"comments": {
|
9
9
|
"prerelease": [
|
10
10
|
{
|
@@ -16,44 +16,113 @@
|
|
16
16
|
{
|
17
17
|
"author": "beachball",
|
18
18
|
"package": "@fluentui/react-button",
|
19
|
-
"comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightly-
|
20
|
-
"commit": "
|
19
|
+
"comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230322-0439.1",
|
20
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
21
21
|
},
|
22
22
|
{
|
23
23
|
"author": "beachball",
|
24
24
|
"package": "@fluentui/react-button",
|
25
|
-
"comment": "Bump @fluentui/react-aria to v0.0.0-nightly-
|
26
|
-
"commit": "
|
25
|
+
"comment": "Bump @fluentui/react-aria to v0.0.0-nightly-20230322-0439.1",
|
26
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
27
27
|
},
|
28
28
|
{
|
29
29
|
"author": "beachball",
|
30
30
|
"package": "@fluentui/react-button",
|
31
|
-
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-
|
32
|
-
"commit": "
|
31
|
+
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230322-0439.1",
|
32
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
33
33
|
},
|
34
34
|
{
|
35
35
|
"author": "beachball",
|
36
36
|
"package": "@fluentui/react-button",
|
37
|
-
"comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-
|
38
|
-
"commit": "
|
37
|
+
"comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-20230322-0439.1",
|
38
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
39
39
|
},
|
40
40
|
{
|
41
41
|
"author": "beachball",
|
42
42
|
"package": "@fluentui/react-button",
|
43
|
-
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-
|
44
|
-
"commit": "
|
43
|
+
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230322-0439.1",
|
44
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
45
45
|
},
|
46
46
|
{
|
47
47
|
"author": "beachball",
|
48
48
|
"package": "@fluentui/react-button",
|
49
|
-
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-
|
50
|
-
"commit": "
|
49
|
+
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230322-0439.1",
|
50
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
51
51
|
},
|
52
52
|
{
|
53
53
|
"author": "beachball",
|
54
54
|
"package": "@fluentui/react-button",
|
55
|
-
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
56
|
-
"commit": "
|
55
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230322-0439.1",
|
56
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
57
|
+
}
|
58
|
+
]
|
59
|
+
}
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"date": "Tue, 21 Mar 2023 21:23:25 GMT",
|
63
|
+
"tag": "@fluentui/react-button_v9.3.5",
|
64
|
+
"version": "9.3.5",
|
65
|
+
"comments": {
|
66
|
+
"patch": [
|
67
|
+
{
|
68
|
+
"author": "makotom@microsoft.com",
|
69
|
+
"package": "@fluentui/react-button",
|
70
|
+
"commit": "7fde5c94869ff9841b142b7ff1d0a3df0ab58f74",
|
71
|
+
"comment": "chore: Bumping version of @fluentui/react-icons to ^2.0.196."
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"author": "tristan.watanabe@gmail.com",
|
75
|
+
"package": "@fluentui/react-button",
|
76
|
+
"commit": "2fac1a139149bd13b76b1306207bc988dca9c72c",
|
77
|
+
"comment": "chore: migrate to swc transpilation approach."
|
78
|
+
},
|
79
|
+
{
|
80
|
+
"author": "tristan.watanabe@gmail.com",
|
81
|
+
"package": "@fluentui/react-button",
|
82
|
+
"commit": "ead1c6d4c2ac3f3596b62b8cbc07b0a03041f11f",
|
83
|
+
"comment": "fix: add node field to package.json exports map."
|
84
|
+
},
|
85
|
+
{
|
86
|
+
"author": "beachball",
|
87
|
+
"package": "@fluentui/react-button",
|
88
|
+
"comment": "Bump @fluentui/keyboard-keys to v9.0.2",
|
89
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
90
|
+
},
|
91
|
+
{
|
92
|
+
"author": "beachball",
|
93
|
+
"package": "@fluentui/react-button",
|
94
|
+
"comment": "Bump @fluentui/react-aria to v9.3.15",
|
95
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
96
|
+
},
|
97
|
+
{
|
98
|
+
"author": "beachball",
|
99
|
+
"package": "@fluentui/react-button",
|
100
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.3.2",
|
101
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
102
|
+
},
|
103
|
+
{
|
104
|
+
"author": "beachball",
|
105
|
+
"package": "@fluentui/react-button",
|
106
|
+
"comment": "Bump @fluentui/react-tabster to v9.6.1",
|
107
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
108
|
+
},
|
109
|
+
{
|
110
|
+
"author": "beachball",
|
111
|
+
"package": "@fluentui/react-button",
|
112
|
+
"comment": "Bump @fluentui/react-theme to v9.1.7",
|
113
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
114
|
+
},
|
115
|
+
{
|
116
|
+
"author": "beachball",
|
117
|
+
"package": "@fluentui/react-button",
|
118
|
+
"comment": "Bump @fluentui/react-utilities to v9.7.2",
|
119
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
120
|
+
},
|
121
|
+
{
|
122
|
+
"author": "beachball",
|
123
|
+
"package": "@fluentui/react-button",
|
124
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20",
|
125
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
57
126
|
}
|
58
127
|
]
|
59
128
|
}
|
package/CHANGELOG.md
CHANGED
@@ -1,24 +1,42 @@
|
|
1
1
|
# Change Log - @fluentui/react-button
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Wed, 22 Mar 2023 04:46:39 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
-
## [0.0.0-nightly-
|
7
|
+
## [0.0.0-nightly-20230322-0439.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v0.0.0-nightly-20230322-0439.1)
|
8
8
|
|
9
|
-
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.3.
|
9
|
+
Wed, 22 Mar 2023 04:46:39 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.3.5..@fluentui/react-button_v0.0.0-nightly-20230322-0439.1)
|
11
11
|
|
12
12
|
### Changes
|
13
13
|
|
14
14
|
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
|
15
|
-
- Bump @fluentui/keyboard-keys to v0.0.0-nightly-
|
16
|
-
- Bump @fluentui/react-aria to v0.0.0-nightly-
|
17
|
-
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-
|
18
|
-
- Bump @fluentui/react-tabster to v0.0.0-nightly-
|
19
|
-
- Bump @fluentui/react-theme to v0.0.0-nightly-
|
20
|
-
- Bump @fluentui/react-utilities to v0.0.0-nightly-
|
21
|
-
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
15
|
+
- Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
16
|
+
- Bump @fluentui/react-aria to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
17
|
+
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
18
|
+
- Bump @fluentui/react-tabster to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
19
|
+
- Bump @fluentui/react-theme to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
20
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
21
|
+
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
22
|
+
|
23
|
+
## [9.3.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.3.5)
|
24
|
+
|
25
|
+
Tue, 21 Mar 2023 21:23:25 GMT
|
26
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.3.4..@fluentui/react-button_v9.3.5)
|
27
|
+
|
28
|
+
### Patches
|
29
|
+
|
30
|
+
- chore: Bumping version of @fluentui/react-icons to ^2.0.196. ([PR #27100](https://github.com/microsoft/fluentui/pull/27100) by makotom@microsoft.com)
|
31
|
+
- chore: migrate to swc transpilation approach. ([PR #27250](https://github.com/microsoft/fluentui/pull/27250) by tristan.watanabe@gmail.com)
|
32
|
+
- fix: add node field to package.json exports map. ([PR #27154](https://github.com/microsoft/fluentui/pull/27154) by tristan.watanabe@gmail.com)
|
33
|
+
- Bump @fluentui/keyboard-keys to v9.0.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
34
|
+
- Bump @fluentui/react-aria to v9.3.15 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
35
|
+
- Bump @fluentui/react-shared-contexts to v9.3.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
36
|
+
- Bump @fluentui/react-tabster to v9.6.1 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
37
|
+
- Bump @fluentui/react-theme to v9.1.7 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
38
|
+
- Bump @fluentui/react-utilities to v9.7.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
39
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
22
40
|
|
23
41
|
## [9.3.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.3.4)
|
24
42
|
|
package/lib/Button.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from
|
1
|
+
export * from './components/Button/index';
|
2
2
|
//# sourceMappingURL=Button.js.map
|
package/lib/CompoundButton.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from
|
1
|
+
export * from './components/CompoundButton/index';
|
2
2
|
//# sourceMappingURL=CompoundButton.js.map
|
package/lib/MenuButton.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from
|
1
|
+
export * from './components/MenuButton/index';
|
2
2
|
//# sourceMappingURL=MenuButton.js.map
|
package/lib/SplitButton.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from
|
1
|
+
export * from './components/SplitButton/index';
|
2
2
|
//# sourceMappingURL=SplitButton.js.map
|
package/lib/ToggleButton.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from
|
1
|
+
export * from './components/ToggleButton/index';
|
2
2
|
//# sourceMappingURL=ToggleButton.js.map
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { renderButton_unstable } from
|
3
|
-
import { useButton_unstable } from
|
4
|
-
import { useButtonStyles_unstable } from
|
5
|
-
import { useCustomStyleHooks_unstable } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { renderButton_unstable } from './renderButton';
|
3
|
+
import { useButton_unstable } from './useButton';
|
4
|
+
import { useButtonStyles_unstable } from './useButtonStyles';
|
5
|
+
import { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';
|
6
6
|
/**
|
7
7
|
* Buttons give people a way to trigger an action.
|
8
8
|
*/
|
@@ -17,5 +17,5 @@ export const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
17
17
|
// Casting is required due to lack of distributive union to support unions on @types/react
|
18
18
|
});
|
19
19
|
|
20
|
-
Button.displayName =
|
20
|
+
Button.displayName = 'Button';
|
21
21
|
//# sourceMappingURL=Button.js.map
|
@@ -1,5 +1,5 @@
|
|
1
|
-
export * from
|
2
|
-
export * from
|
3
|
-
export * from
|
4
|
-
export { buttonClassNames, useButtonStyles_unstable } from
|
1
|
+
export * from './Button';
|
2
|
+
export * from './renderButton';
|
3
|
+
export * from './useButton';
|
4
|
+
export { buttonClassNames, useButtonStyles_unstable } from './useButtonStyles';
|
5
5
|
//# sourceMappingURL=index.js.map
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { getSlots } from
|
1
|
+
import * as React from 'react';
|
2
|
+
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
|
*/
|
@@ -12,6 +12,6 @@ export const renderButton_unstable = state => {
|
|
12
12
|
iconOnly,
|
13
13
|
iconPosition
|
14
14
|
} = state;
|
15
|
-
return /*#__PURE__*/React.createElement(slots.root, slotProps.root, iconPosition !==
|
15
|
+
return /*#__PURE__*/React.createElement(slots.root, slotProps.root, iconPosition !== 'after' && slots.icon && /*#__PURE__*/React.createElement(slots.icon, slotProps.icon), !iconOnly && state.root.children, iconPosition === 'after' && slots.icon && /*#__PURE__*/React.createElement(slots.icon, slotProps.icon));
|
16
16
|
};
|
17
17
|
//# sourceMappingURL=renderButton.js.map
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { useARIAButtonShorthand } from
|
3
|
-
import { getNativeElementProps, resolveShorthand } from
|
4
|
-
import { useButtonContext } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { useARIAButtonShorthand } from '@fluentui/react-aria';
|
3
|
+
import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';
|
4
|
+
import { useButtonContext } from '../../contexts/ButtonContext';
|
5
5
|
/**
|
6
6
|
* Given user props, defines default props for the Button, calls useButtonState, and returns processed state.
|
7
7
|
* @param props - User provided props to the Button component.
|
@@ -12,14 +12,14 @@ export const useButton_unstable = (props, ref) => {
|
|
12
12
|
size: contextSize
|
13
13
|
} = useButtonContext();
|
14
14
|
const {
|
15
|
-
appearance =
|
16
|
-
as =
|
15
|
+
appearance = 'secondary',
|
16
|
+
as = 'button',
|
17
17
|
disabled = false,
|
18
18
|
disabledFocusable = false,
|
19
19
|
icon,
|
20
|
-
iconPosition =
|
21
|
-
shape =
|
22
|
-
size = contextSize
|
20
|
+
iconPosition = 'before',
|
21
|
+
shape = 'rounded',
|
22
|
+
size = contextSize !== null && contextSize !== void 0 ? contextSize : 'medium'
|
23
23
|
} = props;
|
24
24
|
const iconShorthand = resolveShorthand(icon);
|
25
25
|
return {
|
@@ -31,17 +31,17 @@ export const useButton_unstable = (props, ref) => {
|
|
31
31
|
shape,
|
32
32
|
size,
|
33
33
|
// State calculated from a set of props
|
34
|
-
iconOnly: Boolean(iconShorthand
|
34
|
+
iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !props.children),
|
35
35
|
// Slots definition
|
36
36
|
components: {
|
37
|
-
root:
|
38
|
-
icon:
|
37
|
+
root: 'button',
|
38
|
+
icon: 'span'
|
39
39
|
},
|
40
40
|
root: getNativeElementProps(as, useARIAButtonShorthand(props, {
|
41
41
|
required: true,
|
42
42
|
defaultProps: {
|
43
43
|
ref: ref,
|
44
|
-
type:
|
44
|
+
type: 'button'
|
45
45
|
}
|
46
46
|
})),
|
47
47
|
icon: iconShorthand
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","useARIAButtonShorthand","getNativeElementProps","resolveShorthand","useButtonContext","useButton_unstable","props","ref","size","contextSize","appearance","as","disabled","disabledFocusable","icon","iconPosition","shape","iconShorthand","iconOnly","Boolean","children","components","root","required","defaultProps","type"],"sources":["../../../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 { 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 = 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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAA8BC,sBAAsB,QAAQ;AAC5D,SAASC,qBAAqB,EAAEC,gBAAgB,QAAQ;AACxD,SAASC,gBAAgB,QAAQ;AAGjC;;;;;AAKA,OAAO,MAAMC,kBAAA,GAAqBA,CAChCC,KAAA,EACAC,GAAA,KACgB;EAChB,MAAM;IAAEC,IAAA,EAAMC;EAAW,CAAE,GAAGL,gBAAA;EAC9B,MAAM;IACJM,UAAA,GAAa;IACbC,EAAA,GAAK;IACLC,QAAA,GAAW,KAAK;IAChBC,iBAAA,GAAoB,KAAK;IACzBC,IAAA;IACAC,YAAA,GAAe;IACfC,KAAA,GAAQ;IACRR,IAAA,GAAOC,WAAA,
|
1
|
+
{"version":3,"names":["React","useARIAButtonShorthand","getNativeElementProps","resolveShorthand","useButtonContext","useButton_unstable","props","ref","size","contextSize","appearance","as","disabled","disabledFocusable","icon","iconPosition","shape","iconShorthand","iconOnly","Boolean","children","components","root","required","defaultProps","type"],"sources":["../../../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 { 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 = 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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAA8BC,sBAAsB,QAAQ;AAC5D,SAASC,qBAAqB,EAAEC,gBAAgB,QAAQ;AACxD,SAASC,gBAAgB,QAAQ;AAGjC;;;;;AAKA,OAAO,MAAMC,kBAAA,GAAqBA,CAChCC,KAAA,EACAC,GAAA,KACgB;EAChB,MAAM;IAAEC,IAAA,EAAMC;EAAW,CAAE,GAAGL,gBAAA;EAC9B,MAAM;IACJM,UAAA,GAAa;IACbC,EAAA,GAAK;IACLC,QAAA,GAAW,KAAK;IAChBC,iBAAA,GAAoB,KAAK;IACzBC,IAAA;IACAC,YAAA,GAAe;IACfC,KAAA,GAAQ;IACRR,IAAA,GAAOC,WAAA,aAAAA,WAAA,cAAAA,WAAA,GAAe;EAAQ,CAC/B,GAAGH,KAAA;EACJ,MAAMW,aAAA,GAAgBd,gBAAA,CAAiBW,IAAA;EAEvC,OAAO;IACL;IACAJ,UAAA;IACAE,QAAA;IACAC,iBAAA;IACAE,YAAA;IACAC,KAAA;IACAR,IAAA;IAEA;IACAU,QAAA,EAAUC,OAAA,CAAQ,CAAAF,aAAA,aAAAA,aAAA,uBAAAA,aAAA,CAAeG,QAAQ,KAAI,CAACd,KAAA,CAAMc,QAAQ;IAE5D;IACAC,UAAA,EAAY;MACVC,IAAA,EAAM;MACNR,IAAA,EAAM;IACR;IAEAQ,IAAA,EAAMpB,qBAAA,CACJS,EAAA,EACAV,sBAAA,CAAiDK,KAAA,EAAO;MACtDiB,QAAA,EAAU,IAAI;MACdC,YAAA,EAAc;QACZjB,GAAA,EAAKA,GAAA;QACLkB,IAAA,EAAM;MACR;IACF;IAEFX,IAAA,EAAMG;EACR;AACF"}
|
@@ -1,17 +1,17 @@
|
|
1
|
-
import { iconFilledClassName, iconRegularClassName } from
|
2
|
-
import { createCustomFocusIndicatorStyle } from
|
3
|
-
import { tokens } from
|
4
|
-
import { shorthands, __styles, __resetStyles, mergeClasses } from
|
1
|
+
import { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';
|
2
|
+
import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';
|
3
|
+
import { tokens } from '@fluentui/react-theme';
|
4
|
+
import { shorthands, __styles, __resetStyles, mergeClasses } from '@griffel/react';
|
5
5
|
export const buttonClassNames = {
|
6
|
-
root:
|
7
|
-
icon:
|
6
|
+
root: 'fui-Button',
|
7
|
+
icon: 'fui-Button__icon'
|
8
8
|
};
|
9
|
-
const iconSpacingVar =
|
10
|
-
const buttonSpacingSmall =
|
11
|
-
const buttonSpacingSmallWithIcon =
|
12
|
-
const buttonSpacingMedium =
|
13
|
-
const buttonSpacingLarge =
|
14
|
-
const buttonSpacingLargeWithIcon =
|
9
|
+
const iconSpacingVar = '--fui-Button__icon--spacing';
|
10
|
+
const buttonSpacingSmall = '3px';
|
11
|
+
const buttonSpacingSmallWithIcon = '1px';
|
12
|
+
const buttonSpacingMedium = '5px';
|
13
|
+
const buttonSpacingLarge = '8px';
|
14
|
+
const buttonSpacingLargeWithIcon = '7px';
|
15
15
|
const useRootBaseClassName = /*#__PURE__*/__resetStyles("rsawnvh", "r1eny37h", [".rsawnvh{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;text-decoration-line:none;vertical-align:middle;margin:0;overflow:hidden;background-color:var(--colorNeutralBackground1);color:var(--colorNeutralForeground1);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);font-family:var(--fontFamilyBase);outline-style:none;padding:5px var(--spacingHorizontalM);min-width:96px;border-radius:var(--borderRadiusMedium);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightSemibold);line-height:var(--lineHeightBase300);transition-duration:var(--durationFaster);transition-property:background,border,color;transition-timing-function:var(--curveEasyEase);}", ".rsawnvh:hover{background-color:var(--colorNeutralBackground1Hover);border-color:var(--colorNeutralStroke1Hover);color:var(--colorNeutralForeground1Hover);cursor:pointer;}", ".rsawnvh:hover .fui-Icon-filled{display:inline;}", ".rsawnvh:hover .fui-Icon-regular{display:none;}", ".rsawnvh:hover:active{background-color:var(--colorNeutralBackground1Pressed);border-color:var(--colorNeutralStroke1Pressed);color:var(--colorNeutralForeground1Pressed);outline-style:none;}", ".rsawnvh:hover:active .fui-Icon-filled{display:inline;}", ".rsawnvh:hover:active .fui-Icon-regular{display:none;}", "@media screen and (prefers-reduced-motion: reduce){.rsawnvh{transition-duration:0.01ms;}}", "@media (forced-colors: active){.rsawnvh:focus{border-color:ButtonText;}.rsawnvh:hover{background-color:HighlightText;border-color:Highlight;color:Highlight;forced-color-adjust:none;}.rsawnvh:hover:active{background-color:HighlightText;border-color:Highlight;color:Highlight;forced-color-adjust:none;}}", ".rsawnvh:focus{outline-style:none;}", ".rsawnvh:focus-visible{outline-style:none;}", ".rsawnvh[data-fui-focus-visible]{border-color:var(--colorTransparentStroke);border-radius:var(--borderRadiusMedium);outline:var(--strokeWidthThick) solid var(--colorTransparentStroke);box-shadow:var(--shadow4),0 0 0 2px var(--colorStrokeFocus2);z-index:1;}", ".r1eny37h{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;text-decoration-line:none;vertical-align:middle;margin:0;overflow:hidden;background-color:var(--colorNeutralBackground1);color:var(--colorNeutralForeground1);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);font-family:var(--fontFamilyBase);outline-style:none;padding:5px var(--spacingHorizontalM);min-width:96px;border-radius:var(--borderRadiusMedium);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightSemibold);line-height:var(--lineHeightBase300);transition-duration:var(--durationFaster);transition-property:background,border,color;transition-timing-function:var(--curveEasyEase);}", ".r1eny37h:hover{background-color:var(--colorNeutralBackground1Hover);border-color:var(--colorNeutralStroke1Hover);color:var(--colorNeutralForeground1Hover);cursor:pointer;}", ".r1eny37h:hover .fui-Icon-filled{display:inline;}", ".r1eny37h:hover .fui-Icon-regular{display:none;}", ".r1eny37h:hover:active{background-color:var(--colorNeutralBackground1Pressed);border-color:var(--colorNeutralStroke1Pressed);color:var(--colorNeutralForeground1Pressed);outline-style:none;}", ".r1eny37h:hover:active .fui-Icon-filled{display:inline;}", ".r1eny37h:hover:active .fui-Icon-regular{display:none;}", "@media screen and (prefers-reduced-motion: reduce){.r1eny37h{transition-duration:0.01ms;}}", "@media (forced-colors: active){.r1eny37h:focus{border-color:ButtonText;}.r1eny37h:hover{background-color:HighlightText;border-color:Highlight;color:Highlight;forced-color-adjust:none;}.r1eny37h:hover:active{background-color:HighlightText;border-color:Highlight;color:Highlight;forced-color-adjust:none;}}", ".r1eny37h:focus{outline-style:none;}", ".r1eny37h:focus-visible{outline-style:none;}", ".r1eny37h[data-fui-focus-visible]{border-color:var(--colorTransparentStroke);border-radius:var(--borderRadiusMedium);outline:var(--strokeWidthThick) solid var(--colorTransparentStroke);box-shadow:var(--shadow4),0 0 0 2px var(--colorStrokeFocus2);z-index:1;}"]);
|
16
16
|
const useIconBaseClassName = /*#__PURE__*/__resetStyles("rywnvv2", null, [".rywnvv2{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;font-size:20px;height:20px;width:20px;--fui-Button__icon--spacing:var(--spacingHorizontalSNudge);}"]);
|
17
17
|
const useRootStyles = /*#__PURE__*/__styles({
|
@@ -468,11 +468,11 @@ export const useButtonStyles_unstable = state => {
|
|
468
468
|
shape,
|
469
469
|
size
|
470
470
|
} = state;
|
471
|
-
state.root.className = mergeClasses(buttonClassNames.root, rootBaseClassName, appearance && rootStyles[appearance], rootStyles[size], icon && size ===
|
471
|
+
state.root.className = mergeClasses(buttonClassNames.root, rootBaseClassName, appearance && rootStyles[appearance], rootStyles[size], icon && size === 'small' && rootStyles.smallWithIcon, icon && size === 'large' && rootStyles.largeWithIcon, rootStyles[shape],
|
472
472
|
// Disabled styles
|
473
473
|
(disabled || disabledFocusable) && rootDisabledStyles.base, (disabled || disabledFocusable) && rootDisabledStyles.highContrast, appearance && (disabled || disabledFocusable) && rootDisabledStyles[appearance],
|
474
474
|
// Focus styles
|
475
|
-
appearance ===
|
475
|
+
appearance === 'primary' && rootFocusStyles.primary, rootFocusStyles[size], rootFocusStyles[shape],
|
476
476
|
// Icon-only styles
|
477
477
|
iconOnly && rootIconOnlyStyles[size],
|
478
478
|
// User provided class name
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { renderCompoundButton_unstable } from
|
3
|
-
import { useCompoundButton_unstable } from
|
4
|
-
import { useCompoundButtonStyles_unstable } from
|
5
|
-
import { useCustomStyleHooks_unstable } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { renderCompoundButton_unstable } from './renderCompoundButton';
|
3
|
+
import { useCompoundButton_unstable } from './useCompoundButton';
|
4
|
+
import { useCompoundButtonStyles_unstable } from './useCompoundButtonStyles';
|
5
|
+
import { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';
|
6
6
|
/**
|
7
7
|
* CompoundButtons are buttons that can have secondary content that adds extra information to the user.
|
8
8
|
*/
|
@@ -17,5 +17,5 @@ export const CompoundButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
17
17
|
// Casting is required due to lack of distributive union to support unions on @types/react
|
18
18
|
});
|
19
19
|
|
20
|
-
CompoundButton.displayName =
|
20
|
+
CompoundButton.displayName = 'CompoundButton';
|
21
21
|
//# sourceMappingURL=CompoundButton.js.map
|
@@ -1,6 +1,6 @@
|
|
1
|
-
export * from
|
2
|
-
export * from
|
3
|
-
export * from
|
4
|
-
export * from
|
5
|
-
export { compoundButtonClassNames, useCompoundButtonStyles_unstable } from
|
1
|
+
export * from './CompoundButton';
|
2
|
+
export * from './CompoundButton.types';
|
3
|
+
export * from './renderCompoundButton';
|
4
|
+
export * from './useCompoundButton';
|
5
|
+
export { compoundButtonClassNames, useCompoundButtonStyles_unstable } from './useCompoundButtonStyles';
|
6
6
|
//# sourceMappingURL=index.js.map
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { getSlots } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { getSlots } from '@fluentui/react-utilities';
|
3
3
|
/**
|
4
4
|
* Renders a CompoundButton component by passing the state defined props to the appropriate slots.
|
5
5
|
*/
|
@@ -12,6 +12,6 @@ export const renderCompoundButton_unstable = state => {
|
|
12
12
|
iconOnly,
|
13
13
|
iconPosition
|
14
14
|
} = state;
|
15
|
-
return /*#__PURE__*/React.createElement(slots.root, slotProps.root, iconPosition !==
|
15
|
+
return /*#__PURE__*/React.createElement(slots.root, slotProps.root, iconPosition !== 'after' && slots.icon && /*#__PURE__*/React.createElement(slots.icon, slotProps.icon), !iconOnly && /*#__PURE__*/React.createElement(slots.contentContainer, slotProps.contentContainer, slotProps.root.children, slots.secondaryContent && /*#__PURE__*/React.createElement(slots.secondaryContent, slotProps.secondaryContent)), iconPosition === 'after' && slots.icon && /*#__PURE__*/React.createElement(slots.icon, slotProps.icon));
|
16
16
|
};
|
17
17
|
//# sourceMappingURL=renderCompoundButton.js.map
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { resolveShorthand } from
|
3
|
-
import { useButton_unstable } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { resolveShorthand } from '@fluentui/react-utilities';
|
3
|
+
import { useButton_unstable } from '../Button/index';
|
4
4
|
/**
|
5
5
|
* Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.
|
6
6
|
* @param props - User provided props to the CompoundButton component.
|
@@ -11,15 +11,16 @@ export const useCompoundButton_unstable = ({
|
|
11
11
|
secondaryContent,
|
12
12
|
...props
|
13
13
|
}, ref) => {
|
14
|
+
var _state_icon, _state_secondaryContent;
|
14
15
|
const state = {
|
15
16
|
// Button state
|
16
17
|
...useButton_unstable(props, ref),
|
17
18
|
// Slots definition
|
18
19
|
components: {
|
19
|
-
root:
|
20
|
-
icon:
|
21
|
-
contentContainer:
|
22
|
-
secondaryContent:
|
20
|
+
root: 'button',
|
21
|
+
icon: 'span',
|
22
|
+
contentContainer: 'span',
|
23
|
+
secondaryContent: 'span'
|
23
24
|
},
|
24
25
|
contentContainer: resolveShorthand(contentContainer, {
|
25
26
|
required: true
|
@@ -27,7 +28,7 @@ export const useCompoundButton_unstable = ({
|
|
27
28
|
secondaryContent: resolveShorthand(secondaryContent)
|
28
29
|
};
|
29
30
|
// Recalculate iconOnly to take into account secondaryContent.
|
30
|
-
state.iconOnly = Boolean(state.icon
|
31
|
+
state.iconOnly = Boolean(((_state_icon = state.icon) === null || _state_icon === void 0 ? void 0 : _state_icon.children) && !props.children && !((_state_secondaryContent = state.secondaryContent) === null || _state_secondaryContent === void 0 ? void 0 : _state_secondaryContent.children));
|
31
32
|
return state;
|
32
33
|
};
|
33
34
|
//# sourceMappingURL=useCompoundButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","resolveShorthand","useButton_unstable","useCompoundButton_unstable","contentContainer","secondaryContent","props","ref","state","components","root","icon","required","iconOnly","Boolean","children"],"sources":["../../../src/components/CompoundButton/useCompoundButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { useButton_unstable } from '../Button/index';\nimport type { CompoundButtonProps, CompoundButtonState } from './CompoundButton.types';\n\n/**\n * Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.\n * @param props - User provided props to the CompoundButton component.\n * @param ref - User provided ref to be passed to the CompoundButton component.\n */\nexport const useCompoundButton_unstable = (\n { contentContainer, secondaryContent, ...props }: CompoundButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): CompoundButtonState => {\n const state: CompoundButtonState = {\n // Button state\n ...useButton_unstable(props, ref),\n\n // Slots definition\n components: {\n root: 'button',\n icon: 'span',\n contentContainer: 'span',\n secondaryContent: 'span',\n },\n contentContainer: resolveShorthand(contentContainer, { required: true }),\n secondaryContent: resolveShorthand(secondaryContent),\n };\n\n // Recalculate iconOnly to take into account secondaryContent.\n state.iconOnly = Boolean(state.icon?.children && !props.children && !state.secondaryContent?.children);\n\n return state;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,gBAAgB,QAAQ;AACjC,SAASC,kBAAkB,QAAQ;AAGnC;;;;;AAKA,OAAO,MAAMC,0BAAA,GAA6BA,CACxC;EAAEC,gBAAA;EAAkBC,gBAAA;EAAkB,GAAGC;AAAA,CAA4B,EACrEC,GAAA,KACwB;
|
1
|
+
{"version":3,"names":["React","resolveShorthand","useButton_unstable","useCompoundButton_unstable","contentContainer","secondaryContent","props","ref","_state_icon","_state_secondaryContent","state","components","root","icon","required","iconOnly","Boolean","children"],"sources":["../../../src/components/CompoundButton/useCompoundButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { useButton_unstable } from '../Button/index';\nimport type { CompoundButtonProps, CompoundButtonState } from './CompoundButton.types';\n\n/**\n * Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.\n * @param props - User provided props to the CompoundButton component.\n * @param ref - User provided ref to be passed to the CompoundButton component.\n */\nexport const useCompoundButton_unstable = (\n { contentContainer, secondaryContent, ...props }: CompoundButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): CompoundButtonState => {\n const state: CompoundButtonState = {\n // Button state\n ...useButton_unstable(props, ref),\n\n // Slots definition\n components: {\n root: 'button',\n icon: 'span',\n contentContainer: 'span',\n secondaryContent: 'span',\n },\n contentContainer: resolveShorthand(contentContainer, { required: true }),\n secondaryContent: resolveShorthand(secondaryContent),\n };\n\n // Recalculate iconOnly to take into account secondaryContent.\n state.iconOnly = Boolean(state.icon?.children && !props.children && !state.secondaryContent?.children);\n\n return state;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,gBAAgB,QAAQ;AACjC,SAASC,kBAAkB,QAAQ;AAGnC;;;;;AAKA,OAAO,MAAMC,0BAAA,GAA6BA,CACxC;EAAEC,gBAAA;EAAkBC,gBAAA;EAAkB,GAAGC;AAAA,CAA4B,EACrEC,GAAA,KACwB;MAiBCC,WAAA,EAA4CC,uBAAA;EAhBrE,MAAMC,KAAA,GAA6B;IACjC;IACA,GAAGR,kBAAA,CAAmBI,KAAA,EAAOC,GAAA,CAAI;IAEjC;IACAI,UAAA,EAAY;MACVC,IAAA,EAAM;MACNC,IAAA,EAAM;MACNT,gBAAA,EAAkB;MAClBC,gBAAA,EAAkB;IACpB;IACAD,gBAAA,EAAkBH,gBAAA,CAAiBG,gBAAA,EAAkB;MAAEU,QAAA,EAAU;IAAK;IACtET,gBAAA,EAAkBJ,gBAAA,CAAiBI,gBAAA;EACrC;EAEA;EACAK,KAAA,CAAMK,QAAQ,GAAGC,OAAA,CAAQ,EAAAR,WAAA,GAAAE,KAAA,CAAMG,IAAI,cAAVL,WAAA,uBAAAA,WAAA,CAAYS,QAAQ,KAAI,CAACX,KAAA,CAAMW,QAAQ,IAAI,EAAC,CAAAR,uBAAA,GAAAC,KAAA,CAAML,gBAAgB,cAAtBI,uBAAA,uBAAAA,uBAAA,CAAwBQ,QAAQ,CAAD;EAEpG,OAAOP,KAAA;AACT"}
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { tokens } from
|
2
|
-
import { shorthands, mergeClasses, __styles } from
|
3
|
-
import { useButtonStyles_unstable } from
|
1
|
+
import { tokens } from '@fluentui/react-theme';
|
2
|
+
import { shorthands, mergeClasses, __styles } from '@griffel/react';
|
3
|
+
import { useButtonStyles_unstable } from '../Button/useButtonStyles';
|
4
4
|
export const compoundButtonClassNames = {
|
5
|
-
root:
|
6
|
-
icon:
|
7
|
-
contentContainer:
|
8
|
-
secondaryContent:
|
5
|
+
root: 'fui-CompoundButton',
|
6
|
+
icon: 'fui-CompoundButton__icon',
|
7
|
+
contentContainer: 'fui-CompoundButton__contentContainer',
|
8
|
+
secondaryContent: 'fui-CompoundButton__secondaryContent'
|
9
9
|
};
|
10
10
|
const useRootStyles = /*#__PURE__*/__styles({
|
11
11
|
base: {
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { renderMenuButton_unstable } from
|
3
|
-
import { useMenuButton_unstable } from
|
4
|
-
import { useMenuButtonStyles_unstable } from
|
5
|
-
import { useCustomStyleHooks_unstable } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { renderMenuButton_unstable } from './renderMenuButton';
|
3
|
+
import { useMenuButton_unstable } from './useMenuButton';
|
4
|
+
import { useMenuButtonStyles_unstable } from './useMenuButtonStyles';
|
5
|
+
import { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';
|
6
6
|
/**
|
7
7
|
* MenuButtons are buttons that have a chevron icon after the button contents and are usually clicked to open/close
|
8
8
|
* menus.
|
@@ -18,5 +18,5 @@ export const MenuButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
18
18
|
// Casting is required due to lack of distributive union to support unions on @types/react
|
19
19
|
});
|
20
20
|
|
21
|
-
MenuButton.displayName =
|
21
|
+
MenuButton.displayName = 'MenuButton';
|
22
22
|
//# sourceMappingURL=MenuButton.js.map
|
@@ -1,6 +1,6 @@
|
|
1
|
-
export * from
|
2
|
-
export * from
|
3
|
-
export * from
|
4
|
-
export * from
|
5
|
-
export { menuButtonClassNames, useMenuButtonStyles_unstable } from
|
1
|
+
export * from './MenuButton.types';
|
2
|
+
export * from './MenuButton';
|
3
|
+
export * from './renderMenuButton';
|
4
|
+
export * from './useMenuButton';
|
5
|
+
export { menuButtonClassNames, useMenuButtonStyles_unstable } from './useMenuButtonStyles';
|
6
6
|
//# sourceMappingURL=index.js.map
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as React from
|
2
|
-
import { getSlots } from
|
1
|
+
import * as React from 'react';
|
2
|
+
import { getSlots } from '@fluentui/react-utilities';
|
3
3
|
/**
|
4
4
|
* Renders a MenuButton component by passing the state defined props to the appropriate slots.
|
5
5
|
*/
|
@@ -12,6 +12,6 @@ export const renderMenuButton_unstable = state => {
|
|
12
12
|
icon,
|
13
13
|
iconOnly
|
14
14
|
} = state;
|
15
|
-
return /*#__PURE__*/React.createElement(slots.root, slotProps.root, slots.icon && /*#__PURE__*/React.createElement(slots.icon, slotProps.icon), !iconOnly && slotProps.root.children, (!iconOnly || !icon
|
15
|
+
return /*#__PURE__*/React.createElement(slots.root, slotProps.root, slots.icon && /*#__PURE__*/React.createElement(slots.icon, slotProps.icon), !iconOnly && slotProps.root.children, (!iconOnly || !(icon === null || icon === void 0 ? void 0 : icon.children)) && slots.menuIcon && /*#__PURE__*/React.createElement(slots.menuIcon, slotProps.menuIcon));
|
16
16
|
};
|
17
17
|
//# sourceMappingURL=renderMenuButton.js.map
|