@fluentui/react-button 9.74.9-experimental.menu-disable-autofocus.20261008-e9914a95c6.0 → 9.75.1-experimental.css-modules.20261103-d6c85ee2a9.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 (163) hide show
  1. package/CHANGELOG.md +32 -11
  2. package/README.md +22 -0
  3. package/lib/components/Button/Button.js.map +1 -1
  4. package/lib/components/Button/Button.module.css +401 -0
  5. package/lib/components/Button/Button.types.js.map +1 -1
  6. package/lib/components/Button/index.js.map +1 -1
  7. package/lib/components/Button/renderButton.js +2 -2
  8. package/lib/components/Button/renderButton.js.map +1 -1
  9. package/lib/components/Button/useButton.js +1 -1
  10. package/lib/components/Button/useButton.js.map +1 -1
  11. package/lib/components/Button/useButtonStyles.styles.css.js +14 -0
  12. package/lib/components/Button/useButtonStyles.styles.css.js.map +1 -0
  13. package/lib/components/Button/useButtonStyles.styles.raw.css.js +14 -0
  14. package/lib/components/Button/useButtonStyles.styles.raw.css.js.map +1 -0
  15. package/lib/components/Button/useButtonStyles.styles.raw.js.map +1 -1
  16. package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
  17. package/lib/components/CompoundButton/CompoundButton.module.css +143 -0
  18. package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
  19. package/lib/components/CompoundButton/index.js.map +1 -1
  20. package/lib/components/CompoundButton/renderCompoundButton.js +2 -2
  21. package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
  22. package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
  23. package/lib/components/CompoundButton/useCompoundButtonStyles.styles.css.js +27 -0
  24. package/lib/components/CompoundButton/useCompoundButtonStyles.styles.css.js.map +1 -0
  25. package/lib/components/CompoundButton/useCompoundButtonStyles.styles.raw.css.js +27 -0
  26. package/lib/components/CompoundButton/useCompoundButtonStyles.styles.raw.css.js.map +1 -0
  27. package/lib/components/CompoundButton/useCompoundButtonStyles.styles.raw.js.map +1 -1
  28. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  29. package/lib/components/MenuButton/MenuButton.module.css +75 -0
  30. package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
  31. package/lib/components/MenuButton/index.js.map +1 -1
  32. package/lib/components/MenuButton/renderMenuButton.js +2 -2
  33. package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
  34. package/lib/components/MenuButton/useMenuButton.js.map +1 -1
  35. package/lib/components/MenuButton/useMenuButtonStyles.styles.css.js +26 -0
  36. package/lib/components/MenuButton/useMenuButtonStyles.styles.css.js.map +1 -0
  37. package/lib/components/MenuButton/useMenuButtonStyles.styles.raw.css.js +26 -0
  38. package/lib/components/MenuButton/useMenuButtonStyles.styles.raw.css.js.map +1 -0
  39. package/lib/components/MenuButton/useMenuButtonStyles.styles.raw.js.map +1 -1
  40. package/lib/components/SplitButton/SplitButton.js.map +1 -1
  41. package/lib/components/SplitButton/SplitButton.module.css +73 -0
  42. package/lib/components/SplitButton/SplitButton.types.js.map +1 -1
  43. package/lib/components/SplitButton/index.js.map +1 -1
  44. package/lib/components/SplitButton/renderSplitButton.js +2 -2
  45. package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
  46. package/lib/components/SplitButton/useSplitButton.js.map +1 -1
  47. package/lib/components/SplitButton/useSplitButtonStyles.styles.css.js +17 -0
  48. package/lib/components/SplitButton/useSplitButtonStyles.styles.css.js.map +1 -0
  49. package/lib/components/SplitButton/useSplitButtonStyles.styles.raw.css.js +17 -0
  50. package/lib/components/SplitButton/useSplitButtonStyles.styles.raw.css.js.map +1 -0
  51. package/lib/components/SplitButton/useSplitButtonStyles.styles.raw.js.map +1 -1
  52. package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
  53. package/lib/components/ToggleButton/ToggleButton.module.css +234 -0
  54. package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -1
  55. package/lib/components/ToggleButton/index.js.map +1 -1
  56. package/lib/components/ToggleButton/renderToggleButton.js.map +1 -1
  57. package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
  58. package/lib/components/ToggleButton/useToggleButtonStyles.styles.css.js +18 -0
  59. package/lib/components/ToggleButton/useToggleButtonStyles.styles.css.js.map +1 -0
  60. package/lib/components/ToggleButton/useToggleButtonStyles.styles.js +12 -1
  61. package/lib/components/ToggleButton/useToggleButtonStyles.styles.js.map +1 -1
  62. package/lib/components/ToggleButton/useToggleButtonStyles.styles.raw.css.js +18 -0
  63. package/lib/components/ToggleButton/useToggleButtonStyles.styles.raw.css.js.map +1 -0
  64. package/lib/components/ToggleButton/useToggleButtonStyles.styles.raw.js +11 -1
  65. package/lib/components/ToggleButton/useToggleButtonStyles.styles.raw.js.map +1 -1
  66. package/lib/contexts/ButtonContext.js.map +1 -1
  67. package/lib/contexts/index.js.map +1 -1
  68. package/lib/utils/index.js.map +1 -1
  69. package/lib/utils/useToggleState.js.map +1 -1
  70. package/lib-commonjs/Button.cjs +7 -7
  71. package/lib-commonjs/CompoundButton.cjs +7 -7
  72. package/lib-commonjs/MenuButton.cjs +7 -7
  73. package/lib-commonjs/SplitButton.cjs +7 -7
  74. package/lib-commonjs/ToggleButton.cjs +7 -7
  75. package/lib-commonjs/components/Button/Button.cjs.map +1 -1
  76. package/lib-commonjs/components/Button/Button.module.css +401 -0
  77. package/lib-commonjs/components/Button/Button.types.cjs.map +1 -1
  78. package/lib-commonjs/components/Button/index.cjs +7 -7
  79. package/lib-commonjs/components/Button/index.cjs.map +1 -1
  80. package/lib-commonjs/components/Button/renderButton.cjs.map +1 -1
  81. package/lib-commonjs/components/Button/useButton.cjs +4 -4
  82. package/lib-commonjs/components/Button/useButton.cjs.map +1 -1
  83. package/lib-commonjs/components/Button/useButtonStyles.styles.cjs +3 -3
  84. package/lib-commonjs/components/Button/useButtonStyles.styles.cjs.map +1 -1
  85. package/lib-commonjs/components/Button/useButtonStyles.styles.css.cjs +33 -0
  86. package/lib-commonjs/components/Button/useButtonStyles.styles.css.cjs.map +1 -0
  87. package/lib-commonjs/components/Button/useButtonStyles.styles.raw.cjs +3 -3
  88. package/lib-commonjs/components/Button/useButtonStyles.styles.raw.cjs.map +1 -1
  89. package/lib-commonjs/components/Button/useButtonStyles.styles.raw.css.cjs +33 -0
  90. package/lib-commonjs/components/Button/useButtonStyles.styles.raw.css.cjs.map +1 -0
  91. package/lib-commonjs/components/CompoundButton/CompoundButton.cjs.map +1 -1
  92. package/lib-commonjs/components/CompoundButton/CompoundButton.module.css +143 -0
  93. package/lib-commonjs/components/CompoundButton/CompoundButton.types.cjs.map +1 -1
  94. package/lib-commonjs/components/CompoundButton/index.cjs +7 -7
  95. package/lib-commonjs/components/CompoundButton/index.cjs.map +1 -1
  96. package/lib-commonjs/components/CompoundButton/renderCompoundButton.cjs.map +1 -1
  97. package/lib-commonjs/components/CompoundButton/useCompoundButton.cjs +3 -3
  98. package/lib-commonjs/components/CompoundButton/useCompoundButton.cjs.map +1 -1
  99. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.cjs +3 -3
  100. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.cjs.map +1 -1
  101. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.css.cjs +46 -0
  102. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.css.cjs.map +1 -0
  103. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.raw.cjs +3 -3
  104. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.raw.cjs.map +1 -1
  105. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.raw.css.cjs +46 -0
  106. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.raw.css.cjs.map +1 -0
  107. package/lib-commonjs/components/MenuButton/MenuButton.cjs.map +1 -1
  108. package/lib-commonjs/components/MenuButton/MenuButton.module.css +75 -0
  109. package/lib-commonjs/components/MenuButton/MenuButton.types.cjs.map +1 -1
  110. package/lib-commonjs/components/MenuButton/index.cjs +7 -7
  111. package/lib-commonjs/components/MenuButton/index.cjs.map +1 -1
  112. package/lib-commonjs/components/MenuButton/renderMenuButton.cjs.map +1 -1
  113. package/lib-commonjs/components/MenuButton/useMenuButton.cjs +3 -3
  114. package/lib-commonjs/components/MenuButton/useMenuButton.cjs.map +1 -1
  115. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.cjs +3 -3
  116. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.cjs.map +1 -1
  117. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.css.cjs +45 -0
  118. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.css.cjs.map +1 -0
  119. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.raw.cjs +3 -3
  120. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.raw.cjs.map +1 -1
  121. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.raw.css.cjs +45 -0
  122. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.raw.css.cjs.map +1 -0
  123. package/lib-commonjs/components/SplitButton/SplitButton.cjs.map +1 -1
  124. package/lib-commonjs/components/SplitButton/SplitButton.module.css +73 -0
  125. package/lib-commonjs/components/SplitButton/SplitButton.types.cjs.map +1 -1
  126. package/lib-commonjs/components/SplitButton/index.cjs +7 -7
  127. package/lib-commonjs/components/SplitButton/index.cjs.map +1 -1
  128. package/lib-commonjs/components/SplitButton/renderSplitButton.cjs.map +1 -1
  129. package/lib-commonjs/components/SplitButton/useSplitButton.cjs +3 -3
  130. package/lib-commonjs/components/SplitButton/useSplitButton.cjs.map +1 -1
  131. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.cjs +3 -3
  132. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.cjs.map +1 -1
  133. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.css.cjs +36 -0
  134. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.css.cjs.map +1 -0
  135. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.raw.cjs +3 -3
  136. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.raw.cjs.map +1 -1
  137. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.raw.css.cjs +36 -0
  138. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.raw.css.cjs.map +1 -0
  139. package/lib-commonjs/components/ToggleButton/ToggleButton.cjs.map +1 -1
  140. package/lib-commonjs/components/ToggleButton/ToggleButton.module.css +234 -0
  141. package/lib-commonjs/components/ToggleButton/ToggleButton.types.cjs.map +1 -1
  142. package/lib-commonjs/components/ToggleButton/index.cjs +7 -7
  143. package/lib-commonjs/components/ToggleButton/index.cjs.map +1 -1
  144. package/lib-commonjs/components/ToggleButton/renderToggleButton.cjs.map +1 -1
  145. package/lib-commonjs/components/ToggleButton/useToggleButton.cjs +3 -3
  146. package/lib-commonjs/components/ToggleButton/useToggleButton.cjs.map +1 -1
  147. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.cjs +27 -4
  148. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.cjs.map +1 -1
  149. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.css.cjs +37 -0
  150. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.css.cjs.map +1 -0
  151. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.raw.cjs +14 -4
  152. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.raw.cjs.map +1 -1
  153. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.raw.css.cjs +37 -0
  154. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.raw.css.cjs.map +1 -0
  155. package/lib-commonjs/contexts/ButtonContext.cjs +3 -3
  156. package/lib-commonjs/contexts/ButtonContext.cjs.map +1 -1
  157. package/lib-commonjs/contexts/index.cjs +3 -3
  158. package/lib-commonjs/contexts/index.cjs.map +1 -1
  159. package/lib-commonjs/index.cjs +34 -34
  160. package/lib-commonjs/index.cjs.map +1 -1
  161. package/lib-commonjs/utils/index.cjs.map +1 -1
  162. package/lib-commonjs/utils/useToggleState.cjs.map +1 -1
  163. package/package.json +13 -10
