@fluentui/react-swatch-picker 9.74.7-experimental.cli-api.20261006-ccaa611d58.0 → 9.75.0-experimental.css-modules.20261031-810ab07afb.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 (170) hide show
  1. package/CHANGELOG.md +40 -12
  2. package/lib/components/ColorSwatch/ColorSwatch.constants.js.map +1 -1
  3. package/lib/components/ColorSwatch/ColorSwatch.js.map +1 -1
  4. package/lib/components/ColorSwatch/ColorSwatch.module.css +169 -0
  5. package/lib/components/ColorSwatch/ColorSwatch.types.js.map +1 -1
  6. package/lib/components/ColorSwatch/index.js.map +1 -1
  7. package/lib/components/ColorSwatch/renderColorSwatch.js +2 -2
  8. package/lib/components/ColorSwatch/renderColorSwatch.js.map +1 -1
  9. package/lib/components/ColorSwatch/useColorSwatch.js.map +1 -1
  10. package/lib/components/ColorSwatch/useColorSwatchStyles.styles.css.js +18 -0
  11. package/lib/components/ColorSwatch/useColorSwatchStyles.styles.css.js.map +1 -0
  12. package/lib/components/ColorSwatch/useColorSwatchStyles.styles.raw.css.js +18 -0
  13. package/lib/components/ColorSwatch/useColorSwatchStyles.styles.raw.css.js.map +1 -0
  14. package/lib/components/ColorSwatch/useColorSwatchStyles.styles.raw.js.map +1 -1
  15. package/lib/components/EmptySwatch/EmptySwatch.js.map +1 -1
  16. package/lib/components/EmptySwatch/EmptySwatch.module.css +40 -0
  17. package/lib/components/EmptySwatch/EmptySwatch.types.js.map +1 -1
  18. package/lib/components/EmptySwatch/index.js.map +1 -1
  19. package/lib/components/EmptySwatch/renderEmptySwatch.js +2 -2
  20. package/lib/components/EmptySwatch/renderEmptySwatch.js.map +1 -1
  21. package/lib/components/EmptySwatch/useEmptySwatch.js +1 -0
  22. package/lib/components/EmptySwatch/useEmptySwatch.js.map +1 -1
  23. package/lib/components/EmptySwatch/useEmptySwatchStyles.styles.css.js +10 -0
  24. package/lib/components/EmptySwatch/useEmptySwatchStyles.styles.css.js.map +1 -0
  25. package/lib/components/EmptySwatch/useEmptySwatchStyles.styles.js +1 -2
  26. package/lib/components/EmptySwatch/useEmptySwatchStyles.styles.js.map +1 -1
  27. package/lib/components/EmptySwatch/useEmptySwatchStyles.styles.raw.css.js +10 -0
  28. package/lib/components/EmptySwatch/useEmptySwatchStyles.styles.raw.css.js.map +1 -0
  29. package/lib/components/EmptySwatch/useEmptySwatchStyles.styles.raw.js +1 -2
  30. package/lib/components/EmptySwatch/useEmptySwatchStyles.styles.raw.js.map +1 -1
  31. package/lib/components/ImageSwatch/ImageSwatch.js.map +1 -1
  32. package/lib/components/ImageSwatch/ImageSwatch.module.css +101 -0
  33. package/lib/components/ImageSwatch/ImageSwatch.types.js.map +1 -1
  34. package/lib/components/ImageSwatch/index.js.map +1 -1
  35. package/lib/components/ImageSwatch/renderImageSwatch.js +2 -2
  36. package/lib/components/ImageSwatch/renderImageSwatch.js.map +1 -1
  37. package/lib/components/ImageSwatch/useImageSwatch.js +1 -0
  38. package/lib/components/ImageSwatch/useImageSwatch.js.map +1 -1
  39. package/lib/components/ImageSwatch/useImageSwatchStyles.styles.css.js +10 -0
  40. package/lib/components/ImageSwatch/useImageSwatchStyles.styles.css.js.map +1 -0
  41. package/lib/components/ImageSwatch/useImageSwatchStyles.styles.raw.css.js +10 -0
  42. package/lib/components/ImageSwatch/useImageSwatchStyles.styles.raw.css.js.map +1 -0
  43. package/lib/components/ImageSwatch/useImageSwatchStyles.styles.raw.js.map +1 -1
  44. package/lib/components/SwatchPicker/SwatchPicker.js.map +1 -1
  45. package/lib/components/SwatchPicker/SwatchPicker.module.css +18 -0
  46. package/lib/components/SwatchPicker/SwatchPicker.types.js.map +1 -1
  47. package/lib/components/SwatchPicker/index.js.map +1 -1
  48. package/lib/components/SwatchPicker/renderSwatchPicker.js +2 -2
  49. package/lib/components/SwatchPicker/renderSwatchPicker.js.map +1 -1
  50. package/lib/components/SwatchPicker/useSwatchPicker.js +1 -1
  51. package/lib/components/SwatchPicker/useSwatchPicker.js.map +1 -1
  52. package/lib/components/SwatchPicker/useSwatchPickerContextValues.js.map +1 -1
  53. package/lib/components/SwatchPicker/useSwatchPickerStyles.styles.css.js +9 -0
  54. package/lib/components/SwatchPicker/useSwatchPickerStyles.styles.css.js.map +1 -0
  55. package/lib/components/SwatchPicker/useSwatchPickerStyles.styles.raw.css.js +9 -0
  56. package/lib/components/SwatchPicker/useSwatchPickerStyles.styles.raw.css.js.map +1 -0
  57. package/lib/components/SwatchPicker/useSwatchPickerStyles.styles.raw.js.map +1 -1
  58. package/lib/components/SwatchPickerRow/SwatchPickerRow.js.map +1 -1
  59. package/lib/components/SwatchPickerRow/SwatchPickerRow.module.css +12 -0
  60. package/lib/components/SwatchPickerRow/SwatchPickerRow.types.js.map +1 -1
  61. package/lib/components/SwatchPickerRow/index.js.map +1 -1
  62. package/lib/components/SwatchPickerRow/renderSwatchPickerRow.js +2 -2
  63. package/lib/components/SwatchPickerRow/renderSwatchPickerRow.js.map +1 -1
  64. package/lib/components/SwatchPickerRow/useSwatchPickerRow.js +1 -2
  65. package/lib/components/SwatchPickerRow/useSwatchPickerRow.js.map +1 -1
  66. package/lib/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.css.js +9 -0
  67. package/lib/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.css.js.map +1 -0
  68. package/lib/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.raw.css.js +9 -0
  69. package/lib/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.raw.css.js.map +1 -0
  70. package/lib/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.raw.js.map +1 -1
  71. package/lib/contexts/index.js.map +1 -1
  72. package/lib/contexts/swatchPicker.js.map +1 -1
  73. package/lib/utils/renderUtils.js.map +1 -1
  74. package/lib-commonjs/ColorSwatch.cjs +8 -8
  75. package/lib-commonjs/EmptySwatch.cjs +7 -7
  76. package/lib-commonjs/ImageSwatch.cjs +7 -7
  77. package/lib-commonjs/SwatchPicker.cjs +7 -7
  78. package/lib-commonjs/SwatchPickerRow.cjs +7 -7
  79. package/lib-commonjs/components/ColorSwatch/ColorSwatch.cjs.map +1 -1
  80. package/lib-commonjs/components/ColorSwatch/ColorSwatch.constants.cjs.map +1 -1
  81. package/lib-commonjs/components/ColorSwatch/ColorSwatch.module.css +169 -0
  82. package/lib-commonjs/components/ColorSwatch/ColorSwatch.types.cjs.map +1 -1
  83. package/lib-commonjs/components/ColorSwatch/index.cjs +8 -8
  84. package/lib-commonjs/components/ColorSwatch/index.cjs.map +1 -1
  85. package/lib-commonjs/components/ColorSwatch/renderColorSwatch.cjs.map +1 -1
  86. package/lib-commonjs/components/ColorSwatch/useColorSwatch.cjs +3 -3
  87. package/lib-commonjs/components/ColorSwatch/useColorSwatch.cjs.map +1 -1
  88. package/lib-commonjs/components/ColorSwatch/useColorSwatchStyles.styles.cjs +3 -3
  89. package/lib-commonjs/components/ColorSwatch/useColorSwatchStyles.styles.cjs.map +1 -1
  90. package/lib-commonjs/components/ColorSwatch/useColorSwatchStyles.styles.css.cjs +37 -0
  91. package/lib-commonjs/components/ColorSwatch/useColorSwatchStyles.styles.css.cjs.map +1 -0
  92. package/lib-commonjs/components/ColorSwatch/useColorSwatchStyles.styles.raw.cjs +3 -3
  93. package/lib-commonjs/components/ColorSwatch/useColorSwatchStyles.styles.raw.cjs.map +1 -1
  94. package/lib-commonjs/components/ColorSwatch/useColorSwatchStyles.styles.raw.css.cjs +37 -0
  95. package/lib-commonjs/components/ColorSwatch/useColorSwatchStyles.styles.raw.css.cjs.map +1 -0
  96. package/lib-commonjs/components/EmptySwatch/EmptySwatch.cjs.map +1 -1
  97. package/lib-commonjs/components/EmptySwatch/EmptySwatch.module.css +40 -0
  98. package/lib-commonjs/components/EmptySwatch/EmptySwatch.types.cjs.map +1 -1
  99. package/lib-commonjs/components/EmptySwatch/index.cjs +7 -7
  100. package/lib-commonjs/components/EmptySwatch/index.cjs.map +1 -1
  101. package/lib-commonjs/components/EmptySwatch/renderEmptySwatch.cjs.map +1 -1
  102. package/lib-commonjs/components/EmptySwatch/useEmptySwatch.cjs +4 -3
  103. package/lib-commonjs/components/EmptySwatch/useEmptySwatch.cjs.map +1 -1
  104. package/lib-commonjs/components/EmptySwatch/useEmptySwatchStyles.styles.cjs +4 -5
  105. package/lib-commonjs/components/EmptySwatch/useEmptySwatchStyles.styles.cjs.map +1 -1
  106. package/lib-commonjs/components/EmptySwatch/useEmptySwatchStyles.styles.css.cjs +29 -0
  107. package/lib-commonjs/components/EmptySwatch/useEmptySwatchStyles.styles.css.cjs.map +1 -0
  108. package/lib-commonjs/components/EmptySwatch/useEmptySwatchStyles.styles.raw.cjs +4 -5
  109. package/lib-commonjs/components/EmptySwatch/useEmptySwatchStyles.styles.raw.cjs.map +1 -1
  110. package/lib-commonjs/components/EmptySwatch/useEmptySwatchStyles.styles.raw.css.cjs +29 -0
  111. package/lib-commonjs/components/EmptySwatch/useEmptySwatchStyles.styles.raw.css.cjs.map +1 -0
  112. package/lib-commonjs/components/ImageSwatch/ImageSwatch.cjs.map +1 -1
  113. package/lib-commonjs/components/ImageSwatch/ImageSwatch.module.css +101 -0
  114. package/lib-commonjs/components/ImageSwatch/ImageSwatch.types.cjs.map +1 -1
  115. package/lib-commonjs/components/ImageSwatch/index.cjs +7 -7
  116. package/lib-commonjs/components/ImageSwatch/index.cjs.map +1 -1
  117. package/lib-commonjs/components/ImageSwatch/renderImageSwatch.cjs.map +1 -1
  118. package/lib-commonjs/components/ImageSwatch/useImageSwatch.cjs +4 -3
  119. package/lib-commonjs/components/ImageSwatch/useImageSwatch.cjs.map +1 -1
  120. package/lib-commonjs/components/ImageSwatch/useImageSwatchStyles.styles.cjs +3 -3
  121. package/lib-commonjs/components/ImageSwatch/useImageSwatchStyles.styles.cjs.map +1 -1
  122. package/lib-commonjs/components/ImageSwatch/useImageSwatchStyles.styles.css.cjs +29 -0
  123. package/lib-commonjs/components/ImageSwatch/useImageSwatchStyles.styles.css.cjs.map +1 -0
  124. package/lib-commonjs/components/ImageSwatch/useImageSwatchStyles.styles.raw.cjs +3 -3
  125. package/lib-commonjs/components/ImageSwatch/useImageSwatchStyles.styles.raw.cjs.map +1 -1
  126. package/lib-commonjs/components/ImageSwatch/useImageSwatchStyles.styles.raw.css.cjs +29 -0
  127. package/lib-commonjs/components/ImageSwatch/useImageSwatchStyles.styles.raw.css.cjs.map +1 -0
  128. package/lib-commonjs/components/SwatchPicker/SwatchPicker.cjs.map +1 -1
  129. package/lib-commonjs/components/SwatchPicker/SwatchPicker.module.css +18 -0
  130. package/lib-commonjs/components/SwatchPicker/SwatchPicker.types.cjs.map +1 -1
  131. package/lib-commonjs/components/SwatchPicker/index.cjs +7 -7
  132. package/lib-commonjs/components/SwatchPicker/index.cjs.map +1 -1
  133. package/lib-commonjs/components/SwatchPicker/renderSwatchPicker.cjs.map +1 -1
  134. package/lib-commonjs/components/SwatchPicker/useSwatchPicker.cjs +4 -4
  135. package/lib-commonjs/components/SwatchPicker/useSwatchPicker.cjs.map +1 -1
  136. package/lib-commonjs/components/SwatchPicker/useSwatchPickerContextValues.cjs.map +1 -1
  137. package/lib-commonjs/components/SwatchPicker/useSwatchPickerStyles.styles.cjs +3 -3
  138. package/lib-commonjs/components/SwatchPicker/useSwatchPickerStyles.styles.cjs.map +1 -1
  139. package/lib-commonjs/components/SwatchPicker/useSwatchPickerStyles.styles.css.cjs +28 -0
  140. package/lib-commonjs/components/SwatchPicker/useSwatchPickerStyles.styles.css.cjs.map +1 -0
  141. package/lib-commonjs/components/SwatchPicker/useSwatchPickerStyles.styles.raw.cjs +3 -3
  142. package/lib-commonjs/components/SwatchPicker/useSwatchPickerStyles.styles.raw.cjs.map +1 -1
  143. package/lib-commonjs/components/SwatchPicker/useSwatchPickerStyles.styles.raw.css.cjs +28 -0
  144. package/lib-commonjs/components/SwatchPicker/useSwatchPickerStyles.styles.raw.css.cjs.map +1 -0
  145. package/lib-commonjs/components/SwatchPickerRow/SwatchPickerRow.cjs.map +1 -1
  146. package/lib-commonjs/components/SwatchPickerRow/SwatchPickerRow.module.css +12 -0
  147. package/lib-commonjs/components/SwatchPickerRow/SwatchPickerRow.types.cjs.map +1 -1
  148. package/lib-commonjs/components/SwatchPickerRow/index.cjs +7 -7
  149. package/lib-commonjs/components/SwatchPickerRow/index.cjs.map +1 -1
  150. package/lib-commonjs/components/SwatchPickerRow/renderSwatchPickerRow.cjs.map +1 -1
  151. package/lib-commonjs/components/SwatchPickerRow/useSwatchPickerRow.cjs +4 -5
  152. package/lib-commonjs/components/SwatchPickerRow/useSwatchPickerRow.cjs.map +1 -1
  153. package/lib-commonjs/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.cjs +3 -3
  154. package/lib-commonjs/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.cjs.map +1 -1
  155. package/lib-commonjs/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.css.cjs +28 -0
  156. package/lib-commonjs/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.css.cjs.map +1 -0
  157. package/lib-commonjs/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.raw.cjs +3 -3
  158. package/lib-commonjs/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.raw.cjs.map +1 -1
  159. package/lib-commonjs/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.raw.css.cjs +28 -0
  160. package/lib-commonjs/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.raw.css.cjs.map +1 -0
  161. package/lib-commonjs/contexts/index.cjs +5 -5
  162. package/lib-commonjs/contexts/index.cjs.map +1 -1
  163. package/lib-commonjs/contexts/swatchPicker.cjs +4 -4
  164. package/lib-commonjs/contexts/swatchPicker.cjs.map +1 -1
  165. package/lib-commonjs/index.cjs +37 -37
  166. package/lib-commonjs/index.cjs.map +1 -1
  167. package/lib-commonjs/utils/renderUtils.cjs.map +1 -1
  168. package/package.json +15 -15
  169. package/dist/metadata/api/api-root.json +0 -1
  170. package/dist/metadata/index.json +0 -1
