@fluentui/react-button 9.0.0-rc.1 → 9.0.0-rc.10

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 +475 -1
  2. package/CHANGELOG.md +297 -172
  3. package/dist/{react-button.d.ts → index.d.ts} +67 -31
  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.map +1 -1
  11. package/lib/components/Button/Button.types.js.map +1 -1
  12. package/lib/components/Button/index.js +3 -1
  13. package/lib/components/Button/index.js.map +1 -1
  14. package/lib/components/Button/renderButton.js.map +1 -1
  15. package/lib/components/Button/useButton.js +2 -1
  16. package/lib/components/Button/useButton.js.map +1 -1
  17. package/lib/components/Button/useButtonStyles.js +155 -97
  18. package/lib/components/Button/useButtonStyles.js.map +1 -1
  19. package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
  20. package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
  21. package/lib/components/CompoundButton/index.js +3 -1
  22. package/lib/components/CompoundButton/index.js.map +1 -1
  23. package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
  24. package/lib/components/CompoundButton/useCompoundButton.js +7 -2
  25. package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
  26. package/lib/components/CompoundButton/useCompoundButtonStyles.js +77 -55
  27. package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  28. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  29. package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
  30. package/lib/components/MenuButton/index.js +3 -1
  31. package/lib/components/MenuButton/index.js.map +1 -1
  32. package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
  33. package/lib/components/MenuButton/useMenuButton.js.map +1 -1
  34. package/lib/components/MenuButton/useMenuButtonStyles.js +39 -14
  35. package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  36. package/lib/components/SplitButton/SplitButton.js.map +1 -1
  37. package/lib/components/SplitButton/SplitButton.types.js.map +1 -1
  38. package/lib/components/SplitButton/index.js +3 -1
  39. package/lib/components/SplitButton/index.js.map +1 -1
  40. package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
  41. package/lib/components/SplitButton/useSplitButton.js +18 -5
  42. package/lib/components/SplitButton/useSplitButton.js.map +1 -1
  43. package/lib/components/SplitButton/useSplitButtonStyles.js +40 -27
  44. package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
  45. package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
  46. package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -1
  47. package/lib/components/ToggleButton/index.js +3 -1
  48. package/lib/components/ToggleButton/index.js.map +1 -1
  49. package/lib/components/ToggleButton/renderToggleButton.js.map +1 -1
  50. package/lib/components/ToggleButton/useToggleButton.js +3 -41
  51. package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
  52. package/lib/components/ToggleButton/useToggleButtonStyles.js +85 -60
  53. package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  54. package/lib/index.js +11 -5
  55. package/lib/index.js.map +1 -1
  56. package/lib/utils/index.js +2 -0
  57. package/lib/utils/index.js.map +1 -0
  58. package/lib/utils/useToggleState.js +37 -0
  59. package/lib/utils/useToggleState.js.map +1 -0
  60. package/lib-commonjs/Button.js.map +1 -1
  61. package/lib-commonjs/CompoundButton.js.map +1 -1
  62. package/lib-commonjs/MenuButton.js.map +1 -1
  63. package/lib-commonjs/SplitButton.js.map +1 -1
  64. package/lib-commonjs/ToggleButton.js.map +1 -1
  65. package/lib-commonjs/components/Button/Button.js.map +1 -1
  66. package/lib-commonjs/components/Button/Button.types.js.map +1 -1
  67. package/lib-commonjs/components/Button/index.js +9 -1
  68. package/lib-commonjs/components/Button/index.js.map +1 -1
  69. package/lib-commonjs/components/Button/renderButton.js.map +1 -1
  70. package/lib-commonjs/components/Button/useButton.js +2 -1
  71. package/lib-commonjs/components/Button/useButton.js.map +1 -1
  72. package/lib-commonjs/components/Button/useButtonStyles.js +157 -98
  73. package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
  74. package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
  75. package/lib-commonjs/components/CompoundButton/CompoundButton.types.js.map +1 -1
  76. package/lib-commonjs/components/CompoundButton/index.js +9 -1
  77. package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
  78. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
  79. package/lib-commonjs/components/CompoundButton/useCompoundButton.js +7 -2
  80. package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
  81. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +79 -57
  82. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  83. package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
  84. package/lib-commonjs/components/MenuButton/MenuButton.types.js.map +1 -1
  85. package/lib-commonjs/components/MenuButton/index.js +9 -1
  86. package/lib-commonjs/components/MenuButton/index.js.map +1 -1
  87. package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
  88. package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
  89. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +41 -15
  90. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  91. package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
  92. package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -1
  93. package/lib-commonjs/components/SplitButton/index.js +9 -1
  94. package/lib-commonjs/components/SplitButton/index.js.map +1 -1
  95. package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
  96. package/lib-commonjs/components/SplitButton/useSplitButton.js +17 -4
  97. package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
  98. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +41 -28
  99. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
  100. package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
  101. package/lib-commonjs/components/ToggleButton/ToggleButton.types.js.map +1 -1
  102. package/lib-commonjs/components/ToggleButton/index.js +9 -1
  103. package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
  104. package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
  105. package/lib-commonjs/components/ToggleButton/useToggleButton.js +3 -42
  106. package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
  107. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +89 -62
  108. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  109. package/lib-commonjs/index.js +204 -6
  110. package/lib-commonjs/index.js.map +1 -1
  111. package/lib-commonjs/utils/index.js +10 -0
  112. package/lib-commonjs/utils/index.js.map +1 -0
  113. package/lib-commonjs/utils/useToggleState.js +48 -0
  114. package/lib-commonjs/utils/useToggleState.js.map +1 -0
  115. package/package.json +20 -22
  116. package/dist/demo/index.html +0 -71
  117. package/dist/demo/react-dom.development.js +0 -21413
  118. package/dist/demo/react.development.js +0 -3155
  119. package/lib/Button.d.ts +0 -1
  120. package/lib/CompoundButton.d.ts +0 -1
  121. package/lib/MenuButton.d.ts +0 -1
  122. package/lib/SplitButton.d.ts +0 -1
  123. package/lib/ToggleButton.d.ts +0 -1
  124. package/lib/components/Button/Button.d.ts +0 -6
  125. package/lib/components/Button/Button.types.d.ts +0 -62
  126. package/lib/components/Button/index.d.ts +0 -5
  127. package/lib/components/Button/renderButton.d.ts +0 -5
  128. package/lib/components/Button/useButton.d.ts +0 -8
  129. package/lib/components/Button/useButtonStyles.d.ts +0 -3
  130. package/lib/components/CompoundButton/CompoundButton.d.ts +0 -6
  131. package/lib/components/CompoundButton/CompoundButton.types.d.ts +0 -14
  132. package/lib/components/CompoundButton/index.d.ts +0 -5
  133. package/lib/components/CompoundButton/renderCompoundButton.d.ts +0 -5
  134. package/lib/components/CompoundButton/useCompoundButton.d.ts +0 -8
  135. package/lib/components/CompoundButton/useCompoundButtonStyles.d.ts +0 -3
  136. package/lib/components/MenuButton/MenuButton.d.ts +0 -6
  137. package/lib/components/MenuButton/MenuButton.types.d.ts +0 -10
  138. package/lib/components/MenuButton/index.d.ts +0 -5
  139. package/lib/components/MenuButton/renderMenuButton.d.ts +0 -5
  140. package/lib/components/MenuButton/useMenuButton.d.ts +0 -6
  141. package/lib/components/MenuButton/useMenuButtonStyles.d.ts +0 -3
  142. package/lib/components/SplitButton/SplitButton.d.ts +0 -7
  143. package/lib/components/SplitButton/SplitButton.types.d.ts +0 -21
  144. package/lib/components/SplitButton/index.d.ts +0 -5
  145. package/lib/components/SplitButton/renderSplitButton.d.ts +0 -5
  146. package/lib/components/SplitButton/useSplitButton.d.ts +0 -8
  147. package/lib/components/SplitButton/useSplitButtonStyles.d.ts +0 -3
  148. package/lib/components/ToggleButton/ToggleButton.d.ts +0 -6
  149. package/lib/components/ToggleButton/ToggleButton.types.d.ts +0 -20
  150. package/lib/components/ToggleButton/index.d.ts +0 -5
  151. package/lib/components/ToggleButton/renderToggleButton.d.ts +0 -1
  152. package/lib/components/ToggleButton/useToggleButton.d.ts +0 -9
  153. package/lib/components/ToggleButton/useToggleButtonStyles.d.ts +0 -3
  154. package/lib/index.d.ts +0 -5
  155. package/lib-commonjs/Button.d.ts +0 -1
  156. package/lib-commonjs/CompoundButton.d.ts +0 -1
  157. package/lib-commonjs/MenuButton.d.ts +0 -1
  158. package/lib-commonjs/SplitButton.d.ts +0 -1
  159. package/lib-commonjs/ToggleButton.d.ts +0 -1
  160. package/lib-commonjs/components/Button/Button.d.ts +0 -6
  161. package/lib-commonjs/components/Button/Button.types.d.ts +0 -62
  162. package/lib-commonjs/components/Button/index.d.ts +0 -5
  163. package/lib-commonjs/components/Button/renderButton.d.ts +0 -5
  164. package/lib-commonjs/components/Button/useButton.d.ts +0 -8
  165. package/lib-commonjs/components/Button/useButtonStyles.d.ts +0 -3
  166. package/lib-commonjs/components/CompoundButton/CompoundButton.d.ts +0 -6
  167. package/lib-commonjs/components/CompoundButton/CompoundButton.types.d.ts +0 -14
  168. package/lib-commonjs/components/CompoundButton/index.d.ts +0 -5
  169. package/lib-commonjs/components/CompoundButton/renderCompoundButton.d.ts +0 -5
  170. package/lib-commonjs/components/CompoundButton/useCompoundButton.d.ts +0 -8
  171. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.d.ts +0 -3
  172. package/lib-commonjs/components/MenuButton/MenuButton.d.ts +0 -6
  173. package/lib-commonjs/components/MenuButton/MenuButton.types.d.ts +0 -10
  174. package/lib-commonjs/components/MenuButton/index.d.ts +0 -5
  175. package/lib-commonjs/components/MenuButton/renderMenuButton.d.ts +0 -5
  176. package/lib-commonjs/components/MenuButton/useMenuButton.d.ts +0 -6
  177. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.d.ts +0 -3
  178. package/lib-commonjs/components/SplitButton/SplitButton.d.ts +0 -7
  179. package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +0 -21
  180. package/lib-commonjs/components/SplitButton/index.d.ts +0 -5
  181. package/lib-commonjs/components/SplitButton/renderSplitButton.d.ts +0 -5
  182. package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +0 -8
  183. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +0 -3
  184. package/lib-commonjs/components/ToggleButton/ToggleButton.d.ts +0 -6
  185. package/lib-commonjs/components/ToggleButton/ToggleButton.types.d.ts +0 -20
  186. package/lib-commonjs/components/ToggleButton/index.d.ts +0 -5
  187. package/lib-commonjs/components/ToggleButton/renderToggleButton.d.ts +0 -1
  188. package/lib-commonjs/components/ToggleButton/useToggleButton.d.ts +0 -9
  189. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.d.ts +0 -3
  190. package/lib-commonjs/index.d.ts +0 -5
