@fluentui/react-button 9.0.0-nightly.f81b28ceb3.1 → 9.0.0-rc.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. package/CHANGELOG.json +495 -24
  2. package/CHANGELOG.md +114 -14
  3. package/dist/react-button.d.ts +42 -34
  4. package/lib/Button.js.map +1 -1
  5. package/lib/CompoundButton.js.map +1 -1
  6. package/lib/MenuButton.js.map +1 -1
  7. package/lib/SplitButton.js.map +1 -1
  8. package/lib/ToggleButton.js.map +1 -1
  9. package/lib/components/Button/Button.js +7 -7
  10. package/lib/components/Button/Button.js.map +1 -1
  11. package/lib/components/Button/Button.types.d.ts +6 -6
  12. package/lib/components/Button/Button.types.js.map +1 -1
  13. package/lib/components/Button/index.d.ts +2 -2
  14. package/lib/components/Button/index.js +1 -2
  15. package/lib/components/Button/index.js.map +1 -1
  16. package/lib/components/Button/renderButton.d.ts +1 -1
  17. package/lib/components/Button/renderButton.js +13 -9
  18. package/lib/components/Button/renderButton.js.map +1 -1
  19. package/lib/components/Button/useButton.d.ts +1 -1
  20. package/lib/components/Button/useButton.js +22 -25
  21. package/lib/components/Button/useButton.js.map +1 -1
  22. package/lib/components/Button/useButtonStyles.d.ts +2 -9
  23. package/lib/components/Button/useButtonStyles.js +118 -90
  24. package/lib/components/Button/useButtonStyles.js.map +1 -1
  25. package/lib/components/CompoundButton/CompoundButton.js +7 -7
  26. package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
  27. package/lib/components/CompoundButton/CompoundButton.types.d.ts +4 -4
  28. package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
  29. package/lib/components/CompoundButton/index.d.ts +1 -1
  30. package/lib/components/CompoundButton/index.js +1 -1
  31. package/lib/components/CompoundButton/index.js.map +1 -1
  32. package/lib/components/CompoundButton/renderCompoundButton.d.ts +1 -1
  33. package/lib/components/CompoundButton/renderCompoundButton.js +15 -9
  34. package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
  35. package/lib/components/CompoundButton/useCompoundButton.d.ts +1 -1
  36. package/lib/components/CompoundButton/useCompoundButton.js +9 -9
  37. package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
  38. package/lib/components/CompoundButton/useCompoundButtonStyles.d.ts +2 -1
  39. package/lib/components/CompoundButton/useCompoundButtonStyles.js +52 -48
  40. package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  41. package/lib/components/MenuButton/MenuButton.js +7 -7
  42. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  43. package/lib/components/MenuButton/MenuButton.types.d.ts +3 -4
  44. package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
  45. package/lib/components/MenuButton/index.d.ts +1 -1
  46. package/lib/components/MenuButton/index.js +1 -1
  47. package/lib/components/MenuButton/index.js.map +1 -1
  48. package/lib/components/MenuButton/renderMenuButton.d.ts +1 -1
  49. package/lib/components/MenuButton/renderMenuButton.js +13 -9
  50. package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
  51. package/lib/components/MenuButton/useMenuButton.d.ts +1 -1
  52. package/lib/components/MenuButton/useMenuButton.js +11 -11
  53. package/lib/components/MenuButton/useMenuButton.js.map +1 -1
  54. package/lib/components/MenuButton/useMenuButtonStyles.d.ts +2 -1
  55. package/lib/components/MenuButton/useMenuButtonStyles.js +8 -6
  56. package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  57. package/lib/components/SplitButton/SplitButton.js +7 -7
  58. package/lib/components/SplitButton/SplitButton.js.map +1 -1
  59. package/lib/components/SplitButton/SplitButton.types.d.ts +6 -4
  60. package/lib/components/SplitButton/SplitButton.types.js.map +1 -1
  61. package/lib/components/SplitButton/index.d.ts +1 -1
  62. package/lib/components/SplitButton/index.js +1 -1
  63. package/lib/components/SplitButton/index.js.map +1 -1
  64. package/lib/components/SplitButton/renderSplitButton.d.ts +1 -1
  65. package/lib/components/SplitButton/renderSplitButton.js +9 -7
  66. package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
  67. package/lib/components/SplitButton/useSplitButton.d.ts +1 -1
  68. package/lib/components/SplitButton/useSplitButton.js +57 -49
  69. package/lib/components/SplitButton/useSplitButton.js.map +1 -1
  70. package/lib/components/SplitButton/useSplitButtonStyles.d.ts +2 -1
  71. package/lib/components/SplitButton/useSplitButtonStyles.js +38 -34
  72. package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
  73. package/lib/components/ToggleButton/ToggleButton.js +7 -7
  74. package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
  75. package/lib/components/ToggleButton/ToggleButton.types.d.ts +2 -1
  76. package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -1
  77. package/lib/components/ToggleButton/index.d.ts +1 -1
  78. package/lib/components/ToggleButton/index.js +1 -1
  79. package/lib/components/ToggleButton/index.js.map +1 -1
  80. package/lib/components/ToggleButton/renderToggleButton.d.ts +1 -1
  81. package/lib/components/ToggleButton/renderToggleButton.js +1 -1
  82. package/lib/components/ToggleButton/renderToggleButton.js.map +1 -1
  83. package/lib/components/ToggleButton/useToggleButton.d.ts +1 -1
  84. package/lib/components/ToggleButton/useToggleButton.js +33 -31
  85. package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
  86. package/lib/components/ToggleButton/useToggleButtonStyles.d.ts +2 -1
  87. package/lib/components/ToggleButton/useToggleButtonStyles.js +47 -43
  88. package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  89. package/lib/index.js.map +1 -1
  90. package/lib-commonjs/Button.js +1 -1
  91. package/lib-commonjs/Button.js.map +1 -1
  92. package/lib-commonjs/CompoundButton.js +1 -1
  93. package/lib-commonjs/CompoundButton.js.map +1 -1
  94. package/lib-commonjs/MenuButton.js +1 -1
  95. package/lib-commonjs/MenuButton.js.map +1 -1
  96. package/lib-commonjs/SplitButton.js +1 -1
  97. package/lib-commonjs/SplitButton.js.map +1 -1
  98. package/lib-commonjs/ToggleButton.js +1 -1
  99. package/lib-commonjs/ToggleButton.js.map +1 -1
  100. package/lib-commonjs/components/Button/Button.js +8 -8
  101. package/lib-commonjs/components/Button/Button.js.map +1 -1
  102. package/lib-commonjs/components/Button/Button.types.d.ts +6 -6
  103. package/lib-commonjs/components/Button/Button.types.js.map +1 -1
  104. package/lib-commonjs/components/Button/index.d.ts +2 -2
  105. package/lib-commonjs/components/Button/index.js +10 -6
  106. package/lib-commonjs/components/Button/index.js.map +1 -1
  107. package/lib-commonjs/components/Button/renderButton.d.ts +1 -1
  108. package/lib-commonjs/components/Button/renderButton.js +17 -14
  109. package/lib-commonjs/components/Button/renderButton.js.map +1 -1
  110. package/lib-commonjs/components/Button/useButton.d.ts +1 -1
  111. package/lib-commonjs/components/Button/useButton.js +26 -29
  112. package/lib-commonjs/components/Button/useButton.js.map +1 -1
  113. package/lib-commonjs/components/Button/useButtonStyles.d.ts +2 -9
  114. package/lib-commonjs/components/Button/useButtonStyles.js +121 -92
  115. package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
  116. package/lib-commonjs/components/CompoundButton/CompoundButton.js +8 -8
  117. package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
  118. package/lib-commonjs/components/CompoundButton/CompoundButton.types.d.ts +4 -4
  119. package/lib-commonjs/components/CompoundButton/CompoundButton.types.js.map +1 -1
  120. package/lib-commonjs/components/CompoundButton/index.d.ts +1 -1
  121. package/lib-commonjs/components/CompoundButton/index.js +10 -4
  122. package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
  123. package/lib-commonjs/components/CompoundButton/renderCompoundButton.d.ts +1 -1
  124. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +19 -14
  125. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
  126. package/lib-commonjs/components/CompoundButton/useCompoundButton.d.ts +1 -1
  127. package/lib-commonjs/components/CompoundButton/useCompoundButton.js +12 -13
  128. package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
  129. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.d.ts +2 -1
  130. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +58 -53
  131. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  132. package/lib-commonjs/components/MenuButton/MenuButton.js +8 -8
  133. package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
  134. package/lib-commonjs/components/MenuButton/MenuButton.types.d.ts +3 -4
  135. package/lib-commonjs/components/MenuButton/MenuButton.types.js.map +1 -1
  136. package/lib-commonjs/components/MenuButton/index.d.ts +1 -1
  137. package/lib-commonjs/components/MenuButton/index.js +10 -4
  138. package/lib-commonjs/components/MenuButton/index.js.map +1 -1
  139. package/lib-commonjs/components/MenuButton/renderMenuButton.d.ts +1 -1
  140. package/lib-commonjs/components/MenuButton/renderMenuButton.js +17 -14
  141. package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
  142. package/lib-commonjs/components/MenuButton/useMenuButton.d.ts +1 -1
  143. package/lib-commonjs/components/MenuButton/useMenuButton.js +15 -16
  144. package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
  145. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.d.ts +2 -1
  146. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +12 -9
  147. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  148. package/lib-commonjs/components/SplitButton/SplitButton.js +8 -8
  149. package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
  150. package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +6 -4
  151. package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -1
  152. package/lib-commonjs/components/SplitButton/index.d.ts +1 -1
  153. package/lib-commonjs/components/SplitButton/index.js +10 -4
  154. package/lib-commonjs/components/SplitButton/index.js.map +1 -1
  155. package/lib-commonjs/components/SplitButton/renderSplitButton.d.ts +1 -1
  156. package/lib-commonjs/components/SplitButton/renderSplitButton.js +13 -12
  157. package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
  158. package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +1 -1
  159. package/lib-commonjs/components/SplitButton/useSplitButton.js +61 -54
  160. package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
  161. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +2 -1
  162. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +44 -39
  163. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
  164. package/lib-commonjs/components/ToggleButton/ToggleButton.js +8 -8
  165. package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
  166. package/lib-commonjs/components/ToggleButton/ToggleButton.types.d.ts +2 -1
  167. package/lib-commonjs/components/ToggleButton/ToggleButton.types.js.map +1 -1
  168. package/lib-commonjs/components/ToggleButton/index.d.ts +1 -1
  169. package/lib-commonjs/components/ToggleButton/index.js +10 -4
  170. package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
  171. package/lib-commonjs/components/ToggleButton/renderToggleButton.d.ts +1 -1
  172. package/lib-commonjs/components/ToggleButton/renderToggleButton.js +3 -3
  173. package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
  174. package/lib-commonjs/components/ToggleButton/useToggleButton.d.ts +1 -1
  175. package/lib-commonjs/components/ToggleButton/useToggleButton.js +37 -36
  176. package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
  177. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.d.ts +2 -1
  178. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +51 -45
  179. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  180. package/lib-commonjs/index.js +1 -1
  181. package/lib-commonjs/index.js.map +1 -1
  182. package/package.json +13 -15
  183. package/lib/common/isConformant.d.ts +0 -4
  184. package/lib/common/isConformant.js +0 -13
  185. package/lib/common/isConformant.js.map +0 -1
  186. package/lib-commonjs/common/isConformant.d.ts +0 -4
  187. package/lib-commonjs/common/isConformant.js +0 -24
  188. package/lib-commonjs/common/isConformant.js.map +0 -1
