@fluentui/react-button 9.0.0-alpha.84 → 9.0.0-alpha.88

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. package/CHANGELOG.json +87 -1
  2. package/CHANGELOG.md +41 -2
  3. package/dist/react-button.d.ts +73 -7
  4. package/lib/SplitButton.d.ts +1 -0
  5. package/lib/SplitButton.js +2 -0
  6. package/lib/SplitButton.js.map +1 -0
  7. package/lib/components/Button/renderButton.js.map +1 -1
  8. package/lib/components/Button/useButton.d.ts +3 -1
  9. package/lib/components/Button/useButton.js +3 -1
  10. package/lib/components/Button/useButton.js.map +1 -1
  11. package/lib/components/Button/useButtonState.d.ts +2 -2
  12. package/lib/components/Button/useButtonState.js +2 -2
  13. package/lib/components/Button/useButtonState.js.map +1 -1
  14. package/lib/components/Button/useButtonStyles.js.map +1 -1
  15. package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
  16. package/lib/components/CompoundButton/useCompoundButton.d.ts +3 -1
  17. package/lib/components/CompoundButton/useCompoundButton.js +3 -1
  18. package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
  19. package/lib/components/CompoundButton/useCompoundButtonStyles.js +1 -1
  20. package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  21. package/lib/components/MenuButton/MenuButton.types.d.ts +1 -1
  22. package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
  23. package/lib/components/MenuButton/renderMenuButton.js +2 -1
  24. package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
  25. package/lib/components/MenuButton/useMenuButton.d.ts +3 -1
  26. package/lib/components/MenuButton/useMenuButton.js +3 -3
  27. package/lib/components/MenuButton/useMenuButton.js.map +1 -1
  28. package/lib/components/MenuButton/useMenuButtonState.d.ts +5 -0
  29. package/lib/components/MenuButton/useMenuButtonState.js +9 -1
  30. package/lib/components/MenuButton/useMenuButtonState.js.map +1 -1
  31. package/lib/components/MenuButton/useMenuButtonStyles.js +1 -1
  32. package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  33. package/lib/components/SplitButton/SplitButton.d.ts +7 -0
  34. package/lib/components/SplitButton/SplitButton.js +25 -0
  35. package/lib/components/SplitButton/SplitButton.js.map +1 -0
  36. package/lib/components/SplitButton/SplitButton.types.d.ts +30 -0
  37. package/lib/components/SplitButton/SplitButton.types.js +2 -0
  38. package/lib/components/SplitButton/SplitButton.types.js.map +1 -0
  39. package/lib/components/SplitButton/index.d.ts +5 -0
  40. package/lib/components/SplitButton/index.js +6 -0
  41. package/lib/components/SplitButton/index.js.map +1 -0
  42. package/lib/components/SplitButton/renderSplitButton.d.ts +5 -0
  43. package/lib/components/SplitButton/renderSplitButton.js +16 -0
  44. package/lib/components/SplitButton/renderSplitButton.js.map +1 -0
  45. package/lib/components/SplitButton/useSplitButton.d.ts +9 -0
  46. package/lib/components/SplitButton/useSplitButton.js +72 -0
  47. package/lib/components/SplitButton/useSplitButton.js.map +1 -0
  48. package/lib/components/SplitButton/useSplitButtonStyles.d.ts +2 -0
  49. package/lib/components/SplitButton/useSplitButtonStyles.js +61 -0
  50. package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -0
  51. package/lib/components/ToggleButton/useToggleButton.d.ts +4 -1
  52. package/lib/components/ToggleButton/useToggleButton.js +4 -1
  53. package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
  54. package/lib/components/ToggleButton/useToggleButtonStyles.js +1 -1
  55. package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  56. package/lib/index.d.ts +1 -0
  57. package/lib/index.js +1 -0
  58. package/lib/index.js.map +1 -1
  59. package/lib-amd/SplitButton.d.ts +1 -0
  60. package/lib-amd/SplitButton.js +6 -0
  61. package/lib-amd/SplitButton.js.map +1 -0
  62. package/lib-amd/components/Button/renderButton.js.map +1 -1
  63. package/lib-amd/components/Button/useButton.d.ts +3 -1
  64. package/lib-amd/components/Button/useButton.js +3 -1
  65. package/lib-amd/components/Button/useButton.js.map +1 -1
  66. package/lib-amd/components/Button/useButtonState.d.ts +2 -2
  67. package/lib-amd/components/Button/useButtonState.js +2 -2
  68. package/lib-amd/components/Button/useButtonState.js.map +1 -1
  69. package/lib-amd/components/Button/useButtonStyles.js +1 -0
  70. package/lib-amd/components/Button/useButtonStyles.js.map +1 -1
  71. package/lib-amd/components/CompoundButton/renderCompoundButton.js.map +1 -1
  72. package/lib-amd/components/CompoundButton/useCompoundButton.d.ts +3 -1
  73. package/lib-amd/components/CompoundButton/useCompoundButton.js +3 -1
  74. package/lib-amd/components/CompoundButton/useCompoundButton.js.map +1 -1
  75. package/lib-amd/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  76. package/lib-amd/components/MenuButton/MenuButton.types.d.ts +1 -1
  77. package/lib-amd/components/MenuButton/MenuButton.types.js.map +1 -1
  78. package/lib-amd/components/MenuButton/renderMenuButton.js +2 -2
  79. package/lib-amd/components/MenuButton/renderMenuButton.js.map +1 -1
  80. package/lib-amd/components/MenuButton/useMenuButton.d.ts +3 -1
  81. package/lib-amd/components/MenuButton/useMenuButton.js +3 -3
  82. package/lib-amd/components/MenuButton/useMenuButton.js.map +1 -1
  83. package/lib-amd/components/MenuButton/useMenuButtonState.d.ts +5 -0
  84. package/lib-amd/components/MenuButton/useMenuButtonState.js +7 -1
  85. package/lib-amd/components/MenuButton/useMenuButtonState.js.map +1 -1
  86. package/lib-amd/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  87. package/lib-amd/components/SplitButton/SplitButton.d.ts +7 -0
  88. package/lib-amd/components/SplitButton/SplitButton.js +19 -0
  89. package/lib-amd/components/SplitButton/SplitButton.js.map +1 -0
  90. package/lib-amd/components/SplitButton/SplitButton.types.d.ts +30 -0
  91. package/lib-amd/components/SplitButton/SplitButton.types.js +5 -0
  92. package/lib-amd/components/SplitButton/SplitButton.types.js.map +1 -0
  93. package/lib-amd/components/SplitButton/index.d.ts +5 -0
  94. package/lib-amd/components/SplitButton/index.js +11 -0
  95. package/lib-amd/components/SplitButton/index.js.map +1 -0
  96. package/lib-amd/components/SplitButton/renderSplitButton.d.ts +5 -0
  97. package/lib-amd/components/SplitButton/renderSplitButton.js +16 -0
  98. package/lib-amd/components/SplitButton/renderSplitButton.js.map +1 -0
  99. package/lib-amd/components/SplitButton/useSplitButton.d.ts +9 -0
  100. package/lib-amd/components/SplitButton/useSplitButton.js +55 -0
  101. package/lib-amd/components/SplitButton/useSplitButton.js.map +1 -0
  102. package/lib-amd/components/SplitButton/useSplitButtonStyles.d.ts +2 -0
  103. package/lib-amd/components/SplitButton/useSplitButtonStyles.js +123 -0
  104. package/lib-amd/components/SplitButton/useSplitButtonStyles.js.map +1 -0
  105. package/lib-amd/components/ToggleButton/useToggleButton.d.ts +4 -1
  106. package/lib-amd/components/ToggleButton/useToggleButton.js +4 -1
  107. package/lib-amd/components/ToggleButton/useToggleButton.js.map +1 -1
  108. package/lib-amd/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  109. package/lib-amd/index.d.ts +1 -0
  110. package/lib-amd/index.js +2 -1
  111. package/lib-amd/index.js.map +1 -1
  112. package/lib-commonjs/SplitButton.d.ts +1 -0
  113. package/lib-commonjs/SplitButton.js +10 -0
  114. package/lib-commonjs/SplitButton.js.map +1 -0
  115. package/lib-commonjs/components/Button/renderButton.js.map +1 -1
  116. package/lib-commonjs/components/Button/useButton.d.ts +3 -1
  117. package/lib-commonjs/components/Button/useButton.js +3 -1
  118. package/lib-commonjs/components/Button/useButton.js.map +1 -1
  119. package/lib-commonjs/components/Button/useButtonState.d.ts +2 -2
  120. package/lib-commonjs/components/Button/useButtonState.js +2 -2
  121. package/lib-commonjs/components/Button/useButtonState.js.map +1 -1
  122. package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
  123. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
  124. package/lib-commonjs/components/CompoundButton/useCompoundButton.d.ts +3 -1
  125. package/lib-commonjs/components/CompoundButton/useCompoundButton.js +3 -1
  126. package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
  127. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  128. package/lib-commonjs/components/MenuButton/MenuButton.types.d.ts +1 -1
  129. package/lib-commonjs/components/MenuButton/renderMenuButton.js +2 -1
  130. package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
  131. package/lib-commonjs/components/MenuButton/useMenuButton.d.ts +3 -1
  132. package/lib-commonjs/components/MenuButton/useMenuButton.js +3 -3
  133. package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
  134. package/lib-commonjs/components/MenuButton/useMenuButtonState.d.ts +5 -0
  135. package/lib-commonjs/components/MenuButton/useMenuButtonState.js +9 -1
  136. package/lib-commonjs/components/MenuButton/useMenuButtonState.js.map +1 -1
  137. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  138. package/lib-commonjs/components/SplitButton/SplitButton.d.ts +7 -0
  139. package/lib-commonjs/components/SplitButton/SplitButton.js +38 -0
  140. package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -0
  141. package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +30 -0
  142. package/lib-commonjs/components/SplitButton/SplitButton.types.js +6 -0
  143. package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -0
  144. package/lib-commonjs/components/SplitButton/index.d.ts +5 -0
  145. package/lib-commonjs/components/SplitButton/index.js +26 -0
  146. package/lib-commonjs/components/SplitButton/index.js.map +1 -0
  147. package/lib-commonjs/components/SplitButton/renderSplitButton.d.ts +5 -0
  148. package/lib-commonjs/components/SplitButton/renderSplitButton.js +29 -0
  149. package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -0
  150. package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +9 -0
  151. package/lib-commonjs/components/SplitButton/useSplitButton.js +83 -0
  152. package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -0
  153. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +2 -0
  154. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +71 -0
  155. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -0
  156. package/lib-commonjs/components/ToggleButton/useToggleButton.d.ts +4 -1
  157. package/lib-commonjs/components/ToggleButton/useToggleButton.js +4 -1
  158. package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
  159. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  160. package/lib-commonjs/index.d.ts +1 -0
  161. package/lib-commonjs/index.js +2 -0
  162. package/lib-commonjs/index.js.map +1 -1
  163. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"useButtonState.js","sourceRoot":"../src/","sources":["components/Button/useButtonState.ts"],"names":[],"mappings":";;;;IAIA;;;OAGG;IACI,IAAM,cAAc,GAAG,UAAC,KAAkB;QACvC,IAAA,EAAE,GAAyF,KAAK,GAA9F,EAAE,QAAQ,GAA+E,KAAK,SAApF,EAAE,QAAQ,GAAqE,KAAK,SAA1E,EAAE,iBAAiB,GAAkD,KAAK,kBAAvD,EAAE,IAAI,GAA4C,KAAK,KAAjD,EAAE,OAAO,GAAmC,KAAK,QAAxC,EAAa,iBAAiB,GAAK,KAAK,UAAV,CAAW;QAEzG,IAAM,gBAAgB,GAAG,CAAC,CAAC,QAAQ,CAAC;QACpC,IAAM,YAAY,GAAG,CAAC,EAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,CAAA,CAAC;QACtC,KAAK,CAAC,QAAQ,GAAG,YAAY,IAAI,CAAC,gBAAgB,CAAC;QAEnD,IAAM,0BAA0B,GAAG,UAAC,EAAoC;YACtE,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAG,EAAE,EAAE;YAExB,IAAM,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC;YACnB,IAAI,CAAC,EAAE,CAAC,gBAAgB,IAAI,OAAO,IAAI,CAAC,GAAG,KAAK,qBAAK,IAAI,GAAG,KAAK,qBAAK,CAAC,EAAE;gBACvE,gDA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CAAC,EAAE;gBACvE,EAAE,CAAC,cAAc,EAAE,CAAC;gBACpB,EAAE,CAAC,eAAe,EAAE,CAAC;aACtB;iBAAM;gBACL,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAG,EAAE,EAAE;aACjB;QACH,CAAC,CAAC;QAEF,sDAAsD;QACtD,KAAK,CAAC,QAAQ,GAAG,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9E,KAAK,CAAC,eAAe,CAAC,GAAG,QAAQ,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QAErD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAlEW,QAAA,cAAc,kBAkEzB","sourcesContent":["import * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\nimport type { ButtonState } from './Button.types';\n\n/**\n * The useButton hook processes the Button draft state.\n * @param state - Button draft state to mutate.\n */\nexport const useButtonState = (state: ButtonState): ButtonState => {\n const { as, children, disabled, disabledFocusable, icon, onClick, onKeyDown: onKeyDownCallback } = state;\n\n const receivedChildren = !!children;\n const receivedIcon = !!icon?.children;\n state.iconOnly = receivedIcon && !receivedChildren;\n\n const onNonAnchorOrButtonKeyDown = (ev: React.KeyboardEvent<HTMLElement>) => {\n onKeyDownCallback?.(ev);\n\n const key = ev.key;\n if (!ev.defaultPrevented && onClick && (key === Enter || key === Space)) {\n // Translate the keydown enter/space to a click.\n ev.preventDefault();\n ev.stopPropagation();\n\n onClick((ev as unknown) as React.MouseEvent<HTMLAnchorElement | HTMLButtonElement | HTMLElement>);\n }\n };\n\n // Adjust props depending on the root type.\n if (typeof as === 'string') {\n // Add 'role=button' and 'tabIndex=0' for all non-button elements.\n if (as !== 'button') {\n state.role = 'button';\n state.tabIndex = disabled && !disabledFocusable ? undefined : 0;\n\n // Add keydown event handler for all other non-anchor elements.\n if (as !== 'a') {\n state.onKeyDown = onNonAnchorOrButtonKeyDown;\n }\n }\n }\n // Add keydown event handler, 'role=button' and 'tabIndex=0' for all other elements.\n else {\n state.onKeyDown = onNonAnchorOrButtonKeyDown;\n state.role = 'button';\n state.tabIndex = disabled && !disabledFocusable ? undefined : 0;\n }\n\n // Disallow click event when component is disabled and eat events when disabledFocusable is set to true.\n state.onClick = (ev: React.MouseEvent<HTMLElement>) => {\n if (disabled || disabledFocusable) {\n ev.preventDefault();\n } else {\n onClick?.(ev);\n }\n };\n\n // Disallow keydown event when component is disabled and eat events when disabledFocusable is set to true.\n const { onKeyDown } = state;\n state.onKeyDown = (ev: React.KeyboardEvent<HTMLElement>) => {\n const key = ev.key;\n if ((disabled || disabledFocusable) && (key === Enter || key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n } else {\n onKeyDown?.(ev);\n }\n };\n\n // Set the aria-disabled and disabled props correctly.\n state.disabled = as === 'button' ? disabled && !disabledFocusable : undefined;\n state['aria-disabled'] = disabled && !state.disabled;\n\n return state;\n};\n"]}
