@fluentui/react-button 9.0.0-alpha.85 → 9.0.0-alpha.89

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. package/CHANGELOG.json +123 -1
  2. package/CHANGELOG.md +47 -2
  3. package/dist/react-button.d.ts +118 -25
  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/Button.types.d.ts +2 -2
  8. package/lib/components/Button/Button.types.js.map +1 -1
  9. package/lib/components/Button/renderButton.js.map +1 -1
  10. package/lib/components/Button/useButton.d.ts +3 -1
  11. package/lib/components/Button/useButton.js +3 -1
  12. package/lib/components/Button/useButton.js.map +1 -1
  13. package/lib/components/Button/useButtonState.d.ts +2 -2
  14. package/lib/components/Button/useButtonState.js +2 -2
  15. package/lib/components/Button/useButtonState.js.map +1 -1
  16. package/lib/components/Button/useButtonStyles.js.map +1 -1
  17. package/lib/components/CompoundButton/CompoundButton.d.ts +16 -2
  18. package/lib/components/CompoundButton/CompoundButton.types.d.ts +3 -4
  19. package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
  20. package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
  21. package/lib/components/CompoundButton/useCompoundButton.d.ts +3 -1
  22. package/lib/components/CompoundButton/useCompoundButton.js +3 -1
  23. package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
  24. package/lib/components/CompoundButton/useCompoundButtonStyles.js +1 -1
  25. package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  26. package/lib/components/MenuButton/MenuButton.types.d.ts +2 -3
  27. package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
  28. package/lib/components/MenuButton/renderMenuButton.js +2 -1
  29. package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
  30. package/lib/components/MenuButton/useMenuButton.d.ts +3 -1
  31. package/lib/components/MenuButton/useMenuButton.js +3 -3
  32. package/lib/components/MenuButton/useMenuButton.js.map +1 -1
  33. package/lib/components/MenuButton/useMenuButtonState.d.ts +5 -0
  34. package/lib/components/MenuButton/useMenuButtonState.js +9 -1
  35. package/lib/components/MenuButton/useMenuButtonState.js.map +1 -1
  36. package/lib/components/MenuButton/useMenuButtonStyles.js +1 -1
  37. package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  38. package/lib/components/SplitButton/SplitButton.d.ts +7 -0
  39. package/lib/components/SplitButton/SplitButton.js +25 -0
  40. package/lib/components/SplitButton/SplitButton.js.map +1 -0
  41. package/lib/components/SplitButton/SplitButton.types.d.ts +30 -0
  42. package/lib/components/SplitButton/SplitButton.types.js +2 -0
  43. package/lib/components/SplitButton/SplitButton.types.js.map +1 -0
  44. package/lib/components/SplitButton/index.d.ts +5 -0
  45. package/lib/components/SplitButton/index.js +6 -0
  46. package/lib/components/SplitButton/index.js.map +1 -0
  47. package/lib/components/SplitButton/renderSplitButton.d.ts +5 -0
  48. package/lib/components/SplitButton/renderSplitButton.js +16 -0
  49. package/lib/components/SplitButton/renderSplitButton.js.map +1 -0
  50. package/lib/components/SplitButton/useSplitButton.d.ts +9 -0
  51. package/lib/components/SplitButton/useSplitButton.js +72 -0
  52. package/lib/components/SplitButton/useSplitButton.js.map +1 -0
  53. package/lib/components/SplitButton/useSplitButtonStyles.d.ts +2 -0
  54. package/lib/components/SplitButton/useSplitButtonStyles.js +61 -0
  55. package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -0
  56. package/lib/components/ToggleButton/ToggleButton.d.ts +16 -2
  57. package/lib/components/ToggleButton/ToggleButton.types.d.ts +3 -4
  58. package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -1
  59. package/lib/components/ToggleButton/useChecked.d.ts +2 -2
  60. package/lib/components/ToggleButton/useChecked.js.map +1 -1
  61. package/lib/components/ToggleButton/useToggleButton.d.ts +4 -1
  62. package/lib/components/ToggleButton/useToggleButton.js +4 -1
  63. package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
  64. package/lib/components/ToggleButton/useToggleButtonStyles.js +1 -1
  65. package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  66. package/lib/index.d.ts +1 -0
  67. package/lib/index.js +1 -0
  68. package/lib/index.js.map +1 -1
  69. package/lib-amd/SplitButton.d.ts +1 -0
  70. package/lib-amd/SplitButton.js +6 -0
  71. package/lib-amd/SplitButton.js.map +1 -0
  72. package/lib-amd/components/Button/Button.types.d.ts +2 -2
  73. package/lib-amd/components/Button/Button.types.js.map +1 -1
  74. package/lib-amd/components/Button/renderButton.js.map +1 -1
  75. package/lib-amd/components/Button/useButton.d.ts +3 -1
  76. package/lib-amd/components/Button/useButton.js +3 -1
  77. package/lib-amd/components/Button/useButton.js.map +1 -1
  78. package/lib-amd/components/Button/useButtonState.d.ts +2 -2
  79. package/lib-amd/components/Button/useButtonState.js +2 -2
  80. package/lib-amd/components/Button/useButtonState.js.map +1 -1
  81. package/lib-amd/components/Button/useButtonStyles.js +1 -0
  82. package/lib-amd/components/Button/useButtonStyles.js.map +1 -1
  83. package/lib-amd/components/CompoundButton/CompoundButton.d.ts +16 -2
  84. package/lib-amd/components/CompoundButton/CompoundButton.types.d.ts +3 -4
  85. package/lib-amd/components/CompoundButton/CompoundButton.types.js.map +1 -1
  86. package/lib-amd/components/CompoundButton/renderCompoundButton.js.map +1 -1
  87. package/lib-amd/components/CompoundButton/useCompoundButton.d.ts +3 -1
  88. package/lib-amd/components/CompoundButton/useCompoundButton.js +3 -1
  89. package/lib-amd/components/CompoundButton/useCompoundButton.js.map +1 -1
  90. package/lib-amd/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  91. package/lib-amd/components/MenuButton/MenuButton.types.d.ts +2 -3
  92. package/lib-amd/components/MenuButton/MenuButton.types.js.map +1 -1
  93. package/lib-amd/components/MenuButton/renderMenuButton.js +2 -2
  94. package/lib-amd/components/MenuButton/renderMenuButton.js.map +1 -1
  95. package/lib-amd/components/MenuButton/useMenuButton.d.ts +3 -1
  96. package/lib-amd/components/MenuButton/useMenuButton.js +3 -3
  97. package/lib-amd/components/MenuButton/useMenuButton.js.map +1 -1
  98. package/lib-amd/components/MenuButton/useMenuButtonState.d.ts +5 -0
  99. package/lib-amd/components/MenuButton/useMenuButtonState.js +7 -1
  100. package/lib-amd/components/MenuButton/useMenuButtonState.js.map +1 -1
  101. package/lib-amd/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  102. package/lib-amd/components/SplitButton/SplitButton.d.ts +7 -0
  103. package/lib-amd/components/SplitButton/SplitButton.js +19 -0
  104. package/lib-amd/components/SplitButton/SplitButton.js.map +1 -0
  105. package/lib-amd/components/SplitButton/SplitButton.types.d.ts +30 -0
  106. package/lib-amd/components/SplitButton/SplitButton.types.js +5 -0
  107. package/lib-amd/components/SplitButton/SplitButton.types.js.map +1 -0
  108. package/lib-amd/components/SplitButton/index.d.ts +5 -0
  109. package/lib-amd/components/SplitButton/index.js +11 -0
  110. package/lib-amd/components/SplitButton/index.js.map +1 -0
  111. package/lib-amd/components/SplitButton/renderSplitButton.d.ts +5 -0
  112. package/lib-amd/components/SplitButton/renderSplitButton.js +16 -0
  113. package/lib-amd/components/SplitButton/renderSplitButton.js.map +1 -0
  114. package/lib-amd/components/SplitButton/useSplitButton.d.ts +9 -0
  115. package/lib-amd/components/SplitButton/useSplitButton.js +55 -0
  116. package/lib-amd/components/SplitButton/useSplitButton.js.map +1 -0
  117. package/lib-amd/components/SplitButton/useSplitButtonStyles.d.ts +2 -0
  118. package/lib-amd/components/SplitButton/useSplitButtonStyles.js +123 -0
  119. package/lib-amd/components/SplitButton/useSplitButtonStyles.js.map +1 -0
  120. package/lib-amd/components/ToggleButton/ToggleButton.d.ts +16 -2
  121. package/lib-amd/components/ToggleButton/ToggleButton.types.d.ts +3 -4
  122. package/lib-amd/components/ToggleButton/ToggleButton.types.js.map +1 -1
  123. package/lib-amd/components/ToggleButton/useChecked.d.ts +2 -2
  124. package/lib-amd/components/ToggleButton/useChecked.js.map +1 -1
  125. package/lib-amd/components/ToggleButton/useToggleButton.d.ts +4 -1
  126. package/lib-amd/components/ToggleButton/useToggleButton.js +4 -1
  127. package/lib-amd/components/ToggleButton/useToggleButton.js.map +1 -1
  128. package/lib-amd/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  129. package/lib-amd/index.d.ts +1 -0
  130. package/lib-amd/index.js +2 -1
  131. package/lib-amd/index.js.map +1 -1
  132. package/lib-commonjs/SplitButton.d.ts +1 -0
  133. package/lib-commonjs/SplitButton.js +10 -0
  134. package/lib-commonjs/SplitButton.js.map +1 -0
  135. package/lib-commonjs/components/Button/Button.types.d.ts +2 -2
  136. package/lib-commonjs/components/Button/renderButton.js.map +1 -1
  137. package/lib-commonjs/components/Button/useButton.d.ts +3 -1
  138. package/lib-commonjs/components/Button/useButton.js +3 -1
  139. package/lib-commonjs/components/Button/useButton.js.map +1 -1
  140. package/lib-commonjs/components/Button/useButtonState.d.ts +2 -2
  141. package/lib-commonjs/components/Button/useButtonState.js +2 -2
  142. package/lib-commonjs/components/Button/useButtonState.js.map +1 -1
  143. package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
  144. package/lib-commonjs/components/CompoundButton/CompoundButton.d.ts +16 -2
  145. package/lib-commonjs/components/CompoundButton/CompoundButton.types.d.ts +3 -4
  146. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
  147. package/lib-commonjs/components/CompoundButton/useCompoundButton.d.ts +3 -1
  148. package/lib-commonjs/components/CompoundButton/useCompoundButton.js +3 -1
  149. package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
  150. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  151. package/lib-commonjs/components/MenuButton/MenuButton.types.d.ts +2 -3
  152. package/lib-commonjs/components/MenuButton/renderMenuButton.js +2 -1
  153. package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
  154. package/lib-commonjs/components/MenuButton/useMenuButton.d.ts +3 -1
  155. package/lib-commonjs/components/MenuButton/useMenuButton.js +3 -3
  156. package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
  157. package/lib-commonjs/components/MenuButton/useMenuButtonState.d.ts +5 -0
  158. package/lib-commonjs/components/MenuButton/useMenuButtonState.js +9 -1
  159. package/lib-commonjs/components/MenuButton/useMenuButtonState.js.map +1 -1
  160. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  161. package/lib-commonjs/components/SplitButton/SplitButton.d.ts +7 -0
  162. package/lib-commonjs/components/SplitButton/SplitButton.js +38 -0
  163. package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -0
  164. package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +30 -0
  165. package/lib-commonjs/components/SplitButton/SplitButton.types.js +6 -0
  166. package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -0
  167. package/lib-commonjs/components/SplitButton/index.d.ts +5 -0
  168. package/lib-commonjs/components/SplitButton/index.js +26 -0
  169. package/lib-commonjs/components/SplitButton/index.js.map +1 -0
  170. package/lib-commonjs/components/SplitButton/renderSplitButton.d.ts +5 -0
  171. package/lib-commonjs/components/SplitButton/renderSplitButton.js +29 -0
  172. package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -0
  173. package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +9 -0
  174. package/lib-commonjs/components/SplitButton/useSplitButton.js +83 -0
  175. package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -0
  176. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +2 -0
  177. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +71 -0
  178. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -0
  179. package/lib-commonjs/components/ToggleButton/ToggleButton.d.ts +16 -2
  180. package/lib-commonjs/components/ToggleButton/ToggleButton.types.d.ts +3 -4
  181. package/lib-commonjs/components/ToggleButton/useChecked.d.ts +2 -2
  182. package/lib-commonjs/components/ToggleButton/useChecked.js.map +1 -1
  183. package/lib-commonjs/components/ToggleButton/useToggleButton.d.ts +4 -1
  184. package/lib-commonjs/components/ToggleButton/useToggleButton.js +4 -1
  185. package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
  186. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  187. package/lib-commonjs/index.d.ts +1 -0
  188. package/lib-commonjs/index.js +2 -0
  189. package/lib-commonjs/index.js.map +1 -1
  190. package/package.json +10 -10
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/SplitButton/useSplitButtonStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAGA,IAAM,qBAAqB,GAAG;AAC5B,EAAA,MAAM,EAAE,oBADoB;AAE5B,EAAA,UAAU,EAAE;AAFgB,CAA9B;;AAKA,IAAM,SAAS,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,EAAlB;;AAgGO,IAAM,oBAAoB,GAAG,UAAC,KAAD,EAAwB;AAC1D,MAAM,MAAM,GAAG,SAAS,EAAxB;AAEA,EAAA,KAAK,CAAC,SAAN,GAAkB,mBAAA,CAAA,YAAA,CAChB,MAAM,CAAC,IADS,EAEhB,KAAK,CAAC,KAAN,IAAe,MAAM,CAAC,SAFN,EAGhB,KAAK,CAAC,OAAN,IAAiB,MAAM,CAAC,WAHR,EAIhB,KAAK,CAAC,MAAN,IAAgB,MAAM,CAAC,UAJP,EAKhB,KAAK,CAAC,WAAN,IAAqB,MAAM,CAAC,eALZ,EAMhB,KAAK,CAAC,QAAN,IAAkB,MAAM,CAAC,YANT,EAOhB,KAAK,CAAC,SAPU,CAAlB;;AAUA,MAAI,KAAK,CAAC,MAAV,EAAkB;AAChB,IAAA,KAAK,CAAC,MAAN,CAAa,SAAb,GAAyB,mBAAA,CAAA,YAAA,CAAa,qBAAqB,CAAC,MAAnC,EAA2C,KAAK,CAAC,MAAN,CAAa,SAAxD,CAAzB;AACD;;AAED,MAAI,KAAK,CAAC,UAAV,EAAsB;AACpB,IAAA,KAAK,CAAC,UAAN,CAAiB,SAAjB,GAA6B,mBAAA,CAAA,YAAA,CAAa,qBAAqB,CAAC,UAAnC,EAA+C,KAAK,CAAC,UAAN,CAAiB,SAAhE,CAA7B;AACD;;AAED,SAAO,KAAP;AACD,CAtBM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';\nimport type { SplitButtonState } from './SplitButton.types';\n\nconst SplitButtonClassNames = {\n button: 'SplitButton-button',\n menuButton: 'SplitButton-menuButton',\n};\n\nconst useStyles = makeStyles({\n root: theme => ({\n display: 'inline-flex',\n justifyContent: 'stretch',\n position: 'relative',\n\n // Use classnames to increase specificy of styles and avoid collisions.\n [`& .${SplitButtonClassNames.button}`]: {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n\n // Use classnames to increase specificy of styles and avoid collisions.\n [`& .${SplitButtonClassNames.menuButton}`]: {\n borderLeftWidth: 0,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n },\n }),\n rootBlock: {\n width: '100%',\n },\n rootPrimary: theme => ({\n // Use classnames to increase specificy of styles and avoid collisions.\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralForegroundInverted,\n },\n\n ':hover': {\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralForegroundInverted,\n },\n },\n\n ':active': {\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralForegroundInverted,\n },\n },\n }),\n rootSubtle: theme => ({\n // Use classnames to increase specificy of styles and avoid collisions.\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralStroke1Hover,\n },\n\n ':hover': {\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralStroke1Hover,\n },\n },\n\n ':active': {\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralStroke1Hover,\n },\n },\n }),\n rootTransparent: theme => ({\n // Use classnames to increase specificy of styles and avoid collisions.\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralStroke1Hover,\n },\n\n ':hover': {\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralStroke1Hover,\n },\n },\n\n ':active': {\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralStroke1Hover,\n },\n },\n }),\n rootDisabled: theme => ({\n // Use classnames to increase specificy of styles and avoid collisions.\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralStrokeDisabled,\n },\n\n ':hover': {\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralStrokeDisabled,\n },\n },\n\n ':active': {\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralStrokeDisabled,\n },\n },\n }),\n});\n\nexport const useSplitButtonStyles = (state: SplitButtonState): SplitButtonState => {\n const styles = useStyles();\n\n state.className = mergeClasses(\n styles.root,\n state.block && styles.rootBlock,\n state.primary && styles.rootPrimary,\n state.subtle && styles.rootSubtle,\n state.transparent && styles.rootTransparent,\n state.disabled && styles.rootDisabled,\n state.className,\n );\n\n if (state.button) {\n state.button.className = mergeClasses(SplitButtonClassNames.button, state.button.className);\n }\n\n if (state.menuButton) {\n state.menuButton.className = mergeClasses(SplitButtonClassNames.menuButton, state.menuButton.className);\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1,6 +1,20 @@
1
1
  import * as React from 'react';
