@fluentui/react-button 9.5.3 → 9.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/CHANGELOG.md +25 -2
  2. package/lib/Button.js.map +1 -1
  3. package/lib/CompoundButton.js.map +1 -1
  4. package/lib/MenuButton.js.map +1 -1
  5. package/lib/SplitButton.js.map +1 -1
  6. package/lib/ToggleButton.js.map +1 -1
  7. package/lib/components/Button/Button.js.map +1 -1
  8. package/lib/components/Button/Button.types.js.map +1 -1
  9. package/lib/components/Button/index.js.map +1 -1
  10. package/lib/components/Button/renderButton.js.map +1 -1
  11. package/lib/components/Button/useButton.js.map +1 -1
  12. package/lib/components/Button/useButtonStyles.styles.raw.js +488 -0
  13. package/lib/components/Button/useButtonStyles.styles.raw.js.map +1 -0
  14. package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
  15. package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
  16. package/lib/components/CompoundButton/index.js.map +1 -1
  17. package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
  18. package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
  19. package/lib/components/CompoundButton/useCompoundButtonStyles.styles.raw.js +241 -0
  20. package/lib/components/CompoundButton/useCompoundButtonStyles.styles.raw.js.map +1 -0
  21. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  22. package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
  23. package/lib/components/MenuButton/index.js.map +1 -1
  24. package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
  25. package/lib/components/MenuButton/useMenuButton.js.map +1 -1
  26. package/lib/components/MenuButton/useMenuButtonStyles.styles.raw.js +112 -0
  27. package/lib/components/MenuButton/useMenuButtonStyles.styles.raw.js.map +1 -0
  28. package/lib/components/SplitButton/SplitButton.js.map +1 -1
  29. package/lib/components/SplitButton/SplitButton.types.js.map +1 -1
  30. package/lib/components/SplitButton/index.js.map +1 -1
  31. package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
  32. package/lib/components/SplitButton/useSplitButton.js.map +1 -1
  33. package/lib/components/SplitButton/useSplitButtonStyles.styles.raw.js +158 -0
  34. package/lib/components/SplitButton/useSplitButtonStyles.styles.raw.js.map +1 -0
  35. package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
  36. package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -1
  37. package/lib/components/ToggleButton/index.js.map +1 -1
  38. package/lib/components/ToggleButton/renderToggleButton.js.map +1 -1
  39. package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
  40. package/lib/components/ToggleButton/useToggleButtonStyles.styles.raw.js +226 -0
  41. package/lib/components/ToggleButton/useToggleButtonStyles.styles.raw.js.map +1 -0
  42. package/lib/contexts/ButtonContext.js.map +1 -1
  43. package/lib/contexts/index.js.map +1 -1
  44. package/lib/index.js.map +1 -1
  45. package/lib/utils/index.js.map +1 -1
  46. package/lib/utils/useToggleState.js.map +1 -1
  47. package/lib-commonjs/Button.js.map +1 -1
  48. package/lib-commonjs/CompoundButton.js.map +1 -1
  49. package/lib-commonjs/MenuButton.js.map +1 -1
  50. package/lib-commonjs/SplitButton.js.map +1 -1
  51. package/lib-commonjs/ToggleButton.js.map +1 -1
  52. package/lib-commonjs/components/Button/Button.js.map +1 -1
  53. package/lib-commonjs/components/Button/Button.types.js.map +1 -1
  54. package/lib-commonjs/components/Button/index.js.map +1 -1
  55. package/lib-commonjs/components/Button/renderButton.js.map +1 -1
  56. package/lib-commonjs/components/Button/useButton.js.map +1 -1
  57. package/lib-commonjs/components/Button/useButtonStyles.styles.js.map +1 -1
  58. package/lib-commonjs/components/Button/useButtonStyles.styles.raw.js +495 -0
  59. package/lib-commonjs/components/Button/useButtonStyles.styles.raw.js.map +1 -0
  60. package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
  61. package/lib-commonjs/components/CompoundButton/CompoundButton.types.js.map +1 -1
  62. package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
  63. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
  64. package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
  65. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.js.map +1 -1
  66. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.raw.js +253 -0
  67. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.raw.js.map +1 -0
  68. package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
  69. package/lib-commonjs/components/MenuButton/MenuButton.types.js.map +1 -1
  70. package/lib-commonjs/components/MenuButton/index.js.map +1 -1
  71. package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
  72. package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
  73. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.js.map +1 -1
  74. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.raw.js +129 -0
  75. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.raw.js.map +1 -0
  76. package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
  77. package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -1
  78. package/lib-commonjs/components/SplitButton/index.js.map +1 -1
  79. package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
  80. package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
  81. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.js.map +1 -1
  82. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.raw.js +174 -0
  83. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.raw.js.map +1 -0
  84. package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
  85. package/lib-commonjs/components/ToggleButton/ToggleButton.types.js.map +1 -1
  86. package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
  87. package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
  88. package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
  89. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.js.map +1 -1
  90. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.raw.js +237 -0
  91. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.raw.js.map +1 -0
  92. package/lib-commonjs/contexts/ButtonContext.js.map +1 -1
  93. package/lib-commonjs/contexts/index.js.map +1 -1
  94. package/lib-commonjs/index.js.map +1 -1
  95. package/lib-commonjs/utils/index.js.map +1 -1
  96. package/lib-commonjs/utils/useToggleState.js.map +1 -1
  97. package/package.json +5 -5
