@fluentui/react-toolbar 9.0.0-beta.8 → 9.0.0-rc.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 +533 -4
- package/CHANGELOG.md +126 -5
- package/README.md +1 -1
- package/dist/index.d.ts +54 -45
- package/lib/Toolbar.js.map +1 -1
- package/lib/ToolbarButton.js.map +1 -1
- package/lib/ToolbarDivider.js.map +1 -1
- package/lib/ToolbarGroup.js +2 -0
- package/lib/ToolbarGroup.js.map +1 -0
- package/lib/ToolbarRadioButton.js +2 -0
- package/lib/ToolbarRadioButton.js.map +1 -0
- package/lib/ToolbarToggleButton.js.map +1 -1
- package/lib/components/Toolbar/Toolbar.js.map +1 -1
- package/lib/components/Toolbar/Toolbar.types.js.map +1 -1
- package/lib/components/Toolbar/ToolbarContext.js +7 -8
- package/lib/components/Toolbar/ToolbarContext.js.map +1 -1
- package/lib/components/Toolbar/index.js.map +1 -1
- package/lib/components/Toolbar/renderToolbar.js.map +1 -1
- package/lib/components/Toolbar/useToolbar.js +52 -12
- package/lib/components/Toolbar/useToolbar.js.map +1 -1
- package/lib/components/Toolbar/useToolbarContextValues.js +8 -2
- package/lib/components/Toolbar/useToolbarContextValues.js.map +1 -1
- package/lib/components/Toolbar/useToolbarStyles.js +24 -2
- package/lib/components/Toolbar/useToolbarStyles.js.map +1 -1
- package/lib/components/ToolbarButton/ToolbarButton.js +5 -11
- package/lib/components/ToolbarButton/ToolbarButton.js.map +1 -1
- package/lib/components/ToolbarButton/ToolbarButton.types.js.map +1 -1
- package/lib/components/ToolbarButton/index.js.map +1 -1
- package/lib/components/ToolbarButton/useToolbarButton.js +23 -0
- package/lib/components/ToolbarButton/useToolbarButton.js.map +1 -0
- package/lib/components/ToolbarButton/useToolbarButtonStyles.js +28 -0
- package/lib/components/ToolbarButton/useToolbarButtonStyles.js.map +1 -0
- package/lib/components/ToolbarDivider/ToolbarDivider.js +3 -5
- package/lib/components/ToolbarDivider/ToolbarDivider.js.map +1 -1
- package/lib/components/ToolbarDivider/ToolbarDivider.types.js.map +1 -1
- package/lib/components/ToolbarDivider/index.js +1 -0
- package/lib/components/ToolbarDivider/index.js.map +1 -1
- package/lib/components/ToolbarDivider/useToolbarDivider.js +20 -0
- package/lib/components/ToolbarDivider/useToolbarDivider.js.map +1 -0
- package/lib/components/ToolbarDivider/useToolbarDividerStyles.js +8 -2
- package/lib/components/ToolbarDivider/useToolbarDividerStyles.js.map +1 -1
- package/lib/components/ToolbarGroup/ToolbarGroup.js +16 -0
- package/lib/components/ToolbarGroup/ToolbarGroup.js.map +1 -0
- package/lib/components/ToolbarGroup/ToolbarGroup.types.js +2 -0
- package/lib/components/ToolbarGroup/ToolbarGroup.types.js.map +1 -0
- package/lib/components/ToolbarGroup/index.js +3 -0
- package/lib/components/ToolbarGroup/index.js.map +1 -0
- package/lib/components/ToolbarGroup/renderToolbarGroup.js +15 -0
- package/lib/components/ToolbarGroup/renderToolbarGroup.js.map +1 -0
- package/lib/components/ToolbarGroup/useToolbarGroup.js +20 -0
- package/lib/components/ToolbarGroup/useToolbarGroup.js.map +1 -0
- package/lib/components/ToolbarGroup/useToolbarGroupStyles.js +28 -0
- package/lib/components/ToolbarGroup/useToolbarGroupStyles.js.map +1 -0
- package/lib/components/ToolbarRadioButton/ToolbarRadioButton.js +15 -0
- package/lib/components/ToolbarRadioButton/ToolbarRadioButton.js.map +1 -0
- package/lib/components/ToolbarRadioButton/ToolbarRadioButton.types.js +2 -0
- package/lib/components/ToolbarRadioButton/ToolbarRadioButton.types.js.map +1 -0
- package/lib/components/ToolbarRadioButton/index.js +3 -0
- package/lib/components/ToolbarRadioButton/index.js.map +1 -0
- package/lib/components/ToolbarRadioButton/useToolbarRadioButton.js +38 -0
- package/lib/components/ToolbarRadioButton/useToolbarRadioButton.js.map +1 -0
- package/lib/components/ToolbarRadioButton/useToolbarRadioButtonStyles.js +22 -0
- package/lib/components/ToolbarRadioButton/useToolbarRadioButtonStyles.js.map +1 -0
- package/lib/components/ToolbarToggleButton/ToolbarToggleButton.js +3 -2
- package/lib/components/ToolbarToggleButton/ToolbarToggleButton.js.map +1 -1
- package/lib/components/ToolbarToggleButton/ToolbarToggleButton.types.js.map +1 -1
- package/lib/components/ToolbarToggleButton/index.js.map +1 -1
- package/lib/components/ToolbarToggleButton/useToolbarToggleButton.js +14 -6
- package/lib/components/ToolbarToggleButton/useToolbarToggleButton.js.map +1 -1
- package/lib/components/ToolbarToggleButton/useToolbarToggleButtonStyles.js +22 -0
- package/lib/components/ToolbarToggleButton/useToolbarToggleButtonStyles.js.map +1 -0
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Toolbar.js.map +1 -1
- package/lib-commonjs/ToolbarButton.js.map +1 -1
- package/lib-commonjs/ToolbarDivider.js.map +1 -1
- package/lib-commonjs/{ToolbarRadio.js → ToolbarGroup.js} +2 -2
- package/lib-commonjs/ToolbarGroup.js.map +1 -0
- package/lib-commonjs/{ToolbarRadioGroup.js → ToolbarRadioButton.js} +2 -2
- package/lib-commonjs/ToolbarRadioButton.js.map +1 -0
- package/lib-commonjs/ToolbarToggleButton.js.map +1 -1
- package/lib-commonjs/components/Toolbar/Toolbar.js.map +1 -1
- package/lib-commonjs/components/Toolbar/ToolbarContext.js +9 -10
- package/lib-commonjs/components/Toolbar/ToolbarContext.js.map +1 -1
- package/lib-commonjs/components/Toolbar/index.js.map +1 -1
- package/lib-commonjs/components/Toolbar/renderToolbar.js.map +1 -1
- package/lib-commonjs/components/Toolbar/useToolbar.js +52 -12
- package/lib-commonjs/components/Toolbar/useToolbar.js.map +1 -1
- package/lib-commonjs/components/Toolbar/useToolbarContextValues.js +8 -2
- package/lib-commonjs/components/Toolbar/useToolbarContextValues.js.map +1 -1
- package/lib-commonjs/components/Toolbar/useToolbarStyles.js +24 -2
- package/lib-commonjs/components/Toolbar/useToolbarStyles.js.map +1 -1
- package/lib-commonjs/components/ToolbarButton/ToolbarButton.js +5 -10
- package/lib-commonjs/components/ToolbarButton/ToolbarButton.js.map +1 -1
- package/lib-commonjs/components/ToolbarButton/index.js.map +1 -1
- package/lib-commonjs/components/ToolbarButton/useToolbarButton.js +33 -0
- package/lib-commonjs/components/ToolbarButton/useToolbarButton.js.map +1 -0
- package/lib-commonjs/components/ToolbarButton/useToolbarButtonStyles.js +38 -0
- package/lib-commonjs/components/ToolbarButton/useToolbarButtonStyles.js.map +1 -0
- package/lib-commonjs/components/ToolbarDivider/ToolbarDivider.js +3 -4
- package/lib-commonjs/components/ToolbarDivider/ToolbarDivider.js.map +1 -1
- package/lib-commonjs/components/ToolbarDivider/index.js +2 -0
- package/lib-commonjs/components/ToolbarDivider/index.js.map +1 -1
- package/lib-commonjs/components/ToolbarDivider/useToolbarDivider.js +31 -0
- package/lib-commonjs/components/ToolbarDivider/useToolbarDivider.js.map +1 -0
- package/lib-commonjs/components/ToolbarDivider/useToolbarDividerStyles.js +8 -2
- package/lib-commonjs/components/ToolbarDivider/useToolbarDividerStyles.js.map +1 -1
- package/lib-commonjs/components/ToolbarGroup/ToolbarGroup.js +27 -0
- package/lib-commonjs/components/ToolbarGroup/ToolbarGroup.js.map +1 -0
- package/lib-commonjs/components/{ToolbarRadio/ToolbarRadio.types.js → ToolbarGroup/ToolbarGroup.types.js} +1 -1
- package/lib-commonjs/components/{ToolbarRadio/ToolbarRadio.types.js.map → ToolbarGroup/ToolbarGroup.types.js.map} +0 -0
- package/lib-commonjs/components/ToolbarGroup/index.js +12 -0
- package/lib-commonjs/components/ToolbarGroup/index.js.map +1 -0
- package/lib-commonjs/components/ToolbarGroup/renderToolbarGroup.js +26 -0
- package/lib-commonjs/components/ToolbarGroup/renderToolbarGroup.js.map +1 -0
- package/lib-commonjs/components/ToolbarGroup/useToolbarGroup.js +30 -0
- package/lib-commonjs/components/ToolbarGroup/useToolbarGroup.js.map +1 -0
- package/lib-commonjs/components/ToolbarGroup/useToolbarGroupStyles.js +38 -0
- package/lib-commonjs/components/ToolbarGroup/useToolbarGroupStyles.js.map +1 -0
- package/lib-commonjs/components/ToolbarRadioButton/ToolbarRadioButton.js +26 -0
- package/lib-commonjs/components/ToolbarRadioButton/ToolbarRadioButton.js.map +1 -0
- package/lib-commonjs/components/{ToolbarRadioGroup/ToolbarRadioGroup.types.js → ToolbarRadioButton/ToolbarRadioButton.types.js} +1 -1
- package/lib-commonjs/components/{ToolbarRadioGroup/ToolbarRadioGroup.types.js.map → ToolbarRadioButton/ToolbarRadioButton.types.js.map} +0 -0
- package/lib-commonjs/components/ToolbarRadioButton/index.js +12 -0
- package/lib-commonjs/components/ToolbarRadioButton/index.js.map +1 -0
- package/lib-commonjs/components/ToolbarRadioButton/useToolbarRadioButton.js +50 -0
- package/lib-commonjs/components/ToolbarRadioButton/useToolbarRadioButton.js.map +1 -0
- package/lib-commonjs/components/ToolbarRadioButton/useToolbarRadioButtonStyles.js +33 -0
- package/lib-commonjs/components/ToolbarRadioButton/useToolbarRadioButtonStyles.js.map +1 -0
- package/lib-commonjs/components/ToolbarToggleButton/ToolbarToggleButton.js +3 -1
- package/lib-commonjs/components/ToolbarToggleButton/ToolbarToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToolbarToggleButton/index.js.map +1 -1
- package/lib-commonjs/components/ToolbarToggleButton/useToolbarToggleButton.js +13 -5
- package/lib-commonjs/components/ToolbarToggleButton/useToolbarToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToolbarToggleButton/useToolbarToggleButtonStyles.js +33 -0
- package/lib-commonjs/components/ToolbarToggleButton/useToolbarToggleButtonStyles.js.map +1 -0
- package/lib-commonjs/index.js +7 -7
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +27 -19
- package/Spec.md +0 -140
- package/lib/ToolbarRadio.js +0 -2
- package/lib/ToolbarRadio.js.map +0 -1
- package/lib/ToolbarRadioGroup.js +0 -2
- package/lib/ToolbarRadioGroup.js.map +0 -1
- package/lib/components/ToolbarRadio/ToolbarRadio.js +0 -21
- package/lib/components/ToolbarRadio/ToolbarRadio.js.map +0 -1
- package/lib/components/ToolbarRadio/ToolbarRadio.types.js +0 -2
- package/lib/components/ToolbarRadio/ToolbarRadio.types.js.map +0 -1
- package/lib/components/ToolbarRadio/index.js +0 -3
- package/lib/components/ToolbarRadio/index.js.map +0 -1
- package/lib/components/ToolbarRadio/useToolbarRadioStyles.js +0 -41
- package/lib/components/ToolbarRadio/useToolbarRadioStyles.js.map +0 -1
- package/lib/components/ToolbarRadioGroup/ToolbarRadioGroup.js +0 -20
- package/lib/components/ToolbarRadioGroup/ToolbarRadioGroup.js.map +0 -1
- package/lib/components/ToolbarRadioGroup/ToolbarRadioGroup.types.js +0 -2
- package/lib/components/ToolbarRadioGroup/ToolbarRadioGroup.types.js.map +0 -1
- package/lib/components/ToolbarRadioGroup/contexts/useRadioGroupContextValues.js +0 -22
- package/lib/components/ToolbarRadioGroup/contexts/useRadioGroupContextValues.js.map +0 -1
- package/lib/components/ToolbarRadioGroup/index.js +0 -3
- package/lib/components/ToolbarRadioGroup/index.js.map +0 -1
- package/lib/components/ToolbarRadioGroup/useToolbarRadioGroupStyles.js +0 -29
- package/lib/components/ToolbarRadioGroup/useToolbarRadioGroupStyles.js.map +0 -1
- package/lib-commonjs/ToolbarRadio.js.map +0 -1
- package/lib-commonjs/ToolbarRadioGroup.js.map +0 -1
- package/lib-commonjs/components/ToolbarRadio/ToolbarRadio.js +0 -32
- package/lib-commonjs/components/ToolbarRadio/ToolbarRadio.js.map +0 -1
- package/lib-commonjs/components/ToolbarRadio/index.js +0 -12
- package/lib-commonjs/components/ToolbarRadio/index.js.map +0 -1
- package/lib-commonjs/components/ToolbarRadio/useToolbarRadioStyles.js +0 -51
- package/lib-commonjs/components/ToolbarRadio/useToolbarRadioStyles.js.map +0 -1
- package/lib-commonjs/components/ToolbarRadioGroup/ToolbarRadioGroup.js +0 -31
- package/lib-commonjs/components/ToolbarRadioGroup/ToolbarRadioGroup.js.map +0 -1
- package/lib-commonjs/components/ToolbarRadioGroup/contexts/useRadioGroupContextValues.js +0 -31
- package/lib-commonjs/components/ToolbarRadioGroup/contexts/useRadioGroupContextValues.js.map +0 -1
- package/lib-commonjs/components/ToolbarRadioGroup/index.js +0 -12
- package/lib-commonjs/components/ToolbarRadioGroup/index.js.map +0 -1
- package/lib-commonjs/components/ToolbarRadioGroup/useToolbarRadioGroupStyles.js +0 -39
- package/lib-commonjs/components/ToolbarRadioGroup/useToolbarRadioGroupStyles.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,140 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-toolbar
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 20 Dec 2022 14:55:57 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.0-rc.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-toolbar_v9.0.0-rc.1)
|
|
8
|
+
|
|
9
|
+
Tue, 20 Dec 2022 14:55:57 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toolbar_v9.0.0-beta.15..@fluentui/react-toolbar_v9.0.0-rc.1)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- chore: Migrate to new package structure. ([PR #25920](https://github.com/microsoft/fluentui/pull/25920) by tristan.watanabe@gmail.com)
|
|
15
|
+
- Bump @fluentui/react-button to v9.1.11 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
|
|
16
|
+
- Bump @fluentui/react-divider to v9.1.7 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
|
|
17
|
+
- Bump @fluentui/react-theme to v9.1.4 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
|
|
18
|
+
- Bump @fluentui/react-utilities to v9.3.0 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
|
|
19
|
+
- Bump @fluentui/react-context-selector to v9.1.3 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
|
|
20
|
+
- Bump @fluentui/react-radio to v9.0.14 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
|
|
21
|
+
- Bump @fluentui/react-tabster to v9.3.3 ([PR #26047](https://github.com/microsoft/fluentui/pull/26047) by beachball)
|
|
22
|
+
|
|
23
|
+
## [9.0.0-beta.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-toolbar_v9.0.0-beta.15)
|
|
24
|
+
|
|
25
|
+
Mon, 05 Dec 2022 18:29:37 GMT
|
|
26
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toolbar_v9.0.0-beta.14..@fluentui/react-toolbar_v9.0.0-beta.15)
|
|
27
|
+
|
|
28
|
+
### Changes
|
|
29
|
+
|
|
30
|
+
- Bump @fluentui/react-button to v9.1.10 ([PR #25798](https://github.com/microsoft/fluentui/pull/25798) by beachball)
|
|
31
|
+
- Bump @fluentui/react-divider to v9.1.6 ([PR #25798](https://github.com/microsoft/fluentui/pull/25798) by beachball)
|
|
32
|
+
- Bump @fluentui/react-theme to v9.1.3 ([PR #25798](https://github.com/microsoft/fluentui/pull/25798) by beachball)
|
|
33
|
+
- Bump @fluentui/react-radio to v9.0.13 ([PR #25798](https://github.com/microsoft/fluentui/pull/25798) by beachball)
|
|
34
|
+
- Bump @fluentui/react-tabster to v9.3.2 ([PR #25798](https://github.com/microsoft/fluentui/pull/25798) by beachball)
|
|
35
|
+
|
|
36
|
+
## [9.0.0-beta.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-toolbar_v9.0.0-beta.14)
|
|
37
|
+
|
|
38
|
+
Thu, 17 Nov 2022 23:05:30 GMT
|
|
39
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toolbar_v9.0.0-beta.13..@fluentui/react-toolbar_v9.0.0-beta.14)
|
|
40
|
+
|
|
41
|
+
### Changes
|
|
42
|
+
|
|
43
|
+
- Bump @fluentui/react-button to v9.1.9 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
|
|
44
|
+
- Bump @fluentui/react-divider to v9.1.5 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
|
|
45
|
+
- Bump @fluentui/react-utilities to v9.2.2 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
|
|
46
|
+
- Bump @fluentui/react-context-selector to v9.1.2 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
|
|
47
|
+
- Bump @fluentui/react-radio to v9.0.12 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
|
|
48
|
+
- Bump @fluentui/react-tabster to v9.3.1 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
|
|
49
|
+
|
|
50
|
+
## [9.0.0-beta.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-toolbar_v9.0.0-beta.13)
|
|
51
|
+
|
|
52
|
+
Fri, 11 Nov 2022 14:57:47 GMT
|
|
53
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toolbar_v9.0.0-beta.12..@fluentui/react-toolbar_v9.0.0-beta.13)
|
|
54
|
+
|
|
55
|
+
### Changes
|
|
56
|
+
|
|
57
|
+
- fix: create valid export maps ([PR #25558](https://github.com/microsoft/fluentui/pull/25558) by martinhochel@microsoft.com)
|
|
58
|
+
- Bump @fluentui/react-button to v9.1.8 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
|
|
59
|
+
- Bump @fluentui/react-divider to v9.1.4 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
|
|
60
|
+
- Bump @fluentui/react-theme to v9.1.2 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
|
|
61
|
+
- Bump @fluentui/react-utilities to v9.2.1 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
|
|
62
|
+
- Bump @fluentui/react-context-selector to v9.1.1 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
|
|
63
|
+
- Bump @fluentui/react-radio to v9.0.11 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
|
|
64
|
+
- Bump @fluentui/react-tabster to v9.3.0 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
|
|
65
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.18 ([PR #25615](https://github.com/microsoft/fluentui/pull/25615) by beachball)
|
|
66
|
+
|
|
67
|
+
## [9.0.0-beta.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-toolbar_v9.0.0-beta.12)
|
|
68
|
+
|
|
69
|
+
Wed, 02 Nov 2022 11:58:05 GMT
|
|
70
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toolbar_v9.0.0-beta.11..@fluentui/react-toolbar_v9.0.0-beta.12)
|
|
71
|
+
|
|
72
|
+
### Changes
|
|
73
|
+
|
|
74
|
+
- chore: Update Griffel to latest version ([PR #25412](https://github.com/microsoft/fluentui/pull/25412) by olfedias@microsoft.com)
|
|
75
|
+
- chore: remove dependencies on Fluent UI v8 ([PR #25466](https://github.com/microsoft/fluentui/pull/25466) by olfedias@microsoft.com)
|
|
76
|
+
- Bump @fluentui/react-button to v9.1.7 ([PR #25456](https://github.com/microsoft/fluentui/pull/25456) by beachball)
|
|
77
|
+
- Bump @fluentui/react-divider to v9.1.3 ([PR #25456](https://github.com/microsoft/fluentui/pull/25456) by beachball)
|
|
78
|
+
- Bump @fluentui/react-utilities to v9.2.0 ([PR #25456](https://github.com/microsoft/fluentui/pull/25456) by beachball)
|
|
79
|
+
- Bump @fluentui/react-context-selector to v9.1.0 ([PR #25456](https://github.com/microsoft/fluentui/pull/25456) by beachball)
|
|
80
|
+
- Bump @fluentui/react-radio to v9.0.10 ([PR #25456](https://github.com/microsoft/fluentui/pull/25456) by beachball)
|
|
81
|
+
- Bump @fluentui/react-tabster to v9.2.1 ([PR #25456](https://github.com/microsoft/fluentui/pull/25456) by beachball)
|
|
82
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.17 ([PR #25456](https://github.com/microsoft/fluentui/pull/25456) by beachball)
|
|
83
|
+
|
|
84
|
+
## [9.0.0-beta.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-toolbar_v9.0.0-beta.11)
|
|
85
|
+
|
|
86
|
+
Tue, 25 Oct 2022 00:35:39 GMT
|
|
87
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toolbar_v9.0.0-beta.10..@fluentui/react-toolbar_v9.0.0-beta.11)
|
|
88
|
+
|
|
89
|
+
### Changes
|
|
90
|
+
|
|
91
|
+
- Bump @fluentui/react-button to v9.1.6 ([PR #25363](https://github.com/microsoft/fluentui/pull/25363) by beachball)
|
|
92
|
+
|
|
93
|
+
## [9.0.0-beta.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-toolbar_v9.0.0-beta.10)
|
|
94
|
+
|
|
95
|
+
Thu, 20 Oct 2022 08:39:54 GMT
|
|
96
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toolbar_v9.0.0-beta.9..@fluentui/react-toolbar_v9.0.0-beta.10)
|
|
97
|
+
|
|
98
|
+
### Changes
|
|
99
|
+
|
|
100
|
+
- chore: Update Griffel to latest version ([PR #25212](https://github.com/microsoft/fluentui/pull/25212) by olfedias@microsoft.com)
|
|
101
|
+
- chore: Bump peer deps to support React 18 ([PR #24972](https://github.com/microsoft/fluentui/pull/24972) by mgodbolt@microsoft.com)
|
|
102
|
+
- Bump @fluentui/react-button to v9.1.5 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
103
|
+
- Bump @fluentui/react-divider to v9.1.2 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
104
|
+
- Bump @fluentui/react-theme to v9.1.1 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
105
|
+
- Bump @fluentui/react-utilities to v9.1.2 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
106
|
+
- Bump @fluentui/react-context-selector to v9.0.5 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
107
|
+
- Bump @fluentui/react-radio to v9.0.9 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
108
|
+
- Bump @fluentui/react-tabster to v9.2.0 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
109
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.16 ([PR #25265](https://github.com/microsoft/fluentui/pull/25265) by beachball)
|
|
110
|
+
|
|
111
|
+
## [9.0.0-beta.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-toolbar_v9.0.0-beta.9)
|
|
112
|
+
|
|
113
|
+
Thu, 13 Oct 2022 11:03:03 GMT
|
|
114
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toolbar_v9.0.0-beta.8..@fluentui/react-toolbar_v9.0.0-beta.9)
|
|
115
|
+
|
|
116
|
+
### Changes
|
|
117
|
+
|
|
118
|
+
- fix: Toolbar selection should work ([PR #25153](https://github.com/microsoft/fluentui/pull/25153) by lingfangao@hotmail.com)
|
|
119
|
+
- chore: Update Griffel to latest version ([PR #25075](https://github.com/microsoft/fluentui/pull/25075) by olfedias@microsoft.com)
|
|
120
|
+
- Bump @fluentui/react-button to v9.1.4 ([PR #25181](https://github.com/microsoft/fluentui/pull/25181) by beachball)
|
|
121
|
+
- Bump @fluentui/react-divider to v9.1.1 ([PR #25181](https://github.com/microsoft/fluentui/pull/25181) by beachball)
|
|
122
|
+
- Bump @fluentui/react-utilities to v9.1.1 ([PR #25181](https://github.com/microsoft/fluentui/pull/25181) by beachball)
|
|
123
|
+
- Bump @fluentui/react-context-selector to v9.0.4 ([PR #25181](https://github.com/microsoft/fluentui/pull/25181) by beachball)
|
|
124
|
+
- Bump @fluentui/react-radio to v9.0.8 ([PR #25181](https://github.com/microsoft/fluentui/pull/25181) by beachball)
|
|
125
|
+
- Bump @fluentui/react-tabster to v9.1.3 ([PR #25181](https://github.com/microsoft/fluentui/pull/25181) by beachball)
|
|
126
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.15 ([PR #25181](https://github.com/microsoft/fluentui/pull/25181) by beachball)
|
|
127
|
+
|
|
7
128
|
## [9.0.0-beta.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-toolbar_v9.0.0-beta.8)
|
|
8
129
|
|
|
9
|
-
Mon, 03 Oct 2022 22:
|
|
130
|
+
Mon, 03 Oct 2022 22:24:42 GMT
|
|
10
131
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toolbar_v9.0.0-beta.7..@fluentui/react-toolbar_v9.0.0-beta.8)
|
|
11
132
|
|
|
12
133
|
### Changes
|
|
13
134
|
|
|
14
|
-
- Bump @fluentui/react-button to v9.1.3 ([PR #
|
|
15
|
-
- Bump @fluentui/react-radio to v9.0.7 ([PR #
|
|
16
|
-
- Bump @fluentui/react-tabster to v9.1.2 ([PR #
|
|
135
|
+
- Bump @fluentui/react-button to v9.1.3 ([PR #25055](https://github.com/microsoft/fluentui/pull/25055) by beachball)
|
|
136
|
+
- Bump @fluentui/react-radio to v9.0.7 ([PR #25055](https://github.com/microsoft/fluentui/pull/25055) by beachball)
|
|
137
|
+
- Bump @fluentui/react-tabster to v9.1.2 ([PR #25055](https://github.com/microsoft/fluentui/pull/25055) by beachball)
|
|
17
138
|
|
|
18
139
|
## [9.0.0-beta.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-toolbar_v9.0.0-beta.7)
|
|
19
140
|
|
package/README.md
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
## WIP
|
|
4
4
|
|
|
5
|
-
**React Toolbar components for [Fluent UI React](https://
|
|
5
|
+
**React Toolbar components for [Fluent UI React](https://react.fluentui.dev)**
|
|
6
6
|
|
|
7
7
|
These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.
|
package/dist/index.d.ts
CHANGED
|
@@ -8,28 +8,18 @@ import type { ComponentState } from '@fluentui/react-utilities';
|
|
|
8
8
|
import { DividerSlots } from '@fluentui/react-divider';
|
|
9
9
|
import { DividerState } from '@fluentui/react-divider';
|
|
10
10
|
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
|
11
|
-
import { RadioGroupProps } from '@fluentui/react-radio';
|
|
12
|
-
import { RadioGroupState } from '@fluentui/react-radio';
|
|
13
|
-
import { RadioProps } from '@fluentui/react-radio';
|
|
14
|
-
import { RadioState } from '@fluentui/react-radio';
|
|
15
11
|
import * as React_2 from 'react';
|
|
16
12
|
import type { Slot } from '@fluentui/react-utilities';
|
|
17
13
|
import { SlotClassNames } from '@fluentui/react-utilities';
|
|
18
14
|
import { ToggleButtonProps } from '@fluentui/react-button';
|
|
19
15
|
import { ToggleButtonState } from '@fluentui/react-button';
|
|
20
16
|
|
|
21
|
-
export declare type RadioGroupContextValue = Pick<RadioGroupProps, 'name' | 'value' | 'defaultValue' | 'disabled' | 'layout' | 'required'>;
|
|
22
|
-
|
|
23
|
-
export declare type RadioGroupContextValues = {
|
|
24
|
-
radioGroup: RadioGroupContextValue;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
17
|
/**
|
|
28
18
|
* Render the final JSX of Toolbar
|
|
29
19
|
*/
|
|
30
20
|
export declare const renderToolbar_unstable: (state: ToolbarState, contextValues: ToolbarContextValues) => JSX.Element;
|
|
31
21
|
|
|
32
|
-
declare type ToggableHandler = (e: React_2.MouseEvent | React_2.KeyboardEvent, name
|
|
22
|
+
declare type ToggableHandler = (e: React_2.MouseEvent | React_2.KeyboardEvent, name: string, value: string, checked?: boolean) => void;
|
|
33
23
|
|
|
34
24
|
/**
|
|
35
25
|
* Toolbar component
|
|
@@ -47,12 +37,14 @@ export declare const ToolbarButton: ForwardRefComponent<ToolbarButtonProps>;
|
|
|
47
37
|
*/
|
|
48
38
|
export declare type ToolbarButtonProps = ComponentProps<ButtonSlots> & Partial<Pick<ButtonProps, 'disabled' | 'disabledFocusable'>> & {
|
|
49
39
|
appearance?: 'primary' | 'subtle';
|
|
40
|
+
} & {
|
|
41
|
+
vertical?: boolean;
|
|
50
42
|
};
|
|
51
43
|
|
|
52
44
|
/**
|
|
53
45
|
* State used in rendering ToolbarButton
|
|
54
46
|
*/
|
|
55
|
-
export declare type ToolbarButtonState = ComponentState<Partial<ButtonSlots>> & ButtonState
|
|
47
|
+
export declare type ToolbarButtonState = ComponentState<Partial<ButtonSlots>> & ButtonState & Required<Pick<ToolbarButtonProps, 'vertical'>>;
|
|
56
48
|
|
|
57
49
|
declare type ToolbarCheckedValueChangeData = {
|
|
58
50
|
/** The items for this value that are checked */
|
|
@@ -65,8 +57,9 @@ declare type ToolbarCheckedValueChangeEvent = React_2.MouseEvent | React_2.Keybo
|
|
|
65
57
|
|
|
66
58
|
export declare const toolbarClassNames: SlotClassNames<ToolbarSlots>;
|
|
67
59
|
|
|
68
|
-
export declare type ToolbarContextValue = Pick<
|
|
60
|
+
export declare type ToolbarContextValue = Pick<ToolbarState, 'size' | 'vertical' | 'checkedValues'> & {
|
|
69
61
|
handleToggleButton?: ToggableHandler;
|
|
62
|
+
handleRadio?: ToggableHandler;
|
|
70
63
|
};
|
|
71
64
|
|
|
72
65
|
export declare type ToolbarContextValues = {
|
|
@@ -81,13 +74,40 @@ export declare const ToolbarDivider: ForwardRefComponent<ToolbarDividerProps>;
|
|
|
81
74
|
/**
|
|
82
75
|
* ToolbarDivider Props
|
|
83
76
|
*/
|
|
84
|
-
export declare type ToolbarDividerProps = ComponentProps<Partial<DividerSlots
|
|
77
|
+
export declare type ToolbarDividerProps = ComponentProps<Partial<DividerSlots>> & {
|
|
78
|
+
/**
|
|
79
|
+
* A divider can be horizontal or vertical (default).
|
|
80
|
+
*
|
|
81
|
+
* @default true
|
|
82
|
+
*/
|
|
83
|
+
vertical?: boolean;
|
|
84
|
+
};
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
87
|
* State used in rendering ToolbarDivider
|
|
88
88
|
*/
|
|
89
89
|
export declare type ToolbarDividerState = ComponentState<Partial<DividerSlots>> & DividerState;
|
|
90
90
|
|
|
91
|
+
/**
|
|
92
|
+
* ToolbarGroup component is a Button to be used inside Toolbar
|
|
93
|
+
* which will respect toolbar props such as `size`
|
|
94
|
+
*/
|
|
95
|
+
export declare const ToolbarGroup: ForwardRefComponent<ToolbarGroupProps>;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* ToolbarButton Props
|
|
99
|
+
*/
|
|
100
|
+
export declare type ToolbarGroupProps = ComponentProps<ToolbarGroupSlots>;
|
|
101
|
+
|
|
102
|
+
declare type ToolbarGroupSlots = {
|
|
103
|
+
root: Slot<'div'>;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* State used in rendering ToolbarButton
|
|
108
|
+
*/
|
|
109
|
+
export declare type ToolbarGroupState = ComponentState<ToolbarGroupSlots>;
|
|
110
|
+
|
|
91
111
|
/**
|
|
92
112
|
* Toolbar Props
|
|
93
113
|
*/
|
|
@@ -97,7 +117,12 @@ export declare type ToolbarProps = ComponentProps<ToolbarSlots> & {
|
|
|
97
117
|
*
|
|
98
118
|
* @default medium
|
|
99
119
|
*/
|
|
100
|
-
size?: 'small' | 'medium';
|
|
120
|
+
size?: 'small' | 'medium' | 'large';
|
|
121
|
+
/**
|
|
122
|
+
* Toolbar can be vertical styled
|
|
123
|
+
* @default false
|
|
124
|
+
*/
|
|
125
|
+
vertical?: boolean;
|
|
101
126
|
/**
|
|
102
127
|
* Map of all checked values
|
|
103
128
|
*/
|
|
@@ -116,39 +141,23 @@ export declare type ToolbarProps = ComponentProps<ToolbarSlots> & {
|
|
|
116
141
|
};
|
|
117
142
|
|
|
118
143
|
/**
|
|
119
|
-
*
|
|
144
|
+
* ToolbarRadioButton component
|
|
120
145
|
*/
|
|
121
|
-
export declare const
|
|
146
|
+
export declare const ToolbarRadioButton: ForwardRefComponent<ToolbarRadioButtonProps>;
|
|
122
147
|
|
|
123
148
|
/**
|
|
124
|
-
*
|
|
125
|
-
* which will keep always horizontal layout
|
|
149
|
+
* ToolbarRadioButton Props
|
|
126
150
|
*/
|
|
127
|
-
export declare
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
*/
|
|
132
|
-
export declare type ToolbarRadioGroupProps = RadioGroupProps;
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* State used in rendering ToolbarRadioGroup
|
|
136
|
-
*/
|
|
137
|
-
export declare type ToolbarRadioGroupState = RadioGroupState;
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* ToolbarRadio Props
|
|
141
|
-
*/
|
|
142
|
-
export declare type ToolbarRadioProps = RadioProps & {
|
|
143
|
-
size?: 'small' | 'medium';
|
|
151
|
+
export declare type ToolbarRadioButtonProps = ComponentProps<ButtonSlots> & Partial<Pick<ToggleButtonProps, 'disabled' | 'disabledFocusable' | 'size'>> & {
|
|
152
|
+
appearance?: 'primary' | 'subtle';
|
|
153
|
+
name: string;
|
|
154
|
+
value: string;
|
|
144
155
|
};
|
|
145
156
|
|
|
146
157
|
/**
|
|
147
|
-
* State used in rendering
|
|
158
|
+
* State used in rendering ToolbarRadioButton
|
|
148
159
|
*/
|
|
149
|
-
export declare type
|
|
150
|
-
size?: 'small' | 'medium';
|
|
151
|
-
};
|
|
160
|
+
export declare type ToolbarRadioButtonState = ComponentState<Partial<ButtonSlots>> & ToggleButtonState & Required<Pick<ToggleButtonProps, 'checked'>> & Pick<ToolbarRadioButtonProps, 'name' | 'value'>;
|
|
152
161
|
|
|
153
162
|
export declare type ToolbarSlots = {
|
|
154
163
|
root: Slot<'div'>;
|
|
@@ -157,8 +166,9 @@ export declare type ToolbarSlots = {
|
|
|
157
166
|
/**
|
|
158
167
|
* State used in rendering Toolbar
|
|
159
168
|
*/
|
|
160
|
-
export declare type ToolbarState = ComponentState<ToolbarSlots> & Required<Pick<ToolbarProps, 'size' | 'checkedValues'>> & Pick<ToolbarProps, 'defaultCheckedValues' | 'onCheckedValueChange'> & {
|
|
169
|
+
export declare type ToolbarState = ComponentState<ToolbarSlots> & Required<Pick<ToolbarProps, 'size' | 'checkedValues' | 'vertical'>> & Pick<ToolbarProps, 'defaultCheckedValues' | 'onCheckedValueChange'> & {
|
|
161
170
|
handleToggleButton: ToggableHandler;
|
|
171
|
+
handleRadio: ToggableHandler;
|
|
162
172
|
};
|
|
163
173
|
|
|
164
174
|
/**
|
|
@@ -171,15 +181,14 @@ export declare const ToolbarToggleButton: ForwardRefComponent<ToolbarToggleButto
|
|
|
171
181
|
*/
|
|
172
182
|
export declare type ToolbarToggleButtonProps = ComponentProps<ButtonSlots> & Partial<Pick<ToggleButtonProps, 'disabled' | 'disabledFocusable' | 'size'>> & {
|
|
173
183
|
appearance?: 'primary' | 'subtle';
|
|
184
|
+
name: string;
|
|
185
|
+
value: string;
|
|
174
186
|
};
|
|
175
187
|
|
|
176
188
|
/**
|
|
177
189
|
* State used in rendering ToolbarToggleButton
|
|
178
190
|
*/
|
|
179
|
-
export declare type ToolbarToggleButtonState = ComponentState<Partial<ButtonSlots>> & ToggleButtonState & Required<Pick<ToggleButtonProps, 'checked'>> &
|
|
180
|
-
name?: string;
|
|
181
|
-
value?: string;
|
|
182
|
-
};
|
|
191
|
+
export declare type ToolbarToggleButtonState = ComponentState<Partial<ButtonSlots>> & ToggleButtonState & Required<Pick<ToggleButtonProps, 'checked'>> & Pick<ToolbarToggleButtonProps, 'name' | 'value'>;
|
|
183
192
|
|
|
184
193
|
/**
|
|
185
194
|
* Create the state required to render Toolbar.
|
package/lib/Toolbar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.js","sourceRoot":"../src/","sources":["Toolbar.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC","sourcesContent":["export * from './components/Toolbar/index';\n"]}
|
|
1
|
+
{"version":3,"file":"Toolbar.js","sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/Toolbar.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC","sourcesContent":["export * from './components/Toolbar/index';\n"]}
|
package/lib/ToolbarButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarButton.js","sourceRoot":"../src/","sources":["ToolbarButton.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC","sourcesContent":["export * from './components/ToolbarButton/index';\n"]}
|
|
1
|
+
{"version":3,"file":"ToolbarButton.js","sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/ToolbarButton.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC","sourcesContent":["export * from './components/ToolbarButton/index';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarDivider.js","sourceRoot":"../src/","sources":["ToolbarDivider.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC","sourcesContent":["export * from './components/ToolbarDivider/index';\n"]}
|
|
1
|
+
{"version":3,"file":"ToolbarDivider.js","sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/ToolbarDivider.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC","sourcesContent":["export * from './components/ToolbarDivider/index';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolbarGroup.js","sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/ToolbarGroup.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC","sourcesContent":["export * from './components/ToolbarGroup/index';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolbarRadioButton.js","sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/ToolbarRadioButton.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC","sourcesContent":["export * from './components/ToolbarRadioButton/index';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarToggleButton.js","sourceRoot":"../src/","sources":["ToolbarToggleButton.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC","sourcesContent":["export * from './components/ToolbarToggleButton/index';\n"]}
|
|
1
|
+
{"version":3,"file":"ToolbarToggleButton.js","sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/ToolbarToggleButton.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC","sourcesContent":["export * from './components/ToolbarToggleButton/index';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Toolbar/Toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,mBAAT,QAAoC,cAApC;AACA,SAAS,sBAAT,QAAuC,iBAAvC;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AAGA,SAAS,gCAAT,QAAiD,2BAAjD;AAEA;;AAEG;;AACH,OAAO,MAAM,OAAO,gBAAsC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACxF,MAAM,KAAK,GAAG,mBAAmB,CAAC,KAAD,EAAQ,GAAR,CAAjC;EACA,MAAM,aAAa,GAAG,gCAAgC,CAAC,KAAD,CAAtD;EACA,yBAAyB,CAAC,KAAD,CAAzB;EACA,OAAO,sBAAsB,CAAC,KAAD,EAAQ,aAAR,CAA7B;AACD,CALyD,CAAnD;AAOP,OAAO,CAAC,WAAR,GAAsB,SAAtB","sourcesContent":["import * as React from 'react';\nimport { useToolbar_unstable } from './useToolbar';\nimport { renderToolbar_unstable } from './renderToolbar';\nimport { useToolbarStyles_unstable } from './useToolbarStyles';\nimport type { ToolbarProps } from './Toolbar.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useToolbarContextValues_unstable } from './useToolbarContextValues';\n\n/**\n * Toolbar component\n */\nexport const Toolbar: ForwardRefComponent<ToolbarProps> = React.forwardRef((props, ref) => {\n const state = useToolbar_unstable(props, ref);\n const contextValues = useToolbarContextValues_unstable(state);\n useToolbarStyles_unstable(state);\n return renderToolbar_unstable(state, contextValues);\n});\n\nToolbar.displayName = 'Toolbar';\n"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-toolbar/src/components/Toolbar/Toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,mBAAT,QAAoC,cAApC;AACA,SAAS,sBAAT,QAAuC,iBAAvC;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AAGA,SAAS,gCAAT,QAAiD,2BAAjD;AAEA;;AAEG;;AACH,OAAO,MAAM,OAAO,gBAAsC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACxF,MAAM,KAAK,GAAG,mBAAmB,CAAC,KAAD,EAAQ,GAAR,CAAjC;EACA,MAAM,aAAa,GAAG,gCAAgC,CAAC,KAAD,CAAtD;EACA,yBAAyB,CAAC,KAAD,CAAzB;EACA,OAAO,sBAAsB,CAAC,KAAD,EAAQ,aAAR,CAA7B;AACD,CALyD,CAAnD;AAOP,OAAO,CAAC,WAAR,GAAsB,SAAtB","sourcesContent":["import * as React from 'react';\nimport { useToolbar_unstable } from './useToolbar';\nimport { renderToolbar_unstable } from './renderToolbar';\nimport { useToolbarStyles_unstable } from './useToolbarStyles';\nimport type { ToolbarProps } from './Toolbar.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useToolbarContextValues_unstable } from './useToolbarContextValues';\n\n/**\n * Toolbar component\n */\nexport const Toolbar: ForwardRefComponent<ToolbarProps> = React.forwardRef((props, ref) => {\n const state = useToolbar_unstable(props, ref);\n const contextValues = useToolbarContextValues_unstable(state);\n useToolbarStyles_unstable(state);\n return renderToolbar_unstable(state, contextValues);\n});\n\nToolbar.displayName = 'Toolbar';\n"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.types.js","sourceRoot":"../src/","sources":["components/Toolbar/Toolbar.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type ToolbarSlots = {\n root: Slot<'div'>;\n};\n\nexport type ToolbarCheckedValueChangeData = {\n /** The items for this value that are checked */\n checkedItems: string[];\n /** The name of the value */\n name: string;\n};\n\nexport type ToolbarCheckedValueChangeEvent = React.MouseEvent | React.KeyboardEvent;\n\n/**\n * Toolbar Props\n */\nexport type ToolbarProps = ComponentProps<ToolbarSlots> & {\n /**\n * Toolbar can have small or medium size\n *\n * @default medium\n */\n size?: 'small' | 'medium';\n\n /**\n * Map of all checked values\n */\n checkedValues?: Record<string, string[]>;\n\n /**\n * Default values to be checked on mount\n */\n defaultCheckedValues?: Record<string, string[]>;\n\n /**\n * Callback when checked items change for value with a name\n *\n * @param event - React's original SyntheticEvent\n * @param data - A data object with relevant information\n */\n onCheckedValueChange?: (e: ToolbarCheckedValueChangeEvent, data: ToolbarCheckedValueChangeData) => void;\n};\n\n/**\n * State used in rendering Toolbar\n */\nexport type ToolbarState = ComponentState<ToolbarSlots> &\n Required<Pick<ToolbarProps, 'size' | 'checkedValues'>> &\n Pick<ToolbarProps, 'defaultCheckedValues' | 'onCheckedValueChange'> & {\n /*\n * Toggles the state of a ToggleButton item\n */\n handleToggleButton: ToggableHandler;\n };\n\nexport type ToolbarContextValue = Pick<
|
|
1
|
+
{"version":3,"file":"Toolbar.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/components/Toolbar/Toolbar.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type ToolbarSlots = {\n root: Slot<'div'>;\n};\n\nexport type ToolbarCheckedValueChangeData = {\n /** The items for this value that are checked */\n checkedItems: string[];\n /** The name of the value */\n name: string;\n};\n\nexport type ToolbarCheckedValueChangeEvent = React.MouseEvent | React.KeyboardEvent;\n\n/**\n * Toolbar Props\n */\nexport type ToolbarProps = ComponentProps<ToolbarSlots> & {\n /**\n * Toolbar can have small or medium size\n *\n * @default medium\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Toolbar can be vertical styled\n * @default false\n */\n vertical?: boolean;\n\n /**\n * Map of all checked values\n */\n checkedValues?: Record<string, string[]>;\n\n /**\n * Default values to be checked on mount\n */\n defaultCheckedValues?: Record<string, string[]>;\n\n /**\n * Callback when checked items change for value with a name\n *\n * @param event - React's original SyntheticEvent\n * @param data - A data object with relevant information\n */\n onCheckedValueChange?: (e: ToolbarCheckedValueChangeEvent, data: ToolbarCheckedValueChangeData) => void;\n};\n\n/**\n * State used in rendering Toolbar\n */\nexport type ToolbarState = ComponentState<ToolbarSlots> &\n Required<Pick<ToolbarProps, 'size' | 'checkedValues' | 'vertical'>> &\n Pick<ToolbarProps, 'defaultCheckedValues' | 'onCheckedValueChange'> & {\n /*\n * Toggles the state of a ToggleButton item\n */\n handleToggleButton: ToggableHandler;\n /*\n * Toggles the state of a ToggleButton item\n */\n handleRadio: ToggableHandler;\n };\n\nexport type ToolbarContextValue = Pick<ToolbarState, 'size' | 'vertical' | 'checkedValues'> & {\n handleToggleButton?: ToggableHandler;\n handleRadio?: ToggableHandler;\n};\n\nexport type ToolbarContextValues = {\n toolbar: ToolbarContextValue;\n};\n\nexport type UninitializedToolbarState = Omit<ToolbarState, 'checkedValues' | 'handleToggleButton' | 'handleRadio'> &\n Partial<Pick<ToolbarState, 'checkedValues'>>;\n\nexport type ToggableHandler = (\n e: React.MouseEvent | React.KeyboardEvent,\n name: string,\n value: string,\n checked?: boolean,\n) => void;\n"]}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
export const ToolbarContext = /*#__PURE__*/
|
|
1
|
+
import { createContext, useContextSelector } from '@fluentui/react-context-selector';
|
|
2
|
+
export const ToolbarContext = /*#__PURE__*/createContext(undefined);
|
|
3
3
|
const toolbarContextDefaultValue = {
|
|
4
4
|
size: 'medium',
|
|
5
|
-
handleToggleButton: () => null
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return (_a = React.useContext(ToolbarContext)) !== null && _a !== void 0 ? _a : toolbarContextDefaultValue;
|
|
5
|
+
handleToggleButton: () => null,
|
|
6
|
+
handleRadio: () => null,
|
|
7
|
+
vertical: false,
|
|
8
|
+
checkedValues: {}
|
|
11
9
|
};
|
|
10
|
+
export const useToolbarContext_unstable = selector => useContextSelector(ToolbarContext, (ctx = toolbarContextDefaultValue) => selector(ctx));
|
|
12
11
|
//# sourceMappingURL=ToolbarContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Toolbar/ToolbarContext.
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-toolbar/src/components/Toolbar/ToolbarContext.ts"],"names":[],"mappings":"AAAA,SAA0B,aAA1B,EAAyC,kBAAzC,QAAmE,kCAAnE;AAIA,OAAO,MAAM,cAAc,gBAAG,aAAa,CAAkC,SAAlC,CAApC;AAEP,MAAM,0BAA0B,GAAwB;EACtD,IAAI,EAAE,QADgD;EAEtD,kBAAkB,EAAE,MAAM,IAF4B;EAGtD,WAAW,EAAE,MAAM,IAHmC;EAItD,QAAQ,EAAE,KAJ4C;EAKtD,aAAa,EAAE;AALuC,CAAxD;AAQA,OAAO,MAAM,0BAA0B,GAAO,QAAJ,IACxC,kBAAkB,CAAC,cAAD,EAAiB,CAAC,GAAG,GAAG,0BAAP,KAAsC,QAAQ,CAAC,GAAD,CAA/D,CADb","sourcesContent":["import { ContextSelector, createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { Context } from '@fluentui/react-context-selector';\nimport type { ToolbarContextValue } from './Toolbar.types';\n\nexport const ToolbarContext = createContext<ToolbarContextValue | undefined>(undefined) as Context<ToolbarContextValue>;\n\nconst toolbarContextDefaultValue: ToolbarContextValue = {\n size: 'medium' as 'medium',\n handleToggleButton: () => null,\n handleRadio: () => null,\n vertical: false,\n checkedValues: {},\n};\n\nexport const useToolbarContext_unstable = <T>(selector: ContextSelector<ToolbarContextValue, T>): T =>\n useContextSelector(ToolbarContext, (ctx = toolbarContextDefaultValue) => selector(ctx));\n"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Toolbar/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC","sourcesContent":["export * from './Toolbar';\nexport * from './Toolbar.types';\nexport * from './renderToolbar';\nexport * from './useToolbar';\nexport * from './useToolbarStyles';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/components/Toolbar/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC","sourcesContent":["export * from './Toolbar';\nexport * from './Toolbar.types';\nexport * from './renderToolbar';\nexport * from './useToolbar';\nexport * from './useToolbarStyles';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Toolbar/renderToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAEA,SAAS,cAAT,QAA+B,kBAA/B;AAEA;;AAEG;;AACH,OAAO,MAAM,sBAAsB,GAAG,CAAC,KAAD,EAAsB,aAAtB,KAA6D;EACjG,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAe,KAAf,CAArC;EAEA,oBACE,KAAA,CAAA,aAAA,CAAC,cAAc,CAAC,QAAhB,EAAwB;IAAC,KAAK,EAAE,aAAa,CAAC;EAAtB,CAAxB,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,EAAiC,SAAS,CAAC,IAAV,CAAe,QAAhD,CADF,CADF;AAKD,CARM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { ToolbarState, ToolbarSlots, ToolbarContextValues } from './Toolbar.types';\nimport { ToolbarContext } from './ToolbarContext';\n\n/**\n * Render the final JSX of Toolbar\n */\nexport const renderToolbar_unstable = (state: ToolbarState, contextValues: ToolbarContextValues) => {\n const { slots, slotProps } = getSlots<ToolbarSlots>(state);\n\n return (\n <ToolbarContext.Provider value={contextValues.toolbar}>\n <slots.root {...slotProps.root}>{slotProps.root.children}</slots.root>\n </ToolbarContext.Provider>\n );\n};\n"],"sourceRoot":"../src/"}
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-toolbar/src/components/Toolbar/renderToolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAEA,SAAS,cAAT,QAA+B,kBAA/B;AAEA;;AAEG;;AACH,OAAO,MAAM,sBAAsB,GAAG,CAAC,KAAD,EAAsB,aAAtB,KAA6D;EACjG,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAe,KAAf,CAArC;EAEA,oBACE,KAAA,CAAA,aAAA,CAAC,cAAc,CAAC,QAAhB,EAAwB;IAAC,KAAK,EAAE,aAAa,CAAC;EAAtB,CAAxB,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,EAAiC,SAAS,CAAC,IAAV,CAAe,QAAhD,CADF,CADF;AAKD,CARM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { ToolbarState, ToolbarSlots, ToolbarContextValues } from './Toolbar.types';\nimport { ToolbarContext } from './ToolbarContext';\n\n/**\n * Render the final JSX of Toolbar\n */\nexport const renderToolbar_unstable = (state: ToolbarState, contextValues: ToolbarContextValues) => {\n const { slots, slotProps } = getSlots<ToolbarSlots>(state);\n\n return (\n <ToolbarContext.Provider value={contextValues.toolbar}>\n <slots.root {...slotProps.root}>{slotProps.root.children}</slots.root>\n </ToolbarContext.Provider>\n );\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -13,14 +13,16 @@ import { useArrowNavigationGroup } from '@fluentui/react-tabster';
|
|
|
13
13
|
|
|
14
14
|
export const useToolbar_unstable = (props, ref) => {
|
|
15
15
|
const {
|
|
16
|
-
size = 'medium'
|
|
16
|
+
size = 'medium',
|
|
17
|
+
vertical = false
|
|
17
18
|
} = props;
|
|
18
19
|
const arrowNavigationProps = useArrowNavigationGroup({
|
|
19
20
|
circular: true,
|
|
20
|
-
axis: '
|
|
21
|
+
axis: 'both'
|
|
21
22
|
});
|
|
22
23
|
const initialState = {
|
|
23
24
|
size,
|
|
25
|
+
vertical,
|
|
24
26
|
// TODO add appropriate props/defaults
|
|
25
27
|
components: {
|
|
26
28
|
// TODO add each slot's element type or component
|
|
@@ -35,14 +37,11 @@ export const useToolbar_unstable = (props, ref) => {
|
|
|
35
37
|
...props
|
|
36
38
|
})
|
|
37
39
|
};
|
|
38
|
-
const [checkedValues,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
const [checkedValues, onCheckedValueChange] = useToolbarSelectableState({
|
|
41
|
+
checkedValues: props.checkedValues,
|
|
42
|
+
defaultCheckedValues: props.defaultCheckedValues,
|
|
43
|
+
onCheckedValueChange: props.onCheckedValueChange
|
|
42
44
|
});
|
|
43
|
-
const {
|
|
44
|
-
onCheckedValueChange
|
|
45
|
-
} = initialState;
|
|
46
45
|
const handleToggleButton = useEventCallback((e, name, value, checked) => {
|
|
47
46
|
if (name && value) {
|
|
48
47
|
const checkedItems = (checkedValues === null || checkedValues === void 0 ? void 0 : checkedValues[name]) || [];
|
|
@@ -58,14 +57,55 @@ export const useToolbar_unstable = (props, ref) => {
|
|
|
58
57
|
name,
|
|
59
58
|
checkedItems: newCheckedItems
|
|
60
59
|
});
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
const handleRadio = useEventCallback((e, name, value, checked) => {
|
|
63
|
+
if (name && value) {
|
|
64
|
+
onCheckedValueChange === null || onCheckedValueChange === void 0 ? void 0 : onCheckedValueChange(e, {
|
|
65
|
+
name,
|
|
66
|
+
checkedItems: [value]
|
|
67
|
+
});
|
|
64
68
|
}
|
|
65
69
|
});
|
|
66
70
|
return { ...initialState,
|
|
67
71
|
handleToggleButton,
|
|
72
|
+
handleRadio,
|
|
68
73
|
checkedValues: checkedValues !== null && checkedValues !== void 0 ? checkedValues : {}
|
|
69
74
|
};
|
|
70
75
|
};
|
|
76
|
+
/**
|
|
77
|
+
* Adds appropriate state values and handlers for selectable items
|
|
78
|
+
* i.e checkboxes and radios
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
const useToolbarSelectableState = state => {
|
|
82
|
+
const [checkedValues, setCheckedValues] = useControllableState({
|
|
83
|
+
state: state.checkedValues,
|
|
84
|
+
defaultState: state.defaultCheckedValues,
|
|
85
|
+
initialState: {}
|
|
86
|
+
});
|
|
87
|
+
const {
|
|
88
|
+
onCheckedValueChange: onCheckedValueChangeOriginal
|
|
89
|
+
} = state;
|
|
90
|
+
const onCheckedValueChange = useEventCallback((e, {
|
|
91
|
+
name,
|
|
92
|
+
checkedItems
|
|
93
|
+
}) => {
|
|
94
|
+
if (onCheckedValueChangeOriginal) {
|
|
95
|
+
onCheckedValueChangeOriginal(e, {
|
|
96
|
+
name,
|
|
97
|
+
checkedItems
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
setCheckedValues(s => {
|
|
102
|
+
return s ? { ...s,
|
|
103
|
+
[name]: checkedItems
|
|
104
|
+
} : {
|
|
105
|
+
[name]: checkedItems
|
|
106
|
+
};
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
return [checkedValues, onCheckedValueChange];
|
|
110
|
+
};
|
|
71
111
|
//# sourceMappingURL=useToolbar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Toolbar/useToolbar.ts"],"names":[],"mappings":"AACA,SAAS,gBAAT,EAA2B,oBAA3B,QAAuD,2BAAvD;AACA,SAAS,qBAAT,QAAsC,2BAAtC;AAEA,SAAS,uBAAT,QAAwC,yBAAxC;AAEA;;;;;;;;AAQG;;AACH,OAAO,MAAM,mBAAmB,GAAG,CAAC,KAAD,EAAsB,GAAtB,KAAmE;EACpG,MAAM;IAAE,IAAI,GAAG;
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-toolbar/src/components/Toolbar/useToolbar.ts"],"names":[],"mappings":"AACA,SAAS,gBAAT,EAA2B,oBAA3B,QAAuD,2BAAvD;AACA,SAAS,qBAAT,QAAsC,2BAAtC;AAEA,SAAS,uBAAT,QAAwC,yBAAxC;AAEA;;;;;;;;AAQG;;AACH,OAAO,MAAM,mBAAmB,GAAG,CAAC,KAAD,EAAsB,GAAtB,KAAmE;EACpG,MAAM;IAAE,IAAI,GAAG,QAAT;IAAmB,QAAQ,GAAG;EAA9B,IAAwC,KAA9C;EAEA,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;IACnD,QAAQ,EAAE,IADyC;IAEnD,IAAI,EAAE;EAF6C,CAAD,CAApD;EAKA,MAAM,YAAY,GAA8B;IAC9C,IAD8C;IAE9C,QAF8C;IAG9C;IACA,UAAU,EAAE;MACV;MACA,IAAI,EAAE;IAFI,CAJkC;IAQ9C;IACA;IACA,IAAI,EAAE,qBAAqB,CAAC,KAAD,EAAQ;MACjC,IAAI,EAAE,SAD2B;MAEjC,GAFiC;MAGjC,GAAG,oBAH8B;MAIjC,GAAG;IAJ8B,CAAR;EAVmB,CAAhD;EAkBA,MAAM,CAAC,aAAD,EAAgB,oBAAhB,IAAwC,yBAAyB,CAAC;IACtE,aAAa,EAAE,KAAK,CAAC,aADiD;IAEtE,oBAAoB,EAAE,KAAK,CAAC,oBAF0C;IAGtE,oBAAoB,EAAE,KAAK,CAAC;EAH0C,CAAD,CAAvE;EAMA,MAAM,kBAAkB,GAAoB,gBAAgB,CAC1D,CAAC,CAAD,EAA4C,IAA5C,EAA0D,KAA1D,EAAyE,OAAzE,KAA8F;IAC5F,IAAI,IAAI,IAAI,KAAZ,EAAmB;MACjB,MAAM,YAAY,GAAG,CAAA,aAAa,KAAA,IAAb,IAAA,aAAa,KAAA,KAAA,CAAb,GAAa,KAAA,CAAb,GAAA,aAAa,CAAG,IAAH,CAAb,KAAyB,EAA9C;MACA,MAAM,eAAe,GAAG,CAAC,GAAG,YAAJ,CAAxB;;MACA,IAAI,OAAJ,EAAa;QACX,eAAe,CAAC,MAAhB,CAAuB,eAAe,CAAC,OAAhB,CAAwB,KAAxB,CAAvB,EAAuD,CAAvD;MACD,CAFD,MAEO;QACL,eAAe,CAAC,IAAhB,CAAqB,KAArB;MACD;;MACD,oBAAoB,KAAA,IAApB,IAAA,oBAAoB,KAAA,KAAA,CAApB,GAAoB,KAAA,CAApB,GAAA,oBAAoB,CAAG,CAAH,EAAM;QAAE,IAAF;QAAQ,YAAY,EAAE;MAAtB,CAAN,CAApB;IACD;EACF,CAZyD,CAA5D;EAeA,MAAM,WAAW,GAAoB,gBAAgB,CACnD,CAAC,CAAD,EAA4C,IAA5C,EAA0D,KAA1D,EAAyE,OAAzE,KAA8F;IAC5F,IAAI,IAAI,IAAI,KAAZ,EAAmB;MACjB,oBAAoB,KAAA,IAApB,IAAA,oBAAoB,KAAA,KAAA,CAApB,GAAoB,KAAA,CAApB,GAAA,oBAAoB,CAAG,CAAH,EAAM;QACxB,IADwB;QAExB,YAAY,EAAE,CAAC,KAAD;MAFU,CAAN,CAApB;IAID;EACF,CARkD,CAArD;EAWA,OAAO,EACL,GAAG,YADE;IAEL,kBAFK;IAGL,WAHK;IAIL,aAAa,EAAE,aAAa,KAAA,IAAb,IAAA,aAAa,KAAA,KAAA,CAAb,GAAA,aAAA,GAAiB;EAJ3B,CAAP;AAMD,CAhEM;AAkEP;;;AAGG;;AACH,MAAM,yBAAyB,GAC7B,KADgC,IAE9B;EACF,MAAM,CAAC,aAAD,EAAgB,gBAAhB,IAAoC,oBAAoB,CAAC;IAC7D,KAAK,EAAE,KAAK,CAAC,aADgD;IAE7D,YAAY,EAAE,KAAK,CAAC,oBAFyC;IAG7D,YAAY,EAAE;EAH+C,CAAD,CAA9D;EAKA,MAAM;IAAE,oBAAoB,EAAE;EAAxB,IAAyD,KAA/D;EACA,MAAM,oBAAoB,GAAyC,gBAAgB,CAAC,CAAC,CAAD,EAAI;IAAE,IAAF;IAAQ;EAAR,CAAJ,KAA8B;IAChH,IAAI,4BAAJ,EAAkC;MAChC,4BAA4B,CAAC,CAAD,EAAI;QAAE,IAAF;QAAQ;MAAR,CAAJ,CAA5B;IACD;;IAED,gBAAgB,CAAC,CAAC,IAAG;MACnB,OAAO,CAAC,GAAG,EAAE,GAAG,CAAL;QAAQ,CAAC,IAAD,GAAQ;MAAhB,CAAH,GAAoC;QAAE,CAAC,IAAD,GAAQ;MAAV,CAA5C;IACD,CAFe,CAAhB;EAGD,CARkF,CAAnF;EAUA,OAAO,CAAC,aAAD,EAAgB,oBAAhB,CAAP;AACD,CApBD","sourcesContent":["import * as React from 'react';\nimport { useEventCallback, useControllableState } from '@fluentui/react-utilities';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { ToggableHandler, ToolbarProps, ToolbarState, UninitializedToolbarState } from './Toolbar.types';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render Toolbar.\n *\n * The returned state can be modified with hooks such as useToolbarStyles_unstable,\n * before being passed to renderToolbar_unstable.\n *\n * @param props - props from this instance of Toolbar\n * @param ref - reference to root HTMLElement of Toolbar\n */\nexport const useToolbar_unstable = (props: ToolbarProps, ref: React.Ref<HTMLElement>): ToolbarState => {\n const { size = 'medium', vertical = false } = props;\n\n const arrowNavigationProps = useArrowNavigationGroup({\n circular: true,\n axis: 'both',\n });\n\n const initialState: UninitializedToolbarState = {\n size,\n vertical,\n // TODO add appropriate props/defaults\n components: {\n // TODO add each slot's element type or component\n root: 'div',\n },\n // TODO add appropriate slots, for example:\n // mySlot: resolveShorthand(props.mySlot),\n root: getNativeElementProps('div', {\n role: 'toolbar',\n ref,\n ...arrowNavigationProps,\n ...props,\n }),\n };\n\n const [checkedValues, onCheckedValueChange] = useToolbarSelectableState({\n checkedValues: props.checkedValues,\n defaultCheckedValues: props.defaultCheckedValues,\n onCheckedValueChange: props.onCheckedValueChange,\n });\n\n const handleToggleButton: ToggableHandler = useEventCallback(\n (e: React.MouseEvent | React.KeyboardEvent, name: string, value: string, checked?: boolean) => {\n if (name && value) {\n const checkedItems = checkedValues?.[name] || [];\n const newCheckedItems = [...checkedItems];\n if (checked) {\n newCheckedItems.splice(newCheckedItems.indexOf(value), 1);\n } else {\n newCheckedItems.push(value);\n }\n onCheckedValueChange?.(e, { name, checkedItems: newCheckedItems });\n }\n },\n );\n\n const handleRadio: ToggableHandler = useEventCallback(\n (e: React.MouseEvent | React.KeyboardEvent, name: string, value: string, checked?: boolean) => {\n if (name && value) {\n onCheckedValueChange?.(e, {\n name,\n checkedItems: [value],\n });\n }\n },\n );\n\n return {\n ...initialState,\n handleToggleButton,\n handleRadio,\n checkedValues: checkedValues ?? {},\n };\n};\n\n/**\n * Adds appropriate state values and handlers for selectable items\n * i.e checkboxes and radios\n */\nconst useToolbarSelectableState = (\n state: Pick<ToolbarProps, 'checkedValues' | 'defaultCheckedValues' | 'onCheckedValueChange'>,\n) => {\n const [checkedValues, setCheckedValues] = useControllableState({\n state: state.checkedValues,\n defaultState: state.defaultCheckedValues,\n initialState: {},\n });\n const { onCheckedValueChange: onCheckedValueChangeOriginal } = state;\n const onCheckedValueChange: ToolbarState['onCheckedValueChange'] = useEventCallback((e, { name, checkedItems }) => {\n if (onCheckedValueChangeOriginal) {\n onCheckedValueChangeOriginal(e, { name, checkedItems });\n }\n\n setCheckedValues(s => {\n return s ? { ...s, [name]: checkedItems } : { [name]: checkedItems };\n });\n });\n\n return [checkedValues, onCheckedValueChange] as const;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
export function useToolbarContextValues_unstable(state) {
|
|
2
2
|
const {
|
|
3
3
|
size,
|
|
4
|
-
handleToggleButton
|
|
4
|
+
handleToggleButton,
|
|
5
|
+
vertical,
|
|
6
|
+
checkedValues,
|
|
7
|
+
handleRadio
|
|
5
8
|
} = state; // This context is created with "@fluentui/react-context-selector", these is no sense to memoize it
|
|
6
9
|
|
|
7
10
|
const toolbar = {
|
|
8
11
|
size,
|
|
9
|
-
|
|
12
|
+
vertical,
|
|
13
|
+
handleToggleButton,
|
|
14
|
+
handleRadio,
|
|
15
|
+
checkedValues
|
|
10
16
|
};
|
|
11
17
|
return {
|
|
12
18
|
toolbar
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Toolbar/useToolbarContextValues.tsx"],"names":[],"mappings":"AAEA,OAAM,SAAU,gCAAV,CAA2C,KAA3C,EAA8D;EAClE,MAAM;IAAE,IAAF;IAAQ;
|
|
1
|
+
{"version":3,"sources":["packages/react-components/react-toolbar/src/components/Toolbar/useToolbarContextValues.tsx"],"names":[],"mappings":"AAEA,OAAM,SAAU,gCAAV,CAA2C,KAA3C,EAA8D;EAClE,MAAM;IAAE,IAAF;IAAQ,kBAAR;IAA4B,QAA5B;IAAsC,aAAtC;IAAqD;EAArD,IAAqE,KAA3E,CADkE,CAElE;;EACA,MAAM,OAAO,GAAwB;IACnC,IADmC;IAEnC,QAFmC;IAGnC,kBAHmC;IAInC,WAJmC;IAKnC;EALmC,CAArC;EAQA,OAAO;IAAE;EAAF,CAAP;AACD","sourcesContent":["import type { ToolbarContextValue, ToolbarContextValues, ToolbarState } from './Toolbar.types';\n\nexport function useToolbarContextValues_unstable(state: ToolbarState): ToolbarContextValues {\n const { size, handleToggleButton, vertical, checkedValues, handleRadio } = state;\n // This context is created with \"@fluentui/react-context-selector\", these is no sense to memoize it\n const toolbar: ToolbarContextValue = {\n size,\n vertical,\n handleToggleButton,\n handleRadio,\n checkedValues,\n };\n\n return { toolbar };\n}\n"],"sourceRoot":"../src/"}
|