@@ -2,4 +2,4 @@ export * from './CompoundButton';
2
2
  export * from './CompoundButton.types';
3
3
  export * from './renderCompoundButton';
4
4
  export * from './useCompoundButton';
5
- export { useCompoundButtonStyles } from './useCompoundButtonStyles';
5
+ export { compoundButtonClassName, useCompoundButtonStyles_unstable } from './useCompoundButtonStyles';
@@ -2,5 +2,5 @@ export * from './CompoundButton';
2
2
  export * from './CompoundButton.types';
3
3
  export * from './renderCompoundButton';
4
4
  export * from './useCompoundButton';
5
- export { useCompoundButtonStyles } from './useCompoundButtonStyles';
5
+ export { compoundButtonClassName, useCompoundButtonStyles_unstable } from './useCompoundButtonStyles';
6
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/CompoundButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/CompoundButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["export * from './CompoundButton';\nexport * from './CompoundButton.types';\nexport * from './renderCompoundButton';\nexport * from './useCompoundButton';\nexport { compoundButtonClassName, useCompoundButtonStyles_unstable } from './useCompoundButtonStyles';\n"]}
@@ -2,4 +2,4 @@ import type { CompoundButtonState } from './CompoundButton.types';
2
2
  /**
3
3
  * Renders a CompoundButton component by passing the state defined props to the appropriate slots.
4
4
  */
5
- export declare const renderCompoundButton: (state: CompoundButtonState) => JSX.Element;
5
+ export declare const renderCompoundButton_unstable: (state: CompoundButtonState) => JSX.Element;
@@ -1,17 +1,23 @@
1
- import { __assign } from "tslib";
2
1
  import * as React from 'react';
3
2
  import { getSlots } from '@fluentui/react-utilities';
4
3
  /**
5
4
  * Renders a CompoundButton component by passing the state defined props to the appropriate slots.
6
5
  */
7
6
 
8
- export var renderCompoundButton = function (state) {
9
- var _a = getSlots(state, ['root', 'contentContainer', 'icon', 'secondaryContent']),
10
- slots = _a.slots,
11
- slotProps = _a.slotProps;
12
-
13
- var iconOnly = state.iconOnly,
14
- iconPosition = state.iconPosition;
15
- return /*#__PURE__*/React.createElement(slots.root, __assign({}, slotProps.root), iconPosition !== 'after' && /*#__PURE__*/React.createElement(slots.icon, __assign({}, slotProps.icon)), !iconOnly && /*#__PURE__*/React.createElement(slots.contentContainer, __assign({}, slotProps.contentContainer), slotProps.root.children, /*#__PURE__*/React.createElement(slots.secondaryContent, __assign({}, slotProps.secondaryContent))), iconPosition === 'after' && /*#__PURE__*/React.createElement(slots.icon, __assign({}, slotProps.icon)));
7
+ export const renderCompoundButton_unstable = state => {
8
+ const {
9
+ slots,
10
+ slotProps
11
+ } = getSlots(state);
12
+ const {
13
+ iconOnly,
14
+ iconPosition
15
+ } = state;
16
+ return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
17
+ }, iconPosition !== 'after' && slots.icon && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
18
+ }), !iconOnly && /*#__PURE__*/React.createElement(slots.contentContainer, { ...slotProps.contentContainer
19
+ }, slotProps.root.children, slots.secondaryContent && /*#__PURE__*/React.createElement(slots.secondaryContent, { ...slotProps.secondaryContent
20
+ })), iconPosition === 'after' && slots.icon && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
21
+ }));
16
22
  };