2
- import type { ToggleButtonProps } from './ToggleButton.types';
3
2
  /**
4
3
  * ToggleButtons are buttons that toggle between two defined states when triggered.
5
4
  */
6
- export declare const ToggleButton: React.ForwardRefExoticComponent<ToggleButtonProps & React.RefAttributes<HTMLElement>>;
5
+ export declare const ToggleButton: React.ForwardRefExoticComponent<import("@fluentui/react-utilities").ComponentPropsCompat & React.ButtonHTMLAttributes<HTMLElement> & {
6
+ icon?: import("@fluentui/react-utilities").ShorthandPropsCompat<React.HTMLAttributes<HTMLElement>>;
7
+ block?: boolean | undefined;
8
+ circular?: boolean | undefined;
9
+ disabled?: boolean | undefined;
10
+ disabledFocusable?: boolean | undefined;
11
+ iconPosition?: "before" | "after" | undefined;
12
+ outline?: boolean | undefined;
13
+ primary?: boolean | undefined;
14
+ size?: "small" | "medium" | "large" | undefined;
15
+ subtle?: boolean | undefined;
16
+ transparent?: boolean | undefined;
17
+ } & {
18
+ checked?: boolean | undefined;
19
+ defaultChecked?: boolean | undefined;
20
+ } & React.RefAttributes<HTMLElement>>;
@@ -1,6 +1,6 @@
1
1
  import type { ComponentStateCompat } from '@fluentui/react-utilities';