package/CHANGELOG.md CHANGED
@@ -1,23 +1,44 @@
1
1
  # Change Log - @fluentui/react-button
2
2
 
3
- <!-- This log was last generated on Thu, 08 Oct 2026 09:40:08 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Tue, 03 Nov 2026 14:03:09 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [9.74.9-experimental.menu-disable-autofocus.20261008-e9914a95c6.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.74.9-experimental.menu-disable-autofocus.20261008-e9914a95c6.0)
7
+ ## [9.75.1-experimental.css-modules.20261103-d6c85ee2a9.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.75.1-experimental.css-modules.20261103-d6c85ee2a9.0)
8
8
 
9
- Thu, 08 Oct 2026 09:40:08 GMT
9
+ Tue, 03 Nov 2026 14:03:09 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.11.3..@fluentui/react-button_v9.75.1-experimental.css-modules.20261103-d6c85ee2a9.0)
10
11
 
11
12
  ### Changes
12
13
 
13
- - Release 9.74.9-experimental.menu-disable-autofocus.20261008-e9914a95c6 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
14
- - Bump @fluentui/keyboard-keys to v9.74.9-experimental.menu-disable-autofocus.20261008-e9914a95c6.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
15
- - Bump @fluentui/react-aria to v9.74.9-experimental.menu-disable-autofocus.20261008-e9914a95c6.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
16
- - Bump @fluentui/react-jsx-runtime to v9.74.9-experimental.menu-disable-autofocus.20261008-e9914a95c6.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
17
- - Bump @fluentui/react-shared-contexts to v9.74.9-experimental.menu-disable-autofocus.20261008-e9914a95c6.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
18
- - Bump @fluentui/react-tabster to v9.74.9-experimental.menu-disable-autofocus.20261008-e9914a95c6.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
19
- - Bump @fluentui/react-theme to v9.74.9-experimental.menu-disable-autofocus.20261008-e9914a95c6.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
20
- - Bump @fluentui/react-utilities to v9.74.9-experimental.menu-disable-autofocus.20261008-e9914a95c6.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
14
+ - Release 9.75.1-experimental.css-modules.20261103-d6c85ee2a9 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
15
+ - Bump @fluentui/keyboard-keys to v9.75.1-experimental.css-modules.20261103-d6c85ee2a9.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
16
+ - Bump @fluentui/react-aria to v9.75.1-experimental.css-modules.20261103-d6c85ee2a9.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
17
+ - Bump @fluentui/react-jsx-runtime to v9.75.1-experimental.css-modules.20261103-d6c85ee2a9.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
18
+ - Bump @fluentui/react-shared-contexts to v9.75.1-experimental.css-modules.20261103-d6c85ee2a9.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
19
+ - Bump @fluentui/react-tabster to v9.75.1-experimental.css-modules.20261103-d6c85ee2a9.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
20
+ - Bump @fluentui/react-theme to v9.75.1-experimental.css-modules.20261103-d6c85ee2a9.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
21
+ - Bump @fluentui/react-utilities to v9.75.1-experimental.css-modules.20261103-d6c85ee2a9.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
22
+
23
+ ## [9.11.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.11.3)
24
+
25
+ Thu, 22 Oct 2026 11:25:58 GMT
26
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-button_v9.11.2..@fluentui/react-button_v9.11.3)
27
+
28
+ ### Patches
29
+
30
+ - fix: preserve selected toggle button icon contrast in forced-colors mode, including toolbar radio and toggle buttons ([PR #36935](https://github.com/microsoft/fluentui/pull/36935) by paulmardling@microsoft.com)
31
+
32
+ ## [9.11.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.11.2)
33
+
34
+ Mon, 19 Oct 2026 16:49:01 GMT
35
+
36
+ ### Patches
37
+
38
+ - Bump @fluentui/react-aria to v9.17.16 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
39
+ - Bump @fluentui/react-jsx-runtime to v9.4.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
40
+ - Bump @fluentui/react-tabster to v9.26.19 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
41
+ - Bump @fluentui/react-utilities to v9.27.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
21
42
 
22
43
  ## [9.11.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-button_v9.11.1)
23
44
 
package/README.md CHANGED
@@ -89,6 +89,28 @@ Alternatively, run Storybook locally with:
89
89
  1. `yarn start`
90
90
  2. Select `react-button` from the list.
91
91
 
92
+ ### Experimental CSS Modules
93
+
94
+ Button, CompoundButton, MenuButton, SplitButton, and ToggleButton have
95
+ `use<Component>Styles.css-module.ts` alternatives beside their original Griffel
96
+ style hooks. The CSS Module hooks compose Button's shared styles and apply
97
+ independent state classes; nested CSS handles state combinations.
98
+
99
+ The prototype's component imports select the CSS Module hooks for local testing.
100
+ The original Griffel hooks remain available for comparison. CSS Modules use the
101
+ `fluentui` cascade layer and FluentProvider's theme custom properties. They require
102
+ CSS Modules and native CSS nesting support, or an equivalent bundler transform.
103
+ Use headless/CSS-styled icons with their defaults in the same layer:
104
+
105
+ ```css
106
+ @import url('@fluentui/react-icons/headless/styles.css') layer(fluent);
107
+ ```
108
+
109
+ The Nx build copies every `*.module.css` file next to its hook in both `lib` and
110
+ `lib-commonjs`. Applications must process these CSS imports and retain CSS side
111
+ effects. Browser-based parity checks are required when changing the cascade;
112
+ JSDOM hook tests only validate the state-to-class mapping.
113
+
92
114
  ### Specification
93
115
 
94
116
  See [SPEC.md](./src/components/Button/SPEC.md).
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Button/Button.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { renderButton_unstable } from './renderButton';\nimport { useButton_unstable } from './useButton';\nimport { useButtonStyles_unstable } from './useButtonStyles.styles';\nimport type { ButtonProps } from './Button.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Buttons give people a way to trigger an action.\n */\nexport const Button: ForwardRefComponent<ButtonProps> = React.forwardRef((props, ref) => {\n const state = useButton_unstable(props, ref);\n\n useButtonStyles_unstable(state);\n\n useCustomStyleHook_unstable('useButtonStyles_unstable')(state);\n\n return renderButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<ButtonProps>;\n\nButton.displayName = 'Button';\n"],"names":["React","renderButton_unstable","useButton_unstable","useButtonStyles_unstable","useCustomStyleHook_unstable","Button","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ,oBAAiB;AACvD,SAASC,kBAAkB,QAAQ,iBAAc;AACjD,SAASC,wBAAwB,QAAQ,8BAA2B;AAGpE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,uBAA2CL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC/E,MAAMC,QAAQP,mBAAmBK,OAAOC;IAExCL,yBAAyBM;IAEzBL,4BAA4B,4BAA4BK;IAExD,OAAOR,sBAAsBQ;AAC7B,0FAA0F;AAC5F,GAAuC;AAEvCJ,OAAOK,WAAW,GAAG"}
1
+ {"version":3,"sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { renderButton_unstable } from './renderButton';\nimport { useButton_unstable } from './useButton';\nimport { useButtonStyles_unstable } from './useButtonStyles.styles';\nimport type { ButtonProps } from './Button.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Buttons give people a way to trigger an action.\n */\nexport const Button: ForwardRefComponent<ButtonProps> = React.forwardRef((props, ref) => {\n const state = useButton_unstable(props, ref);\n\n useButtonStyles_unstable(state);\n\n useCustomStyleHook_unstable('useButtonStyles_unstable')(state);\n\n return renderButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<ButtonProps>;\n\nButton.displayName = 'Button';\n"],"names":["React","renderButton_unstable","useButton_unstable","useButtonStyles_unstable","useCustomStyleHook_unstable","Button","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ,oBAAiB;AACvD,SAASC,kBAAkB,QAAQ,iBAAc;AACjD,SAASC,wBAAwB,QAAQ,8BAA2B;AAGpE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,uBAA2CL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC/E,MAAMC,QAAQP,mBAAmBK,OAAOC;IAExCL,yBAAyBM;IAEzBL,4BAA4B,4BAA4BK;IAExD,OAAOR,sBAAsBQ;AAC7B,0FAA0F;AAC5F,GAAuC;AAEvCJ,OAAOK,WAAW,GAAG"}
@@ -0,0 +1,401 @@
1
+ @layer fluent {
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
+ .icon {
160
+ --fui-Button__icon--spacing: var(--spacingHorizontalXS);
161
+ }
162
+
163
+ &:where(.withIcon) {
164
+ padding-top: var(--strokeWidthThin);
165
+ padding-bottom: var(--strokeWidthThin);
166
+ }
167
+ }
168
+
169
+ .medium {
170
+ padding: calc(var(--spacingVerticalSNudge) - var(--strokeWidthThin)) var(--spacingHorizontalM);
171
+ min-width: calc(var(--spacingHorizontalXXXL) * 3);
172
+ font-size: var(--fontSizeBase300);
173
+ font-weight: var(--fontWeightSemibold);
174
+ line-height: var(--lineHeightBase300);
175
+ }
176
+
177
+ .large {
178
+ min-width: calc(var(--spacingHorizontalXXXL) * 3);
179
+ padding: var(--spacingVerticalS) var(--spacingHorizontalL);
180
+ font-size: var(--fontSizeBase400);
181
+ font-weight: var(--fontWeightSemibold);
182
+ line-height: var(--lineHeightBase400);
183
+
184
+ .icon {
185
+ font-size: var(--fontSizeBase600);
186
+ height: var(--fontSizeBase600);
187
+ width: var(--fontSizeBase600);
188
+ }
189
+
190
+ &:where(.withIcon) {
191
+ padding-top: calc(var(--spacingVerticalS) - var(--strokeWidthThin));
192
+ padding-bottom: calc(var(--spacingVerticalS) - var(--strokeWidthThin));
193
+ }
194
+ }
195
+
196
+ .rounded {
197
+ border-radius: var(--borderRadiusMedium);
198
+ }
199
+
200
+ .circular {
201
+ border-radius: var(--borderRadiusCircular);
202
+ }
203
+
204
+ .square {
205
+ border-radius: var(--borderRadiusNone);
206
+ }
207
+
208
+ .disabled,
209
+ .disabled:hover,
210
+ .disabled:hover:active,
211
+ .disabled:active:focus-visible {
212
+ background-color: var(--colorNeutralBackgroundDisabled);
213
+ border-color: var(--colorNeutralStrokeDisabled);
214
+ color: var(--colorNeutralForegroundDisabled);
215
+ cursor: not-allowed;
216
+ }
217
+
218
+ .disabled :global(.fui-Button__icon),
219
+ .disabled:hover :global(.fui-Button__icon),
220
+ .disabled:hover:active :global(.fui-Button__icon),
221
+ .disabled:active:focus-visible :global(.fui-Button__icon) {
222
+ color: var(--colorNeutralForegroundDisabled);
223
+ }
224
+
225
+ .disabled:hover :global(.fui-Icon-filled),
226
+ .disabled:hover:active :global(.fui-Icon-filled),
227
+ .disabled:active:focus-visible :global(.fui-Icon-filled) {
228
+ display: none;
229
+ }
230
+
231
+ .disabled:hover :global(.fui-Icon-regular),
232
+ .disabled:hover:active :global(.fui-Icon-regular),
233
+ .disabled:active:focus-visible :global(.fui-Icon-regular) {
234
+ display: inline;
235
+ }
236
+
237
+ .disabled {
238
+ &:where(.outline, .subtle, .transparent) {
239
+ &,
240
+ &:hover,
241
+ &:hover:active,
242
+ &:active:focus-visible {
243
+ background-color: var(--colorTransparentBackground);
244
+ }
245
+ }
246
+
247
+ &:where(.primary, .subtle, .transparent) {
248
+ &,
249
+ &:hover,
250
+ &:hover:active,
251
+ &:active:focus-visible {
252
+ border-color: transparent;
253
+ }
254
+ }
255
+ }
256
+
257
+ .primary[data-fui-focus-visible] {
258
+ border-color: var(--colorStrokeFocus2);
259
+ box-shadow: var(--shadow2), 0 0 0 var(--strokeWidthThin) var(--colorStrokeFocus2) inset,
260
+ 0 0 0 var(--strokeWidthThick) var(--colorNeutralForegroundOnBrand) inset;
261
+ }
262
+
263
+ .primary[data-fui-focus-visible]:hover {
264
+ border-color: var(--colorStrokeFocus2);
265
+ box-shadow: var(--shadow2), 0 0 0 var(--strokeWidthThin) var(--colorStrokeFocus2) inset;
266
+ }
267
+
268
+ /* Firefox needs an extra quarter of the default thin stroke at some zoom levels. */
269
+ @supports (-moz-appearance: button) {
270
+ .root[data-fui-focus-visible] {
271
+ box-shadow: 0 0 0 calc(var(--strokeWidthThin) * 1.25) var(--colorStrokeFocus2) inset;
272
+ }
273
+
274
+ .primary[data-fui-focus-visible] {
275
+ box-shadow: var(--shadow2), 0 0 0 calc(var(--strokeWidthThin) * 1.25) var(--colorStrokeFocus2) inset,
276
+ 0 0 0 var(--strokeWidthThick) var(--colorNeutralForegroundOnBrand) inset;
277
+ }
278
+
279
+ .primary[data-fui-focus-visible]:hover {
280
+ box-shadow: var(--shadow2), 0 0 0 calc(var(--strokeWidthThin) * 1.25) var(--colorStrokeFocus2) inset;
281
+ }
282
+ }
283
+
284
+ .small[data-fui-focus-visible] {
285
+ border-radius: var(--borderRadiusSmall);
286
+ }
287
+
288
+ .large[data-fui-focus-visible] {
289
+ border-radius: var(--borderRadiusLarge);
290
+ }
291
+
292
+ .circular[data-fui-focus-visible] {
293
+ border-radius: var(--borderRadiusCircular);
294
+ }
295
+
296
+ .square[data-fui-focus-visible] {
297
+ border-radius: var(--borderRadiusNone);
298
+ }
299
+
300
+ .iconOnly {
301
+ padding: calc(var(--spacingVerticalSNudge) - var(--strokeWidthThin));
302
+ min-width: var(--spacingHorizontalXXXL);
303
+ max-width: var(--spacingHorizontalXXXL);
304
+
305
+ &:where(.small) {
306
+ padding: var(--strokeWidthThin);
307
+ min-width: var(--spacingHorizontalXXL);
308
+ max-width: var(--spacingHorizontalXXL);
309
+ }
310
+
311
+ &:where(.large) {
312
+ padding: calc(var(--spacingVerticalS) - var(--strokeWidthThin));
313
+ min-width: calc(var(--spacingHorizontalXL) * 2);
314
+ max-width: calc(var(--spacingHorizontalXL) * 2);
315
+ }
316
+ }
317
+
318
+ .icon {
319
+ align-items: center;
320
+ display: inline-flex;
321
+ justify-content: center;
322
+ font-size: var(--fontSizeBase500);
323
+ height: var(--fontSizeBase500);
324
+ width: var(--fontSizeBase500);
325
+ --fui-Button__icon--spacing: var(--spacingHorizontalSNudge);
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
+ }
401
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Button/Button.types.ts"],"sourcesContent":["import type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { ComponentProps, ComponentState, DistributiveOmit, Slot } from '@fluentui/react-utilities';\n\nexport type ButtonSlots = {\n /**\n * Root of the component that renders as either a `<button>` tag or an `<a>` tag.\n */\n root: NonNullable<Slot<ARIAButtonSlotProps<'a'>>>;\n\n /**\n * Icon that renders either before or after the `children` as specified by the `iconPosition` prop.\n */\n icon?: Slot<'span'>;\n};\n\n/**\n * A button supports different sizes.\n */\nexport type ButtonSize = 'small' | 'medium' | 'large';\n\nexport type ButtonProps = ComponentProps<ButtonSlots> & {\n /**\n * A button can have its content and borders styled for greater emphasis or to be subtle.\n * - 'secondary' (default): Gives emphasis to the button in such a way that it indicates a secondary action.\n * - 'primary': Emphasizes the button as a primary action.\n * - 'outline': Removes background styling.\n * - 'subtle': Minimizes emphasis to blend into the background until hovered or focused.\n * - 'transparent': Removes background and border styling.\n *\n * @default 'secondary'\n */\n appearance?: 'secondary' | 'primary' | 'outline' | 'subtle' | 'transparent';\n\n /**\n * When set, allows the button to be focusable even when it has been disabled. This is used in scenarios where it\n * is important to keep a consistent tab order for screen reader and keyboard users. The primary example of this\n * pattern is when the disabled button is in a menu or a commandbar and is seldom used for standalone buttons.\n *\n * @default false\n */\n disabledFocusable?: boolean;\n\n /**\n * A button can show that it cannot be interacted with.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * A button can format its icon to appear before or after its content.\n *\n * @default 'before'\n */\n iconPosition?: 'before' | 'after';\n\n /**\n * A button can be rounded, circular, or square.\n *\n * @default 'rounded'\n */\n shape?: 'rounded' | 'circular' | 'square';\n\n /**\n * A button supports different sizes.\n *\n * @default 'medium'\n */\n size?: ButtonSize;\n};\n\nexport type ButtonBaseProps = DistributiveOmit<ButtonProps, 'appearance' | 'size' | 'shape'>;\n\nexport type ButtonState = ComponentState<ButtonSlots> &\n Required<Pick<ButtonProps, 'appearance' | 'disabledFocusable' | 'disabled' | 'iconPosition' | 'shape' | 'size'>> & {\n /**\n * A button can contain only an icon.\n *\n * @default false\n */\n iconOnly: boolean;\n };\n\nexport type ButtonBaseState = DistributiveOmit<ButtonState, 'appearance' | 'size' | 'shape'>;\n"],"names":[],"mappings":"AAmFA,WAA6F"}
1
+ {"version":3,"sources":["../../../src/components/Button/Button.types.ts"],"sourcesContent":["import type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { ComponentProps, ComponentState, DistributiveOmit, Slot } from '@fluentui/react-utilities';\n\nexport type ButtonSlots = {\n /**\n * Root of the component that renders as either a `<button>` tag or an `<a>` tag.\n */\n root: NonNullable<Slot<ARIAButtonSlotProps<'a'>>>;\n\n /**\n * Icon that renders either before or after the `children` as specified by the `iconPosition` prop.\n */\n icon?: Slot<'span'>;\n};\n\n/**\n * A button supports different sizes.\n */\nexport type ButtonSize = 'small' | 'medium' | 'large';\n\nexport type ButtonProps = ComponentProps<ButtonSlots> & {\n /**\n * A button can have its content and borders styled for greater emphasis or to be subtle.\n * - 'secondary' (default): Gives emphasis to the button in such a way that it indicates a secondary action.\n * - 'primary': Emphasizes the button as a primary action.\n * - 'outline': Removes background styling.\n * - 'subtle': Minimizes emphasis to blend into the background until hovered or focused.\n * - 'transparent': Removes background and border styling.\n *\n * @default 'secondary'\n */\n appearance?: 'secondary' | 'primary' | 'outline' | 'subtle' | 'transparent';\n\n /**\n * When set, allows the button to be focusable even when it has been disabled. This is used in scenarios where it\n * is important to keep a consistent tab order for screen reader and keyboard users. The primary example of this\n * pattern is when the disabled button is in a menu or a commandbar and is seldom used for standalone buttons.\n *\n * @default false\n */\n disabledFocusable?: boolean;\n\n /**\n * A button can show that it cannot be interacted with.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * A button can format its icon to appear before or after its content.\n *\n * @default 'before'\n */\n iconPosition?: 'before' | 'after';\n\n /**\n * A button can be rounded, circular, or square.\n *\n * @default 'rounded'\n */\n shape?: 'rounded' | 'circular' | 'square';\n\n /**\n * A button supports different sizes.\n *\n * @default 'medium'\n */\n size?: ButtonSize;\n};\n\nexport type ButtonBaseProps = DistributiveOmit<ButtonProps, 'appearance' | 'size' | 'shape'>;\n\nexport type ButtonState = ComponentState<ButtonSlots> &\n Required<Pick<ButtonProps, 'appearance' | 'disabledFocusable' | 'disabled' | 'iconPosition' | 'shape' | 'size'>> & {\n /**\n * A button can contain only an icon.\n *\n * @default false\n */\n iconOnly: boolean;\n };\n\nexport type ButtonBaseState = DistributiveOmit<ButtonState, 'appearance' | 'size' | 'shape'>;\n"],"names":[],"mappings":"AAmFA,WAA6F"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Button/index.ts"],"sourcesContent":["export { Button } from './Button';\n// Explicit exports to omit ButtonCommons\nexport type { ButtonBaseProps, ButtonProps, ButtonSlots, ButtonBaseState, ButtonState } from './Button.types';\nexport { renderButton_unstable } from './renderButton';\nexport { useButton_unstable, useButtonBase_unstable } from './useButton';\nexport { buttonClassNames, useButtonStyles_unstable } from './useButtonStyles.styles';\n"],"names":["Button","renderButton_unstable","useButton_unstable","useButtonBase_unstable","buttonClassNames","useButtonStyles_unstable"],"mappings":"AAAA,SAASA,MAAM,QAAQ,cAAW;AAGlC,SAASC,qBAAqB,QAAQ,oBAAiB;AACvD,SAASC,kBAAkB,EAAEC,sBAAsB,QAAQ,iBAAc;AACzE,SAASC,gBAAgB,EAAEC,wBAAwB,QAAQ,8BAA2B"}
1
+ {"version":3,"sources":["../../../src/components/Button/index.ts"],"sourcesContent":["export { Button } from './Button';\n// Explicit exports to omit ButtonCommons\nexport type { ButtonBaseProps, ButtonProps, ButtonSlots, ButtonBaseState, ButtonState } from './Button.types';\nexport { renderButton_unstable } from './renderButton';\nexport { useButton_unstable, useButtonBase_unstable } from './useButton';\nexport { buttonClassNames, useButtonStyles_unstable } from './useButtonStyles.styles';\n"],"names":["Button","renderButton_unstable","useButton_unstable","useButtonBase_unstable","buttonClassNames","useButtonStyles_unstable"],"mappings":"AAAA,SAASA,MAAM,QAAQ,cAAW;AAGlC,SAASC,qBAAqB,QAAQ,oBAAiB;AACvD,SAASC,kBAAkB,EAAEC,sBAAsB,QAAQ,iBAAc;AACzE,SAASC,gBAAgB,EAAEC,wBAAwB,QAAQ,8BAA2B"}
@@ -1,5 +1,5 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
- import { assertSlots } from "@fluentui/react-utilities";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
+ import { assertSlots } from "@fluentui/react-utilities";
3
3
  /**
4
4
  * Renders a Button component by passing the state defined props to the appropriate slots.
5
5
  */ export const renderButton_unstable = (state)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Button/renderButton.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\nimport type { ButtonSlots, ButtonBaseState } from './Button.types';\n\n/**\n * Renders a Button component by passing the state defined props to the appropriate slots.\n */\nexport const renderButton_unstable = (state: ButtonBaseState): JSXElement => {\n assertSlots<ButtonSlots>(state);\n const { iconOnly, iconPosition } = state;\n\n return (\n <state.root>\n {iconPosition !== 'after' && state.icon && <state.icon />}\n {!iconOnly && state.root.children}\n {iconPosition === 'after' && state.icon && <state.icon />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderButton_unstable","state","iconOnly","iconPosition","root","icon","children"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAKxD;;CAEC,GACD,OAAO,MAAMC,wBAAwB,CAACC;IACpCF,YAAyBE;IACzB,MAAM,EAAEC,QAAQ,EAAEC,YAAY,EAAE,GAAGF;IAEnC,qBACE,MAACA,MAAMG,IAAI;;YACRD,iBAAiB,WAAWF,MAAMI,IAAI,kBAAI,KAACJ,MAAMI,IAAI;YACrD,CAACH,YAAYD,MAAMG,IAAI,CAACE,QAAQ;YAChCH,iBAAiB,WAAWF,MAAMI,IAAI,kBAAI,KAACJ,MAAMI,IAAI;;;AAG5D,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/Button/renderButton.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\nimport type { ButtonSlots, ButtonBaseState } from './Button.types';\n\n/**\n * Renders a Button component by passing the state defined props to the appropriate slots.\n */\nexport const renderButton_unstable = (state: ButtonBaseState): JSXElement => {\n assertSlots<ButtonSlots>(state);\n const { iconOnly, iconPosition } = state;\n\n return (\n <state.root>\n {iconPosition !== 'after' && state.icon && <state.icon />}\n {!iconOnly && state.root.children}\n {iconPosition === 'after' && state.icon && <state.icon />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderButton_unstable","state","iconOnly","iconPosition","root","icon","children"],"mappings":";AAAA,0BAA0B,GAC1B,iDAAiD,GAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAKxD;;CAEC,GACD,OAAO,MAAMC,wBAAwB,CAACC;IACpCF,YAAyBE;IACzB,MAAM,EAAEC,QAAQ,EAAEC,YAAY,EAAE,GAAGF;IAEnC,qBACE,MAACA,MAAMG,IAAI;;YACRD,iBAAiB,WAAWF,MAAMI,IAAI,kBAAI,KAACJ,MAAMI,IAAI;YACrD,CAACH,YAAYD,MAAMG,IAAI,CAACE,QAAQ;YAChCH,iBAAiB,WAAWF,MAAMI,IAAI,kBAAI,KAACJ,MAAMI,IAAI;;;AAG5D,EAAE"}
@@ -23,11 +23,11 @@ import { slot } from "@fluentui/react-utilities";
23
23
  * @param props - User provided props to the Button component.
24
24
  * @param ref - User provided ref to be passed to the Button component.
25
25
  */ export const useButtonBase_unstable = (props, ref)=>{
26
+ var _props_disabled, _props_disabledFocusable;
26
27
  const { icon, iconPosition = 'before', ...buttonProps } = props;
27
28
  const iconShorthand = slot.optional(icon, {
28
29
  elementType: 'span'
29
30
  });
30
- var _props_disabled, _props_disabledFocusable;
31
31
  return {
32
32
  disabled: (_props_disabled = props.disabled) !== null && _props_disabled !== void 0 ? _props_disabled : false,
33
33
  disabledFocusable: (_props_disabledFocusable = props.disabledFocusable) !== null && _props_disabledFocusable !== void 0 ? _props_disabledFocusable : false,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Button/useButton.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useButtonContext } from '../../contexts/ButtonContext';\nimport type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport { slot } from '@fluentui/react-utilities';\nimport type { ButtonBaseProps, ButtonBaseState, ButtonProps, ButtonState } from './Button.types';\n\n/**\n * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.\n * @param props - User provided props to the Button component.\n * @param ref - User provided ref to be passed to the Button component.\n */\nexport const useButton_unstable = (\n props: ButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ButtonState => {\n const { size: contextSize } = useButtonContext();\n const { appearance = 'secondary', shape = 'rounded', size = contextSize ?? 'medium', ...buttonProps } = props;\n const state = useButtonBase_unstable(buttonProps, ref);\n\n return {\n appearance,\n shape,\n size,\n ...state,\n };\n};\n\n/**\n * Base hook for Button component, which manages state related to slots structure and ARIA attributes.\n *\n * @param props - User provided props to the Button component.\n * @param ref - User provided ref to be passed to the Button component.\n */\nexport const useButtonBase_unstable = (\n props: ButtonBaseProps,\n ref?: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ButtonBaseState => {\n const { icon, iconPosition = 'before', ...buttonProps } = props;\n const iconShorthand = slot.optional(icon, { elementType: 'span' });\n\n return {\n disabled: props.disabled ?? false,\n disabledFocusable: props.disabledFocusable ?? false,\n iconPosition,\n iconOnly: Boolean(iconShorthand?.children && !props.children),\n components: { root: 'button', icon: 'span' },\n root: slot.always<ARIAButtonSlotProps<'a'>>(useARIAButtonProps(buttonProps.as, buttonProps), {\n elementType: 'button',\n defaultProps: {\n ref: ref as React.Ref<HTMLButtonElement & HTMLAnchorElement>,\n type: props.as !== 'a' ? 'button' : undefined,\n },\n }),\n icon: iconShorthand,\n };\n};\n"],"names":["useButtonContext","useARIAButtonProps","slot","useButton_unstable","props","ref","size","contextSize","appearance","shape","buttonProps","state","useButtonBase_unstable","icon","iconPosition","iconShorthand","optional","elementType","disabled","disabledFocusable","iconOnly","Boolean","children","components","root","always","as","defaultProps","type","undefined"],"mappings":"AAAA;AAGA,SAASA,gBAAgB,QAAQ,kCAA+B;AAEhE,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,IAAI,QAAQ,4BAA4B;AAGjD;;;;CAIC,GACD,OAAO,MAAMC,qBAAqB,CAChCC,OACAC;IAEA,MAAM,EAAEC,MAAMC,WAAW,EAAE,GAAGP;IAC9B,MAAM,EAAEQ,aAAa,WAAW,EAAEC,QAAQ,SAAS,EAAEH,OAAOC,wBAAAA,yBAAAA,cAAe,QAAQ,EAAE,GAAGG,aAAa,GAAGN;IACxG,MAAMO,QAAQC,uBAAuBF,aAAaL;IAElD,OAAO;QACLG;QACAC;QACAH;QACA,GAAGK,KAAK;IACV;AACF,EAAE;AAEF;;;;;CAKC,GACD,OAAO,MAAMC,yBAAyB,CACpCR,OACAC;IAEA,MAAM,EAAEQ,IAAI,EAAEC,eAAe,QAAQ,EAAE,GAAGJ,aAAa,GAAGN;IAC1D,MAAMW,gBAAgBb,KAAKc,QAAQ,CAACH,MAAM;QAAEI,aAAa;IAAO;QAGpDb,iBACSA;IAFrB,OAAO;QACLc,UAAUd,CAAAA,kBAAAA,MAAMc,QAAQ,cAAdd,6BAAAA,kBAAkB;QAC5Be,mBAAmBf,CAAAA,2BAAAA,MAAMe,iBAAiB,cAAvBf,sCAAAA,2BAA2B;QAC9CU;QACAM,UAAUC,QAAQN,CAAAA,0BAAAA,oCAAAA,cAAeO,QAAQ,KAAI,CAAClB,MAAMkB,QAAQ;QAC5DC,YAAY;YAAEC,MAAM;YAAUX,MAAM;QAAO;QAC3CW,MAAMtB,KAAKuB,MAAM,CAA2BxB,mBAAmBS,YAAYgB,EAAE,EAAEhB,cAAc;YAC3FO,aAAa;YACbU,cAAc;gBACZtB,KAAKA;gBACLuB,MAAMxB,MAAMsB,EAAE,KAAK,MAAM,WAAWG;YACtC;QACF;QACAhB,MAAME;IACR;AACF,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/Button/useButton.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useButtonContext } from '../../contexts/ButtonContext';\nimport type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\nimport { slot } from '@fluentui/react-utilities';\nimport type { ButtonBaseProps, ButtonBaseState, ButtonProps, ButtonState } from './Button.types';\n\n/**\n * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.\n * @param props - User provided props to the Button component.\n * @param ref - User provided ref to be passed to the Button component.\n */\nexport const useButton_unstable = (\n props: ButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ButtonState => {\n const { size: contextSize } = useButtonContext();\n const { appearance = 'secondary', shape = 'rounded', size = contextSize ?? 'medium', ...buttonProps } = props;\n const state = useButtonBase_unstable(buttonProps, ref);\n\n return {\n appearance,\n shape,\n size,\n ...state,\n };\n};\n\n/**\n * Base hook for Button component, which manages state related to slots structure and ARIA attributes.\n *\n * @param props - User provided props to the Button component.\n * @param ref - User provided ref to be passed to the Button component.\n */\nexport const useButtonBase_unstable = (\n props: ButtonBaseProps,\n ref?: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ButtonBaseState => {\n const { icon, iconPosition = 'before', ...buttonProps } = props;\n const iconShorthand = slot.optional(icon, { elementType: 'span' });\n\n return {\n disabled: props.disabled ?? false,\n disabledFocusable: props.disabledFocusable ?? false,\n iconPosition,\n iconOnly: Boolean(iconShorthand?.children && !props.children),\n components: { root: 'button', icon: 'span' },\n root: slot.always<ARIAButtonSlotProps<'a'>>(useARIAButtonProps(buttonProps.as, buttonProps), {\n elementType: 'button',\n defaultProps: {\n ref: ref as React.Ref<HTMLButtonElement & HTMLAnchorElement>,\n type: props.as !== 'a' ? 'button' : undefined,\n },\n }),\n icon: iconShorthand,\n };\n};\n"],"names":["useButtonContext","useARIAButtonProps","slot","useButton_unstable","props","ref","size","contextSize","appearance","shape","buttonProps","state","useButtonBase_unstable","icon","iconPosition","iconShorthand","optional","elementType","disabled","disabledFocusable","iconOnly","Boolean","children","components","root","always","as","defaultProps","type","undefined"],"mappings":"AAAA;AAGA,SAASA,gBAAgB,QAAQ,kCAA+B;AAEhE,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,IAAI,QAAQ,4BAA4B;AAGjD;;;;CAIC,GACD,OAAO,MAAMC,qBAAqB,CAChCC,OACAC;IAEA,MAAM,EAAEC,MAAMC,WAAW,EAAE,GAAGP;IAC9B,MAAM,EAAEQ,aAAa,WAAW,EAAEC,QAAQ,SAAS,EAAEH,OAAOC,wBAAAA,yBAAAA,cAAe,QAAQ,EAAE,GAAGG,aAAa,GAAGN;IACxG,MAAMO,QAAQC,uBAAuBF,aAAaL;IAElD,OAAO;QACLG;QACAC;QACAH;QACA,GAAGK,KAAK;IACV;AACF,EAAE;AAEF;;;;;CAKC,GACD,OAAO,MAAMC,yBAAyB,CACpCR,OACAC;QAMYD,iBACSA;IALrB,MAAM,EAAES,IAAI,EAAEC,eAAe,QAAQ,EAAE,GAAGJ,aAAa,GAAGN;IAC1D,MAAMW,gBAAgBb,KAAKc,QAAQ,CAACH,MAAM;QAAEI,aAAa;IAAO;IAEhE,OAAO;QACLC,QAAQ,GAAEd,kBAAAA,MAAMc,QAAQ,cAAdd,6BAAAA,kBAAkB;QAC5Be,iBAAiB,GAAEf,2BAAAA,MAAMe,iBAAiB,cAAvBf,sCAAAA,2BAA2B;QAC9CU;QACAM,UAAUC,QAAQN,CAAAA,0BAAAA,oCAAAA,cAAeO,QAAQ,KAAI,CAAClB,MAAMkB,QAAQ;QAC5DC,YAAY;YAAEC,MAAM;YAAUX,MAAM;QAAO;QAC3CW,MAAMtB,KAAKuB,MAAM,CAA2BxB,mBAAmBS,YAAYgB,EAAE,EAAEhB,cAAc;YAC3FO,aAAa;YACbU,cAAc;gBACZtB,KAAKA;gBACLuB,MAAMxB,MAAMsB,EAAE,KAAK,MAAM,WAAWG;YACtC;QACF;QACAhB,MAAME;IACR;AACF,EAAE"}
@@ -0,0 +1,14 @@
1
+ import { clsx } from "clsx";
2
+ import styles from "./Button.module.css";
3
+ export const buttonClassNames = {
4
+ root: 'fui-Button',
5
+ icon: 'fui-Button__icon'
6
+ };
7
+ export const useButtonStyles_unstable = (state)=>{
8
+ const { appearance, disabled, disabledFocusable, icon, iconOnly, iconPosition, shape, size } = state;
9
+ state.root.className = clsx(buttonClassNames.root, styles.root, styles[appearance], styles[size], styles[shape], icon && styles.withIcon, (disabled || disabledFocusable) && styles.disabled, iconOnly && styles.iconOnly, state.root.className);
10
+ if (state.icon) {
11
+ state.icon.className = clsx(buttonClassNames.icon, styles.icon, !!state.root.children && styles[iconPosition], state.icon.className);
12
+ }
13
+ return state;
14
+ };
@@ -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":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAE5B,OAAOC,YAAY,sBAAsB;AAGzC,OAAO,MAAMC,mBAAgD;IAC3DC,MAAM;IACNC,MAAM;AACR,EAAE;AAEF,OAAO,MAAMC,2BAA2B,CAACC;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,GAAGd,KACrBE,iBAAiBC,IAAI,EACrBF,OAAOE,IAAI,EACXF,MAAM,CAACM,WAAW,EAClBN,MAAM,CAACY,KAAK,EACZZ,MAAM,CAACW,MAAM,EACbR,QAAQH,OAAOc,QAAQ,EACvB,AAACP,CAAAA,YAAYC,iBAAgB,KAAMR,OAAOO,QAAQ,EAClDE,YAAYT,OAAOS,QAAQ,EAC3BJ,MAAMH,IAAI,CAACW,SAAS;IAGtB,IAAIR,MAAMF,IAAI,EAAE;QACdE,MAAMF,IAAI,CAACU,SAAS,GAAGd,KACrBE,iBAAiBE,IAAI,EACrBH,OAAOG,IAAI,EACX,CAAC,CAACE,MAAMH,IAAI,CAACa,QAAQ,IAAIf,MAAM,CAACU,aAAa,EAC7CL,MAAMF,IAAI,CAACU,SAAS;IAExB;IAEA,OAAOR;AACT,EAAE"}
@@ -0,0 +1,14 @@
1
+ import { clsx } from "clsx";
2
+ import styles from "./Button.module.css";
3
+ export const buttonClassNames = {
4
+ root: 'fui-Button',
5
+ icon: 'fui-Button__icon'
6
+ };
7
+ export const useButtonStyles_unstable = (state)=>{
8
+ const { appearance, disabled, disabledFocusable, icon, iconOnly, iconPosition, shape, size } = state;
9
+ state.root.className = clsx(buttonClassNames.root, styles.root, styles[appearance], styles[size], styles[shape], icon && styles.withIcon, (disabled || disabledFocusable) && styles.disabled, iconOnly && styles.iconOnly, state.root.className);
10
+ if (state.icon) {
11
+ state.icon.className = clsx(buttonClassNames.icon, styles.icon, !!state.root.children && styles[iconPosition], state.icon.className);
12
+ }
13
+ return state;
14
+ };
@@ -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":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAE5B,OAAOC,YAAY,sBAAsB;AAGzC,OAAO,MAAMC,mBAAgD;IAC3DC,MAAM;IACNC,MAAM;AACR,EAAE;AAEF,OAAO,MAAMC,2BAA2B,CAACC;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,GAAGd,KACrBE,iBAAiBC,IAAI,EACrBF,OAAOE,IAAI,EACXF,MAAM,CAACM,WAAW,EAClBN,MAAM,CAACY,KAAK,EACZZ,MAAM,CAACW,MAAM,EACbR,QAAQH,OAAOc,QAAQ,EACvB,AAACP,CAAAA,YAAYC,iBAAgB,KAAMR,OAAOO,QAAQ,EAClDE,YAAYT,OAAOS,QAAQ,EAC3BJ,MAAMH,IAAI,CAACW,SAAS;IAGtB,IAAIR,MAAMF,IAAI,EAAE;QACdE,MAAMF,IAAI,CAACU,SAAS,GAAGd,KACrBE,iBAAiBE,IAAI,EACrBH,OAAOG,IAAI,EACX,CAAC,CAACE,MAAMH,IAAI,CAACa,QAAQ,IAAIf,MAAM,CAACU,aAAa,EAC7CL,MAAMF,IAAI,CAACU,SAAS;IAExB;IAEA,OAAOR;AACT,EAAE"}