17
23
  //# sourceMappingURL=renderCompoundButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/CompoundButton/renderCompoundButton.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ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B;AAGA;;AAEG;;AACH,OAAO,MAAM,6BAA6B,GAAI,KAAD,IAA+B;AAC1E,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAsB,KAAtB,CAArC;AACA,QAAM;AAAE,IAAA,QAAF;AAAY,IAAA;AAAZ,MAA6B,KAAnC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,YAAY,KAAK,OAAjB,IAA4B,KAAK,CAAC,IAAlC,iBAA0C,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAD7C,EAEG,CAAC,QAAD,iBACC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAP,EAAuB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAvB,EACG,SAAS,CAAC,IAAV,CAAe,QADlB,EAEG,KAAK,CAAC,gBAAN,iBAA0B,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAP,EAAuB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAvB,CAF7B,CAHJ,EAQG,YAAY,KAAK,OAAjB,IAA4B,KAAK,CAAC,IAAlC,iBAA0C,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAR7C,CADF;AAYD,CAhBM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { CompoundButtonSlots, CompoundButtonState } from './CompoundButton.types';\n\n/**\n * Renders a CompoundButton component by passing the state defined props to the appropriate slots.\n */\nexport const renderCompoundButton_unstable = (state: CompoundButtonState) => {\n const { slots, slotProps } = getSlots<CompoundButtonSlots>(state);\n const { iconOnly, iconPosition } = state;\n\n return (\n <slots.root {...slotProps.root}>\n {iconPosition !== 'after' && slots.icon && <slots.icon {...slotProps.icon} />}\n {!iconOnly && (\n <slots.contentContainer {...slotProps.contentContainer}>\n {slotProps.root.children}\n {slots.secondaryContent && <slots.secondaryContent {...slotProps.secondaryContent} />}\n </slots.contentContainer>\n )}\n {iconPosition === 'after' && slots.icon && <slots.icon {...slotProps.icon} />}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
@@ -5,4 +5,4 @@ import type { CompoundButtonProps, CompoundButtonState } from './CompoundButton.
5
5
  * @param props - User provided props to the CompoundButton component.
6
6
  * @param ref - User provided ref to be passed to the CompoundButton component.
7
7
  */