package/CHANGELOG.md CHANGED
@@ -1,24 +1,52 @@
1
1
  # Change Log - @fluentui/react-swatch-picker
2
2
 
3
- <!-- This log was last generated on Tue, 06 Oct 2026 11:40:33 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Sat, 31 Oct 2026 11:08:56 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [9.74.7-experimental.cli-api.20261006-ccaa611d58.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-swatch-picker_v9.74.7-experimental.cli-api.20261006-ccaa611d58.0)
7
+ ## [9.75.0-experimental.css-modules.20261031-810ab07afb.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-swatch-picker_v9.75.0-experimental.css-modules.20261031-810ab07afb.0)
8
8
 
9
- Tue, 06 Oct 2026 11:40:33 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-swatch-picker_v9.6.1..@fluentui/react-swatch-picker_v9.74.7-experimental.cli-api.20261006-ccaa611d58.0)
9
+ Sat, 31 Oct 2026 11:08:56 GMT
11
10
 
12
11
  ### Changes
13
12
 
14
- - Release 9.74.7-experimental.cli-api.20261006-ccaa611d58 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
15
- - Bump @fluentui/react-context-selector to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
16
- - Bump @fluentui/react-field to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
17
- - Bump @fluentui/react-jsx-runtime to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
18
- - Bump @fluentui/react-shared-contexts to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
19
- - Bump @fluentui/react-tabster to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
20
- - Bump @fluentui/react-theme to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
21
- - Bump @fluentui/react-utilities to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
13
+ - Release 9.75.0-experimental.css-modules.20261031-810ab07afb ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
14
+ - Bump @fluentui/react-context-selector to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
15
+ - Bump @fluentui/react-field to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
16
+ - Bump @fluentui/react-jsx-runtime to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
17
+ - Bump @fluentui/react-shared-contexts to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
18
+ - Bump @fluentui/react-tabster to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
19
+ - Bump @fluentui/react-theme to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
20
+ - Bump @fluentui/react-utilities to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
21
+
22
+ ## [9.6.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-swatch-picker_v9.6.3)
23
+
24
+ Mon, 19 Oct 2026 16:49:01 GMT
25
+
26
+ ### Patches
27
+
28
+ - fix: forward the style prop to the SwatchPicker and SwatchPickerRow roots ([PR #36847](https://github.com/microsoft/fluentui/pull/36847) by vgenaev@gmail.com)
29
+ - fix: prevent ImageSwatch and EmptySwatch from submitting forms ([PR #36822](https://github.com/microsoft/fluentui/pull/36822) by vgenaev@gmail.com)
30
+ - Bump @fluentui/react-context-selector to v9.2.21 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
31
+ - Bump @fluentui/react-field to v9.5.6 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
32
+ - Bump @fluentui/react-jsx-runtime to v9.4.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
33
+ - Bump @fluentui/react-tabster to v9.26.19 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
34
+ - Bump @fluentui/react-utilities to v9.27.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
35
+
36
+ ## [9.6.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-swatch-picker_v9.6.2)
37
+
38
+ Tue, 22 Sep 2026 11:25:39 GMT
39
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-swatch-picker_v9.6.1..@fluentui/react-swatch-picker_v9.6.2)
40
+
41
+ ### Patches
42
+
43
+ - fix: remove unused react-dom and @types/react-dom peer dependencies, mark @types/react as optional ([PR #36559](https://github.com/microsoft/fluentui/pull/36559) by martinhochel@microsoft.com)
44
+ - Bump @fluentui/react-context-selector to v9.2.20 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
45
+ - Bump @fluentui/react-field to v9.5.5 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
46
+ - Bump @fluentui/react-jsx-runtime to v9.4.6 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
47
+ - Bump @fluentui/react-shared-contexts to v9.26.4 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
48
+ - Bump @fluentui/react-tabster to v9.26.18 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
49
+ - Bump @fluentui/react-utilities to v9.26.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
22
50
 
23
51
  ## [9.6.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-swatch-picker_v9.6.1)
24
52
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ColorSwatch/ColorSwatch.constants.ts"],"sourcesContent":["export const swatchCSSVars = {\n color: `--fui-SwatchPicker--color`,\n borderColor: `--fui-SwatchPicker--borderColor`,\n};\n"],"names":["swatchCSSVars","color","borderColor"],"mappings":"AAAA,OAAO,MAAMA,gBAAgB;IAC3BC,OAAO,CAAC,yBAAyB,CAAC;IAClCC,aAAa,CAAC,+BAA+B,CAAC;AAChD,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/ColorSwatch/ColorSwatch.constants.ts"],"sourcesContent":["export const swatchCSSVars = {\n color: `--fui-SwatchPicker--color`,\n borderColor: `--fui-SwatchPicker--borderColor`,\n};\n"],"names":["swatchCSSVars","color","borderColor"],"mappings":"AAAA,OAAO,MAAMA,gBAAgB;IAC3BC,OAAO,CAAC,yBAAyB,CAAC;IAClCC,aAAa,CAAC,+BAA+B,CAAC;AAChD,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ColorSwatch/ColorSwatch.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useColorSwatch_unstable } from './useColorSwatch';\nimport { renderColorSwatch_unstable } from './renderColorSwatch';\nimport { useColorSwatchStyles_unstable } from './useColorSwatchStyles.styles';\nimport type { ColorSwatchProps } from './ColorSwatch.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * ColorSwatch component is used to render a colors, icons and gradients.\n */\nexport const ColorSwatch: ForwardRefComponent<ColorSwatchProps> = React.forwardRef((props, ref) => {\n const state = useColorSwatch_unstable(props, ref);\n\n useColorSwatchStyles_unstable(state);\n useCustomStyleHook_unstable('useColorSwatchStyles_unstable')(state);\n\n return renderColorSwatch_unstable(state);\n});\n\nColorSwatch.displayName = 'ColorSwatch';\n"],"names":["React","useColorSwatch_unstable","renderColorSwatch_unstable","useColorSwatchStyles_unstable","useCustomStyleHook_unstable","ColorSwatch","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,uBAAuB,QAAQ,sBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,6BAA6B,QAAQ,mCAAgC;AAE9E,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,4BAAqDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACzF,MAAMC,QAAQR,wBAAwBM,OAAOC;IAE7CL,8BAA8BM;IAC9BL,4BAA4B,iCAAiCK;IAE7D,OAAOP,2BAA2BO;AACpC,GAAG;AAEHJ,YAAYK,WAAW,GAAG"}
1
+ {"version":3,"sources":["../../../src/components/ColorSwatch/ColorSwatch.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useColorSwatch_unstable } from './useColorSwatch';\nimport { renderColorSwatch_unstable } from './renderColorSwatch';\nimport { useColorSwatchStyles_unstable } from './useColorSwatchStyles.styles';\nimport type { ColorSwatchProps } from './ColorSwatch.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * ColorSwatch component is used to render a colors, icons and gradients.\n */\nexport const ColorSwatch: ForwardRefComponent<ColorSwatchProps> = React.forwardRef((props, ref) => {\n const state = useColorSwatch_unstable(props, ref);\n\n useColorSwatchStyles_unstable(state);\n useCustomStyleHook_unstable('useColorSwatchStyles_unstable')(state);\n\n return renderColorSwatch_unstable(state);\n});\n\nColorSwatch.displayName = 'ColorSwatch';\n"],"names":["React","useColorSwatch_unstable","renderColorSwatch_unstable","useColorSwatchStyles_unstable","useCustomStyleHook_unstable","ColorSwatch","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,uBAAuB,QAAQ,sBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,6BAA6B,QAAQ,mCAAgC;AAE9E,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,4BAAqDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACzF,MAAMC,QAAQR,wBAAwBM,OAAOC;IAE7CL,8BAA8BM;IAC9BL,4BAA4B,iCAAiCK;IAE7D,OAAOP,2BAA2BO;AACpC,GAAG;AAEHJ,YAAYK,WAAW,GAAG"}
@@ -0,0 +1,169 @@
1
+ @layer fluentui {
2
+ .root {
3
+ display: inline-flex;
4
+ flex-shrink: 0;
5
+ align-items: center;
6
+ justify-content: center;
7
+ box-sizing: border-box;
8
+ border: var(--strokeWidthThin) solid var(--fui-SwatchPicker--borderColor, var(--colorTransparentStroke));
9
+ background: var(--fui-SwatchPicker--color);
10
+ overflow: hidden;
11
+ padding: 0;
12
+ &:hover {
13
+ cursor: pointer;
14
+ border: none;
15
+ box-shadow: inset 0 0 0 var(--strokeWidthThick) var(--colorBrandStroke1),
16
+ inset 0 0 0 var(--strokeWidthThicker) var(--colorStrokeFocus1);
17
+ }
18
+ &:hover:active {
19
+ border: none;
20
+ box-shadow: inset 0 0 0 var(--strokeWidthThicker) var(--colorCompoundBrandStrokePressed),
21
+ inset 0 0 0 var(--strokeWidthThickest) var(--colorStrokeFocus1);
22
+ }
23
+ &:focus {
24
+ outline: none;
25
+ }
26
+ &:focus-visible {
27
+ outline: none;
28
+ }
29
+ &[data-fui-focus-visible] {
30
+ border: none;
31
+ outline: none;
32
+ box-shadow: inset 0 0 0 var(--strokeWidthThick) var(--colorStrokeFocus2),
33
+ inset 0 0 0 var(--strokeWidthThicker) var(--colorStrokeFocus1);
34
+ }
35
+ }
36
+ .extra-small {
37
+ width: var(--spacingHorizontalXL);
38
+ height: var(--spacingHorizontalXL);
39
+ &:hover {
40
+ box-shadow: inset 0 0 0 var(--strokeWidthThin) var(--colorBrandStroke1),
41
+ inset 0 0 0 var(--strokeWidthThick) var(--colorStrokeFocus1);
42
+ }
43
+ &:hover:active {
44
+ border: none;
45
+ box-shadow: inset 0 0 0 var(--strokeWidthThick) var(--colorCompoundBrandStrokePressed),
46
+ inset 0 0 0 var(--strokeWidthThicker) var(--colorStrokeFocus1);
47
+ }
48
+ }
49
+ .small {
50
+ width: var(--spacingHorizontalXXL);
51
+ height: var(--spacingHorizontalXXL);
52
+ &:hover:active {
53
+ border: none;
54
+ box-shadow: inset 0 0 0 var(--strokeWidthThick) var(--colorCompoundBrandStrokePressed),
55
+ inset 0 0 0 var(--strokeWidthThicker) var(--colorStrokeFocus1);
56
+ }
57
+ }
58
+ .medium {
59
+ width: calc(var(--spacingHorizontalXXL) + var(--spacingHorizontalXS));
60
+ height: calc(var(--spacingHorizontalXXL) + var(--spacingHorizontalXS));
61
+ }
62
+ .large {
63
+ width: var(--spacingHorizontalXXXL);
64
+ height: var(--spacingHorizontalXXXL);
65
+ }
66
+ .rounded {
67
+ border-radius: var(--borderRadiusMedium);
68
+ &[data-fui-focus-visible] {
69
+ border-radius: var(--borderRadiusMedium);
70
+ }
71
+ }
72
+ .circular {
73
+ border-radius: var(--borderRadiusCircular);
74
+ &[data-fui-focus-visible] {
75
+ border-radius: var(--borderRadiusCircular);
76
+ }
77
+ }
78
+ .square {
79
+ border-radius: var(--borderRadiusNone);
80
+ &[data-fui-focus-visible] {
81
+ border-radius: var(--borderRadiusNone);
82
+ }
83
+ }
84
+ .selected {
85
+ border: none;
86
+ box-shadow: inset 0 0 0 var(--strokeWidthThicker) var(--colorBrandStroke1),
87
+ inset 0 0 0 calc(var(--spacingHorizontalSNudge) - var(--strokeWidthThin)) var(--colorStrokeFocus1);
88
+ &[data-fui-focus-visible] {
89
+ box-shadow: inset 0 0 0 var(--strokeWidthThicker) var(--colorStrokeFocus2),
90
+ inset 0 0 0 calc(var(--spacingHorizontalSNudge) - var(--strokeWidthThin)) var(--colorStrokeFocus1);
91
+ }
92
+ &:hover {
93
+ box-shadow: inset 0 0 0 var(--strokeWidthThickest) var(--colorCompoundBrandStrokeHover),
94
+ inset 0 0 0 var(--spacingHorizontalSNudge) var(--colorStrokeFocus1);
95
+ }
96
+ &:hover:active {
97
+ box-shadow: inset 0 0 0 var(--strokeWidthThickest) var(--colorCompoundBrandStrokePressed),
98
+ inset 0 0 0 calc(var(--spacingHorizontalS) - var(--strokeWidthThin)) var(--colorStrokeFocus1);
99
+ }
100
+ @media (forced-colors: active) {
101
+ box-shadow: inset 0 0 0 var(--strokeWidthThicker) var(--colorBrandStroke2Pressed),
102
+ inset 0 0 0 calc(var(--spacingHorizontalSNudge) - var(--strokeWidthThin)) var(--colorStrokeFocus1);
103
+ }
104
+ }
105
+ .selected:where(.small, .extra-small) {
106
+ @media (forced-colors: none) {
107
+ box-shadow: inset 0 0 0 var(--strokeWidthThick) var(--colorBrandStroke1),
108
+ inset 0 0 0 var(--strokeWidthThicker) var(--colorStrokeFocus1);
109
+ }
110
+ &:hover {
111
+ box-shadow: inset 0 0 0 var(--strokeWidthThick) var(--colorCompoundBrandStrokeHover),
112
+ inset 0 0 0 var(--strokeWidthThicker) var(--colorStrokeFocus1);
113
+ }
114
+ &:hover:active {
115
+ box-shadow: inset 0 0 0 var(--strokeWidthThicker) var(--colorCompoundBrandStrokePressed),
116
+ inset 0 0 0 var(--strokeWidthThickest) var(--colorStrokeFocus1);
117
+ }
118
+ }
119
+ .disabled {
120
+ &:hover {
121
+ cursor: not-allowed;
122
+ box-shadow: none;
123
+ }
124
+ @media (forced-colors: active) {
125
+ &:hover {
126
+ box-shadow: none;
127
+ }
128
+ }
129
+ }
130
+ .icon {
131
+ position: absolute;
132
+ display: flex;
133
+ align-self: center;
134
+ }
135
+ .disabledIcon {
136
+ color: var(--colorNeutralForegroundInverted);
137
+ filter: drop-shadow(
138
+ 0 var(--strokeWidthThin) var(--strokeWidthThin) rgb(from var(--colorNeutralShadowKey) r g b / 1)
139
+ );
140
+ }
141
+ :where(.extra-small) > .icon {
142
+ font-size: var(--fontSizeBase400);
143
+ }
144
+ :where(.small) > .icon {
145
+ font-size: var(--fontSizeBase400);
146
+ }
147
+ :where(.medium) > .icon {
148
+ font-size: var(--fontSizeBase500);
149
+ }
150
+ :where(.large) > .icon {
151
+ font-size: var(--spacingHorizontalXXL);
152
+ }
153
+ @media (forced-colors: active) {
154
+ .root {
155
+ forced-color-adjust: none;
156
+ }
157
+ .root:hover {
158
+ box-shadow: inset 0 0 0 var(--strokeWidthThick) var(--colorBrandStroke2Hover),
159
+ inset 0 0 0 var(--strokeWidthThicker) var(--colorStrokeFocus1);
160
+ }
161
+ .root:hover:active {
162
+ box-shadow: inset 0 0 0 var(--strokeWidthThicker) var(--colorBrandStroke2Pressed),
163
+ inset 0 0 0 var(--strokeWidthThickest) var(--colorStrokeFocus1);
164
+ }
165
+ .disabled:hover {
166
+ box-shadow: none;
167
+ }
168
+ }
169
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ColorSwatch/ColorSwatch.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { SwatchPickerProps } from '../SwatchPicker/SwatchPicker.types';\n\nexport type ColorSwatchSlots = {\n root: NonNullable<Slot<'button'>>;\n icon?: Slot<'span'>;\n disabledIcon?: Slot<'span'>;\n};\n\n/**\n * ColorSwatch Props\n */\nexport type ColorSwatchProps = ComponentProps<ColorSwatchSlots> &\n Pick<SwatchPickerProps, 'size' | 'shape'> & {\n /**\n * Border color when contrast is low\n */\n borderColor?: string;\n\n /**\n * Swatch color\n */\n color: string;\n\n /**\n * Whether the swatch is disabled\n */\n disabled?: boolean;\n\n /**\n * Swatch value\n */\n value: string;\n };\n\nexport type ColorSwatchBaseProps = Omit<ColorSwatchProps, 'size' | 'shape'>;\n\n/**\n * State used in rendering ColorSwatch\n */\nexport type ColorSwatchState = ComponentState<ColorSwatchSlots> &\n Pick<ColorSwatchProps, 'color' | 'disabled' | 'size' | 'shape' | 'value'> & {\n selected: boolean;\n };\n\nexport type ColorSwatchBaseState = Omit<ColorSwatchState, 'size' | 'shape'>;\n"],"names":[],"mappings":"AA6CA,WAA4E"}
1
+ {"version":3,"sources":["../../../src/components/ColorSwatch/ColorSwatch.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { SwatchPickerProps } from '../SwatchPicker/SwatchPicker.types';\n\nexport type ColorSwatchSlots = {\n root: NonNullable<Slot<'button'>>;\n icon?: Slot<'span'>;\n disabledIcon?: Slot<'span'>;\n};\n\n/**\n * ColorSwatch Props\n */\nexport type ColorSwatchProps = ComponentProps<ColorSwatchSlots> &\n Pick<SwatchPickerProps, 'size' | 'shape'> & {\n /**\n * Border color when contrast is low\n */\n borderColor?: string;\n\n /**\n * Swatch color\n */\n color: string;\n\n /**\n * Whether the swatch is disabled\n */\n disabled?: boolean;\n\n /**\n * Swatch value\n */\n value: string;\n };\n\nexport type ColorSwatchBaseProps = Omit<ColorSwatchProps, 'size' | 'shape'>;\n\n/**\n * State used in rendering ColorSwatch\n */\nexport type ColorSwatchState = ComponentState<ColorSwatchSlots> &\n Pick<ColorSwatchProps, 'color' | 'disabled' | 'size' | 'shape' | 'value'> & {\n selected: boolean;\n };\n\nexport type ColorSwatchBaseState = Omit<ColorSwatchState, 'size' | 'shape'>;\n"],"names":[],"mappings":"AA6CA,WAA4E"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ColorSwatch/index.ts"],"sourcesContent":["export { ColorSwatch } from './ColorSwatch';\nexport type {\n ColorSwatchBaseProps,\n ColorSwatchBaseState,\n ColorSwatchProps,\n ColorSwatchSlots,\n ColorSwatchState,\n} from './ColorSwatch.types';\nexport { renderColorSwatch_unstable } from './renderColorSwatch';\nexport { useColorSwatch_unstable, useColorSwatchBase_unstable } from './useColorSwatch';\nexport { colorSwatchClassNames, useColorSwatchStyles_unstable } from './useColorSwatchStyles.styles';\nexport { swatchCSSVars } from './ColorSwatch.constants';\n"],"names":["ColorSwatch","renderColorSwatch_unstable","useColorSwatch_unstable","useColorSwatchBase_unstable","colorSwatchClassNames","useColorSwatchStyles_unstable","swatchCSSVars"],"mappings":"AAAA,SAASA,WAAW,QAAQ,mBAAgB;AAQ5C,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,uBAAuB,EAAEC,2BAA2B,QAAQ,sBAAmB;AACxF,SAASC,qBAAqB,EAAEC,6BAA6B,QAAQ,mCAAgC;AACrG,SAASC,aAAa,QAAQ,6BAA0B"}
1
+ {"version":3,"sources":["../../../src/components/ColorSwatch/index.ts"],"sourcesContent":["export { ColorSwatch } from './ColorSwatch';\nexport type {\n ColorSwatchBaseProps,\n ColorSwatchBaseState,\n ColorSwatchProps,\n ColorSwatchSlots,\n ColorSwatchState,\n} from './ColorSwatch.types';\nexport { renderColorSwatch_unstable } from './renderColorSwatch';\nexport { useColorSwatch_unstable, useColorSwatchBase_unstable } from './useColorSwatch';\nexport { colorSwatchClassNames, useColorSwatchStyles_unstable } from './useColorSwatchStyles.styles';\nexport { swatchCSSVars } from './ColorSwatch.constants';\n"],"names":["ColorSwatch","renderColorSwatch_unstable","useColorSwatch_unstable","useColorSwatchBase_unstable","colorSwatchClassNames","useColorSwatchStyles_unstable","swatchCSSVars"],"mappings":"AAAA,SAASA,WAAW,QAAQ,mBAAgB;AAQ5C,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,uBAAuB,EAAEC,2BAA2B,QAAQ,sBAAmB;AACxF,SAASC,qBAAqB,EAAEC,6BAA6B,QAAQ,mCAAgC;AACrG,SAASC,aAAa,QAAQ,6BAA0B"}
@@ -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
  * Render the final JSX of ColorSwatch
5
5
  */ export const renderColorSwatch_unstable = (state)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ColorSwatch/renderColorSwatch.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { ColorSwatchBaseState, ColorSwatchSlots } from './ColorSwatch.types';\n\n/**\n * Render the final JSX of ColorSwatch\n */\nexport const renderColorSwatch_unstable = (state: ColorSwatchBaseState): JSXElement => {\n assertSlots<ColorSwatchSlots>(state);\n\n return (\n <state.root>\n {state.root.children}\n {state.icon && <state.icon />}\n {state.disabled && state.disabledIcon && <state.disabledIcon />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderColorSwatch_unstable","state","root","children","icon","disabled","disabledIcon"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CAACC;IACzCF,YAA8BE;IAE9B,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAMC,IAAI,CAACC,QAAQ;YACnBF,MAAMG,IAAI,kBAAI,KAACH,MAAMG,IAAI;YACzBH,MAAMI,QAAQ,IAAIJ,MAAMK,YAAY,kBAAI,KAACL,MAAMK,YAAY;;;AAGlE,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/ColorSwatch/renderColorSwatch.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { ColorSwatchBaseState, ColorSwatchSlots } from './ColorSwatch.types';\n\n/**\n * Render the final JSX of ColorSwatch\n */\nexport const renderColorSwatch_unstable = (state: ColorSwatchBaseState): JSXElement => {\n assertSlots<ColorSwatchSlots>(state);\n\n return (\n <state.root>\n {state.root.children}\n {state.icon && <state.icon />}\n {state.disabled && state.disabledIcon && <state.disabledIcon />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderColorSwatch_unstable","state","root","children","icon","disabled","disabledIcon"],"mappings":";AAAA,0BAA0B,GAC1B,iDAAiD,GAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CAACC;IACzCF,YAA8BE;IAE9B,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAMC,IAAI,CAACC,QAAQ;YACnBF,MAAMG,IAAI,kBAAI,KAACH,MAAMG,IAAI;YACzBH,MAAMI,QAAQ,IAAIJ,MAAMK,YAAY,kBAAI,KAACL,MAAMK,YAAY;;;AAGlE,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ColorSwatch/useColorSwatch.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { slot, useEventCallback, getIntrinsicElementProps, mergeCallbacks } from '@fluentui/react-utilities';\nimport type {\n ColorSwatchBaseProps,\n ColorSwatchBaseState,\n ColorSwatchProps,\n ColorSwatchState,\n} from './ColorSwatch.types';\nimport { useSwatchPickerContextValue_unstable } from '../../contexts/swatchPicker';\nimport { ProhibitedFilled } from '@fluentui/react-icons';\nimport { swatchCSSVars } from './ColorSwatch.constants';\n\n/**\n * Create the basee state required to render unstyled ColorSwatch.\n *\n * The returned state can be modified with hooks before being passed to renderColorSwatch_unstable.\n *\n * @param props - props from this instance of ColorSwatch\n * @param ref - reference to root HTMLButtonElement of ColorSwatch\n */\nexport const useColorSwatchBase_unstable = (\n props: ColorSwatchBaseProps,\n ref: React.Ref<HTMLButtonElement>,\n): ColorSwatchBaseState => {\n const { borderColor, color, disabled, disabledIcon, icon, value, onClick, style, ...rest } = props;\n const isGrid = useSwatchPickerContextValue_unstable(ctx => ctx.isGrid);\n\n const requestSelectionChange = useSwatchPickerContextValue_unstable(ctx => ctx.requestSelectionChange);\n const selected = useSwatchPickerContextValue_unstable(ctx => ctx.selectedValue === value);\n\n const onColorSwatchClick = useEventCallback(\n mergeCallbacks(onClick, (event: React.MouseEvent<HTMLButtonElement>) =>\n requestSelectionChange(event, {\n selectedValue: value,\n selectedSwatch: color,\n }),\n ),\n );\n\n const rootVariables = {\n [swatchCSSVars.color]: color,\n [swatchCSSVars.borderColor]: borderColor,\n };\n\n const role = isGrid ? 'gridcell' : 'radio';\n const ariaSelected = isGrid\n ? {\n 'aria-selected': selected,\n }\n : { 'aria-checked': selected };\n\n const iconShorthand = slot.optional(icon, { elementType: 'span' });\n const disabledIconShorthand = slot.optional(disabledIcon, {\n elementType: 'span',\n });\n\n return {\n components: {\n root: 'button',\n icon: 'span',\n disabledIcon: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref,\n role,\n ...ariaSelected,\n onClick: onColorSwatchClick,\n type: 'button',\n disabled,\n ...rest,\n style: {\n ...rootVariables,\n ...style,\n },\n }),\n { elementType: 'button' },\n ),\n icon: iconShorthand,\n disabledIcon: disabledIconShorthand,\n disabled,\n selected,\n color,\n value,\n };\n};\n\n/**\n * Create the state required to render ColorSwatch.\n *\n * The returned state can be modified with hooks such as useColorSwatchStyles_unstable,\n * before being passed to renderColorSwatch_unstable.\n *\n * @param props - props from this instance of ColorSwatch\n * @param ref - reference to root HTMLButtonElement of ColorSwatch\n */\nexport const useColorSwatch_unstable = (\n props: ColorSwatchProps,\n ref: React.Ref<HTMLButtonElement>,\n): ColorSwatchState => {\n const sizeFromContext = useSwatchPickerContextValue_unstable(ctx => ctx.size);\n const shapeFromContext = useSwatchPickerContextValue_unstable(ctx => ctx.shape);\n const { size = sizeFromContext, shape = shapeFromContext, disabledIcon, ...rest } = props;\n\n const baseState = useColorSwatchBase_unstable(rest, ref);\n\n return {\n ...baseState,\n size,\n shape,\n disabledIcon: slot.optional(disabledIcon, {\n defaultProps: {\n ...baseState.disabledIcon,\n children: <ProhibitedFilled />,\n },\n renderByDefault: true,\n elementType: 'span',\n }),\n };\n};\n"],"names":["React","slot","useEventCallback","getIntrinsicElementProps","mergeCallbacks","useSwatchPickerContextValue_unstable","ProhibitedFilled","swatchCSSVars","useColorSwatchBase_unstable","props","ref","borderColor","color","disabled","disabledIcon","icon","value","onClick","style","rest","isGrid","ctx","requestSelectionChange","selected","selectedValue","onColorSwatchClick","event","selectedSwatch","rootVariables","role","ariaSelected","iconShorthand","optional","elementType","disabledIconShorthand","components","root","always","type","useColorSwatch_unstable","sizeFromContext","size","shapeFromContext","shape","baseState","defaultProps","children","renderByDefault"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,IAAI,EAAEC,gBAAgB,EAAEC,wBAAwB,EAAEC,cAAc,QAAQ,4BAA4B;AAO7G,SAASC,oCAAoC,QAAQ,iCAA8B;AACnF,SAASC,gBAAgB,QAAQ,wBAAwB;AACzD,SAASC,aAAa,QAAQ,6BAA0B;AAExD;;;;;;;CAOC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,OACAC;IAEA,MAAM,EAAEC,WAAW,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,IAAI,EAAEC,KAAK,EAAEC,OAAO,EAAEC,KAAK,EAAE,GAAGC,MAAM,GAAGV;IAC7F,MAAMW,SAASf,qCAAqCgB,CAAAA,MAAOA,IAAID,MAAM;IAErE,MAAME,yBAAyBjB,qCAAqCgB,CAAAA,MAAOA,IAAIC,sBAAsB;IACrG,MAAMC,WAAWlB,qCAAqCgB,CAAAA,MAAOA,IAAIG,aAAa,KAAKR;IAEnF,MAAMS,qBAAqBvB,iBACzBE,eAAea,SAAS,CAACS,QACvBJ,uBAAuBI,OAAO;YAC5BF,eAAeR;YACfW,gBAAgBf;QAClB;IAIJ,MAAMgB,gBAAgB;QACpB,CAACrB,cAAcK,KAAK,C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":["../../../src/components/ColorSwatch/useColorSwatch.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { slot, useEventCallback, getIntrinsicElementProps, mergeCallbacks } from '@fluentui/react-utilities';\nimport type {\n ColorSwatchBaseProps,\n ColorSwatchBaseState,\n ColorSwatchProps,\n ColorSwatchState,\n} from './ColorSwatch.types';\nimport { useSwatchPickerContextValue_unstable } from '../../contexts/swatchPicker';\nimport { ProhibitedFilled } from '@fluentui/react-icons';\nimport { swatchCSSVars } from './ColorSwatch.constants';\n\n/**\n * Create the basee state required to render unstyled ColorSwatch.\n *\n * The returned state can be modified with hooks before being passed to renderColorSwatch_unstable.\n *\n * @param props - props from this instance of ColorSwatch\n * @param ref - reference to root HTMLButtonElement of ColorSwatch\n */\nexport const useColorSwatchBase_unstable = (\n props: ColorSwatchBaseProps,\n ref: React.Ref<HTMLButtonElement>,\n): ColorSwatchBaseState => {\n const { borderColor, color, disabled, disabledIcon, icon, value, onClick, style, ...rest } = props;\n const isGrid = useSwatchPickerContextValue_unstable(ctx => ctx.isGrid);\n\n const requestSelectionChange = useSwatchPickerContextValue_unstable(ctx => ctx.requestSelectionChange);\n const selected = useSwatchPickerContextValue_unstable(ctx => ctx.selectedValue === value);\n\n const onColorSwatchClick = useEventCallback(\n mergeCallbacks(onClick, (event: React.MouseEvent<HTMLButtonElement>) =>\n requestSelectionChange(event, {\n selectedValue: value,\n selectedSwatch: color,\n }),\n ),\n );\n\n const rootVariables = {\n [swatchCSSVars.color]: color,\n [swatchCSSVars.borderColor]: borderColor,\n };\n\n const role = isGrid ? 'gridcell' : 'radio';\n const ariaSelected = isGrid\n ? {\n 'aria-selected': selected,\n }\n : { 'aria-checked': selected };\n\n const iconShorthand = slot.optional(icon, { elementType: 'span' });\n const disabledIconShorthand = slot.optional(disabledIcon, {\n elementType: 'span',\n });\n\n return {\n components: {\n root: 'button',\n icon: 'span',\n disabledIcon: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref,\n role,\n ...ariaSelected,\n onClick: onColorSwatchClick,\n type: 'button',\n disabled,\n ...rest,\n style: {\n ...rootVariables,\n ...style,\n },\n }),\n { elementType: 'button' },\n ),\n icon: iconShorthand,\n disabledIcon: disabledIconShorthand,\n disabled,\n selected,\n color,\n value,\n };\n};\n\n/**\n * Create the state required to render ColorSwatch.\n *\n * The returned state can be modified with hooks such as useColorSwatchStyles_unstable,\n * before being passed to renderColorSwatch_unstable.\n *\n * @param props - props from this instance of ColorSwatch\n * @param ref - reference to root HTMLButtonElement of ColorSwatch\n */\nexport const useColorSwatch_unstable = (\n props: ColorSwatchProps,\n ref: React.Ref<HTMLButtonElement>,\n): ColorSwatchState => {\n const sizeFromContext = useSwatchPickerContextValue_unstable(ctx => ctx.size);\n const shapeFromContext = useSwatchPickerContextValue_unstable(ctx => ctx.shape);\n const { size = sizeFromContext, shape = shapeFromContext, disabledIcon, ...rest } = props;\n\n const baseState = useColorSwatchBase_unstable(rest, ref);\n\n return {\n ...baseState,\n size,\n shape,\n disabledIcon: slot.optional(disabledIcon, {\n defaultProps: {\n ...baseState.disabledIcon,\n children: <ProhibitedFilled />,\n },\n renderByDefault: true,\n elementType: 'span',\n }),\n };\n};\n"],"names":["React","slot","useEventCallback","getIntrinsicElementProps","mergeCallbacks","useSwatchPickerContextValue_unstable","ProhibitedFilled","swatchCSSVars","useColorSwatchBase_unstable","props","ref","borderColor","color","disabled","disabledIcon","icon","value","onClick","style","rest","isGrid","ctx","requestSelectionChange","selected","selectedValue","onColorSwatchClick","event","selectedSwatch","rootVariables","role","ariaSelected","iconShorthand","optional","elementType","disabledIconShorthand","components","root","always","type","useColorSwatch_unstable","sizeFromContext","size","shapeFromContext","shape","baseState","defaultProps","children","renderByDefault"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,IAAI,EAAEC,gBAAgB,EAAEC,wBAAwB,EAAEC,cAAc,QAAQ,4BAA4B;AAO7G,SAASC,oCAAoC,QAAQ,iCAA8B;AACn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MAAMgB;QACNjB,cAAcoB;QACdrB;QACAU;QACAX;QACAI;IACF;AACF,EAAE;AAEF;;;;;;;;CAQC,GACD,OAAO,MAAMuB,0BAA0B,CACrC9B,OACAC;IAEA,MAAM8B,kBAAkBnC,qCAAqCgB,CAAAA,MAAOA,IAAIoB,IAAI;IAC5E,MAAMC,mBAAmBrC,qCAAqCgB,CAAAA,MAAOA,IAAIsB,KAAK;IAC9E,MAAM,EAAEF,OAAOD,eAAe,EAAEG,QAAQD,gBAAgB,EAAE5B,YAAY,EAAE,GAAGK,MAAM,GAAGV;IAEpF,MAAMmC,YAAYpC,4BAA4BW,MAAMT;IAEpD,OAAO;QACL,GAAGkC,SAAS;QACZH;QACAE;QACA7B,cAAcb,KAAK+B,QAAQ,CAAClB,cAAc;YACxC+B,cAAc;gBACZ,GAAGD,UAAU9B,YAAY;gBACzBgC,wBAAU,oBAACxC;YACb;YACAyC,iBAAiB;YACjBd,aAAa;QACf;IACF;AACF,EAAE"}
@@ -0,0 +1,18 @@
1
+ import { clsx } from "clsx";
2
+ import styles from "./ColorSwatch.module.css";
3
+ export const colorSwatchClassNames = {
4
+ root: 'fui-ColorSwatch',
5
+ icon: 'fui-ColorSwatch__icon',
6
+ disabledIcon: 'fui-ColorSwatch__disabledIcon'
7
+ };
8
+ export const useColorSwatchStyles_unstable = (state)=>{
9
+ var _state_size, _state_shape;
10
+ state.root.className = clsx(colorSwatchClassNames.root, styles.root, styles[(_state_size = state.size) !== null && _state_size !== void 0 ? _state_size : 'medium'], styles[(_state_shape = state.shape) !== null && _state_shape !== void 0 ? _state_shape : 'square'], state.selected && styles.selected, state.disabled && styles.disabled, state.root.className);
11
+ if (state.disabled && state.disabledIcon) {
12
+ state.disabledIcon.className = clsx(styles.icon, styles.disabledIcon, state.disabledIcon.className);
13
+ }
14
+ if (state.icon) {
15
+ state.icon.className = clsx(styles.icon, state.icon.className);
16
+ }
17
+ return state;
18
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ColorSwatch/useColorSwatchStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { ColorSwatchSlots, ColorSwatchState } from './ColorSwatch.types';\nimport styles from './ColorSwatch.module.css';\n\nexport const colorSwatchClassNames: SlotClassNames<ColorSwatchSlots> = {\n root: 'fui-ColorSwatch',\n icon: 'fui-ColorSwatch__icon',\n disabledIcon: 'fui-ColorSwatch__disabledIcon',\n};\n\nexport const useColorSwatchStyles_unstable = (state: ColorSwatchState): ColorSwatchState => {\n state.root.className = clsx(\n colorSwatchClassNames.root,\n styles.root,\n styles[state.size ?? 'medium'],\n styles[state.shape ?? 'square'],\n state.selected && styles.selected,\n state.disabled && styles.disabled,\n state.root.className,\n );\n if (state.disabled && state.disabledIcon) {\n state.disabledIcon.className = clsx(styles.icon, styles.disabledIcon, state.disabledIcon.className);\n }\n if (state.icon) {\n state.icon.className = clsx(styles.icon, state.icon.className);\n }\n return state;\n};\n"],"names":["clsx","styles","colorSwatchClassNames","root","icon","disabledIcon","useColorSwatchStyles_unstable","state","className","size","shape","selected","disabled"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,2BAA2B;AAE9C,OAAO,MAAMC,wBAA0D;IACrEC,MAAM;IACNC,MAAM;IACNC,cAAc;AAChB,EAAE;AAEF,OAAO,MAAMC,gCAAgC,CAACC;QAInCA,aACAA;IAJTA,MAAMJ,IAAI,CAACK,SAAS,GAAGR,KACrBE,sBAAsBC,IAAI,EAC1BF,OAAOE,IAAI,EACXF,MAAM,EAACM,cAAAA,MAAME,IAAI,cAAVF,yBAAAA,cAAc,SAAS,EAC9BN,MAAM,EAACM,eAAAA,MAAMG,KAAK,cAAXH,0BAAAA,eAAe,SAAS,EAC/BA,MAAMI,QAAQ,IAAIV,OAAOU,QAAQ,EACjCJ,MAAMK,QAAQ,IAAIX,OAAOW,QAAQ,EACjCL,MAAMJ,IAAI,CAACK,SAAS;IAEtB,IAAID,MAAMK,QAAQ,IAAIL,MAAMF,YAAY,EAAE;QACxCE,MAAMF,YAAY,CAACG,SAAS,GAAGR,KAAKC,OAAOG,IAAI,EAAEH,OAAOI,YAAY,EAAEE,MAAMF,YAAY,CAACG,SAAS;IACpG;IACA,IAAID,MAAMH,IAAI,EAAE;QACdG,MAAMH,IAAI,CAACI,SAAS,GAAGR,KAAKC,OAAOG,IAAI,EAAEG,MAAMH,IAAI,CAACI,SAAS;IAC/D;IACA,OAAOD;AACT,EAAE"}
@@ -0,0 +1,18 @@
1
+ import { clsx } from "clsx";
2
+ import styles from "./ColorSwatch.module.css";
3
+ export const colorSwatchClassNames = {
4
+ root: 'fui-ColorSwatch',
5
+ icon: 'fui-ColorSwatch__icon',
6
+ disabledIcon: 'fui-ColorSwatch__disabledIcon'
7
+ };
8
+ export const useColorSwatchStyles_unstable = (state)=>{
9
+ var _state_size, _state_shape;
10
+ state.root.className = clsx(colorSwatchClassNames.root, styles.root, styles[(_state_size = state.size) !== null && _state_size !== void 0 ? _state_size : 'medium'], styles[(_state_shape = state.shape) !== null && _state_shape !== void 0 ? _state_shape : 'square'], state.selected && styles.selected, state.disabled && styles.disabled, state.root.className);
11
+ if (state.disabled && state.disabledIcon) {
12
+ state.disabledIcon.className = clsx(styles.icon, styles.disabledIcon, state.disabledIcon.className);
13
+ }
14
+ if (state.icon) {
15
+ state.icon.className = clsx(styles.icon, state.icon.className);
16
+ }
17
+ return state;
18
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ColorSwatch/useColorSwatchStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { ColorSwatchSlots, ColorSwatchState } from './ColorSwatch.types';\nimport styles from './ColorSwatch.module.css';\n\nexport const colorSwatchClassNames: SlotClassNames<ColorSwatchSlots> = {\n root: 'fui-ColorSwatch',\n icon: 'fui-ColorSwatch__icon',\n disabledIcon: 'fui-ColorSwatch__disabledIcon',\n};\n\nexport const useColorSwatchStyles_unstable = (state: ColorSwatchState): ColorSwatchState => {\n state.root.className = clsx(\n colorSwatchClassNames.root,\n styles.root,\n styles[state.size ?? 'medium'],\n styles[state.shape ?? 'square'],\n state.selected && styles.selected,\n state.disabled && styles.disabled,\n state.root.className,\n );\n if (state.disabled && state.disabledIcon) {\n state.disabledIcon.className = clsx(styles.icon, styles.disabledIcon, state.disabledIcon.className);\n }\n if (state.icon) {\n state.icon.className = clsx(styles.icon, state.icon.className);\n }\n return state;\n};\n"],"names":["clsx","styles","colorSwatchClassNames","root","icon","disabledIcon","useColorSwatchStyles_unstable","state","className","size","shape","selected","disabled"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,2BAA2B;AAE9C,OAAO,MAAMC,wBAA0D;IACrEC,MAAM;IACNC,MAAM;IACNC,cAAc;AAChB,EAAE;AAEF,OAAO,MAAMC,gCAAgC,CAACC;QAInCA,aACAA;IAJTA,MAAMJ,IAAI,CAACK,SAAS,GAAGR,KACrBE,sBAAsBC,IAAI,EAC1BF,OAAOE,IAAI,EACXF,MAAM,EAACM,cAAAA,MAAME,IAAI,cAAVF,yBAAAA,cAAc,SAAS,EAC9BN,MAAM,EAACM,eAAAA,MAAMG,KAAK,cAAXH,0BAAAA,eAAe,SAAS,EAC/BA,MAAMI,QAAQ,IAAIV,OAAOU,QAAQ,EACjCJ,MAAMK,QAAQ,IAAIX,OAAOW,QAAQ,EACjCL,MAAMJ,IAAI,CAACK,SAAS;IAEtB,IAAID,MAAMK,QAAQ,IAAIL,MAAMF,YAAY,EAAE;QACxCE,MAAMF,YAAY,CAACG,SAAS,GAAGR,KAAKC,OAAOG,IAAI,EAAEH,OAAOI,YAAY,EAAEE,MAAMF,YAAY,CAACG,SAAS;IACpG;IACA,IAAID,MAAMH,IAAI,EAAE;QACdG,MAAMH,IAAI,CAACI,SAAS,GAAGR,KAAKC,OAAOG,IAAI,EAAEG,MAAMH,IAAI,CAACI,SAAS;IAC/D;IACA,OAAOD;AACT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ColorSwatch/useColorSwatchStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { ColorSwatchSlots, ColorSwatchState } from './ColorSwatch.types';\nimport { tokens } from '@fluentui/react-theme';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { swatchCSSVars } from './ColorSwatch.constants';\n\nexport const colorSwatchClassNames: SlotClassNames<ColorSwatchSlots> = {\n root: 'fui-ColorSwatch',\n icon: 'fui-ColorSwatch__icon',\n disabledIcon: 'fui-ColorSwatch__disabledIcon',\n};\n\nconst { color, borderColor } = swatchCSSVars;\n\n/**\n * Styles for the root slot\n */\nconst useResetStyles = makeResetStyles({\n display: 'inline-flex',\n flexShrink: 0,\n alignItems: 'center',\n justifyContent: 'center',\n boxSizing: 'border-box',\n border: `1px solid var(${borderColor}, ${tokens.colorTransparentStroke})`,\n background: `var(${color})`,\n overflow: 'hidden',\n padding: '0',\n ':hover': {\n cursor: 'pointer',\n border: 'none',\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorBrandStroke1}, inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus1}`,\n },\n ':hover:active': {\n border: 'none',\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorCompoundBrandStrokePressed}, inset 0 0 0 ${tokens.strokeWidthThickest} ${tokens.colorStrokeFocus1}`,\n },\n ':focus': {\n outline: 'none',\n },\n ':focus-visible': {\n outline: 'none',\n },\n ...createCustomFocusIndicatorStyle({\n border: 'none',\n outline: 'none',\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorStrokeFocus2}, inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus1}`,\n }),\n\n // High contrast styles\n\n '@media (forced-colors: active)': {\n forcedColorAdjust: 'none',\n ':hover': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorBrandStroke2Hover}, inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus1}`,\n },\n ':hover:active': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorBrandStroke2Pressed}, inset 0 0 0 ${tokens.strokeWidthThickest} ${tokens.colorStrokeFocus1}`,\n },\n },\n});\n\nconst useStyles = makeStyles({\n disabled: {\n ':hover': {\n cursor: 'not-allowed',\n boxShadow: 'none',\n },\n '@media (forced-colors: active)': {\n ':hover': {\n boxShadow: 'none',\n },\n },\n },\n selected: {\n border: 'none',\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorBrandStroke1}, inset 0 0 0 5px ${tokens.colorStrokeFocus1}`,\n ':hover': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThickest} ${tokens.colorCompoundBrandStrokeHover}, inset 0 0 0 6px ${tokens.colorStrokeFocus1}`,\n },\n ':hover:active': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThickest} ${tokens.colorCompoundBrandStrokePressed}, inset 0 0 0 7px ${tokens.colorStrokeFocus1}`,\n },\n ...createCustomFocusIndicatorStyle({\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus2}, inset 0 0 0 5px ${tokens.colorStrokeFocus1}`,\n }),\n '@media (forced-colors: active)': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorBrandStroke2Pressed}, inset 0 0 0 5px ${tokens.colorStrokeFocus1}`,\n },\n },\n selectedSmall: {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorBrandStroke1}, inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus1}`,\n ':hover': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorCompoundBrandStrokeHover}, inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus1}`,\n },\n ':hover:active': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorCompoundBrandStrokePressed}, inset 0 0 0 ${tokens.strokeWidthThickest} ${tokens.colorStrokeFocus1}`,\n },\n },\n});\n\nconst useSizeStyles = makeStyles({\n 'extra-small': {\n width: '20px',\n height: '20px',\n ':hover': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThin} ${tokens.colorBrandStroke1}, inset 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorStrokeFocus1}`,\n },\n ':hover:active': {\n border: 'none',\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorCompoundBrandStrokePressed}, inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus1}`,\n },\n },\n small: {\n width: '24px',\n height: '24px',\n ':hover:active': {\n border: 'none',\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorCompoundBrandStrokePressed}, inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus1}`,\n },\n },\n medium: {\n width: '28px',\n height: '28px',\n },\n large: {\n width: '32px',\n height: '32px',\n },\n});\n\nconst useShapeStyles = makeStyles({\n rounded: {\n borderRadius: tokens.borderRadiusMedium,\n ...createCustomFocusIndicatorStyle({ borderRadius: tokens.borderRadiusMedium }),\n },\n circular: {\n borderRadius: tokens.borderRadiusCircular,\n ...createCustomFocusIndicatorStyle({ borderRadius: tokens.borderRadiusCircular }),\n },\n square: {\n borderRadius: tokens.borderRadiusNone,\n ...createCustomFocusIndicatorStyle({ borderRadius: tokens.borderRadiusNone }),\n },\n});\n\nconst useIconStyles = makeStyles({\n disabledIcon: {\n color: tokens.colorNeutralForegroundInverted,\n filter: 'drop-shadow(0 1px 1px rgb(0 0 0 / 1))',\n },\n icon: {\n position: 'absolute',\n display: 'flex',\n alignSelf: 'center',\n },\n 'extra-small': {\n fontSize: '16px',\n },\n small: {\n fontSize: '16px',\n },\n medium: {\n fontSize: '20px',\n },\n large: {\n fontSize: '24px',\n },\n});\n\n/**\n * Apply styling to the ColorSwatch slots based on the state\n */\nexport const useColorSwatchStyles_unstable = (state: ColorSwatchState): ColorSwatchState => {\n const { size = 'medium', shape = 'square' } = state;\n\n const resetStyles = useResetStyles();\n const styles = useStyles();\n const sizeStyles = useSizeStyles();\n const shapeStyles = useShapeStyles();\n const iconStyles = useIconStyles();\n const smallerSelectedStyles = size === 'small' || size === 'extra-small' ? styles.selectedSmall : '';\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(\n colorSwatchClassNames.root,\n resetStyles,\n sizeStyles[size],\n shapeStyles[shape],\n state.selected && styles.selected,\n state.selected && smallerSelectedStyles,\n state.disabled && styles.disabled,\n state.root.className,\n );\n\n if (state.disabled && state.disabledIcon) {\n // eslint-disable-next-line react-hooks/immutability\n state.disabledIcon.className = mergeClasses(\n iconStyles.icon,\n iconStyles[size],\n iconStyles.disabledIcon,\n state.disabledIcon.className,\n );\n }\n\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = mergeClasses(iconStyles.icon, iconStyles[size], state.icon.className);\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","createCustomFocusIndicatorStyle","swatchCSSVars","colorSwatchClassNames","root","icon","disabledIcon","color","borderColor","useResetStyles","display","flexShrink","alignItems","justifyContent","boxSizing","border","colorTransparentStroke","background","overflow","padding","cursor","boxShadow","strokeWidthThick","colorBrandStroke1","strokeWidthThicker","colorStrokeFocus1","colorCompoundBrandStrokePressed","strokeWidthThickest","outline","colorStrokeFocus2","forcedColorAdjust","colorBrandStroke2Hover","colorBrandStroke2Pressed","useStyles","disabled","selected","colorCompoundBrandStrokeHover","selectedSmall","useSizeStyles","width","height","strokeWidthThin","small","medium","large","useShapeStyles","rounded","borderRadius","borderRadiusMedium","circular","borderRadiusCircular","square","borderRadiusNone","useIconStyles","colorNeutralForegroundInverted","filter","position","alignSelf","fontSize","useColorSwatchStyles_unstable","state","size","shape","resetStyles","styles","sizeStyles","shapeStyles","iconStyles","smallerSelectedStyles","className"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG3E,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,+BAA+B,QAAQ,0BAA0B;AAC1E,SAASC,aAAa,QAAQ,6BAA0B;AAExD,OAAO,MAAMC,wBAA0D;IACrEC,MAAM;IACNC,MAAM;IACNC,cAAc;AAChB,EAAE;AAEF,MAAM,EAAEC,KAAK,EAAEC,WAAW,EAAE,GAAGN;AAE/B;;CAEC,GACD,MAAMO,iBAAiBZ,gBAAgB;IACrCa,SAAS;IACTC,YAAY;IACZC,YAAY;IACZC,gBAAgB;IAChBC,WAAW;IACXC,QAAQ,CAAC,cAAc,EAAEP,YAAY,EAAE,EAAER,OAAOgB,sBAAsB,CAAC,CAAC,CAAC;IACzEC,YAAY,CAAC,IAAI,EAAEV,MAAM,CAAC,CAAC;IAC3BW,UAAU;IACVC,SAAS;IACT,UAAU;QACRC,QAAQ;QACRL,QAAQ;QACRM,WAAW,CAAC,YAAY,EAAErB,OAAOsB,gBAAgB,CAAC,CAAC,EAAEtB,OAAOuB,iBAAiB,CAAC,cAAc,EAAEvB,OAAOwB,kBAAkB,CAAC,CAAC,EAAExB,OAAOyB,iBAAiB,EAAE;IACvJ;IACA,iBAAiB;QACfV,QAAQ;QACRM,WAAW,CAAC,YAAY,EAAErB,OAAOwB,kBAAkB,CAAC,CAAC,EAAExB,OAAO0B,+BAA+B,CAAC,cAAc,EAAE1B,OAAO2B,mBAAmB,CAAC,CAAC,EAAE3B,OAAOyB,iBAAiB,EAAE;IACxK;IACA,UAAU;QACRG,SAAS;IACX;IACA,kBAAkB;QAChBA,SAAS;IACX;IACA,GAAG3B,gCAAgC;QACjC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MG,cAActD;IACpB,MAAMuD,SAAS/B;IACf,MAAMgC,aAAa3B;IACnB,MAAM4B,cAAcrB;IACpB,MAAMsB,aAAad;IACnB,MAAMe,wBAAwBP,SAAS,WAAWA,SAAS,gBAAgBG,OAAO3B,aAAa,GAAG;IAElG,oDAAoD;IACpDuB,MAAMxD,IAAI,CAACiE,SAAS,GAAGtE,aACrBI,sBAAsBC,IAAI,EAC1B2D,aACAE,UAAU,CAACJ,KAAK,EAChBK,WAAW,CAACJ,MAAM,EAClBF,MAAMzB,QAAQ,IAAI6B,OAAO7B,QAAQ,EACjCyB,MAAMzB,QAAQ,IAAIiC,uBAClBR,MAAM1B,QAAQ,IAAI8B,OAAO9B,QAAQ,EACjC0B,MAAMxD,IAAI,CAACiE,SAAS;IAGtB,IAAIT,MAAM1B,QAAQ,IAAI0B,MAAMtD,YAAY,EAAE;QACxC,oDAAoD;QACpDsD,MAAMtD,YAAY,CAAC+D,SAAS,GAAGtE,aAC7BoE,WAAW9D,IAAI,EACf8D,UAAU,CAACN,KAAK,EAChBM,WAAW7D,YAAY,EACvBsD,MAAMtD,YAAY,CAAC+D,SAAS;IAEhC;IAEA,IAAIT,MAAMvD,IAAI,EAAE;QACd,oDAAoD;QACpDuD,MAAMvD,IAAI,CAACgE,SAAS,GAAGtE,aAAaoE,WAAW9D,IAAI,EAAE8D,UAAU,CAACN,KAAK,EAAED,MAAMvD,IAAI,CAACgE,SAAS;IAC7F;IAEA,OAAOT;AACT,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/ColorSwatch/useColorSwatchStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { ColorSwatchSlots, ColorSwatchState } from './ColorSwatch.types';\nimport { tokens } from '@fluentui/react-theme';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { swatchCSSVars } from './ColorSwatch.constants';\n\nexport const colorSwatchClassNames: SlotClassNames<ColorSwatchSlots> = {\n root: 'fui-ColorSwatch',\n icon: 'fui-ColorSwatch__icon',\n disabledIcon: 'fui-ColorSwatch__disabledIcon',\n};\n\nconst { color, borderColor } = swatchCSSVars;\n\n/**\n * Styles for the root slot\n */\nconst useResetStyles = makeResetStyles({\n display: 'inline-flex',\n flexShrink: 0,\n alignItems: 'center',\n justifyContent: 'center',\n boxSizing: 'border-box',\n border: `1px solid var(${borderColor}, ${tokens.colorTransparentStroke})`,\n background: `var(${color})`,\n overflow: 'hidden',\n padding: '0',\n ':hover': {\n cursor: 'pointer',\n border: 'none',\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorBrandStroke1}, inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus1}`,\n },\n ':hover:active': {\n border: 'none',\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorCompoundBrandStrokePressed}, inset 0 0 0 ${tokens.strokeWidthThickest} ${tokens.colorStrokeFocus1}`,\n },\n ':focus': {\n outline: 'none',\n },\n ':focus-visible': {\n outline: 'none',\n },\n ...createCustomFocusIndicatorStyle({\n border: 'none',\n outline: 'none',\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorStrokeFocus2}, inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus1}`,\n }),\n\n // High contrast styles\n\n '@media (forced-colors: active)': {\n forcedColorAdjust: 'none',\n ':hover': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorBrandStroke2Hover}, inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus1}`,\n },\n ':hover:active': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorBrandStroke2Pressed}, inset 0 0 0 ${tokens.strokeWidthThickest} ${tokens.colorStrokeFocus1}`,\n },\n },\n});\n\nconst useStyles = makeStyles({\n disabled: {\n ':hover': {\n cursor: 'not-allowed',\n boxShadow: 'none',\n },\n '@media (forced-colors: active)': {\n ':hover': {\n boxShadow: 'none',\n },\n },\n },\n selected: {\n border: 'none',\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorBrandStroke1}, inset 0 0 0 5px ${tokens.colorStrokeFocus1}`,\n ':hover': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThickest} ${tokens.colorCompoundBrandStrokeHover}, inset 0 0 0 6px ${tokens.colorStrokeFocus1}`,\n },\n ':hover:active': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThickest} ${tokens.colorCompoundBrandStrokePressed}, inset 0 0 0 7px ${tokens.colorStrokeFocus1}`,\n },\n ...createCustomFocusIndicatorStyle({\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus2}, inset 0 0 0 5px ${tokens.colorStrokeFocus1}`,\n }),\n '@media (forced-colors: active)': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorBrandStroke2Pressed}, inset 0 0 0 5px ${tokens.colorStrokeFocus1}`,\n },\n },\n selectedSmall: {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorBrandStroke1}, inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus1}`,\n ':hover': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorCompoundBrandStrokeHover}, inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus1}`,\n },\n ':hover:active': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorCompoundBrandStrokePressed}, inset 0 0 0 ${tokens.strokeWidthThickest} ${tokens.colorStrokeFocus1}`,\n },\n },\n});\n\nconst useSizeStyles = makeStyles({\n 'extra-small': {\n width: '20px',\n height: '20px',\n ':hover': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThin} ${tokens.colorBrandStroke1}, inset 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorStrokeFocus1}`,\n },\n ':hover:active': {\n border: 'none',\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorCompoundBrandStrokePressed}, inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus1}`,\n },\n },\n small: {\n width: '24px',\n height: '24px',\n ':hover:active': {\n border: 'none',\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorCompoundBrandStrokePressed}, inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus1}`,\n },\n },\n medium: {\n width: '28px',\n height: '28px',\n },\n large: {\n width: '32px',\n height: '32px',\n },\n});\n\nconst useShapeStyles = makeStyles({\n rounded: {\n borderRadius: tokens.borderRadiusMedium,\n ...createCustomFocusIndicatorStyle({ borderRadius: tokens.borderRadiusMedium }),\n },\n circular: {\n borderRadius: tokens.borderRadiusCircular,\n ...createCustomFocusIndicatorStyle({ borderRadius: tokens.borderRadiusCircular }),\n },\n square: {\n borderRadius: tokens.borderRadiusNone,\n ...createCustomFocusIndicatorStyle({ borderRadius: tokens.borderRadiusNone }),\n },\n});\n\nconst useIconStyles = makeStyles({\n disabledIcon: {\n color: tokens.colorNeutralForegroundInverted,\n filter: 'drop-shadow(0 1px 1px rgb(0 0 0 / 1))',\n },\n icon: {\n position: 'absolute',\n display: 'flex',\n alignSelf: 'center',\n },\n 'extra-small': {\n fontSize: '16px',\n },\n small: {\n fontSize: '16px',\n },\n medium: {\n fontSize: '20px',\n },\n large: {\n fontSize: '24px',\n },\n});\n\n/**\n * Apply styling to the ColorSwatch slots based on the state\n */\nexport const useColorSwatchStyles_unstable = (state: ColorSwatchState): ColorSwatchState => {\n const { size = 'medium', shape = 'square' } = state;\n\n const resetStyles = useResetStyles();\n const styles = useStyles();\n const sizeStyles = useSizeStyles();\n const shapeStyles = useShapeStyles();\n const iconStyles = useIconStyles();\n const smallerSelectedStyles = size === 'small' || size === 'extra-small' ? styles.selectedSmall : '';\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(\n colorSwatchClassNames.root,\n resetStyles,\n sizeStyles[size],\n shapeStyles[shape],\n state.selected && styles.selected,\n state.selected && smallerSelectedStyles,\n state.disabled && styles.disabled,\n state.root.className,\n );\n\n if (state.disabled && state.disabledIcon) {\n // eslint-disable-next-line react-hooks/immutability\n state.disabledIcon.className = mergeClasses(\n iconStyles.icon,\n iconStyles[size],\n iconStyles.disabledIcon,\n state.disabledIcon.className,\n );\n }\n\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = mergeClasses(iconStyles.icon, iconStyles[size], state.icon.className);\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","createCustomFocusIndicatorStyle","swatchCSSVars","colorSwatchClassNames","root","icon","disabledIcon","color","borderColor","useResetStyles","display","flexShrink","alignItems","justifyContent","boxSizing","border","colorTransparentStroke","background","overflow","padding","cursor","boxShadow","strokeWidthThick","colorBrandStroke1","strokeWidthThicker","colorStrokeFocus1","colorCompoundBrandStrokePressed","strokeWidthThickest","outline","colorStrokeFocus2","forcedColorAdjust","colorBrandStroke2Hover","colorBrandStroke2Pressed","useStyles","disabled","selected","colorCompoundBrandStrokeHover","selectedSmall","useSizeStyles","width","height","strokeWidthThin","small","medium","large","useShapeStyles","rounded","borderRadius","borderRadiusMedium","circular","borderRadiusCircular","square","borderRadiusNone","useIconStyles","colorNeutralForegroundInverted","filter","position","alignSelf","fontSize","useColorSwatchStyles_unstable","state","size","shape","resetStyles","styles","sizeStyles","shapeStyles","iconStyles","smallerSelectedStyles","className"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG3E,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,+BAA+B,QAAQ,0BAA0B;AAC1E,SAASC,aAAa,QAAQ,6BAA0B;AAExD,OAAO,MAAMC,wBAA0D;IACrEC,MAAM;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AQ,IAAIiC,uBAClBR,MAAM1B,QAAQ,IAAI8B,OAAO9B,QAAQ,EACjC0B,MAAMxD,IAAI,CAACiE,SAAS;IAGtB,IAAIT,MAAM1B,QAAQ,IAAI0B,MAAMtD,YAAY,EAAE;QACxC,oDAAoD;QACpDsD,MAAMtD,YAAY,CAAC+D,SAAS,GAAGtE,aAC7BoE,WAAW9D,IAAI,EACf8D,UAAU,CAACN,KAAK,EAChBM,WAAW7D,YAAY,EACvBsD,MAAMtD,YAAY,CAAC+D,SAAS;IAEhC;IAEA,IAAIT,MAAMvD,IAAI,EAAE;QACd,oDAAoD;QACpDuD,MAAMvD,IAAI,CAACgE,SAAS,GAAGtE,aAAaoE,WAAW9D,IAAI,EAAE8D,UAAU,CAACN,KAAK,EAAED,MAAMvD,IAAI,CAACgE,SAAS;IAC7F;IAEA,OAAOT;AACT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/EmptySwatch/EmptySwatch.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useEmptySwatch_unstable } from './useEmptySwatch';\nimport { renderEmptySwatch_unstable } from './renderEmptySwatch';\nimport { useEmptySwatchStyles_unstable } from './useEmptySwatchStyles.styles';\nimport type { EmptySwatchProps } from './EmptySwatch.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * EmptySwatch component is used for adding new color swatches.\n */\nexport const EmptySwatch: ForwardRefComponent<EmptySwatchProps> = React.forwardRef((props, ref) => {\n const state = useEmptySwatch_unstable(props, ref);\n\n useEmptySwatchStyles_unstable(state);\n useCustomStyleHook_unstable('useEmptySwatchStyles_unstable')(state);\n return renderEmptySwatch_unstable(state);\n});\n\nEmptySwatch.displayName = 'EmptySwatch';\n"],"names":["React","useEmptySwatch_unstable","renderEmptySwatch_unstable","useEmptySwatchStyles_unstable","useCustomStyleHook_unstable","EmptySwatch","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,uBAAuB,QAAQ,sBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,6BAA6B,QAAQ,mCAAgC;AAE9E,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,4BAAqDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACzF,MAAMC,QAAQR,wBAAwBM,OAAOC;IAE7CL,8BAA8BM;IAC9BL,4BAA4B,iCAAiCK;IAC7D,OAAOP,2BAA2BO;AACpC,GAAG;AAEHJ,YAAYK,WAAW,GAAG"}
1
+ {"version":3,"sources":["../../../src/components/EmptySwatch/EmptySwatch.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useEmptySwatch_unstable } from './useEmptySwatch';\nimport { renderEmptySwatch_unstable } from './renderEmptySwatch';\nimport { useEmptySwatchStyles_unstable } from './useEmptySwatchStyles.styles';\nimport type { EmptySwatchProps } from './EmptySwatch.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * EmptySwatch component is used for adding new color swatches.\n */\nexport const EmptySwatch: ForwardRefComponent<EmptySwatchProps> = React.forwardRef((props, ref) => {\n const state = useEmptySwatch_unstable(props, ref);\n\n useEmptySwatchStyles_unstable(state);\n useCustomStyleHook_unstable('useEmptySwatchStyles_unstable')(state);\n return renderEmptySwatch_unstable(state);\n});\n\nEmptySwatch.displayName = 'EmptySwatch';\n"],"names":["React","useEmptySwatch_unstable","renderEmptySwatch_unstable","useEmptySwatchStyles_unstable","useCustomStyleHook_unstable","EmptySwatch","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,uBAAuB,QAAQ,sBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,6BAA6B,QAAQ,mCAAgC;AAE9E,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,4BAAqDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACzF,MAAMC,QAAQR,wBAAwBM,OAAOC;IAE7CL,8BAA8BM;IAC9BL,4BAA4B,iCAAiCK;IAC7D,OAAOP,2BAA2BO;AACpC,GAAG;AAEHJ,YAAYK,WAAW,GAAG"}
@@ -0,0 +1,40 @@
1
+ @layer fluentui {
2
+ .root {
3
+ background-color: var(--colorTransparentBackground);
4
+ border: var(--strokeWidthThin) dashed var(--colorNeutralForeground4);
5
+ }
6
+ .extra-small {
7
+ width: var(--spacingHorizontalXL);
8
+ height: var(--spacingHorizontalXL);
9
+ }
10
+ .small {
11
+ width: var(--spacingHorizontalXXL);
12
+ height: var(--spacingHorizontalXXL);
13
+ }
14
+ .medium {
15
+ width: calc(var(--spacingHorizontalXXL) + var(--spacingHorizontalXS));
16
+ height: calc(var(--spacingHorizontalXXL) + var(--spacingHorizontalXS));
17
+ }
18
+ .large {
19
+ width: var(--spacingHorizontalXXXL);
20
+ height: var(--spacingHorizontalXXXL);
21
+ }
22
+ .rounded {
23
+ border-radius: var(--borderRadiusMedium);
24
+ &[data-fui-focus-visible] {
25
+ border-radius: var(--borderRadiusMedium);
26
+ }
27
+ }
28
+ .circular {
29
+ border-radius: var(--borderRadiusCircular);
30
+ &[data-fui-focus-visible] {
31
+ border-radius: var(--borderRadiusCircular);
32
+ }
33
+ }
34
+ .square {
35
+ border-radius: var(--borderRadiusNone);
36
+ &[data-fui-focus-visible] {
37
+ border-radius: var(--borderRadiusNone);
38
+ }
39
+ }
40
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/EmptySwatch/EmptySwatch.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { SwatchPickerProps } from '../SwatchPicker/SwatchPicker.types';\n\nexport type EmptySwatchSlots = {\n root: Slot<'button'>;\n};\n\n/**\n * EmptySwatch Props\n */\nexport type EmptySwatchProps = ComponentProps<EmptySwatchSlots> & Pick<SwatchPickerProps, 'size' | 'shape'>;\n\nexport type EmptySwatchBaseProps = ComponentProps<EmptySwatchSlots>;\n\n/**\n * State used in rendering EmptySwatch\n */\nexport type EmptySwatchState = ComponentState<EmptySwatchSlots> & Pick<EmptySwatchProps, 'size' | 'shape'>;\n\nexport type EmptySwatchBaseState = ComponentState<EmptySwatchSlots>;\n"],"names":[],"mappings":"AAmBA,WAAoE"}
1
+ {"version":3,"sources":["../../../src/components/EmptySwatch/EmptySwatch.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { SwatchPickerProps } from '../SwatchPicker/SwatchPicker.types';\n\nexport type EmptySwatchSlots = {\n root: Slot<'button'>;\n};\n\n/**\n * EmptySwatch Props\n */\nexport type EmptySwatchProps = ComponentProps<EmptySwatchSlots> & Pick<SwatchPickerProps, 'size' | 'shape'>;\n\nexport type EmptySwatchBaseProps = ComponentProps<EmptySwatchSlots>;\n\n/**\n * State used in rendering EmptySwatch\n */\nexport type EmptySwatchState = ComponentState<EmptySwatchSlots> & Pick<EmptySwatchProps, 'size' | 'shape'>;\n\nexport type EmptySwatchBaseState = ComponentState<EmptySwatchSlots>;\n"],"names":[],"mappings":"AAmBA,WAAoE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/EmptySwatch/index.ts"],"sourcesContent":["export { EmptySwatch } from './EmptySwatch';\nexport type {\n EmptySwatchBaseProps,\n EmptySwatchBaseState,\n EmptySwatchProps,\n EmptySwatchSlots,\n EmptySwatchState,\n} from './EmptySwatch.types';\nexport { renderEmptySwatch_unstable } from './renderEmptySwatch';\nexport { useEmptySwatch_unstable, useEmptySwatchBase_unstable } from './useEmptySwatch';\nexport { emptySwatchClassNames, useEmptySwatchStyles_unstable } from './useEmptySwatchStyles.styles';\n"],"names":["EmptySwatch","renderEmptySwatch_unstable","useEmptySwatch_unstable","useEmptySwatchBase_unstable","emptySwatchClassNames","useEmptySwatchStyles_unstable"],"mappings":"AAAA,SAASA,WAAW,QAAQ,mBAAgB;AAQ5C,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,uBAAuB,EAAEC,2BAA2B,QAAQ,sBAAmB;AACxF,SAASC,qBAAqB,EAAEC,6BAA6B,QAAQ,mCAAgC"}
1
+ {"version":3,"sources":["../../../src/components/EmptySwatch/index.ts"],"sourcesContent":["export { EmptySwatch } from './EmptySwatch';\nexport type {\n EmptySwatchBaseProps,\n EmptySwatchBaseState,\n EmptySwatchProps,\n EmptySwatchSlots,\n EmptySwatchState,\n} from './EmptySwatch.types';\nexport { renderEmptySwatch_unstable } from './renderEmptySwatch';\nexport { useEmptySwatch_unstable, useEmptySwatchBase_unstable } from './useEmptySwatch';\nexport { emptySwatchClassNames, useEmptySwatchStyles_unstable } from './useEmptySwatchStyles.styles';\n"],"names":["EmptySwatch","renderEmptySwatch_unstable","useEmptySwatch_unstable","useEmptySwatchBase_unstable","emptySwatchClassNames","useEmptySwatchStyles_unstable"],"mappings":"AAAA,SAASA,WAAW,QAAQ,mBAAgB;AAQ5C,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,uBAAuB,EAAEC,2BAA2B,QAAQ,sBAAmB;AACxF,SAASC,qBAAqB,EAAEC,6BAA6B,QAAQ,mCAAgC"}
@@ -1,5 +1,5 @@
1
- import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
- import { assertSlots } from "@fluentui/react-utilities";
1
+ import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
+ import { assertSlots } from "@fluentui/react-utilities";
3
3
  /**
4
4
  * Render the final JSX of EmptySwatch
5
5
  */ export const renderEmptySwatch_unstable = (state)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/EmptySwatch/renderEmptySwatch.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { EmptySwatchBaseState, EmptySwatchSlots } from './EmptySwatch.types';\n\n/**\n * Render the final JSX of EmptySwatch\n */\nexport const renderEmptySwatch_unstable = (state: EmptySwatchBaseState): JSXElement => {\n assertSlots<EmptySwatchSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderEmptySwatch_unstable","state","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CAACC;IACzCF,YAA8BE;IAE9B,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/EmptySwatch/renderEmptySwatch.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { EmptySwatchBaseState, EmptySwatchSlots } from './EmptySwatch.types';\n\n/**\n * Render the final JSX of EmptySwatch\n */\nexport const renderEmptySwatch_unstable = (state: EmptySwatchBaseState): JSXElement => {\n assertSlots<EmptySwatchSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderEmptySwatch_unstable","state","root"],"mappings":";AAAA,0BAA0B,GAC1B,iDAAiD,GAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CAACC;IACzCF,YAA8BE;IAE9B,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
@@ -22,6 +22,7 @@ import { useSwatchPickerContextValue_unstable } from "../../contexts/swatchPicke
22
22
  ref,
23
23
  role,
24
24
  ...a11yProps,
25
+ type: 'button',
25
26
  ...props
26
27
  }), {
27
28
  elementType: 'button'
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/EmptySwatch/useEmptySwatch.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type {\n EmptySwatchBaseProps,\n EmptySwatchBaseState,\n EmptySwatchProps,\n EmptySwatchState,\n} from './EmptySwatch.types';\nimport { useSwatchPickerContextValue_unstable } from '../../contexts/swatchPicker';\n\n/**\n * Create the base state required to render unstyled EmptySwatch.\n *\n * The returned state can be modified with hooks before being passed to renderEmptySwatch_unstable.\n *\n * @param props - props from this instance of EmptySwatch\n * @param ref - reference to root HTMLDivElement of EmptySwatch\n */\nexport const useEmptySwatchBase_unstable = (\n props: EmptySwatchBaseProps,\n ref: React.Ref<HTMLButtonElement>,\n): EmptySwatchBaseState => {\n const isGrid = useSwatchPickerContextValue_unstable(ctx => ctx.isGrid);\n\n const role = isGrid ? 'gridcell' : 'radio';\n const a11yProps = isGrid ? {} : { 'aria-checked': false };\n return {\n components: {\n root: 'button',\n },\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref,\n role,\n ...a11yProps,\n ...props,\n }),\n { elementType: 'button' },\n ),\n };\n};\n\n/**\n * Create the state required to render EmptySwatch.\n *\n * The returned state can be modified with hooks such as useEmptySwatchStyles_unstable,\n * before being passed to renderEmptySwatch_unstable.\n *\n * @param props - props from this instance of EmptySwatch\n * @param ref - reference to root HTMLDivElement of EmptySwatch\n */\nexport const useEmptySwatch_unstable = (\n props: EmptySwatchProps,\n ref: React.Ref<HTMLButtonElement>,\n): EmptySwatchState => {\n const sizeFromContext = useSwatchPickerContextValue_unstable(ctx => ctx.size);\n const shapeFromContext = useSwatchPickerContextValue_unstable(ctx => ctx.shape);\n const { size = sizeFromContext, shape = shapeFromContext, ...rest } = props;\n\n const baseState = useEmptySwatchBase_unstable(rest, ref);\n\n return {\n ...baseState,\n size,\n shape,\n };\n};\n"],"names":["getIntrinsicElementProps","slot","useSwatchPickerContextValue_unstable","useEmptySwatchBase_unstable","props","ref","isGrid","ctx","role","a11yProps","components","root","always","elementType","useEmptySwatch_unstable","sizeFromContext","size","shapeFromContext","shape","rest","baseState"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAO3E,SAASC,oCAAoC,QAAQ,iCAA8B;AAEnF;;;;;;;CAOC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,OACAC;IAEA,MAAMC,SAASJ,qCAAqCK,CAAAA,MAAOA,IAAID,MAAM;IAErE,MAAME,OAAOF,SAAS,aAAa;IACnC,MAAMG,YAAYH,SAAS,CAAC,IAAI;QAAE,gBAAgB;IAAM;IACxD,OAAO;QACLI,YAAY;YACVC,MAAM;QACR;QACAA,MAAMV,KAAKW,MAAM,CACfZ,yBAAyB,UAAU;YACjCK;YACAG;YACA,GAAGC,SAAS;YACZ,GAAGL,KAAK;QACV,IACA;YAAES,aAAa;QAAS;IAE5B;AACF,EAAE;AAEF;;;;;;;;CAQC,GACD,OAAO,MAAMC,0BAA0B,CACrCV,OACAC;IAEA,MAAMU,kBAAkBb,qCAAqCK,CAAAA,MAAOA,IAAIS,IAAI;IAC5E,MAAMC,mBAAmBf,qCAAqCK,CAAAA,MAAOA,IAAIW,KAAK;IAC9E,MAAM,EAAEF,OAAOD,eAAe,EAAEG,QAAQD,gBAAgB,EAAE,GAAGE,MAAM,GAAGf;IAEtE,MAAMgB,YAAYjB,4BAA4BgB,MAAMd;IAEpD,OAAO;QACL,GAAGe,SAAS;QACZJ;QACAE;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/EmptySwatch/useEmptySwatch.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type {\n EmptySwatchBaseProps,\n EmptySwatchBaseState,\n EmptySwatchProps,\n EmptySwatchState,\n} from './EmptySwatch.types';\nimport { useSwatchPickerContextValue_unstable } from '../../contexts/swatchPicker';\n\n/**\n * Create the base state required to render unstyled EmptySwatch.\n *\n * The returned state can be modified with hooks before being passed to renderEmptySwatch_unstable.\n *\n * @param props - props from this instance of EmptySwatch\n * @param ref - reference to root HTMLDivElement of EmptySwatch\n */\nexport const useEmptySwatchBase_unstable = (\n props: EmptySwatchBaseProps,\n ref: React.Ref<HTMLButtonElement>,\n): EmptySwatchBaseState => {\n const isGrid = useSwatchPickerContextValue_unstable(ctx => ctx.isGrid);\n\n const role = isGrid ? 'gridcell' : 'radio';\n const a11yProps = isGrid ? {} : { 'aria-checked': false };\n return {\n components: {\n root: 'button',\n },\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref,\n role,\n ...a11yProps,\n type: 'button',\n ...props,\n }),\n { elementType: 'button' },\n ),\n };\n};\n\n/**\n * Create the state required to render EmptySwatch.\n *\n * The returned state can be modified with hooks such as useEmptySwatchStyles_unstable,\n * before being passed to renderEmptySwatch_unstable.\n *\n * @param props - props from this instance of EmptySwatch\n * @param ref - reference to root HTMLDivElement of EmptySwatch\n */\nexport const useEmptySwatch_unstable = (\n props: EmptySwatchProps,\n ref: React.Ref<HTMLButtonElement>,\n): EmptySwatchState => {\n const sizeFromContext = useSwatchPickerContextValue_unstable(ctx => ctx.size);\n const shapeFromContext = useSwatchPickerContextValue_unstable(ctx => ctx.shape);\n const { size = sizeFromContext, shape = shapeFromContext, ...rest } = props;\n\n const baseState = useEmptySwatchBase_unstable(rest, ref);\n\n return {\n ...baseState,\n size,\n shape,\n };\n};\n"],"names":["getIntrinsicElementProps","slot","useSwatchPickerContextValue_unstable","useEmptySwatchBase_unstable","props","ref","isGrid","ctx","role","a11yProps","components","root","always","type","elementType","useEmptySwatch_unstable","sizeFromContext","size","shapeFromContext","shape","rest","baseState"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAO3E,SAASC,oCAAoC,QAAQ,iCAA8B;AAEnF;;;;;;;CAOC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,OACAC;IAEA,MAAMC,SAASJ,qCAAqCK,CAAAA,MAAOA,IAAID,MAAM;IAErE,MAAME,OAAOF,SAAS,aAAa;IACnC,MAAMG,YAAYH,SAAS,CAAC,IAAI;QAAE,gBAAgB;IAAM;IACxD,OAAO;QACLI,YAAY;YACVC,MAAM;QACR;QACAA,MAAMV,KAAKW,MAAM,CACfZ,yBAAyB,UAAU;YACjCK;YACAG;YACA,GAAGC,SAAS;YACZI,MAAM;YACN,GAAGT,KAAK;QACV,IACA;YAAEU,aAAa;QAAS;IAE5B;AACF,EAAE;AAEF;;;;;;;;CAQC,GACD,OAAO,MAAMC,0BAA0B,CACrCX,OACAC;IAEA,MAAMW,kBAAkBd,qCAAqCK,CAAAA,MAAOA,IAAIU,IAAI;IAC5E,MAAMC,mBAAmBhB,qCAAqCK,CAAAA,MAAOA,IAAIY,KAAK;IAC9E,MAAM,EAAEF,OAAOD,eAAe,EAAEG,QAAQD,gBAAgB,EAAE,GAAGE,MAAM,GAAGhB;IAEtE,MAAMiB,YAAYlB,4BAA4BiB,MAAMf;IAEpD,OAAO;QACL,GAAGgB,SAAS;QACZJ;QACAE;IACF;AACF,EAAE"}
@@ -0,0 +1,10 @@
1
+ import { clsx } from "clsx";
2
+ import styles from "./EmptySwatch.module.css";
3
+ export const emptySwatchClassNames = {
4
+ root: 'fui-EmptySwatch'
5
+ };
6
+ export const useEmptySwatchStyles_unstable = (state)=>{
7
+ var _state_size, _state_shape;
8
+ state.root.className = clsx(emptySwatchClassNames.root, styles.root, styles[(_state_size = state.size) !== null && _state_size !== void 0 ? _state_size : 'medium'], styles[(_state_shape = state.shape) !== null && _state_shape !== void 0 ? _state_shape : 'square'], state.root.className);
9
+ return state;
10
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/EmptySwatch/useEmptySwatchStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { EmptySwatchSlots, EmptySwatchState } from './EmptySwatch.types';\nimport styles from './EmptySwatch.module.css';\n\nexport const emptySwatchClassNames: SlotClassNames<EmptySwatchSlots> = {\n root: 'fui-EmptySwatch',\n};\n\nexport const useEmptySwatchStyles_unstable = (state: EmptySwatchState): EmptySwatchState => {\n state.root.className = clsx(\n emptySwatchClassNames.root,\n styles.root,\n styles[state.size ?? 'medium'],\n styles[state.shape ?? 'square'],\n state.root.className,\n );\n return state;\n};\n"],"names":["clsx","styles","emptySwatchClassNames","root","useEmptySwatchStyles_unstable","state","className","size","shape"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,2BAA2B;AAE9C,OAAO,MAAMC,wBAA0D;IACrEC,MAAM;AACR,EAAE;AAEF,OAAO,MAAMC,gCAAgC,CAACC;QAInCA,aACAA;IAJTA,MAAMF,IAAI,CAACG,SAAS,GAAGN,KACrBE,sBAAsBC,IAAI,EAC1BF,OAAOE,IAAI,EACXF,MAAM,EAACI,cAAAA,MAAME,IAAI,cAAVF,yBAAAA,cAAc,SAAS,EAC9BJ,MAAM,EAACI,eAAAA,MAAMG,KAAK,cAAXH,0BAAAA,eAAe,SAAS,EAC/BA,MAAMF,IAAI,CAACG,SAAS;IAEtB,OAAOD;AACT,EAAE"}
@@ -86,12 +86,11 @@ const useShapeStyles = /*#__PURE__*/__styles({
86
86
  * Apply styling to the EmptySwatch slots based on the state
87
87
  */
88
88
  export const useEmptySwatchStyles_unstable = state => {
89
+ var _state_size, _state_shape;
89
90
  const styles = useStyles();
90
91
  const sizeStyles = useSizeStyles();
91
92
  const shapeStyles = useShapeStyles();
92
- var _state_size;
93
93
  const size = (_state_size = state.size) !== null && _state_size !== void 0 ? _state_size : 'medium';
94
- var _state_shape;
95
94
  // eslint-disable-next-line react-hooks/immutability
96
95
  state.root.className = mergeClasses(emptySwatchClassNames.root, styles, sizeStyles[size], shapeStyles[(_state_shape = state.shape) !== null && _state_shape !== void 0 ? _state_shape : 'square'], state.root.className);
97
96
  return state;