@fluentui/react-button 9.0.0-nightly.d730088d7f.0 → 9.0.0-rc.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (223) hide show
  1. package/CHANGELOG.json +864 -27
  2. package/CHANGELOG.md +375 -181
  3. package/dist/{react-button.d.ts → index.d.ts} +97 -53
  4. package/{lib → dist}/tsdoc-metadata.json +0 -0
  5. package/lib/Button.js.map +1 -1
  6. package/lib/CompoundButton.js.map +1 -1
  7. package/lib/MenuButton.js.map +1 -1
  8. package/lib/SplitButton.js.map +1 -1
  9. package/lib/ToggleButton.js.map +1 -1
  10. package/lib/components/Button/Button.js +7 -7
  11. package/lib/components/Button/Button.js.map +1 -1
  12. package/lib/components/Button/Button.types.js.map +1 -1
  13. package/lib/components/Button/index.js +3 -2
  14. package/lib/components/Button/index.js.map +1 -1
  15. package/lib/components/Button/renderButton.js +13 -9
  16. package/lib/components/Button/renderButton.js.map +1 -1
  17. package/lib/components/Button/useButton.js +23 -25
  18. package/lib/components/Button/useButton.js.map +1 -1
  19. package/lib/components/Button/useButtonStyles.js +248 -162
  20. package/lib/components/Button/useButtonStyles.js.map +1 -1
  21. package/lib/components/CompoundButton/CompoundButton.js +7 -7
  22. package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
  23. package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
  24. package/lib/components/CompoundButton/index.js +3 -1
  25. package/lib/components/CompoundButton/index.js.map +1 -1
  26. package/lib/components/CompoundButton/renderCompoundButton.js +15 -9
  27. package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
  28. package/lib/components/CompoundButton/useCompoundButton.js +13 -8
  29. package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
  30. package/lib/components/CompoundButton/useCompoundButtonStyles.js +101 -75
  31. package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  32. package/lib/components/MenuButton/MenuButton.js +7 -7
  33. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  34. package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
  35. package/lib/components/MenuButton/index.js +3 -1
  36. package/lib/components/MenuButton/index.js.map +1 -1
  37. package/lib/components/MenuButton/renderMenuButton.js +13 -9
  38. package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
  39. package/lib/components/MenuButton/useMenuButton.js +11 -11
  40. package/lib/components/MenuButton/useMenuButton.js.map +1 -1
  41. package/lib/components/MenuButton/useMenuButtonStyles.js +44 -17
  42. package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  43. package/lib/components/SplitButton/SplitButton.js +7 -7
  44. package/lib/components/SplitButton/SplitButton.js.map +1 -1
  45. package/lib/components/SplitButton/SplitButton.types.js.map +1 -1
  46. package/lib/components/SplitButton/index.js +3 -1
  47. package/lib/components/SplitButton/index.js.map +1 -1
  48. package/lib/components/SplitButton/renderSplitButton.js +9 -7
  49. package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
  50. package/lib/components/SplitButton/useSplitButton.js +58 -49
  51. package/lib/components/SplitButton/useSplitButton.js.map +1 -1
  52. package/lib/components/SplitButton/useSplitButtonStyles.js +53 -36
  53. package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
  54. package/lib/components/ToggleButton/ToggleButton.js +7 -7
  55. package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
  56. package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -1
  57. package/lib/components/ToggleButton/index.js +3 -1
  58. package/lib/components/ToggleButton/index.js.map +1 -1
  59. package/lib/components/ToggleButton/renderToggleButton.js +1 -1
  60. package/lib/components/ToggleButton/renderToggleButton.js.map +1 -1
  61. package/lib/components/ToggleButton/useToggleButton.js +5 -41
  62. package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
  63. package/lib/components/ToggleButton/useToggleButtonStyles.js +114 -85
  64. package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  65. package/lib/index.js +11 -5
  66. package/lib/index.js.map +1 -1
  67. package/lib/utils/index.js +2 -0
  68. package/lib/utils/index.js.map +1 -0
  69. package/lib/utils/useToggleState.js +37 -0
  70. package/lib/utils/useToggleState.js.map +1 -0
  71. package/lib-commonjs/Button.js +1 -1
  72. package/lib-commonjs/Button.js.map +1 -1
  73. package/lib-commonjs/CompoundButton.js +1 -1
  74. package/lib-commonjs/CompoundButton.js.map +1 -1
  75. package/lib-commonjs/MenuButton.js +1 -1
  76. package/lib-commonjs/MenuButton.js.map +1 -1
  77. package/lib-commonjs/SplitButton.js +1 -1
  78. package/lib-commonjs/SplitButton.js.map +1 -1
  79. package/lib-commonjs/ToggleButton.js +1 -1
  80. package/lib-commonjs/ToggleButton.js.map +1 -1
  81. package/lib-commonjs/components/Button/Button.js +8 -8
  82. package/lib-commonjs/components/Button/Button.js.map +1 -1
  83. package/lib-commonjs/components/Button/Button.types.js.map +1 -1
  84. package/lib-commonjs/components/Button/index.js +18 -6
  85. package/lib-commonjs/components/Button/index.js.map +1 -1
  86. package/lib-commonjs/components/Button/renderButton.js +17 -14
  87. package/lib-commonjs/components/Button/renderButton.js.map +1 -1
  88. package/lib-commonjs/components/Button/useButton.js +27 -29
  89. package/lib-commonjs/components/Button/useButton.js.map +1 -1
  90. package/lib-commonjs/components/Button/useButtonStyles.js +251 -163
  91. package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
  92. package/lib-commonjs/components/CompoundButton/CompoundButton.js +8 -8
  93. package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
  94. package/lib-commonjs/components/CompoundButton/CompoundButton.types.js.map +1 -1
  95. package/lib-commonjs/components/CompoundButton/index.js +18 -4
  96. package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
  97. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +19 -14
  98. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
  99. package/lib-commonjs/components/CompoundButton/useCompoundButton.js +16 -12
  100. package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
  101. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +104 -77
  102. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  103. package/lib-commonjs/components/MenuButton/MenuButton.js +8 -8
  104. package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
  105. package/lib-commonjs/components/MenuButton/MenuButton.types.js.map +1 -1
  106. package/lib-commonjs/components/MenuButton/index.js +18 -4
  107. package/lib-commonjs/components/MenuButton/index.js.map +1 -1
  108. package/lib-commonjs/components/MenuButton/renderMenuButton.js +17 -14
  109. package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
  110. package/lib-commonjs/components/MenuButton/useMenuButton.js +15 -16
  111. package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
  112. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +48 -19
  113. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  114. package/lib-commonjs/components/SplitButton/SplitButton.js +8 -8
  115. package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
  116. package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -1
  117. package/lib-commonjs/components/SplitButton/index.js +18 -4
  118. package/lib-commonjs/components/SplitButton/index.js.map +1 -1
  119. package/lib-commonjs/components/SplitButton/renderSplitButton.js +13 -12
  120. package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
  121. package/lib-commonjs/components/SplitButton/useSplitButton.js +62 -54
  122. package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
  123. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +57 -39
  124. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
  125. package/lib-commonjs/components/ToggleButton/ToggleButton.js +8 -8
  126. package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
  127. package/lib-commonjs/components/ToggleButton/ToggleButton.types.js.map +1 -1
  128. package/lib-commonjs/components/ToggleButton/index.js +18 -4
  129. package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
  130. package/lib-commonjs/components/ToggleButton/renderToggleButton.js +3 -3
  131. package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
  132. package/lib-commonjs/components/ToggleButton/useToggleButton.js +7 -45
  133. package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
  134. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +119 -86
  135. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  136. package/lib-commonjs/index.js +204 -6
  137. package/lib-commonjs/index.js.map +1 -1
  138. package/lib-commonjs/utils/index.js +10 -0
  139. package/lib-commonjs/utils/index.js.map +1 -0
  140. package/lib-commonjs/utils/useToggleState.js +48 -0
  141. package/lib-commonjs/utils/useToggleState.js.map +1 -0
  142. package/package.json +22 -27
  143. package/dist/demo/index.html +0 -71
  144. package/dist/demo/react-dom.development.js +0 -21413
  145. package/dist/demo/react.development.js +0 -3155
  146. package/lib/Button.d.ts +0 -1
  147. package/lib/CompoundButton.d.ts +0 -1
  148. package/lib/MenuButton.d.ts +0 -1
  149. package/lib/SplitButton.d.ts +0 -1
  150. package/lib/ToggleButton.d.ts +0 -1
  151. package/lib/common/isConformant.d.ts +0 -4
  152. package/lib/common/isConformant.js +0 -13
  153. package/lib/common/isConformant.js.map +0 -1
  154. package/lib/components/Button/Button.d.ts +0 -6
  155. package/lib/components/Button/Button.types.d.ts +0 -62
  156. package/lib/components/Button/index.d.ts +0 -5
  157. package/lib/components/Button/renderButton.d.ts +0 -5
  158. package/lib/components/Button/useButton.d.ts +0 -8
  159. package/lib/components/Button/useButtonStyles.d.ts +0 -10
  160. package/lib/components/CompoundButton/CompoundButton.d.ts +0 -6
  161. package/lib/components/CompoundButton/CompoundButton.types.d.ts +0 -14
  162. package/lib/components/CompoundButton/index.d.ts +0 -5
  163. package/lib/components/CompoundButton/renderCompoundButton.d.ts +0 -5
  164. package/lib/components/CompoundButton/useCompoundButton.d.ts +0 -8
  165. package/lib/components/CompoundButton/useCompoundButtonStyles.d.ts +0 -2
  166. package/lib/components/MenuButton/MenuButton.d.ts +0 -6
  167. package/lib/components/MenuButton/MenuButton.types.d.ts +0 -11
  168. package/lib/components/MenuButton/index.d.ts +0 -5
  169. package/lib/components/MenuButton/renderMenuButton.d.ts +0 -5
  170. package/lib/components/MenuButton/useMenuButton.d.ts +0 -6
  171. package/lib/components/MenuButton/useMenuButtonStyles.d.ts +0 -2
  172. package/lib/components/SplitButton/SplitButton.d.ts +0 -7
  173. package/lib/components/SplitButton/SplitButton.types.d.ts +0 -19
  174. package/lib/components/SplitButton/index.d.ts +0 -5
  175. package/lib/components/SplitButton/renderSplitButton.d.ts +0 -5
  176. package/lib/components/SplitButton/useSplitButton.d.ts +0 -8
  177. package/lib/components/SplitButton/useSplitButtonStyles.d.ts +0 -2
  178. package/lib/components/ToggleButton/ToggleButton.d.ts +0 -6
  179. package/lib/components/ToggleButton/ToggleButton.types.d.ts +0 -19
  180. package/lib/components/ToggleButton/index.d.ts +0 -5
  181. package/lib/components/ToggleButton/renderToggleButton.d.ts +0 -1
  182. package/lib/components/ToggleButton/useToggleButton.d.ts +0 -9
  183. package/lib/components/ToggleButton/useToggleButtonStyles.d.ts +0 -2
  184. package/lib/index.d.ts +0 -5
  185. package/lib-commonjs/Button.d.ts +0 -1
  186. package/lib-commonjs/CompoundButton.d.ts +0 -1
  187. package/lib-commonjs/MenuButton.d.ts +0 -1
  188. package/lib-commonjs/SplitButton.d.ts +0 -1
  189. package/lib-commonjs/ToggleButton.d.ts +0 -1
  190. package/lib-commonjs/common/isConformant.d.ts +0 -4
  191. package/lib-commonjs/common/isConformant.js +0 -24
  192. package/lib-commonjs/common/isConformant.js.map +0 -1
  193. package/lib-commonjs/components/Button/Button.d.ts +0 -6
  194. package/lib-commonjs/components/Button/Button.types.d.ts +0 -62
  195. package/lib-commonjs/components/Button/index.d.ts +0 -5
  196. package/lib-commonjs/components/Button/renderButton.d.ts +0 -5
  197. package/lib-commonjs/components/Button/useButton.d.ts +0 -8
  198. package/lib-commonjs/components/Button/useButtonStyles.d.ts +0 -10
  199. package/lib-commonjs/components/CompoundButton/CompoundButton.d.ts +0 -6
  200. package/lib-commonjs/components/CompoundButton/CompoundButton.types.d.ts +0 -14
  201. package/lib-commonjs/components/CompoundButton/index.d.ts +0 -5
  202. package/lib-commonjs/components/CompoundButton/renderCompoundButton.d.ts +0 -5
  203. package/lib-commonjs/components/CompoundButton/useCompoundButton.d.ts +0 -8
  204. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.d.ts +0 -2
  205. package/lib-commonjs/components/MenuButton/MenuButton.d.ts +0 -6
  206. package/lib-commonjs/components/MenuButton/MenuButton.types.d.ts +0 -11
  207. package/lib-commonjs/components/MenuButton/index.d.ts +0 -5
  208. package/lib-commonjs/components/MenuButton/renderMenuButton.d.ts +0 -5
  209. package/lib-commonjs/components/MenuButton/useMenuButton.d.ts +0 -6
  210. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.d.ts +0 -2
  211. package/lib-commonjs/components/SplitButton/SplitButton.d.ts +0 -7
  212. package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +0 -19
  213. package/lib-commonjs/components/SplitButton/index.d.ts +0 -5
  214. package/lib-commonjs/components/SplitButton/renderSplitButton.d.ts +0 -5
  215. package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +0 -8
  216. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +0 -2
  217. package/lib-commonjs/components/ToggleButton/ToggleButton.d.ts +0 -6
  218. package/lib-commonjs/components/ToggleButton/ToggleButton.types.d.ts +0 -19
  219. package/lib-commonjs/components/ToggleButton/index.d.ts +0 -5
  220. package/lib-commonjs/components/ToggleButton/renderToggleButton.d.ts +0 -1
  221. package/lib-commonjs/components/ToggleButton/useToggleButton.d.ts +0 -9
  222. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.d.ts +0 -2
  223. package/lib-commonjs/index.d.ts +0 -5
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Button/useButton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1BU,CAAvB;;AA6BA,MAAI,KAAK,CAAC,IAAV,EAAgB;AACd,IAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,gBAAA,CAAiB,IADI,EAErB,UAAU,CAAC,IAFU,EAGrB,KAAK,CAAC,IAAN,CAAW,QAAX,KAAwB,SAAxB,IAAqC,KAAK,CAAC,IAAN,CAAW,QAAX,KAAwB,IAA7D,IAAqE,UAAU,CAAC,YAAD,CAH1D,EAIrB,UAAU,CAAC,IAAD,CAJW,EAKrB,KAAK,CAAC,IAAN,CAAW,SALU,CAAvB;AAOD;;AAED,SAAO,KAAP;AACD,CA3DM;;AAAM,OAAA,CAAA,wBAAA,GAAwB,wBAAxB","sourcesContent":["import { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { shorthands, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { ButtonSlots, ButtonState } from './Button.types';\n\nexport const buttonClassNames: SlotClassNames<ButtonSlots> = {\n root: 'fui-Button',\n icon: 'fui-Button__icon',\n};\n/**\n * @deprecated Use `buttonClassNames.root` instead.\n */\nexport const buttonClassName = buttonClassNames.root;\n\nconst iconSpacingVar = '--fui-Button__icon--spacing';\n\nconst useRootStyles = makeStyles({\n // Base styles\n base: {\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n verticalAlign: 'middle',\n\n ...shorthands.margin(0),\n\n maxWidth: '280px',\n\n ...shorthands.overflow('hidden'),\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground1,\n ...shorthands.border(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke1),\n\n fontFamily: tokens.fontFamilyBase,\n\n outlineStyle: 'none',\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n color: tokens.colorNeutralForeground1Hover,\n\n cursor: 'pointer',\n\n [`& .${iconFilledClassName}`]: {\n display: 'inline',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none',\n },\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n color: tokens.colorNeutralForeground1Pressed,\n\n outlineStyle: 'none',\n\n [`& .${iconFilledClassName}`]: {\n display: 'inline',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none',\n },\n },\n },\n\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n ':focus': {\n ...shorthands.borderColor('ButtonText'),\n },\n\n ':hover': {\n ...shorthands.borderColor('Highlight'),\n color: 'Highlight',\n },\n\n ':hover:active': {\n color: 'Highlight',\n },\n },\n },\n\n // Block styles\n block: {\n maxWidth: '100%',\n width: '100%',\n },\n\n // Appearance variations\n outline: {\n backgroundColor: tokens.colorTransparentBackground,\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n },\n },\n primary: {\n backgroundColor: tokens.colorBrandBackground,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n\n ':hover': {\n backgroundColor: tokens.colorBrandBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorBrandBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n secondary: {\n /* The secondary styles are exactly the same as the base styles. */\n },\n subtle: {\n backgroundColor: tokens.colorSubtleBackground,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2,\n\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandHover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n transparent: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2,\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandHover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n\n // Shape variations\n circular: {\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n },\n rounded: {\n /* The borderRadius rounded styles are handled in the size variations */\n },\n square: {\n ...shorthands.borderRadius(tokens.borderRadiusNone),\n },\n\n // Size variations\n small: {\n ...shorthands.padding(tokens.spacingVerticalNone, tokens.spacingHorizontalS),\n\n height: '24px',\n minWidth: '64px',\n\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n\n fontSize: tokens.fontSizeBase200,\n fontWeight: tokens.fontWeightRegular,\n lineHeight: tokens.lineHeightBase200,\n },\n medium: {\n ...shorthands.padding(tokens.spacingVerticalNone, tokens.spacingHorizontalM),\n\n height: '32px',\n minWidth: '96px',\n\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n\n fontSize: tokens.fontSizeBase300,\n fontWeight: tokens.fontWeightSemibold,\n lineHeight: tokens.lineHeightBase300,\n },\n large: {\n ...shorthands.padding(tokens.spacingVerticalNone, tokens.spacingHorizontalL),\n\n height: '40px',\n minWidth: '96px',\n\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n\n fontSize: tokens.fontSizeBase400,\n fontWeight: tokens.fontWeightSemibold,\n lineHeight: tokens.lineHeightBase400,\n },\n});\n\nconst useRootDisabledStyles = makeStyles({\n // Base styles\n base: {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n\n cursor: 'not-allowed',\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n\n cursor: 'not-allowed',\n\n [`& .${iconFilledClassName}`]: {\n display: 'none',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'inline',\n },\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n\n cursor: 'not-allowed',\n\n [`& .${iconFilledClassName}`]: {\n display: 'none',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'inline',\n },\n },\n },\n\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n color: 'GrayText',\n\n ':focus': {\n ...shorthands.borderColor('GrayText'),\n },\n\n ':hover': {\n ...shorthands.borderColor('GrayText'),\n color: 'GrayText',\n },\n\n ':hover:active': {\n ...shorthands.borderColor('GrayText'),\n color: 'GrayText',\n },\n },\n },\n\n // Appearance variations\n outline: {\n backgroundColor: tokens.colorTransparentBackground,\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n },\n },\n primary: {\n ...shorthands.borderColor('transparent'),\n\n ':hover': {\n ...shorthands.borderColor('transparent'),\n },\n\n ':hover:active': {\n ...shorthands.borderColor('transparent'),\n },\n },\n secondary: {\n /* The secondary styles are exactly the same as the base styles. */\n },\n subtle: {\n backgroundColor: 'transparent',\n ...shorthands.borderColor('transparent'),\n\n ':hover': {\n backgroundColor: 'transparent',\n ...shorthands.borderColor('transparent'),\n },\n\n ':hover:active': {\n backgroundColor: 'transparent',\n ...shorthands.borderColor('transparent'),\n },\n },\n transparent: {\n backgroundColor: 'transparent',\n ...shorthands.borderColor('transparent'),\n\n ':hover': {\n backgroundColor: 'transparent',\n ...shorthands.borderColor('transparent'),\n },\n\n ':hover:active': {\n backgroundColor: 'transparent',\n ...shorthands.borderColor('transparent'),\n },\n },\n});\n\nconst useRootFocusStyles = makeStyles({\n base: createCustomFocusIndicatorStyle({\n ...shorthands.borderColor('transparent'),\n outlineColor: 'transparent',\n outlineWidth: tokens.strokeWidthThick,\n outlineStyle: 'solid',\n boxShadow: `\n ${tokens.shadow4},\n 0 0 0 2px ${tokens.colorStrokeFocus2}\n `,\n zIndex: 1,\n }),\n\n circular: createCustomFocusIndicatorStyle({\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n }),\n rounded: {},\n // Primary styles\n primary: createCustomFocusIndicatorStyle({\n ...shorthands.borderColor(tokens.colorNeutralForegroundOnBrand),\n boxShadow: `${tokens.shadow2}, 0 0 0 2px ${tokens.colorStrokeFocus2}`,\n }),\n square: createCustomFocusIndicatorStyle({\n ...shorthands.borderRadius(tokens.borderRadiusNone),\n }),\n\n // Size variations\n small: createCustomFocusIndicatorStyle({\n ...shorthands.borderRadius(tokens.borderRadiusSmall),\n }),\n medium: createCustomFocusIndicatorStyle({\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n }),\n large: createCustomFocusIndicatorStyle({\n ...shorthands.borderRadius(tokens.borderRadiusLarge),\n }),\n});\n\nconst useRootIconOnlyStyles = makeStyles({\n // Size variations\n small: {\n ...shorthands.padding(tokens.spacingHorizontalXS),\n\n minWidth: '28px',\n maxWidth: '28px',\n },\n medium: {\n ...shorthands.padding(tokens.spacingHorizontalXS),\n\n minWidth: '32px',\n maxWidth: '32px',\n },\n large: {\n ...shorthands.padding(tokens.spacingHorizontalSNudge),\n\n minWidth: '40px',\n maxWidth: '40px',\n },\n});\n\nconst useIconStyles = makeStyles({\n // Base styles\n base: {\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n },\n\n // Size variations\n small: {\n fontSize: '20px',\n height: '20px',\n width: '20px',\n\n [iconSpacingVar]: tokens.spacingHorizontalXS,\n },\n medium: {\n fontSize: '20px',\n height: '20px',\n width: '20px',\n\n [iconSpacingVar]: tokens.spacingHorizontalSNudge,\n },\n large: {\n fontSize: '24px',\n height: '24px',\n width: '24px',\n\n [iconSpacingVar]: tokens.spacingHorizontalSNudge,\n },\n\n // Icon position variations\n before: {\n marginRight: `var(${iconSpacingVar})`,\n },\n after: {\n marginLeft: `var(${iconSpacingVar})`,\n },\n});\n\nexport const useButtonStyles_unstable = (state: ButtonState): ButtonState => {\n const rootStyles = useRootStyles();\n const rootDisabledStyles = useRootDisabledStyles();\n const rootFocusStyles = useRootFocusStyles();\n const rootIconOnlyStyles = useRootIconOnlyStyles();\n const iconStyles = useIconStyles();\n\n const {\n appearance,\n // eslint-disable-next-line deprecation/deprecation\n block,\n disabled,\n disabledFocusable,\n iconOnly,\n iconPosition,\n shape,\n size,\n } = state;\n\n state.root.className = mergeClasses(\n buttonClassNames.root,\n\n // Root styles\n rootStyles.base,\n rootStyles.highContrast,\n block && rootStyles.block,\n appearance && rootStyles[appearance],\n rootStyles[size],\n rootStyles[shape],\n\n // Disabled styles\n (disabled || disabledFocusable) && rootDisabledStyles.base,\n (disabled || disabledFocusable) && rootDisabledStyles.highContrast,\n appearance && (disabled || disabledFocusable) && rootDisabledStyles[appearance],\n\n // Focus styles\n rootFocusStyles.base,\n appearance === 'primary' && rootFocusStyles.primary,\n rootFocusStyles[size],\n rootFocusStyles[shape],\n\n // Icon-only styles\n iconOnly && rootIconOnlyStyles[size],\n\n // User provided class name\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n buttonClassNames.icon,\n iconStyles.base,\n state.root.children !== undefined && state.root.children !== null && iconStyles[iconPosition],\n iconStyles[size],\n state.icon.className,\n );\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -5,22 +5,22 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.CompoundButton = void 0;
7
7
 
8
- var React = /*#__PURE__*/require("react");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var renderCompoundButton_1 = /*#__PURE__*/require("./renderCompoundButton");
10
+ const renderCompoundButton_1 = /*#__PURE__*/require("./renderCompoundButton");
11
11
 
12
- var useCompoundButton_1 = /*#__PURE__*/require("./useCompoundButton");
12
+ const useCompoundButton_1 = /*#__PURE__*/require("./useCompoundButton");
13
13
 
14
- var useCompoundButtonStyles_1 = /*#__PURE__*/require("./useCompoundButtonStyles");
14
+ const useCompoundButtonStyles_1 = /*#__PURE__*/require("./useCompoundButtonStyles");
15
15
  /**
16
16
  * CompoundButtons are buttons that can have secondary content that adds extra information to the user.
17
17
  */
18
18
 
19
19
 
20
- exports.CompoundButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
21
- var state = useCompoundButton_1.useCompoundButton(props, ref);
22
- useCompoundButtonStyles_1.useCompoundButtonStyles(state);
23
- return renderCompoundButton_1.renderCompoundButton(state); // Casting is required due to lack of distributive union to support unions on @types/react
20
+ exports.CompoundButton = /*#__PURE__*/React.forwardRef((props, ref) => {
21
+ const state = useCompoundButton_1.useCompoundButton_unstable(props, ref);
22
+ useCompoundButtonStyles_1.useCompoundButtonStyles_unstable(state);
23
+ return renderCompoundButton_1.renderCompoundButton_unstable(state); // Casting is required due to lack of distributive union to support unions on @types/react
24
24
  });
25
25
  exports.CompoundButton.displayName = 'CompoundButton';
26
26
  //# sourceMappingURL=CompoundButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/CompoundButton/CompoundButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,IAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,IAAA,yBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,cAAA,gBAA2D,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAClG,MAAM,KAAK,GAAG,mBAAA,CAAA,iBAAA,CAAkB,KAAlB,EAAyB,GAAzB,CAAd;AAEA,EAAA,yBAAA,CAAA,uBAAA,CAAwB,KAAxB;AAEA,SAAO,sBAAA,CAAA,oBAAA,CAAqB,KAArB,CAAP,CALkG,CAMlG;AACD,CAPuE,CAA3D;AASb,OAAA,CAAA,cAAA,CAAe,WAAf,GAA6B,gBAA7B","sourceRoot":""}
1
+ {"version":3,"sources":["components/CompoundButton/CompoundButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,MAAA,yBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,cAAA,gBAA2D,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACtG,QAAM,KAAK,GAAG,mBAAA,CAAA,0BAAA,CAA2B,KAA3B,EAAkC,GAAlC,CAAd;AAEA,EAAA,yBAAA,CAAA,gCAAA,CAAiC,KAAjC;AAEA,SAAO,sBAAA,CAAA,6BAAA,CAA8B,KAA9B,CAAP,CALsG,CAMtG;AACD,CAPuE,CAA3D;AASb,OAAA,CAAA,cAAA,CAAe,WAAf,GAA6B,gBAA7B","sourcesContent":["import * as React from 'react';\nimport { renderCompoundButton_unstable } from './renderCompoundButton';\nimport { useCompoundButton_unstable } from './useCompoundButton';\nimport { useCompoundButtonStyles_unstable } from './useCompoundButtonStyles';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { CompoundButtonProps } from './CompoundButton.types';\n\n/**\n * CompoundButtons are buttons that can have secondary content that adds extra information to the user.\n */\nexport const CompoundButton: ForwardRefComponent<CompoundButtonProps> = React.forwardRef((props, ref) => {\n const state = useCompoundButton_unstable(props, ref);\n\n useCompoundButtonStyles_unstable(state);\n\n return renderCompoundButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<CompoundButtonProps>;\n\nCompoundButton.displayName = 'CompoundButton';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useCompoundButtonStyles = void 0;
6
+ exports.useCompoundButtonStyles_unstable = exports.compoundButtonClassNames = exports.compoundButtonClassName = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const tslib_1 = /*#__PURE__*/require("tslib");
9
9
 
10
10
  tslib_1.__exportStar(require("./CompoundButton"), exports);
11
11
 
@@ -16,11 +16,25 @@ tslib_1.__exportStar(require("./renderCompoundButton"), exports);
16
16
  tslib_1.__exportStar(require("./useCompoundButton"), exports);
17
17
 
18
18
  var useCompoundButtonStyles_1 = /*#__PURE__*/require("./useCompoundButtonStyles");
19
+ /* eslint-disable-next-line deprecation/deprecation */
19
20
 
20
- Object.defineProperty(exports, "useCompoundButtonStyles", {
21
+
22
+ Object.defineProperty(exports, "compoundButtonClassName", {
23
+ enumerable: true,
24
+ get: function () {
25
+ return useCompoundButtonStyles_1.compoundButtonClassName;
26
+ }
27
+ });
28
+ Object.defineProperty(exports, "compoundButtonClassNames", {
29
+ enumerable: true,
30
+ get: function () {
31
+ return useCompoundButtonStyles_1.compoundButtonClassNames;
32
+ }
33
+ });
34
+ Object.defineProperty(exports, "useCompoundButtonStyles_unstable", {
21
35
  enumerable: true,
22
36
  get: function () {
23
- return useCompoundButtonStyles_1.useCompoundButtonStyles;
37
+ return useCompoundButtonStyles_1.useCompoundButtonStyles_unstable;
24
38
  }
25
39
  });
26
40
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/CompoundButton/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,IAAA,yBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,yBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,yBAAA,CAAA,uBAAA;AAAuB;AAAvB,CAAA","sourceRoot":""}
1
+ {"version":3,"sources":["components/CompoundButton/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,wBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,IAAA,yBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AACE;;;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,yBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,yBAAA,CAAA,uBAAA;AAAuB;AAAvB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,0BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,yBAAA,CAAA,wBAAA;AAAwB;AAAxB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,kCAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,yBAAA,CAAA,gCAAA;AAAgC;AAAhC,CAAA","sourcesContent":["export * from './CompoundButton';\nexport * from './CompoundButton.types';\nexport * from './renderCompoundButton';\nexport * from './useCompoundButton';\nexport {\n /* eslint-disable-next-line deprecation/deprecation */\n compoundButtonClassName,\n compoundButtonClassNames,\n useCompoundButtonStyles_unstable,\n} from './useCompoundButtonStyles';\n"],"sourceRoot":"../src/"}
@@ -3,27 +3,32 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.renderCompoundButton = void 0;
6
+ exports.renderCompoundButton_unstable = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var React = /*#__PURE__*/require("react");
11
-
12
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
13
11
  /**
14
12
  * Renders a CompoundButton component by passing the state defined props to the appropriate slots.
15
13
  */
16
14
 
17
15
 
18
- var renderCompoundButton = function (state) {
19
- var _a = react_utilities_1.getSlots(state, ['root', 'contentContainer', 'icon', 'secondaryContent']),
20
- slots = _a.slots,
21
- slotProps = _a.slotProps;
22
-
23
- var iconOnly = state.iconOnly,
24
- iconPosition = state.iconPosition;
25
- return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root), iconPosition !== 'after' && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)), !iconOnly && React.createElement(slots.contentContainer, tslib_1.__assign({}, slotProps.contentContainer), slotProps.root.children, React.createElement(slots.secondaryContent, tslib_1.__assign({}, slotProps.secondaryContent))), iconPosition === 'after' && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)));
16
+ const renderCompoundButton_unstable = state => {
17
+ const {
18
+ slots,
19
+ slotProps
20
+ } = react_utilities_1.getSlots(state);
21
+ const {
22
+ iconOnly,
23
+ iconPosition
24
+ } = state;
25
+ return React.createElement(slots.root, { ...slotProps.root
26
+ }, iconPosition !== 'after' && slots.icon && React.createElement(slots.icon, { ...slotProps.icon
27
+ }), !iconOnly && React.createElement(slots.contentContainer, { ...slotProps.contentContainer
28
+ }, slotProps.root.children, slots.secondaryContent && React.createElement(slots.secondaryContent, { ...slotProps.secondaryContent
29
+ })), iconPosition === 'after' && slots.icon && React.createElement(slots.icon, { ...slotProps.icon
30
+ }));
26
31
  };
27
32
 
28
- exports.renderCompoundButton = renderCompoundButton;
33
+ exports.renderCompoundButton_unstable = renderCompoundButton_unstable;
29
34
  //# sourceMappingURL=renderCompoundButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/CompoundButton/renderCompoundButton.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,oBAAoB,GAAG,UAAC,KAAD,EAA2B;AACvD,MAAA,EAAA,GAAuB,iBAAA,CAAA,QAAA,CAA8B,KAA9B,EAAqC,CAChE,MADgE,EAEhE,kBAFgE,EAGhE,MAHgE,EAIhE,kBAJgE,CAArC,CAAvB;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AAME,MAAA,QAAQ,GAAmB,KAAK,CAAxB,QAAR;AAAA,MAAU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C,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,YAAY,KAAK,OAAjB,IAA4B,KAAK,CAAC,IAAlC,IAA0C,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAD7C,EAEG,CAAC,QAAD,IACC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAP,EAAuB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAvB,EACG,SAAS,CAAC,IAAV,CAAe,QADlB,EAEG,KAAK,CAAC,gBAAN,IAA0B,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAP,EAAuB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAvB,CAF7B,CAHJ,EAQG,YAAY,KAAK,OAAjB,IAA4B,KAAK,CAAC,IAAlC,IAA0C,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAR7C,CADF;AAYD,CAhBM;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { CompoundButtonSlots, CompoundButtonState } from './CompoundButton.types';\n\n/**\n * Renders a CompoundButton component by passing the state defined props to the appropriate slots.\n */\nexport const renderCompoundButton_unstable = (state: CompoundButtonState) => {\n const { slots, slotProps } = getSlots<CompoundButtonSlots>(state);\n const { iconOnly, iconPosition } = state;\n\n return (\n <slots.root {...slotProps.root}>\n {iconPosition !== 'after' && slots.icon && <slots.icon {...slotProps.icon} />}\n {!iconOnly && (\n <slots.contentContainer {...slotProps.contentContainer}>\n {slotProps.root.children}\n {slots.secondaryContent && <slots.secondaryContent {...slotProps.secondaryContent} />}\n </slots.contentContainer>\n )}\n {iconPosition === 'after' && slots.icon && <slots.icon {...slotProps.icon} />}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
@@ -3,13 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useCompoundButton = void 0;
6
+ exports.useCompoundButton_unstable = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
9
 
10
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
-
12
- var index_1 = /*#__PURE__*/require("../Button/index");
10
+ const index_1 = /*#__PURE__*/require("../Button/index");
13
11
  /**
14
12
  * Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.
15
13
  * @param props - User provided props to the CompoundButton component.
@@ -17,12 +15,15 @@ var index_1 = /*#__PURE__*/require("../Button/index");
17
15
  */
18
16
 
19
17
 
20
- var useCompoundButton = function (_a, ref) {
21
- var contentContainer = _a.contentContainer,
22
- secondaryContent = _a.secondaryContent,
23
- props = tslib_1.__rest(_a, ["contentContainer", "secondaryContent"]);
18
+ const useCompoundButton_unstable = ({
19
+ contentContainer,
20
+ secondaryContent,
21
+ ...props
22
+ }, ref) => {
23
+ var _a, _b;
24
24
 
25
- return tslib_1.__assign(tslib_1.__assign({}, index_1.useButton(props, ref)), {
25
+ const state = { // Button state
26
+ ...index_1.useButton_unstable(props, ref),
26
27
  // Slots definition
27
28
  components: {
28
29
  root: 'button',
@@ -34,8 +35,11 @@ var useCompoundButton = function (_a, ref) {
34
35
  required: true
35
36
  }),
36
37
  secondaryContent: react_utilities_1.resolveShorthand(secondaryContent)
37
- });
38
+ }; // Recalculate iconOnly to take into account secondaryContent.
39
+
40
+ state.iconOnly = Boolean(((_a = state.icon) === null || _a === void 0 ? void 0 : _a.children) && !props.children && !((_b = state.secondaryContent) === null || _b === void 0 ? void 0 : _b.children));
41
+ return state;
38
42
  };
39
43
 
40
- exports.useCompoundButton = useCompoundButton;
44
+ exports.useCompoundButton_unstable = useCompoundButton_unstable;
41
45
  //# sourceMappingURL=useCompoundButton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/CompoundButton/useCompoundButton.ts"],"names":[],"mappings":";;;;;;;;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,IAAA,OAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;AAEA;;;;AAIG;;;AACI,IAAM,iBAAiB,GAAG,UAC/B,EAD+B,EAE/B,GAF+B,EAEsB;AADnD,MAAA,gBAAgB,GAAA,EAAA,CAAA,gBAAhB;AAAA,MAAkB,gBAAgB,GAAA,EAAA,CAAA,gBAAlC;AAAA,MAAuC,KAAK,GAAA,OAAA,CAAA,MAAA,CAAA,EAAA,EAA9C,CAAA,kBAAA,EAAA,kBAAA,CAA8C,CAA5C;;AAGF,SAAA,OAAA,CAAA,QAAA,CAAA,OAAA,CAAA,QAAA,CAAA,EAAA,EAEK,OAAA,CAAA,SAAA,CAAU,KAAV,EAAiB,GAAjB,CAFL,CAAA,EAE0B;AAExB;AACA,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,QADI;AAEV,MAAA,IAAI,EAAE,MAFI;AAGV,MAAA,gBAAgB,EAAE,MAHR;AAIV,MAAA,gBAAgB,EAAE;AAJR,KAHY;AASxB,IAAA,gBAAgB,EAAE,iBAAA,CAAA,gBAAA,CAAiB,gBAAjB,EAAmC;AAAE,MAAA,QAAQ,EAAE;AAAZ,KAAnC,CATM;AAUxB,IAAA,gBAAgB,EAAE,iBAAA,CAAA,gBAAA,CAAiB,gBAAjB;AAVM,GAF1B,CAAA;AAcD,CAlBM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","sourceRoot":""}
1
+ {"version":3,"sources":["components/CompoundButton/useCompoundButton.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;AAGA;;;;AAIG;;;AACI,MAAM,0BAA0B,GAAG,CACxC;AAAE,EAAA,gBAAF;AAAoB,EAAA,gBAApB;AAAsC,KAAG;AAAzC,CADwC,EAExC,GAFwC,KAGjB;;;AACvB,QAAM,KAAK,GAAwB,EACjC;AACA,OAAG,OAAA,CAAA,kBAAA,CAAmB,KAAnB,EAA0B,GAA1B,CAF8B;AAIjC;AACA,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,QADI;AAEV,MAAA,IAAI,EAAE,MAFI;AAGV,MAAA,gBAAgB,EAAE,MAHR;AAIV,MAAA,gBAAgB,EAAE;AAJR,KALqB;AAWjC,IAAA,gBAAgB,EAAE,iBAAA,CAAA,gBAAA,CAAiB,gBAAjB,EAAmC;AAAE,MAAA,QAAQ,EAAE;AAAZ,KAAnC,CAXe;AAYjC,IAAA,gBAAgB,EAAE,iBAAA,CAAA,gBAAA,CAAiB,gBAAjB;AAZe,GAAnC,CADuB,CAgBvB;;AACA,EAAA,KAAK,CAAC,QAAN,GAAiB,OAAO,CAAC,CAAA,CAAA,EAAA,GAAA,KAAK,CAAC,IAAN,MAAU,IAAV,IAAU,EAAA,KAAA,KAAA,CAAV,GAAU,KAAA,CAAV,GAAU,EAAA,CAAE,QAAZ,KAAwB,CAAC,KAAK,CAAC,QAA/B,IAA2C,EAAC,CAAA,EAAA,GAAA,KAAK,CAAC,gBAAN,MAAsB,IAAtB,IAAsB,EAAA,KAAA,KAAA,CAAtB,GAAsB,KAAA,CAAtB,GAAsB,EAAA,CAAE,QAAzB,CAA5C,CAAxB;AAEA,SAAO,KAAP;AACD,CAvBM;;AAAM,OAAA,CAAA,0BAAA,GAA0B,0BAA1B","sourcesContent":["import * as React from 'react';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { useButton_unstable } from '../Button/index';\nimport type { CompoundButtonProps, CompoundButtonState } from './CompoundButton.types';\n\n/**\n * Given user props, defines default props for the CompoundButton, calls useButtonState, and returns processed state.\n * @param props - User provided props to the CompoundButton component.\n * @param ref - User provided ref to be passed to the CompoundButton component.\n */\nexport const useCompoundButton_unstable = (\n { contentContainer, secondaryContent, ...props }: CompoundButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): CompoundButtonState => {\n const state: CompoundButtonState = {\n // Button state\n ...useButton_unstable(props, ref),\n\n // Slots definition\n components: {\n root: 'button',\n icon: 'span',\n contentContainer: 'span',\n secondaryContent: 'span',\n },\n contentContainer: resolveShorthand(contentContainer, { required: true }),\n secondaryContent: resolveShorthand(secondaryContent),\n };\n\n // Recalculate iconOnly to take into account secondaryContent.\n state.iconOnly = Boolean(state.icon?.children && !props.children && !state.secondaryContent?.children);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -3,115 +3,141 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useCompoundButtonStyles = void 0;
6
+ exports.useCompoundButtonStyles_unstable = exports.compoundButtonClassName = exports.compoundButtonClassNames = void 0;
7
7
 
8
- var react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
8
+ const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
9
9
 
10
- var useButtonStyles_1 = /*#__PURE__*/require("../Button/useButtonStyles");
10
+ const react_1 = /*#__PURE__*/require("@griffel/react");
11
11
 
12
- var CompoundButtonClassNames = {
13
- secondaryContent: 'CompoundButton-secondaryContent'
12
+ const useButtonStyles_1 = /*#__PURE__*/require("../Button/useButtonStyles");
13
+
14
+ exports.compoundButtonClassNames = {
15
+ root: 'fui-CompoundButton',
16
+ icon: 'fui-CompoundButton__icon',
17
+ contentContainer: 'fui-CompoundButton__contentContainer',
18
+ secondaryContent: 'fui-CompoundButton__secondaryContent'
14
19
  };
20
+ /**
21
+ * @deprecated Use `compoundButtonClassName.root` instead.
22
+ */
23
+
24
+ exports.compoundButtonClassName = exports.compoundButtonClassNames.root;
15
25
 
16
- var useRootStyles = /*#__PURE__*/react_make_styles_1.__styles({
26
+ const useRootStyles = /*#__PURE__*/react_1.__styles({
17
27
  "base": {
18
- "rmohyg": "fsbu5mz",
19
28
  "Bqenvij": "f11ysow2",
20
- "Bekya5a": "f1smw4j4",
21
- "Bi863bl": "f1b73140",
22
- "B7j81dy": "f19sbf7w"
29
+ "B2u0y6b": "fheyfof",
30
+ "J657lq": "f1um431h",
31
+ "Jlnjib": "fte7hqw",
32
+ "Bc29nj9": "f1yh8ef3"
33
+ },
34
+ "highContrast": {
35
+ "pu7qz5": "fi3u9nm",
36
+ "B10010i": "f1tdgb9w"
23
37
  },
24
38
  "outline": {},
25
39
  "primary": {
26
- "Bekya5a": "f1wrmfx5",
27
- "Bi863bl": "fl6im4w",
28
- "B7j81dy": "f1y0ndy"
40
+ "J657lq": "foe7gw6",
41
+ "Jlnjib": "fvxlz81",
42
+ "Bc29nj9": "f1c2mdy"
29
43
  },
44
+ "secondary": {},
30
45
  "subtle": {
31
- "Bekya5a": "f1smw4j4",
32
- "Bi863bl": "f182e9fe",
33
- "B7j81dy": "fdrkfd0"
46
+ "J657lq": "f1um431h",
47
+ "Jlnjib": "f1wn9xqz",
48
+ "Bc29nj9": "f1a8q4d0"
34
49
  },
35
50
  "transparent": {
36
- "Bekya5a": "f1smw4j4",
37
- "Bi863bl": "f182e9fe",
38
- "B7j81dy": "fdrkfd0"
51
+ "J657lq": "f1um431h",
52
+ "Jlnjib": "f1wn9xqz",
53
+ "Bc29nj9": "f1a8q4d0"
39
54
  },
40
55
  "small": {
41
- "z8tnut": "fp9bwmr",
42
- "z189sj": ["f19lj068", "f177v4lu"],
43
- "Byoj8tv": "f150uoa4",
44
- "uwmqm3": ["f177v4lu", "f19lj068"],
56
+ "z8tnut": "f17mpqex",
57
+ "z189sj": ["f1vdfbxk", "f1f5gg8d"],
58
+ "Byoj8tv": "f1quwm26",
59
+ "uwmqm3": ["f1f5gg8d", "f1vdfbxk"],
45
60
  "Be2twd7": "fkhj508",
46
61
  "Bg96gwp": "f1i3iumi"
47
62
  },
48
63
  "medium": {
49
- "z8tnut": "f1kcqot9",
50
- "z189sj": ["f11qrl6u", "fjlbh76"],
51
- "Byoj8tv": "fpe6lb7",
52
- "uwmqm3": ["fjlbh76", "f11qrl6u"],
64
+ "z8tnut": "fbtff6s",
65
+ "z189sj": ["fw5db7e", "f1uw59to"],
66
+ "Byoj8tv": "flw3t2g",
67
+ "uwmqm3": ["f1uw59to", "fw5db7e"],
53
68
  "Be2twd7": "fkhj508",
54
69
  "Bg96gwp": "f1i3iumi"
55
70
  },
56
71
  "large": {
57
- "z8tnut": "fqag9an",
58
- "z189sj": ["f1gbmcue", "f1rh9g5y"],
59
- "Byoj8tv": "fp67ikv",
60
- "uwmqm3": ["f1rh9g5y", "f1gbmcue"],
72
+ "z8tnut": "fm4bm3s",
73
+ "z189sj": ["fjodcmx", "fhx4nu"],
74
+ "Byoj8tv": "fdt8xvx",
75
+ "uwmqm3": ["fhx4nu", "fjodcmx"],
61
76
  "Be2twd7": "fod5ikn",
62
77
  "Bg96gwp": "faaz57k"
63
78
  },
64
79
  "disabled": {
65
- "Bekya5a": "f1ygg8x6",
66
- "Bi863bl": "fhtktt2",
67
- "B7j81dy": "f1v2jbe6"
80
+ "J657lq": "f1rlv8bf",
81
+ "Jlnjib": "fd1dbtm",
82
+ "Bc29nj9": "f1vqmdmi"
83
+ },
84
+ "disabledHighContrast": {
85
+ "B8ia98v": "f1csacz4",
86
+ "pu7qz5": "f1s5tkfe",
87
+ "B10010i": "fs0rda3"
68
88
  }
69
89
  }, {
70
- "d": [".fsbu5mz{gap:12px;}", ".f11ysow2{height:auto;}", ".f1smw4j4 .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2);}", ".f1wrmfx5 .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".fp9bwmr{padding-top:8px;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".f150uoa4{padding-bottom:8px;}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1kcqot9{padding-top:12px;}", ".f11qrl6u{padding-right:12px;}", ".fjlbh76{padding-left:12px;}", ".fpe6lb7{padding-bottom:12px;}", ".fqag9an{padding-top:16px;}", ".f1gbmcue{padding-right:16px;}", ".f1rh9g5y{padding-left:16px;}", ".fp67ikv{padding-bottom:16px;}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".f1ygg8x6 .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundDisabled);}"],
71
- "h": [".f1b73140:hover .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2Hover);}", ".fl6im4w:hover .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".f182e9fe:hover .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2BrandHover);}", ".fhtktt2:hover .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundDisabled);}"],
72
- "a": [".f19sbf7w:active .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2Pressed);}", ".f1y0ndy:active .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".fdrkfd0:active .CompoundButton-secondaryContent{color:var(--colorNeutralForeground2BrandPressed);}", ".f1v2jbe6:active .CompoundButton-secondaryContent{color:var(--colorNeutralForegroundDisabled);}"]
90
+ "d": [".f11ysow2{height:auto;}", ".fheyfof{max-width:unset;}", ".f1um431h .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForeground2);}", ".foe7gw6 .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".f17mpqex{padding-top:var(--spacingHorizontalS);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f1quwm26{padding-bottom:var(--spacingHorizontalMNudge);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".fbtff6s{padding-top:14px;}", ".fw5db7e{padding-right:var(--spacingHorizontalM);}", ".f1uw59to{padding-left:var(--spacingHorizontalM);}", ".flw3t2g{padding-bottom:var(--spacingHorizontalL);}", ".fm4bm3s{padding-top:18px;}", ".fjodcmx{padding-right:var(--spacingHorizontalL);}", ".fhx4nu{padding-left:var(--spacingHorizontalL);}", ".fdt8xvx{padding-bottom:var(--spacingHorizontalXL);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".f1rlv8bf .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForegroundDisabled);}"],
91
+ "h": [".fte7hqw:hover .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForeground2Hover);}", ".f1yh8ef3:hover:active .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForeground2Pressed);}", ".fvxlz81:hover .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".f1c2mdy:hover:active .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForegroundOnBrand);}", ".f1wn9xqz:hover .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForeground2BrandHover);}", ".f1a8q4d0:hover:active .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForeground2BrandPressed);}", ".fd1dbtm:hover .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForegroundDisabled);}", ".f1vqmdmi:hover:active .fui-CompoundButton__secondaryContent{color:var(--colorNeutralForegroundDisabled);}"],
92
+ "t": ["@media (forced-colors: active){.fi3u9nm:hover .fui-CompoundButton__secondaryContent{color:Highlight;}}", "@media (forced-colors: active){.f1tdgb9w:hover:active .fui-CompoundButton__secondaryContent{color:Highlight;}}", "@media (forced-colors: active){.f1csacz4 .fui-CompoundButton__secondaryContent{color:GrayText;}}", "@media (forced-colors: active){.f1s5tkfe:hover .fui-CompoundButton__secondaryContent{color:GrayText;}}", "@media (forced-colors: active){.fs0rda3:hover:active .fui-CompoundButton__secondaryContent{color:GrayText;}}"]
73
93
  });
74
94
 
75
- var useRootIconOnlyStyles = /*#__PURE__*/react_make_styles_1.__styles({
95
+ const useRootIconOnlyStyles = /*#__PURE__*/react_1.__styles({
76
96
  "small": {
77
- "z8tnut": "f10ra9hq",
78
- "z189sj": ["f8wuabp", "fycuoez"],
79
- "Byoj8tv": "f1y2xyjm",
80
- "uwmqm3": ["fycuoez", "f8wuabp"],
97
+ "z8tnut": "f1x4af0m",
98
+ "z189sj": ["f7x41pl", "fruq291"],
99
+ "Byoj8tv": "fd55psn",
100
+ "uwmqm3": ["fruq291", "f7x41pl"],
81
101
  "B2u0y6b": "ft5vyj6",
82
102
  "Bf4jedk": "f17suaiq"
83
103
  },
84
104
  "medium": {
85
- "z8tnut": "f1xp5gbu",
86
- "z189sj": ["f1sgzk6v", "f1bg5zqg"],
87
- "Byoj8tv": "f1d7kygh",
88
- "uwmqm3": ["f1bg5zqg", "f1sgzk6v"],
105
+ "z8tnut": "f16k8034",
106
+ "z189sj": ["fdw0yi8", "fk8j09s"],
107
+ "Byoj8tv": "f1angvds",
108
+ "uwmqm3": ["fk8j09s", "fdw0yi8"],
89
109
  "B2u0y6b": "fdczgix",
90
110
  "Bf4jedk": "fjdcg9m"
91
111
  },
92
112
  "large": {
93
- "z8tnut": "fp9bwmr",
94
- "z189sj": ["f19lj068", "f177v4lu"],
95
- "Byoj8tv": "f150uoa4",
96
- "uwmqm3": ["f177v4lu", "f19lj068"],
113
+ "z8tnut": "f17mpqex",
114
+ "z189sj": ["f1vdfbxk", "f1f5gg8d"],
115
+ "Byoj8tv": "fdvome7",
116
+ "uwmqm3": ["f1f5gg8d", "f1vdfbxk"],
97
117
  "B2u0y6b": "fww51uw",
98
118
  "Bf4jedk": "f1qhsl2h"
99
119
  }
100
120
  }, {
101
- "d": [".f10ra9hq{padding-top:4px;}", ".f8wuabp{padding-right:4px;}", ".fycuoez{padding-left:4px;}", ".f1y2xyjm{padding-bottom:4px;}", ".ft5vyj6{max-width:48px;}", ".f17suaiq{min-width:48px;}", ".f1xp5gbu{padding-top:6px;}", ".f1sgzk6v{padding-right:6px;}", ".f1bg5zqg{padding-left:6px;}", ".f1d7kygh{padding-bottom:6px;}", ".fdczgix{max-width:52px;}", ".fjdcg9m{min-width:52px;}", ".fp9bwmr{padding-top:8px;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".f150uoa4{padding-bottom:8px;}", ".fww51uw{max-width:56px;}", ".f1qhsl2h{min-width:56px;}"]
121
+ "d": [".f1x4af0m{padding-top:var(--spacingHorizontalXS);}", ".f7x41pl{padding-right:var(--spacingHorizontalXS);}", ".fruq291{padding-left:var(--spacingHorizontalXS);}", ".fd55psn{padding-bottom:var(--spacingHorizontalXS);}", ".ft5vyj6{max-width:48px;}", ".f17suaiq{min-width:48px;}", ".f16k8034{padding-top:var(--spacingHorizontalSNudge);}", ".fdw0yi8{padding-right:var(--spacingHorizontalSNudge);}", ".fk8j09s{padding-left:var(--spacingHorizontalSNudge);}", ".f1angvds{padding-bottom:var(--spacingHorizontalSNudge);}", ".fdczgix{max-width:52px;}", ".fjdcg9m{min-width:52px;}", ".f17mpqex{padding-top:var(--spacingHorizontalS);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".fdvome7{padding-bottom:var(--spacingHorizontalS);}", ".fww51uw{max-width:56px;}", ".f1qhsl2h{min-width:56px;}"]
102
122
  });
103
123
 
104
- var useIconStyles = /*#__PURE__*/react_make_styles_1.__styles({
124
+ const useIconStyles = /*#__PURE__*/react_1.__styles({
105
125
  "base": {
106
126
  "Be2twd7": "fndrnj9",
107
127
  "Bqenvij": "fbhnoac",
108
128
  "a9b677": "feqmc2u"
129
+ },
130
+ "before": {
131
+ "t21cq0": ["fkujibs", "f199hnxi"]
132
+ },
133
+ "after": {
134
+ "Frg6f3": ["f199hnxi", "fkujibs"]
109
135
  }
110
136
  }, {
111
- "d": [".fndrnj9{font-size:40px;}", ".fbhnoac{height:40px;}", ".feqmc2u{width:40px;}"]
137
+ "d": [".fndrnj9{font-size:40px;}", ".fbhnoac{height:40px;}", ".feqmc2u{width:40px;}", ".fkujibs{margin-right:var(--spacingHorizontalM);}", ".f199hnxi{margin-left:var(--spacingHorizontalM);}"]
112
138
  });
113
139
 
114
- var useContentContainerStyles = /*#__PURE__*/react_make_styles_1.__styles({
140
+ const useContentContainerStyles = /*#__PURE__*/react_1.__styles({
115
141
  "base": {
116
142
  "mc9l5x": "f22iagw",
117
143
  "Beiy3e4": "f1vx9l62",
@@ -121,10 +147,9 @@ var useContentContainerStyles = /*#__PURE__*/react_make_styles_1.__styles({
121
147
  "d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".f1o700av{text-align:left;}", ".fes3tcz{text-align:right;}"]
122
148
  });
123
149
 
124
- var useSecondaryContentStyles = /*#__PURE__*/react_make_styles_1.__styles({
150
+ const useSecondaryContentStyles = /*#__PURE__*/react_1.__styles({
125
151
  "base": {
126
152
  "Bg96gwp": "flkuc6h",
127
- "B6of3ja": "fvjh0tl",
128
153
  "Bhrd7zp": "figsok6"
129
154
  },
130
155
  "small": {
@@ -137,39 +162,41 @@ var useSecondaryContentStyles = /*#__PURE__*/react_make_styles_1.__styles({
137
162
  "Be2twd7": "fkhj508"
138
163
  }
139
164
  }, {
140
- "d": [".flkuc6h{line-height:100%;}", ".fvjh0tl{margin-top:4px;}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fkhj508{font-size:var(--fontSizeBase300);}"]
165
+ "d": [".flkuc6h{line-height:100%;}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fkhj508{font-size:var(--fontSizeBase300);}"]
141
166
  });
142
167
 
143
- var useCompoundButtonStyles = function (state) {
144
- var rootStyles = useRootStyles();
145
- var rootIconOnlyStyles = useRootIconOnlyStyles();
146
- var iconStyles = useIconStyles();
147
- var contentContainerStyles = useContentContainerStyles();
148
- var secondaryContentStyles = useSecondaryContentStyles();
149
- var appearance = state.appearance,
150
- disabled = state.disabled,
151
- disabledFocusable = state.disabledFocusable,
152
- iconOnly = state.iconOnly,
153
- size = state.size;
154
- state.root.className = react_make_styles_1.mergeClasses( // Root styles
155
- rootStyles.base, appearance && rootStyles[appearance], rootStyles[size], // Disabled styles
156
- (disabled || disabledFocusable) && rootStyles.disabled, // Icon-only styles
168
+ const useCompoundButtonStyles_unstable = state => {
169
+ const rootStyles = useRootStyles();
170
+ const rootIconOnlyStyles = useRootIconOnlyStyles();
171
+ const iconStyles = useIconStyles();
172
+ const contentContainerStyles = useContentContainerStyles();
173
+ const secondaryContentStyles = useSecondaryContentStyles();
174
+ const {
175
+ appearance,
176
+ disabled,
177
+ disabledFocusable,
178
+ iconOnly,
179
+ iconPosition,
180
+ size
181
+ } = state;
182
+ state.root.className = react_1.mergeClasses(exports.compoundButtonClassNames.root, // Root styles
183
+ rootStyles.base, rootStyles.highContrast, appearance && rootStyles[appearance], rootStyles[size], // Disabled styles
184
+ (disabled || disabledFocusable) && rootStyles.disabled, (disabled || disabledFocusable) && rootStyles.disabledHighContrast, // Icon-only styles
157
185
  iconOnly && rootIconOnlyStyles[size], // User provided class name
158
186
  state.root.className);
187
+ state.contentContainer.className = react_1.mergeClasses(exports.compoundButtonClassNames.contentContainer, contentContainerStyles.base, state.contentContainer.className);
159
188
 
160
189
  if (state.icon) {
161
- state.icon.className = react_make_styles_1.mergeClasses(iconStyles.base, state.icon.className);
190
+ state.icon.className = react_1.mergeClasses(exports.compoundButtonClassNames.icon, iconStyles.base, state.root.children !== undefined && state.root.children !== null && iconStyles[iconPosition], state.icon.className);
162
191
  }
163
192
 
164
- state.contentContainer.className = react_make_styles_1.mergeClasses(contentContainerStyles.base, state.contentContainer.className);
165
-
166
193
  if (state.secondaryContent) {
167
- state.secondaryContent.className = react_make_styles_1.mergeClasses(CompoundButtonClassNames.secondaryContent, secondaryContentStyles.base, secondaryContentStyles[size], state.secondaryContent.className);
194
+ state.secondaryContent.className = react_1.mergeClasses(exports.compoundButtonClassNames.secondaryContent, secondaryContentStyles.base, secondaryContentStyles[size], state.secondaryContent.className);
168
195
  }
169
196
 
170
- useButtonStyles_1.useButtonStyles(state);
197
+ useButtonStyles_1.useButtonStyles_unstable(state);
171
198
  return state;
172
199
  };
173
200
 
174
- exports.useCompoundButtonStyles = useCompoundButtonStyles;
201
+ exports.useCompoundButtonStyles_unstable = useCompoundButtonStyles_unstable;
175
202
  //# sourceMappingURL=useCompoundButtonStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/CompoundButton/useCompoundButtonStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAGA,IAAM,wBAAwB,GAAG;AAC/B,EAAA,gBAAgB,EAAE;AADa,CAAjC;;AAIA,IAAM,aAAa,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAtB;;AAwHA,IAAM,qBAAqB,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAA9B;;AAsBA,IAAM,aAAa,gB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,EAEjC,sBAAsB,CAAC,IAFU,EAGjC,sBAAsB,CAAC,IAAD,CAHW,EAIjC,KAAK,CAAC,gBAAN,CAAuB,SAJU,CAAnC;AAMD;;AAED,EAAA,iBAAA,CAAA,wBAAA,CAAyB,KAAzB;AAEA,SAAO,KAAP;AACD,CAxDM;;AAAM,OAAA,CAAA,gCAAA,GAAgC,gCAAhC","sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { useButtonStyles_unstable } from '../Button/useButtonStyles';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { CompoundButtonSlots, CompoundButtonState } from './CompoundButton.types';\n\nexport const compoundButtonClassNames: SlotClassNames<CompoundButtonSlots> = {\n root: 'fui-CompoundButton',\n icon: 'fui-CompoundButton__icon',\n contentContainer: 'fui-CompoundButton__contentContainer',\n secondaryContent: 'fui-CompoundButton__secondaryContent',\n};\n\n/**\n * @deprecated Use `compoundButtonClassName.root` instead.\n */\nexport const compoundButtonClassName = compoundButtonClassNames.root;\n\nconst useRootStyles = makeStyles({\n // Base styles\n base: {\n height: 'auto',\n maxWidth: 'unset',\n\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Hover,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n },\n\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Highlight',\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Highlight',\n },\n },\n },\n },\n\n // Appearance variations\n outline: {\n /* No styles */\n },\n primary: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n },\n secondary: {\n /* The secondary styles are exactly the same as the base styles. */\n },\n subtle: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandHover,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n },\n transparent: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandHover,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n },\n\n // Size variations\n small: {\n ...shorthands.padding(\n tokens.spacingHorizontalS,\n tokens.spacingHorizontalS,\n tokens.spacingHorizontalMNudge,\n tokens.spacingHorizontalS,\n ),\n\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n medium: {\n ...shorthands.padding('14px', tokens.spacingHorizontalM, tokens.spacingHorizontalL, tokens.spacingHorizontalM),\n\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n large: {\n ...shorthands.padding('18px', tokens.spacingHorizontalL, tokens.spacingHorizontalXL, tokens.spacingHorizontalL),\n\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n },\n\n // Disabled styles\n disabled: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n },\n\n // Disabled high contrast styles\n disabledHighContrast: {\n '@media (forced-colors: active)': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText',\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText',\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText',\n },\n },\n },\n },\n});\n\nconst useRootIconOnlyStyles = makeStyles({\n // Size variations\n small: {\n ...shorthands.padding(tokens.spacingHorizontalXS),\n\n maxWidth: '48px',\n minWidth: '48px',\n },\n medium: {\n ...shorthands.padding(tokens.spacingHorizontalSNudge),\n\n maxWidth: '52px',\n minWidth: '52px',\n },\n large: {\n ...shorthands.padding(tokens.spacingHorizontalS),\n\n maxWidth: '56px',\n minWidth: '56px',\n },\n});\n\nconst useIconStyles = makeStyles({\n // Base styles\n base: {\n fontSize: '40px',\n height: '40px',\n width: '40px',\n },\n\n // Icon position variations\n before: {\n marginRight: tokens.spacingHorizontalM,\n },\n after: {\n marginLeft: tokens.spacingHorizontalM,\n },\n});\n\nconst useContentContainerStyles = makeStyles({\n // Base styles\n base: {\n display: 'flex',\n flexDirection: 'column',\n textAlign: 'left',\n },\n});\n\nconst useSecondaryContentStyles = makeStyles({\n // Base styles\n base: {\n lineHeight: '100%',\n fontWeight: tokens.fontWeightRegular,\n },\n\n // Size variations\n small: {\n fontSize: tokens.fontSizeBase200,\n },\n medium: {\n fontSize: tokens.fontSizeBase200,\n },\n large: {\n fontSize: tokens.fontSizeBase300,\n },\n});\n\nexport const useCompoundButtonStyles_unstable = (state: CompoundButtonState): CompoundButtonState => {\n const rootStyles = useRootStyles();\n const rootIconOnlyStyles = useRootIconOnlyStyles();\n const iconStyles = useIconStyles();\n const contentContainerStyles = useContentContainerStyles();\n const secondaryContentStyles = useSecondaryContentStyles();\n\n const { appearance, disabled, disabledFocusable, iconOnly, iconPosition, size } = state;\n\n state.root.className = mergeClasses(\n compoundButtonClassNames.root,\n\n // Root styles\n rootStyles.base,\n rootStyles.highContrast,\n appearance && rootStyles[appearance],\n rootStyles[size],\n\n // Disabled styles\n (disabled || disabledFocusable) && rootStyles.disabled,\n (disabled || disabledFocusable) && rootStyles.disabledHighContrast,\n\n // Icon-only styles\n iconOnly && rootIconOnlyStyles[size],\n\n // User provided class name\n state.root.className,\n );\n\n state.contentContainer.className = mergeClasses(\n compoundButtonClassNames.contentContainer,\n contentContainerStyles.base,\n state.contentContainer.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n compoundButtonClassNames.icon,\n iconStyles.base,\n state.root.children !== undefined && state.root.children !== null && iconStyles[iconPosition],\n state.icon.className,\n );\n }\n\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(\n compoundButtonClassNames.secondaryContent,\n secondaryContentStyles.base,\n secondaryContentStyles[size],\n state.secondaryContent.className,\n );\n }\n\n useButtonStyles_unstable(state);\n\n return state;\n};\n"],"sourceRoot":"../src/"}