1
+ {"version":3,"file":"useButtonState.js","sourceRoot":"../src/","sources":["components/Button/useButtonState.ts"],"names":[],"mappings":";;;;IAIA;;;OAGG;IACI,IAAM,cAAc,GAAG,UAAC,KAAkB;QACvC,IAAA,EAAE,GAAyF,KAAK,GAA9F,EAAE,QAAQ,GAA+E,KAAK,SAApF,EAAE,QAAQ,GAAqE,KAAK,SAA1E,EAAE,iBAAiB,GAAkD,KAAK,kBAAvD,EAAE,IAAI,GAA4C,KAAK,KAAjD,EAAE,OAAO,GAAmC,KAAK,QAAxC,EAAa,iBAAiB,GAAK,KAAK,UAAV,CAAW;QAEzG,IAAM,gBAAgB,GAAG,CAAC,CAAC,QAAQ,CAAC;QACpC,IAAM,YAAY,GAAG,CAAC,EAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,CAAA,CAAC;QACtC,KAAK,CAAC,QAAQ,GAAG,YAAY,IAAI,CAAC,gBAAgB,CAAC;QAEnD,IAAM,0BAA0B,GAAG,UAAC,E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EF,0GAA0G;QAClG,IAAA,SAAS,GAAK,KAAK,UAAV,CAAW;QAC5B,KAAK,CAAC,SAAS,GAAG,UAAC,EAAoC;YACrD,IAAM,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC;YACnB,IAAI,CAAC,QAAQ,IAAI,iBAAiB,CAAC,IAAI,CAAC,GAAG,KAAK,qBAAK,IAAI,GAAG,KAAK,qBAAK,CAAC,EAAE;gBACvE,EAAE,CAAC,cAAc,EAAE,CAAC;gBACpB,EAAE,CAAC,eAAe,EAAE,CAAC;aACtB;iBAAM;gBACL,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAG,EAAE,EAAE;aACjB;QACH,CAAC,CAAC;QAEF,sDAAsD;QACtD,KAAK,CAAC,QAAQ,GAAG,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9E,KAAK,CAAC,eAAe,CAAC,GAAG,QAAQ,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QAErD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAlEW,QAAA,cAAc,kBAkEzB","sourcesContent":["import * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\nimport type { ButtonState } from './Button.types';\n\n/**\n * The useButton hook processes the Button state.\n * @param state - Button state to mutate.\n */\nexport const useButtonState = (state: ButtonState): ButtonState => {\n const { as, children, disabled, disabledFocusable, icon, onClick, onKeyDown: onKeyDownCallback } = state;\n\n const receivedChildren = !!children;\n const receivedIcon = !!icon?.children;\n state.iconOnly = receivedIcon && !receivedChildren;\n\n const onNonAnchorOrButtonKeyDown = (ev: React.KeyboardEvent<HTMLElement>) => {\n onKeyDownCallback?.(ev);\n\n const key = ev.key;\n if (!ev.defaultPrevented && onClick && (key === Enter || key === Space)) {\n // Translate the keydown enter/space to a click.\n ev.preventDefault();\n ev.stopPropagation();\n\n onClick((ev as unknown) as React.MouseEvent<HTMLAnchorElement | HTMLButtonElement | HTMLElement>);\n }\n };\n\n // Adjust props depending on the root type.\n if (typeof as === 'string') {\n // Add 'role=button' and 'tabIndex=0' for all non-button elements.\n if (as !== 'button') {\n state.role = 'button';\n state.tabIndex = disabled && !disabledFocusable ? undefined : 0;\n\n // Add keydown event handler for all other non-anchor elements.\n if (as !== 'a') {\n state.onKeyDown = onNonAnchorOrButtonKeyDown;\n }\n }\n }\n // Add keydown event handler, 'role=button' and 'tabIndex=0' for all other elements.\n else {\n state.onKeyDown = onNonAnchorOrButtonKeyDown;\n state.role = 'button';\n state.tabIndex = disabled && !disabledFocusable ? undefined : 0;\n }\n\n // Disallow click event when component is disabled and eat events when disabledFocusable is set to true.\n state.onClick = (ev: React.MouseEvent<HTMLElement>) => {\n if (disabled || disabledFocusable) {\n ev.preventDefault();\n } else {\n onClick?.(ev);\n }\n };\n\n // Disallow keydown event when component is disabled and eat events when disabledFocusable is set to true.\n const { onKeyDown } = state;\n state.onKeyDown = (ev: React.KeyboardEvent<HTMLElement>) => {\n const key = ev.key;\n if ((disabled || disabledFocusable) && (key === Enter || key === Space)) {\n ev.preventDefault();\n ev.stopPropagation();\n } else {\n onKeyDown?.(ev);\n }\n };\n\n // Set the aria-disabled and disabled props correctly.\n state.disabled = as === 'button' ? disabled && !disabledFocusable : undefined;\n state['aria-disabled'] = disabled && !state.disabled;\n\n return state;\n};\n"]}
@@ -202,6 +202,7 @@ define(["require", "exports", "@fluentui/react-make-styles", "@fluentui/react-ta
202
202
  base: react_tabster_1.createFocusIndicatorStyleRule(function (theme) { return ({
203
203
  borderColor: 'transparent',
204
204
  boxShadow: "\n " + theme.alias.shadow.shadow4 + ",\n 0 0 0 2px " + theme.alias.color.neutral.strokeFocus2 + "\n ",
205
+ zIndex: 1,
205
206
  }); }),
206
207
  circular: react_tabster_1.createFocusIndicatorStyleRule(function (theme) { return ({
207
208
  borderRadius: theme.global.borderRadius.circular,
@@ -1 +1 @@
1
- {"version":3,"file":"useButtonStyles.js","sourceRoot":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I,KAAK,CAAC,iBAAiB,CAAC,IAAI,UAAU,CAAC,QAAQ,EAClE,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,OAAO,IAAI,UAAU,CAAC,eAAe,EAC1F,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,OAAO,IAAI,UAAU,CAAC,eAAe,EAC1F,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,UAAU,CAAC,cAAc,EACxF,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,WAAW,IAAI,UAAU,CAAC,mBAAmB,EAClG,KAAK,CAAC,QAAQ,IAAI,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,EAChD,KAAK,CAAC,SAAS,CAChB,CAAC;QAEF,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,gCAAY,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAEnG,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IA9BW,QAAA,eAAe,mBA8B1B","sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';\nimport { createFocusIndicatorStyleRule } from '@fluentui/react-tabster';\nimport type { ButtonState } from './Button.types';\n\n// TODO: These are named in design specs but not hoisted to global/alias yet.\n// We're tracking these here to determine how we can hoist them.\nexport const buttonSpacing = {\n smallest: '2px',\n smaller: '4px',\n small: '6px',\n medium: '8px',\n large: '12px',\n larger: '16px',\n};\n\nconst useRootStyles = makeStyles({\n base: theme => ({\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n verticalAlign: 'middle',\n\n margin: 0,\n\n maxWidth: '280px',\n\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n\n background: theme.alias.color.neutral.neutralBackground1,\n color: theme.alias.color.neutral.neutralForeground1,\n\n borderColor: theme.alias.color.neutral.neutralStroke1,\n borderStyle: 'solid',\n borderWidth: theme.global.strokeWidth.thin,\n\n fontFamily: theme.global.type.fontFamilies.base,\n\n outline: 'none',\n\n ':hover': {\n background: theme.alias.color.neutral.neutralBackground1Hover,\n borderColor: theme.alias.color.neutral.neutralStroke1Hover,\n color: theme.alias.color.neutral.neutralForeground1,\n\n cursor: 'pointer',\n },\n\n ':active': {\n background: theme.alias.color.neutral.neutralBackground1Pressed,\n borderColor: theme.alias.color.neutral.neutralStroke1Pressed,\n color: theme.alias.color.neutral.neutralForeground1,\n\n outline: 'none',\n },\n }),\n small: theme => ({\n // TODO: remove unsafe property: https://caniuse.com/?search=gap\n gap: buttonSpacing.smaller,\n padding: `0 ${buttonSpacing.medium}`,\n\n height: '24px',\n minWidth: '64px',\n\n borderRadius: theme.global.borderRadius.small,\n\n fontSize: theme.global.type.fontSizes.base[200],\n fontWeight: theme.global.type.fontWeights.regular,\n lineHeight: theme.global.type.lineHeights.base[200],\n }),\n medium: theme => ({\n // TODO: remove unsafe property: https://caniuse.com/?search=gap\n gap: buttonSpacing.small,\n padding: `0 ${buttonSpacing.large}`,\n\n height: '32px',\n minWidth: '96px',\n\n borderRadius: theme.global.borderRadius.medium,\n\n fontSize: theme.global.type.fontSizes.base[300],\n fontWeight: theme.global.type.fontWeights.semibold,\n lineHeight: theme.global.type.lineHeights.base[300],\n }),\n large: theme => ({\n // TODO: remove unsafe property: https://caniuse.com/?search=gap\n gap: buttonSpacing.small,\n padding: `0 ${buttonSpacing.larger}`,\n\n height: '40px',\n minWidth: '96px',\n\n borderRadius: theme.global.borderRadius.medium,\n\n fontSize: theme.global.type.fontSizes.base[400],\n fontWeight: theme.global.type.fontWeights.semibold,\n lineHeight: theme.global.type.lineHeights.base[400],\n }),\n block: {\n maxWidth: '100%',\n width: '100%',\n },\n circular: theme => ({\n borderRadius: theme.global.borderRadius.circular,\n }),\n outline: theme => ({\n background: theme.alias.color.neutral.transparentBackground,\n\n ':hover': {\n background: theme.alias.color.neutral.transparentBackgroundHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.transparentBackgroundPressed,\n },\n }),\n primary: theme => ({\n background: theme.alias.color.neutral.brandBackground,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n\n ':hover': {\n background: theme.alias.color.neutral.brandBackgroundHover,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n\n ':active': {\n background: theme.alias.color.neutral.brandBackgroundPressed,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n }),\n subtle: theme => ({\n background: theme.alias.color.neutral.subtleBackground,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2,\n\n ':hover': {\n background: theme.alias.color.neutral.subtleBackgroundHover,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.subtleBackgroundPressed,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandPressed,\n },\n }),\n transparent: theme => ({\n background: theme.alias.color.neutral.transparentBackground,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2,\n\n ':hover': {\n background: theme.alias.color.neutral.transparentBackgroundHover,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.transparentBackgroundPressed,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandPressed,\n },\n }),\n disabled: theme => ({\n background: theme.alias.color.neutral.neutralBackgroundDisabled,\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n\n cursor: 'not-allowed',\n\n ':hover': {\n background: theme.alias.color.neutral.neutralBackgroundDisabled,\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n\n cursor: 'not-allowed',\n },\n\n ':active': {\n background: theme.alias.color.neutral.neutralBackgroundDisabled,\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n\n cursor: 'not-allowed',\n },\n }),\n disabledOutline: theme => ({\n background: theme.alias.color.neutral.transparentBackground,\n\n ':hover': {\n background: theme.alias.color.neutral.transparentBackgroundHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.transparentBackgroundPressed,\n },\n }),\n disabledPrimary: {\n borderColor: 'transparent',\n\n ':hover': {\n borderColor: 'transparent',\n },\n\n ':active': {\n borderColor: 'transparent',\n },\n },\n disabledSubtle: {\n background: 'none',\n borderColor: 'transparent',\n\n ':hover': {\n background: 'none',\n borderColor: 'transparent',\n },\n\n ':active': {\n background: 'none',\n borderColor: 'transparent',\n },\n },\n disabledTransparent: {\n background: 'none',\n borderColor: 'transparent',\n\n ':hover': {\n background: 'none',\n borderColor: 'transparent',\n },\n\n ':active': {\n background: 'none',\n borderColor: 'transparent',\n },\n },\n});\n\nconst useRootFocusStyles = makeStyles({\n base: createFocusIndicatorStyleRule(theme => ({\n borderColor: 'transparent',\n boxShadow: `\n ${theme.alias.shadow.shadow4},\n 0 0 0 2px ${theme.alias.color.neutral.strokeFocus2}\n `,\n })),\n circular: createFocusIndicatorStyleRule(theme => ({\n borderRadius: theme.global.borderRadius.circular,\n })),\n primary: createFocusIndicatorStyleRule(theme => ({\n borderColor: theme.alias.color.neutral.neutralForegroundOnBrand,\n boxShadow: `${theme.alias.shadow.shadow2}, 0 0 0 2px ${theme.alias.color.neutral.strokeFocus2}`,\n })),\n});\n\nconst useRootIconOnlyStyles = makeStyles({\n small: {\n padding: buttonSpacing.smaller,\n\n minWidth: '28px',\n maxWidth: '28px',\n },\n medium: {\n padding: buttonSpacing.smaller,\n\n minWidth: '32px',\n maxWidth: '32px',\n },\n large: {\n padding: buttonSpacing.small,\n\n minWidth: '40px',\n maxWidth: '40px',\n },\n});\n\nconst useIconStyles = makeStyles({\n base: {\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n },\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 useButtonStyles = (state: ButtonState): ButtonState => {\n const rootStyles = useRootStyles();\n const rootFocusStyles = useRootFocusStyles();\n const rootIconOnlyStyles = useRootIconOnlyStyles();\n const iconStyles = useIconStyles();\n\n state.className = mergeClasses(\n rootStyles.base,\n rootFocusStyles.base,\n rootStyles[state.size],\n state.block && rootStyles.block,\n state.circular && rootStyles.circular,\n state.circular && rootFocusStyles.circular,\n state.outline && rootStyles.outline,\n state.primary && rootStyles.primary,\n state.primary && rootFocusStyles.primary,\n state.subtle && rootStyles.subtle,\n state.transparent && rootStyles.transparent,\n (state.disabled || state.disabledFocusable) && rootStyles.disabled,\n (state.disabled || state.disabledFocusable) && state.outline && rootStyles.disabledOutline,\n (state.disabled || state.disabledFocusable) && state.primary && rootStyles.disabledPrimary,\n (state.disabled || state.disabledFocusable) && state.subtle && rootStyles.disabledSubtle,\n (state.disabled || state.disabledFocusable) && state.transparent && rootStyles.disabledTransparent,\n state.iconOnly && rootIconOnlyStyles[state.size],\n state.className,\n );\n\n state.icon.className = mergeClasses(iconStyles.base, iconStyles[state.size], state.icon.className);\n\n return state;\n};\n"]}
1
+ {"version":3,"file":"useButtonStyles.js","sourceRoot":"../src/","sources":["components/Button/useButtonStyles.ts"],"names":[],"mappings":";;;;IAIA,6EAA6E;IAC7E,sEAAsE;IACzD,QAAA,aAAa,GAAG;QAC3B,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,KAA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CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,OAAO,IAAI,UAAU,CAAC,eAAe,EAC1F,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,UAAU,CAAC,cAAc,EACxF,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,WAAW,IAAI,UAAU,CAAC,mBAAmB,EAClG,KAAK,CAAC,QAAQ,IAAI,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,EAChD,KAAK,CAAC,SAAS,CAChB,CAAC;QAEF,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,gCAAY,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAEnG,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IA9BW,QAAA,eAAe,mBA8B1B","sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';\nimport { createFocusIndicatorStyleRule } from '@fluentui/react-tabster';\nimport type { ButtonState } from './Button.types';\n\n// TODO: These are named in design specs but not hoisted to global/alias yet.\n// We're tracking these here to determine how we can hoist them.\nexport const buttonSpacing = {\n smallest: '2px',\n smaller: '4px',\n small: '6px',\n medium: '8px',\n large: '12px',\n larger: '16px',\n};\n\nconst useRootStyles = makeStyles({\n base: theme => ({\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n verticalAlign: 'middle',\n\n margin: 0,\n\n maxWidth: '280px',\n\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n\n background: theme.alias.color.neutral.neutralBackground1,\n color: theme.alias.color.neutral.neutralForeground1,\n\n borderColor: theme.alias.color.neutral.neutralStroke1,\n borderStyle: 'solid',\n borderWidth: theme.global.strokeWidth.thin,\n\n fontFamily: theme.global.type.fontFamilies.base,\n\n outline: 'none',\n\n ':hover': {\n background: theme.alias.color.neutral.neutralBackground1Hover,\n borderColor: theme.alias.color.neutral.neutralStroke1Hover,\n color: theme.alias.color.neutral.neutralForeground1,\n\n cursor: 'pointer',\n },\n\n ':active': {\n background: theme.alias.color.neutral.neutralBackground1Pressed,\n borderColor: theme.alias.color.neutral.neutralStroke1Pressed,\n color: theme.alias.color.neutral.neutralForeground1,\n\n outline: 'none',\n },\n }),\n small: theme => ({\n // TODO: remove unsafe property: https://caniuse.com/?search=gap\n gap: buttonSpacing.smaller,\n padding: `0 ${buttonSpacing.medium}`,\n\n height: '24px',\n minWidth: '64px',\n\n borderRadius: theme.global.borderRadius.small,\n\n fontSize: theme.global.type.fontSizes.base[200],\n fontWeight: theme.global.type.fontWeights.regular,\n lineHeight: theme.global.type.lineHeights.base[200],\n }),\n medium: theme => ({\n // TODO: remove unsafe property: https://caniuse.com/?search=gap\n gap: buttonSpacing.small,\n padding: `0 ${buttonSpacing.large}`,\n\n height: '32px',\n minWidth: '96px',\n\n borderRadius: theme.global.borderRadius.medium,\n\n fontSize: theme.global.type.fontSizes.base[300],\n fontWeight: theme.global.type.fontWeights.semibold,\n lineHeight: theme.global.type.lineHeights.base[300],\n }),\n large: theme => ({\n // TODO: remove unsafe property: https://caniuse.com/?search=gap\n gap: buttonSpacing.small,\n padding: `0 ${buttonSpacing.larger}`,\n\n height: '40px',\n minWidth: '96px',\n\n borderRadius: theme.global.borderRadius.medium,\n\n fontSize: theme.global.type.fontSizes.base[400],\n fontWeight: theme.global.type.fontWeights.semibold,\n lineHeight: theme.global.type.lineHeights.base[400],\n }),\n block: {\n maxWidth: '100%',\n width: '100%',\n },\n circular: theme => ({\n borderRadius: theme.global.borderRadius.circular,\n }),\n outline: theme => ({\n background: theme.alias.color.neutral.transparentBackground,\n\n ':hover': {\n background: theme.alias.color.neutral.transparentBackgroundHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.transparentBackgroundPressed,\n },\n }),\n primary: theme => ({\n background: theme.alias.color.neutral.brandBackground,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n\n ':hover': {\n background: theme.alias.color.neutral.brandBackgroundHover,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n\n ':active': {\n background: theme.alias.color.neutral.brandBackgroundPressed,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n }),\n subtle: theme => ({\n background: theme.alias.color.neutral.subtleBackground,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2,\n\n ':hover': {\n background: theme.alias.color.neutral.subtleBackgroundHover,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.subtleBackgroundPressed,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandPressed,\n },\n }),\n transparent: theme => ({\n background: theme.alias.color.neutral.transparentBackground,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2,\n\n ':hover': {\n background: theme.alias.color.neutral.transparentBackgroundHover,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.transparentBackgroundPressed,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandPressed,\n },\n }),\n disabled: theme => ({\n background: theme.alias.color.neutral.neutralBackgroundDisabled,\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n\n cursor: 'not-allowed',\n\n ':hover': {\n background: theme.alias.color.neutral.neutralBackgroundDisabled,\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n\n cursor: 'not-allowed',\n },\n\n ':active': {\n background: theme.alias.color.neutral.neutralBackgroundDisabled,\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n\n cursor: 'not-allowed',\n },\n }),\n disabledOutline: theme => ({\n background: theme.alias.color.neutral.transparentBackground,\n\n ':hover': {\n background: theme.alias.color.neutral.transparentBackgroundHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.transparentBackgroundPressed,\n },\n }),\n disabledPrimary: {\n borderColor: 'transparent',\n\n ':hover': {\n borderColor: 'transparent',\n },\n\n ':active': {\n borderColor: 'transparent',\n },\n },\n disabledSubtle: {\n background: 'none',\n borderColor: 'transparent',\n\n ':hover': {\n background: 'none',\n borderColor: 'transparent',\n },\n\n ':active': {\n background: 'none',\n borderColor: 'transparent',\n },\n },\n disabledTransparent: {\n background: 'none',\n borderColor: 'transparent',\n\n ':hover': {\n background: 'none',\n borderColor: 'transparent',\n },\n\n ':active': {\n background: 'none',\n borderColor: 'transparent',\n },\n },\n});\n\nconst useRootFocusStyles = makeStyles({\n base: createFocusIndicatorStyleRule(theme => ({\n borderColor: 'transparent',\n boxShadow: `\n ${theme.alias.shadow.shadow4},\n 0 0 0 2px ${theme.alias.color.neutral.strokeFocus2}\n `,\n zIndex: 1,\n })),\n circular: createFocusIndicatorStyleRule(theme => ({\n borderRadius: theme.global.borderRadius.circular,\n })),\n primary: createFocusIndicatorStyleRule(theme => ({\n borderColor: theme.alias.color.neutral.neutralForegroundOnBrand,\n boxShadow: `${theme.alias.shadow.shadow2}, 0 0 0 2px ${theme.alias.color.neutral.strokeFocus2}`,\n })),\n});\n\nconst useRootIconOnlyStyles = makeStyles({\n small: {\n padding: buttonSpacing.smaller,\n\n minWidth: '28px',\n maxWidth: '28px',\n },\n medium: {\n padding: buttonSpacing.smaller,\n\n minWidth: '32px',\n maxWidth: '32px',\n },\n large: {\n padding: buttonSpacing.small,\n\n minWidth: '40px',\n maxWidth: '40px',\n },\n});\n\nconst useIconStyles = makeStyles({\n base: {\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n },\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 useButtonStyles = (state: ButtonState): ButtonState => {\n const rootStyles = useRootStyles();\n const rootFocusStyles = useRootFocusStyles();\n const rootIconOnlyStyles = useRootIconOnlyStyles();\n const iconStyles = useIconStyles();\n\n state.className = mergeClasses(\n rootStyles.base,\n rootFocusStyles.base,\n rootStyles[state.size],\n state.block && rootStyles.block,\n state.circular && rootStyles.circular,\n state.circular && rootFocusStyles.circular,\n state.outline && rootStyles.outline,\n state.primary && rootStyles.primary,\n state.primary && rootFocusStyles.primary,\n state.subtle && rootStyles.subtle,\n state.transparent && rootStyles.transparent,\n (state.disabled || state.disabledFocusable) && rootStyles.disabled,\n (state.disabled || state.disabledFocusable) && state.outline && rootStyles.disabledOutline,\n (state.disabled || state.disabledFocusable) && state.primary && rootStyles.disabledPrimary,\n (state.disabled || state.disabledFocusable) && state.subtle && rootStyles.disabledSubtle,\n (state.disabled || state.disabledFocusable) && state.transparent && rootStyles.disabledTransparent,\n state.iconOnly && rootIconOnlyStyles[state.size],\n state.className,\n );\n\n state.icon.className = mergeClasses(iconStyles.base, iconStyles[state.size], state.icon.className);\n\n return state;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"renderCompoundButton.js","sourceRoot":"../src/","sources":["components/CompoundButton/renderCompoundButton.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,oBAAoB,GAAG,UAAC,KAA0B;QACvD,IAAA,KAAuB,gCAAc,CAAC,KAAK,EAAE,sDAAkC,CAAC,EAA9E,KAAK,WAAA,EAAE,SAAS,eAA8D,CAAC;QAC/E,IAAA,QAAQ,GAA6B,KAAK,SAAlC,EAAE,QAAQ,GAAmB,KAAK,SAAxB,EAAE,YAAY,GAAK,KAAK,aAAV,CAAW;QAEnD,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAE3B,YAAY,KAAK,OAAO,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI;YAC9D,CAAC,QAAQ,IAAI,CACZ,oBAAC,KAAK,CAAC,gBAAgB,uBAAK,SAAS,CAAC,gBAAgB;gBACnD,QAAQ;gBACT,oBAAC,KAAK,CAAC,gBAAgB,uBAAK,SAAS,CAAC,gBAAgB,EAAI,CACnC,CAC1B;YACA,YAAY,KAAK,OAAO,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CACpD,CACd,CAAC;IACJ,CAAC,CAAC;IAjBW,QAAA,oBAAoB,wBAiB/B","sourcesContent":["import * as React from 'react';\nimport { getSlotsCompat } from '@fluentui/react-utilities';\nimport { compoundButtonShorthandPropsCompat } from './useCompoundButton';\nimport type { 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 = (state: CompoundButtonState) => {\n const { slots, slotProps } = getSlotsCompat(state, compoundButtonShorthandPropsCompat);\n const { children, iconOnly, iconPosition } = state;\n\n return (\n <slots.root {...slotProps.root}>\n {/*loading && <slots.loader {...slotProps.loader} />*/}\n {iconPosition !== 'after' && <slots.icon {...slotProps.icon} />}\n {!iconOnly && (\n <slots.contentContainer {...slotProps.contentContainer}>\n {children}\n <slots.secondaryContent {...slotProps.secondaryContent} />\n </slots.contentContainer>\n )}\n {iconPosition === 'after' && <slots.icon {...slotProps.icon} />}\n </slots.root>\n );\n};\n"]}
1
+ {"version":3,"file":"renderCompoundButton.js","sourceRoot":"../src/","sources":["components/CompoundButton/renderCompoundButton.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,oBAAoB,GAAG,UAAC,KAA0B;QACvD,IAAA,KAAuB,gCAAc,CAAC,KAAK,EAAE,sDAAkC,CAAC,EAA9E,KAAK,WAAA,EAAE,SAAS,eAA8D,CAAC;QAC/E,IAAA,QAAQ,GAA6B,KAAK,SAAlC,EAAE,QAAQ,GAAmB,KAAK,SAAxB,EAAE,YAAY,GAAK,KAAK,aAAV,CAAW;QAEnD,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC3B,YAAY,KAAK,OAAO,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI;YAC9D,CAAC,QAAQ,IAAI,CACZ,oBAAC,KAAK,CAAC,gBAAgB,uBAAK,SAAS,CAAC,gBAAgB;gBACnD,QAAQ;gBACT,oBAAC,KAAK,CAAC,gBAAgB,uBAAK,SAAS,CAAC,gBAAgB,EAAI,CACnC,CAC1B;YACA,YAAY,KAAK,OAAO,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CACpD,CACd,CAAC;IACJ,CAAC,CAAC;IAhBW,QAAA,oBAAoB,wBAgB/B","sourcesContent":["import * as React from 'react';\nimport { getSlotsCompat } from '@fluentui/react-utilities';\nimport { compoundButtonShorthandPropsCompat } from './useCompoundButton';\nimport type { 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 = (state: CompoundButtonState) => {\n const { slots, slotProps } = getSlotsCompat(state, compoundButtonShorthandPropsCompat);\n const { children, iconOnly, iconPosition } = state;\n\n return (\n <slots.root {...slotProps.root}>\n {iconPosition !== 'after' && <slots.icon {...slotProps.icon} />}\n {!iconOnly && (\n <slots.contentContainer {...slotProps.contentContainer}>\n {children}\n <slots.secondaryContent {...slotProps.secondaryContent} />\n </slots.contentContainer>\n )}\n {iconPosition === 'after' && <slots.icon {...slotProps.icon} />}\n </slots.root>\n );\n};\n"]}
@@ -5,6 +5,8 @@ import type { CompoundButtonProps, CompoundButtonShorthandPropsCompat, CompoundB
5
5
  */
6
6
  export declare const compoundButtonShorthandPropsCompat: CompoundButtonShorthandPropsCompat[];
7
7
  /**
8
- * Given user props, returns the final state for a CompoundButton.
8
+ * Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.
9
+ * @param props - User provided props to the CompoundButton component.
10
+ * @param ref - User provided ref to be passed to the CompoundButton component.
9
11
  */
10
12
  export declare const useCompoundButton: (props: CompoundButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: CompoundButtonProps | undefined) => CompoundButtonState;
@@ -14,7 +14,9 @@ define(["require", "exports", "@fluentui/react-utilities", "../Button/useButtonS
14
14
  deepMerge: exports.compoundButtonShorthandPropsCompat,
15
15
  });
16
16
  /**
17
- * Given user props, returns the final state for a CompoundButton.
17
+ * Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.
18
+ * @param props - User provided props to the CompoundButton component.
19
+ * @param ref - User provided ref to be passed to the CompoundButton component.
18
20
  */
19
21
  var useCompoundButton = function (props, ref, defaultProps) {
20
22
  var state = mergeProps({
@@ -1 +1 @@
1
- {"version":3,"file":"useCompoundButton.js","sourceRoot":"../src/","sources":["components/CompoundButton/useCompoundButton.ts"],"names":[],"mappings":";;;;IASA;;OAEG;IACU,QAAA,kCAAkC,GAAyC;QACtF,kBAAkB;QAClB,MAAM;QACN,kBAAkB;KACnB,CAAC;IAEF,IAAM,UAAU,GAAG,gCAAc,CAAsB;QACrD,SAAS,EAAE,0CAAkC;KAC9C,CAAC,CAAC;IAEH;;OAEG;IACI,IAAM,iBAAiB,GAAG,UAC/B,KAA0B,EAC1B,GAA2B,EAC3B,YAAkC;QAElC,IAAM,KAAK,GAAG,UAAU,CACtB;YACE,GAAG,KAAA;YACH,EAAE,EAAE,QAAQ;YACZ,8BAA8B;YAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACpB,oCAAoC;YACpC,gBAAgB,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;YAChD,gBAAgB,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YAChC,iBAAiB;YACjB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;SACf,EACD,YAAY,IAAI,uCAAqB,CAAC,YAAY,EAAE,0CAAkC,CAAC,EACvF,uCAAqB,CAAC,KAAK,EAAE,0CAAkC,CAAC,CACjE,CAAC;QAEF,+BAAc,CAAC,KAAK,CAAC,CAAC;QAEtB,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAzBW,QAAA,iBAAiB,qBAyB5B","sourcesContent":["import * as React from 'react';\nimport { makeMergeProps, resolveShorthandProps } from '@fluentui/react-utilities';\nimport { useButtonState } from '../Button/useButtonState';\nimport type {\n CompoundButtonProps,\n CompoundButtonShorthandPropsCompat,\n CompoundButtonState,\n} from './CompoundButton.types';\n\n/**\n * Consts listing which props are shorthand props.\n */\nexport const compoundButtonShorthandPropsCompat: CompoundButtonShorthandPropsCompat[] = [\n 'contentContainer',\n 'icon',\n 'secondaryContent',\n];\n\nconst mergeProps = makeMergeProps<CompoundButtonState>({\n deepMerge: compoundButtonShorthandPropsCompat,\n});\n\n/**\n * Given user props, returns the final state for a CompoundButton.\n */\nexport const useCompoundButton = (\n props: CompoundButtonProps,\n ref: React.Ref<HTMLElement>,\n defaultProps?: CompoundButtonProps,\n): CompoundButtonState => {\n const state = mergeProps(\n {\n ref,\n as: 'button',\n // Slots inherited from Button\n icon: { as: 'span' },\n // Slots exclusive to CompoundButton\n contentContainer: { as: 'span', children: null },\n secondaryContent: { as: 'span' },\n // Non-slot props\n size: 'medium',\n type: 'button', // This is added because the default for type is 'submit'\n },\n defaultProps && resolveShorthandProps(defaultProps, compoundButtonShorthandPropsCompat),\n resolveShorthandProps(props, compoundButtonShorthandPropsCompat),\n );\n\n useButtonState(state);\n\n return state;\n};\n"]}
1
+ {"version":3,"file":"useCompoundButton.js","sourceRoot":"../src/","sources":["components/CompoundButton/useCompoundButton.ts"],"names":[],"mappings":";;;;IASA;;OAEG;IACU,QAAA,kCAAkC,GAAyC;QACtF,kBAAkB;QAClB,MAAM;QACN,kBAAkB;KACnB,CAAC;IAEF,IAAM,UAAU,GAAG,gCAAc,CAAsB;QACrD,SAAS,EAAE,0CAAkC;KAC9C,CAAC,CAAC;IAEH;;;;OAIG;IACI,IAAM,iBAAiB,GAAG,UAC/B,KAA0B,EAC1B,GAA2B,EAC3B,YAAkC;QAElC,IAAM,KAAK,GAAG,UAAU,CACtB;YACE,GAAG,KAAA;YACH,EAAE,EAAE,QAAQ;YACZ,8BAA8B;YAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACpB,oCAAoC;YACpC,gBAAgB,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;YAChD,gBAAgB,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YAChC,iBAAiB;YACjB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;SACf,EACD,YAAY,IAAI,uCAAqB,CAAC,YAAY,EAAE,0CAAkC,CAAC,EACvF,uCAAqB,CAAC,KAAK,EAAE,0CAAkC,CAAC,CACjE,CAAC;QAEF,+BAAc,CAAC,KAAK,CAAC,CAAC;QAEtB,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAzBW,QAAA,iBAAiB,qBAyB5B","sourcesContent":["import * as React from 'react';\nimport { makeMergeProps, resolveShorthandProps } from '@fluentui/react-utilities';\nimport { useButtonState } from '../Button/useButtonState';\nimport type {\n CompoundButtonProps,\n CompoundButtonShorthandPropsCompat,\n CompoundButtonState,\n} from './CompoundButton.types';\n\n/**\n * Consts listing which props are shorthand props.\n */\nexport const compoundButtonShorthandPropsCompat: CompoundButtonShorthandPropsCompat[] = [\n 'contentContainer',\n 'icon',\n 'secondaryContent',\n];\n\nconst mergeProps = makeMergeProps<CompoundButtonState>({\n deepMerge: compoundButtonShorthandPropsCompat,\n});\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 = (\n props: CompoundButtonProps,\n ref: React.Ref<HTMLElement>,\n defaultProps?: CompoundButtonProps,\n): CompoundButtonState => {\n const state = mergeProps(\n {\n ref,\n as: 'button',\n // Slots inherited from Button\n icon: { as: 'span' },\n // Slots exclusive to CompoundButton\n contentContainer: { as: 'span', children: null },\n secondaryContent: { as: 'span' },\n // Non-slot props\n size: 'medium',\n type: 'button', // This is added because the default for type is 'submit'\n },\n defaultProps && resolveShorthandProps(defaultProps, compoundButtonShorthandPropsCompat),\n resolveShorthandProps(props, compoundButtonShorthandPropsCompat),\n );\n\n useButtonState(state);\n\n return state;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useCompoundButtonStyles.js","sourceRoot":"../src/","sources":["components/CompoundButton/useCompoundButtonStyles.ts"],"names":[],"mappings":";;;;IAIA,IAAM,wBAAwB,GAAG;QAC/B,gBAAgB,EAAE,iCAAiC;KACpD,CAAC;IAEF,IAAM,aAAa,GAAG,8BAAU,CAAC;QAC/B,IAAI,EAAE,UAAA,KAAK;;YAAI,OAAA;oBACb,gEAAgE;oBAChE,GAAG,EAAE,+BAAa,CAAC,KAAK;oBAExB,MAAM,EAAE,MAAM;;gBAEd,GAAC,QAAM,wBAAwB,CAAC,gBAAkB,IAAG;oBACnD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB;iBACpD;gBAED,YAAQ;oBACN,GAAC,QAAM,wBAAwB,CAAC,gBAAkB,IAAG;wBACnD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,uBAAuB;qBACzD;uBACF;gBAED,aAAS;oBACP,GAAC,QAAM,wBAAwB,CAAC,gBAAkB,IAAG;wBACnD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,yBAAyB;qBAC3D;uBACF;mBACD;QArBa,CAqBb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IAAI,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,EAChD,KAAK,CAAC,SAAS,CAChB,CAAC;QAEF,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,gCAAY,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAE3E,KAAK,CAAC,gBAAgB,CAAC,SAAS,GAAG,gCAAY,CAAC,sBAAsB,CAAC,IAAI,EAAE,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAE/G,KAAK,CAAC,gBAAgB,CAAC,SAAS,GAAG,gCAAY,CAC7C,wBAAwB,CAAC,gBAAgB,EACzC,sBAAsB,CAAC,IAAI,EAC3B,sBAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,EAClC,KAAK,CAAC,gBAAgB,CAAC,SAAS,CACjC,CAAC;QAEF,iCAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAhCW,QAAA,uBAAuB,2BAgClC","sourcesContent":["import { mergeClasses, makeStyles } from '@fluentui/react-make-styles';\nimport { buttonSpacing, useButtonStyles } from '../Button/useButtonStyles';\nimport type { CompoundButtonState } from './CompoundButton.types';\n\nconst CompoundButtonClassNames = {\n secondaryContent: 'CompoundButton-secondaryContent',\n};\n\nconst useRootStyles = makeStyles({\n base: theme => ({\n // TODO: remove unsafe property: https://caniuse.com/?search=gap\n gap: buttonSpacing.large,\n\n height: 'auto',\n\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2Hover,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2Pressed,\n },\n },\n }),\n small: theme => ({\n padding: buttonSpacing.medium,\n\n fontSize: theme.global.type.fontSizes.base[300],\n lineHeight: theme.global.type.lineHeights.base[300],\n }),\n medium: theme => ({\n padding: buttonSpacing.large,\n\n fontSize: theme.global.type.fontSizes.base[300],\n lineHeight: theme.global.type.lineHeights.base[300],\n }),\n large: theme => ({\n padding: buttonSpacing.larger,\n\n fontSize: theme.global.type.fontSizes.base[400],\n lineHeight: theme.global.type.lineHeights.base[400],\n }),\n primary: theme => ({\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n },\n }),\n subtle: theme => ({\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2BrandHover,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2BrandPressed,\n },\n },\n }),\n transparent: theme => ({\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2BrandHover,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2BrandPressed,\n },\n },\n }),\n disabled: theme => ({\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n },\n },\n }),\n});\n\nconst useRootIconOnlyStyles = makeStyles({\n small: {\n padding: buttonSpacing.smaller,\n\n maxWidth: '48px',\n minWidth: '48px',\n },\n medium: {\n padding: buttonSpacing.small,\n\n maxWidth: '52px',\n minWidth: '52px',\n },\n large: {\n padding: buttonSpacing.medium,\n\n maxWidth: '56px',\n minWidth: '56px',\n },\n});\n\nconst useIconStyles = makeStyles({\n base: {\n fontSize: '40px',\n height: '40px',\n width: '40px',\n },\n});\n\nconst useContentContainerStyles = makeStyles({\n base: {\n display: 'flex',\n flexDirection: 'column',\n textAlign: 'left',\n },\n});\n\nconst useSecondaryContentStyles = makeStyles({\n base: theme => ({\n lineHeight: '100%',\n marginTop: '4px',\n fontWeight: theme.global.type.fontWeights.regular,\n }),\n small: theme => ({\n fontSize: theme.global.type.fontSizes.base[200],\n }),\n medium: theme => ({\n fontSize: theme.global.type.fontSizes.base[200],\n }),\n large: theme => ({\n fontSize: theme.global.type.fontSizes.base[300],\n }),\n});\n\nexport const useCompoundButtonStyles = (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 state.className = mergeClasses(\n rootStyles.base,\n rootStyles[state.size],\n state.primary && rootStyles.primary,\n state.subtle && rootStyles.subtle,\n state.transparent && rootStyles.transparent,\n (state.disabled || state.disabledFocusable) && rootStyles.disabled,\n state.iconOnly && rootIconOnlyStyles[state.size],\n state.className,\n );\n\n state.icon.className = mergeClasses(iconStyles.base, state.icon.className);\n\n state.contentContainer.className = mergeClasses(contentContainerStyles.base, state.contentContainer.className);\n\n state.secondaryContent.className = mergeClasses(\n CompoundButtonClassNames.secondaryContent,\n secondaryContentStyles.base,\n secondaryContentStyles[state.size],\n state.secondaryContent.className,\n );\n\n useButtonStyles(state);\n\n return state;\n};\n"]}
1
+ {"version":3,"file":"useCompoundButtonStyles.js","sourceRoot":"../src/","sources":["components/CompoundButton/useCompoundButtonStyles.ts"],"names":[],"mappings":";;;;IAIA,IAAM,wBAAwB,GAAG;QAC/B,gBAAgB,EAAE,iCAAiC;KACpD,CAAC;IAEF,IAAM,aAAa,GAAG,8BAAU,CAAC;QAC/B,IAAI,EAAE,UAAA,KAAK;;YAAI,OAAA;oBACb,gEAAgE;oBAChE,GAAG,EAAE,+BAAa,CAAC,KAAK;oBAExB,MAAM,EAAE,MAAM;;gBAEd,GAAC,QAAM,wBAAwB,CAAC,gBAAkB,IAAG;oBACnD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB;iBACpD;gBAED,YAAQ;oBACN,GAAC,QAAM,wBAAwB,CAAC,gBAAkB,IAAG;wBACnD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,uBAAuB;qBACzD;uBACF;gBAED,aAAS;oBACP,GAAC,QAAM,wBAAwB,CAAC,gBAAkB,IAAG;wBACnD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,yBAAyB;qBAC3D;uBACF;mBACD;QArBa,CAqBb;QACF,KAAK,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;YACf,OAAO,EAAE,+BAAa,CAAC,MAAM;YAE7B,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC;YAC/C,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC;SACpD,CAAC,EALc,CAKd;QACF,MAAM,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;YAChB,OAAO,EAAE,+BAAa,CAAC,KAAK;YAE5B,QAAQ,EAAE,KAAK,CAAC,MAAM,CA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ACzC,sBAAsB,CAAC,IAAI,EAC3B,sBAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,EAClC,KAAK,CAAC,gBAAgB,CAAC,SAAS,CACjC,CAAC;QAEF,iCAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAhCW,QAAA,uBAAuB,2BAgClC","sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';\nimport { buttonSpacing, useButtonStyles } from '../Button/useButtonStyles';\nimport type { CompoundButtonState } from './CompoundButton.types';\n\nconst CompoundButtonClassNames = {\n secondaryContent: 'CompoundButton-secondaryContent',\n};\n\nconst useRootStyles = makeStyles({\n base: theme => ({\n // TODO: remove unsafe property: https://caniuse.com/?search=gap\n gap: buttonSpacing.large,\n\n height: 'auto',\n\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2Hover,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2Pressed,\n },\n },\n }),\n small: theme => ({\n padding: buttonSpacing.medium,\n\n fontSize: theme.global.type.fontSizes.base[300],\n lineHeight: theme.global.type.lineHeights.base[300],\n }),\n medium: theme => ({\n padding: buttonSpacing.large,\n\n fontSize: theme.global.type.fontSizes.base[300],\n lineHeight: theme.global.type.lineHeights.base[300],\n }),\n large: theme => ({\n padding: buttonSpacing.larger,\n\n fontSize: theme.global.type.fontSizes.base[400],\n lineHeight: theme.global.type.lineHeights.base[400],\n }),\n primary: theme => ({\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n },\n }),\n subtle: theme => ({\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2BrandHover,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2BrandPressed,\n },\n },\n }),\n transparent: theme => ({\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2BrandHover,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2BrandPressed,\n },\n },\n }),\n disabled: theme => ({\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n },\n },\n }),\n});\n\nconst useRootIconOnlyStyles = makeStyles({\n small: {\n padding: buttonSpacing.smaller,\n\n maxWidth: '48px',\n minWidth: '48px',\n },\n medium: {\n padding: buttonSpacing.small,\n\n maxWidth: '52px',\n minWidth: '52px',\n },\n large: {\n padding: buttonSpacing.medium,\n\n maxWidth: '56px',\n minWidth: '56px',\n },\n});\n\nconst useIconStyles = makeStyles({\n base: {\n fontSize: '40px',\n height: '40px',\n width: '40px',\n },\n});\n\nconst useContentContainerStyles = makeStyles({\n base: {\n display: 'flex',\n flexDirection: 'column',\n textAlign: 'left',\n },\n});\n\nconst useSecondaryContentStyles = makeStyles({\n base: theme => ({\n lineHeight: '100%',\n marginTop: '4px',\n fontWeight: theme.global.type.fontWeights.regular,\n }),\n small: theme => ({\n fontSize: theme.global.type.fontSizes.base[200],\n }),\n medium: theme => ({\n fontSize: theme.global.type.fontSizes.base[200],\n }),\n large: theme => ({\n fontSize: theme.global.type.fontSizes.base[300],\n }),\n});\n\nexport const useCompoundButtonStyles = (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 state.className = mergeClasses(\n rootStyles.base,\n rootStyles[state.size],\n state.primary && rootStyles.primary,\n state.subtle && rootStyles.subtle,\n state.transparent && rootStyles.transparent,\n (state.disabled || state.disabledFocusable) && rootStyles.disabled,\n state.iconOnly && rootIconOnlyStyles[state.size],\n state.className,\n );\n\n state.icon.className = mergeClasses(iconStyles.base, state.icon.className);\n\n state.contentContainer.className = mergeClasses(contentContainerStyles.base, state.contentContainer.className);\n\n state.secondaryContent.className = mergeClasses(\n CompoundButtonClassNames.secondaryContent,\n secondaryContentStyles.base,\n secondaryContentStyles[state.size],\n state.secondaryContent.className,\n );\n\n useButtonStyles(state);\n\n return state;\n};\n"]}
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import type { MenuTriggerChildProps } from '@fluentui/react-menu';
3
3
  import type { ComponentStateCompat, ShorthandPropsCompat } from '@fluentui/react-utilities';
4
4
  import type { ButtonDefaultedProps, ButtonProps, ButtonShorthandPropsCompat, ButtonState } from '../Button/Button.types';
5
- export declare type MenuButtonProps = Omit<ButtonProps, 'iconPosition'> & Partial<MenuTriggerChildProps> & {
5
+ export declare type MenuButtonProps = Omit<ButtonProps, 'iconPosition'> & Partial<Omit<MenuTriggerChildProps, 'ref'>> & {
6
6
  /**
7
7
  * Menu icon that indicates that this button has a menu that can be expanded.
8
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"MenuButton.types.js","sourceRoot":"../src/","sources":["components/MenuButton/MenuButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { MenuTriggerChildProps } from '@fluentui/react-menu';\nimport type { ComponentStateCompat, ShorthandPropsCompat } from '@fluentui/react-utilities';\nimport type {\n ButtonDefaultedProps,\n ButtonProps,\n ButtonShorthandPropsCompat,\n ButtonState,\n} from '../Button/Button.types';\n\nexport type MenuButtonProps = Omit<ButtonProps, 'iconPosition'> &\n Partial<MenuTriggerChildProps> & {\n /**\n * Menu icon that indicates that this button has a menu that can be expanded.\n */\n menuIcon?: ShorthandPropsCompat<React.HTMLAttributes<HTMLElement>>;\n };\n\nexport type MenuButtonShorthandPropsCompat = ButtonShorthandPropsCompat | 'menuIcon';\n\nexport type MenuButtonDefaultedProps = ButtonDefaultedProps | 'menuIcon';\n\nexport interface MenuButtonState\n extends Omit<ButtonState, 'iconPosition'>,\n ComponentStateCompat<MenuButtonProps, MenuButtonShorthandPropsCompat, MenuButtonDefaultedProps> {}\n"]}
1
+ {"version":3,"file":"MenuButton.types.js","sourceRoot":"../src/","sources":["components/MenuButton/MenuButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { MenuTriggerChildProps } from '@fluentui/react-menu';\nimport type { ComponentStateCompat, ShorthandPropsCompat } from '@fluentui/react-utilities';\nimport type {\n ButtonDefaultedProps,\n ButtonProps,\n ButtonShorthandPropsCompat,\n ButtonState,\n} from '../Button/Button.types';\n\nexport type MenuButtonProps = Omit<ButtonProps, 'iconPosition'> &\n Partial<Omit<MenuTriggerChildProps, 'ref'>> & {\n /**\n * Menu icon that indicates that this button has a menu that can be expanded.\n */\n menuIcon?: ShorthandPropsCompat<React.HTMLAttributes<HTMLElement>>;\n };\n\nexport type MenuButtonShorthandPropsCompat = ButtonShorthandPropsCompat | 'menuIcon';\n\nexport type MenuButtonDefaultedProps = ButtonDefaultedProps | 'menuIcon';\n\nexport interface MenuButtonState\n extends Omit<ButtonState, 'iconPosition'>,\n ComponentStateCompat<MenuButtonProps, MenuButtonShorthandPropsCompat, MenuButtonDefaultedProps> {}\n"]}
@@ -7,11 +7,11 @@ define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "./
7
7
  */
8
8
  var renderMenuButton = function (state) {
9
9
  var _a = react_utilities_1.getSlotsCompat(state, useMenuButton_1.menuButtonShorthandPropsCompat), slots = _a.slots, slotProps = _a.slotProps;
10
- var children = state.children, iconOnly = state.iconOnly;
10
+ var children = state.children, icon = state.icon, iconOnly = state.iconOnly;
11
11
  return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
12
12
  React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)),
13
13
  !iconOnly && children,
14
- !iconOnly && React.createElement(slots.menuIcon, tslib_1.__assign({}, slotProps.menuIcon))));
14
+ (!iconOnly || !icon.children) && React.createElement(slots.menuIcon, tslib_1.__assign({}, slotProps.menuIcon))));
15
15
  };
16
16
  exports.renderMenuButton = renderMenuButton;
17
17
  });
@@ -1 +1 @@
1
- {"version":3,"file":"renderMenuButton.js","sourceRoot":"../src/","sources":["components/MenuButton/renderMenuButton.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,gBAAgB,GAAG,UAAC,KAAsB;QAC/C,IAAA,KAAuB,gCAAc,CAAC,KAAK,EAAE,8CAA8B,CAAC,EAA1E,KAAK,WAAA,EAAE,SAAS,eAA0D,CAAC;QAC3E,IAAA,QAAQ,GAAe,KAAK,SAApB,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAW;QAErC,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC5B,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI;YACjC,CAAC,QAAQ,IAAI,QAAQ;YACrB,CAAC,QAAQ,IAAI,oBAAC,KAAK,CAAC,QAAQ,uBAAK,SAAS,CAAC,QAAQ,EAAI,CAC7C,CACd,CAAC;IACJ,CAAC,CAAC;IAXW,QAAA,gBAAgB,oBAW3B","sourcesContent":["import * as React from 'react';\nimport { getSlotsCompat } from '@fluentui/react-utilities';\nimport { menuButtonShorthandPropsCompat } from './useMenuButton';\nimport type { 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 = (state: MenuButtonState) => {\n const { slots, slotProps } = getSlotsCompat(state, menuButtonShorthandPropsCompat);\n const { children, iconOnly } = state;\n\n return (\n <slots.root {...slotProps.root}>\n <slots.icon {...slotProps.icon} />\n {!iconOnly && children}\n {!iconOnly && <slots.menuIcon {...slotProps.menuIcon} />}\n </slots.root>\n );\n};\n"]}
1
+ {"version":3,"file":"renderMenuButton.js","sourceRoot":"../src/","sources":["components/MenuButton/renderMenuButton.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,gBAAgB,GAAG,UAAC,KAAsB;QAC/C,IAAA,KAAuB,gCAAc,CAAC,KAAK,EAAE,8CAA8B,CAAC,EAA1E,KAAK,WAAA,EAAE,SAAS,eAA0D,CAAC;QAC3E,IAAA,QAAQ,GAAqB,KAAK,SAA1B,EAAE,IAAI,GAAe,KAAK,KAApB,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAW;QAE3C,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC5B,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI;YACjC,CAAC,QAAQ,IAAI,QAAQ;YACrB,CAAC,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,oBAAC,KAAK,CAAC,QAAQ,uBAAK,SAAS,CAAC,QAAQ,EAAI,CACjE,CACd,CAAC;IACJ,CAAC,CAAC;IAXW,QAAA,gBAAgB,oBAW3B","sourcesContent":["import * as React from 'react';\nimport { getSlotsCompat } from '@fluentui/react-utilities';\nimport { menuButtonShorthandPropsCompat } from './useMenuButton';\nimport type { 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 = (state: MenuButtonState) => {\n const { slots, slotProps } = getSlotsCompat(state, menuButtonShorthandPropsCompat);\n const { children, icon, iconOnly } = state;\n\n return (\n <slots.root {...slotProps.root}>\n <slots.icon {...slotProps.icon} />\n {!iconOnly && children}\n {(!iconOnly || !icon.children) && <slots.menuIcon {...slotProps.menuIcon} />}\n </slots.root>\n );\n};\n"]}
@@ -5,6 +5,8 @@ import type { MenuButtonProps, MenuButtonShorthandPropsCompat, MenuButtonState }
5
5
  */
6
6
  export declare const menuButtonShorthandPropsCompat: MenuButtonShorthandPropsCompat[];
7
7
  /**
8
- * Given user props, returns the final state for a MenuButton.
8
+ * Given user props, defines default props for the MenuButton, calls useButtonState, and returns processed state.
9
+ * @param props - User provided props to the MenuButton component.
10
+ * @param ref - User provided ref to be passed to the MenuButton component.
9
11
  */
10
12
  export declare const useMenuButton: (props: MenuButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: MenuButtonProps | undefined) => MenuButtonState;
@@ -8,11 +8,11 @@ define(["require", "exports", "@fluentui/react-utilities", "./useMenuButtonState
8
8
  exports.menuButtonShorthandPropsCompat = ['icon', 'menuIcon'];
9
9
  var mergeProps = react_utilities_1.makeMergeProps({ deepMerge: exports.menuButtonShorthandPropsCompat });
10
10
  /**
11
- * Given user props, returns the final state for a MenuButton.
11
+ * Given user props, defines default props for the MenuButton, calls useButtonState, and returns processed state.
12
+ * @param props - User provided props to the MenuButton component.
13
+ * @param ref - User provided ref to be passed to the MenuButton component.
12
14
  */
13
15
  var useMenuButton = function (props, ref, defaultProps) {
14
- // Note: because menu button's template and slots are different, we can't reuse
15
- // those, but the useMenuButtonState hook can reuse useButtonState.
16
16
  var state = mergeProps({
17
17
  ref: ref,
18
18
  as: 'button',
@@ -1 +1 @@
1
- {"version":3,"file":"useMenuButton.js","sourceRoot":"../src/","sources":["components/MenuButton/useMenuButton.ts"],"names":[],"mappings":";;;;IAKA;;OAEG;IACU,QAAA,8BAA8B,GAAqC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAErG,IAAM,UAAU,GAAG,gCAAc,CAAkB,EAAE,SAAS,EAAE,sCAA8B,EAAE,CAAC,CAAC;IAElG;;OAEG;IACI,IAAM,aAAa,GAAG,UAAC,KAAsB,EAAE,GAA2B,EAAE,YAA8B;QAC/G,+EAA+E;QAC/E,mEAAmE;QACnE,IAAM,KAAK,GAAG,UAAU,CACtB;YACE,GAAG,KAAA;YACH,EAAE,EAAE,QAAQ;YACZ,eAAe;YACf,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACpB,mBAAmB;YACnB,QAAQ,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACxB,iBAAiB;YACjB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;SACf,EACD,YAAY,IAAI,uCAAqB,CAAC,YAAY,EAAE,sCAA8B,CAAC,EACnF,uCAAqB,CAAC,KAAK,EAAE,sCAA8B,CAAC,CAC1C,CAAC;QAErB,uCAAkB,CAAC,KAAK,CAAC,CAAC;QAE1B,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAtBW,QAAA,aAAa,iBAsBxB","sourcesContent":["import * as React from 'react';\nimport { makeMergeProps, resolveShorthandProps } from '@fluentui/react-utilities';\nimport { useMenuButtonState } from './useMenuButtonState';\nimport type { MenuButtonProps, MenuButtonShorthandPropsCompat, MenuButtonState } from './MenuButton.types';\n\n/**\n * Consts listing which props are shorthand props.\n */\nexport const menuButtonShorthandPropsCompat: MenuButtonShorthandPropsCompat[] = ['icon', 'menuIcon'];\n\nconst mergeProps = makeMergeProps<MenuButtonState>({ deepMerge: menuButtonShorthandPropsCompat });\n\n/**\n * Given user props, returns the final state for a MenuButton.\n */\nexport const useMenuButton = (props: MenuButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: MenuButtonProps) => {\n // Note: because menu button's template and slots are different, we can't reuse\n // those, but the useMenuButtonState hook can reuse useButtonState.\n const state = mergeProps(\n {\n ref,\n as: 'button',\n // Button slots\n icon: { as: 'span' },\n // MenuButton slots\n menuIcon: { as: 'span' },\n // Non-slot props\n size: 'medium',\n type: 'button', // This is added because the default for type is 'submit'\n },\n defaultProps && resolveShorthandProps(defaultProps, menuButtonShorthandPropsCompat),\n resolveShorthandProps(props, menuButtonShorthandPropsCompat),\n ) as MenuButtonState;\n\n useMenuButtonState(state);\n\n return state;\n};\n"]}
1
+ {"version":3,"file":"useMenuButton.js","sourceRoot":"../src/","sources":["components/MenuButton/useMenuButton.ts"],"names":[],"mappings":";;;;IAKA;;OAEG;IACU,QAAA,8BAA8B,GAAqC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAErG,IAAM,UAAU,GAAG,gCAAc,CAAkB,EAAE,SAAS,EAAE,sCAA8B,EAAE,CAAC,CAAC;IAElG;;;;OAIG;IACI,IAAM,aAAa,GAAG,UAAC,KAAsB,EAAE,GAA2B,EAAE,YAA8B;QAC/G,IAAM,KAAK,GAAG,UAAU,CACtB;YACE,GAAG,KAAA;YACH,EAAE,EAAE,QAAQ;YACZ,eAAe;YACf,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACpB,mBAAmB;YACnB,QAAQ,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACxB,iBAAiB;YACjB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;SACf,EACD,YAAY,IAAI,uCAAqB,CAAC,YAAY,EAAE,sCAA8B,CAAC,EACnF,uCAAqB,CAAC,KAAK,EAAE,sCAA8B,CAAC,CAC7D,CAAC;QAEF,uCAAkB,CAAC,KAAK,CAAC,CAAC;QAE1B,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IApBW,QAAA,aAAa,iBAoBxB","sourcesContent":["import * as React from 'react';\nimport { makeMergeProps, resolveShorthandProps } from '@fluentui/react-utilities';\nimport { useMenuButtonState } from './useMenuButtonState';\nimport type { MenuButtonProps, MenuButtonShorthandPropsCompat, MenuButtonState } from './MenuButton.types';\n\n/**\n * Consts listing which props are shorthand props.\n */\nexport const menuButtonShorthandPropsCompat: MenuButtonShorthandPropsCompat[] = ['icon', 'menuIcon'];\n\nconst mergeProps = makeMergeProps<MenuButtonState>({ deepMerge: menuButtonShorthandPropsCompat });\n\n/**\n * Given user props, defines default props for the MenuButton, calls useButtonState, and returns processed state.\n * @param props - User provided props to the MenuButton component.\n * @param ref - User provided ref to be passed to the MenuButton component.\n */\nexport const useMenuButton = (props: MenuButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: MenuButtonProps) => {\n const state = mergeProps(\n {\n ref,\n as: 'button',\n // Button slots\n icon: { as: 'span' },\n // MenuButton slots\n menuIcon: { as: 'span' },\n // Non-slot props\n size: 'medium',\n type: 'button', // This is added because the default for type is 'submit'\n },\n defaultProps && resolveShorthandProps(defaultProps, menuButtonShorthandPropsCompat),\n resolveShorthandProps(props, menuButtonShorthandPropsCompat),\n );\n\n useMenuButtonState(state);\n\n return state;\n};\n"]}
@@ -1,2 +1,7 @@
1
1
  import type { MenuButtonState } from './MenuButton.types';
2
+ /**
3
+ * The useMenuButtonState hook processes the MenuButton state, first calling useButtonState, and then adding any
4
+ * additional MenuButton specific processing.
5
+ * @param state - MenuButtonButton state to mutate.
6
+ */
2
7
  export declare const useMenuButtonState: (state: MenuButtonState) => MenuButtonState;
@@ -2,10 +2,16 @@ define(["require", "exports", "react", "@fluentui/react-icons", "../Button/useBu
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.useMenuButtonState = void 0;
5
+ /**
6
+ * The useMenuButtonState hook processes the MenuButton state, first calling useButtonState, and then adding any
7
+ * additional MenuButton specific processing.
8
+ * @param state - MenuButtonButton state to mutate.
9
+ */
5
10
  var useMenuButtonState = function (state) {
6
11
  // It behaves like a button.
7
12
  useButtonState_1.useButtonState(state);
8
- var menuIcon = state.menuIcon, size = state.size;
13
+ var children = state.children, menuIcon = state.menuIcon, size = state.size;
14
+ state.iconOnly = !children;
9
15
  if (!menuIcon.children) {
10
16
  if (size === 'large') {
11
17
  menuIcon.children = React.createElement(react_icons_1.ChevronDown24Regular, null);
@@ -1 +1 @@
1
- {"version":3,"file":"useMenuButtonState.js","sourceRoot":"../src/","sources":["components/MenuButton/useMenuButtonState.tsx"],"names":[],"mappings":";;;;IAKO,IAAM,kBAAkB,GAAG,UAAC,KAAsB;QACvD,4BAA4B;QAC5B,+BAAc,CAAC,KAAK,CAAC,CAAC;QAEd,IAAA,QAAQ,GAAW,KAAK,SAAhB,EAAE,IAAI,GAAK,KAAK,KAAV,CAAW;QACjC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;YACtB,IAAI,IAAI,KAAK,OAAO,EAAE;gBACpB,QAAQ,CAAC,QAAQ,GAAG,oBAAC,kCAAoB,OAAG,CAAC;aAC9C;iBAAM;gBACL,QAAQ,CAAC,QAAQ,GAAG,oBAAC,kCAAoB,OAAG,CAAC;aAC9C;SACF;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAdW,QAAA,kBAAkB,sBAc7B","sourcesContent":["import * as React from 'react';\nimport { ChevronDown20Regular, ChevronDown24Regular } from '@fluentui/react-icons';\nimport { useButtonState } from '../Button/useButtonState';\nimport type { MenuButtonState } from './MenuButton.types';\n\nexport const useMenuButtonState = (state: MenuButtonState): MenuButtonState => {\n // It behaves like a button.\n useButtonState(state);\n\n const { menuIcon, size } = state;\n if (!menuIcon.children) {\n if (size === 'large') {\n menuIcon.children = <ChevronDown24Regular />;\n } else {\n menuIcon.children = <ChevronDown20Regular />;\n }\n }\n\n return state;\n};\n"]}
1
+ {"version":3,"file":"useMenuButtonState.js","sourceRoot":"../src/","sources":["components/MenuButton/useMenuButtonState.tsx"],"names":[],"mappings":";;;;IAKA;;;;OAIG;IACI,IAAM,kBAAkB,GAAG,UAAC,KAAsB;QACvD,4BAA4B;QAC5B,+BAAc,CAAC,KAAK,CAAC,CAAC;QAEd,IAAA,QAAQ,GAAqB,KAAK,SAA1B,EAAE,QAAQ,GAAW,KAAK,SAAhB,EAAE,IAAI,GAAK,KAAK,KAAV,CAAW;QAC3C,KAAK,CAAC,QAAQ,GAAG,CAAC,QAAQ,CAAC;QAC3B,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;YACtB,IAAI,IAAI,KAAK,OAAO,EAAE;gBACpB,QAAQ,CAAC,QAAQ,GAAG,oBAAC,kCAAoB,OAAG,CAAC;aAC9C;iBAAM;gBACL,QAAQ,CAAC,QAAQ,GAAG,oBAAC,kCAAoB,OAAG,CAAC;aAC9C;SACF;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAfW,QAAA,kBAAkB,sBAe7B","sourcesContent":["import * as React from 'react';\nimport { ChevronDown20Regular, ChevronDown24Regular } from '@fluentui/react-icons';\nimport { useButtonState } from '../Button/useButtonState';\nimport type { MenuButtonState } from './MenuButton.types';\n\n/**\n * The useMenuButtonState hook processes the MenuButton state, first calling useButtonState, and then adding any\n * additional MenuButton specific processing.\n * @param state - MenuButtonButton state to mutate.\n */\nexport const useMenuButtonState = (state: MenuButtonState): MenuButtonState => {\n // It behaves like a button.\n useButtonState(state);\n\n const { children, menuIcon, size } = state;\n state.iconOnly = !children;\n if (!menuIcon.children) {\n if (size === 'large') {\n menuIcon.children = <ChevronDown24Regular />;\n } else {\n menuIcon.children = <ChevronDown20Regular />;\n }\n }\n\n return state;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useMenuButtonStyles.js","sourceRoot":"../src/","sources":["components/MenuButton/useMenuButtonStyles.ts"],"names":[],"mappings":";;;;IAIA,IAAM,iBAAiB,GAAG,8BAAU,CAAC;QACnC,KAAK,EAAE;YACL,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,MAAM;SACd;QACD,MAAM,EAAE;YACN,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,MAAM;SACd;QACD,KAAK,EAAE;YACL,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,MAAM;SACd;KACF,CAAC,CAAC;IAEI,IAAM,mBAAmB,GAAG,UAAC,KAAsB;QACxD,IAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;QAE3C,KAAK,CAAC,QAAQ,CAAC,SAAS,GAAG,gCAAY,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAE9F,iCAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IARW,QAAA,mBAAmB,uBAQ9B","sourcesContent":["import { mergeClasses, makeStyles } from '@fluentui/react-make-styles';\nimport { useButtonStyles } from '../Button/useButtonStyles';\nimport type { MenuButtonState } from './MenuButton.types';\n\nconst useMenuIconStyles = makeStyles({\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 = (state: MenuButtonState): MenuButtonState => {\n const menuIconStyles = useMenuIconStyles();\n\n state.menuIcon.className = mergeClasses(menuIconStyles[state.size], state.menuIcon.className);\n\n useButtonStyles(state);\n\n return state;\n};\n"]}
1
+ {"version":3,"file":"useMenuButtonStyles.js","sourceRoot":"../src/","sources":["components/MenuButton/useMenuButtonStyles.ts"],"names":[],"mappings":";;;;IAIA,IAAM,iBAAiB,GAAG,8BAAU,CAAC;QACnC,KAAK,EAAE;YACL,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,MAAM;SACd;QACD,MAAM,EAAE;YACN,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,MAAM;SACd;QACD,KAAK,EAAE;YACL,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,MAAM;SACd;KACF,CAAC,CAAC;IAEI,IAAM,mBAAmB,GAAG,UAAC,KAAsB;QACxD,IAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;QAE3C,KAAK,CAAC,QAAQ,CAAC,SAAS,GAAG,gCAAY,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAE9F,iCAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IARW,QAAA,mBAAmB,uBAQ9B","sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';\nimport { useButtonStyles } from '../Button/useButtonStyles';\nimport type { MenuButtonState } from './MenuButton.types';\n\nconst useMenuIconStyles = makeStyles({\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 = (state: MenuButtonState): MenuButtonState => {\n const menuIconStyles = useMenuIconStyles();\n\n state.menuIcon.className = mergeClasses(menuIconStyles[state.size], state.menuIcon.className);\n\n useButtonStyles(state);\n\n return state;\n};\n"]}
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import type { SplitButtonProps } from './SplitButton.types';
3
+ /**
4
+ * SplitButtons are a grouping of two interactive surfaces where the interacting with the first one triggers a primary
5
+ * action, while interacting with the second one opens a menu with secondary actions.
6
+ */
7
+ export declare const SplitButton: React.ForwardRefExoticComponent<SplitButtonProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,19 @@
1
+ define(["require", "exports", "react", "../Button/index", "../MenuButton/index", "./renderSplitButton", "./useSplitButton", "./useSplitButtonStyles"], function (require, exports, React, index_1, index_2, renderSplitButton_1, useSplitButton_1, useSplitButtonStyles_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.SplitButton = void 0;
5
+ /**
6
+ * SplitButtons are a grouping of two interactive surfaces where the interacting with the first one triggers a primary
7
+ * action, while interacting with the second one opens a menu with secondary actions.
8
+ */
9
+ exports.SplitButton = React.forwardRef(function (props, ref) {
10
+ var state = useSplitButton_1.useSplitButton(props, ref, {
11
+ button: { as: index_1.Button },
12
+ menuButton: { as: index_2.MenuButton },
13
+ });
14
+ useSplitButtonStyles_1.useSplitButtonStyles(state);
15
+ return renderSplitButton_1.renderSplitButton(state);
16
+ });
17
+ exports.SplitButton.displayName = 'SplitButton';
18
+ });
19
+ //# sourceMappingURL=SplitButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SplitButton.js","sourceRoot":"../src/","sources":["components/SplitButton/SplitButton.tsx"],"names":[],"mappings":";;;;IAQA;;;OAGG;IACU,QAAA,WAAW,GAAG,KAAK,CAAC,UAAU,CAAgC,UAAC,KAAK,EAAE,GAAG;QACpF,IAAM,KAAK,GAAG,+BAAc,CAAC,KAAK,EAAE,GAAG,EAAE;YACvC,MAAM,EAAE,EAAE,EAAE,EAAE,cAAM,EAAE;YACtB,UAAU,EAAE,EAAE,EAAE,EAAE,kBAAU,EAAE;SAC/B,CAAC,CAAC;QAEH,2CAAoB,CAAC,KAAK,CAAC,CAAC;QAE5B,OAAO,qCAAiB,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,mBAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import * as React from 'react';\nimport { Button } from '../Button/index';\nimport { MenuButton } from '../MenuButton/index';\nimport { renderSplitButton } from './renderSplitButton';\nimport { useSplitButton } from './useSplitButton';\nimport { useSplitButtonStyles } from './useSplitButtonStyles';\nimport type { SplitButtonProps } from './SplitButton.types';\n\n/**\n * SplitButtons are a grouping of two interactive surfaces where the interacting with the first one triggers a primary\n * action, while interacting with the second one opens a menu with secondary actions.\n */\nexport const SplitButton = React.forwardRef<HTMLElement, SplitButtonProps>((props, ref) => {\n const state = useSplitButton(props, ref, {\n button: { as: Button },\n menuButton: { as: MenuButton },\n });\n\n useSplitButtonStyles(state);\n\n return renderSplitButton(state);\n});\n\nSplitButton.displayName = 'SplitButton';\n"]}
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ import type { ComponentStateCompat, ShorthandPropsCompat } from '@fluentui/react-utilities';
3
+ import type { ButtonProps, ButtonShorthandPropsCompat } from '../Button/Button.types';
4
+ import type { MenuButtonProps } from '../MenuButton/MenuButton.types';
5
+ export interface SplitButtonProps extends Omit<ButtonProps, ButtonShorthandPropsCompat>, MenuButtonProps {
6
+ /**
7
+ * Button to perform primary action in SplitButton.
8
+ */
9
+ button?: ShorthandPropsCompat<ButtonProps>;
10
+ /**
11
+ * Button that opens menu with secondary actions in SplitButton.
12
+ */
13
+ menuButton?: ShorthandPropsCompat<MenuButtonProps>;
14
+ /**
15
+ * Ref to the Button element.
16
+ */
17
+ buttonRef?: React.Ref<HTMLElement>;
18
+ /**
19
+ * Ref to the MenuButton element.
20
+ */
21
+ menuButtonRef?: React.Ref<HTMLElement>;
22
+ }
23
+ export declare type SplitButtonShorthandPropsCompat = 'button' | 'menuButton';
24
+ export declare type SplitButtonDefaultedProps = 'size';
25
+ export interface SplitButtonState extends ComponentStateCompat<SplitButtonProps, SplitButtonShorthandPropsCompat, SplitButtonDefaultedProps> {
26
+ /**
27
+ * Ref to the root element
28
+ */
29
+ ref: React.Ref<HTMLElement>;
30
+ }
@@ -0,0 +1,5 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ });
5
+ //# sourceMappingURL=SplitButton.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SplitButton.types.js","sourceRoot":"../src/","sources":["components/SplitButton/SplitButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentStateCompat, ShorthandPropsCompat } from '@fluentui/react-utilities';\nimport type { ButtonProps, ButtonShorthandPropsCompat } from '../Button/Button.types';\nimport type { MenuButtonProps } from '../MenuButton/MenuButton.types';\n\nexport interface SplitButtonProps extends Omit<ButtonProps, ButtonShorthandPropsCompat>, MenuButtonProps {\n /**\n * Button to perform primary action in SplitButton.\n */\n button?: ShorthandPropsCompat<ButtonProps>;\n\n /**\n * Button that opens menu with secondary actions in SplitButton.\n */\n menuButton?: ShorthandPropsCompat<MenuButtonProps>;\n\n /**\n * Ref to the Button element.\n */\n buttonRef?: React.Ref<HTMLElement>;\n\n /**\n * Ref to the MenuButton element.\n */\n menuButtonRef?: React.Ref<HTMLElement>;\n}\n\nexport type SplitButtonShorthandPropsCompat = 'button' | 'menuButton';\n\nexport type SplitButtonDefaultedProps = 'size';\n\nexport interface SplitButtonState\n extends ComponentStateCompat<SplitButtonProps, SplitButtonShorthandPropsCompat, SplitButtonDefaultedProps> {\n /**\n * Ref to the root element\n */\n ref: React.Ref<HTMLElement>;\n}\n"]}
@@ -0,0 +1,5 @@
1
+ export * from './SplitButton';
2
+ export * from './SplitButton.types';
3
+ export * from './renderSplitButton';
4
+ export * from './useSplitButton';
5
+ export { useSplitButtonStyles } from './useSplitButtonStyles';
@@ -0,0 +1,11 @@
1
+ define(["require", "exports", "tslib", "./SplitButton", "./SplitButton.types", "./renderSplitButton", "./useSplitButton", "./useSplitButtonStyles"], function (require, exports, tslib_1, SplitButton_1, SplitButton_types_1, renderSplitButton_1, useSplitButton_1, useSplitButtonStyles_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useSplitButtonStyles = void 0;
5
+ tslib_1.__exportStar(SplitButton_1, exports);
6
+ tslib_1.__exportStar(SplitButton_types_1, exports);
7
+ tslib_1.__exportStar(renderSplitButton_1, exports);
8
+ tslib_1.__exportStar(useSplitButton_1, exports);
9
+ Object.defineProperty(exports, "useSplitButtonStyles", { enumerable: true, get: function () { return useSplitButtonStyles_1.useSplitButtonStyles; } });
10
+ });
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/SplitButton/index.ts"],"names":[],"mappings":";;;;IAAA,6CAA8B;IAC9B,mDAAoC;IACpC,mDAAoC;IACpC,gDAAiC;IACxB,4HAAA,oBAAoB,OAAA","sourcesContent":["export * from './SplitButton';\nexport * from './SplitButton.types';\nexport * from './renderSplitButton';\nexport * from './useSplitButton';\nexport { useSplitButtonStyles } from './useSplitButtonStyles';\n"]}
@@ -0,0 +1,5 @@
1
+ import type { SplitButtonState } from './SplitButton.types';
2
+ /**
3
+ * Renders a SplitButton component by passing the state defined props to the appropriate slots.
4
+ */
5
+ export declare const renderSplitButton: (state: SplitButtonState) => JSX.Element;
@@ -0,0 +1,16 @@
1
+ define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "./useSplitButton"], function (require, exports, tslib_1, React, react_utilities_1, useSplitButton_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.renderSplitButton = void 0;
5
+ /**
6
+ * Renders a SplitButton component by passing the state defined props to the appropriate slots.
7
+ */
8
+ var renderSplitButton = function (state) {
9
+ var _a = react_utilities_1.getSlotsCompat(state, useSplitButton_1.splitButtonShorthandProps), slots = _a.slots, slotProps = _a.slotProps;
10
+ return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
11
+ React.createElement(slots.button, tslib_1.__assign({}, slotProps.button)),
12
+ React.createElement(slots.menuButton, tslib_1.__assign({}, slotProps.menuButton))));
13
+ };
14
+ exports.renderSplitButton = renderSplitButton;
15
+ });
16
+ //# sourceMappingURL=renderSplitButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderSplitButton.js","sourceRoot":"../src/","sources":["components/SplitButton/renderSplitButton.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,iBAAiB,GAAG,UAAC,KAAuB;QACjD,IAAA,KAAuB,gCAAc,CAAC,KAAK,EAAE,0CAAyB,CAAC,EAArE,KAAK,WAAA,EAAE,SAAS,eAAqD,CAAC;QAE9E,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC5B,oBAAC,KAAK,CAAC,MAAM,uBAAK,SAAS,CAAC,MAAM,EAAI;YACtC,oBAAC,KAAK,CAAC,UAAU,uBAAK,SAAS,CAAC,UAAU,EAAI,CACnC,CACd,CAAC;IACJ,CAAC,CAAC;IATW,QAAA,iBAAiB,qBAS5B","sourcesContent":["import * as React from 'react';\nimport { getSlotsCompat } from '@fluentui/react-utilities';\nimport { splitButtonShorthandProps } from './useSplitButton';\nimport type { SplitButtonState } from './SplitButton.types';\n\n/**\n * Renders a SplitButton component by passing the state defined props to the appropriate slots.\n */\nexport const renderSplitButton = (state: SplitButtonState) => {\n const { slots, slotProps } = getSlotsCompat(state, splitButtonShorthandProps);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.button {...slotProps.button} />\n <slots.menuButton {...slotProps.menuButton} />\n </slots.root>\n );\n};\n"]}
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import type { SplitButtonProps, SplitButtonShorthandPropsCompat, SplitButtonState } from './SplitButton.types';
3
+ export declare const splitButtonShorthandProps: SplitButtonShorthandPropsCompat[];
4
+ /**
5
+ * Given user props, defines default props for the SplitButton and returns processed state.
6
+ * @param props - User provided props to the SplitButton component.
7
+ * @param ref - User provided ref to be passed to the SplitButton component.
8
+ */
9
+ export declare const useSplitButton: (props: SplitButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: SplitButtonProps | undefined) => SplitButtonState;
@@ -0,0 +1,55 @@
1
+ define(["require", "exports", "tslib", "@fluentui/react-utilities"], function (require, exports, tslib_1, react_utilities_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useSplitButton = exports.splitButtonShorthandProps = void 0;
5
+ exports.splitButtonShorthandProps = ['button', 'menuButton'];
6
+ var mergeProps = react_utilities_1.makeMergeProps({ deepMerge: exports.splitButtonShorthandProps });
7
+ /**
8
+ * Given user props, defines default props for the SplitButton and returns processed state.
9
+ * @param props - User provided props to the SplitButton component.
10
+ * @param ref - User provided ref to be passed to the SplitButton component.
11
+ */
12
+ var useSplitButton = function (props, ref, defaultProps) {
13
+ var resolvedShorthandProps = react_utilities_1.resolveShorthandProps(props, exports.splitButtonShorthandProps);
14
+ var className = props.className;
15
+ var button = resolvedShorthandProps.button, buttonRef = resolvedShorthandProps.buttonRef, circular = resolvedShorthandProps.circular, disabled = resolvedShorthandProps.disabled, disabledFocusable = resolvedShorthandProps.disabledFocusable, menuButton = resolvedShorthandProps.menuButton, menuButtonRef = resolvedShorthandProps.menuButtonRef, outline = resolvedShorthandProps.outline, primary = resolvedShorthandProps.primary, _a = resolvedShorthandProps.size, size = _a === void 0 ? 'medium' : _a, subtle = resolvedShorthandProps.subtle, transparent = resolvedShorthandProps.transparent, userProps = tslib_1.__rest(resolvedShorthandProps, ["button", "buttonRef", "circular", "disabled", "disabledFocusable", "menuButton", "menuButtonRef", "outline", "primary", "size", "subtle", "transparent"]);
16
+ // TODO: To be resolved when moving to simplified prop merging
17
+ // const buttonInternalRef = React.useRef<HTMLElement | null>(null);
18
+ // const menuButtonInternalRef = React.useRef<HTMLElement | null>(null);
19
+ var state = mergeProps({
20
+ 'aria-disabled': disabled,
21
+ as: 'div',
22
+ className: className,
23
+ ref: ref,
24
+ size: size,
25
+ button: tslib_1.__assign(tslib_1.__assign({ as: 'button',
26
+ // TODO: To be resolved when moving to simplified prop merging
27
+ // ref: useMergedRefs(buttonRef, buttonInternalRef),
28
+ circular: circular,
29
+ disabled: disabled,
30
+ disabledFocusable: disabledFocusable,
31
+ outline: outline,
32
+ primary: primary,
33
+ size: size,
34
+ subtle: subtle,
35
+ transparent: transparent }, userProps), button),
36
+ menuButton: tslib_1.__assign({ as: 'button',
37
+ // TODO: To be resolved when moving to simplified prop merging
38
+ // ref: useMergedRefs(menuButtonRef, menuButtonInternalRef),
39
+ circular: circular,
40
+ disabled: disabled,
41
+ disabledFocusable: disabledFocusable,
42
+ outline: outline,
43
+ primary: primary,
44
+ size: size,
45
+ subtle: subtle,
46
+ transparent: transparent }, menuButton),
47
+ },
48
+ // TODO: To be resolved when moving to simplified prop merging
49
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
+ defaultProps, resolvedShorthandProps);
51
+ return state;
52
+ };
53
+ exports.useSplitButton = useSplitButton;
54
+ });
55
+ //# sourceMappingURL=useSplitButton.js.map