@@ -3,16 +3,214 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.useToggleState = exports.useToggleButton_unstable = exports.useToggleButtonStyles_unstable = exports.toggleButtonClassNames = exports.toggleButtonClassName = exports.renderToggleButton_unstable = exports.ToggleButton = exports.useSplitButton_unstable = exports.useSplitButtonStyles_unstable = exports.splitButtonClassNames = exports.splitButtonClassName = exports.renderSplitButton_unstable = exports.SplitButton = exports.useMenuButton_unstable = exports.useMenuButtonStyles_unstable = exports.renderMenuButton_unstable = exports.menuButtonClassNames = exports.menuButtonClassName = exports.MenuButton = exports.useCompoundButton_unstable = exports.useCompoundButtonStyles_unstable = exports.renderCompoundButton_unstable = exports.compoundButtonClassNames = exports.compoundButtonClassName = exports.CompoundButton = exports.useButton_unstable = exports.useButtonStyles_unstable = exports.renderButton_unstable = exports.buttonClassNames = exports.buttonClassName = exports.Button = void 0;
6
7
 
7
- const tslib_1 = /*#__PURE__*/require("tslib");
8
+ var Button_1 = /*#__PURE__*/require("./Button");
8
9
 
9
- tslib_1.__exportStar(require("./Button"), exports);
10
+ Object.defineProperty(exports, "Button", {
11
+ enumerable: true,
12
+ get: function () {
13
+ return Button_1.Button;
14
+ }
15
+ }); // eslint-disable-next-line deprecation/deprecation
10
16
 
