@fluentui/react-toolbar 9.0.0-rc.2 → 9.0.0-rc.3

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.
Files changed (133) hide show
  1. package/CHANGELOG.json +78 -1
  2. package/CHANGELOG.md +19 -2
  3. package/dist/index.d.ts +69 -0
  4. package/lib/components/Toolbar/Toolbar.js +0 -1
  5. package/lib/components/Toolbar/Toolbar.js.map +1 -1
  6. package/lib/components/Toolbar/ToolbarContext.js.map +1 -1
  7. package/lib/components/Toolbar/renderToolbar.js +2 -2
  8. package/lib/components/Toolbar/renderToolbar.js.map +1 -1
  9. package/lib/components/Toolbar/useToolbar.js +4 -7
  10. package/lib/components/Toolbar/useToolbar.js.map +1 -1
  11. package/lib/components/Toolbar/useToolbarContextValues.js +2 -2
  12. package/lib/components/Toolbar/useToolbarContextValues.js.map +1 -1
  13. package/lib/components/Toolbar/useToolbarStyles.js +19 -22
  14. package/lib/components/Toolbar/useToolbarStyles.js.map +1 -1
  15. package/lib/components/ToolbarButton/ToolbarButton.js +3 -2
  16. package/lib/components/ToolbarButton/ToolbarButton.js.map +1 -1
  17. package/lib/components/ToolbarButton/index.js +2 -0
  18. package/lib/components/ToolbarButton/index.js.map +1 -1
  19. package/lib/components/ToolbarButton/useToolbarButton.js +0 -1
  20. package/lib/components/ToolbarButton/useToolbarButton.js.map +1 -1
  21. package/lib/components/ToolbarButton/useToolbarButtonStyles.js +5 -9
  22. package/lib/components/ToolbarButton/useToolbarButtonStyles.js.map +1 -1
  23. package/lib/components/ToolbarDivider/ToolbarDivider.js +0 -1
  24. package/lib/components/ToolbarDivider/ToolbarDivider.js.map +1 -1
  25. package/lib/components/ToolbarDivider/useToolbarDivider.js +0 -1
  26. package/lib/components/ToolbarDivider/useToolbarDivider.js.map +1 -1
  27. package/lib/components/ToolbarDivider/useToolbarDividerStyles.js +6 -9
  28. package/lib/components/ToolbarDivider/useToolbarDividerStyles.js.map +1 -1
  29. package/lib/components/ToolbarGroup/ToolbarGroup.js +3 -2
  30. package/lib/components/ToolbarGroup/ToolbarGroup.js.map +1 -1
  31. package/lib/components/ToolbarGroup/index.js +3 -0
  32. package/lib/components/ToolbarGroup/index.js.map +1 -1
  33. package/lib/components/ToolbarGroup/renderToolbarGroup.js +2 -2
  34. package/lib/components/ToolbarGroup/renderToolbarGroup.js.map +1 -1
  35. package/lib/components/ToolbarGroup/useToolbarGroup.js +0 -1
  36. package/lib/components/ToolbarGroup/useToolbarGroup.js.map +1 -1
  37. package/lib/components/ToolbarGroup/useToolbarGroupStyles.js +5 -8
  38. package/lib/components/ToolbarGroup/useToolbarGroupStyles.js.map +1 -1
  39. package/lib/components/ToolbarRadioButton/ToolbarRadioButton.js +0 -1
  40. package/lib/components/ToolbarRadioButton/ToolbarRadioButton.js.map +1 -1
  41. package/lib/components/ToolbarRadioButton/index.js +2 -0
  42. package/lib/components/ToolbarRadioButton/index.js.map +1 -1
  43. package/lib/components/ToolbarRadioButton/useToolbarRadioButton.js +2 -3
  44. package/lib/components/ToolbarRadioButton/useToolbarRadioButton.js.map +1 -1
  45. package/lib/components/ToolbarRadioButton/useToolbarRadioButtonStyles.js +3 -6
  46. package/lib/components/ToolbarRadioButton/useToolbarRadioButtonStyles.js.map +1 -1
  47. package/lib/components/ToolbarToggleButton/ToolbarToggleButton.js +0 -1
  48. package/lib/components/ToolbarToggleButton/ToolbarToggleButton.js.map +1 -1
  49. package/lib/components/ToolbarToggleButton/index.js +2 -0
  50. package/lib/components/ToolbarToggleButton/index.js.map +1 -1
  51. package/lib/components/ToolbarToggleButton/useToolbarToggleButton.js +2 -6
  52. package/lib/components/ToolbarToggleButton/useToolbarToggleButton.js.map +1 -1
  53. package/lib/components/ToolbarToggleButton/useToolbarToggleButtonStyles.js +3 -6
  54. package/lib/components/ToolbarToggleButton/useToolbarToggleButtonStyles.js.map +1 -1
  55. package/lib/index.js +4 -4
  56. package/lib/index.js.map +1 -1
  57. package/lib-commonjs/Toolbar.js +0 -2
  58. package/lib-commonjs/Toolbar.js.map +1 -1
  59. package/lib-commonjs/ToolbarButton.js +0 -2
  60. package/lib-commonjs/ToolbarButton.js.map +1 -1
  61. package/lib-commonjs/ToolbarDivider.js +0 -2
  62. package/lib-commonjs/ToolbarDivider.js.map +1 -1
  63. package/lib-commonjs/ToolbarGroup.js +0 -2
  64. package/lib-commonjs/ToolbarGroup.js.map +1 -1
  65. package/lib-commonjs/ToolbarRadioButton.js +0 -2
  66. package/lib-commonjs/ToolbarRadioButton.js.map +1 -1
  67. package/lib-commonjs/ToolbarToggleButton.js +0 -2
  68. package/lib-commonjs/ToolbarToggleButton.js.map +1 -1
  69. package/lib-commonjs/components/Toolbar/Toolbar.js +0 -7
  70. package/lib-commonjs/components/Toolbar/Toolbar.js.map +1 -1
  71. package/lib-commonjs/components/Toolbar/Toolbar.types.js.map +1 -1
  72. package/lib-commonjs/components/Toolbar/ToolbarContext.js +0 -4
  73. package/lib-commonjs/components/Toolbar/ToolbarContext.js.map +1 -1
  74. package/lib-commonjs/components/Toolbar/index.js +0 -6
  75. package/lib-commonjs/components/Toolbar/index.js.map +1 -1
  76. package/lib-commonjs/components/Toolbar/renderToolbar.js +2 -7
  77. package/lib-commonjs/components/Toolbar/renderToolbar.js.map +1 -1
  78. package/lib-commonjs/components/Toolbar/useToolbar.js +4 -12
  79. package/lib-commonjs/components/Toolbar/useToolbar.js.map +1 -1
  80. package/lib-commonjs/components/Toolbar/useToolbarContextValues.js +2 -4
  81. package/lib-commonjs/components/Toolbar/useToolbarContextValues.js.map +1 -1
  82. package/lib-commonjs/components/Toolbar/useToolbarStyles.js +19 -25
  83. package/lib-commonjs/components/Toolbar/useToolbarStyles.js.map +1 -1
  84. package/lib-commonjs/components/ToolbarButton/ToolbarButton.js +3 -7
  85. package/lib-commonjs/components/ToolbarButton/ToolbarButton.js.map +1 -1
  86. package/lib-commonjs/components/ToolbarButton/ToolbarButton.types.js.map +1 -1
  87. package/lib-commonjs/components/ToolbarButton/index.js +2 -3
  88. package/lib-commonjs/components/ToolbarButton/index.js.map +1 -1
  89. package/lib-commonjs/components/ToolbarButton/useToolbarButton.js +0 -4
  90. package/lib-commonjs/components/ToolbarButton/useToolbarButton.js.map +1 -1
  91. package/lib-commonjs/components/ToolbarButton/useToolbarButtonStyles.js +5 -12
  92. package/lib-commonjs/components/ToolbarButton/useToolbarButtonStyles.js.map +1 -1
  93. package/lib-commonjs/components/ToolbarDivider/ToolbarDivider.js +0 -6
  94. package/lib-commonjs/components/ToolbarDivider/ToolbarDivider.js.map +1 -1
  95. package/lib-commonjs/components/ToolbarDivider/ToolbarDivider.types.js.map +1 -1
  96. package/lib-commonjs/components/ToolbarDivider/index.js +0 -5
  97. package/lib-commonjs/components/ToolbarDivider/index.js.map +1 -1
  98. package/lib-commonjs/components/ToolbarDivider/useToolbarDivider.js +0 -5
  99. package/lib-commonjs/components/ToolbarDivider/useToolbarDivider.js.map +1 -1
  100. package/lib-commonjs/components/ToolbarDivider/useToolbarDividerStyles.js +6 -12
  101. package/lib-commonjs/components/ToolbarDivider/useToolbarDividerStyles.js.map +1 -1
  102. package/lib-commonjs/components/ToolbarGroup/ToolbarGroup.js +3 -7
  103. package/lib-commonjs/components/ToolbarGroup/ToolbarGroup.js.map +1 -1
  104. package/lib-commonjs/components/ToolbarGroup/ToolbarGroup.types.js.map +1 -1
  105. package/lib-commonjs/components/ToolbarGroup/index.js +3 -3
  106. package/lib-commonjs/components/ToolbarGroup/index.js.map +1 -1
  107. package/lib-commonjs/components/ToolbarGroup/renderToolbarGroup.js +2 -6
  108. package/lib-commonjs/components/ToolbarGroup/renderToolbarGroup.js.map +1 -1
  109. package/lib-commonjs/components/ToolbarGroup/useToolbarGroup.js +0 -4
  110. package/lib-commonjs/components/ToolbarGroup/useToolbarGroup.js.map +1 -1
  111. package/lib-commonjs/components/ToolbarGroup/useToolbarGroupStyles.js +5 -11
  112. package/lib-commonjs/components/ToolbarGroup/useToolbarGroupStyles.js.map +1 -1
  113. package/lib-commonjs/components/ToolbarRadioButton/ToolbarRadioButton.js +0 -6
  114. package/lib-commonjs/components/ToolbarRadioButton/ToolbarRadioButton.js.map +1 -1
  115. package/lib-commonjs/components/ToolbarRadioButton/ToolbarRadioButton.types.js.map +1 -1
  116. package/lib-commonjs/components/ToolbarRadioButton/index.js +2 -3
  117. package/lib-commonjs/components/ToolbarRadioButton/index.js.map +1 -1
  118. package/lib-commonjs/components/ToolbarRadioButton/useToolbarRadioButton.js +2 -8
  119. package/lib-commonjs/components/ToolbarRadioButton/useToolbarRadioButton.js.map +1 -1
  120. package/lib-commonjs/components/ToolbarRadioButton/useToolbarRadioButtonStyles.js +3 -10
  121. package/lib-commonjs/components/ToolbarRadioButton/useToolbarRadioButtonStyles.js.map +1 -1
  122. package/lib-commonjs/components/ToolbarToggleButton/ToolbarToggleButton.js +0 -6
  123. package/lib-commonjs/components/ToolbarToggleButton/ToolbarToggleButton.js.map +1 -1
  124. package/lib-commonjs/components/ToolbarToggleButton/ToolbarToggleButton.types.js.map +1 -1
  125. package/lib-commonjs/components/ToolbarToggleButton/index.js +2 -3
  126. package/lib-commonjs/components/ToolbarToggleButton/index.js.map +1 -1
  127. package/lib-commonjs/components/ToolbarToggleButton/useToolbarToggleButton.js +2 -10
  128. package/lib-commonjs/components/ToolbarToggleButton/useToolbarToggleButton.js.map +1 -1
  129. package/lib-commonjs/components/ToolbarToggleButton/useToolbarToggleButtonStyles.js +3 -10
  130. package/lib-commonjs/components/ToolbarToggleButton/useToolbarToggleButtonStyles.js.map +1 -1
  131. package/lib-commonjs/index.js +55 -13
  132. package/lib-commonjs/index.js.map +1 -1
  133. package/package.json +10 -10