@@ -0,0 +1,237 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ toggleButtonClassNames: function() {
13
+ return toggleButtonClassNames;
14
+ },
15
+ useToggleButtonStyles_unstable: function() {
16
+ return useToggleButtonStyles_unstable;
17
+ }
18
+ });
19
+ const _reacticons = require("@fluentui/react-icons");
20
+ const _reacttabster = require("@fluentui/react-tabster");
21
+ const _reacttheme = require("@fluentui/react-theme");
22
+ const _react = require("@griffel/react");
23
+ const _useButtonStylesstyles = require("../Button/useButtonStyles.styles");
24
+ const toggleButtonClassNames = {
25
+ root: 'fui-ToggleButton',
26
+ icon: 'fui-ToggleButton__icon'
27
+ };
28
+ const useRootCheckedStyles = (0, _react.makeStyles)({
29
+ // Base styles
30
+ base: {
31
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground1Selected,
32
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStroke1),
33
+ color: _reacttheme.tokens.colorNeutralForeground1Selected,
34
+ ..._react.shorthands.borderWidth(_reacttheme.tokens.strokeWidthThin),
35
+ [`& .${_reacticons.iconFilledClassName}`]: {
36
+ display: 'inline'
37
+ },
38
+ [`& .${_reacticons.iconRegularClassName}`]: {
39
+ display: 'none'
40
+ },
41
+ ':hover': {
42
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground1Hover,
43
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStroke1Hover),
44
+ color: _reacttheme.tokens.colorNeutralForeground1Hover
45
+ },
46
+ ':hover:active': {
47
+ backgroundColor: _reacttheme.tokens.colorNeutralBackground1Pressed,
48
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStroke1Pressed),
49
+ color: _reacttheme.tokens.colorNeutralForeground1Pressed
50
+ }
51
+ },
52
+ // High contrast styles
53
+ highContrast: {
54
+ '@media (forced-colors: active)': {
55
+ backgroundColor: 'Highlight',
56
+ ..._react.shorthands.borderColor('Highlight'),
57
+ color: 'HighlightText',
58
+ forcedColorAdjust: 'none',
59
+ ':hover': {
60
+ backgroundColor: 'HighlightText',
61
+ ..._react.shorthands.borderColor('Highlight'),
62
+ color: 'Highlight'
63
+ },
64
+ ':hover:active': {
65
+ backgroundColor: 'HighlightText',
66
+ ..._react.shorthands.borderColor('Highlight'),
67
+ color: 'Highlight'
68
+ },
69
+ ':focus': {
70
+ border: '1px solid HighlightText',
71
+ outlineColor: 'Highlight'
72
+ }
73
+ }
74
+ },
75
+ // Appearance variations
76
+ outline: {
77
+ backgroundColor: _reacttheme.tokens.colorTransparentBackgroundSelected,
78
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStroke1),
79
+ ..._react.shorthands.borderWidth(_reacttheme.tokens.strokeWidthThicker),
80
+ ':hover': {
81
+ backgroundColor: _reacttheme.tokens.colorTransparentBackgroundHover
82
+ },
83
+ ':hover:active': {
84
+ backgroundColor: _reacttheme.tokens.colorTransparentBackgroundPressed
85
+ },
86
+ ...(0, _reacttabster.createCustomFocusIndicatorStyle)({
87
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStroke1)
88
+ })
89
+ },
90
+ primary: {
91
+ backgroundColor: _reacttheme.tokens.colorBrandBackgroundSelected,
92
+ ..._react.shorthands.borderColor('transparent'),
93
+ color: _reacttheme.tokens.colorNeutralForegroundOnBrand,
94
+ ':hover': {
95
+ backgroundColor: _reacttheme.tokens.colorBrandBackgroundHover,
96
+ ..._react.shorthands.borderColor('transparent'),
97
+ color: _reacttheme.tokens.colorNeutralForegroundOnBrand
98
+ },
99
+ ':hover:active': {
100
+ backgroundColor: _reacttheme.tokens.colorBrandBackgroundPressed,
101
+ ..._react.shorthands.borderColor('transparent'),
102
+ color: _reacttheme.tokens.colorNeutralForegroundOnBrand
103
+ }
104
+ },
105
+ secondary: {},
106
+ subtle: {
107
+ backgroundColor: _reacttheme.tokens.colorSubtleBackgroundSelected,
108
+ ..._react.shorthands.borderColor('transparent'),
109
+ color: _reacttheme.tokens.colorNeutralForeground2Selected,
110
+ ':hover': {
111
+ backgroundColor: _reacttheme.tokens.colorSubtleBackgroundHover,
112
+ ..._react.shorthands.borderColor('transparent'),
113
+ color: _reacttheme.tokens.colorNeutralForeground2Hover
114
+ },
115
+ ':hover:active': {
116
+ backgroundColor: _reacttheme.tokens.colorSubtleBackgroundPressed,
117
+ ..._react.shorthands.borderColor('transparent'),
118
+ color: _reacttheme.tokens.colorNeutralForeground2Pressed
119
+ }
120
+ },
121
+ transparent: {
122
+ backgroundColor: _reacttheme.tokens.colorTransparentBackgroundSelected,
123
+ ..._react.shorthands.borderColor('transparent'),
124
+ color: _reacttheme.tokens.colorNeutralForeground2BrandSelected,
125
+ ':hover': {
126
+ backgroundColor: _reacttheme.tokens.colorTransparentBackgroundHover,
127
+ ..._react.shorthands.borderColor('transparent'),
128
+ color: _reacttheme.tokens.colorNeutralForeground2BrandHover
129
+ },
130
+ ':hover:active': {
131
+ backgroundColor: _reacttheme.tokens.colorTransparentBackgroundPressed,
132
+ ..._react.shorthands.borderColor('transparent'),
133
+ color: _reacttheme.tokens.colorNeutralForeground2BrandPressed
134
+ }
135
+ }
136
+ });
137
+ const useRootDisabledStyles = (0, _react.makeStyles)({
138
+ // Base styles
139
+ base: {
140
+ backgroundColor: _reacttheme.tokens.colorNeutralBackgroundDisabled,
141
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStrokeDisabled),
142
+ color: _reacttheme.tokens.colorNeutralForegroundDisabled,
143
+ ':hover': {
144
+ backgroundColor: _reacttheme.tokens.colorNeutralBackgroundDisabled,
145
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStrokeDisabled),
146
+ color: _reacttheme.tokens.colorNeutralForegroundDisabled
147
+ },
148
+ ':hover:active': {
149
+ backgroundColor: _reacttheme.tokens.colorNeutralBackgroundDisabled,
150
+ ..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStrokeDisabled),
151
+ color: _reacttheme.tokens.colorNeutralForegroundDisabled
152
+ }
153
+ },
154
+ // Appearance variations
155
+ outline: {},
156
+ primary: {
157
+ ..._react.shorthands.borderColor('transparent'),
158
+ ':hover': {
159
+ ..._react.shorthands.borderColor('transparent')
160
+ },
161
+ ':hover:active': {
162
+ ..._react.shorthands.borderColor('transparent')
163
+ }
164
+ },
165
+ secondary: {},
166
+ subtle: {
167
+ backgroundColor: _reacttheme.tokens.colorTransparentBackground,
168
+ ..._react.shorthands.borderColor('transparent'),
169
+ ':hover': {
170
+ backgroundColor: _reacttheme.tokens.colorTransparentBackgroundHover,
171
+ ..._react.shorthands.borderColor('transparent')
172
+ },
173
+ ':hover:active': {
174
+ backgroundColor: _reacttheme.tokens.colorTransparentBackgroundPressed,
175
+ ..._react.shorthands.borderColor('transparent')
176
+ }
177
+ },
178
+ transparent: {
179
+ backgroundColor: _reacttheme.tokens.colorTransparentBackground,
180
+ ..._react.shorthands.borderColor('transparent'),
181
+ ':hover': {
182
+ backgroundColor: _reacttheme.tokens.colorTransparentBackgroundHover,
183
+ ..._react.shorthands.borderColor('transparent')
184
+ },
185
+ ':hover:active': {
186
+ backgroundColor: _reacttheme.tokens.colorTransparentBackgroundPressed,
187
+ ..._react.shorthands.borderColor('transparent')
188
+ }
189
+ }
190
+ });
191
+ const useIconCheckedStyles = (0, _react.makeStyles)({
192
+ // Appearance variations
193
+ subtleOrTransparent: {
194
+ color: _reacttheme.tokens.colorNeutralForeground2BrandSelected
195
+ },
196
+ // High contrast styles
197
+ highContrast: {
198
+ '@media (forced-colors: active)': {
199
+ forcedColorAdjust: 'auto'
200
+ }
201
+ }
202
+ });
203
+ const usePrimaryHighContrastStyles = (0, _react.makeStyles)({
204
+ // Do not use primary variant high contrast styles for toggle buttons
205
+ // otherwise there isn't enough difference between on/off states
206
+ base: {
207
+ '@media (forced-colors: active)': {
208
+ backgroundColor: 'ButtonFace',
209
+ ..._react.shorthands.borderColor('ButtonBorder'),
210
+ color: 'ButtonText',
211
+ forcedColorAdjust: 'auto'
212
+ }
213
+ },
214
+ disabled: {
215
+ '@media (forced-colors: active)': {
216
+ ..._react.shorthands.borderColor('GrayText'),
217
+ color: 'GrayText',
218
+ ':focus': {
219
+ ..._react.shorthands.borderColor('GrayText')
220
+ }
221
+ }
222
+ }
223
+ });
224
+ const useToggleButtonStyles_unstable = (state)=>{
225
+ 'use no memo';
226
+ const rootCheckedStyles = useRootCheckedStyles();
227
+ const rootDisabledStyles = useRootDisabledStyles();
228
+ const iconCheckedStyles = useIconCheckedStyles();
229
+ const primaryHighContrastStyles = usePrimaryHighContrastStyles();
230
+ const { appearance, checked, disabled, disabledFocusable } = state;
231
+ state.root.className = (0, _react.mergeClasses)(toggleButtonClassNames.root, appearance === 'primary' && primaryHighContrastStyles.base, appearance === 'primary' && (disabled || disabledFocusable) && primaryHighContrastStyles.disabled, checked && rootCheckedStyles.base, checked && rootCheckedStyles.highContrast, appearance && checked && rootCheckedStyles[appearance], (disabled || disabledFocusable) && rootDisabledStyles.base, appearance && (disabled || disabledFocusable) && rootDisabledStyles[appearance], state.root.className);
232
+ if (state.icon) {
233
+ state.icon.className = (0, _react.mergeClasses)(toggleButtonClassNames.icon, checked && (appearance === 'subtle' || appearance === 'transparent') && iconCheckedStyles.subtleOrTransparent, iconCheckedStyles.highContrast, state.icon.className);
234
+ }
235
+ (0, _useButtonStylesstyles.useButtonStyles_unstable)(state);
236
+ return state;
237
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ToggleButton/useToggleButtonStyles.styles.ts"],"sourcesContent":["import { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { useButtonStyles_unstable } from '../Button/useButtonStyles.styles';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { ButtonSlots } from '../Button/Button.types';\nimport type { ToggleButtonState } from './ToggleButton.types';\n\nexport const toggleButtonClassNames: SlotClassNames<ButtonSlots> = {\n root: 'fui-ToggleButton',\n icon: 'fui-ToggleButton__icon',\n};\n\nconst useRootCheckedStyles = makeStyles({\n // Base styles\n base: {\n backgroundColor: tokens.colorNeutralBackground1Selected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n color: tokens.colorNeutralForeground1Selected,\n\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n\n [`& .${iconFilledClassName}`]: {\n display: 'inline',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none',\n },\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n color: tokens.colorNeutralForeground1Hover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n color: tokens.colorNeutralForeground1Pressed,\n },\n },\n\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n backgroundColor: 'Highlight',\n ...shorthands.borderColor('Highlight'),\n color: 'HighlightText',\n forcedColorAdjust: 'none',\n\n ':hover': {\n backgroundColor: 'HighlightText',\n ...shorthands.borderColor('Highlight'),\n color: 'Highlight',\n },\n\n ':hover:active': {\n backgroundColor: 'HighlightText',\n ...shorthands.borderColor('Highlight'),\n color: 'Highlight',\n },\n\n ':focus': {\n border: '1px solid HighlightText',\n outlineColor: 'Highlight',\n },\n },\n },\n\n // Appearance variations\n outline: {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n ...shorthands.borderWidth(tokens.strokeWidthThicker),\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n },\n\n ...createCustomFocusIndicatorStyle({\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n }),\n },\n primary: {\n backgroundColor: tokens.colorBrandBackgroundSelected,\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.colorSubtleBackgroundSelected,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2Selected,\n\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2Hover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n transparent: {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandSelected,\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\nconst useRootDisabledStyles = makeStyles({\n // Base styles\n base: {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n\n // Appearance variations\n outline: {\n /* No styles */\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: tokens.colorTransparentBackground,\n ...shorthands.borderColor('transparent'),\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent'),\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n },\n },\n transparent: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor('transparent'),\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent'),\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n },\n },\n});\n\nconst useIconCheckedStyles = makeStyles({\n // Appearance variations\n subtleOrTransparent: {\n color: tokens.colorNeutralForeground2BrandSelected,\n },\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n forcedColorAdjust: 'auto',\n },\n },\n});\n\nconst usePrimaryHighContrastStyles = makeStyles({\n // Do not use primary variant high contrast styles for toggle buttons\n // otherwise there isn't enough difference between on/off states\n base: {\n '@media (forced-colors: active)': {\n backgroundColor: 'ButtonFace',\n ...shorthands.borderColor('ButtonBorder'),\n color: 'ButtonText',\n forcedColorAdjust: 'auto',\n },\n },\n\n disabled: {\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n color: 'GrayText',\n\n ':focus': {\n ...shorthands.borderColor('GrayText'),\n },\n },\n },\n});\n\nexport const useToggleButtonStyles_unstable = (state: ToggleButtonState): ToggleButtonState => {\n 'use no memo';\n\n const rootCheckedStyles = useRootCheckedStyles();\n const rootDisabledStyles = useRootDisabledStyles();\n const iconCheckedStyles = useIconCheckedStyles();\n const primaryHighContrastStyles = usePrimaryHighContrastStyles();\n\n const { appearance, checked, disabled, disabledFocusable } = state;\n\n state.root.className = mergeClasses(\n toggleButtonClassNames.root,\n\n // Primary high contrast styles\n appearance === 'primary' && primaryHighContrastStyles.base,\n appearance === 'primary' && (disabled || disabledFocusable) && primaryHighContrastStyles.disabled,\n\n // Checked styles\n checked && rootCheckedStyles.base,\n checked && rootCheckedStyles.highContrast,\n appearance && checked && rootCheckedStyles[appearance],\n\n // Disabled styles\n (disabled || disabledFocusable) && rootDisabledStyles.base,\n appearance && (disabled || disabledFocusable) && rootDisabledStyles[appearance],\n\n // User provided class name\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n toggleButtonClassNames.icon,\n checked && (appearance === 'subtle' || appearance === 'transparent') && iconCheckedStyles.subtleOrTransparent,\n iconCheckedStyles.highContrast,\n state.icon.className,\n );\n }\n\n useButtonStyles_unstable(state);\n\n return state;\n};\n"],"names":["iconFilledClassName","iconRegularClassName","createCustomFocusIndicatorStyle","tokens","shorthands","mergeClasses","makeStyles","useButtonStyles_unstable","toggleButtonClassNames","root","icon","useRootCheckedStyles","base","backgroundColor","colorNeutralBackground1Selected","borderColor","colorNeutralStroke1","color","colorNeutralForeground1Selected","borderWidth","strokeWidthThin","display","colorNeutralBackground1Hover","colorNeutralStroke1Hover","colorNeutralForeground1Hover","colorNeutralBackground1Pressed","colorNeutralStroke1Pressed","colorNeutralForeground1Pressed","highContrast","forcedColorAdjust","border","outlineColor","outline","colorTransparentBackgroundSelected","strokeWidthThicker","colorTransparentBackgroundHover","colorTransparentBackgroundPressed","primary","colorBrandBackgroundSelected","colorNeutralForegroundOnBrand","colorBrandBackgroundHover","colorBrandBackgroundPressed","secondary","subtle","colorSubtleBackgroundSelected","colorNeutralForeground2Selected","colorSubtleBackgroundHover","colorNeutralForeground2Hover","colorSubtleBackgroundPressed","colorNeutralForeground2Pressed","transparent","colorNeutralForeground2BrandSelected","colorNeutralForeground2BrandHover","colorNeutralForeground2BrandPressed","useRootDisabledStyles","colorNeutralBackgroundDisabled","colorNeutralStrokeDisabled","colorNeutralForegroundDisabled","colorTransparentBackground","useIconCheckedStyles","subtleOrTransparent","usePrimaryHighContrastStyles","disabled","useToggleButtonStyles_unstable","state","rootCheckedStyles","rootDisabledStyles","iconCheckedStyles","primaryHighContrastStyles","appearance","checked","disabledFocusable","className"],"mappings":";;;;;;;;;;;IASaQ,sBAAAA;;;kCAgPAuD;eAAAA;;;4BAzP6C,wBAAwB;8BAClC,0BAA0B;4BACnD,wBAAwB;uBACM,iBAAiB;uCAC7B,mCAAmC;AAKrE,+BAA4D;IACjEtD,MAAM;IACNC,MAAM;AACR,EAAE;AAEF,MAAMC,2BAAuBL,iBAAAA,EAAW;IACtC,cAAc;IACdM,MAAM;QACJC,iBAAiBV,kBAAAA,CAAOW,+BAA+B;QACvD,GAAGV,iBAAAA,CAAWW,WAAW,CAACZ,kBAAAA,CAAOa,mBAAmB,CAAC;QACrDC,OAAOd,kBAAAA,CAAOe,+BAA+B;QAE7C,GAAGd,iBAAAA,CAAWe,WAAW,CAAChB,kBAAAA,CAAOiB,e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C,MAAM,EAAEQ,UAAU,EAAEC,OAAO,EAAER,QAAQ,EAAES,iBAAiB,EAAE,GAAGP;IAE7DA,MAAMvD,IAAI,CAAC+D,SAAS,OAAGnE,mBAAAA,EACrBG,uBAAuBC,IAAI,EAE3B,AACA4D,eAAe,aAAaD,GADG,uBACuBxD,IAAI,EAC1DyD,eAAe,aAAcP,CAAAA,YAAYS,iBAAAA,CAAgB,IAAMH,0BAA0BN,QAAQ,EAEjG,AACAQ,WAAWL,MADM,YACYrD,IAAI,EACjC0D,WAAWL,kBAAkBrC,YAAY,EACzCyC,cAAcC,WAAWL,iBAAiB,CAACI,WAAW,EAGtD,AADA,AACCP,CAAAA,YAAYS,KADK,YACLA,CAAgB,IAAML,mBAAmBtD,IAAI,EAC1DyD,cAAeP,CAAAA,YAAYS,iBAAAA,CAAgB,IAAML,kBAAkB,CAACG,WAAW,EAE/E,AACAL,MAAMvD,IAAI,CAAC+D,SAAS,OADO;IAI7B,IAAIR,MAAMtD,IAAI,EAAE;QACdsD,MAAMtD,IAAI,CAAC8D,SAAS,OAAGnE,mBAAAA,EACrBG,uBAAuBE,IAAI,EAC3B4D,WAAYD,CAAAA,eAAe,YAAYA,eAAe,aAAA,CAAY,IAAMF,kBAAkBP,mBAAmB,EAC7GO,kBAAkBvC,YAAY,EAC9BoC,MAAMtD,IAAI,CAAC8D,SAAS;IAExB;QAEAjE,+CAAAA,EAAyByD;IAEzB,OAAOA;AACT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/contexts/ButtonContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { ButtonSize } from '../components/Button/Button.types';\n\nconst buttonContext = React.createContext<ButtonContextValue | undefined>(undefined);\n\n/**\n * @internal\n * Internal context value used to update default values between internal components\n */\nexport interface ButtonContextValue {\n size?: ButtonSize;\n}\n\nconst buttonContextDefaultValue: ButtonContextValue = {};\n\n/**\n * @internal\n * Internal context provider used to update default values between internal components\n */\nexport const ButtonContextProvider = buttonContext.Provider;\n\n/**\n * @internal\n * Internal context hook used to update default values between internal components\n */\nexport const useButtonContext = () => React.useContext(buttonContext) ?? buttonContextDefaultValue;\n"],"names":["ButtonContextProvider","useButtonContext","buttonContext","React","createContext","undefined","buttonContextDefaultValue","Provider","useContext"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAmBaA,qBAAAA;eAAAA;;IAMAC,gBAAAA;eAAAA;;;;iEAzBU;AAGvB,MAAMC,8BAAgBC,OAAMC,aAAa,CAAiCC;AAU1E,MAAMC,4BAAgD,CAAC;AAMhD,MAAMN,wBAAwBE,cAAcK,QAAQ;AAMpD,MAAMN,mBAAmB;QAAME;WAAAA,CAAAA,oBAAAA,OAAMK,UAAU,CAACN,cAAAA,MAAAA,QAAjBC,sBAAAA,KAAAA,IAAAA,oBAAmCG;AAAwB"}
1
+ {"version":3,"sources":["../src/contexts/ButtonContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { ButtonSize } from '../components/Button/Button.types';\n\nconst buttonContext = React.createContext<ButtonContextValue | undefined>(undefined);\n\n/**\n * @internal\n * Internal context value used to update default values between internal components\n */\nexport interface ButtonContextValue {\n size?: ButtonSize;\n}\n\nconst buttonContextDefaultValue: ButtonContextValue = {};\n\n/**\n * @internal\n * Internal context provider used to update default values between internal components\n */\nexport const ButtonContextProvider = buttonContext.Provider;\n\n/**\n * @internal\n * Internal context hook used to update default values between internal components\n */\nexport const useButtonContext = () => React.useContext(buttonContext) ?? buttonContextDefaultValue;\n"],"names":["React","buttonContext","createContext","undefined","buttonContextDefaultValue","ButtonContextProvider","Provider","useButtonContext","useContext"],"mappings":";;;;;;;;;;;IAmBaK,qBAAAA;;;oBAMAE;;;;;iEAzBU,QAAQ;AAG/B,MAAMN,8BAAgBD,OAAME,aAAa,CAAiCC;AAU1E,MAAMC,4BAAgD,CAAC;AAMhD,8BAA8BH,cAAcK,QAAQ,CAAC;AAMrD,MAAMC,mBAAmB;QAAMP;WAAAA,CAAAA,oBAAAA,OAAMQ,UAAU,CAACP,cAAAA,MAAAA,QAAjBD,sBAAAA,KAAAA,IAAAA,oBAAmCI;EAA0B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/contexts/index.ts"],"sourcesContent":["export type { ButtonContextValue } from './ButtonContext';\nexport { ButtonContextProvider, useButtonContext } from './ButtonContext';\n"],"names":["ButtonContextProvider","useButtonContext"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACSA,qBAAqB;eAArBA,oCAAqB;;IAAEC,gBAAgB;eAAhBA,+BAAgB;;;+BAAQ"}
1
+ {"version":3,"sources":["../src/contexts/index.ts"],"sourcesContent":["export type { ButtonContextValue } from './ButtonContext';\nexport { ButtonContextProvider, useButtonContext } from './ButtonContext';\n"],"names":["ButtonContextProvider","useButtonContext"],"mappings":";;;;;;;;;;;;eACSA,oCAAqB;;;eAAEC,+BAAgB;;;+BAAQ,kBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Button,\n buttonClassNames,\n renderButton_unstable,\n useButtonStyles_unstable,\n useButton_unstable,\n} from './Button';\nexport type { ButtonProps, ButtonSlots, ButtonState } from './Button';\nexport {\n CompoundButton,\n compoundButtonClassNames,\n renderCompoundButton_unstable,\n useCompoundButtonStyles_unstable,\n useCompoundButton_unstable,\n} from './CompoundButton';\nexport type { CompoundButtonProps, CompoundButtonSlots, CompoundButtonState } from './CompoundButton';\nexport {\n MenuButton,\n menuButtonClassNames,\n renderMenuButton_unstable,\n useMenuButtonStyles_unstable,\n useMenuButton_unstable,\n} from './MenuButton';\nexport type { MenuButtonProps, MenuButtonSlots, MenuButtonState } from './MenuButton';\nexport {\n SplitButton,\n renderSplitButton_unstable,\n splitButtonClassNames,\n useSplitButtonStyles_unstable,\n useSplitButton_unstable,\n} from './SplitButton';\nexport type { SplitButtonProps, SplitButtonSlots, SplitButtonState } from './SplitButton';\nexport {\n ToggleButton,\n renderToggleButton_unstable,\n toggleButtonClassNames,\n useToggleButtonStyles_unstable,\n useToggleButton_unstable,\n} from './ToggleButton';\nexport type { ToggleButtonProps, ToggleButtonState } from './ToggleButton';\n\nexport { useToggleState } from './utils/index';\n\nexport { ButtonContextProvider, useButtonContext } from './contexts/index';\nexport type { ButtonContextValue } from './contexts/index';\n"],"names":["Button","ButtonContextProvider","CompoundButton","MenuButton","SplitButton","ToggleButton","buttonClassNames","compoundButtonClassNames","menuButtonClassNames","renderButton_unstable","renderCompoundButton_unstable","renderMenuButton_unstable","renderSplitButton_unstable","renderToggleButton_unstable","splitButtonClassNames","toggleButtonClassNames","useButtonContext","useButtonStyles_unstable","useButton_unstable","useCompoundButtonStyles_unstable","useCompoundButton_unstable","useMenuButtonStyles_unstable","useMenuButton_unstable","useSplitButtonStyles_unstable","useSplitButton_unstable","useToggleButtonStyles_unstable","useToggleButton_unstable","useToggleState"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,MAAM;eAANA,cAAM;;IA0CCC,qBAAqB;eAArBA,6BAAqB;;IAlC5BC,cAAc;eAAdA,8BAAc;;IAQdC,UAAU;eAAVA,sBAAU;;IAQVC,WAAW;eAAXA,wBAAW;;IAQXC,YAAY;eAAZA,0BAAY;;IA/BZC,gBAAgB;eAAhBA,wBAAgB;;IAQhBC,wBAAwB;eAAxBA,wCAAwB;;IAQxBC,oBAAoB;eAApBA,gCAAoB;;IAfpBC,qBAAqB;eAArBA,6BAAqB;;IAQrBC,6BAA6B;eAA7BA,6CAA6B;;IAQ7BC,yBAAyB;eAAzBA,qCAAyB;;IAOzBC,0BAA0B;eAA1BA,uCAA0B;;IAQ1BC,2BAA2B;eAA3BA,yCAA2B;;IAP3BC,qBAAqB;eAArBA,kCAAqB;;IAQrBC,sBAAsB;eAAtBA,oCAAsB;;IAQQC,gBAAgB;eAAhBA,wBAAgB;;IAvC9CC,wBAAwB;eAAxBA,gCAAwB;;IACxBC,kBAAkB;eAAlBA,0BAAkB;;IAOlBC,gCAAgC;eAAhCA,gDAAgC;;IAChCC,0BAA0B;eAA1BA,0CAA0B;;IAO1BC,4BAA4B;eAA5BA,wCAA4B;;IAC5BC,sBAAsB;eAAtBA,kCAAsB;;IAOtBC,6BAA6B;eAA7BA,0CAA6B;;IAC7BC,uBAAuB;eAAvBA,oCAAuB;;IAOvBC,8BAA8B;eAA9BA,4CAA8B;;IAC9BC,wBAAwB;eAAxBA,sCAAwB;;IAIjBC,cAAc;eAAdA,qBAAc;;;wBAnChB;gCAQA;4BAQA;6BAQA;8BAQA;uBAGwB;wBAEyB"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Button,\n buttonClassNames,\n renderButton_unstable,\n useButtonStyles_unstable,\n useButton_unstable,\n} from './Button';\nexport type { ButtonProps, ButtonSlots, ButtonState } from './Button';\nexport {\n CompoundButton,\n compoundButtonClassNames,\n renderCompoundButton_unstable,\n useCompoundButtonStyles_unstable,\n useCompoundButton_unstable,\n} from './CompoundButton';\nexport type { CompoundButtonProps, CompoundButtonSlots, CompoundButtonState } from './CompoundButton';\nexport {\n MenuButton,\n menuButtonClassNames,\n renderMenuButton_unstable,\n useMenuButtonStyles_unstable,\n useMenuButton_unstable,\n} from './MenuButton';\nexport type { MenuButtonProps, MenuButtonSlots, MenuButtonState } from './MenuButton';\nexport {\n SplitButton,\n renderSplitButton_unstable,\n splitButtonClassNames,\n useSplitButtonStyles_unstable,\n useSplitButton_unstable,\n} from './SplitButton';\nexport type { SplitButtonProps, SplitButtonSlots, SplitButtonState } from './SplitButton';\nexport {\n ToggleButton,\n renderToggleButton_unstable,\n toggleButtonClassNames,\n useToggleButtonStyles_unstable,\n useToggleButton_unstable,\n} from './ToggleButton';\nexport type { ToggleButtonProps, ToggleButtonState } from './ToggleButton';\n\nexport { useToggleState } from './utils/index';\n\nexport { ButtonContextProvider, useButtonContext } from './contexts/index';\nexport type { ButtonContextValue } from './contexts/index';\n"],"names":["Button","buttonClassNames","renderButton_unstable","useButtonStyles_unstable","useButton_unstable","CompoundButton","compoundButtonClassNames","renderCompoundButton_unstable","useCompoundButtonStyles_unstable","useCompoundButton_unstable","MenuButton","menuButtonClassNames","renderMenuButton_unstable","useMenuButtonStyles_unstable","useMenuButton_unstable","SplitButton","renderSplitButton_unstable","splitButtonClassNames","useSplitButtonStyles_unstable","useSplitButton_unstable","ToggleButton","renderToggleButton_unstable","toggleButtonClassNames","useToggleButtonStyles_unstable","useToggleButton_unstable","useToggleState","ButtonContextProvider","useButtonContext"],"mappings":";;;;;;;;;;;IACEA,MAAM;;;;eA0CC0B,6BAAqB;;;eAlC5BrB,8BAAc;;;eAQdK,sBAAU;;eAQC;eAAXK;;gBAQY;eAAZK;;;eA/BAnB,wBAAgB;;;eAQhBK,wCAAwB;;wBAQJ;eAApBK;;;eAfAT,6BAAqB;;iCAQQ;eAA7BK;;6BAQyB;eAAzBK;;;eAOAI,uCAA0B;;;eAQ1BK,yCAA2B;;;eAP3BJ,kCAAqB;;;eAQrBK,oCAAsB;;IAQQK;uCAAgB;;;eAvC9CxB,gCAAwB;;;eACxBC,0BAAkB;;;eAOlBI,gDAAgC;;;eAChCC,0CAA0B;;;eAO1BI,wCAA4B;;;eAC5BC,kCAAsB;;;eAOtBI,0CAA6B;;;eAC7BC,oCAAuB;;IAOvBI;2DAA8B;;;eAC9BC,sCAAwB;;;eAIjBC,qBAAc;;;wBAnChB,WAAW;gCAQX,mBAAmB;4BAQnB,eAAe;6BAQf,gBAAgB;8BAQhB,iBAAiB;uBAGO,gBAAgB;wBAES,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/index.ts"],"sourcesContent":["export { useToggleState } from './useToggleState';\n"],"names":["useToggleState"],"rangeMappings":";;;;;;;;;;","mappings":";;;;+BAASA;;;eAAAA,8BAAc;;;gCAAQ"}
1
+ {"version":3,"sources":["../src/utils/index.ts"],"sourcesContent":["export { useToggleState } from './useToggleState';\n"],"names":["useToggleState"],"mappings":";;;;;;;eAASA,8BAAc;;;gCAAQ,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/useToggleState.ts"],"sourcesContent":["import * as React from 'react';\nimport { mergeCallbacks, useControllableState, useEventCallback } from '@fluentui/react-utilities';\nimport type { ButtonState } from '../Button';\nimport type { ToggleButtonProps, ToggleButtonState } from '../ToggleButton';\n\nexport function useToggleState<\n TToggleButtonProps extends Pick<ToggleButtonProps, 'checked' | 'defaultChecked' | 'disabled' | 'disabledFocusable'>,\n TButtonState extends Pick<ButtonState, 'root'>,\n TToggleButtonState extends Pick<ToggleButtonState, 'checked' | 'root'>,\n>(props: TToggleButtonProps, state: TButtonState): TToggleButtonState {\n const { checked, defaultChecked, disabled, disabledFocusable } = props;\n const { onClick, role } = state.root;\n\n const [checkedValue, setCheckedValue] = useControllableState({\n state: checked,\n defaultState: defaultChecked,\n initialState: false,\n });\n\n const isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';\n\n const onToggleClick = React.useCallback(\n (ev: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n if (!disabled && !disabledFocusable) {\n if (ev.defaultPrevented) {\n return;\n }\n\n setCheckedValue(!checkedValue);\n }\n },\n [checkedValue, disabled, disabledFocusable, setCheckedValue],\n );\n\n return {\n ...state,\n\n checked: checkedValue,\n\n root: {\n ...state.root,\n [isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed']: checkedValue,\n onClick: useEventCallback(\n mergeCallbacks(onClick as React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>, onToggleClick),\n ),\n },\n } as TToggleButtonState;\n}\n"],"names":["useToggleState","props","state","checked","defaultChecked","disabled","disabledFocusable","onClick","role","root","checkedValue","setCheckedValue","useControllableState","defaultState","initialState","isCheckboxTypeRole","onToggleClick","React","useCallback","ev","defaultPrevented","useEventCallback","mergeCallbacks"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAKgBA;;;eAAAA;;;;iEALO;gCACgD;AAIhE,SAASA,eAIdC,KAAyB,EAAEC,KAAmB;IAC9C,MAAM,EAAEC,OAAO,EAAEC,cAAc,EAAEC,QAAQ,EAAEC,iBAAiB,EAAE,GAAGL;IACjE,MAAM,EAAEM,OAAO,EAAEC,IAAI,EAAE,GAAGN,MAAMO,IAAI;IAEpC,MAAM,CAACC,cAAcC,gBAAgB,GAAGC,IAAAA,oCAAAA,EAAqB;QAC3DV,OAAOC;QACPU,cAAcT;QACdU,cAAc;IAChB;IAEA,MAAMC,qBAAqBP,SAAS,sBAAsBA,SAAS;IAEnE,MAAMQ,gBAAgBC,OAAMC,WAAW,CACrC,CAACC;QACC,IAAI,CAACd,YAAY,CAACC,mBAAmB;YACnC,IAAIa,GAAGC,gBAAgB,EAAE;gBACvB;YACF;YAEAT,gBAAgB,CAACD;QACnB;IACF,GACA;QAACA;QAAcL;QAAUC;QAAmBK;KAAgB;IAG9D,OAAO;QACL,GAAGT,KAAK;QAERC,SAASO;QAETD,MAAM;YACJ,GAAGP,MAAMO,IAAI;YACb,CAACM,qBAAqB,iBAAiB,eAAe,EAAEL;YACxDH,SAASc,IAAAA,gCAAAA,EACPC,IAAAA,8BAAAA,EAAef,SAA2ES;QAE9F;IACF;AACF"}
1
+ {"version":3,"sources":["../src/utils/useToggleState.ts"],"sourcesContent":["import * as React from 'react';\nimport { mergeCallbacks, useControllableState, useEventCallback } from '@fluentui/react-utilities';\nimport type { ButtonState } from '../Button';\nimport type { ToggleButtonProps, ToggleButtonState } from '../ToggleButton';\n\nexport function useToggleState<\n TToggleButtonProps extends Pick<ToggleButtonProps, 'checked' | 'defaultChecked' | 'disabled' | 'disabledFocusable'>,\n TButtonState extends Pick<ButtonState, 'root'>,\n TToggleButtonState extends Pick<ToggleButtonState, 'checked' | 'root'>,\n>(props: TToggleButtonProps, state: TButtonState): TToggleButtonState {\n const { checked, defaultChecked, disabled, disabledFocusable } = props;\n const { onClick, role } = state.root;\n\n const [checkedValue, setCheckedValue] = useControllableState({\n state: checked,\n defaultState: defaultChecked,\n initialState: false,\n });\n\n const isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';\n\n const onToggleClick = React.useCallback(\n (ev: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n if (!disabled && !disabledFocusable) {\n if (ev.defaultPrevented) {\n return;\n }\n\n setCheckedValue(!checkedValue);\n }\n },\n [checkedValue, disabled, disabledFocusable, setCheckedValue],\n );\n\n return {\n ...state,\n\n checked: checkedValue,\n\n root: {\n ...state.root,\n [isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed']: checkedValue,\n onClick: useEventCallback(\n mergeCallbacks(onClick as React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>, onToggleClick),\n ),\n },\n } as TToggleButtonState;\n}\n"],"names":["React","mergeCallbacks","useControllableState","useEventCallback","useToggleState","props","state","checked","defaultChecked","disabled","disabledFocusable","onClick","role","root","checkedValue","setCheckedValue","defaultState","initialState","isCheckboxTypeRole","onToggleClick","useCallback","ev","defaultPrevented"],"mappings":";;;;+BAKgBI;;;;;;;iEALO,QAAQ;gCACwC,4BAA4B;AAI5F,wBAILC,KAAyB,EAAEC,KAAmB;IAC9C,MAAM,EAAEC,OAAO,EAAEC,cAAc,EAAEC,QAAQ,EAAEC,iBAAiB,EAAE,GAAGL;IACjE,MAAM,EAAEM,OAAO,EAAEC,IAAI,EAAE,GAAGN,MAAMO,IAAI;IAEpC,MAAM,CAACC,cAAcC,gBAAgB,OAAGb,oCAAAA,EAAqB;QAC3DI,OAAOC;QACPS,cAAcR;QACdS,cAAc;IAChB;IAEA,MAAMC,qBAAqBN,SAAS,sBAAsBA,SAAS;IAEnE,MAAMO,gBAAgBnB,OAAMoB,WAAW,CACrC,CAACC;QACC,IAAI,CAACZ,YAAY,CAACC,mBAAmB;YACnC,IAAIW,GAAGC,gBAAgB,EAAE;gBACvB;YACF;YAEAP,gBAAgB,CAACD;QACnB;IACF,GACA;QAACA;QAAcL;QAAUC;QAAmBK;KAAgB;IAG9D,OAAO;QACL,GAAGT,KAAK;QAERC,SAASO;QAETD,MAAM;YACJ,GAAGP,MAAMO,IAAI;YACb,CAACK,qBAAqB,iBAAiB,eAAe,EAAEJ;YACxDH,aAASR,gCAAAA,MACPF,8BAAAA,EAAeU,SAA2EQ;QAE9F;IACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-button",
3
- "version": "9.5.3",
3
+ "version": "9.6.1",
4
4
  "description": "Fluent UI React Button component.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -20,13 +20,13 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@fluentui/keyboard-keys": "^9.0.8",
23
- "@fluentui/react-aria": "^9.15.3",
23
+ "@fluentui/react-aria": "^9.16.0",
24
24
  "@fluentui/react-icons": "^2.0.245",
25
- "@fluentui/react-jsx-runtime": "^9.1.2",
25
+ "@fluentui/react-jsx-runtime": "^9.1.3",
26
26
  "@fluentui/react-shared-contexts": "^9.24.0",
27
- "@fluentui/react-tabster": "^9.25.3",
27
+ "@fluentui/react-tabster": "^9.26.1",
28
28
  "@fluentui/react-theme": "^9.1.24",
29
- "@fluentui/react-utilities": "^9.22.0",
29
+ "@fluentui/react-utilities": "^9.23.0",
30
30
  "@griffel/react": "^1.5.22",
31
31
  "@swc/helpers": "^0.5.1"
32
32
  },