@fluentui/react-button 9.75.1-experimental.positioning-engine.20261103-19efe125d1.0 → 9.75.2-experimental.css-modules.20261113-ba13c87438.0

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 (53) hide show
  1. package/CHANGELOG.md +12 -12
  2. package/README.md +24 -2
  3. package/lib/components/Button/Button.module.css +400 -0
  4. package/lib/components/Button/useButtonStyles.styles.css.js +14 -0
  5. package/lib/components/Button/useButtonStyles.styles.css.js.map +1 -0
  6. package/lib/components/Button/useButtonStyles.styles.raw.css.js +14 -0
  7. package/lib/components/Button/useButtonStyles.styles.raw.css.js.map +1 -0
  8. package/lib/components/CompoundButton/CompoundButton.module.css +137 -0
  9. package/lib/components/CompoundButton/useCompoundButtonStyles.styles.css.js +27 -0
  10. package/lib/components/CompoundButton/useCompoundButtonStyles.styles.css.js.map +1 -0
  11. package/lib/components/CompoundButton/useCompoundButtonStyles.styles.raw.css.js +27 -0
  12. package/lib/components/CompoundButton/useCompoundButtonStyles.styles.raw.css.js.map +1 -0
  13. package/lib/components/MenuButton/MenuButton.module.css +72 -0
  14. package/lib/components/MenuButton/useMenuButtonStyles.styles.css.js +26 -0
  15. package/lib/components/MenuButton/useMenuButtonStyles.styles.css.js.map +1 -0
  16. package/lib/components/MenuButton/useMenuButtonStyles.styles.raw.css.js +26 -0
  17. package/lib/components/MenuButton/useMenuButtonStyles.styles.raw.css.js.map +1 -0
  18. package/lib/components/SplitButton/SplitButton.module.css +70 -0
  19. package/lib/components/SplitButton/useSplitButtonStyles.styles.css.js +17 -0
  20. package/lib/components/SplitButton/useSplitButtonStyles.styles.css.js.map +1 -0
  21. package/lib/components/SplitButton/useSplitButtonStyles.styles.raw.css.js +17 -0
  22. package/lib/components/SplitButton/useSplitButtonStyles.styles.raw.css.js.map +1 -0
  23. package/lib/components/ToggleButton/ToggleButton.module.css +242 -0
  24. package/lib/components/ToggleButton/useToggleButtonStyles.styles.css.js +18 -0
  25. package/lib/components/ToggleButton/useToggleButtonStyles.styles.css.js.map +1 -0
  26. package/lib/components/ToggleButton/useToggleButtonStyles.styles.raw.css.js +18 -0
  27. package/lib/components/ToggleButton/useToggleButtonStyles.styles.raw.css.js.map +1 -0
  28. package/lib-commonjs/components/Button/Button.module.css +400 -0
  29. package/lib-commonjs/components/Button/useButtonStyles.styles.css.cjs +33 -0
  30. package/lib-commonjs/components/Button/useButtonStyles.styles.css.cjs.map +1 -0
  31. package/lib-commonjs/components/Button/useButtonStyles.styles.raw.css.cjs +33 -0
  32. package/lib-commonjs/components/Button/useButtonStyles.styles.raw.css.cjs.map +1 -0
  33. package/lib-commonjs/components/CompoundButton/CompoundButton.module.css +137 -0
  34. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.css.cjs +46 -0
  35. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.css.cjs.map +1 -0
  36. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.raw.css.cjs +46 -0
  37. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.raw.css.cjs.map +1 -0
  38. package/lib-commonjs/components/MenuButton/MenuButton.module.css +72 -0
  39. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.css.cjs +45 -0
  40. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.css.cjs.map +1 -0
  41. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.raw.css.cjs +45 -0
  42. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.raw.css.cjs.map +1 -0
  43. package/lib-commonjs/components/SplitButton/SplitButton.module.css +70 -0
  44. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.css.cjs +36 -0
  45. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.css.cjs.map +1 -0
  46. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.raw.css.cjs +36 -0
  47. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.raw.css.cjs.map +1 -0
  48. package/lib-commonjs/components/ToggleButton/ToggleButton.module.css +242 -0
  49. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.css.cjs +37 -0
  50. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.css.cjs.map +1 -0
  51. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.raw.css.cjs +37 -0
  52. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.raw.css.cjs.map +1 -0
  53. package/package.json +13 -10