11
- tslib_1.__exportStar(require("./CompoundButton"), exports);
17
+ Object.defineProperty(exports, "buttonClassName", {
18
+ enumerable: true,
19
+ get: function () {
20
+ return Button_1.buttonClassName;
21
+ }
22
+ });
23
+ Object.defineProperty(exports, "buttonClassNames", {
24
+ enumerable: true,
25
+ get: function () {
26
+ return Button_1.buttonClassNames;
27
+ }
28
+ });
29
+ Object.defineProperty(exports, "renderButton_unstable", {
30
+ enumerable: true,
31
+ get: function () {
32
+ return Button_1.renderButton_unstable;
33
+ }
34
+ });
35
+ Object.defineProperty(exports, "useButtonStyles_unstable", {
36
+ enumerable: true,
37
+ get: function () {
38
+ return Button_1.useButtonStyles_unstable;
39
+ }
40
+ });
41
+ Object.defineProperty(exports, "useButton_unstable", {
42
+ enumerable: true,
43
+ get: function () {
44
+ return Button_1.useButton_unstable;
45
+ }
46
+ });
12
47
 
13
- tslib_1.__exportStar(require("./MenuButton"), exports);
48
+ var CompoundButton_1 = /*#__PURE__*/require("./CompoundButton");
14
49
 