8
- export declare const useCompoundButton: ({ contentContainer, secondaryContent, ...props }: CompoundButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => CompoundButtonState;
8
+ export declare const useCompoundButton_unstable: ({ contentContainer, secondaryContent, ...props }: CompoundButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => CompoundButtonState;
@@ -1,18 +1,18 @@
1
- import { __assign, __rest } from "tslib";
2
1
  import { resolveShorthand } from '@fluentui/react-utilities';
3
- import { useButton } from '../Button/index';
2
+ import { useButton_unstable } from '../Button/index';
4
3
  /**
5
4
  * Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.
6
5
  * @param props - User provided props to the CompoundButton component.
7
6
  * @param ref - User provided ref to be passed to the CompoundButton component.
8
7
  */
9
8
 
10
- export var useCompoundButton = function (_a, ref) {
11
- var contentContainer = _a.contentContainer,
12
- secondaryContent = _a.secondaryContent,
13
- props = __rest(_a, ["contentContainer", "secondaryContent"]);
14
-
15
- return __assign(__assign({}, useButton(props, ref)), {
9
+ export const useCompoundButton_unstable = ({
10
+ contentContainer,
11
+ secondaryContent,
12
+ ...props
13
+ }, ref) => {
14
+ return { // Button state
15
+ ...useButton_unstable(props, ref),
16
16
  // Slots definition
17
17
  components: {
18
18
  root: 'button',
@@ -24,6 +24,6 @@ export var useCompoundButton = function (_a, ref) {
24
24
  required: true
25
25
  }),
26
26
  secondaryContent: resolveShorthand(secondaryContent)
27
- });
27
+ };
28
28
  };
29
29
  //# sourceMappingURL=useCompoundButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/CompoundButton/useCompoundButton.ts"],"names":[],"mappings":";AACA,SAAS,gBAAT,QAAiC,2BAAjC;AAEA,SAAS,SAAT,QAA0B,iBAA1B;AAEA;;;;AAIG;;AACH,OAAO,IAAM,iBAAiB,GAAG,UAC/B,EAD+B,EAE/B,GAF+B,EAEsB;AADnD,MAAA,gBAAgB,GAAA,EAAA,CAAA,gBAAhB;AAAA,MAAkB,gBAAgB,GAAA,EAAA,CAAA,gBAAlC;AAAA,MAAuC,KAAK,GAAA,MAAA,CAAA,EAAA,EAA9C,CAAA,kBAAA,EAAA,kBAAA,CAA8C,CAA5C;;AAGF,SAAA,QAAA,CAAA,QAAA,CAAA,EAAA,EAEK,SAAS,CAAC,KAAD,EAAQ,GAAR,CAFd,CAAA,EAE0B;AAExB;AACA,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,QADI;AAEV,MAAA,IAAI,EAAE,MAFI;AAGV,MAAA,gBAAgB,EAAE,MAHR;AAIV,MAAA,gBAAgB,EAAE;AAJR,KAHY;AASxB,IAAA,gBAAgB,EAAE,gBAAgB,CAAC,gBAAD,EAAmB;AAAE,MAAA,QAAQ,EAAE;AAAZ,KAAnB,CATV;AAUxB,IAAA,gBAAgB,EAAE,gBAAgB,CAAC,gBAAD;AAVV,GAF1B,CAAA;AAcD,CAlBM","sourceRoot":""}
1
+ {"version":3,"sources":["components/CompoundButton/useCompoundButton.ts"],"names":[],"mappings":"AACA,SAAS,gBAAT,QAAiC,2BAAjC;AAEA,SAAS,kBAAT,QAAmC,iBAAnC;AAEA;;;;AAIG;;AACH,OAAO,MAAM,0BAA0B,GAAG,CACxC;AAAE,EAAA,gBAAF;AAAoB,EAAA,gBAApB;AAAsC,KAAG;AAAzC,CADwC,EAExC,GAFwC,KAGjB;AACvB,SAAO,EACL;AACA,OAAG,kBAAkB,CAAC,KAAD,EAAQ,GAAR,CAFhB;AAIL;AACA,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,QADI;AAEV,MAAA,IAAI,EAAE,MAFI;AAGV,MAAA,gBAAgB,EAAE,MAHR;AAIV,MAAA,gBAAgB,EAAE;AAJR,KALP;AAWL,IAAA,gBAAgB,EAAE,gBAAgB,CAAC,gBAAD,EAAmB;AAAE,MAAA,QAAQ,EAAE;AAAZ,KAAnB,CAX7B;AAYL,IAAA,gBAAgB,EAAE,gBAAgB,CAAC,gBAAD;AAZ7B,GAAP;AAcD,CAlBM","sourcesContent":["import * as React from 'react';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport type { CompoundButtonProps, CompoundButtonState } from './CompoundButton.types';\nimport { useButton_unstable } from '../Button/index';\n\n/**\n * Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.\n * @param props - User provided props to the CompoundButton component.\n * @param ref - User provided ref to be passed to the CompoundButton component.\n */\nexport const useCompoundButton_unstable = (\n { contentContainer, secondaryContent, ...props }: CompoundButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): CompoundButtonState => {\n return {\n // Button state\n ...useButton_unstable(props, ref),\n\n // Slots definition\n components: {\n root: 'button',\n icon: 'span',\n contentContainer: 'span',\n secondaryContent: 'span',\n },\n contentContainer: resolveShorthand(contentContainer, { required: true }),\n secondaryContent: resolveShorthand(secondaryContent),\n };\n};\n"],"sourceRoot":"../src/"}
@@ -1,2 +1,3 @@
1
1
  import type { CompoundButtonState } from './CompoundButton.types';
2
- export declare const useCompoundButtonStyles: (state: CompoundButtonState) => CompoundButtonState;
2
+ export declare const compoundButtonClassName = "fui-CompoundButton";
3
+ export declare const useCompoundButtonStyles_unstable: (state: CompoundButtonState) => CompoundButtonState;
@@ -1,69 +1,72 @@
1
- import { mergeClasses, __styles } from '@fluentui/react-make-styles';
2
- import { buttonSpacing, useButtonStyles } from '../Button/useButtonStyles';
3
- var CompoundButtonClassNames = {
4
- secondaryContent: 'CompoundButton-secondaryContent'
1
+ import { shorthands, mergeClasses, __styles } from '@griffel/react';
2
+ import { tokens } from '@fluentui/react-theme';
3
+ import { useButtonStyles_unstable } from '../Button/useButtonStyles';
4
+ export const compoundButtonClassName = 'fui-CompoundButton';
5
+ const CompoundButtonClassNames = {
6
+ secondaryContent: `${compoundButtonClassName}-secondaryContent`
5
7
  };
6
8
 
7
- var useRootStyles = /*#__PURE__*/__styles({
9
+ const useRootStyles = /*#__PURE__*/__styles({
8
10
  "base": {
9
- "rmohyg": "fsbu5mz",
11
+ "i8kkvl": "f4akndk",
12
+ "Belr9w4": "fe5j3v",
10
13
  "Bqenvij": "f11ysow2",
11
- "Bekya5a": "f1smw4j4",
12
- "Bi863bl": "f1b73140",
13
- "B7j81dy": "f19sbf7w"
14
+ "Bma4kx5": "f900oq5",
15
+ "l15nfm": "f8rpug0",
16
+ "n4n7rj": "fre7xro"
14
17
  },
15
18
  "outline": {},
16
19
  "primary": {
17
- "Bekya5a": "f1wrmfx5",
18
- "Bi863bl": "fl6im4w",
19
- "B7j81dy": "f1y0ndy"
20
+ "Bma4kx5": "f1ur7rb7",
21
+ "l15nfm": "f1itoici",
22
+ "n4n7rj": "f1uen3ov"
20
23
  },
21
24
  "subtle": {
22
- "Bekya5a": "f1smw4j4",
23
- "Bi863bl": "f182e9fe",
24
- "B7j81dy": "fdrkfd0"
25
+ "Bma4kx5": "f900oq5",
26
+ "l15nfm": "f1l9nom2",
27
+ "n4n7rj": "fvjq8kx"
25
28
  },
26
29
  "transparent": {
27
- "Bekya5a": "f1smw4j4",
28
- "Bi863bl": "f182e9fe",
29
- "B7j81dy": "fdrkfd0"
30
+ "Bma4kx5": "f900oq5",
31
+ "l15nfm": "f1l9nom2",
32
+ "n4n7rj": "fvjq8kx"
30
33
  },
31
34
  "small": {
32
35
  "z8tnut": "fp9bwmr",
33
36
  "z189sj": ["f19lj068", "f177v4lu"],
34
- "Byoj8tv": "f150uoa4",
37
+ "Byoj8tv": "f1fow5ox",
35
38
  "uwmqm3": ["f177v4lu", "f19lj068"],
36
39
  "Be2twd7": "fkhj508",
37
40
  "Bg96gwp": "f1i3iumi"
38
41
  },
39
42
  "medium": {
40
- "z8tnut": "f1kcqot9",
43
+ "z8tnut": "fbtff6s",
41
44
  "z189sj": ["f11qrl6u", "fjlbh76"],
42
- "Byoj8tv": "fpe6lb7",
45
+ "Byoj8tv": "fp67ikv",
43
46
  "uwmqm3": ["fjlbh76", "f11qrl6u"],
44
47
  "Be2twd7": "fkhj508",
45
48
  "Bg96gwp": "f1i3iumi"
46
49
  },
47
50
  "large": {
48
- "z8tnut": "fqag9an",
51
+ "z8tnut": "fm4bm3s",
49
52
  "z189sj": ["f1gbmcue", "f1rh9g5y"],
50
- "Byoj8tv": "fp67ikv",
53
+ "Byoj8tv": "fe2my4m",
51
54
  "uwmqm3": ["f1rh9g5y", "f1gbmcue"],
52
55
  "Be2twd7": "fod5ikn",
53
56
  "Bg96gwp": "faaz57k"
54
57
  },
55
58
  "disabled": {
56
- "Bekya5a": "f1ygg8x6",
57
- "Bi863bl": "fhtktt2",
58
- "B7j81dy": "f1v2jbe6"
59
+ "Bma4kx5": "fj9njph",
60
+ "l15nfm": "fr13fpv",
61
+ "n4n7rj": "f1xrf5v0"
59
62
  }
60
63
  }, {
61
- "d": [".fsbu5mz{gap:12px;}", ".f11ysow2{height:auto;}", ".f1smw4j4 .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2);}", ".f1wrmfx5 .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".fp9bwmr{padding-top:8px;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".f150uoa4{padding-bottom:8px;}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1kcqot9{padding-top:12px;}", ".f11qrl6u{padding-right:12px;}", ".fjlbh76{padding-left:12px;}", ".fpe6lb7{padding-bottom:12px;}", ".fqag9an{padding-top:16px;}", ".f1gbmcue{padding-right:16px;}", ".f1rh9g5y{padding-left:16px;}", ".fp67ikv{padding-bottom:16px;}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".f1ygg8x6 .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundDisabled);}"],
62
- "h": [".f1b73140:hover .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2Hover);}", ".fl6im4w:hover .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".f182e9fe:hover .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2BrandHover);}", ".fhtktt2:hover .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundDisabled);}"],
63
- "a": [".f19sbf7w:active .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2Pressed);}", ".f1y0ndy:active .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".fdrkfd0:active .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2BrandPressed);}", ".f1v2jbe6:active .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundDisabled);}"]
64
+ "d": [".f4akndk{-webkit-column-gap:12px;column-gap:12px;}", ".fe5j3v{row-gap:12px;}", ".f11ysow2{height:auto;}", ".f900oq5 .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForeground2);}", ".f1ur7rb7 .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".fp9bwmr{padding-top:8px;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".f1fow5ox{padding-bottom:10px;}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".fbtff6s{padding-top:14px;}", ".f11qrl6u{padding-right:12px;}", ".fjlbh76{padding-left:12px;}", ".fp67ikv{padding-bottom:16px;}", ".fm4bm3s{padding-top:18px;}", ".f1gbmcue{padding-right:16px;}", ".f1rh9g5y{padding-left:16px;}", ".fe2my4m{padding-bottom:20px;}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".fj9njph .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForegroundDisabled);}"],
65
+ "h": [".f8rpug0:hover .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForeground2Hover);}", ".f1itoici:hover .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".f1l9nom2:hover .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForeground2BrandHover);}", ".fr13fpv:hover .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForegroundDisabled);}"],
66
+ "a": [".fre7xro:active .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForeground2Pressed);}", ".f1uen3ov:active .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".fvjq8kx:active .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForeground2BrandPressed);}", ".f1xrf5v0:active .fui-CompoundButton-secondaryContent{color:var(--colorNeutralForegroundDisabled);}"]
64
67
  });