@@ -0,0 +1,400 @@
1
+ /* @griffel-buckets reset: .root, .icon; defaults: .secondary, .medium, .rounded */
2
+ .root {
3
+ align-items: center;
4
+ box-sizing: border-box;
5
+ display: inline-flex;
6
+ justify-content: center;
7
+ text-decoration-line: none;
8
+ vertical-align: middle;
9
+ margin: 0;
10
+ overflow: hidden;
11
+ background-color: var(--colorNeutralBackground1);
12
+ color: var(--colorNeutralForeground1);
13
+ border: var(--strokeWidthThin) solid var(--colorNeutralStroke1);
14
+ font-family: var(--fontFamilyBase);
15
+ outline-style: none;
16
+ transition-duration: var(--durationFaster);
17
+ transition-property: background, border, color;
18
+ transition-timing-function: var(--curveEasyEase);
19
+ }
20
+
21
+ .root:hover {
22
+ background-color: var(--colorNeutralBackground1Hover);
23
+ border-color: var(--colorNeutralStroke1Hover);
24
+ color: var(--colorNeutralForeground1Hover);
25
+ cursor: pointer;
26
+ }
27
+
28
+ .root:hover:active,
29
+ .root:active:focus-visible {
30
+ background-color: var(--colorNeutralBackground1Pressed);
31
+ border-color: var(--colorNeutralStroke1Pressed);
32
+ color: var(--colorNeutralForeground1Pressed);
33
+ outline-style: none;
34
+ }
35
+
36
+ @media screen and (prefers-reduced-motion: reduce) {
37
+ .root {
38
+ transition-duration: 0.01ms;
39
+ }
40
+ }
41
+
42
+ .root[data-fui-focus-visible] {
43
+ border-color: var(--colorStrokeFocus2);
44
+ border-radius: var(--borderRadiusMedium);
45
+ border-width: var(--strokeWidthThin);
46
+ outline: var(--strokeWidthThick) solid var(--colorTransparentStroke);
47
+ box-shadow: 0 0 0 var(--strokeWidthThin) var(--colorStrokeFocus2) inset;
48
+ z-index: 1;
49
+ }
50
+
51
+ .secondary {
52
+ background-color: var(--colorNeutralBackground1);
53
+ }
54
+
55
+ .outline {
56
+ background-color: var(--colorTransparentBackground);
57
+ }
58
+
59
+ .outline:hover {
60
+ background-color: var(--colorTransparentBackgroundHover);
61
+ }
62
+
63
+ .outline:hover:active,
64
+ .outline:active:focus-visible {
65
+ background-color: var(--colorTransparentBackgroundPressed);
66
+ }
67
+
68
+ .primary {
69
+ background-color: var(--colorBrandBackground);
70
+ border-color: transparent;
71
+ color: var(--colorNeutralForegroundOnBrand);
72
+ }
73
+
74
+ .primary:hover {
75
+ background-color: var(--colorBrandBackgroundHover);
76
+ border-color: transparent;
77
+ color: var(--colorNeutralForegroundOnBrand);
78
+ }
79
+
80
+ .primary:hover:active,
81
+ .primary:active:focus-visible {
82
+ background-color: var(--colorBrandBackgroundPressed);
83
+ border-color: transparent;
84
+ color: var(--colorNeutralForegroundOnBrand);
85
+ }
86
+
87
+ .subtle {
88
+ background-color: var(--colorSubtleBackground);
89
+ border-color: transparent;
90
+ color: var(--colorNeutralForeground2);
91
+ }
92
+
93
+ .subtle:hover {
94
+ background-color: var(--colorSubtleBackgroundHover);
95
+ border-color: transparent;
96
+ color: var(--colorNeutralForeground2Hover);
97
+ }
98
+
99
+ .subtle:hover:active,
100
+ .subtle:active:focus-visible {
101
+ background-color: var(--colorSubtleBackgroundPressed);
102
+ border-color: transparent;
103
+ color: var(--colorNeutralForeground2Pressed);
104
+ }
105
+
106
+ .subtle:hover :global(.fui-Button__icon) {
107
+ color: var(--colorNeutralForeground2BrandHover);
108
+ }
109
+
110
+ .subtle:hover:active :global(.fui-Button__icon),
111
+ .subtle:active:focus-visible :global(.fui-Button__icon) {
112
+ color: var(--colorNeutralForeground2BrandPressed);
113
+ }
114
+
115
+ .transparent {
116
+ background-color: var(--colorTransparentBackground);
117
+ border-color: transparent;
118
+ color: var(--colorNeutralForeground2);
119
+ }
120
+
121
+ .transparent:hover {
122
+ background-color: var(--colorTransparentBackgroundHover);
123
+ border-color: transparent;
124
+ color: var(--colorNeutralForeground2BrandHover);
125
+ }
126
+
127
+ .transparent:hover:active,
128
+ .transparent:active:focus-visible {
129
+ background-color: var(--colorTransparentBackgroundPressed);
130
+ border-color: transparent;
131
+ color: var(--colorNeutralForeground2BrandPressed);
132
+ }
133
+
134
+ .subtle:hover :global(.fui-Icon-filled),
135
+ .subtle:hover:active :global(.fui-Icon-filled),
136
+ .subtle:active:focus-visible :global(.fui-Icon-filled),
137
+ .transparent:hover :global(.fui-Icon-filled),
138
+ .transparent:hover:active :global(.fui-Icon-filled),
139
+ .transparent:active:focus-visible :global(.fui-Icon-filled) {
140
+ display: inline;
141
+ }
142
+
143
+ .subtle:hover :global(.fui-Icon-regular),
144
+ .subtle:hover:active :global(.fui-Icon-regular),
145
+ .subtle:active:focus-visible :global(.fui-Icon-regular),
146
+ .transparent:hover :global(.fui-Icon-regular),
147
+ .transparent:hover:active :global(.fui-Icon-regular),
148
+ .transparent:active:focus-visible :global(.fui-Icon-regular) {
149
+ display: none;
150
+ }
151
+
152
+ .small {
153
+ min-width: calc(var(--spacingHorizontalXXXL) * 2);
154
+ padding: calc(var(--spacingVerticalXS) - var(--strokeWidthThin)) var(--spacingHorizontalS);
155
+ font-size: var(--fontSizeBase200);
156
+ font-weight: var(--fontWeightRegular);
157
+ line-height: var(--lineHeightBase200);
158
+
159
+ &:where(.withIcon) {
160
+ padding-top: var(--strokeWidthThin);
161
+ padding-bottom: var(--strokeWidthThin);
162
+ }
163
+ }
164
+
165
+ .medium {
166
+ padding: calc(var(--spacingVerticalSNudge) - var(--strokeWidthThin)) var(--spacingHorizontalM);
167
+ min-width: calc(var(--spacingHorizontalXXXL) * 3);
168
+ font-size: var(--fontSizeBase300);
169
+ font-weight: var(--fontWeightSemibold);
170
+ line-height: var(--lineHeightBase300);
171
+ }
172
+
173
+ .large {
174
+ min-width: calc(var(--spacingHorizontalXXXL) * 3);
175
+ padding: var(--spacingVerticalS) var(--spacingHorizontalL);
176
+ font-size: var(--fontSizeBase400);
177
+ font-weight: var(--fontWeightSemibold);
178
+ line-height: var(--lineHeightBase400);
179
+
180
+ &:where(.withIcon) {
181
+ padding-top: calc(var(--spacingVerticalS) - var(--strokeWidthThin));
182
+ padding-bottom: calc(var(--spacingVerticalS) - var(--strokeWidthThin));
183
+ }
184
+ }
185
+
186
+ .rounded {
187
+ border-radius: var(--borderRadiusMedium);
188
+ }
189
+
190
+ .circular {
191
+ border-radius: var(--borderRadiusCircular);
192
+ }
193
+
194
+ .square {
195
+ border-radius: var(--borderRadiusNone);
196
+ }
197
+
198
+ .disabled,
199
+ .disabled:hover,
200
+ .disabled:hover:active,
201
+ .disabled:active:focus-visible {
202
+ background-color: var(--colorNeutralBackgroundDisabled);
203
+ border-color: var(--colorNeutralStrokeDisabled);
204
+ color: var(--colorNeutralForegroundDisabled);
205
+ cursor: not-allowed;
206
+ }
207
+
208
+ .disabled :global(.fui-Button__icon),
209
+ .disabled:hover :global(.fui-Button__icon),
210
+ .disabled:hover:active :global(.fui-Button__icon),
211
+ .disabled:active:focus-visible :global(.fui-Button__icon) {
212
+ color: var(--colorNeutralForegroundDisabled);
213
+ }
214
+
215
+ .disabled:hover :global(.fui-Icon-filled),
216
+ .disabled:hover:active :global(.fui-Icon-filled),
217
+ .disabled:active:focus-visible :global(.fui-Icon-filled) {
218
+ display: none;
219
+ }
220
+
221
+ .disabled:hover :global(.fui-Icon-regular),
222
+ .disabled:hover:active :global(.fui-Icon-regular),
223
+ .disabled:active:focus-visible :global(.fui-Icon-regular) {
224
+ display: inline;
225
+ }
226
+
227
+ .disabled {
228
+ &:where(.outline, .subtle, .transparent) {
229
+ &,
230
+ &:hover,
231
+ &:hover:active,
232
+ &:active:focus-visible {
233
+ background-color: var(--colorTransparentBackground);
234
+ }
235
+ }
236
+
237
+ &:where(.primary, .subtle, .transparent) {
238
+ &,
239
+ &:hover,
240
+ &:hover:active,
241
+ &:active:focus-visible {
242
+ border-color: transparent;
243
+ }
244
+ }
245
+ }
246
+
247
+ .primary[data-fui-focus-visible] {
248
+ border-color: var(--colorStrokeFocus2);
249
+ box-shadow: var(--shadow2), 0 0 0 var(--strokeWidthThin) var(--colorStrokeFocus2) inset,
250
+ 0 0 0 var(--strokeWidthThick) var(--colorNeutralForegroundOnBrand) inset;
251
+ }
252
+
253
+ .primary[data-fui-focus-visible]:hover {
254
+ border-color: var(--colorStrokeFocus2);
255
+ box-shadow: var(--shadow2), 0 0 0 var(--strokeWidthThin) var(--colorStrokeFocus2) inset;
256
+ }
257
+
258
+ /* Firefox needs an extra quarter of the default thin stroke at some zoom levels. */
259
+ @supports (-moz-appearance: button) {
260
+ .root[data-fui-focus-visible] {
261
+ box-shadow: 0 0 0 calc(var(--strokeWidthThin) * 1.25) var(--colorStrokeFocus2) inset;
262
+ }
263
+
264
+ .primary[data-fui-focus-visible] {
265
+ box-shadow: var(--shadow2), 0 0 0 calc(var(--strokeWidthThin) * 1.25) var(--colorStrokeFocus2) inset,
266
+ 0 0 0 var(--strokeWidthThick) var(--colorNeutralForegroundOnBrand) inset;
267
+ }
268
+
269
+ .primary[data-fui-focus-visible]:hover {
270
+ box-shadow: var(--shadow2), 0 0 0 calc(var(--strokeWidthThin) * 1.25) var(--colorStrokeFocus2) inset;
271
+ }
272
+ }
273
+
274
+ .small[data-fui-focus-visible] {
275
+ border-radius: var(--borderRadiusSmall);
276
+ }
277
+
278
+ .large[data-fui-focus-visible] {
279
+ border-radius: var(--borderRadiusLarge);
280
+ }
281
+
282
+ .circular[data-fui-focus-visible] {
283
+ border-radius: var(--borderRadiusCircular);
284
+ }
285
+
286
+ .square[data-fui-focus-visible] {
287
+ border-radius: var(--borderRadiusNone);
288
+ }
289
+
290
+ .iconOnly {
291
+ padding: calc(var(--spacingVerticalSNudge) - var(--strokeWidthThin));
292
+ min-width: var(--spacingHorizontalXXXL);
293
+ max-width: var(--spacingHorizontalXXXL);
294
+
295
+ &:where(.small) {
296
+ padding: var(--strokeWidthThin);
297
+ min-width: var(--spacingHorizontalXXL);
298
+ max-width: var(--spacingHorizontalXXL);
299
+ }
300
+
301
+ &:where(.large) {
302
+ padding: calc(var(--spacingVerticalS) - var(--strokeWidthThin));
303
+ min-width: calc(var(--spacingHorizontalXL) * 2);
304
+ max-width: calc(var(--spacingHorizontalXL) * 2);
305
+ }
306
+ }
307
+
308
+ .icon {
309
+ align-items: center;
310
+ display: inline-flex;
311
+ justify-content: center;
312
+ font-size: var(--fontSizeBase500);
313
+ height: var(--fontSizeBase500);
314
+ width: var(--fontSizeBase500);
315
+ --fui-Button__icon--spacing: var(--spacingHorizontalSNudge);
316
+ }
317
+
318
+ :where(.small) .icon {
319
+ --fui-Button__icon--spacing: var(--spacingHorizontalXS);
320
+ }
321
+
322
+ :where(.large) .icon {
323
+ font-size: var(--fontSizeBase600);
324
+ height: var(--fontSizeBase600);
325
+ width: var(--fontSizeBase600);
326
+ }
327
+
328
+ .before {
329
+ margin-inline-end: var(--fui-Button__icon--spacing);
330
+ }
331
+
332
+ .after {
333
+ margin-inline-start: var(--fui-Button__icon--spacing);
334
+ }
335
+
336
+ @media (forced-colors: active) {
337
+ .root:focus {
338
+ border-color: ButtonText;
339
+ }
340
+
341
+ .root:hover,
342
+ .root:hover:active,
343
+ .root:active:focus-visible {
344
+ background-color: HighlightText;
345
+ border-color: Highlight;
346
+ color: Highlight;
347
+ forced-color-adjust: none;
348
+ }
349
+
350
+ .primary {
351
+ background-color: Highlight;
352
+ border-color: HighlightText;
353
+ color: HighlightText;
354
+ forced-color-adjust: none;
355
+ }
356
+
357
+ .primary:hover,
358
+ .primary:hover:active,
359
+ .primary:active:focus-visible {
360
+ background-color: HighlightText;
361
+ border-color: Highlight;
362
+ color: Highlight;
363
+ }
364
+
365
+ .subtle:hover,
366
+ .subtle:hover:active,
367
+ .subtle:active:focus-visible,
368
+ .subtle:hover :global(.fui-Button__icon),
369
+ .subtle:hover:active :global(.fui-Button__icon),
370
+ .subtle:active:focus-visible :global(.fui-Button__icon) {
371
+ color: Highlight;
372
+ }
373
+
374
+ .transparent:hover,
375
+ .transparent:hover:active,
376
+ .transparent:active:focus-visible {
377
+ background-color: var(--colorTransparentBackground);
378
+ color: Highlight;
379
+ }
380
+
381
+ .disabled,
382
+ .disabled:hover,
383
+ .disabled:hover:active,
384
+ .disabled:active:focus-visible {
385
+ background-color: ButtonFace;
386
+ border-color: GrayText;
387
+ color: GrayText;
388
+ }
389
+
390
+ .disabled:focus {
391
+ border-color: GrayText;
392
+ }
393
+
394
+ .disabled :global(.fui-Button__icon),
395
+ .disabled:hover :global(.fui-Button__icon),
396
+ .disabled:hover:active :global(.fui-Button__icon),
397
+ .disabled:active:focus-visible :global(.fui-Button__icon) {
398
+ color: GrayText;
399
+ }
400
+ }
@@ -0,0 +1,33 @@
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: Object.getOwnPropertyDescriptor(all, name).get
9
+ });
10
+ }
11
+ _export(exports, {
12
+ get buttonClassNames () {
13
+ return buttonClassNames;
14
+ },
15
+ get useButtonStyles_unstable () {
16
+ return useButtonStyles_unstable;
17
+ }
18
+ });
19
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
20
+ const _clsx = require("clsx");
21
+ const _Buttonmodulecss = /*#__PURE__*/ _interop_require_default._(require("./Button.module.css"));
22
+ const buttonClassNames = {
23
+ root: 'fui-Button',
24
+ icon: 'fui-Button__icon'
25
+ };
26
+ const useButtonStyles_unstable = (state)=>{
27
+ const { appearance, disabled, disabledFocusable, icon, iconOnly, iconPosition, shape, size } = state;
28
+ state.root.className = (0, _clsx.clsx)(buttonClassNames.root, _Buttonmodulecss.default.root, _Buttonmodulecss.default[appearance], _Buttonmodulecss.default[size], _Buttonmodulecss.default[shape], icon && _Buttonmodulecss.default.withIcon, (disabled || disabledFocusable) && _Buttonmodulecss.default.disabled, iconOnly && _Buttonmodulecss.default.iconOnly, state.root.className);
29
+ if (state.icon) {
30
+ state.icon.className = (0, _clsx.clsx)(buttonClassNames.icon, _Buttonmodulecss.default.icon, !!state.root.children && _Buttonmodulecss.default[iconPosition], state.icon.className);
31
+ }
32
+ return state;
33
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Button/useButtonStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport styles from './Button.module.css';\nimport type { ButtonSlots, ButtonState } from './Button.types';\n\nexport const buttonClassNames: SlotClassNames<ButtonSlots> = {\n root: 'fui-Button',\n icon: 'fui-Button__icon',\n};\n\nexport const useButtonStyles_unstable = (state: ButtonState): ButtonState => {\n const { appearance, disabled, disabledFocusable, icon, iconOnly, iconPosition, shape, size } = state;\n\n state.root.className = clsx(\n buttonClassNames.root,\n styles.root,\n styles[appearance],\n styles[size],\n styles[shape],\n icon && styles.withIcon,\n (disabled || disabledFocusable) && styles.disabled,\n iconOnly && styles.iconOnly,\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = clsx(\n buttonClassNames.icon,\n styles.icon,\n !!state.root.children && styles[iconPosition],\n state.icon.className,\n );\n }\n\n return state;\n};\n"],"names":["clsx","styles","buttonClassNames","root","icon","useButtonStyles_unstable","state","appearance","disabled","disabledFocusable","iconOnly","iconPosition","shape","size","className","withIcon","children"],"mappings":";;;;;;;;;;;QAKaE;;;QAKAG;;;;;sBAVQ,OAAO;0EAET,sBAAsB;AAGlC,yBAAsD;IAC3DF,MAAM;IACNC,MAAM;AACR,EAAE;AAEK,iCAAiC,CAACE;IACvC,MAAM,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,iBAAiB,EAAEL,IAAI,EAAEM,QAAQ,EAAEC,YAAY,EAAEC,KAAK,EAAEC,IAAI,EAAE,GAAGP;IAE/FA,MAAMH,IAAI,CAACW,SAAS,OAAGd,UAAAA,EACrBE,iBAAiBC,IAAI,EACrBF,wBAAAA,CAAOE,IAAI,EACXF,wBAAM,CAACM,WAAW,EAClBN,wBAAM,CAACY,KAAK,EACZZ,wBAAM,CAACW,MAAM,EACbR,QAAQH,wBAAAA,CAAOc,QAAQ,EACtBP,aAAYC,iBAAAA,CAAgB,IAAMR,wBAAAA,CAAOO,QAAQ,EAClDE,YAAYT,wBAAAA,CAAOS,QAAQ,EAC3BJ,MAAMH,IAAI,CAACW,SAAS;IAGtB,IAAIR,MAAMF,IAAI,EAAE;QACdE,MAAMF,IAAI,CAACU,SAAS,GAAGd,cAAAA,EACrBE,iBAAiBE,IAAI,EACrBH,wBAAAA,CAAOG,IAAI,EACX,CAAC,CAACE,MAAMH,IAAI,CAACa,QAAQ,IAAIf,wBAAM,CAACU,aAAa,EAC7CL,MAAMF,IAAI,CAACU,SAAS;IAExB;IAEA,OAAOR;AACT,EAAE"}
@@ -0,0 +1,33 @@
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: Object.getOwnPropertyDescriptor(all, name).get
9
+ });
10
+ }
11
+ _export(exports, {
12
+ get buttonClassNames () {
13
+ return buttonClassNames;
14
+ },
15
+ get useButtonStyles_unstable () {
16
+ return useButtonStyles_unstable;
17
+ }
18
+ });
19
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
20
+ const _clsx = require("clsx");
21
+ const _Buttonmodulecss = /*#__PURE__*/ _interop_require_default._(require("./Button.module.css"));
22
+ const buttonClassNames = {
23
+ root: 'fui-Button',
24
+ icon: 'fui-Button__icon'
25
+ };
26
+ const useButtonStyles_unstable = (state)=>{
27
+ const { appearance, disabled, disabledFocusable, icon, iconOnly, iconPosition, shape, size } = state;
28
+ state.root.className = (0, _clsx.clsx)(buttonClassNames.root, _Buttonmodulecss.default.root, _Buttonmodulecss.default[appearance], _Buttonmodulecss.default[size], _Buttonmodulecss.default[shape], icon && _Buttonmodulecss.default.withIcon, (disabled || disabledFocusable) && _Buttonmodulecss.default.disabled, iconOnly && _Buttonmodulecss.default.iconOnly, state.root.className);
29
+ if (state.icon) {
30
+ state.icon.className = (0, _clsx.clsx)(buttonClassNames.icon, _Buttonmodulecss.default.icon, !!state.root.children && _Buttonmodulecss.default[iconPosition], state.icon.className);
31
+ }
32
+ return state;
33
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Button/useButtonStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport styles from './Button.module.css';\nimport type { ButtonSlots, ButtonState } from './Button.types';\n\nexport const buttonClassNames: SlotClassNames<ButtonSlots> = {\n root: 'fui-Button',\n icon: 'fui-Button__icon',\n};\n\nexport const useButtonStyles_unstable = (state: ButtonState): ButtonState => {\n const { appearance, disabled, disabledFocusable, icon, iconOnly, iconPosition, shape, size } = state;\n\n state.root.className = clsx(\n buttonClassNames.root,\n styles.root,\n styles[appearance],\n styles[size],\n styles[shape],\n icon && styles.withIcon,\n (disabled || disabledFocusable) && styles.disabled,\n iconOnly && styles.iconOnly,\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = clsx(\n buttonClassNames.icon,\n styles.icon,\n !!state.root.children && styles[iconPosition],\n state.icon.className,\n );\n }\n\n return state;\n};\n"],"names":["clsx","styles","buttonClassNames","root","icon","useButtonStyles_unstable","state","appearance","disabled","disabledFocusable","iconOnly","iconPosition","shape","size","className","withIcon","children"],"mappings":";;;;;;;;;;;QAKaE;;;QAKAG;;;;;sBAVQ,OAAO;0EAET,sBAAsB;AAGlC,yBAAsD;IAC3DF,MAAM;IACNC,MAAM;AACR,EAAE;AAEK,iCAAiC,CAACE;IACvC,MAAM,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,iBAAiB,EAAEL,IAAI,EAAEM,QAAQ,EAAEC,YAAY,EAAEC,KAAK,EAAEC,IAAI,EAAE,GAAGP;IAE/FA,MAAMH,IAAI,CAACW,SAAS,OAAGd,UAAAA,EACrBE,iBAAiBC,IAAI,EACrBF,wBAAAA,CAAOE,IAAI,EACXF,wBAAM,CAACM,WAAW,EAClBN,wBAAM,CAACY,KAAK,EACZZ,wBAAM,CAACW,MAAM,EACbR,QAAQH,wBAAAA,CAAOc,QAAQ,EACtBP,aAAYC,iBAAAA,CAAgB,IAAMR,wBAAAA,CAAOO,QAAQ,EAClDE,YAAYT,wBAAAA,CAAOS,QAAQ,EAC3BJ,MAAMH,IAAI,CAACW,SAAS;IAGtB,IAAIR,MAAMF,IAAI,EAAE;QACdE,MAAMF,IAAI,CAACU,SAAS,GAAGd,cAAAA,EACrBE,iBAAiBE,IAAI,EACrBH,wBAAAA,CAAOG,IAAI,EACX,CAAC,CAACE,MAAMH,IAAI,CAACa,QAAQ,IAAIf,wBAAM,CAACU,aAAa,EAC7CL,MAAMF,IAAI,CAACU,SAAS;IAExB;IAEA,OAAOR;AACT,EAAE"}
@@ -0,0 +1,137 @@
1
+ .root {
2
+ height: auto;
3
+ }
4
+
5
+ .icon {
6
+ font-size: calc(var(--fontSizeBase500) * 2);
7
+ height: calc(var(--fontSizeBase500) * 2);
8
+ width: calc(var(--fontSizeBase500) * 2);
9
+ }
10
+
11
+ .root:where(.outline, .secondary, .subtle, .transparent) :global(.fui-CompoundButton__secondaryContent) {
12
+ color: var(--colorNeutralForeground2);
13
+ }
14
+
15
+ .root:hover :global(.fui-CompoundButton__secondaryContent) {
16
+ color: var(--colorNeutralForeground2Hover);
17
+ }
18
+
19
+ .root:hover:active :global(.fui-CompoundButton__secondaryContent),
20
+ .root:active:focus-visible :global(.fui-CompoundButton__secondaryContent) {
21
+ color: var(--colorNeutralForeground2Pressed);
22
+ }
23
+
24
+ .primary :global(.fui-CompoundButton__secondaryContent),
25
+ .primary:hover :global(.fui-CompoundButton__secondaryContent),
26
+ .primary:hover:active :global(.fui-CompoundButton__secondaryContent),
27
+ .primary:active:focus-visible :global(.fui-CompoundButton__secondaryContent) {
28
+ color: var(--colorNeutralForegroundOnBrand);
29
+ }
30
+
31
+ .transparent:hover :global(.fui-CompoundButton__secondaryContent) {
32
+ color: var(--colorNeutralForeground2BrandHover);
33
+ }
34
+
35
+ .transparent:hover:active :global(.fui-CompoundButton__secondaryContent),
36
+ .transparent:active:focus-visible :global(.fui-CompoundButton__secondaryContent) {
37
+ color: var(--colorNeutralForeground2BrandPressed);
38
+ }
39
+
40
+ .small {
41
+ padding: var(--spacingVerticalS) var(--spacingHorizontalS) var(--spacingVerticalMNudge);
42
+ font-size: var(--fontSizeBase300);
43
+ line-height: var(--lineHeightBase300);
44
+ }
45
+
46
+ .medium {
47
+ padding: calc(var(--spacingVerticalL) - var(--strokeWidthThick)) var(--spacingHorizontalM) var(--spacingVerticalL);
48
+ font-size: var(--fontSizeBase300);
49
+ line-height: var(--lineHeightBase300);
50
+ }
51
+
52
+ .large {
53
+ padding: calc(var(--spacingVerticalXL) - var(--strokeWidthThick)) var(--spacingHorizontalL) var(--spacingVerticalXL);
54
+ font-size: var(--fontSizeBase400);
55
+ line-height: var(--lineHeightBase400);
56
+ }
57
+
58
+ .disabled :global(.fui-CompoundButton__secondaryContent),
59
+ .disabled:hover :global(.fui-CompoundButton__secondaryContent),
60
+ .disabled:hover:active :global(.fui-CompoundButton__secondaryContent),
61
+ .disabled:active:focus-visible :global(.fui-CompoundButton__secondaryContent) {
62
+ color: var(--colorNeutralForegroundDisabled);
63
+ }
64
+
65
+ .iconOnly {
66
+ padding: var(--spacingVerticalSNudge);
67
+ max-width: calc(var(--spacingHorizontalXXL) * 2 + var(--spacingHorizontalXS));
68
+ min-width: calc(var(--spacingHorizontalXXL) * 2 + var(--spacingHorizontalXS));
69
+
70
+ &:where(.small) {
71
+ padding: var(--spacingVerticalXS);
72
+ max-width: calc(var(--spacingHorizontalXXL) * 2);
73
+ min-width: calc(var(--spacingHorizontalXXL) * 2);
74
+ }
75
+
76
+ &:where(.large) {
77
+ padding: var(--spacingVerticalS);
78
+ max-width: calc(var(--spacingHorizontalXXL) * 2 + var(--spacingHorizontalS));
79
+ min-width: calc(var(--spacingHorizontalXXL) * 2 + var(--spacingHorizontalS));
80
+ }
81
+ }
82
+
83
+ .before {
84
+ margin-inline-end: var(--spacingHorizontalM);
85
+ }
86
+
87
+ .after {
88
+ margin-inline-start: var(--spacingHorizontalM);
89
+ }
90
+
91
+ .contentContainer {
92
+ display: flex;
93
+ flex-direction: column;
94
+ text-align: start;
95
+
96
+ &:where(:dir(rtl)) {
97
+ text-align: right;
98
+ }
99
+ }
100
+
101
+ .secondaryContent {
102
+ line-height: 100%;
103
+ font-weight: var(--fontWeightRegular);
104
+ }
105
+
106
+ :where(.small, .medium) .secondaryContent {
107
+ font-size: var(--fontSizeBase200);
108
+ }
109
+
110
+ :where(.large) .secondaryContent {
111
+ font-size: var(--fontSizeBase300);
112
+ }
113
+
114
+ @media (forced-colors: active) {
115
+ .root:hover :global(.fui-CompoundButton__secondaryContent),
116
+ .root:hover:active :global(.fui-CompoundButton__secondaryContent),
117
+ .root:active:focus-visible :global(.fui-CompoundButton__secondaryContent) {
118
+ color: Highlight;
119
+ }
120
+
121
+ .primary :global(.fui-CompoundButton__secondaryContent) {
122
+ color: HighlightText;
123
+ }
124
+
125
+ .subtle:hover :global(.fui-CompoundButton__secondaryContent),
126
+ .subtle:hover:active :global(.fui-CompoundButton__secondaryContent),
127
+ .subtle:active:focus-visible :global(.fui-CompoundButton__secondaryContent) {
128
+ color: Canvas;
129
+ }
130
+
131
+ .disabled :global(.fui-CompoundButton__secondaryContent),
132
+ .disabled:hover :global(.fui-CompoundButton__secondaryContent),
133
+ .disabled:hover:active :global(.fui-CompoundButton__secondaryContent),
134
+ .disabled:active:focus-visible :global(.fui-CompoundButton__secondaryContent) {
135
+ color: GrayText;
136
+ }
137
+ }
@@ -0,0 +1,46 @@
1
+ 'use client';
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ function _export(target, all) {
7
+ for(var name in all)Object.defineProperty(target, name, {
8
+ enumerable: true,
9
+ get: Object.getOwnPropertyDescriptor(all, name).get
10
+ });
11
+ }
12
+ _export(exports, {
13
+ get compoundButtonClassNames () {
14
+ return compoundButtonClassNames;
15
+ },
16
+ get useCompoundButtonStyles_unstable () {
17
+ return useCompoundButtonStyles_unstable;
18
+ }
19
+ });
20
+ const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
21
+ const _clsx = require("clsx");
22
+ const _useButtonStylesstylescss = require("../Button/useButtonStyles.styles.css.cjs");
23
+ const _CompoundButtonmodulecss = /*#__PURE__*/ _interop_require_default._(require("./CompoundButton.module.css"));
24
+ const compoundButtonClassNames = {
25
+ root: 'fui-CompoundButton',
26
+ icon: 'fui-CompoundButton__icon',
27
+ contentContainer: 'fui-CompoundButton__contentContainer',
28
+ secondaryContent: 'fui-CompoundButton__secondaryContent'
29
+ };
30
+ const useCompoundButtonStyles_unstable = (state)=>{
31
+ const { appearance, disabled, disabledFocusable, iconOnly, iconPosition, size } = state;
32
+ // eslint-disable-next-line react-hooks/immutability
33
+ state.root.className = (0, _clsx.clsx)(compoundButtonClassNames.root, _CompoundButtonmodulecss.default.root, _CompoundButtonmodulecss.default[appearance], _CompoundButtonmodulecss.default[size], (disabled || disabledFocusable) && _CompoundButtonmodulecss.default.disabled, iconOnly && _CompoundButtonmodulecss.default.iconOnly, state.root.className);
34
+ // eslint-disable-next-line react-hooks/immutability
35
+ state.contentContainer.className = (0, _clsx.clsx)(compoundButtonClassNames.contentContainer, _CompoundButtonmodulecss.default.contentContainer, state.contentContainer.className);
36
+ if (state.icon) {
37
+ // eslint-disable-next-line react-hooks/immutability
38
+ state.icon.className = (0, _clsx.clsx)(compoundButtonClassNames.icon, _CompoundButtonmodulecss.default.icon, state.root.children !== undefined && state.root.children !== null && _CompoundButtonmodulecss.default[iconPosition], state.icon.className);
39
+ }
40
+ if (state.secondaryContent) {
41
+ // eslint-disable-next-line react-hooks/immutability
42
+ state.secondaryContent.className = (0, _clsx.clsx)(compoundButtonClassNames.secondaryContent, _CompoundButtonmodulecss.default.secondaryContent, state.secondaryContent.className);
43
+ }
44
+ (0, _useButtonStylesstylescss.useButtonStyles_unstable)(state);
45
+ return state;
46
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/CompoundButton/useCompoundButtonStyles.styles.css.ts"],"sourcesContent":["'use client';\n\nimport { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useButtonStyles_unstable } from '../Button/useButtonStyles.styles.css';\nimport type { CompoundButtonSlots, CompoundButtonState } from './CompoundButton.types';\nimport styles from './CompoundButton.module.css';\n\nexport const compoundButtonClassNames: SlotClassNames<CompoundButtonSlots> = {\n root: 'fui-CompoundButton',\n icon: 'fui-CompoundButton__icon',\n contentContainer: 'fui-CompoundButton__contentContainer',\n secondaryContent: 'fui-CompoundButton__secondaryContent',\n};\n\nexport const useCompoundButtonStyles_unstable = (state: CompoundButtonState): CompoundButtonState => {\n const { appearance, disabled, disabledFocusable, iconOnly, iconPosition, size } = state;\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = clsx(\n compoundButtonClassNames.root,\n styles.root,\n styles[appearance],\n styles[size],\n (disabled || disabledFocusable) && styles.disabled,\n iconOnly && styles.iconOnly,\n state.root.className,\n );\n // eslint-disable-next-line react-hooks/immutability\n state.contentContainer.className = clsx(\n compoundButtonClassNames.contentContainer,\n styles.contentContainer,\n state.contentContainer.className,\n );\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = clsx(\n compoundButtonClassNames.icon,\n styles.icon,\n state.root.children !== undefined && state.root.children !== null && styles[iconPosition],\n state.icon.className,\n );\n }\n if (state.secondaryContent) {\n // eslint-disable-next-line react-hooks/immutability\n state.secondaryContent.className = clsx(\n compoundButtonClassNames.secondaryContent,\n styles.secondaryContent,\n state.secondaryContent.className,\n );\n }\n\n useButtonStyles_unstable(state);\n return state;\n};\n"],"names":["clsx","useButtonStyles_unstable","styles","compoundButtonClassNames","root","icon","contentContainer","secondaryContent","useCompoundButtonStyles_unstable","state","appearance","disabled","disabledFocusable","iconOnly","iconPosition","size","className","children","undefined"],"mappings":"AAAA;;;;;;;;;;;;QAQaG;;;;;;;;sBANQ,OAAO;0CAEa,0CAAuC;kFAE7D,8BAA8B;AAE1C,iCAAsE;IAC3EC,MAAM;IACNC,MAAM;IACNC,kBAAkB;IAClBC,kBAAkB;AACpB,EAAE;AAEK,MAAMC,mCAAmC,CAACC;IAC/C,MAAM,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,iBAAiB,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,IAAI,EAAE,GAAGN;IAElF,oDAAoD;IACpDA,MAAML,IAAI,CAACY,SAAS,OAAGhB,UAAAA,EACrBG,yBAAyBC,IAAI,EAC7BF,gCAAAA,CAAOE,IAAI,EACXF,gCAAM,CAACQ,WAAW,EAClBR,gCAAM,CAACa,KAAK,EACXJ,CAAAA,YAAYC,iBAAAA,CAAgB,IAAMV,gCAAAA,CAAOS,QAAQ,EAClDE,YAAYX,gCAAAA,CAAOW,QAAQ,EAC3BJ,MAAML,IAAI,CAACY,SAAS;IAEtB,oDAAoD;IACpDP,MAAMH,gBAAgB,CAACU,SAAS,OAAGhB,UAAAA,EACjCG,yBAAyBG,gBAAgB,EACzCJ,gCAAAA,CAAOI,gBAAgB,EACvBG,MAAMH,gBAAgB,CAACU,SAAS;IAElC,IAAIP,MAAMJ,IAAI,EAAE;QACd,oDAAoD;QACpDI,MAAMJ,IAAI,CAACW,SAAS,OAAGhB,UAAAA,EACrBG,yBAAyBE,IAAI,EAC7BH,gCAAAA,CAAOG,IAAI,EACXI,MAAML,IAAI,CAACa,QAAQ,KAAKC,aAAaT,MAAML,IAAI,CAACa,QAAQ,KAAK,QAAQf,gCAAM,CAACY,aAAa,EACzFL,MAAMJ,IAAI,CAACW,SAAS;IAExB;IACA,IAAIP,MAAMF,gBAAgB,EAAE;QAC1B,oDAAoD;QACpDE,MAAMF,gBAAgB,CAACS,SAAS,OAAGhB,UAAAA,EACjCG,yBAAyBI,gBAAgB,EACzCL,gCAAAA,CAAOK,gBAAgB,EACvBE,MAAMF,gBAAgB,CAACS,SAAS;IAEpC;QAEAf,kDAAAA,EAAyBQ;IACzB,OAAOA;AACT,EAAE"}