@fluentui/react-button 0.0.0-nightly-20220519-0420.1 → 0.0.0-nightly-20220525-0423.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/CHANGELOG.json +99 -13
- package/CHANGELOG.md +35 -9
- package/README.md +80 -18
- package/dist/index.d.ts +6 -37
- package/lib/components/Button/Button.types.js.map +1 -1
- package/lib/components/Button/index.js +1 -3
- package/lib/components/Button/index.js.map +1 -1
- package/lib/components/Button/useButton.js +0 -3
- package/lib/components/Button/useButton.js.map +1 -1
- package/lib/components/Button/useButtonStyles.js +52 -58
- package/lib/components/Button/useButtonStyles.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
- package/lib/components/CompoundButton/index.js +1 -3
- package/lib/components/CompoundButton/index.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.js +34 -33
- package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +2 -1
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
- package/lib/components/MenuButton/index.js +1 -3
- package/lib/components/MenuButton/index.js.map +1 -1
- package/lib/components/MenuButton/useMenuButtonStyles.js +21 -16
- package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.js +1 -1
- package/lib/components/SplitButton/SplitButton.js.map +1 -1
- package/lib/components/SplitButton/index.js +1 -3
- package/lib/components/SplitButton/index.js.map +1 -1
- package/lib/components/SplitButton/useSplitButton.js +0 -4
- package/lib/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButtonStyles.js +4 -13
- package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib/components/ToggleButton/index.js +1 -3
- package/lib/components/ToggleButton/index.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.js +45 -9
- package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib/index.js +5 -10
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/Button/index.js +1 -9
- package/lib-commonjs/components/Button/index.js.map +1 -1
- package/lib-commonjs/components/Button/useButton.js +0 -3
- package/lib-commonjs/components/Button/useButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.js +53 -59
- package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/index.js +1 -9
- package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +35 -34
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.js +2 -1
- package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/index.js +1 -9
- package/lib-commonjs/components/MenuButton/index.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +23 -17
- 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 +1 -9
- package/lib-commonjs/components/SplitButton/index.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButton.js +0 -4
- package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +5 -14
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/index.js +1 -9
- package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +47 -10
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib-commonjs/index.js +1 -36
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.json
CHANGED
@@ -2,17 +2,103 @@
|
|
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, 25 May 2022 04:35:47 GMT",
|
6
|
+
"tag": "@fluentui/react-button_v0.0.0-nightly-20220525-0423.1",
|
7
|
+
"version": "0.0.0-nightly-20220525-0423.1",
|
8
8
|
"comments": {
|
9
9
|
"prerelease": [
|
10
|
+
{
|
11
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
12
|
+
"package": "@fluentui/react-button",
|
13
|
+
"commit": "cc2a9d0f9b722f68a54da026ab320e3be22c21dd",
|
14
|
+
"comment": "ToggleButton: Differentiating hover and checked styles."
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
18
|
+
"package": "@fluentui/react-button",
|
19
|
+
"commit": "2c84c4f1ad43819325ee0aafa57d42a1f8239113",
|
20
|
+
"comment": "ToggleButton: Apply thicker border width to checked outline toggle buttons."
|
21
|
+
}
|
22
|
+
]
|
23
|
+
}
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"date": "Mon, 23 May 2022 18:56:41 GMT",
|
27
|
+
"tag": "@fluentui/react-button_v9.0.0-rc.11",
|
28
|
+
"version": "9.0.0-rc.11",
|
29
|
+
"comments": {
|
30
|
+
"prerelease": [
|
31
|
+
{
|
32
|
+
"author": "esteban.230@hotmail.com",
|
33
|
+
"package": "@fluentui/react-button",
|
34
|
+
"commit": "5ed22515a7542b432ed694f22606ac3718d501cb",
|
35
|
+
"comment": "Removing <componentName>ClassName exports."
|
36
|
+
},
|
37
|
+
{
|
38
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
39
|
+
"package": "@fluentui/react-button",
|
40
|
+
"commit": "5ed22515a7542b432ed694f22606ac3718d501cb",
|
41
|
+
"comment": "Removing deprecated block prop from all button components."
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"author": "beachball",
|
45
|
+
"package": "@fluentui/react-button",
|
46
|
+
"comment": "Bump @fluentui/react-tabster to v9.0.0-rc.11",
|
47
|
+
"commit": "d4f80b17690e962d6a24e68959608d1ffe84aef6"
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"author": "beachball",
|
51
|
+
"package": "@fluentui/react-button",
|
52
|
+
"comment": "Bump @fluentui/react-theme to v9.0.0-rc.9",
|
53
|
+
"commit": "d4f80b17690e962d6a24e68959608d1ffe84aef6"
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"author": "beachball",
|
57
|
+
"package": "@fluentui/react-button",
|
58
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.7",
|
59
|
+
"commit": "d4f80b17690e962d6a24e68959608d1ffe84aef6"
|
60
|
+
}
|
61
|
+
],
|
62
|
+
"none": [
|
63
|
+
{
|
64
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
65
|
+
"package": "@fluentui/react-button",
|
66
|
+
"commit": "aa1f446e037786d74a3c14f0bee09dbcf403a929",
|
67
|
+
"comment": "Improving README and updating spec and migration guide."
|
68
|
+
}
|
69
|
+
]
|
70
|
+
}
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"date": "Mon, 23 May 2022 12:14:03 GMT",
|
74
|
+
"tag": "@fluentui/react-button_v9.0.0-rc.10",
|
75
|
+
"version": "9.0.0-rc.10",
|
76
|
+
"comments": {
|
77
|
+
"prerelease": [
|
78
|
+
{
|
79
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
80
|
+
"package": "@fluentui/react-button",
|
81
|
+
"commit": "6cb084a7afe7d662dc2d9d65b91474f132566390",
|
82
|
+
"comment": "Using spacing tokens for button components."
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
86
|
+
"package": "@fluentui/react-button",
|
87
|
+
"commit": "29f73d77cfdc20a123cb64115fb1a926300d216e",
|
88
|
+
"comment": "Removing flex gap from button components and fixing spacing to better align with design spec."
|
89
|
+
},
|
10
90
|
{
|
11
91
|
"author": "olfedias@microsoft.com",
|
12
92
|
"package": "@fluentui/react-button",
|
13
93
|
"commit": "f120fe9160ad7311a87af0cfacd8d2fb26275e34",
|
14
94
|
"comment": "chore: Update Griffel to latest version"
|
15
95
|
},
|
96
|
+
{
|
97
|
+
"author": "olfedias@microsoft.com",
|
98
|
+
"package": "@fluentui/react-button",
|
99
|
+
"commit": "60804cec07a495b8a5d1fc66338bf0443b212144",
|
100
|
+
"comment": "chore: Update Griffel to latest version"
|
101
|
+
},
|
16
102
|
{
|
17
103
|
"author": "humberto_makoto@hotmail.com",
|
18
104
|
"package": "@fluentui/react-button",
|
@@ -28,32 +114,32 @@
|
|
28
114
|
{
|
29
115
|
"author": "beachball",
|
30
116
|
"package": "@fluentui/react-button",
|
31
|
-
"comment": "Bump @fluentui/react-aria to
|
32
|
-
"commit": "
|
117
|
+
"comment": "Bump @fluentui/react-aria to v9.0.0-rc.9",
|
118
|
+
"commit": "8d58f08997acf595e3eb7f628123e7fa7830c394"
|
33
119
|
},
|
34
120
|
{
|
35
121
|
"author": "beachball",
|
36
122
|
"package": "@fluentui/react-button",
|
37
|
-
"comment": "Bump @fluentui/react-tabster to
|
38
|
-
"commit": "
|
123
|
+
"comment": "Bump @fluentui/react-tabster to v9.0.0-rc.10",
|
124
|
+
"commit": "8d58f08997acf595e3eb7f628123e7fa7830c394"
|
39
125
|
},
|
40
126
|
{
|
41
127
|
"author": "beachball",
|
42
128
|
"package": "@fluentui/react-button",
|
43
|
-
"comment": "Bump @fluentui/react-theme to
|
44
|
-
"commit": "
|
129
|
+
"comment": "Bump @fluentui/react-theme to v9.0.0-rc.8",
|
130
|
+
"commit": "8d58f08997acf595e3eb7f628123e7fa7830c394"
|
45
131
|
},
|
46
132
|
{
|
47
133
|
"author": "beachball",
|
48
134
|
"package": "@fluentui/react-button",
|
49
|
-
"comment": "Bump @fluentui/react-utilities to
|
50
|
-
"commit": "
|
135
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.0-rc.9",
|
136
|
+
"commit": "8d58f08997acf595e3eb7f628123e7fa7830c394"
|
51
137
|
},
|
52
138
|
{
|
53
139
|
"author": "beachball",
|
54
140
|
"package": "@fluentui/react-button",
|
55
|
-
"comment": "Bump @fluentui/react-conformance-griffel to
|
56
|
-
"commit": "
|
141
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.6",
|
142
|
+
"commit": "8d58f08997acf595e3eb7f628123e7fa7830c394"
|
57
143
|
}
|
58
144
|
]
|
59
145
|
}
|
package/CHANGELOG.md
CHANGED
@@ -1,24 +1,50 @@
|
|
1
1
|
# Change Log - @fluentui/react-button
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Wed, 25 May 2022 04:35:47 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-20220525-0423.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v0.0.0-nightly-20220525-0423.1)
|
8
8
|
|
9
|
-
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.0.0-rc.
|
9
|
+
Wed, 25 May 2022 04:35:47 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.0.0-rc.11..@fluentui/react-button_v0.0.0-nightly-20220525-0423.1)
|
11
11
|
|
12
12
|
### Changes
|
13
13
|
|
14
|
+
- ToggleButton: Differentiating hover and checked styles. ([PR #23209](https://github.com/microsoft/fluentui/pull/23209) by Humberto.Morimoto@microsoft.com)
|
15
|
+
- ToggleButton: Apply thicker border width to checked outline toggle buttons. ([PR #23207](https://github.com/microsoft/fluentui/pull/23207) by Humberto.Morimoto@microsoft.com)
|
16
|
+
|
17
|
+
## [9.0.0-rc.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.0.0-rc.11)
|
18
|
+
|
19
|
+
Mon, 23 May 2022 18:56:41 GMT
|
20
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.0.0-rc.10..@fluentui/react-button_v9.0.0-rc.11)
|
21
|
+
|
22
|
+
### Changes
|
23
|
+
|
24
|
+
- Removing <componentName>ClassName exports. ([PR #23092](https://github.com/microsoft/fluentui/pull/23092) by esteban.230@hotmail.com)
|
25
|
+
- Removing deprecated block prop from all button components. ([PR #23092](https://github.com/microsoft/fluentui/pull/23092) by Humberto.Morimoto@microsoft.com)
|
26
|
+
- Bump @fluentui/react-tabster to v9.0.0-rc.11 ([PR #23146](https://github.com/microsoft/fluentui/pull/23146) by beachball)
|
27
|
+
- Bump @fluentui/react-theme to v9.0.0-rc.9 ([PR #23146](https://github.com/microsoft/fluentui/pull/23146) by beachball)
|
28
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.7 ([PR #23146](https://github.com/microsoft/fluentui/pull/23146) by beachball)
|
29
|
+
|
30
|
+
## [9.0.0-rc.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.0.0-rc.10)
|
31
|
+
|
32
|
+
Mon, 23 May 2022 12:14:03 GMT
|
33
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.0.0-rc.9..@fluentui/react-button_v9.0.0-rc.10)
|
34
|
+
|
35
|
+
### Changes
|
36
|
+
|
37
|
+
- Using spacing tokens for button components. ([PR #23076](https://github.com/microsoft/fluentui/pull/23076) by Humberto.Morimoto@microsoft.com)
|
38
|
+
- Removing flex gap from button components and fixing spacing to better align with design spec. ([PR #23091](https://github.com/microsoft/fluentui/pull/23091) by Humberto.Morimoto@microsoft.com)
|
14
39
|
- chore: Update Griffel to latest version ([PR #22894](https://github.com/microsoft/fluentui/pull/22894) by olfedias@microsoft.com)
|
40
|
+
- chore: Update Griffel to latest version ([PR #23029](https://github.com/microsoft/fluentui/pull/23029) by olfedias@microsoft.com)
|
15
41
|
- Removing Common types from all button components. ([PR #22904](https://github.com/microsoft/fluentui/pull/22904) by humberto_makoto@hotmail.com)
|
16
42
|
- Removing ToggleButtonCommons type in @fluentui/react-button. ([PR #23067](https://github.com/microsoft/fluentui/pull/23067) by Humberto.Morimoto@microsoft.com)
|
17
|
-
- Bump @fluentui/react-aria to
|
18
|
-
- Bump @fluentui/react-tabster to
|
19
|
-
- Bump @fluentui/react-theme to
|
20
|
-
- Bump @fluentui/react-utilities to
|
21
|
-
- Bump @fluentui/react-conformance-griffel to
|
43
|
+
- Bump @fluentui/react-aria to v9.0.0-rc.9 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
|
44
|
+
- Bump @fluentui/react-tabster to v9.0.0-rc.10 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
|
45
|
+
- Bump @fluentui/react-theme to v9.0.0-rc.8 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
|
46
|
+
- Bump @fluentui/react-utilities to v9.0.0-rc.9 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
|
47
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.6 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
|
22
48
|
|
23
49
|
## [9.0.0-rc.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.0.0-rc.9)
|
24
50
|
|
package/README.md
CHANGED
@@ -2,35 +2,97 @@
|
|
2
2
|
|
3
3
|
**Button components for [Fluent UI React](https://developer.microsoft.com/en-us/fluentui)**
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
- Buttons enable users to trigger an action or event, such as submitting a form, opening a dialog, canceling an action, or performing a delete operation.
|
6
|
+
- CompoundButtons are buttons that can have secondary content that adds extra information to the user.
|
7
|
+
- MenuButtons are buttons that have a chevron icon after the button contents and are usually clicked to open/close menus.
|
8
|
+
- SplitButtons are a grouping of two interactive surfaces where interacting with the first one triggers a primary action, while interacting with the second one opens a menu with secondary actions.
|
9
|
+
- ToggleButtons are buttons that toggle between two defined states when triggered.
|
10
10
|
|
11
11
|
## Usage
|
12
12
|
|
13
13
|
To import Button:
|
14
14
|
|
15
15
|
```js
|
16
|
-
import { Button } from '@fluentui/react-
|
16
|
+
import { Button, CompoundButton, MenuButton, SplitButton, ToggleButton } from '@fluentui/react-components';
|
17
17
|
```
|
18
18
|
|
19
|
-
|
19
|
+
### Examples
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
### Button
|
22
|
+
|
23
|
+
```jsx
|
24
|
+
<Button>Submit</Button>
|
25
|
+
<Button icon={<SVGIcon />} />
|
26
|
+
<Button icon={<SVGIcon />}>Submit</Button>
|
27
|
+
<Button icon={<SVGIcon />} iconPosition="after">Submit</Button>
|
28
|
+
<Button appearance="primary">Submit</Button>
|
29
|
+
<Button disabled>Submit</Button>
|
30
|
+
<Button size="small">Submit</Button>
|
31
|
+
<Button size="large">Submit</Button>
|
23
32
|
```
|
24
33
|
|
25
|
-
###
|
34
|
+
### CompoundButton
|
26
35
|
|
27
36
|
```jsx
|
28
|
-
<
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
37
|
+
<CompoundButton icon={<CalendarMonth />} secondaryContent="Secondary content" {...props}>
|
38
|
+
Example
|
39
|
+
</CompoundButton>
|
40
|
+
```
|
41
|
+
|
42
|
+
### MenuButton
|
43
|
+
|
44
|
+
```jsx
|
45
|
+
<Menu>
|
46
|
+
<MenuTrigger>
|
47
|
+
<MenuButton>Example</MenuButton>
|
48
|
+
</MenuTrigger>
|
49
|
+
|
50
|
+
<MenuPopover>
|
51
|
+
<MenuList>
|
52
|
+
<MenuItem>Item a</MenuItem>
|
53
|
+
<MenuItem>Item b</MenuItem>
|
54
|
+
</MenuList>
|
55
|
+
</MenuPopover>
|
56
|
+
</Menu>
|
57
|
+
```
|
58
|
+
|
59
|
+
### SplitButton
|
60
|
+
|
61
|
+
```jsx
|
62
|
+
<Menu positioning="below-end">
|
63
|
+
<MenuTrigger>
|
64
|
+
{(triggerProps: MenuButtonProps) => <SplitButton menuButton={triggerProps}>Example</SplitButton>}
|
65
|
+
</MenuTrigger>
|
66
|
+
|
67
|
+
<MenuPopover>
|
68
|
+
<MenuList>
|
69
|
+
<MenuItem>Item a</MenuItem>
|
70
|
+
<MenuItem>Item b</MenuItem>
|
71
|
+
</MenuList>
|
72
|
+
</MenuPopover>
|
73
|
+
</Menu>
|
74
|
+
```
|
75
|
+
|
76
|
+
### ToggleButton
|
77
|
+
|
78
|
+
```jsx
|
79
|
+
<ToggleButton>Toggle volume</ToggleButton>
|
80
|
+
<ToggleButton defaultChecked={true}>Toggle volume</ToggleButton>
|
81
|
+
<ToggleButton checked={true}>Toggle volume</ToggleButton>
|
82
|
+
<ToggleButton checked={false}>Toggle volume</ToggleButton>
|
36
83
|
```
|
84
|
+
|
85
|
+
See [Fluent UI Storybook](https://aka.ms/fluentui-storybook) for more detailed usage examples.
|
86
|
+
|
87
|
+
Alternatively, run Storybook locally with:
|
88
|
+
|
89
|
+
1. `yarn start`
|
90
|
+
2. Select `react-button` from the list.
|
91
|
+
|
92
|
+
### Specification
|
93
|
+
|
94
|
+
See [SPEC.md](./src/components/Button/SPEC.md).
|
95
|
+
|
96
|
+
### Migration Guide
|
97
|
+
|
98
|
+
If you're upgrading to Fluent UI v9 see [MIGRATION.md](./src/components/Button/MIGRATION.md) for guidance on updating to the latest component implementations.
|
package/dist/index.d.ts
CHANGED
@@ -11,11 +11,6 @@ import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
11
11
|
*/
|
12
12
|
export declare const Button: ForwardRefComponent<ButtonProps>;
|
13
13
|
|
14
|
-
/**
|
15
|
-
* @deprecated Use `buttonClassNames.root` instead.
|
16
|
-
*/
|
17
|
-
export declare const buttonClassName: string;
|
18
|
-
|
19
14
|
export declare const buttonClassNames: SlotClassNames<ButtonSlots>;
|
20
15
|
|
21
16
|
export declare type ButtonProps = ComponentProps<ButtonSlots> & {
|
@@ -30,13 +25,6 @@ export declare type ButtonProps = ComponentProps<ButtonSlots> & {
|
|
30
25
|
* @default 'secondary'
|
31
26
|
*/
|
32
27
|
appearance?: 'secondary' | 'primary' | 'outline' | 'subtle' | 'transparent';
|
33
|
-
/**
|
34
|
-
* A button can fill the width of its container.
|
35
|
-
* @default false
|
36
|
-
*
|
37
|
-
* @deprecated - Use style overrides instead.
|
38
|
-
*/
|
39
|
-
block?: boolean;
|
40
28
|
/**
|
41
29
|
* When set, allows the button to be focusable even when it has been disabled. This is used in scenarios where it
|
42
30
|
* is important to keep a consistent tab order for screen reader and keyboard users. The primary example of this
|
@@ -82,7 +70,7 @@ export declare type ButtonSlots = {
|
|
82
70
|
icon?: Slot<'span'>;
|
83
71
|
};
|
84
72
|
|
85
|
-
export declare type ButtonState = ComponentState<ButtonSlots> & Required<Pick<ButtonProps, 'appearance' | '
|
73
|
+
export declare type ButtonState = ComponentState<ButtonSlots> & Required<Pick<ButtonProps, 'appearance' | 'disabledFocusable' | 'disabled' | 'iconPosition' | 'shape' | 'size'>> & {
|
86
74
|
/**
|
87
75
|
* A button can contain only an icon.
|
88
76
|
*
|
@@ -96,14 +84,9 @@ export declare type ButtonState = ComponentState<ButtonSlots> & Required<Pick<Bu
|
|
96
84
|
*/
|
97
85
|
export declare const CompoundButton: ForwardRefComponent<CompoundButtonProps>;
|
98
86
|
|
99
|
-
/**
|
100
|
-
* @deprecated Use `compoundButtonClassName.root` instead.
|
101
|
-
*/
|
102
|
-
export declare const compoundButtonClassName: string;
|
103
|
-
|
104
87
|
export declare const compoundButtonClassNames: SlotClassNames<CompoundButtonSlots>;
|
105
88
|
|
106
|
-
export declare type CompoundButtonProps = ComponentProps<Partial<CompoundButtonSlots>> & Pick<ButtonProps, 'appearance' | '
|
89
|
+
export declare type CompoundButtonProps = ComponentProps<Partial<CompoundButtonSlots>> & Pick<ButtonProps, 'appearance' | 'disabledFocusable' | 'disabled' | 'iconPosition' | 'shape' | 'size'>;
|
107
90
|
|
108
91
|
export declare type CompoundButtonSlots = ButtonSlots & {
|
109
92
|
/**
|
@@ -119,18 +102,14 @@ export declare type CompoundButtonSlots = ButtonSlots & {
|
|
119
102
|
export declare type CompoundButtonState = ComponentState<CompoundButtonSlots> & Omit<ButtonState, keyof ButtonSlots | 'components'>;
|
120
103
|
|
121
104
|
/**
|
122
|
-
* MenuButtons are buttons that
|
105
|
+
* MenuButtons are buttons that have a chevron icon after the button contents and are usually clicked to open/close
|
106
|
+
* menus.
|
123
107
|
*/
|
124
108
|
export declare const MenuButton: ForwardRefComponent<MenuButtonProps>;
|
125
109
|
|
126
|
-
/**
|
127
|
-
* @deprecated Use `menuButtonClassName.root` instead.
|
128
|
-
*/
|
129
|
-
export declare const menuButtonClassName: string;
|
130
|
-
|
131
110
|
export declare const menuButtonClassNames: SlotClassNames<MenuButtonSlots>;
|
132
111
|
|
133
|
-
export declare type MenuButtonProps = ComponentProps<MenuButtonSlots> & Pick<ButtonProps, 'appearance' | '
|
112
|
+
export declare type MenuButtonProps = ComponentProps<MenuButtonSlots> & Pick<ButtonProps, 'appearance' | 'disabledFocusable' | 'disabled' | 'shape' | 'size'>;
|
134
113
|
|
135
114
|
export declare type MenuButtonSlots = ButtonSlots & {
|
136
115
|
/**
|
@@ -164,16 +143,11 @@ export declare const renderMenuButton_unstable: (state: MenuButtonState) => JSX.
|
|
164
143
|
export declare const renderSplitButton_unstable: (state: SplitButtonState) => JSX.Element;
|
165
144
|
|
166
145
|
/**
|
167
|
-
* SplitButtons are a grouping of two interactive surfaces where
|
146
|
+
* SplitButtons are a grouping of two interactive surfaces where interacting with the first one triggers a primary
|
168
147
|
* action, while interacting with the second one opens a menu with secondary actions.
|
169
148
|
*/
|
170
149
|
export declare const SplitButton: ForwardRefComponent<SplitButtonProps>;
|
171
150
|
|
172
|
-
/**
|
173
|
-
* @deprecated Use `splitButtonClassName.root` instead.
|
174
|
-
*/
|
175
|
-
export declare const splitButtonClassName: string;
|
176
|
-
|
177
151
|
export declare const splitButtonClassNames: SlotClassNames<SplitButtonSlots>;
|
178
152
|
|
179
153
|
export declare type SplitButtonProps = ComponentProps<SplitButtonSlots> & Omit<ButtonProps, 'root'> & Omit<MenuButtonProps, 'root'>;
|
@@ -200,11 +174,6 @@ export declare type SplitButtonState = ComponentState<SplitButtonSlots> & Omit<B
|
|
200
174
|
*/
|
201
175
|
export declare const ToggleButton: ForwardRefComponent<ToggleButtonProps>;
|
202
176
|
|
203
|
-
/**
|
204
|
-
* @deprecated Use `toggleButtonClassName.root` instead.
|
205
|
-
*/
|
206
|
-
export declare const toggleButtonClassName: string;
|
207
|
-
|
208
177
|
export declare const toggleButtonClassNames: SlotClassNames<ButtonSlots>;
|
209
178
|
|
210
179
|
export declare type ToggleButtonProps = ButtonProps & {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Button.types.js","sourceRoot":"../src/","sources":["components/Button/Button.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type ButtonSlots = {\n /**\n * Root of the component that renders as either a `<button>` tag or an `<a>` tag.\n */\n root: NonNullable<Slot<ARIAButtonSlotProps>>;\n\n /**\n * Icon that renders either before or after the `children` as specified by the `iconPosition` prop.\n */\n icon?: Slot<'span'>;\n};\n\nexport type ButtonProps = ComponentProps<ButtonSlots> & {\n /**\n * A button can have its content and borders styled for greater emphasis or to be subtle.\n * - 'secondary' (default): Gives emphasis to the button in such a way that it indicates a secondary action.\n * - 'primary': Emphasizes the button as a primary action.\n * - 'outline': Removes background styling.\n * - 'subtle': Minimizes emphasis to blend into the background until hovered or focused.\n * - 'transparent': Removes background and border styling.\n *\n * @default 'secondary'\n */\n appearance?: 'secondary' | 'primary' | 'outline' | 'subtle' | 'transparent';\n\n /**\n *
|
1
|
+
{"version":3,"file":"Button.types.js","sourceRoot":"../src/","sources":["components/Button/Button.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type ButtonSlots = {\n /**\n * Root of the component that renders as either a `<button>` tag or an `<a>` tag.\n */\n root: NonNullable<Slot<ARIAButtonSlotProps>>;\n\n /**\n * Icon that renders either before or after the `children` as specified by the `iconPosition` prop.\n */\n icon?: Slot<'span'>;\n};\n\nexport type ButtonProps = ComponentProps<ButtonSlots> & {\n /**\n * A button can have its content and borders styled for greater emphasis or to be subtle.\n * - 'secondary' (default): Gives emphasis to the button in such a way that it indicates a secondary action.\n * - 'primary': Emphasizes the button as a primary action.\n * - 'outline': Removes background styling.\n * - 'subtle': Minimizes emphasis to blend into the background until hovered or focused.\n * - 'transparent': Removes background and border styling.\n *\n * @default 'secondary'\n */\n appearance?: 'secondary' | 'primary' | 'outline' | 'subtle' | 'transparent';\n\n /**\n * When set, allows the button to be focusable even when it has been disabled. This is used in scenarios where it\n * is important to keep a consistent tab order for screen reader and keyboard users. The primary example of this\n * pattern is when the disabled button is in a menu or a commandbar and is seldom used for standalone buttons.\n *\n * @default false\n */\n disabledFocusable?: boolean;\n\n /**\n * A button can show that it cannot be interacted with.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * A button can format its icon to appear before or after its content.\n *\n * @default 'before'\n */\n iconPosition?: 'before' | 'after';\n\n /**\n * A button can be rounded, circular, or square.\n *\n * @default 'rounded'\n */\n shape?: 'rounded' | 'circular' | 'square';\n\n /**\n * A button supports different sizes.\n *\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n};\n\nexport type ButtonState = ComponentState<ButtonSlots> &\n Required<Pick<ButtonProps, 'appearance' | 'disabledFocusable' | 'disabled' | 'iconPosition' | 'shape' | 'size'>> & {\n /**\n * A button can contain only an icon.\n *\n * @default false\n */\n iconOnly: boolean;\n };\n"]}
|
@@ -1,7 +1,5 @@
|
|
1
1
|
export * from './Button';
|
2
2
|
export * from './renderButton';
|
3
3
|
export * from './useButton';
|
4
|
-
export {
|
5
|
-
/* eslint-disable-next-line deprecation/deprecation */
|
6
|
-
buttonClassName, buttonClassNames, useButtonStyles_unstable } from './useButtonStyles';
|
4
|
+
export { buttonClassNames, useButtonStyles_unstable } from './useButtonStyles';
|
7
5
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Button/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Button/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AAGzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export * from './Button';\n// Explicit exports to omit ButtonCommons\nexport type { ButtonProps, ButtonSlots, ButtonState } from './Button.types';\nexport * from './renderButton';\nexport * from './useButton';\nexport { buttonClassNames, useButtonStyles_unstable } from './useButtonStyles';\n"]}
|
@@ -10,8 +10,6 @@ export const useButton_unstable = (props, ref) => {
|
|
10
10
|
const {
|
11
11
|
appearance = 'secondary',
|
12
12
|
as,
|
13
|
-
// eslint-disable-next-line deprecation/deprecation
|
14
|
-
block = false,
|
15
13
|
disabled = false,
|
16
14
|
disabledFocusable = false,
|
17
15
|
icon,
|
@@ -23,7 +21,6 @@ export const useButton_unstable = (props, ref) => {
|
|
23
21
|
return {
|
24
22
|
// Props passed at the top-level
|
25
23
|
appearance,
|
26
|
-
block,
|
27
24
|
disabled,
|
28
25
|
disabledFocusable,
|
29
26
|
iconPosition,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Button/useButton.ts"],"names":[],"mappings":"AACA,SAAS,aAAT,QAA8B,sBAA9B;AACA,SAAS,qBAAT,EAAgC,gBAAhC,QAAwD,2BAAxD;AAIA;;;;AAIG;;AACH,OAAO,MAAM,kBAAkB,GAAG,CAChC,KADgC,EAEhC,GAFgC,KAGjB;AACf,QAAM;AACJ,IAAA,UAAU,GAAG,WADT;AAEJ,IAAA,EAFI;AAGJ
|
1
|
+
{"version":3,"sources":["components/Button/useButton.ts"],"names":[],"mappings":"AACA,SAAS,aAAT,QAA8B,sBAA9B;AACA,SAAS,qBAAT,EAAgC,gBAAhC,QAAwD,2BAAxD;AAIA;;;;AAIG;;AACH,OAAO,MAAM,kBAAkB,GAAG,CAChC,KADgC,EAEhC,GAFgC,KAGjB;AACf,QAAM;AACJ,IAAA,UAAU,GAAG,WADT;AAEJ,IAAA,EAFI;AAGJ,IAAA,QAAQ,GAAG,KAHP;AAIJ,IAAA,iBAAiB,GAAG,KAJhB;AAKJ,IAAA,IALI;AAMJ,IAAA,YAAY,GAAG,QANX;AAOJ,IAAA,KAAK,GAAG,SAPJ;AAQJ,IAAA,IAAI,GAAG;AARH,MASF,KATJ;AAUA,QAAM,aAAa,GAAG,gBAAgB,CAAC,IAAD,CAAtC;AAEA,SAAO;AACL;AACA,IAAA,UAFK;AAGL,IAAA,QAHK;AAIL,IAAA,iBAJK;AAKL,IAAA,YALK;AAML,IAAA,KANK;AAOL,IAAA,IAPK;AASL;AACA,IAAA,QAAQ,EAAE,OAAO,CAAC,CAAA,aAAa,KAAA,IAAb,IAAA,aAAa,KAAA,KAAA,CAAb,GAAa,KAAA,CAAb,GAAA,aAAa,CAAE,QAAf,KAA2B,CAAC,KAAK,CAAC,QAAnC,CAVZ;AAYL;AACA,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,QADI;AAEV,MAAA,IAAI,EAAE;AAFI,KAbP;AAkBL,IAAA,IAAI,EAAE,qBAAqB,CACzB,EAAE,IAAI,QADmB,EAEzB,aAAa,CAAsB,KAAtB,EAA6B;AACxC,MAAA,QAAQ,EAAE,IAD8B;AAExC,MAAA,YAAY,EAAE;AACZ;AACA,QAAA,GAAG,EAAE,GAFO;AAGZ,QAAA,IAAI,EAAE,QAHM,CAGI;;AAHJ;AAF0B,KAA7B,CAFY,CAlBtB;AA6BL,IAAA,IAAI,EAAE;AA7BD,GAAP;AA+BD,CA/CM","sourcesContent":["import * as React from 'react';\nimport { useARIAButton } from '@fluentui/react-aria';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport type { ARIAButtonSlotProps } from '@fluentui/react-aria';\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,\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 || 'button',\n useARIAButton<ARIAButtonSlotProps>(props, {\n required: true,\n defaultProps: {\n // useARIAButton isn't working with React.Ref<HTMLButtonElement | HTMLAnchorElement>\n ref: ref as React.Ref<HTMLButtonElement>,\n type: 'button', // This is added because the default for type is 'submit'\n },\n }),\n ),\n icon: iconShorthand,\n };\n};\n"],"sourceRoot":"../src/"}
|