2
2
  import type { ButtonDefaultedProps, ButtonProps, ButtonShorthandPropsCompat, ButtonState } from '../Button/Button.types';
3
- export interface ToggleButtonProps extends ButtonProps {
3
+ export declare type ToggleButtonProps = ButtonProps & {
4
4
  /**
5
5
  * Defines the controlled checked state of the `ToggleButton`.
6
6
  * Mutually exclusive to `defaultChecked`.
@@ -15,8 +15,7 @@ export interface ToggleButtonProps extends ButtonProps {
15
15
  * @default false
16
16
  */
17
17
  defaultChecked?: boolean;
18
- }
18
+ };
19
19
  export declare type ToggleButtonShorthandPropsCompat = ButtonShorthandPropsCompat;
20
20
  export declare type ToggleButtonDefaultedProps = ButtonDefaultedProps;
21
- export interface ToggleButtonState extends ButtonState, ComponentStateCompat<ToggleButtonProps, ToggleButtonShorthandPropsCompat, ToggleButtonDefaultedProps> {
22
- }
21
+ export declare type ToggleButtonState = ButtonState & ComponentStateCompat<ToggleButtonProps, ToggleButtonShorthandPropsCompat, ToggleButtonDefaultedProps>;
@@ -1,12 +1,12 @@
1
1
  import * as React from 'react';