package/CHANGELOG.json CHANGED
@@ -2,7 +2,84 @@
2
2
  "name": "@fluentui/react-toolbar",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 21 Dec 2022 10:17:16 GMT",
5
+ "date": "Wed, 04 Jan 2023 01:36:01 GMT",
6
+ "tag": "@fluentui/react-toolbar_v9.0.0-rc.3",
7
+ "version": "9.0.0-rc.3",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "olfedias@microsoft.com",
12
+ "package": "@fluentui/react-toolbar",
13
+ "commit": "2c38f1e4ae07b2b60df596efe11015a68f166dbf",
14
+ "comment": "chore: Update Griffel to latest version"
15
+ },
16
+ {
17
+ "author": "lingfangao@hotmail.com",
18
+ "package": "@fluentui/react-toolbar",
19
+ "commit": "5bdf0b017a95c95f7d6fea8efe448b74940e2022",
20
+ "comment": "fix: Export all relevant Toolbar components and utilities"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-toolbar",
25
+ "comment": "Bump @fluentui/react-button to v9.1.13",
26
+ "commit": "3e322d15529451be153e97298873253e21af4082"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-toolbar",
31
+ "comment": "Bump @fluentui/react-divider to v9.1.9",
32
+ "commit": "3e322d15529451be153e97298873253e21af4082"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-toolbar",
37
+ "comment": "Bump @fluentui/react-utilities to v9.3.1",
38
+ "commit": "3e322d15529451be153e97298873253e21af4082"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui/react-toolbar",
43
+ "comment": "Bump @fluentui/react-context-selector to v9.1.4",
44
+ "commit": "3e322d15529451be153e97298873253e21af4082"
45
+ },
46
+ {
47
+ "author": "beachball",
48
+ "package": "@fluentui/react-toolbar",
49
+ "comment": "Bump @fluentui/react-radio to v9.0.16",
50
+ "commit": "3e322d15529451be153e97298873253e21af4082"
51
+ },
52
+ {
53
+ "author": "beachball",
54
+ "package": "@fluentui/react-toolbar",
55
+ "comment": "Bump @fluentui/react-tabster to v9.3.5",
56
+ "commit": "3e322d15529451be153e97298873253e21af4082"
57
+ },
58
+ {
59
+ "author": "beachball",
60
+ "package": "@fluentui/react-toolbar",
61
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.19",
62
+ "commit": "3e322d15529451be153e97298873253e21af4082"
63
+ }
64
+ ],
65
+ "none": [
66
+ {
67
+ "author": "martinhochel@microsoft.com",
68
+ "package": "@fluentui/react-toolbar",
69
+ "commit": "194b0cf0cc27c1c1233aa945f09b3ad29778d8ca",
70
+ "comment": "chore(scripts): use for @fluentui/scripts version within all package.json"
71
+ },
72
+ {
73
+ "author": "martinhochel@microsoft.com",
74
+ "package": "@fluentui/react-toolbar",
75
+ "commit": "4ec2b998b294d6d9c3196d3d82893bdd97d0c105",
76
+ "comment": "chore(scripts): move index.ts to to follow sub-folder domain packaging"
77
+ }
78
+ ]
79
+ }
80
+ },
81
+ {
82
+ "date": "Wed, 21 Dec 2022 10:20:33 GMT",
6
83
  "tag": "@fluentui/react-toolbar_v9.0.0-rc.2",
7
84
  "version": "9.0.0-rc.2",
8
85
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,29 @@
1
1
  # Change Log - @fluentui/react-toolbar
2
2
 
3
- This log was last generated on Wed, 21 Dec 2022 10:17:16 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 04 Jan 2023 01:36:01 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.0.0-rc.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-toolbar_v9.0.0-rc.3)
8
+
9
+ Wed, 04 Jan 2023 01:36:01 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toolbar_v9.0.0-rc.2..@fluentui/react-toolbar_v9.0.0-rc.3)
11
+
12
+ ### Changes
13
+
14
+ - chore: Update Griffel to latest version ([PR #26045](https://github.com/microsoft/fluentui/pull/26045) by olfedias@microsoft.com)
15
+ - fix: Export all relevant Toolbar components and utilities ([PR #26065](https://github.com/microsoft/fluentui/pull/26065) by lingfangao@hotmail.com)
16
+ - Bump @fluentui/react-button to v9.1.13 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
17
+ - Bump @fluentui/react-divider to v9.1.9 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
18
+ - Bump @fluentui/react-utilities to v9.3.1 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
19
+ - Bump @fluentui/react-context-selector to v9.1.4 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
20
+ - Bump @fluentui/react-radio to v9.0.16 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
21
+ - Bump @fluentui/react-tabster to v9.3.5 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
22
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.19 ([PR #26114](https://github.com/microsoft/fluentui/pull/26114) by beachball)
23
+
7
24
  ## [9.0.0-rc.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-toolbar_v9.0.0-rc.2)
8
25
 
9
- Wed, 21 Dec 2022 10:17:16 GMT
26
+ Wed, 21 Dec 2022 10:20:33 GMT
10
27
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toolbar_v9.0.0-rc.1..@fluentui/react-toolbar_v9.0.0-rc.2)
11
28
 
12
29
  ### Changes
package/dist/index.d.ts CHANGED
@@ -19,6 +19,11 @@ import { ToggleButtonState } from '@fluentui/react-button';
19
19
  */
20
20
  export declare const renderToolbar_unstable: (state: ToolbarState, contextValues: ToolbarContextValues) => JSX.Element;
21
21
 
22
+ /**
23
+ * Render the final JSX of ToolbarGroup
24
+ */
25
+ export declare const renderToolbarGroup_unstable: (state: ToolbarGroupState) => JSX.Element;
26
+
22
27
  declare type ToggableHandler = (e: React_2.MouseEvent | React_2.KeyboardEvent, name: string, value: string, checked?: boolean) => void;
23
28
 
24
29
  /**
@@ -94,6 +99,8 @@ export declare type ToolbarDividerState = ComponentState<Partial<DividerSlots>>
94
99
  */
95
100
  export declare const ToolbarGroup: ForwardRefComponent<ToolbarGroupProps>;
96
101
 
102
+ export declare const toolbarGroupClassNames: SlotClassNames<ToolbarGroupSlots>;
103
+
97
104
  /**
98
105
  * ToolbarButton Props
99
106
  */
@@ -201,14 +208,76 @@ export declare type ToolbarToggleButtonState = ComponentState<Partial<ButtonSlot
201
208
  */
202
209
  export declare const useToolbar_unstable: (props: ToolbarProps, ref: React_2.Ref<HTMLElement>) => ToolbarState;
203
210
 
211
+ /**
212
+ * Given user props, defines default props for the Button, calls useButtonState and useChecked, and returns
213
+ * processed state.
214
+ * @param props - User provided props to the Button component.
215
+ * @param ref - User provided ref to be passed to the Button component.
216
+ */
217
+ export declare const useToolbarButton_unstable: (props: ToolbarButtonProps, ref: React_2.Ref<HTMLButtonElement | HTMLAnchorElement>) => ToolbarButtonState;
218
+
219
+ /**
220
+ * Apply styling to the ToolbarButton slots based on the state
221
+ */
222
+ export declare const useToolbarButtonStyles_unstable: (state: ToolbarButtonState) => void;
223
+
224
+ /**
225
+ * Create the state required to render ToolbarDivider.
226
+ *
227
+ * The returned state can be modified with hooks such as useToolbarDividerStyles_unstable,
228
+ * before being passed to renderToolbar_unstable.
229
+ *
230
+ * @param props - props from this instance of ToolbarDivider
231
+ * @param ref - reference to root HTMLElement of ToolbarDivider
232
+ */
233
+ export declare const useToolbarDivider_unstable: (props: ToolbarDividerProps, ref: React_2.Ref<HTMLElement>) => ToolbarDividerState;
234
+
204
235
  /**
205
236
  * Apply styling to the ToolbarDivider slots based on the state
206
237
  */
207
238
  export declare const useToolbarDividerStyles_unstable: (state: ToolbarDividerState) => ToolbarDividerState;
208
239
 
240
+ /**
241
+ * Given user props, defines default props for the Group
242
+ * @param props - User provided props to the Group component.
243
+ * @param ref - User provided ref to be passed to the Group component.
244
+ */
245
+ export declare const useToolbarGroup_unstable: (props: ToolbarGroupProps, ref: React_2.Ref<HTMLDivElement>) => ToolbarGroupState;
246
+
247
+ /**
248
+ * Apply styling to the Toolbar slots based on the state
249
+ */
250
+ export declare const useToolbarGroupStyles_unstable: (state: ToolbarGroupState) => ToolbarGroupState;
251
+
252
+ /**
253
+ * Given user props, defines default props for the RadioButton, calls useButtonState and useChecked, and returns
254
+ * processed state.
255
+ * @param props - User provided props to the RadioButton component.
256
+ * @param ref - User provided ref to be passed to the RadioButton component.
257
+ */
258
+ export declare const useToolbarRadioButton_unstable: (props: ToolbarRadioButtonProps, ref: React_2.Ref<HTMLButtonElement | HTMLAnchorElement>) => ToolbarRadioButtonState;
259
+
260
+ /**
261
+ * Apply styling to the ToolbarRadioButton slots based on the state
262
+ */
263
+ export declare const useToolbarRadioButtonStyles_unstable: (state: ToolbarRadioButtonState) => void;
264
+
209
265
  /**
210
266
  * Apply styling to the Toolbar slots based on the state
211
267
  */
212
268
  export declare const useToolbarStyles_unstable: (state: ToolbarState) => ToolbarState;
213
269
 
270
+ /**
271
+ * Given user props, defines default props for the ToggleButton, calls useButtonState and useChecked, and returns
272
+ * processed state.
273
+ * @param props - User provided props to the ToggleButton component.
274
+ * @param ref - User provided ref to be passed to the ToggleButton component.
275
+ */
276
+ export declare const useToolbarToggleButton_unstable: (props: ToolbarToggleButtonProps, ref: React_2.Ref<HTMLButtonElement | HTMLAnchorElement>) => ToolbarToggleButtonState;
277
+
278
+ /**
279
+ * Apply styling to the ToolbarToggleButton slots based on the state
280
+ */
281
+ export declare const useToolbarToggleButtonStyles_unstable: (state: ToolbarToggleButtonState) => void;
282
+
214
283
  export { }
@@ -6,7 +6,6 @@ import { useToolbarContextValues_unstable } from './useToolbarContextValues';
6
6
  /**
7
7
  * Toolbar component
8
8
  */
9
-
10
9
  export const Toolbar = /*#__PURE__*/React.forwardRef((props, ref) => {
11
10
  const state = useToolbar_unstable(props, ref);
12
11
  const contextValues = useToolbarContextValues_unstable(state);
@@ -1 +1 @@
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
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,mBAAmB,QAAQ,cAAc;AAClD,SAASC,sBAAsB,QAAQ,iBAAiB;AACxD,SAASC,yBAAyB,QAAQ,oBAAoB;AAG9D,SAASC,gCAAgC,QAAQ,2BAA2B;AAE5E;;;AAGA,OAAO,MAAMC,OAAO,gBAAsCL,KAAK,CAACM,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACxF,MAAMC,KAAK,GAAGR,mBAAmB,CAACM,KAAK,EAAEC,GAAG,CAAC;EAC7C,MAAME,aAAa,GAAGN,gCAAgC,CAACK,KAAK,CAAC;EAC7DN,yBAAyB,CAACM,KAAK,CAAC;EAChC,OAAOP,sBAAsB,CAACO,KAAK,EAAEC,aAAa,CAAC;AACrD,CAAC,CAAC;AAEFL,OAAO,CAACM,WAAW,GAAG,SAAS","names":["React","useToolbar_unstable","renderToolbar_unstable","useToolbarStyles_unstable","useToolbarContextValues_unstable","Toolbar","forwardRef","props","ref","state","contextValues","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/components/Toolbar/Toolbar.tsx"],"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"]}
@@ -1 +1 @@
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
+ {"version":3,"mappings":"AAAA,SAA0BA,aAAa,EAAEC,kBAAkB,QAAQ,kCAAkC;AAIrG,OAAO,MAAMC,cAAc,gBAAGF,aAAa,CAAkCG,SAAS,CAAiC;AAEvH,MAAMC,0BAA0B,GAAwB;EACtDC,IAAI,EAAE,QAAoB;EAC1BC,kBAAkB,EAAE,MAAM,IAAI;EAC9BC,WAAW,EAAE,MAAM,IAAI;EACvBC,QAAQ,EAAE,KAAK;EACfC,aAAa,EAAE;CAChB;AAED,OAAO,MAAMC,0BAA0B,GAAOC,QAAiD,IAC7FV,kBAAkB,CAACC,cAAc,EAAE,CAACU,GAAG,GAAGR,0BAA0B,KAAKO,QAAQ,CAACC,GAAG,CAAC,CAAC","names":["createContext","useContextSelector","ToolbarContext","undefined","toolbarContextDefaultValue","size","handleToggleButton","handleRadio","vertical","checkedValues","useToolbarContext_unstable","selector","ctx"],"sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/components/Toolbar/ToolbarContext.ts"],"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"]}
@@ -4,7 +4,6 @@ import { ToolbarContext } from './ToolbarContext';
4
4
  /**
5
5
  * Render the final JSX of Toolbar
6
6
  */
7
-
8
7
  export const renderToolbar_unstable = (state, contextValues) => {
9
8
  const {
10
9
  slots,
@@ -12,7 +11,8 @@ export const renderToolbar_unstable = (state, contextValues) => {
12
11
  } = getSlots(state);
13
12
  return /*#__PURE__*/React.createElement(ToolbarContext.Provider, {
14
13
  value: contextValues.toolbar
15
- }, /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
14
+ }, /*#__PURE__*/React.createElement(slots.root, {
15
+ ...slotProps.root
16
16
  }, slotProps.root.children));
17
17
  };
18
18
  //# sourceMappingURL=renderToolbar.js.map
@@ -1 +1 @@
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/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAEpD,SAASC,cAAc,QAAQ,kBAAkB;AAEjD;;;AAGA,OAAO,MAAMC,sBAAsB,GAAG,CAACC,KAAmB,EAAEC,aAAmC,KAAI;EACjG,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGN,QAAQ,CAAeG,KAAK,CAAC;EAE1D,oBACEJ,oBAACE,cAAc,CAACM,QAAQ;IAACC,KAAK,EAAEJ,aAAa,CAACK;EAAO,gBACnDV,oBAACM,KAAK,CAACK,IAAI;IAAA,GAAKJ,SAAS,CAACI;EAAI,GAAGJ,SAAS,CAACI,IAAI,CAACC,QAAQ,CAAc,CAC9C;AAE9B,CAAC","names":["React","getSlots","ToolbarContext","renderToolbar_unstable","state","contextValues","slots","slotProps","Provider","value","toolbar","root","children"],"sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/components/Toolbar/renderToolbar.tsx"],"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"]}
@@ -10,7 +10,6 @@ import { useArrowNavigationGroup } from '@fluentui/react-tabster';
10
10
  * @param props - props from this instance of Toolbar
11
11
  * @param ref - reference to root HTMLElement of Toolbar
12
12
  */
13
-
14
13
  export const useToolbar_unstable = (props, ref) => {
15
14
  const {
16
15
  size = 'medium',
@@ -46,13 +45,11 @@ export const useToolbar_unstable = (props, ref) => {
46
45
  if (name && value) {
47
46
  const checkedItems = (checkedValues === null || checkedValues === void 0 ? void 0 : checkedValues[name]) || [];
48
47
  const newCheckedItems = [...checkedItems];
49
-
50
48
  if (checked) {
51
49
  newCheckedItems.splice(newCheckedItems.indexOf(value), 1);
52
50
  } else {
53
51
  newCheckedItems.push(value);
54
52
  }
55
-
56
53
  onCheckedValueChange === null || onCheckedValueChange === void 0 ? void 0 : onCheckedValueChange(e, {
57
54
  name,
58
55
  checkedItems: newCheckedItems
@@ -67,7 +64,8 @@ export const useToolbar_unstable = (props, ref) => {
67
64
  });
68
65
  }
69
66
  });
70
- return { ...initialState,
67
+ return {
68
+ ...initialState,
71
69
  handleToggleButton,
72
70
  handleRadio,
73
71
  checkedValues: checkedValues !== null && checkedValues !== void 0 ? checkedValues : {}
@@ -77,7 +75,6 @@ export const useToolbar_unstable = (props, ref) => {
77
75
  * Adds appropriate state values and handlers for selectable items
78
76
  * i.e checkboxes and radios
79
77
  */
80
-
81
78
  const useToolbarSelectableState = state => {
82
79
  const [checkedValues, setCheckedValues] = useControllableState({
83
80
  state: state.checkedValues,
@@ -97,9 +94,9 @@ const useToolbarSelectableState = state => {
97
94
  checkedItems
98
95
  });
99
96
  }
100
-
101
97
  setCheckedValues(s => {
102
- return s ? { ...s,
98
+ return s ? {
99
+ ...s,
103
100
  [name]: checkedItems
104
101
  } : {
105
102
  [name]: checkedItems
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-toolbar/src/components/Toolbar/useToolbar.ts"],"names":[],"mappings":"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","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
+ {"version":3,"mappings":"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","names":["useEventCallback","useControllableState","getNativeElementProps","useArrowNavigationGroup","useToolbar_unstable","props","ref","size","vertical","arrowNavigationProps","circular","axis","initialState","components","root","role","checkedValues","onCheckedValueChange","useToolbarSelectableState","defaultCheckedValues","handleToggleButton","e","name","value","checked","checkedItems","newCheckedItems","splice","indexOf","push","handleRadio","state","setCheckedValues","defaultState","onCheckedValueChangeOriginal","s"],"sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/components/Toolbar/useToolbar.ts"],"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"]}
@@ -5,8 +5,8 @@ export function useToolbarContextValues_unstable(state) {
5
5
  vertical,
6
6
  checkedValues,
7
7
  handleRadio
8
- } = state; // This context is created with "@fluentui/react-context-selector", these is no sense to memoize it
9
-
8
+ } = state;
9
+ // This context is created with "@fluentui/react-context-selector", these is no sense to memoize it
10
10
  const toolbar = {
11
11
  size,
12
12
  vertical,
@@ -1 +1 @@
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/"}
1
+ {"version":3,"mappings":"AAEA,OAAM,SAAUA,gCAAgC,CAACC,KAAmB;EAClE,MAAM;IAAEC,IAAI;IAAEC,kBAAkB;IAAEC,QAAQ;IAAEC,aAAa;IAAEC;EAAW,CAAE,GAAGL,KAAK;EAChF;EACA,MAAMM,OAAO,GAAwB;IACnCL,IAAI;IACJE,QAAQ;IACRD,kBAAkB;IAClBG,WAAW;IACXD;GACD;EAED,OAAO;IAAEE;EAAO,CAAE;AACpB","names":["useToolbarContextValues_unstable","state","size","handleToggleButton","vertical","checkedValues","handleRadio","toolbar"],"sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/components/Toolbar/useToolbarContextValues.tsx"],"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"]}
@@ -5,39 +5,36 @@ export const toolbarClassNames = {
5
5
  /**
6
6
  * Styles for the root slot
7
7
  */
8
-
9
8
  const useStyles = /*#__PURE__*/__styles({
10
- "root": {
11
- "mc9l5x": "f22iagw",
12
- "Bt984gj": "f122n59",
13
- "z8tnut": "f10ra9hq",
14
- "z189sj": ["f19lj068", "f177v4lu"],
15
- "Byoj8tv": "f1y2xyjm",
16
- "uwmqm3": ["f177v4lu", "f19lj068"],
17
- "i8kkvl": "f4px1ci",
18
- "Belr9w4": "fn67r4l"
9
+ root: {
10
+ mc9l5x: "f22iagw",
11
+ Bt984gj: "f122n59",
12
+ z8tnut: "f10ra9hq",
13
+ z189sj: ["f19lj068", "f177v4lu"],
14
+ Byoj8tv: "f1y2xyjm",
15
+ uwmqm3: ["f177v4lu", "f19lj068"],
16
+ i8kkvl: "f4px1ci",
17
+ Belr9w4: "fn67r4l"
19
18
  },
20
- "vertical": {
21
- "Beiy3e4": "f1vx9l62",
22
- "a9b677": "f1acs6jw"
19
+ vertical: {
20
+ Beiy3e4: "f1vx9l62",
21
+ a9b677: "f1acs6jw"
23
22
  },
24
- "small": {
25
- "Bqenvij": "f1d2rq10"
23
+ small: {
24
+ Bqenvij: "f1d2rq10"
26
25
  },
27
- "medium": {
28
- "Bqenvij": "fbhnoac"
26
+ medium: {
27
+ Bqenvij: "fbhnoac"
29
28
  },
30
- "large": {
31
- "Bqenvij": "ff2sm71"
29
+ large: {
30
+ Bqenvij: "ff2sm71"
32
31
  }
33
32
  }, {
34
- "d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f10ra9hq{padding-top:4px;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".f1y2xyjm{padding-bottom:4px;}", ".f4px1ci{-webkit-column-gap:8px;column-gap:8px;}", ".fn67r4l{row-gap:8px;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".f1acs6jw{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;}", ".f1d2rq10{height:32px;}", ".fbhnoac{height:40px;}", ".ff2sm71{height:48px;}"]
33
+ d: [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f10ra9hq{padding-top:4px;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".f1y2xyjm{padding-bottom:4px;}", ".f4px1ci{-webkit-column-gap:8px;column-gap:8px;}", ".fn67r4l{row-gap:8px;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".f1acs6jw{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;}", ".f1d2rq10{height:32px;}", ".fbhnoac{height:40px;}", ".ff2sm71{height:48px;}"]
35
34
  });
36
35
  /**
37
36
  * Apply styling to the Toolbar slots based on the state
38
37
  */
39
-
40
-
41
38
  export const useToolbarStyles_unstable = state => {
42
39
  const styles = useStyles();
43
40
  const {
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-toolbar/src/components/Toolbar/useToolbarStyles.ts"],"names":[],"mappings":"AACA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AAGA,OAAO,MAAM,iBAAiB,GAAiC;EAC7D,IAAI,EAAE;AADuD,CAAxD;AAIP;;AAEG;;AACH,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAsBA;;AAEG;;;AACH,OAAO,MAAM,yBAAyB,GAAI,KAAD,IAAsC;EAC7E,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM;IAAE,QAAF;IAAY;EAAZ,IAAqB,KAA3B;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,iBAAiB,CAAC,IADe,EAEjC,MAAM,CAAC,IAF0B,EAGjC,QAAQ,IAAI,MAAM,CAAC,QAHc,EAIjC,IAAI,KAAK,OAAT,IAAoB,CAAC,QAArB,IAAiC,MAAM,CAAC,KAJP,EAKjC,IAAI,KAAK,QAAT,IAAqB,CAAC,QAAtB,IAAkC,MAAM,CAAC,MALR,EAMjC,IAAI,KAAK,OAAT,IAAoB,CAAC,QAArB,IAAiC,MAAM,CAAC,KANP,EAOjC,KAAK,CAAC,IAAN,CAAW,SAPsB,CAAnC;EAUA,OAAO,KAAP;AACD,CAdM","sourcesContent":["import { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { ToolbarSlots, ToolbarState } from './Toolbar.types';\n\nexport const toolbarClassNames: SlotClassNames<ToolbarSlots> = {\n root: 'fui-Toolbar',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n alignItems: 'center',\n ...shorthands.padding('4px', '8px', '4px', '8px'),\n ...shorthands.gap('8px'),\n },\n vertical: {\n flexDirection: 'column',\n width: 'fit-content',\n },\n small: {\n height: '32px',\n },\n medium: {\n height: '40px',\n },\n large: {\n height: '48px',\n },\n});\n\n/**\n * Apply styling to the Toolbar slots based on the state\n */\nexport const useToolbarStyles_unstable = (state: ToolbarState): ToolbarState => {\n const styles = useStyles();\n const { vertical, size } = state;\n state.root.className = mergeClasses(\n toolbarClassNames.root,\n styles.root,\n vertical && styles.vertical,\n size === 'small' && !vertical && styles.small,\n size === 'medium' && !vertical && styles.medium,\n size === 'large' && !vertical && styles.large,\n state.root.className,\n );\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AACA,mBAAqBA,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AAGrE,OAAO,MAAMC,iBAAiB,GAAiC;EAC7DC,IAAI,EAAE;CACP;AAED;;;AAGA,MAAMC,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAoBhB;AAEF;;;AAGA,OAAO,MAAMC,yBAAyB,GAAIC,KAAmB,IAAkB;EAC7E,MAAMC,MAAM,GAAGH,SAAS,EAAE;EAC1B,MAAM;IAAEI,QAAQ;IAAEC;EAAI,CAAE,GAAGH,KAAK;EAChCA,KAAK,CAACH,IAAI,CAACO,SAAS,GAAGV,YAAY,CACjCE,iBAAiB,CAACC,IAAI,EACtBI,MAAM,CAACJ,IAAI,EACXK,QAAQ,IAAID,MAAM,CAACC,QAAQ,EAC3BC,IAAI,KAAK,OAAO,IAAI,CAACD,QAAQ,IAAID,MAAM,CAACI,KAAK,EAC7CF,IAAI,KAAK,QAAQ,IAAI,CAACD,QAAQ,IAAID,MAAM,CAACK,MAAM,EAC/CH,IAAI,KAAK,OAAO,IAAI,CAACD,QAAQ,IAAID,MAAM,CAACM,KAAK,EAC7CP,KAAK,CAACH,IAAI,CAACO,SAAS,CACrB;EAED,OAAOJ,KAAK;AACd,CAAC","names":["mergeClasses","shorthands","toolbarClassNames","root","useStyles","useToolbarStyles_unstable","state","styles","vertical","size","className","small","medium","large"],"sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/components/Toolbar/useToolbarStyles.ts"],"sourcesContent":["import { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { ToolbarSlots, ToolbarState } from './Toolbar.types';\n\nexport const toolbarClassNames: SlotClassNames<ToolbarSlots> = {\n root: 'fui-Toolbar',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n alignItems: 'center',\n ...shorthands.padding('4px', '8px', '4px', '8px'),\n ...shorthands.gap('8px'),\n },\n vertical: {\n flexDirection: 'column',\n width: 'fit-content',\n },\n small: {\n height: '32px',\n },\n medium: {\n height: '40px',\n },\n large: {\n height: '48px',\n },\n});\n\n/**\n * Apply styling to the Toolbar slots based on the state\n */\nexport const useToolbarStyles_unstable = (state: ToolbarState): ToolbarState => {\n const styles = useStyles();\n const { vertical, size } = state;\n state.root.className = mergeClasses(\n toolbarClassNames.root,\n styles.root,\n vertical && styles.vertical,\n size === 'small' && !vertical && styles.small,\n size === 'medium' && !vertical && styles.medium,\n size === 'large' && !vertical && styles.large,\n state.root.className,\n );\n\n return state;\n};\n"]}
@@ -6,11 +6,12 @@ import { useToolbarButton_unstable } from './useToolbarButton';
6
6
  * ToolbarButton component is a Button to be used inside Toolbar
7
7
  * which will respect toolbar props such as `size`
8
8
  */
9
-
10
9
  export const ToolbarButton = /*#__PURE__*/React.forwardRef((props, ref) => {
11
10
  const state = useToolbarButton_unstable(props, ref);
12
11
  useToolbarButtonStyles_unstable(state);
13
- return renderButton_unstable(state); // Casting is required due to lack of distributive union to support unions on @types/react
12
+ return renderButton_unstable(state);
13
+ // Casting is required due to lack of distributive union to support unions on @types/react
14
14
  });
15
+
15
16
  ToolbarButton.displayName = 'ToolbarButton';
16
17
  //# sourceMappingURL=ToolbarButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-toolbar/src/components/ToolbarButton/ToolbarButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAGA,SAAS,qBAAT,QAAsC,wBAAtC;AACA,SAAS,+BAAT,QAAgD,0BAAhD;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AAEA;;;AAGG;;AACH,OAAO,MAAM,aAAa,gBAA4C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpG,MAAM,KAAK,GAAG,yBAAyB,CAAC,KAAD,EAAQ,GAAR,CAAvC;EACA,+BAA+B,CAAC,KAAD,CAA/B;EAEA,OAAO,qBAAqB,CAAC,KAAD,CAA5B,CAJoG,CAKpG;AACD,CANqE,CAA/D;AAQP,aAAa,CAAC,WAAd,GAA4B,eAA5B","sourcesContent":["import * as React from 'react';\nimport type { ToolbarButtonProps } from './ToolbarButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { renderButton_unstable } from '@fluentui/react-button';\nimport { useToolbarButtonStyles_unstable } from './useToolbarButtonStyles';\nimport { useToolbarButton_unstable } from './useToolbarButton';\n\n/**\n * ToolbarButton component is a Button to be used inside Toolbar\n * which will respect toolbar props such as `size`\n */\nexport const ToolbarButton: ForwardRefComponent<ToolbarButtonProps> = React.forwardRef((props, ref) => {\n const state = useToolbarButton_unstable(props, ref);\n useToolbarButtonStyles_unstable(state);\n \n return renderButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<ToolbarButtonProps>;\n\nToolbarButton.displayName = 'ToolbarButton';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAG9B,SAASC,qBAAqB,QAAQ,wBAAwB;AAC9D,SAASC,+BAA+B,QAAQ,0BAA0B;AAC1E,SAASC,yBAAyB,QAAQ,oBAAoB;AAE9D;;;;AAIA,OAAO,MAAMC,aAAa,gBAA4CJ,KAAK,CAACK,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACpG,MAAMC,KAAK,GAAGL,yBAAyB,CAACG,KAAK,EAAEC,GAAG,CAAC;EACnDL,+BAA+B,CAACM,KAAK,CAAC;EAEtC,OAAOP,qBAAqB,CAACO,KAAK,CAAC;EACnC;AACF,CAAC,CAA4C;;AAE7CJ,aAAa,CAACK,WAAW,GAAG,eAAe","names":["React","renderButton_unstable","useToolbarButtonStyles_unstable","useToolbarButton_unstable","ToolbarButton","forwardRef","props","ref","state","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/components/ToolbarButton/ToolbarButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ToolbarButtonProps } from './ToolbarButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { renderButton_unstable } from '@fluentui/react-button';\nimport { useToolbarButtonStyles_unstable } from './useToolbarButtonStyles';\nimport { useToolbarButton_unstable } from './useToolbarButton';\n\n/**\n * ToolbarButton component is a Button to be used inside Toolbar\n * which will respect toolbar props such as `size`\n */\nexport const ToolbarButton: ForwardRefComponent<ToolbarButtonProps> = React.forwardRef((props, ref) => {\n const state = useToolbarButton_unstable(props, ref);\n useToolbarButtonStyles_unstable(state);\n \n return renderButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<ToolbarButtonProps>;\n\nToolbarButton.displayName = 'ToolbarButton';\n"]}
@@ -1,3 +1,5 @@
1
1
  export * from './ToolbarButton';
2
2
  export * from './ToolbarButton.types';
3
+ export * from './useToolbarButton';
4
+ export * from './useToolbarButtonStyles';
3
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/components/ToolbarButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './ToolbarButton';\nexport * from './ToolbarButton.types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/components/ToolbarButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC","sourcesContent":["export * from './ToolbarButton';\nexport * from './ToolbarButton.types';\nexport * from './useToolbarButton';\nexport * from './useToolbarButtonStyles';\n"]}
@@ -5,7 +5,6 @@ import { useButton_unstable } from '@fluentui/react-button';
5
5
  * @param props - User provided props to the Button component.
6
6
  * @param ref - User provided ref to be passed to the Button component.
7
7
  */
8
-
9
8
  export const useToolbarButton_unstable = (props, ref) => {
10
9
  const {
11
10
  vertical = false,
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-toolbar/src/components/ToolbarButton/useToolbarButton.ts"],"names":[],"mappings":"AACA,SAAS,kBAAT,QAAmC,wBAAnC;AAGA;;;;;AAKG;;AACH,OAAO,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;EACtB,MAAM;IAAE,QAAQ,GAAG,KAAb;IAAoB,GAAG;EAAvB,IAAuC,KAA7C;EACA,MAAM,KAAK,GAAG,kBAAkB,CAAC;IAAE,UAAU,EAAE,QAAd;IAAwB,GAAG;EAA3B,CAAD,EAA2C,GAA3C,CAAhC;EACA,OAAO;IACL,QADK;IAEL,GAAG;EAFE,CAAP;AAID,CAVM","sourcesContent":["import * as React from 'react';\nimport { useButton_unstable } from '@fluentui/react-button';\nimport { ToolbarButtonProps, ToolbarButtonState } from './ToolbarButton.types';\n\n/**\n * Given user props, defines default props for the Button, calls useButtonState and useChecked, and returns\n * 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 useToolbarButton_unstable = (\n props: ToolbarButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ToolbarButtonState => {\n const { vertical = false, ...buttonProps } = props;\n const state = useButton_unstable({ appearance: 'subtle', ...buttonProps }, ref);\n return {\n vertical,\n ...state,\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AACA,SAASA,kBAAkB,QAAQ,wBAAwB;AAG3D;;;;;;AAMA,OAAO,MAAMC,yBAAyB,GAAG,CACvCC,KAAyB,EACzBC,GAAqD,KAC/B;EACtB,MAAM;IAAEC,QAAQ,GAAG,KAAK;IAAE,GAAGC;EAAW,CAAE,GAAGH,KAAK;EAClD,MAAMI,KAAK,GAAGN,kBAAkB,CAAC;IAAEO,UAAU,EAAE,QAAQ;IAAE,GAAGF;EAAW,CAAE,EAAEF,GAAG,CAAC;EAC/E,OAAO;IACLC,QAAQ;IACR,GAAGE;GACJ;AACH,CAAC","names":["useButton_unstable","useToolbarButton_unstable","props","ref","vertical","buttonProps","state","appearance"],"sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/components/ToolbarButton/useToolbarButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { useButton_unstable } from '@fluentui/react-button';\nimport { ToolbarButtonProps, ToolbarButtonState } from './ToolbarButton.types';\n\n/**\n * Given user props, defines default props for the Button, calls useButtonState and useChecked, and returns\n * 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 useToolbarButton_unstable = (\n props: ToolbarButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ToolbarButtonState => {\n const { vertical = false, ...buttonProps } = props;\n const state = useButton_unstable({ appearance: 'subtle', ...buttonProps }, ref);\n return {\n vertical,\n ...state,\n };\n};\n"]}
@@ -1,26 +1,22 @@
1
1
  import { __styles, mergeClasses } from '@griffel/react';
2
2
  import { useButtonStyles_unstable } from '@fluentui/react-button';
3
-
4
3
  const useBaseStyles = /*#__PURE__*/__styles({
5
- "vertical": {
6
- "Beiy3e4": "f1vx9l62"
4
+ vertical: {
5
+ Beiy3e4: "f1vx9l62"
7
6
  },
8
- "verticalIcon": {
9
- "Be2twd7": "f1rt2boy"
7
+ verticalIcon: {
8
+ Be2twd7: "f1rt2boy"
10
9
  }
11
10
  }, {
12
- "d": [".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".f1rt2boy{font-size:24px;}"]
11
+ d: [".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".f1rt2boy{font-size:24px;}"]
13
12
  });
14
13
  /**
15
14
  * Apply styling to the ToolbarButton slots based on the state
16
15
  */
17
-
18
-
19
16
  export const useToolbarButtonStyles_unstable = state => {
20
17
  useButtonStyles_unstable(state);
21
18
  const buttonStyles = useBaseStyles();
22
19
  state.root.className = mergeClasses(state.root.className, state.vertical && buttonStyles.vertical);
23
-
24
20
  if (state.icon) {
25
21
  state.icon.className = mergeClasses(state.icon.className, state.vertical && buttonStyles.verticalIcon);
26
22
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-toolbar/src/components/ToolbarButton/useToolbarButtonStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,gBAAzC;AACA,SAAS,wBAAT,QAAyC,wBAAzC;;AAGA,MAAM,aAAa,gBAAG;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAtB;AASA;;AAEG;;;AACH,OAAO,MAAM,+BAA+B,GAAI,KAAD,IAA8B;EAC3E,wBAAwB,CAAC,KAAD,CAAxB;EACA,MAAM,YAAY,GAAG,aAAa,EAAlC;EAEA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,KAAK,CAAC,IAAN,CAAW,SAAZ,EAAuB,KAAK,CAAC,QAAN,IAAkB,YAAY,CAAC,QAAtD,CAAnC;;EACA,IAAI,KAAK,CAAC,IAAV,EAAgB;IACd,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,KAAK,CAAC,IAAN,CAAW,SAAZ,EAAuB,KAAK,CAAC,QAAN,IAAkB,YAAY,CAAC,YAAtD,CAAnC;EACD;AACF,CARM","sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { useButtonStyles_unstable } from '@fluentui/react-button';\nimport { ToolbarButtonState } from './ToolbarButton.types';\n\nconst useBaseStyles = makeStyles({\n vertical: {\n flexDirection: 'column',\n },\n verticalIcon: {\n fontSize: '24px',\n },\n});\n\n/**\n * Apply styling to the ToolbarButton slots based on the state\n */\nexport const useToolbarButtonStyles_unstable = (state: ToolbarButtonState) => {\n useButtonStyles_unstable(state);\n const buttonStyles = useBaseStyles();\n\n state.root.className = mergeClasses(state.root.className, state.vertical && buttonStyles.vertical);\n if (state.icon) {\n state.icon.className = mergeClasses(state.icon.className, state.vertical && buttonStyles.verticalIcon);\n }\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,mBAAqBA,YAAY,QAAQ,gBAAgB;AACzD,SAASC,wBAAwB,QAAQ,wBAAwB;AAGjE,MAAMC,aAAa,gBAAG;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAOpB;AAEF;;;AAGA,OAAO,MAAMC,+BAA+B,GAAIC,KAAyB,IAAI;EAC3EH,wBAAwB,CAACG,KAAK,CAAC;EAC/B,MAAMC,YAAY,GAAGH,aAAa,EAAE;EAEpCE,KAAK,CAACE,IAAI,CAACC,SAAS,GAAGP,YAAY,CAACI,KAAK,CAACE,IAAI,CAACC,SAAS,EAAEH,KAAK,CAACI,QAAQ,IAAIH,YAAY,CAACG,QAAQ,CAAC;EAClG,IAAIJ,KAAK,CAACK,IAAI,EAAE;IACdL,KAAK,CAACK,IAAI,CAACF,SAAS,GAAGP,YAAY,CAACI,KAAK,CAACK,IAAI,CAACF,SAAS,EAAEH,KAAK,CAACI,QAAQ,IAAIH,YAAY,CAACK,YAAY,CAAC;;AAE1G,CAAC","names":["mergeClasses","useButtonStyles_unstable","useBaseStyles","useToolbarButtonStyles_unstable","state","buttonStyles","root","className","vertical","icon","verticalIcon"],"sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/components/ToolbarButton/useToolbarButtonStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { useButtonStyles_unstable } from '@fluentui/react-button';\nimport { ToolbarButtonState } from './ToolbarButton.types';\n\nconst useBaseStyles = makeStyles({\n vertical: {\n flexDirection: 'column',\n },\n verticalIcon: {\n fontSize: '24px',\n },\n});\n\n/**\n * Apply styling to the ToolbarButton slots based on the state\n */\nexport const useToolbarButtonStyles_unstable = (state: ToolbarButtonState) => {\n useButtonStyles_unstable(state);\n const buttonStyles = useBaseStyles();\n\n state.root.className = mergeClasses(state.root.className, state.vertical && buttonStyles.vertical);\n if (state.icon) {\n state.icon.className = mergeClasses(state.icon.className, state.vertical && buttonStyles.verticalIcon);\n }\n};\n"]}
@@ -5,7 +5,6 @@ import { useToolbarDivider_unstable } from './useToolbarDivider';
5
5
  /**
6
6
  * ToolbarDivider component
7
7
  */
8
-
9
8
  export const ToolbarDivider = /*#__PURE__*/React.forwardRef((props, ref) => {
10
9
  const state = useToolbarDivider_unstable(props, ref);
11
10
  useToolbarDividerStyles_unstable(state);
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-toolbar/src/components/ToolbarDivider/ToolbarDivider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gCAAT,QAAiD,2BAAjD;AAGA,SAAS,sBAAT,QAAuC,yBAAvC;AACA,SAAS,0BAAT,QAA2C,qBAA3C;AAEA;;AAEG;;AACH,OAAO,MAAM,cAAc,gBAA6C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACtG,MAAM,KAAK,GAAG,0BAA0B,CAAC,KAAD,EAAQ,GAAR,CAAxC;EACA,gCAAgC,CAAC,KAAD,CAAhC;EACA,OAAO,sBAAsB,CAAC,KAAD,CAA7B;AACD,CAJuE,CAAjE;AAMP,cAAc,CAAC,WAAf,GAA6B,gBAA7B","sourcesContent":["import * as React from 'react';\nimport { useToolbarDividerStyles_unstable } from './useToolbarDividerStyles';\nimport type { ToolbarDividerProps } from './ToolbarDivider.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { renderDivider_unstable } from '@fluentui/react-divider';\nimport { useToolbarDivider_unstable } from './useToolbarDivider';\n\n/**\n * ToolbarDivider component\n */\nexport const ToolbarDivider: ForwardRefComponent<ToolbarDividerProps> = React.forwardRef((props, ref) => {\n const state = useToolbarDivider_unstable(props, ref);\n useToolbarDividerStyles_unstable(state);\n return renderDivider_unstable(state);\n});\n\nToolbarDivider.displayName = 'ToolbarDivider';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,gCAAgC,QAAQ,2BAA2B;AAG5E,SAASC,sBAAsB,QAAQ,yBAAyB;AAChE,SAASC,0BAA0B,QAAQ,qBAAqB;AAEhE;;;AAGA,OAAO,MAAMC,cAAc,gBAA6CJ,KAAK,CAACK,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACtG,MAAMC,KAAK,GAAGL,0BAA0B,CAACG,KAAK,EAAEC,GAAG,CAAC;EACpDN,gCAAgC,CAACO,KAAK,CAAC;EACvC,OAAON,sBAAsB,CAACM,KAAK,CAAC;AACtC,CAAC,CAAC;AAEFJ,cAAc,CAACK,WAAW,GAAG,gBAAgB","names":["React","useToolbarDividerStyles_unstable","renderDivider_unstable","useToolbarDivider_unstable","ToolbarDivider","forwardRef","props","ref","state","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/components/ToolbarDivider/ToolbarDivider.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useToolbarDividerStyles_unstable } from './useToolbarDividerStyles';\nimport type { ToolbarDividerProps } from './ToolbarDivider.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { renderDivider_unstable } from '@fluentui/react-divider';\nimport { useToolbarDivider_unstable } from './useToolbarDivider';\n\n/**\n * ToolbarDivider component\n */\nexport const ToolbarDivider: ForwardRefComponent<ToolbarDividerProps> = React.forwardRef((props, ref) => {\n const state = useToolbarDivider_unstable(props, ref);\n useToolbarDividerStyles_unstable(state);\n return renderDivider_unstable(state);\n});\n\nToolbarDivider.displayName = 'ToolbarDivider';\n"]}