65
68
 
66
- var useRootIconOnlyStyles = /*#__PURE__*/__styles({
69
+ const useRootIconOnlyStyles = /*#__PURE__*/__styles({
67
70
  "small": {
68
71
  "z8tnut": "f10ra9hq",
69
72
  "z189sj": ["f8wuabp", "fycuoez"],
@@ -92,7 +95,7 @@ var useRootIconOnlyStyles = /*#__PURE__*/__styles({
92
95
  "d": [".f10ra9hq{padding-top:4px;}", ".f8wuabp{padding-right:4px;}", ".fycuoez{padding-left:4px;}", ".f1y2xyjm{padding-bottom:4px;}", ".ft5vyj6{max-width:48px;}", ".f17suaiq{min-width:48px;}", ".f1xp5gbu{padding-top:6px;}", ".f1sgzk6v{padding-right:6px;}", ".f1bg5zqg{padding-left:6px;}", ".f1d7kygh{padding-bottom:6px;}", ".fdczgix{max-width:52px;}", ".fjdcg9m{min-width:52px;}", ".fp9bwmr{padding-top:8px;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".f150uoa4{padding-bottom:8px;}", ".fww51uw{max-width:56px;}", ".f1qhsl2h{min-width:56px;}"]
93
96
  });
94
97
 
95
- var useIconStyles = /*#__PURE__*/__styles({
98
+ const useIconStyles = /*#__PURE__*/__styles({
96
99
  "base": {
97
100
  "Be2twd7": "fndrnj9",
98
101
  "Bqenvij": "fbhnoac",
@@ -102,7 +105,7 @@ var useIconStyles = /*#__PURE__*/__styles({
102
105
  "d": [".fndrnj9{font-size:40px;}", ".fbhnoac{height:40px;}", ".feqmc2u{width:40px;}"]
103
106
  });
104
107
 
105
- var useContentContainerStyles = /*#__PURE__*/__styles({
108
+ const useContentContainerStyles = /*#__PURE__*/__styles({
106
109
  "base": {
107
110
  "mc9l5x": "f22iagw",
108
111
  "Beiy3e4": "f1vx9l62",
@@ -112,10 +115,9 @@ var useContentContainerStyles = /*#__PURE__*/__styles({
112
115
  "d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".f1o700av{text-align:left;}", ".fes3tcz{text-align:right;}"]
113
116
  });
114
117
 
115
- var useSecondaryContentStyles = /*#__PURE__*/__styles({
118
+ const useSecondaryContentStyles = /*#__PURE__*/__styles({
116
119
  "base": {
117
120
  "Bg96gwp": "flkuc6h",
118
- "B6of3ja": "fvjh0tl",
119
121
  "Bhrd7zp": "figsok6"
120
122
  },
121
123
  "small": {
@@ -128,21 +130,23 @@ var useSecondaryContentStyles = /*#__PURE__*/__styles({
128
130
  "Be2twd7": "fkhj508"
129
131
  }
130
132
  }, {
131
- "d": [".flkuc6h{line-height:100%;}", ".fvjh0tl{margin-top:4px;}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fkhj508{font-size:var(--fontSizeBase300);}"]
133
+ "d": [".flkuc6h{line-height:100%;}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fkhj508{font-size:var(--fontSizeBase300);}"]
132
134
  });
133
135
 
134
- export var useCompoundButtonStyles = function (state) {
135
- var rootStyles = useRootStyles();
136
- var rootIconOnlyStyles = useRootIconOnlyStyles();
137
- var iconStyles = useIconStyles();
138
- var contentContainerStyles = useContentContainerStyles();
139
- var secondaryContentStyles = useSecondaryContentStyles();
140
- var appearance = state.appearance,
141
- disabled = state.disabled,
142
- disabledFocusable = state.disabledFocusable,
143
- iconOnly = state.iconOnly,
144
- size = state.size;
145
- state.root.className = mergeClasses( // Root styles
136
+ export const useCompoundButtonStyles_unstable = state => {
137
+ const rootStyles = useRootStyles();
138
+ const rootIconOnlyStyles = useRootIconOnlyStyles();
139
+ const iconStyles = useIconStyles();
140
+ const contentContainerStyles = useContentContainerStyles();
141
+ const secondaryContentStyles = useSecondaryContentStyles();
142
+ const {
143
+ appearance,
144
+ disabled,
145
+ disabledFocusable,
146
+ iconOnly,
147
+ size
148
+ } = state;
149
+ state.root.className = mergeClasses(compoundButtonClassName, // Root styles
146
150
  rootStyles.base, appearance && rootStyles[appearance], rootStyles[size], // Disabled styles
147
151
  (disabled || disabledFocusable) && rootStyles.disabled, // Icon-only styles
148
152
  iconOnly && rootIconOnlyStyles[size], // User provided class name
@@ -158,7 +162,7 @@ export var useCompoundButtonStyles = function (state) {
158
162
  state.secondaryContent.className = mergeClasses(CompoundButtonClassNames.secondaryContent, secondaryContentStyles.base, secondaryContentStyles[size], state.secondaryContent.className);
159
163
  }
160
164
 
161
- useButtonStyles(state);
165
+ useButtonStyles_unstable(state);
162
166
  return state;
163
167
  };
164
168
  //# sourceMappingURL=useCompoundButtonStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/CompoundButton/useCompoundButtonStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,kBAAyC,6BAAzC;AACA,SAAS,aAAT,EAAwB,eAAxB,QAA+C,2BAA/C;AAGA,IAAM,wBAAwB,GAAG;AAC/B,EAA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import { tokens } from '@fluentui/react-theme';\nimport { useButtonStyles_unstable } from '../Button/useButtonStyles';\nimport type { CompoundButtonState } from './CompoundButton.types';\n\nexport const compoundButtonClassName = 'fui-CompoundButton';\n\nconst CompoundButtonClassNames = {\n secondaryContent: `${compoundButtonClassName}-secondaryContent`,\n};\n\nconst useRootStyles = makeStyles({\n // Base styles\n base: {\n ...shorthands.gap('12px'),\n\n height: 'auto',\n\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Hover,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n },\n\n // Appearance variations\n outline: {\n /* No styles */\n },\n primary: {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n },\n subtle: {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandHover,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n },\n transparent: {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandHover,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n },\n\n // Size variations\n small: {\n ...shorthands.padding('8px', '8px', '10px', '8px'),\n\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n medium: {\n ...shorthands.padding('14px', '12px', '16px', '12px'),\n\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n large: {\n ...shorthands.padding('18px', '16px', '20px', '16px'),\n\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n },\n\n // Disabled styles\n disabled: {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n },\n});\n\nconst useRootIconOnlyStyles = makeStyles({\n // Size variations\n small: {\n ...shorthands.padding('4px'),\n\n maxWidth: '48px',\n minWidth: '48px',\n },\n medium: {\n ...shorthands.padding('6px'),\n\n maxWidth: '52px',\n minWidth: '52px',\n },\n large: {\n ...shorthands.padding('8px'),\n\n maxWidth: '56px',\n minWidth: '56px',\n },\n});\n\nconst useIconStyles = makeStyles({\n // Base styles\n base: {\n fontSize: '40px',\n height: '40px',\n width: '40px',\n },\n});\n\nconst useContentContainerStyles = makeStyles({\n // Base styles\n base: {\n display: 'flex',\n flexDirection: 'column',\n textAlign: 'left',\n },\n});\n\nconst useSecondaryContentStyles = makeStyles({\n // Base styles\n base: {\n lineHeight: '100%',\n fontWeight: tokens.fontWeightRegular,\n },\n\n // Size variations\n small: {\n fontSize: tokens.fontSizeBase200,\n },\n medium: {\n fontSize: tokens.fontSizeBase200,\n },\n large: {\n fontSize: tokens.fontSizeBase300,\n },\n});\n\nexport const useCompoundButtonStyles_unstable = (state: CompoundButtonState): CompoundButtonState => {\n const rootStyles = useRootStyles();\n const rootIconOnlyStyles = useRootIconOnlyStyles();\n const iconStyles = useIconStyles();\n const contentContainerStyles = useContentContainerStyles();\n const secondaryContentStyles = useSecondaryContentStyles();\n\n const { appearance, disabled, disabledFocusable, iconOnly, size } = state;\n\n state.root.className = mergeClasses(\n compoundButtonClassName,\n\n // Root styles\n rootStyles.base,\n appearance && rootStyles[appearance],\n rootStyles[size],\n\n // Disabled styles\n (disabled || disabledFocusable) && rootStyles.disabled,\n\n // Icon-only styles\n iconOnly && rootIconOnlyStyles[size],\n\n // User provided class name\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(iconStyles.base, state.icon.className);\n }\n\n state.contentContainer.className = mergeClasses(contentContainerStyles.base, state.contentContainer.className);\n\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(\n CompoundButtonClassNames.secondaryContent,\n secondaryContentStyles.base,\n secondaryContentStyles[size],\n state.secondaryContent.className,\n );\n }\n\n useButtonStyles_unstable(state);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1,15 +1,15 @@
1
1
  import * as React from 'react';
2
- import { renderMenuButton } from './renderMenuButton';
3
- import { useMenuButton } from './useMenuButton';
4
- import { useMenuButtonStyles } from './useMenuButtonStyles';
2
+ import { renderMenuButton_unstable } from './renderMenuButton';
3
+ import { useMenuButton_unstable } from './useMenuButton';
4
+ import { useMenuButtonStyles_unstable } from './useMenuButtonStyles';
5
5
  /**
6
6
  * MenuButtons are buttons that handle opening and closing a menu when they are triggered.
7
7
  */
8
8
 
9
- export var MenuButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
10
- var state = useMenuButton(props, ref);
11
- useMenuButtonStyles(state);
12
- return renderMenuButton(state); // Casting is required due to lack of distributive union to support unions on @types/react
9
+ export const MenuButton = /*#__PURE__*/React.forwardRef((props, ref) => {
10
+ const state = useMenuButton_unstable(props, ref);
11
+ useMenuButtonStyles_unstable(state);
12
+ return renderMenuButton_unstable(state); // Casting is required due to lack of distributive union to support unions on @types/react
13
13
  });
14
14
  MenuButton.displayName = 'MenuButton';
15
15
  //# sourceMappingURL=MenuButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuButton/MenuButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gBAAT,QAAiC,oBAAjC;AACA,SAAS,aAAT,QAA8B,iBAA9B;AACA,SAAS,mBAAT,QAAoC,uBAApC;AAIA;;AAEG;;AACH,OAAO,IAAM,UAAU,gBAAyC,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAC1F,MAAM,KAAK,GAAG,aAAa,CAAC,KAAD,EAAQ,GAAR,CAA3B;AAEA,EAAA,mBAAmB,CAAC,KAAD,CAAnB;AAEA,SAAO,gBAAgB,CAAC,KAAD,CAAvB,CAL0F,CAM1F;AACD,CAP+D,CAAzD;AASP,UAAU,CAAC,WAAX,GAAyB,YAAzB","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuButton/MenuButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AACA,SAAS,sBAAT,QAAuC,iBAAvC;AACA,SAAS,4BAAT,QAA6C,uBAA7C;AAIA;;AAEG;;AACH,OAAO,MAAM,UAAU,gBAAyC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAC9F,QAAM,KAAK,GAAG,sBAAsB,CAAC,KAAD,EAAQ,GAAR,CAApC;AAEA,EAAA,4BAA4B,CAAC,KAAD,CAA5B;AAEA,SAAO,yBAAyB,CAAC,KAAD,CAAhC,CAL8F,CAM9F;AACD,CAP+D,CAAzD;AASP,UAAU,CAAC,WAAX,GAAyB,YAAzB","sourcesContent":["import * as React from 'react';\nimport { renderMenuButton_unstable } from './renderMenuButton';\nimport { useMenuButton_unstable } from './useMenuButton';\nimport { useMenuButtonStyles_unstable } from './useMenuButtonStyles';\nimport type { MenuButtonProps } from './MenuButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * MenuButtons are buttons that handle opening and closing a menu when they are triggered.\n */\nexport const MenuButton: ForwardRefComponent<MenuButtonProps> = React.forwardRef((props, ref) => {\n const state = useMenuButton_unstable(props, ref);\n\n useMenuButtonStyles_unstable(state);\n\n return renderMenuButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<MenuButtonProps>;\n\nMenuButton.displayName = 'MenuButton';\n"],"sourceRoot":"../src/"}
@@ -1,11 +1,10 @@
1
- import type { MenuTriggerChildProps } from '@fluentui/react-menu';
2
- import type { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
1
+ import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
3
2
  import type { ButtonCommons, ButtonSlots, ButtonState } from '../Button/Button.types';
4
3
  export declare type MenuButtonSlots = ButtonSlots & {
5
4
  /**
6
5
  * Menu icon that indicates that this button has a menu that can be expanded.
7
6
  */
8
- menuIcon?: IntrinsicShorthandProps<'span'>;
7
+ menuIcon?: Slot<'span'>;
9
8
  };
10
- export declare type MenuButtonProps = ComponentProps<MenuButtonSlots> & Partial<Omit<ButtonCommons, 'iconPosition'>> & Partial<MenuTriggerChildProps>;
9
+ export declare type MenuButtonProps = ComponentProps<MenuButtonSlots> & Partial<Omit<ButtonCommons, 'iconPosition'>>;
11
10
  export declare type MenuButtonState = ComponentState<MenuButtonSlots> & Omit<ButtonState, keyof ButtonSlots | 'components' | 'iconPosition'>;
@@ -1 +1 @@
1
- {"version":3,"file":"MenuButton.types.js","sourceRoot":"","sources":["../../../src/components/MenuButton/MenuButton.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"MenuButton.types.js","sourceRoot":"../src/","sources":["components/MenuButton/MenuButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { ButtonCommons, ButtonSlots, ButtonState } from '../Button/Button.types';\n\nexport type MenuButtonSlots = ButtonSlots & {\n /**\n * Menu icon that indicates that this button has a menu that can be expanded.\n */\n menuIcon?: Slot<'span'>;\n};\n\nexport type MenuButtonProps = ComponentProps<MenuButtonSlots> & Partial<Omit<ButtonCommons, 'iconPosition'>>;\n\nexport type MenuButtonState = ComponentState<MenuButtonSlots> &\n Omit<ButtonState, keyof ButtonSlots | 'components' | 'iconPosition'>;\n"]}
@@ -2,4 +2,4 @@ export * from './MenuButton.types';
2
2
  export * from './MenuButton';
3
3
  export * from './renderMenuButton';
4
4
  export * from './useMenuButton';
5
- export { useMenuButtonStyles } from './useMenuButtonStyles';
5
+ export { menuButtonClassName, useMenuButtonStyles_unstable } from './useMenuButtonStyles';
@@ -2,5 +2,5 @@ export * from './MenuButton.types';
2
2
  export * from './MenuButton';
3
3
  export * from './renderMenuButton';
4
4
  export * from './useMenuButton';
5
- export { useMenuButtonStyles } from './useMenuButtonStyles';
5
+ export { menuButtonClassName, useMenuButtonStyles_unstable } from './useMenuButtonStyles';
6
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MenuButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/MenuButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["export * from './MenuButton.types';\nexport * from './MenuButton';\nexport * from './renderMenuButton';\nexport * from './useMenuButton';\nexport { menuButtonClassName, useMenuButtonStyles_unstable } from './useMenuButtonStyles';\n"]}
@@ -2,4 +2,4 @@ import type { MenuButtonState } from './MenuButton.types';
2
2
  /**
3
3
  * Renders a MenuButton component by passing the state defined props to the appropriate slots.
4
4
  */
5
- export declare const renderMenuButton: (state: MenuButtonState) => JSX.Element;
5
+ export declare const renderMenuButton_unstable: (state: MenuButtonState) => JSX.Element;
@@ -1,17 +1,21 @@
1
- import { __assign } from "tslib";
2
1
  import * as React from 'react';
3
2
  import { getSlots } from '@fluentui/react-utilities';
4
3
  /**
5
4
  * Renders a MenuButton component by passing the state defined props to the appropriate slots.
6
5
  */
7
6
 
8
- export var renderMenuButton = function (state) {
9
- var _a = getSlots(state, ['root', 'icon', 'menuIcon']),
10
- slots = _a.slots,
11
- slotProps = _a.slotProps;
12
-
13
- var icon = state.icon,
14
- iconOnly = state.iconOnly;
15
- return /*#__PURE__*/React.createElement(slots.root, __assign({}, slotProps.root), /*#__PURE__*/React.createElement(slots.icon, __assign({}, slotProps.icon)), !iconOnly && slotProps.root.children, (!iconOnly || !(icon === null || icon === void 0 ? void 0 : icon.children)) && /*#__PURE__*/React.createElement(slots.menuIcon, __assign({}, slotProps.menuIcon)));
7
+ export const renderMenuButton_unstable = state => {
8
+ const {
9
+ slots,
10
+ slotProps
11
+ } = getSlots(state);
12
+ const {
13
+ icon,
14
+ iconOnly
15
+ } = state;
16
+ return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
17
+ }, slots.icon && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
18
+ }), !iconOnly && slotProps.root.children, (!iconOnly || !(icon === null || icon === void 0 ? void 0 : icon.children)) && slots.menuIcon && /*#__PURE__*/React.createElement(slots.menuIcon, { ...slotProps.menuIcon
19
+ }));
16
20
  };
17
21
  //# sourceMappingURL=renderMenuButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components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AT,MAAuB,QAAQ,CAAkB,KAAlB,CAArC;AACA,QAAM;AAAE,IAAA,IAAF;AAAQ,IAAA;AAAR,MAAqB,KAA3B;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,KAAK,CAAC,IAAN,iBAAc,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CADjB,EAEG,CAAC,QAAD,IAAa,SAAS,CAAC,IAAV,CAAe,QAF/B,EAGG,CAAC,CAAC,QAAD,IAAa,EAAC,IAAI,KAAA,IAAJ,IAAA,IAAI,KAAA,KAAA,CAAJ,GAAI,KAAA,CAAJ,GAAA,IAAI,CAAE,QAAP,CAAd,KAAkC,KAAK,CAAC,QAAxC,iBAAoD,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,EAAA,GAAK,SAAS,CAAC;AAAf,GAAf,CAHvD,CADF;AAOD,CAXM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { MenuButtonSlots, MenuButtonState } from './MenuButton.types';\n\n/**\n * Renders a MenuButton component by passing the state defined props to the appropriate slots.\n */\nexport const renderMenuButton_unstable = (state: MenuButtonState) => {\n const { slots, slotProps } = getSlots<MenuButtonSlots>(state);\n const { icon, iconOnly } = state;\n\n return (\n <slots.root {...slotProps.root}>\n {slots.icon && <slots.icon {...slotProps.icon} />}\n {!iconOnly && slotProps.root.children}\n {(!iconOnly || !icon?.children) && slots.menuIcon && <slots.menuIcon {...slotProps.menuIcon} />}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
@@ -3,4 +3,4 @@ import type { MenuButtonProps, MenuButtonState } from './MenuButton.types';
3
3
  /**
4
4
  * Given user props, returns the final state for a MenuButton.
5
5
  */
6
- export declare const useMenuButton: ({ menuIcon, ...props }: MenuButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => MenuButtonState;
6
+ export declare const useMenuButton_unstable: ({ menuIcon, ...props }: MenuButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => MenuButtonState;
@@ -1,18 +1,18 @@
1
- import { __assign, __rest } from "tslib";
2
1
  import * as React from 'react';
3
- import { ChevronDown20Regular, ChevronDown24Regular } from '@fluentui/react-icons';
2
+ import { ChevronDownRegular } from '@fluentui/react-icons';
4
3
  import { resolveShorthand } from '@fluentui/react-utilities';
5
- import { useButton } from '../Button/index';
4
+ import { useButton_unstable } from '../Button/index';
6
5
  /**
7
6
  * Given user props, returns the final state for a MenuButton.
8
7
  */
9
8
 
10
- export var useMenuButton = function (_a, ref) {
11
- var menuIcon = _a.menuIcon,
12
- props = __rest(_a, ["menuIcon"]);
13
-
14
- var buttonState = useButton(props, ref);
15
- return __assign(__assign({}, buttonState), {
9
+ export const useMenuButton_unstable = ({
10
+ menuIcon,
11
+ ...props
12
+ }, ref) => {
13
+ const buttonState = useButton_unstable(props, ref);
14
+ return { // Button state
15
+ ...buttonState,
16
16
  // State calculated from a set of props
17
17
  iconOnly: Boolean(!props.children),
18
18
  // Slots definition
@@ -23,10 +23,10 @@ export var useMenuButton = function (_a, ref) {
23
23
  },
24
24
  menuIcon: resolveShorthand(menuIcon, {
25
25
  defaultProps: {
26
- children: buttonState.size === 'large' ? /*#__PURE__*/React.createElement(ChevronDown24Regular, null) : /*#__PURE__*/React.createElement(ChevronDown20Regular, null)
26
+ children: /*#__PURE__*/React.createElement(ChevronDownRegular, null)
27
27
  },
28
28
  required: true
29
29
  })
30
- });
30
+ };
31
31
  };
32
32
  //# sourceMappingURL=useMenuButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuButton/useMenuButton.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,oBAAT,EAA+B,oBAA/B,QAA2D,uBAA3D;AACA,SAAS,gBAAT,QAA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M,WAAW,GAAG,kBAAkB,CAAC,KAAD,EAAQ,GAAR,CAAtC;AACA,SAAO,EACL;AACA,OAAG,WAFE;AAIL;AACA,IAAA,QAAQ,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,QAAR,CALZ;AAOL;AACA,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,QADI;AAEV,MAAA,IAAI,EAAE,MAFI;AAGV,MAAA,QAAQ,EAAE;AAHA,KARP;AAcL,IAAA,QAAQ,EAAE,gBAAgB,CAAC,QAAD,EAAW;AACnC,MAAA,YAAY,EAAE;AACZ,QAAA,QAAQ,eAAE,KAAA,CAAA,aAAA,CAAC,kBAAD,EAAmB,IAAnB;AADE,OADqB;AAInC,MAAA,QAAQ,EAAE;AAJyB,KAAX;AAdrB,GAAP;AAqBD,CA1BM","sourcesContent":["import * as React from 'react';\nimport { ChevronDownRegular } from '@fluentui/react-icons';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { useButton_unstable } from '../Button/index';\nimport type { MenuButtonProps, MenuButtonState } from './MenuButton.types';\n\n/**\n * Given user props, returns the final state for a MenuButton.\n */\nexport const useMenuButton_unstable = (\n { menuIcon, ...props }: MenuButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): MenuButtonState => {\n const buttonState = useButton_unstable(props, ref);\n return {\n // Button state\n ...buttonState,\n\n // State calculated from a set of props\n iconOnly: Boolean(!props.children),\n\n // Slots definition\n components: {\n root: 'button',\n icon: 'span',\n menuIcon: 'span',\n },\n\n menuIcon: resolveShorthand(menuIcon, {\n defaultProps: {\n children: <ChevronDownRegular />,\n },\n required: true,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
@@ -1,2 +1,3 @@
1
1
  import type { MenuButtonState } from './MenuButton.types';
2
- export declare const useMenuButtonStyles: (state: MenuButtonState) => MenuButtonState;
2
+ export declare const menuButtonClassName = "fui-MenuButton";
3
+ export declare const useMenuButtonStyles_unstable: (state: MenuButtonState) => MenuButtonState;
@@ -1,7 +1,8 @@
1
- import { mergeClasses, __styles } from '@fluentui/react-make-styles';
2
- import { useButtonStyles } from '../Button/useButtonStyles';
1
+ import { mergeClasses, __styles } from '@griffel/react';
2
+ import { useButtonStyles_unstable } from '../Button/useButtonStyles';
3
+ export const menuButtonClassName = 'fui-MenuButton';
3
4
 
4
- var useMenuIconStyles = /*#__PURE__*/__styles({
5
+ const useMenuIconStyles = /*#__PURE__*/__styles({
5
6
  "small": {
6
7
  "Be2twd7": "fe5j1ua",
7
8
  "Bqenvij": "fjamq6b",
@@ -21,14 +22,15 @@ var useMenuIconStyles = /*#__PURE__*/__styles({
21
22
  "d": [".fe5j1ua{font-size:20px;}", ".fjamq6b{height:20px;}", ".f64fuq3{width:20px;}", ".f1rt2boy{font-size:24px;}", ".frvgh55{height:24px;}", ".fq4mcun{width:24px;}"]
22
23
  });
23
24
 
24
- export var useMenuButtonStyles = function (state) {
25
- var menuIconStyles = useMenuIconStyles();
25
+ export const useMenuButtonStyles_unstable = state => {
26
+ const menuIconStyles = useMenuIconStyles();
27
+ state.root.className = mergeClasses(menuButtonClassName, state.root.className);
26
28
 
27
29
  if (state.menuIcon) {
28
30
  state.menuIcon.className = mergeClasses(menuIconStyles[state.size], state.menuIcon.className);
29
31
  }
30
32
 
31
- useButtonStyles(state);
33
+ useButtonStyles_unstable(state);
32
34
  return state;
33
35
  };
34
36
  //# sourceMappingURL=useMenuButtonStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/MenuButton/useMenuButtonStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,kBAAyC,6BAAzC;AAEA,SAAS,eAAT,QAAgC,2BAAhC;;AAGA,IAAM,iBAAiB,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAA1B;;AAmBA,OAAO,IAAM,mBAAmB,GAAG,UAAC,KAAD,EAAuB;AACxD,MAAM,cAAc,GAAG,iBAAiB,EAAxC;;AACA,MAAI,KAAK,CAAC,QAAV,EAAoB;AAClB,IAAA,KAAK,CAAC,QAAN,CAAe,SAAf,GAA2B,YAAY,CAAC,cAAc,CAAC,KAAK,CAAC,IAAP,CAAf,EAA6B,KAAK,CAAC,QAAN,CAAe,SAA5C,CAAvC;AACD;;AAED,EAAA,eAAe,CAAC,KAAD,CAAf;AAEA,SAAO,KAAP;AACD,CATM","sourceRoot":""}
1
+ {"version":3,"sources":["components/MenuButton/useMenuButtonStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,kBAAyC,gBAAzC;AAEA,SAAS,wBAAT,QAAyC,2BAAzC;AAGA,OAAO,MAAM,mBAAmB,GAAG,gBAA5B;;AAEP,MAAM,iBAAiB,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAA1B;;AAmBA,OAAO,MAAM,4BAA4B,GAAI,KAAD,IAA4C;AACtF,QAAM,cAAc,GAAG,iBAAiB,EAAxC;AAEA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,mBAAD,EAAsB,KAAK,CAAC,IAAN,CAAW,SAAjC,CAAnC;;AAEA,MAAI,KAAK,CAAC,QAAV,EAAoB;AAClB,IAAA,KAAK,CAAC,QAAN,CAAe,SAAf,GAA2B,YAAY,CAAC,cAAc,CAAC,KAAK,CAAC,IAAP,CAAf,EAA6B,KAAK,CAAC,QAAN,CAAe,SAA5C,CAAvC;AACD;;AAED,EAAA,wBAAwB,CAAC,KAAD,CAAxB;AAEA,SAAO,KAAP;AACD,CAZM","sourcesContent":["import { mergeClasses, makeStyles } from '@griffel/react';\nimport { ButtonState } from '../Button/Button.types';\nimport { useButtonStyles_unstable } from '../Button/useButtonStyles';\nimport type { MenuButtonState } from './MenuButton.types';\n\nexport const menuButtonClassName = 'fui-MenuButton';\n\nconst useMenuIconStyles = makeStyles({\n // Size appearance\n small: {\n fontSize: '20px',\n height: '20px',\n width: '20px',\n },\n medium: {\n fontSize: '20px',\n height: '20px',\n width: '20px',\n },\n large: {\n fontSize: '24px',\n height: '24px',\n width: '24px',\n },\n});\n\nexport const useMenuButtonStyles_unstable = (state: MenuButtonState): MenuButtonState => {\n const menuIconStyles = useMenuIconStyles();\n\n state.root.className = mergeClasses(menuButtonClassName, state.root.className);\n\n if (state.menuIcon) {\n state.menuIcon.className = mergeClasses(menuIconStyles[state.size], state.menuIcon.className);\n }\n\n useButtonStyles_unstable(state as ButtonState);\n\n return state;\n};\n"],"sourceRoot":"../src/"}