15
- tslib_1.__exportStar(require("./SplitButton"), exports);
50
+ Object.defineProperty(exports, "CompoundButton", {
51
+ enumerable: true,
52
+ get: function () {
53
+ return CompoundButton_1.CompoundButton;
54
+ }
55
+ }); // eslint-disable-next-line deprecation/deprecation
56
+
57
+ Object.defineProperty(exports, "compoundButtonClassName", {
58
+ enumerable: true,
59
+ get: function () {
60
+ return CompoundButton_1.compoundButtonClassName;
61
+ }
62
+ });
63
+ Object.defineProperty(exports, "compoundButtonClassNames", {
64
+ enumerable: true,
65
+ get: function () {
66
+ return CompoundButton_1.compoundButtonClassNames;
67
+ }
68
+ });
69
+ Object.defineProperty(exports, "renderCompoundButton_unstable", {
70
+ enumerable: true,
71
+ get: function () {
72
+ return CompoundButton_1.renderCompoundButton_unstable;
73
+ }
74
+ });
75
+ Object.defineProperty(exports, "useCompoundButtonStyles_unstable", {
76
+ enumerable: true,
77
+ get: function () {
78
+ return CompoundButton_1.useCompoundButtonStyles_unstable;
79
+ }
80
+ });
81
+ Object.defineProperty(exports, "useCompoundButton_unstable", {
82
+ enumerable: true,
83
+ get: function () {
84
+ return CompoundButton_1.useCompoundButton_unstable;
85
+ }
86
+ });
87
+
88
+ var MenuButton_1 = /*#__PURE__*/require("./MenuButton");
89
+
90
+ Object.defineProperty(exports, "MenuButton", {
91
+ enumerable: true,
92
+ get: function () {
93
+ return MenuButton_1.MenuButton;
94
+ }
95
+ }); // eslint-disable-next-line deprecation/deprecation
96
+
97
+ Object.defineProperty(exports, "menuButtonClassName", {
98
+ enumerable: true,
99
+ get: function () {
100
+ return MenuButton_1.menuButtonClassName;
101
+ }
102
+ });
103
+ Object.defineProperty(exports, "menuButtonClassNames", {
104
+ enumerable: true,
105
+ get: function () {
106
+ return MenuButton_1.menuButtonClassNames;
107
+ }
108
+ });
109
+ Object.defineProperty(exports, "renderMenuButton_unstable", {
110
+ enumerable: true,
111
+ get: function () {
112
+ return MenuButton_1.renderMenuButton_unstable;
113
+ }
114
+ });
115
+ Object.defineProperty(exports, "useMenuButtonStyles_unstable", {
116
+ enumerable: true,
117
+ get: function () {
118
+ return MenuButton_1.useMenuButtonStyles_unstable;
119
+ }
120
+ });
121
+ Object.defineProperty(exports, "useMenuButton_unstable", {
122
+ enumerable: true,
123
+ get: function () {
124
+ return MenuButton_1.useMenuButton_unstable;
125
+ }
126
+ });
16
127
 