2
- export interface CheckedState {
2
+ export declare type CheckedState = {
3
3
  checked?: boolean;
4
4
  defaultChecked?: boolean;
5
5
  onClick?: React.DOMAttributes<HTMLElement>['onClick'];
6
6
  role?: string;
7
7
  'aria-checked'?: React.AriaAttributes['aria-pressed'];
8
8
  'aria-pressed'?: React.AriaAttributes['aria-pressed'];
9
- }
9
+ };
10
10
  /**
11
11
  * The useToggle hook processes adds the correct toggled state and acccessibility as needed.
12
12
  * @param state - state to read and augment.
@@ -1 +1 @@
1
- {"version":3,"sources":["components/ToggleButton/useChecked.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAYA;;;AAGG;;;AACI,IAAM,UAAU,GAAG,UAA8B,KAA9B,EAA2C;AAC3D,MAAA,OAAO,GAAoC,KAAK,CAAzC,OAAP;AAAA,MAAS,OAAO,GAA2B,KAAK,CAAhC,OAAhB;AAAA,MAAkB,cAAc,GAAW,KAAK,CAAhB,cAAhC;AAAA,MAAkC,IAAI,GAAK,KAAK,CAAV,IAAtC;;AACF,MAAA,EAAA,GAAkC,iBAAA,CAAA,oBAAA,CAAqB,OAArB,EAA8B,cAA9B,CAAlC;AAAA,MAAC,YAAY,GAAA,EAAA,CAAA,CAAA,CAAb;AAAA,MAAe,eAAe,GAAA,EAAA,CAAA,CAAA,CAA9B,CAF6D,CAInE;;;AACA,EAAA,KAAK,CAAC,OAAN,GAAgB,YAAhB,CALmE,CAOnE;;AACA,MAAM,kBAAkB,GAAG,IAAI,KAAK,kBAAT,IAA+B,IAAI,KAAK,UAAnE;AAEA,EAAA,KAAK,CAAC,kBAAkB,GAAG,cAAH,GAAoB,cAAvC,CAAL,GAA8D,CAAC,CAAC,YAAhE;AAEA,EAAA,KAAK,CAAC,OAAN,GAAgB,KAAK,CAAC,WAAN,CACd,UAAC,EAAD,EAAoD;AAClD,QAAI,OAAJ,EAAa;AACX,MAAA,OAAO,CAAC,EAAD,CAAP;;AAEA,UAAI,EAAE,CAAC,gBAAP,EAAyB;AACvB;AACD;AACF;;AAED,IAAA,eAAe,CAAC,CAAC,YAAF,CAAf;AACD,GAXa,EAYd,CAAC,YAAD,EAAe,eAAf,EAAgC,OAAhC,CAZc,CAAhB;AAcD,CA1BM;;AAAM,OAAA,CAAA,UAAA,GAAU,UAAV","sourcesContent":["import * as React from 'react';\nimport { useControllableValue } from '@fluentui/react-utilities';\n\nexport interface CheckedState {\n checked?: boolean;\n defaultChecked?: boolean;\n onClick?: React.DOMAttributes<HTMLElement>['onClick'];\n\n role?: string;\n 'aria-checked'?: React.AriaAttributes['aria-pressed'];\n 'aria-pressed'?: React.AriaAttributes['aria-pressed'];\n}\n\n/**\n * The useToggle hook processes adds the correct toggled state and acccessibility as needed.\n * @param state - state to read and augment.\n */\nexport const useChecked = <TState extends CheckedState>(state: TState) => {\n const { onClick, checked, defaultChecked, role } = state;\n const [checkedValue, setCheckedValue] = useControllableValue(checked, defaultChecked);\n\n // Ensure the state is the correct controlled/uncontrolled value.\n state.checked = checkedValue;\n\n // Ensure the right aria value is set to represent the checked state.\n const isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';\n\n state[isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed'] = !!checkedValue;\n\n state.onClick = React.useCallback(\n (ev: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n if (onClick) {\n onClick(ev);\n\n if (ev.defaultPrevented) {\n return;\n }\n }\n\n setCheckedValue(!checkedValue);\n },\n [checkedValue, setCheckedValue, onClick],\n );\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/ToggleButton/useChecked.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAYA;;;AAGG;;;AACI,IAAM,UAAU,GAAG,UAA8B,KAA9B,EAA2C;AAC3D,MAAA,OAAO,GAAoC,KAAK,CAAzC,OAAP;AAAA,MAAS,OAAO,GAA2B,KAAK,CAAhC,OAAhB;AAAA,MAAkB,cAAc,GAAW,KAAK,CAAhB,cAAhC;AAAA,MAAkC,IAAI,GAAK,KAAK,CAAV,IAAtC;;AACF,MAAA,EAAA,GAAkC,iBAAA,CAAA,oBAAA,CAAqB,OAArB,EAA8B,cAA9B,CAAlC;AAAA,MAAC,YAAY,GAAA,EAAA,CAAA,CAAA,CAAb;AAAA,MAAe,eAAe,GAAA,EAAA,CAAA,CAAA,CAA9B,CAF6D,CAInE;;;AACA,EAAA,KAAK,CAAC,OAAN,GAAgB,YAAhB,CALmE,CAOnE;;AACA,MAAM,kBAAkB,GAAG,IAAI,KAAK,kBAAT,IAA+B,IAAI,KAAK,UAAnE;AAEA,EAAA,KAAK,CAAC,kBAAkB,GAAG,cAAH,GAAoB,cAAvC,CAAL,GAA8D,CAAC,CAAC,YAAhE;AAEA,EAAA,KAAK,CAAC,OAAN,GAAgB,KAAK,CAAC,WAAN,CACd,UAAC,EAAD,EAAoD;AAClD,QAAI,OAAJ,EAAa;AACX,MAAA,OAAO,CAAC,EAAD,CAAP;;AAEA,UAAI,EAAE,CAAC,gBAAP,EAAyB;AACvB;AACD;AACF;;AAED,IAAA,eAAe,CAAC,CAAC,YAAF,CAAf;AACD,GAXa,EAYd,CAAC,YAAD,EAAe,eAAf,EAAgC,OAAhC,CAZc,CAAhB;AAcD,CA1BM;;AAAM,OAAA,CAAA,UAAA,GAAU,UAAV","sourcesContent":["import * as React from 'react';\nimport { useControllableValue } from '@fluentui/react-utilities';\n\nexport type CheckedState = {\n checked?: boolean;\n defaultChecked?: boolean;\n onClick?: React.DOMAttributes<HTMLElement>['onClick'];\n\n role?: string;\n 'aria-checked'?: React.AriaAttributes['aria-pressed'];\n 'aria-pressed'?: React.AriaAttributes['aria-pressed'];\n};\n\n/**\n * The useToggle hook processes adds the correct toggled state and acccessibility as needed.\n * @param state - state to read and augment.\n */\nexport const useChecked = <TState extends CheckedState>(state: TState) => {\n const { onClick, checked, defaultChecked, role } = state;\n const [checkedValue, setCheckedValue] = useControllableValue(checked, defaultChecked);\n\n // Ensure the state is the correct controlled/uncontrolled value.\n state.checked = checkedValue;\n\n // Ensure the right aria value is set to represent the checked state.\n const isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';\n\n state[isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed'] = !!checkedValue;\n\n state.onClick = React.useCallback(\n (ev: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n if (onClick) {\n onClick(ev);\n\n if (ev.defaultPrevented) {\n return;\n }\n }\n\n setCheckedValue(!checkedValue);\n },\n [checkedValue, setCheckedValue, onClick],\n );\n};\n"],"sourceRoot":"../src/"}
@@ -1,6 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import type { ToggleButtonProps, ToggleButtonState } from './ToggleButton.types';
3
3
  /**
4
- * Given user props, returns the final state for a ToggleButton.
4
+ * Given user props, defines default props for the ToggleButton, calls useButtonState and useChecked, and returns
5
+ * processed state.
6
+ * @param props - User provided props to the ToggleButton component.
7
+ * @param ref - User provided ref to be passed to the ToggleButton component.
5
8
  */
6
9
  export declare const useToggleButton: (props: ToggleButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: ToggleButtonProps | undefined) => ToggleButtonState;
@@ -9,7 +9,10 @@ var useButton_1 = /*#__PURE__*/require("../Button/useButton");
9
9
 
10
10
  var useChecked_1 = /*#__PURE__*/require("./useChecked");
11
11
  /**
12
- * Given user props, returns the final state for a ToggleButton.
12
+ * Given user props, defines default props for the ToggleButton, calls useButtonState and useChecked, and returns
13
+ * processed state.
14
+ * @param props - User provided props to the ToggleButton component.
15
+ * @param ref - User provided ref to be passed to the ToggleButton component.
13
16
  */
14
17
 
15
18
 
@@ -1 +1 @@
1
- {"version":3,"sources":["components/ToggleButton/useToggleButton.ts"],"names":[],"mappings":";;;;;;;AACA,IAAA,WAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,IAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,eAAe,GAAG,UAC7B,KAD6B,EAE7B,GAF6B,EAG7B,YAH6B,EAGG;AAEhC,MAAM,KAAK,GAAG,WAAA,CAAA,SAAA,CAAU,KAAV,EAAiB,GAAjB,EAAsB,YAAtB,CAAd;AAEA,EAAA,YAAA,CAAA,UAAA,CAAW,KAAX;AAEA,SAAO,KAAP;AACD,CAVM;;AAAM,OAAA,CAAA,eAAA,GAAe,eAAf","sourcesContent":["import * as React from 'react';\nimport { useButton } from '../Button/useButton';\nimport { useChecked } from './useChecked';\nimport type { ToggleButtonProps, ToggleButtonState } from './ToggleButton.types';\n\n/**\n * Given user props, returns the final state for a ToggleButton.\n */\nexport const useToggleButton = (\n props: ToggleButtonProps,\n ref: React.Ref<HTMLElement>,\n defaultProps?: ToggleButtonProps,\n) => {\n const state = useButton(props, ref, defaultProps);\n\n useChecked(state as ToggleButtonProps);\n\n return state as ToggleButtonState;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/ToggleButton/useToggleButton.ts"],"names":[],"mappings":";;;;;;;AACA,IAAA,WAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,IAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;AAGA;;;;;AAKG;;;AACI,IAAM,eAAe,GAAG,UAC7B,KAD6B,EAE7B,GAF6B,EAG7B,YAH6B,EAGG;AAEhC,MAAM,KAAK,GAAG,WAAA,CAAA,SAAA,CAAU,KAAV,EAAiB,GAAjB,EAAsB,YAAtB,CAAd;AAEA,EAAA,YAAA,CAAA,UAAA,CAAW,KAAX;AAEA,SAAO,KAAP;AACD,CAVM;;AAAM,OAAA,CAAA,eAAA,GAAe,eAAf","sourcesContent":["import * as React from 'react';\nimport { useButton } from '../Button/useButton';\nimport { useChecked } from './useChecked';\nimport type { ToggleButtonProps, ToggleButtonState } from './ToggleButton.types';\n\n/**\n * Given user props, defines default props for the ToggleButton, calls useButtonState and useChecked, and returns\n * processed state.\n * @param props - User provided props to the ToggleButton component.\n * @param ref - User provided ref to be passed to the ToggleButton component.\n */\nexport const useToggleButton = (\n props: ToggleButtonProps,\n ref: React.Ref<HTMLElement>,\n defaultProps?: ToggleButtonProps,\n) => {\n const state = useButton(props, ref, defaultProps);\n\n useChecked(state as ToggleButtonProps);\n\n return state as ToggleButtonState;\n};\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["components/ToggleButton/useToggleButtonStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAGA,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;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;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;;AA4IO,IAAM,qBAAqB,GAAG,UAAC,KAAD,EAAyB;AAC5D,MAAM,UAAU,GAAG,aAAa,EAAhC;AAEA,EAAA,KAAK,CAAC,SAAN,GAAkB,mBAAA,CAAA,YAAA,CAChB,KAAK,CAAC,OAAN,IAAiB,UAAU,CAAC,OADZ,EAEhB,KAAK,CAAC,OAAN,IAAiB,KAAK,CAAC,OAAvB,IAAkC,UAAU,CAAC,cAF7B,EAGhB,KAAK,CAAC,OAAN,IAAiB,KAAK,CAAC,OAAvB,IAAkC,UAAU,CAAC,cAH7B,EAIhB,KAAK,CAAC,OAAN,IAAiB,KAAK,CAAC,MAAvB,IAAiC,UAAU,CAAC,aAJ5B,EAKhB,KAAK,CAAC,OAAN,IAAiB,KAAK,CAAC,WAAvB,IAAsC,UAAU,CAAC,kBALjC,EAMhB,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,UAAU,CAAC,QAN1C,EAOhB,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,KAAK,CAAC,OAArD,IAAgE,UAAU,CAAC,eAP3D,EAQhB,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,KAAK,CAAC,MAArD,IAA+D,UAAU,CAAC,cAR1D,EAShB,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,KAAK,CAAC,WAArD,IAAoE,UAAU,CAAC,mBAT/D,EAUhB,KAAK,CAAC,SAVU,CAAlB;AAaA,EAAA,iBAAA,CAAA,eAAA,CAAgB,KAAhB;AAEA,SAAO,KAAP;AACD,CAnBM;;AAAM,OAAA,CAAA,qBAAA,GAAqB,qBAArB","sourcesContent":["import { mergeClasses, makeStyles } from '@fluentui/react-make-styles';\nimport { useButtonStyles } from '../Button/useButtonStyles';\nimport type { ToggleButtonState } from './ToggleButton.types';\n\nconst useRootStyles = makeStyles({\n checked: theme => ({\n background: theme.alias.color.neutral.neutralBackground1Selected,\n borderColor: theme.alias.color.neutral.neutralStroke1,\n color: theme.alias.color.neutral.neutralForeground1,\n\n borderWidth: theme.global.strokeWidth.thin,\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\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 }),\n checkedOutline: theme => ({\n background: theme.alias.color.neutral.transparentBackgroundSelected,\n\n ':hover': {\n background: theme.alias.color.neutral.transparentBackgroundHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.transparentBackgroundPressed,\n },\n }),\n checkedPrimary: theme => ({\n background: theme.alias.color.neutral.brandBackgroundSelected,\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 checkedSubtle: theme => ({\n background: theme.alias.color.neutral.subtleBackgroundSelected,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandSelected,\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 checkedTransparent: theme => ({\n background: theme.alias.color.neutral.transparentBackgroundSelected,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandSelected,\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 ':hover': {\n background: theme.alias.color.neutral.neutralBackgroundDisabled,\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\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 }),\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\nexport const useToggleButtonStyles = (state: ToggleButtonState): ToggleButtonState => {\n const rootStyles = useRootStyles();\n\n state.className = mergeClasses(\n state.checked && rootStyles.checked,\n state.checked && state.outline && rootStyles.checkedOutline,\n state.checked && state.primary && rootStyles.checkedPrimary,\n state.checked && state.subtle && rootStyles.checkedSubtle,\n state.checked && state.transparent && rootStyles.checkedTransparent,\n (state.disabled || state.disabledFocusable) && rootStyles.disabled,\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.className,\n );\n\n useButtonStyles(state);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/ToggleButton/useToggleButtonStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAGA,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;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;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;;AA4IO,IAAM,qBAAqB,GAAG,UAAC,KAAD,EAAyB;AAC5D,MAAM,UAAU,GAAG,aAAa,EAAhC;AAEA,EAAA,KAAK,CAAC,SAAN,GAAkB,mBAAA,CAAA,YAAA,CAChB,KAAK,CAAC,OAAN,IAAiB,UAAU,CAAC,OADZ,EAEhB,KAAK,CAAC,OAAN,IAAiB,KAAK,CAAC,OAAvB,IAAkC,UAAU,CAAC,cAF7B,EAGhB,KAAK,CAAC,OAAN,IAAiB,KAAK,CAAC,OAAvB,IAAkC,UAAU,CAAC,cAH7B,EAIhB,KAAK,CAAC,OAAN,IAAiB,KAAK,CAAC,MAAvB,IAAiC,UAAU,CAAC,aAJ5B,EAKhB,KAAK,CAAC,OAAN,IAAiB,KAAK,CAAC,WAAvB,IAAsC,UAAU,CAAC,kBALjC,EAMhB,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,UAAU,CAAC,QAN1C,EAOhB,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,KAAK,CAAC,OAArD,IAAgE,UAAU,CAAC,eAP3D,EAQhB,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,KAAK,CAAC,MAArD,IAA+D,UAAU,CAAC,cAR1D,EAShB,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,KAAK,CAAC,WAArD,IAAoE,UAAU,CAAC,mBAT/D,EAUhB,KAAK,CAAC,SAVU,CAAlB;AAaA,EAAA,iBAAA,CAAA,eAAA,CAAgB,KAAhB;AAEA,SAAO,KAAP;AACD,CAnBM;;AAAM,OAAA,CAAA,qBAAA,GAAqB,qBAArB","sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';\nimport { useButtonStyles } from '../Button/useButtonStyles';\nimport type { ToggleButtonState } from './ToggleButton.types';\n\nconst useRootStyles = makeStyles({\n checked: theme => ({\n background: theme.alias.color.neutral.neutralBackground1Selected,\n borderColor: theme.alias.color.neutral.neutralStroke1,\n color: theme.alias.color.neutral.neutralForeground1,\n\n borderWidth: theme.global.strokeWidth.thin,\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\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 }),\n checkedOutline: theme => ({\n background: theme.alias.color.neutral.transparentBackgroundSelected,\n\n ':hover': {\n background: theme.alias.color.neutral.transparentBackgroundHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.transparentBackgroundPressed,\n },\n }),\n checkedPrimary: theme => ({\n background: theme.alias.color.neutral.brandBackgroundSelected,\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 checkedSubtle: theme => ({\n background: theme.alias.color.neutral.subtleBackgroundSelected,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandSelected,\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 checkedTransparent: theme => ({\n background: theme.alias.color.neutral.transparentBackgroundSelected,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandSelected,\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 ':hover': {\n background: theme.alias.color.neutral.neutralBackgroundDisabled,\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\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 }),\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\nexport const useToggleButtonStyles = (state: ToggleButtonState): ToggleButtonState => {\n const rootStyles = useRootStyles();\n\n state.className = mergeClasses(\n state.checked && rootStyles.checked,\n state.checked && state.outline && rootStyles.checkedOutline,\n state.checked && state.primary && rootStyles.checkedPrimary,\n state.checked && state.subtle && rootStyles.checkedSubtle,\n state.checked && state.transparent && rootStyles.checkedTransparent,\n (state.disabled || state.disabledFocusable) && rootStyles.disabled,\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.className,\n );\n\n useButtonStyles(state);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1,4 +1,5 @@
1
1
  export * from './Button';
2
2
  export * from './CompoundButton';
3
3
  export * from './MenuButton';
4
+ export * from './SplitButton';
4
5
  export * from './ToggleButton';
@@ -12,5 +12,7 @@ tslib_1.__exportStar(require("./CompoundButton"), exports);
12
12
 
13
13
  tslib_1.__exportStar(require("./MenuButton"), exports);
14
14
 
15
+ tslib_1.__exportStar(require("./SplitButton"), exports);
16
+
15
17
  tslib_1.__exportStar(require("./ToggleButton"), exports);
16
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,UAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './Button';\nexport * from './CompoundButton';\nexport * from './MenuButton';\nexport * from './ToggleButton';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,UAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './Button';\nexport * from './CompoundButton';\nexport * from './MenuButton';\nexport * from './SplitButton';\nexport * from './ToggleButton';\n"],"sourceRoot":"../src/"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-button",
3
- "version": "9.0.0-alpha.85",
3
+ "version": "9.0.0-alpha.89",
4
4
  "description": "Fluent UI React Button component.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -26,12 +26,12 @@
26
26
  },
27
27
  "devDependencies": {
28
28
  "@fluentui/a11y-testing": "^0.1.0",
29
- "@fluentui/babel-make-styles": "9.0.0-alpha.47",
30
- "@fluentui/eslint-plugin": "^1.4.1",
31
- "@fluentui/jest-serializer-make-styles": "9.0.0-alpha.40",
32
- "@fluentui/react-conformance": "^0.5.0",
33
- "@fluentui/react-conformance-make-styles": "9.0.0-alpha.9",
34
- "@fluentui/react-menu": "9.0.0-alpha.76",
29
+ "@fluentui/babel-make-styles": "9.0.0-alpha.51",
30
+ "@fluentui/eslint-plugin": "*",
31
+ "@fluentui/jest-serializer-make-styles": "9.0.0-alpha.44",
32
+ "@fluentui/react-conformance": "*",
33
+ "@fluentui/react-conformance-make-styles": "9.0.0-alpha.13",
34
+ "@fluentui/react-menu": "9.0.0-alpha.80",
35
35
  "@fluentui/scripts": "^1.0.0",
36
36
  "@types/enzyme": "3.10.3",
37
37
  "@types/enzyme-adapter-react-16": "1.0.3",
@@ -47,9 +47,9 @@
47
47
  "dependencies": {
48
48
  "@fluentui/keyboard-keys": "9.0.0-alpha.3",
49
49
  "@fluentui/react-icons": "^1.1.136",
50
- "@fluentui/react-make-styles": "9.0.0-alpha.65",
51
- "@fluentui/react-tabster": "9.0.0-alpha.59",
52
- "@fluentui/react-utilities": "9.0.0-alpha.47",
50
+ "@fluentui/react-make-styles": "9.0.0-alpha.69",
51
+ "@fluentui/react-tabster": "9.0.0-alpha.63",
52
+ "@fluentui/react-utilities": "9.0.0-alpha.49",
53
53
  "tslib": "^2.1.0"
54
54
  },
55
55
  "peerDependencies": {