17
- tslib_1.__exportStar(require("./ToggleButton"), exports);
128
+ var SplitButton_1 = /*#__PURE__*/require("./SplitButton");
129
+
130
+ Object.defineProperty(exports, "SplitButton", {
131
+ enumerable: true,
132
+ get: function () {
133
+ return SplitButton_1.SplitButton;
134
+ }
135
+ });
136
+ Object.defineProperty(exports, "renderSplitButton_unstable", {
137
+ enumerable: true,
138
+ get: function () {
139
+ return SplitButton_1.renderSplitButton_unstable;
140
+ }
141
+ }); // eslint-disable-next-line deprecation/deprecation
142
+
143
+ Object.defineProperty(exports, "splitButtonClassName", {
144
+ enumerable: true,
145
+ get: function () {
146
+ return SplitButton_1.splitButtonClassName;
147
+ }
148
+ });
149
+ Object.defineProperty(exports, "splitButtonClassNames", {
150
+ enumerable: true,
151
+ get: function () {
152
+ return SplitButton_1.splitButtonClassNames;
153
+ }
154
+ });
155
+ Object.defineProperty(exports, "useSplitButtonStyles_unstable", {
156
+ enumerable: true,
157
+ get: function () {
158
+ return SplitButton_1.useSplitButtonStyles_unstable;
159
+ }
160
+ });
161
+ Object.defineProperty(exports, "useSplitButton_unstable", {
162
+ enumerable: true,
163
+ get: function () {
164
+ return SplitButton_1.useSplitButton_unstable;
165
+ }
166
+ });
167
+
168
+ var ToggleButton_1 = /*#__PURE__*/require("./ToggleButton");
169
+
170
+ Object.defineProperty(exports, "ToggleButton", {
171
+ enumerable: true,
172
+ get: function () {
173
+ return ToggleButton_1.ToggleButton;
174
+ }
175
+ });
176
+ Object.defineProperty(exports, "renderToggleButton_unstable", {
177
+ enumerable: true,
178
+ get: function () {
179
+ return ToggleButton_1.renderToggleButton_unstable;
180
+ }
181
+ }); // eslint-disable-next-line deprecation/deprecation
182
+
183
+ Object.defineProperty(exports, "toggleButtonClassName", {
184
+ enumerable: true,
185
+ get: function () {
186
+ return ToggleButton_1.toggleButtonClassName;
187
+ }
188
+ });
189
+ Object.defineProperty(exports, "toggleButtonClassNames", {
190
+ enumerable: true,
191
+ get: function () {
192
+ return ToggleButton_1.toggleButtonClassNames;
193
+ }
194
+ });
195
+ Object.defineProperty(exports, "useToggleButtonStyles_unstable", {
196
+ enumerable: true,
197
+ get: function () {
198
+ return ToggleButton_1.useToggleButtonStyles_unstable;
199
+ }
200
+ });
201
+ Object.defineProperty(exports, "useToggleButton_unstable", {
202
+ enumerable: true,
203
+ get: function () {
204
+ return ToggleButton_1.useToggleButton_unstable;
205
+ }
206
+ });
207
+
208
+ var index_1 = /*#__PURE__*/require("./utils/index");
209
+
210
+ Object.defineProperty(exports, "useToggleState", {
211
+ enumerable: true,
212
+ get: function () {
213
+ return index_1.useToggleState;
214
+ }
215
+ });
18
216
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/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","sourceRoot":""}
1
+ {"version":3,"sources":["index.ts"],"names":[],"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AAAtB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gCAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,cAAA,CAAA,8BAAA;AAA8B;AAA9B,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,0BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,cAAA,CAAA,wBAAA;AAAwB;AAAxB,CAAA;;AAIF,IAAA,OAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,cAAA;AAAc;AAAd,CAAA","sourcesContent":["export {\n Button,\n // eslint-disable-next-line deprecation/deprecation\n buttonClassName,\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 // eslint-disable-next-line deprecation/deprecation\n compoundButtonClassName,\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 // eslint-disable-next-line deprecation/deprecation\n menuButtonClassName,\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 // eslint-disable-next-line deprecation/deprecation\n splitButtonClassName,\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 // eslint-disable-next-line deprecation/deprecation\n toggleButtonClassName,\n toggleButtonClassNames,\n useToggleButtonStyles_unstable,\n useToggleButton_unstable,\n} from './ToggleButton';\nexport type { ToggleButtonProps, ToggleButtonState } from './ToggleButton';\n\nexport { useToggleState } from './utils/index';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ const tslib_1 = /*#__PURE__*/require("tslib");
8
+
9
+ tslib_1.__exportStar(require("./useToggleState"), exports);
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["utils/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './useToggleState';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useToggleState = void 0;
7
+
8
+ const React = /*#__PURE__*/require("react");
9
+
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
+
12
+ function useToggleState(props, state) {
13
+ const {
14
+ checked,
15
+ defaultChecked,
16
+ disabled,
17
+ disabledFocusable
18
+ } = props;
19
+ const {
20
+ onClick,
21
+ role
22
+ } = state.root;
23
+ const [checkedValue, setCheckedValue] = react_utilities_1.useControllableState({
24
+ state: checked,
25
+ defaultState: defaultChecked,
26
+ initialState: false
27
+ });
28
+ const isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';
29
+ const onToggleClick = React.useCallback(ev => {
30
+ if (!disabled && !disabledFocusable) {
31
+ if (ev.defaultPrevented) {
32
+ return;
33
+ }
34
+
35
+ setCheckedValue(!checkedValue);
36
+ }
37
+ }, [checkedValue, disabled, disabledFocusable, setCheckedValue]);
38
+ return { ...state,
39
+ checked: checkedValue,
40
+ root: { ...state.root,
41
+ [isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed']: checkedValue,
42
+ onClick: react_utilities_1.useMergedEventCallbacks(onClick, onToggleClick)
43
+ }
44
+ };
45
+ }
46
+
47
+ exports.useToggleState = useToggleState;
48
+ //# sourceMappingURL=useToggleState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["utils/useToggleState.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAIA,SAAgB,cAAhB,CAIE,KAJF,EAI6B,KAJ7B,EAIgD;AAC9C,QAAM;AAAE,IAAA,OAAF;AAAW,IAAA,cAAX;AAA2B,IAAA,QAA3B;AAAqC,IAAA;AAArC,MAA2D,KAAjE;AACA,QAAM;AAAE,IAAA,OAAF;AAAW,IAAA;AAAX,MAAoB,KAAK,CAAC,IAAhC;AAEA,QAAM,CAAC,YAAD,EAAe,eAAf,IAAkC,iBAAA,CAAA,oBAAA,CAAqB;AAC3D,IAAA,KAAK,EAAE,OADoD;AAE3D,IAAA,YAAY,EAAE,cAF6C;AAG3D,IAAA,YAAY,EAAE;AAH6C,GAArB,CAAxC;AAMA,QAAM,kBAAkB,GAAG,IAAI,KAAK,kBAAT,IAA+B,IAAI,KAAK,UAAnE;AAEA,QAAM,aAAa,GAAG,KAAK,CAAC,WAAN,CACpB,EAAE,IAAG;AACH,QAAI,CAAC,QAAD,IAAa,CAAC,iBAAlB,EAAqC;AACnC,UAAI,EAAE,CAAC,gBAAP,EAAyB;AACvB;AACD;;AAED,MAAA,eAAe,CAAC,CAAC,YAAF,CAAf;AACD;AACF,GATmB,EAUpB,CAAC,YAAD,EAAe,QAAf,EAAyB,iBAAzB,EAA4C,eAA5C,CAVoB,CAAtB;AAaA,SAAO,EACL,GAAG,KADE;AAGL,IAAA,OAAO,EAAE,YAHJ;AAKL,IAAA,IAAI,EAAE,EACJ,GAAG,KAAK,CAAC,IADL;AAEJ,OAAC,kBAAkB,GAAG,cAAH,GAAoB,cAAvC,GAAwD,YAFpD;AAGJ,MAAA,OAAO,EAAE,iBAAA,CAAA,uBAAA,CACP,OADO,EAEP,aAFO;AAHL;AALD,GAAP;AAcD;;AA3CD,OAAA,CAAA,cAAA,GAAA,cAAA","sourcesContent":["import * as React from 'react';\nimport { useControllableState, useMergedEventCallbacks } 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 => {\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: useMergedEventCallbacks(\n onClick as React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>,\n onToggleClick,\n ),\n },\n } as TToggleButtonState;\n}\n"],"sourceRoot":"../src/"}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@fluentui/react-button",
3
- "version": "9.0.0-rc.1",
3
+ "version": "9.0.0-rc.10",
4
4
  "description": "Fluent UI React Button component.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
7
- "typings": "lib/index.d.ts",
7
+ "typings": "dist/index.d.ts",
8
8
  "sideEffects": false,
9
9
  "repository": {
10
10
  "type": "git",
@@ -21,34 +21,25 @@
21
21
  "start": "yarn storybook",
22
22
  "test": "jest --passWithNoTests",
23
23
  "docs": "api-extractor run --config=config/api-extractor.local.json --local",
24
- "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-button/src && yarn docs",
25
- "storybook": "node ../../scripts/storybook/runner",
24
+ "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/packages/react-components/react-button/src && yarn docs",
25
+ "storybook": "node ../../../scripts/storybook/runner",
26
26
  "type-check": "tsc -b tsconfig.json"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@fluentui/a11y-testing": "^0.1.0",
30
30
  "@fluentui/eslint-plugin": "*",
31
31
  "@fluentui/react-conformance": "*",
32
- "@fluentui/react-conformance-griffel": "9.0.0-beta.1",
33
- "@fluentui/scripts": "^1.0.0",
34
- "@types/enzyme": "3.10.3",
35
- "@types/enzyme-adapter-react-16": "1.0.3",
36
- "@types/react": "16.9.42",
37
- "@types/react-dom": "16.9.10",
38
- "@types/react-test-renderer": "^16.0.0",
39
- "enzyme": "~3.10.0",
40
- "enzyme-adapter-react-16": "^1.15.0",
41
- "react": "16.8.6",
42
- "react-dom": "16.8.6",
43
- "react-test-renderer": "^16.3.0"
32
+ "@fluentui/react-conformance-griffel": "9.0.0-beta.6",
33
+ "@fluentui/scripts": "^1.0.0"
44
34
  },
45
35
  "dependencies": {
46
- "@fluentui/keyboard-keys": "9.0.0-rc.1",
47
- "@fluentui/react-aria": "9.0.0-rc.1",
48
- "@fluentui/react-icons": "^2.0.159-beta.10",
49
- "@fluentui/react-tabster": "9.0.0-rc.1",
50
- "@fluentui/react-utilities": "9.0.0-rc.1",
51
- "@griffel/react": "1.0.0",
36
+ "@fluentui/keyboard-keys": "9.0.0-rc.6",
37
+ "@fluentui/react-aria": "9.0.0-rc.9",
38
+ "@fluentui/react-icons": "^2.0.166-rc.3",
39
+ "@fluentui/react-tabster": "9.0.0-rc.10",
40
+ "@fluentui/react-theme": "9.0.0-rc.8",
41
+ "@fluentui/react-utilities": "9.0.0-rc.9",
42
+ "@griffel/react": "1.0.5",
52
43
  "tslib": "^2.1.0"
53
44
  },
54
45
  "peerDependencies": {
@@ -63,5 +54,12 @@
63
54
  "minor",
64
55
  "patch"
65
56
  ]
57
+ },
58
+ "exports": {
59
+ ".": {
60
+ "types": "./lib/index.d.ts",
61
+ "import": "./lib/index.js",
62
+ "require": "./lib-commonjs/index.js"
63
+ }
66
64
  }
67
65
  }
@@ -1,71 +0,0 @@
1
- <!DOCTYPE html>
2
- <html dir="ltr" lang="en-us">
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" user-scalable="no" />
7
- <title>Fluent UI React Examples</title>
8
- </head>
9
-
10
- <body>
11
- <div id="content"></div>
12
- <script type="text/javascript">
13
- // @ts-check
14
- window.FabricConfig = {
15
- // Uncommenting this prevents the fontfaces from being registered.
16
- // Alternatively you can specify a base url which contains the font/icon assets.
17
- // fontBaseUrl: '',
18
- // mergeStyles: {
19
- // injectionMode: 2
20
- // }
21
- };
22
-
23
- var isLocal = ['localhost', '[::]', '127.0.0.1'].indexOf(location.hostname) !== -1;
24
-
25
- var isDev = getParameterByName('dev') === '1' || !!getParameterByName('strict');
26
- var minParam = getParameterByName('min');
27
- var useMinified =
28
- !isDev && minParam !== '0' && (minParam === '1' || location.pathname === '/fabric-react/master/');
29
-
30
- function loadScript(n) {
31
- for (var i = 0; i < n.length; i++) {
32
- var s = document.createElement('script');
33
- s.src = n[i];
34
- s.async = false;
35
- document.body.appendChild(s);
36
- }
37
- }
38
-
39
- const scripts = [];
40
-
41
- if (isLocal) {
42
- scripts.push('./react.development.js');
43
- scripts.push('./react-dom.development.js');
44
- } else {
45
- const reactVersion = isDev ? 'development.js' : 'production.min.js';
46
- scripts.push('//cdnjs.cloudflare.com/ajax/libs/react/16.8.6/umd/react.' + reactVersion);
47
- scripts.push('//cdnjs.cloudflare.com/ajax/libs/react-dom/16.8.6/umd/react-dom.' + reactVersion);
48
- }
49
-
50
- if (useMinified) {
51
- scripts.push('demo-app.min.js');
52
- } else {
53
- scripts.push('demo-app.js');
54
- }
55
-
56
- loadScript(scripts);
57
-
58
- function getParameterByName(name, url) {
59
- if (!url) {
60
- url = location.href;
61
- }
62
- name = name.replace(/[\[\]]/g, '\\$&');
63
- var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
64
- results = regex.exec(url);
65
- if (!results) return null;
66
- if (!results[2]) return '';
67
- return decodeURIComponent(results[2].replace(/\+/g, ' '));
68
- }
69
- </script>
70
- </body>
71
- </html>