@fluentui/react-carousel 9.1.0 → 9.3.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 (217) hide show
  1. package/CHANGELOG.md +44 -2
  2. package/dist/index.d.ts +58 -2
  3. package/lib/Carousel.js.map +1 -1
  4. package/lib/CarouselAutoplayButton.js.map +1 -1
  5. package/lib/CarouselButton.js.map +1 -1
  6. package/lib/CarouselCard.js.map +1 -1
  7. package/lib/CarouselContext.js.map +1 -1
  8. package/lib/CarouselNav.js.map +1 -1
  9. package/lib/CarouselNavButton.js.map +1 -1
  10. package/lib/CarouselNavContainer.js.map +1 -1
  11. package/lib/CarouselNavImageButton.js.map +1 -1
  12. package/lib/CarouselSlider.js.map +1 -1
  13. package/lib/CarouselViewport.js +1 -0
  14. package/lib/CarouselViewport.js.map +1 -0
  15. package/lib/components/Carousel/Carousel.js +2 -3
  16. package/lib/components/Carousel/Carousel.js.map +1 -1
  17. package/lib/components/Carousel/Carousel.types.js.map +1 -1
  18. package/lib/components/Carousel/index.js.map +1 -1
  19. package/lib/components/Carousel/renderCarousel.js.map +1 -1
  20. package/lib/components/Carousel/useCarousel.js +9 -6
  21. package/lib/components/Carousel/useCarousel.js.map +1 -1
  22. package/lib/components/Carousel/useCarouselContextValues.js +5 -3
  23. package/lib/components/Carousel/useCarouselContextValues.js.map +1 -1
  24. package/lib/components/Carousel/useCarouselStyles.styles.js +3 -10
  25. package/lib/components/Carousel/useCarouselStyles.styles.js.map +1 -1
  26. package/lib/components/CarouselAutoplayButton/CarouselAutoplayButton.js +2 -3
  27. package/lib/components/CarouselAutoplayButton/CarouselAutoplayButton.js.map +1 -1
  28. package/lib/components/CarouselAutoplayButton/CarouselAutoplayButton.types.js.map +1 -1
  29. package/lib/components/CarouselAutoplayButton/index.js.map +1 -1
  30. package/lib/components/CarouselAutoplayButton/renderCarouselAutoplayButton.js +1 -1
  31. package/lib/components/CarouselAutoplayButton/renderCarouselAutoplayButton.js.map +1 -1
  32. package/lib/components/CarouselAutoplayButton/useCarouselAutoplayButton.js.map +1 -1
  33. package/lib/components/CarouselAutoplayButton/useCarouselAutoplayButtonStyles.styles.js +1 -2
  34. package/lib/components/CarouselButton/CarouselButton.js +2 -3
  35. package/lib/components/CarouselButton/CarouselButton.js.map +1 -1
  36. package/lib/components/CarouselButton/CarouselButton.types.js.map +1 -1
  37. package/lib/components/CarouselButton/index.js.map +1 -1
  38. package/lib/components/CarouselButton/renderCarouselButton.js +1 -1
  39. package/lib/components/CarouselButton/renderCarouselButton.js.map +1 -1
  40. package/lib/components/CarouselButton/useCarouselButton.js.map +1 -1
  41. package/lib/components/CarouselButton/useCarouselButtonStyles.styles.js +1 -2
  42. package/lib/components/CarouselCard/CarouselCard.js +2 -3
  43. package/lib/components/CarouselCard/CarouselCard.js.map +1 -1
  44. package/lib/components/CarouselCard/CarouselCard.types.js.map +1 -1
  45. package/lib/components/CarouselCard/index.js.map +1 -1
  46. package/lib/components/CarouselCard/renderCarouselCard.js.map +1 -1
  47. package/lib/components/CarouselCard/useCarouselCard.js +17 -10
  48. package/lib/components/CarouselCard/useCarouselCard.js.map +1 -1
  49. package/lib/components/CarouselCard/useCarouselCardStyles.styles.js +1 -2
  50. package/lib/components/CarouselContext.js +2 -1
  51. package/lib/components/CarouselContext.js.map +1 -1
  52. package/lib/components/CarouselContext.types.js.map +1 -1
  53. package/lib/components/CarouselNav/CarouselNav.js +2 -3
  54. package/lib/components/CarouselNav/CarouselNav.js.map +1 -1
  55. package/lib/components/CarouselNav/CarouselNav.types.js.map +1 -1
  56. package/lib/components/CarouselNav/CarouselNavContext.js.map +1 -1
  57. package/lib/components/CarouselNav/CarouselNavIndexContext.js.map +1 -1
  58. package/lib/components/CarouselNav/index.js.map +1 -1
  59. package/lib/components/CarouselNav/renderCarouselNav.js.map +1 -1
  60. package/lib/components/CarouselNav/useCarouselNav.js.map +1 -1
  61. package/lib/components/CarouselNav/useCarouselNavStyles.styles.js +1 -2
  62. package/lib/components/CarouselNavButton/CarouselNavButton.js +2 -3
  63. package/lib/components/CarouselNavButton/CarouselNavButton.js.map +1 -1
  64. package/lib/components/CarouselNavButton/CarouselNavButton.types.js.map +1 -1
  65. package/lib/components/CarouselNavButton/index.js.map +1 -1
  66. package/lib/components/CarouselNavButton/renderCarouselNavButton.js.map +1 -1
  67. package/lib/components/CarouselNavButton/useCarouselNavButton.js.map +1 -1
  68. package/lib/components/CarouselNavButton/useCarouselNavButtonStyles.styles.js +1 -2
  69. package/lib/components/CarouselNavContainer/CarouselNavContainer.js +2 -8
  70. package/lib/components/CarouselNavContainer/CarouselNavContainer.js.map +1 -1
  71. package/lib/components/CarouselNavContainer/CarouselNavContainer.types.js.map +1 -1
  72. package/lib/components/CarouselNavContainer/index.js.map +1 -1
  73. package/lib/components/CarouselNavContainer/renderCarouselNavContainer.js.map +1 -1
  74. package/lib/components/CarouselNavContainer/useCarouselNavContainer.js.map +1 -1
  75. package/lib/components/CarouselNavContainer/useCarouselNavContainerStyles.styles.js +1 -2
  76. package/lib/components/CarouselNavImageButton/CarouselNavImageButton.js +2 -3
  77. package/lib/components/CarouselNavImageButton/CarouselNavImageButton.js.map +1 -1
  78. package/lib/components/CarouselNavImageButton/CarouselNavImageButton.types.js.map +1 -1
  79. package/lib/components/CarouselNavImageButton/index.js.map +1 -1
  80. package/lib/components/CarouselNavImageButton/renderCarouselNavImageButton.js.map +1 -1
  81. package/lib/components/CarouselNavImageButton/useCarouselNavImageButton.js.map +1 -1
  82. package/lib/components/CarouselNavImageButton/useCarouselNavImageButtonStyles.styles.js +1 -2
  83. package/lib/components/CarouselSlider/CarouselSlider.js +2 -3
  84. package/lib/components/CarouselSlider/CarouselSlider.js.map +1 -1
  85. package/lib/components/CarouselSlider/CarouselSlider.types.js +3 -1
  86. package/lib/components/CarouselSlider/CarouselSlider.types.js.map +1 -1
  87. package/lib/components/CarouselSlider/CarouselSliderContext.js.map +1 -1
  88. package/lib/components/CarouselSlider/index.js.map +1 -1
  89. package/lib/components/CarouselSlider/renderCarouselSlider.js.map +1 -1
  90. package/lib/components/CarouselSlider/useCarouselSlider.js +3 -1
  91. package/lib/components/CarouselSlider/useCarouselSlider.js.map +1 -1
  92. package/lib/components/CarouselSlider/useCarouselSliderStyles.styles.js +1 -2
  93. package/lib/components/CarouselViewport/CarouselViewport.js +16 -0
  94. package/lib/components/CarouselViewport/CarouselViewport.js.map +1 -0
  95. package/lib/components/CarouselViewport/CarouselViewport.types.js +3 -0
  96. package/lib/components/CarouselViewport/CarouselViewport.types.js.map +1 -0
  97. package/lib/components/CarouselViewport/index.js +5 -0
  98. package/lib/components/CarouselViewport/index.js.map +1 -0
  99. package/lib/components/CarouselViewport/renderCarouselViewport.js +12 -0
  100. package/lib/components/CarouselViewport/renderCarouselViewport.js.map +1 -0
  101. package/lib/components/CarouselViewport/useCarouselViewport.js +28 -0
  102. package/lib/components/CarouselViewport/useCarouselViewport.js.map +1 -0
  103. package/lib/components/CarouselViewport/useCarouselViewportStyles.styles.js +25 -0
  104. package/lib/components/CarouselViewport/useCarouselViewportStyles.styles.js.map +1 -0
  105. package/lib/components/pointerEvents.js +58 -0
  106. package/lib/components/pointerEvents.js.map +1 -0
  107. package/lib/components/useEmblaCarousel.js +53 -30
  108. package/lib/components/useEmblaCarousel.js.map +1 -1
  109. package/lib/index.js +1 -0
  110. package/lib/index.js.map +1 -1
  111. package/lib-commonjs/Carousel.js.map +1 -1
  112. package/lib-commonjs/CarouselAutoplayButton.js.map +1 -1
  113. package/lib-commonjs/CarouselButton.js.map +1 -1
  114. package/lib-commonjs/CarouselCard.js.map +1 -1
  115. package/lib-commonjs/CarouselContext.js.map +1 -1
  116. package/lib-commonjs/CarouselNav.js.map +1 -1
  117. package/lib-commonjs/CarouselNavButton.js.map +1 -1
  118. package/lib-commonjs/CarouselNavContainer.js.map +1 -1
  119. package/lib-commonjs/CarouselNavImageButton.js.map +1 -1
  120. package/lib-commonjs/CarouselSlider.js.map +1 -1
  121. package/lib-commonjs/CarouselViewport.js +6 -0
  122. package/lib-commonjs/CarouselViewport.js.map +1 -0
  123. package/lib-commonjs/components/Carousel/Carousel.js +2 -3
  124. package/lib-commonjs/components/Carousel/Carousel.js.map +1 -1
  125. package/lib-commonjs/components/Carousel/Carousel.types.js.map +1 -1
  126. package/lib-commonjs/components/Carousel/index.js.map +1 -1
  127. package/lib-commonjs/components/Carousel/renderCarousel.js.map +1 -1
  128. package/lib-commonjs/components/Carousel/useCarousel.js +9 -6
  129. package/lib-commonjs/components/Carousel/useCarousel.js.map +1 -1
  130. package/lib-commonjs/components/Carousel/useCarouselContextValues.js +5 -3
  131. package/lib-commonjs/components/Carousel/useCarouselContextValues.js.map +1 -1
  132. package/lib-commonjs/components/Carousel/useCarouselStyles.styles.js +3 -12
  133. package/lib-commonjs/components/Carousel/useCarouselStyles.styles.js.map +1 -1
  134. package/lib-commonjs/components/CarouselAutoplayButton/CarouselAutoplayButton.js +2 -3
  135. package/lib-commonjs/components/CarouselAutoplayButton/CarouselAutoplayButton.js.map +1 -1
  136. package/lib-commonjs/components/CarouselAutoplayButton/CarouselAutoplayButton.types.js.map +1 -1
  137. package/lib-commonjs/components/CarouselAutoplayButton/index.js.map +1 -1
  138. package/lib-commonjs/components/CarouselAutoplayButton/renderCarouselAutoplayButton.js.map +1 -1
  139. package/lib-commonjs/components/CarouselAutoplayButton/useCarouselAutoplayButton.js.map +1 -1
  140. package/lib-commonjs/components/CarouselAutoplayButton/useCarouselAutoplayButtonStyles.styles.js +1 -1
  141. package/lib-commonjs/components/CarouselButton/CarouselButton.js +2 -3
  142. package/lib-commonjs/components/CarouselButton/CarouselButton.js.map +1 -1
  143. package/lib-commonjs/components/CarouselButton/CarouselButton.types.js.map +1 -1
  144. package/lib-commonjs/components/CarouselButton/index.js.map +1 -1
  145. package/lib-commonjs/components/CarouselButton/renderCarouselButton.js.map +1 -1
  146. package/lib-commonjs/components/CarouselButton/useCarouselButton.js.map +1 -1
  147. package/lib-commonjs/components/CarouselButton/useCarouselButtonStyles.styles.js +1 -1
  148. package/lib-commonjs/components/CarouselCard/CarouselCard.js +2 -3
  149. package/lib-commonjs/components/CarouselCard/CarouselCard.js.map +1 -1
  150. package/lib-commonjs/components/CarouselCard/CarouselCard.types.js.map +1 -1
  151. package/lib-commonjs/components/CarouselCard/index.js.map +1 -1
  152. package/lib-commonjs/components/CarouselCard/renderCarouselCard.js.map +1 -1
  153. package/lib-commonjs/components/CarouselCard/useCarouselCard.js +16 -10
  154. package/lib-commonjs/components/CarouselCard/useCarouselCard.js.map +1 -1
  155. package/lib-commonjs/components/CarouselCard/useCarouselCardStyles.styles.js +1 -1
  156. package/lib-commonjs/components/CarouselContext.js +2 -1
  157. package/lib-commonjs/components/CarouselContext.js.map +1 -1
  158. package/lib-commonjs/components/CarouselContext.types.js.map +1 -1
  159. package/lib-commonjs/components/CarouselNav/CarouselNav.js +2 -3
  160. package/lib-commonjs/components/CarouselNav/CarouselNav.js.map +1 -1
  161. package/lib-commonjs/components/CarouselNav/CarouselNav.types.js.map +1 -1
  162. package/lib-commonjs/components/CarouselNav/CarouselNavContext.js.map +1 -1
  163. package/lib-commonjs/components/CarouselNav/CarouselNavIndexContext.js.map +1 -1
  164. package/lib-commonjs/components/CarouselNav/index.js.map +1 -1
  165. package/lib-commonjs/components/CarouselNav/renderCarouselNav.js.map +1 -1
  166. package/lib-commonjs/components/CarouselNav/useCarouselNav.js.map +1 -1
  167. package/lib-commonjs/components/CarouselNav/useCarouselNavStyles.styles.js +1 -1
  168. package/lib-commonjs/components/CarouselNavButton/CarouselNavButton.js +2 -3
  169. package/lib-commonjs/components/CarouselNavButton/CarouselNavButton.js.map +1 -1
  170. package/lib-commonjs/components/CarouselNavButton/CarouselNavButton.types.js.map +1 -1
  171. package/lib-commonjs/components/CarouselNavButton/index.js.map +1 -1
  172. package/lib-commonjs/components/CarouselNavButton/renderCarouselNavButton.js.map +1 -1
  173. package/lib-commonjs/components/CarouselNavButton/useCarouselNavButton.js.map +1 -1
  174. package/lib-commonjs/components/CarouselNavButton/useCarouselNavButtonStyles.styles.js +1 -1
  175. package/lib-commonjs/components/CarouselNavContainer/CarouselNavContainer.js +2 -8
  176. package/lib-commonjs/components/CarouselNavContainer/CarouselNavContainer.js.map +1 -1
  177. package/lib-commonjs/components/CarouselNavContainer/CarouselNavContainer.types.js.map +1 -1
  178. package/lib-commonjs/components/CarouselNavContainer/index.js.map +1 -1
  179. package/lib-commonjs/components/CarouselNavContainer/renderCarouselNavContainer.js.map +1 -1
  180. package/lib-commonjs/components/CarouselNavContainer/useCarouselNavContainer.js.map +1 -1
  181. package/lib-commonjs/components/CarouselNavContainer/useCarouselNavContainerStyles.styles.js +1 -1
  182. package/lib-commonjs/components/CarouselNavImageButton/CarouselNavImageButton.js +2 -3
  183. package/lib-commonjs/components/CarouselNavImageButton/CarouselNavImageButton.js.map +1 -1
  184. package/lib-commonjs/components/CarouselNavImageButton/CarouselNavImageButton.types.js.map +1 -1
  185. package/lib-commonjs/components/CarouselNavImageButton/index.js.map +1 -1
  186. package/lib-commonjs/components/CarouselNavImageButton/renderCarouselNavImageButton.js.map +1 -1
  187. package/lib-commonjs/components/CarouselNavImageButton/useCarouselNavImageButton.js.map +1 -1
  188. package/lib-commonjs/components/CarouselNavImageButton/useCarouselNavImageButtonStyles.styles.js +1 -1
  189. package/lib-commonjs/components/CarouselSlider/CarouselSlider.js +2 -3
  190. package/lib-commonjs/components/CarouselSlider/CarouselSlider.js.map +1 -1
  191. package/lib-commonjs/components/CarouselSlider/CarouselSlider.types.js +3 -1
  192. package/lib-commonjs/components/CarouselSlider/CarouselSlider.types.js.map +1 -1
  193. package/lib-commonjs/components/CarouselSlider/CarouselSliderContext.js.map +1 -1
  194. package/lib-commonjs/components/CarouselSlider/index.js.map +1 -1
  195. package/lib-commonjs/components/CarouselSlider/renderCarouselSlider.js.map +1 -1
  196. package/lib-commonjs/components/CarouselSlider/useCarouselSlider.js +3 -1
  197. package/lib-commonjs/components/CarouselSlider/useCarouselSlider.js.map +1 -1
  198. package/lib-commonjs/components/CarouselSlider/useCarouselSliderStyles.styles.js +1 -1
  199. package/lib-commonjs/components/CarouselViewport/CarouselViewport.js +25 -0
  200. package/lib-commonjs/components/CarouselViewport/CarouselViewport.js.map +1 -0
  201. package/lib-commonjs/components/CarouselViewport/CarouselViewport.types.js +6 -0
  202. package/lib-commonjs/components/CarouselViewport/CarouselViewport.types.js.map +1 -0
  203. package/lib-commonjs/components/CarouselViewport/index.js +10 -0
  204. package/lib-commonjs/components/CarouselViewport/index.js.map +1 -0
  205. package/lib-commonjs/components/CarouselViewport/renderCarouselViewport.js +20 -0
  206. package/lib-commonjs/components/CarouselViewport/renderCarouselViewport.js.map +1 -0
  207. package/lib-commonjs/components/CarouselViewport/useCarouselViewport.js +31 -0
  208. package/lib-commonjs/components/CarouselViewport/useCarouselViewport.js.map +1 -0
  209. package/lib-commonjs/components/CarouselViewport/useCarouselViewportStyles.styles.js +41 -0
  210. package/lib-commonjs/components/CarouselViewport/useCarouselViewportStyles.styles.js.map +1 -0
  211. package/lib-commonjs/components/pointerEvents.js +68 -0
  212. package/lib-commonjs/components/pointerEvents.js.map +1 -0
  213. package/lib-commonjs/components/useEmblaCarousel.js +52 -29
  214. package/lib-commonjs/components/useEmblaCarousel.js.map +1 -1
  215. package/lib-commonjs/index.js +16 -0
  216. package/lib-commonjs/index.js.map +1 -1
  217. package/package.json +12 -22
package/CHANGELOG.md CHANGED
@@ -1,12 +1,54 @@
1
1
  # Change Log - @fluentui/react-carousel
2
2
 
3
- This log was last generated on Tue, 08 Oct 2024 22:02:29 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 11 Nov 2024 09:55:33 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.3.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-carousel_v9.3.0)
8
+
9
+ Mon, 11 Nov 2024 09:55:33 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-carousel_v9.2.0..@fluentui/react-carousel_v9.3.0)
11
+
12
+ ### Minor changes
13
+
14
+ - fix: Drag events now trigger onActiveIndexChange with drag/touch event attached ([PR #33092](https://github.com/microsoft/fluentui/pull/33092) by mifraser@microsoft.com)
15
+ - feat: Add CarouselViewport to correctly define CarouselSlider within a static container ([PR #33155](https://github.com/microsoft/fluentui/pull/33155) by mifraser@microsoft.com)
16
+ - Bump @fluentui/react-aria to v9.13.9 ([PR #31887](https://github.com/microsoft/fluentui/pull/31887) by beachball)
17
+ - Bump @fluentui/react-button to v9.3.95 ([PR #31887](https://github.com/microsoft/fluentui/pull/31887) by beachball)
18
+ - Bump @fluentui/react-context-selector to v9.1.69 ([PR #31887](https://github.com/microsoft/fluentui/pull/31887) by beachball)
19
+ - Bump @fluentui/react-jsx-runtime to v9.0.46 ([PR #31887](https://github.com/microsoft/fluentui/pull/31887) by beachball)
20
+ - Bump @fluentui/react-shared-contexts to v9.21.0 ([PR #31887](https://github.com/microsoft/fluentui/pull/31887) by beachball)
21
+ - Bump @fluentui/react-tabster to v9.23.0 ([PR #31887](https://github.com/microsoft/fluentui/pull/31887) by beachball)
22
+ - Bump @fluentui/react-theme to v9.1.22 ([PR #31887](https://github.com/microsoft/fluentui/pull/31887) by beachball)
23
+ - Bump @fluentui/react-utilities to v9.18.17 ([PR #31887](https://github.com/microsoft/fluentui/pull/31887) by beachball)
24
+
25
+ ### Patches
26
+
27
+ - fix: Ensure pointer events do not block future focus index changes ([PR #33204](https://github.com/microsoft/fluentui/pull/33204) by mifraser@microsoft.com)
28
+ - chore: replace npm-scripts and just-scrtips with nx inferred tasks ([PR #33074](https://github.com/microsoft/fluentui/pull/33074) by martinhochel@microsoft.com)
29
+ - style: resolve exposed jsx pragma lint issues within monorepo ([PR #32975](https://github.com/microsoft/fluentui/pull/32975) by martinhochel@microsoft.com)
30
+
31
+ ## [9.2.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-carousel_v9.2.0)
32
+
33
+ Tue, 15 Oct 2024 17:17:52 GMT
34
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-carousel_v9.1.0..@fluentui/react-carousel_v9.2.0)
35
+
36
+ ### Minor changes
37
+
38
+ - feat: Add fade motion to carousel as an optional prop ([PR #33000](https://github.com/microsoft/fluentui/pull/33000) by mifraser@microsoft.com)
39
+ - feat: Enable circular focus if circular, and enable animations on focus index change ([PR #33015](https://github.com/microsoft/fluentui/pull/33015) by mifraser@microsoft.com)
40
+ - Bump @fluentui/react-aria to v9.13.8 ([PR #32999](https://github.com/microsoft/fluentui/pull/32999) by beachball)
41
+ - Bump @fluentui/react-button to v9.3.94 ([PR #32999](https://github.com/microsoft/fluentui/pull/32999) by beachball)
42
+ - Bump @fluentui/react-context-selector to v9.1.68 ([PR #32999](https://github.com/microsoft/fluentui/pull/32999) by beachball)
43
+ - Bump @fluentui/react-jsx-runtime to v9.0.45 ([PR #32999](https://github.com/microsoft/fluentui/pull/32999) by beachball)
44
+ - Bump @fluentui/react-shared-contexts to v9.20.2 ([PR #32999](https://github.com/microsoft/fluentui/pull/32999) by beachball)
45
+ - Bump @fluentui/react-tabster to v9.22.9 ([PR #32999](https://github.com/microsoft/fluentui/pull/32999) by beachball)
46
+ - Bump @fluentui/react-theme to v9.1.21 ([PR #32999](https://github.com/microsoft/fluentui/pull/32999) by beachball)
47
+ - Bump @fluentui/react-utilities to v9.18.16 ([PR #32999](https://github.com/microsoft/fluentui/pull/32999) by beachball)
48
+
7
49
  ## [9.1.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-carousel_v9.1.0)
8
50
 
9
- Tue, 08 Oct 2024 22:02:29 GMT
51
+ Tue, 08 Oct 2024 22:05:56 GMT
10
52
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-carousel-preview_v0.6.0..@fluentui/react-carousel_v9.1.0)
11
53
 
12
54
  ### Minor changes
package/dist/index.d.ts CHANGED
@@ -142,6 +142,7 @@ export declare type CarouselContextValue = {
142
142
  enableAutoplay: (autoplay: boolean) => void;
143
143
  resetAutoplay: () => void;
144
144
  containerRef?: React_2.RefObject<HTMLDivElement>;
145
+ viewportRef?: React_2.RefObject<HTMLDivElement>;
145
146
  };
146
147
 
147
148
  /**
@@ -151,13 +152,18 @@ export declare type CarouselContextValues = {
151
152
  carousel: CarouselContextValue;
152
153
  };
153
154
 
154
- export declare type CarouselIndexChangeData = EventData<'click' | 'focus', React_2.FocusEvent | React_2.MouseEvent<HTMLButtonElement | HTMLAnchorElement>> & {
155
+ export declare type CarouselIndexChangeData = (EventData<'click', React_2.MouseEvent<HTMLButtonElement | HTMLAnchorElement>> | EventData<'focus', React_2.FocusEvent> | EventData<'drag', PointerEvent | MouseEvent>) & {
155
156
  /**
156
157
  * The index to be set after event has occurred.
157
158
  */
158
159
  index: number;
159
160
  };
160
161
 
162
+ /**
163
+ * List of integrated motion types
164
+ */
165
+ declare type CarouselMotion = 'slide' | 'fade';
166
+
161
167
  /**
162
168
  * Used to jump to a card based on index, using arrow navigation via Tabster.
163
169
  *
@@ -346,6 +352,11 @@ export declare type CarouselProps = ComponentProps<CarouselSlots> & {
346
352
  * Defaults to: False
347
353
  */
348
354
  whitespace?: boolean;
355
+ /**
356
+ * Sets motion to fade in/out style with minimal movement
357
+ * Defaults: false
358
+ */
359
+ motion?: CarouselMotion;
349
360
  /**
350
361
  * Localizes the string used to announce carousel page changes
351
362
  * Defaults to: undefined
@@ -396,7 +407,7 @@ export declare type CarouselSliderSlots = {
396
407
  /**
397
408
  * State used in rendering CarouselSlider
398
409
  */
399
- export declare type CarouselSliderState = ComponentState<CarouselSliderSlots> & Pick<CarouselSliderProps, 'cardFocus'>;
410
+ export declare type CarouselSliderState = ComponentState<CarouselSliderSlots> & CarouselSliderContextValue;
400
411
 
401
412
  export declare type CarouselSlots = {
402
413
  root: Slot<'div'>;
@@ -429,6 +440,30 @@ declare interface CarouselUpdateData {
429
440
  slideNodes: HTMLElement[];
430
441
  }
431
442
 
443
+ /**
444
+ * CarouselViewport component - TODO: add more docs
445
+ */
446
+ export declare const CarouselViewport: ForwardRefComponent<CarouselViewportProps>;
447
+
448
+ export declare const carouselViewportClassNames: SlotClassNames<CarouselViewportSlots>;
449
+
450
+ /**
451
+ * CarouselViewport Props
452
+ */
453
+ export declare type CarouselViewportProps = ComponentProps<CarouselViewportSlots>;
454
+
455
+ export declare type CarouselViewportSlots = {
456
+ /**
457
+ * The viewport outer container, defining the size of the carousels visible and interactable area
458
+ */
459
+ root: Slot<'div'>;
460
+ };
461
+
462
+ /**
463
+ * State used in rendering CarouselViewport
464
+ */
465
+ export declare type CarouselViewportState = ComponentState<Required<CarouselViewportSlots>> & CarouselSliderContextValue;
466
+
432
467
  export declare type NavButtonRenderFunction = (index: number) => React_2.ReactNode;
433
468
 
434
469
  /**
@@ -476,6 +511,11 @@ export declare const renderCarouselNavImageButton_unstable: (state: CarouselNavI
476
511
  */
477
512
  export declare const renderCarouselSlider_unstable: (state: CarouselSliderState, contextValues: CarouselSliderContextValues) => JSX.Element;
478
513
 
514
+ /**
515
+ * Render the final JSX of CarouselViewport
516
+ */
517
+ export declare const renderCarouselViewport_unstable: (state: CarouselViewportState, contextValues: CarouselSliderContextValues) => JSX.Element;
518
+
479
519
  /**
480
520
  * Create the state required to render Carousel.
481
521
  *
@@ -622,4 +662,20 @@ export declare const useCarouselSliderStyles_unstable: (state: CarouselSliderSta
622
662
  */
623
663
  export declare const useCarouselStyles_unstable: (state: CarouselState) => CarouselState;
624
664
 
665
+ /**
666
+ * Create the state required to render CarouselViewport.
667
+ *
668
+ * The returned state can be modified with hooks such as useCarouselViewportStyles_unstable,
669
+ * before being passed to renderCarouselViewport_unstable.
670
+ *
671
+ * @param props - props from this instance of CarouselViewport
672
+ * @param ref - reference to root HTMLDivElement of CarouselViewport
673
+ */
674
+ export declare const useCarouselViewport_unstable: (props: CarouselViewportProps, ref: React_2.Ref<HTMLDivElement>) => CarouselViewportState;
675
+
676
+ /**
677
+ * Apply styling to the CarouselViewport slots based on the state
678
+ */
679
+ export declare const useCarouselViewportStyles_unstable: (state: CarouselViewportState) => CarouselViewportState;
680
+
625
681
  export { }
@@ -1 +1 @@
1
- {"version":3,"sources":["Carousel.ts"],"sourcesContent":["export * from './components/Carousel/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,8BAA8B"}
1
+ {"version":3,"sources":["../src/Carousel.ts"],"sourcesContent":["export * from './components/Carousel/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,8BAA8B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["CarouselAutoplayButton.ts"],"sourcesContent":["export * from './components/CarouselAutoplayButton/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,4CAA4C"}
1
+ {"version":3,"sources":["../src/CarouselAutoplayButton.ts"],"sourcesContent":["export * from './components/CarouselAutoplayButton/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,4CAA4C"}
@@ -1 +1 @@
1
- {"version":3,"sources":["CarouselButton.ts"],"sourcesContent":["export * from './components/CarouselButton/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,oCAAoC"}
1
+ {"version":3,"sources":["../src/CarouselButton.ts"],"sourcesContent":["export * from './components/CarouselButton/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,oCAAoC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["CarouselCard.ts"],"sourcesContent":["export * from './components/CarouselCard/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,kCAAkC"}
1
+ {"version":3,"sources":["../src/CarouselCard.ts"],"sourcesContent":["export * from './components/CarouselCard/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,kCAAkC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["CarouselContext.ts"],"sourcesContent":["export * from './components/CarouselContext';\nexport * from './components/CarouselContext.types';\n"],"names":[],"rangeMappings":";","mappings":"AAAA,cAAc,+BAA+B;AAC7C,cAAc,qCAAqC"}
1
+ {"version":3,"sources":["../src/CarouselContext.ts"],"sourcesContent":["export * from './components/CarouselContext';\nexport * from './components/CarouselContext.types';\n"],"names":[],"rangeMappings":";","mappings":"AAAA,cAAc,+BAA+B;AAC7C,cAAc,qCAAqC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["CarouselNav.ts"],"sourcesContent":["export * from './components/CarouselNav/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,iCAAiC"}
1
+ {"version":3,"sources":["../src/CarouselNav.ts"],"sourcesContent":["export * from './components/CarouselNav/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,iCAAiC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["CarouselNavButton.ts"],"sourcesContent":["export * from './components/CarouselNavButton/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,uCAAuC"}
1
+ {"version":3,"sources":["../src/CarouselNavButton.ts"],"sourcesContent":["export * from './components/CarouselNavButton/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,uCAAuC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["CarouselNavContainer.ts"],"sourcesContent":["export * from './components/CarouselNavContainer/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,0CAA0C"}
1
+ {"version":3,"sources":["../src/CarouselNavContainer.ts"],"sourcesContent":["export * from './components/CarouselNavContainer/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,0CAA0C"}
@@ -1 +1 @@
1
- {"version":3,"sources":["CarouselNavImageButton.ts"],"sourcesContent":["export * from './components/CarouselNavImageButton/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,4CAA4C"}
1
+ {"version":3,"sources":["../src/CarouselNavImageButton.ts"],"sourcesContent":["export * from './components/CarouselNavImageButton/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,4CAA4C"}
@@ -1 +1 @@
1
- {"version":3,"sources":["CarouselSlider.ts"],"sourcesContent":["export * from './components/CarouselSlider/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,oCAAoC"}
1
+ {"version":3,"sources":["../src/CarouselSlider.ts"],"sourcesContent":["export * from './components/CarouselSlider/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,oCAAoC"}
@@ -0,0 +1 @@
1
+ export * from './components/CarouselViewport/index';
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/CarouselViewport.ts"],"sourcesContent":["export * from './components/CarouselViewport/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,sCAAsC"}
@@ -3,6 +3,7 @@ import { useCarousel_unstable } from './useCarousel';
3
3
  import { renderCarousel_unstable } from './renderCarousel';
4
4
  import { useCarouselStyles_unstable } from './useCarouselStyles.styles';
5
5
  import { useCarouselContextValues_unstable } from './useCarouselContextValues';
6
+ import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
6
7
  /**
7
8
  * Carousel is the context wrapper and container for all carousel content/controls,
8
9
  * it has no direct style or slot opinions.
@@ -11,10 +12,8 @@ import { useCarouselContextValues_unstable } from './useCarouselContextValues';
11
12
  */ export const Carousel = /*#__PURE__*/ React.forwardRef((props, ref)=>{
12
13
  const state = useCarousel_unstable(props, ref);
13
14
  useCarouselStyles_unstable(state);
15
+ useCustomStyleHook_unstable('useCarouselStyles_unstable')(state);
14
16
  const contextValues = useCarouselContextValues_unstable(state);
15
- // TODO update types in packages/react-components/react-shared-contexts/src/CustomStyleHooksContext/CustomStyleHooksContext.ts
16
- // https://github.com/microsoft/fluentui/blob/master/rfcs/react-components/convergence/custom-styling.md
17
- // useCustomStyleHook_unstable('useCarouselStyles_unstable')(state);
18
17
  return renderCarousel_unstable(state, contextValues);
19
18
  });
20
19
  Carousel.displayName = 'Carousel';
@@ -1 +1 @@
1
- {"version":3,"sources":["Carousel.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCarousel_unstable } from './useCarousel';\nimport { renderCarousel_unstable } from './renderCarousel';\nimport { useCarouselStyles_unstable } from './useCarouselStyles.styles';\nimport type { CarouselProps } from './Carousel.types';\nimport { useCarouselContextValues_unstable } from './useCarouselContextValues';\n\n/**\n * Carousel is the context wrapper and container for all carousel content/controls,\n * it has no direct style or slot opinions.\n *\n * Carousel also provides API interfaces for callbacks that will occur on navigation events.\n */\nexport const Carousel: ForwardRefComponent<CarouselProps> = React.forwardRef((props, ref) => {\n const state = useCarousel_unstable(props, ref);\n\n useCarouselStyles_unstable(state);\n\n const contextValues = useCarouselContextValues_unstable(state);\n // TODO update types in packages/react-components/react-shared-contexts/src/CustomStyleHooksContext/CustomStyleHooksContext.ts\n // https://github.com/microsoft/fluentui/blob/master/rfcs/react-components/convergence/custom-styling.md\n // useCustomStyleHook_unstable('useCarouselStyles_unstable')(state);\n return renderCarousel_unstable(state, contextValues);\n});\n\nCarousel.displayName = 'Carousel';\n"],"names":["React","useCarousel_unstable","renderCarousel_unstable","useCarouselStyles_unstable","useCarouselContextValues_unstable","Carousel","forwardRef","props","ref","state","contextValues","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,6BAA6B;AAExE,SAASC,iCAAiC,QAAQ,6BAA6B;AAE/E;;;;;CAKC,GACD,OAAO,MAAMC,yBAA+CL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACnF,MAAMC,QAAQR,qBAAqBM,OAAOC;IAE1CL,2BAA2BM;IAE3B,MAAMC,gBAAgBN,kCAAkCK;IACxD,8HAA8H;IAC9H,wGAAwG;IACxG,oEAAoE;IACpE,OAAOP,wBAAwBO,OAAOC;AACxC,GAAG;AAEHL,SAASM,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/components/Carousel/Carousel.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCarousel_unstable } from './useCarousel';\nimport { renderCarousel_unstable } from './renderCarousel';\nimport { useCarouselStyles_unstable } from './useCarouselStyles.styles';\nimport type { CarouselProps } from './Carousel.types';\nimport { useCarouselContextValues_unstable } from './useCarouselContextValues';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Carousel is the context wrapper and container for all carousel content/controls,\n * it has no direct style or slot opinions.\n *\n * Carousel also provides API interfaces for callbacks that will occur on navigation events.\n */\nexport const Carousel: ForwardRefComponent<CarouselProps> = React.forwardRef((props, ref) => {\n const state = useCarousel_unstable(props, ref);\n\n useCarouselStyles_unstable(state);\n useCustomStyleHook_unstable('useCarouselStyles_unstable')(state);\n\n const contextValues = useCarouselContextValues_unstable(state);\n\n return renderCarousel_unstable(state, contextValues);\n});\n\nCarousel.displayName = 'Carousel';\n"],"names":["React","useCarousel_unstable","renderCarousel_unstable","useCarouselStyles_unstable","useCarouselContextValues_unstable","useCustomStyleHook_unstable","Carousel","forwardRef","props","ref","state","contextValues","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,6BAA6B;AAExE,SAASC,iCAAiC,QAAQ,6BAA6B;AAC/E,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;;;;CAKC,GACD,OAAO,MAAMC,yBAA+CN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IACnF,MAAMC,QAAQT,qBAAqBO,OAAOC;IAE1CN,2BAA2BO;IAC3BL,4BAA4B,8BAA8BK;IAE1D,MAAMC,gBAAgBP,kCAAkCM;IAExD,OAAOR,wBAAwBQ,OAAOC;AACxC,GAAG;AAEHL,SAASM,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["Carousel.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, EventHandler, Slot } from '@fluentui/react-utilities';\nimport type { CarouselContextValue, CarouselIndexChangeData } from '../CarouselContext.types';\n\nexport type CarouselSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * Children function replacement, passes through updated context index and carousel information for localization\n */\nexport type CarouselAnnouncerFunction = (index: number, totalSlides: number, slideGroupList: number[][]) => string;\n\n/**\n * Carousel Props\n */\nexport type CarouselProps = ComponentProps<CarouselSlots> & {\n /**\n * The initial page to display in uncontrolled mode.\n */\n defaultActiveIndex?: number;\n\n /**\n * The alignment of the carousel.\n */\n align?: 'center' | 'start' | 'end';\n\n /**\n * The value of the currently active page.\n */\n activeIndex?: number;\n\n /**\n * Callback to notify a page change.\n */\n onActiveIndexChange?: EventHandler<CarouselIndexChangeData>;\n\n /**\n * Circular enables the carousel to loop back around on navigation past trailing index.\n */\n circular?: boolean;\n\n /**\n * Controls the number of carousel cards per navigation element, will default to 'auto'\n * Recommended to set to '1' when using full page carousel cards.\n */\n groupSize?: number | 'auto';\n\n /**\n * Enables drag to scroll on carousel items.\n * Defaults to: False\n */\n draggable?: boolean;\n\n /**\n * Adds whitespace to start/end so that 'align' prop is always respected for current index\n * Defaults to: False\n */\n whitespace?: boolean;\n\n /**\n * Localizes the string used to announce carousel page changes\n * Defaults to: undefined\n */\n announcement?: CarouselAnnouncerFunction;\n};\n\n/**\n * State used in rendering Carousel\n */\nexport type CarouselState = ComponentState<CarouselSlots> & CarouselContextValue;\n\nexport interface CarouselVisibilityEventDetail {\n isVisible: boolean;\n}\n\nexport type CarouselVisibilityChangeEvent = CustomEvent<CarouselVisibilityEventDetail>;\n\n/**\n * @internal\n */\nexport interface CarouselUpdateData {\n /**\n * The current carousel index, a change in index will not trigger the callback (use context index instead).\n */\n activeIndex: number;\n /**\n * The total number of slides to be navigated, accounts for grouping.\n */\n navItemsCount: number;\n /**\n * A breakdown of the card indexes contained within each slide index.\n */\n groupIndexList: number[][];\n /**\n * An array of the card DOM elements after render\n */\n slideNodes: HTMLElement[];\n}\n"],"names":[],"rangeMappings":";;","mappings":"AA6EA;;CAEC,GACD,WAiBC"}
1
+ {"version":3,"sources":["../src/components/Carousel/Carousel.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, EventHandler, Slot } from '@fluentui/react-utilities';\nimport type { CarouselContextValue, CarouselIndexChangeData } from '../CarouselContext.types';\n\nexport type CarouselSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * Children function replacement, passes through updated context index and carousel information for localization\n */\nexport type CarouselAnnouncerFunction = (index: number, totalSlides: number, slideGroupList: number[][]) => string;\n\n/**\n * List of integrated motion types\n */\nexport type CarouselMotion = 'slide' | 'fade';\n\n/**\n * Carousel Props\n */\nexport type CarouselProps = ComponentProps<CarouselSlots> & {\n /**\n * The initial page to display in uncontrolled mode.\n */\n defaultActiveIndex?: number;\n\n /**\n * The alignment of the carousel.\n */\n align?: 'center' | 'start' | 'end';\n\n /**\n * The value of the currently active page.\n */\n activeIndex?: number;\n\n /**\n * Callback to notify a page change.\n */\n onActiveIndexChange?: EventHandler<CarouselIndexChangeData>;\n\n /**\n * Circular enables the carousel to loop back around on navigation past trailing index.\n */\n circular?: boolean;\n\n /**\n * Controls the number of carousel cards per navigation element, will default to 'auto'\n * Recommended to set to '1' when using full page carousel cards.\n */\n groupSize?: number | 'auto';\n\n /**\n * Enables drag to scroll on carousel items.\n * Defaults to: False\n */\n draggable?: boolean;\n\n /**\n * Adds whitespace to start/end so that 'align' prop is always respected for current index\n * Defaults to: False\n */\n whitespace?: boolean;\n\n /**\n * Sets motion to fade in/out style with minimal movement\n * Defaults: false\n */\n motion?: CarouselMotion;\n\n /**\n * Localizes the string used to announce carousel page changes\n * Defaults to: undefined\n */\n announcement?: CarouselAnnouncerFunction;\n};\n\n/**\n * State used in rendering Carousel\n */\nexport type CarouselState = ComponentState<CarouselSlots> & CarouselContextValue;\n\nexport interface CarouselVisibilityEventDetail {\n isVisible: boolean;\n}\n\nexport type CarouselVisibilityChangeEvent = CustomEvent<CarouselVisibilityEventDetail>;\n\n/**\n * @internal\n */\nexport interface CarouselUpdateData {\n /**\n * The current carousel index, a change in index will not trigger the callback (use context index instead).\n */\n activeIndex: number;\n /**\n * The total number of slides to be navigated, accounts for grouping.\n */\n navItemsCount: number;\n /**\n * A breakdown of the card indexes contained within each slide index.\n */\n groupIndexList: number[][];\n /**\n * An array of the card DOM elements after render\n */\n slideNodes: HTMLElement[];\n}\n"],"names":[],"rangeMappings":";;","mappings":"AAwFA;;CAEC,GACD,WAiBC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Carousel';\nexport * from './Carousel.types';\nexport * from './renderCarousel';\nexport * from './useCarousel';\nexport * from './useCarouselStyles.styles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,aAAa;AAC3B,cAAc,mBAAmB;AACjC,cAAc,mBAAmB;AACjC,cAAc,gBAAgB;AAC9B,cAAc,6BAA6B"}
1
+ {"version":3,"sources":["../src/components/Carousel/index.ts"],"sourcesContent":["export * from './Carousel';\nexport * from './Carousel.types';\nexport * from './renderCarousel';\nexport * from './useCarousel';\nexport * from './useCarouselStyles.styles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,aAAa;AAC3B,cAAc,mBAAmB;AACjC,cAAc,mBAAmB;AACjC,cAAc,gBAAgB;AAC9B,cAAc,6BAA6B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["renderCarousel.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { CarouselState, CarouselSlots } from './Carousel.types';\nimport { CarouselProvider } from '../CarouselContext';\nimport type { CarouselContextValues } from '../CarouselContext.types';\n\n/**\n * Render the final JSX of Carousel\n */\nexport const renderCarousel_unstable = (state: CarouselState, contextValues: CarouselContextValues) => {\n assertSlots<CarouselSlots>(state);\n\n return (\n <CarouselProvider value={contextValues.carousel}>\n <state.root />\n </CarouselProvider>\n );\n};\n"],"names":["assertSlots","CarouselProvider","renderCarousel_unstable","state","contextValues","value","carousel","root"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAExD,SAASC,gBAAgB,QAAQ,qBAAqB;AAGtD;;CAEC,GACD,OAAO,MAAMC,0BAA0B,CAACC,OAAsBC;IAC5DJ,YAA2BG;IAE3B,qBACE,KAACF;QAAiBI,OAAOD,cAAcE,QAAQ;kBAC7C,cAAA,KAACH,MAAMI,IAAI;;AAGjB,EAAE"}
1
+ {"version":3,"sources":["../src/components/Carousel/renderCarousel.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { CarouselState, CarouselSlots } from './Carousel.types';\nimport { CarouselProvider } from '../CarouselContext';\nimport type { CarouselContextValues } from '../CarouselContext.types';\n\n/**\n * Render the final JSX of Carousel\n */\nexport const renderCarousel_unstable = (state: CarouselState, contextValues: CarouselContextValues) => {\n assertSlots<CarouselSlots>(state);\n\n return (\n <CarouselProvider value={contextValues.carousel}>\n <state.root />\n </CarouselProvider>\n );\n};\n"],"names":["assertSlots","CarouselProvider","renderCarousel_unstable","state","contextValues","value","carousel","root"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAExD,SAASC,gBAAgB,QAAQ,qBAAqB;AAGtD;;CAEC,GACD,OAAO,MAAMC,0BAA0B,CAACC,OAAsBC;IAC5DJ,YAA2BG;IAE3B,qBACE,KAACF;QAAiBI,OAAOD,cAAcE,QAAQ;kBAC7C,cAAA,KAACH,MAAMI,IAAI;;AAGjB,EAAE"}
@@ -13,9 +13,9 @@ import { useAnnounce } from '@fluentui/react-shared-contexts';
13
13
  * @param ref - reference to root HTMLDivElement of Carousel
14
14
  */ export function useCarousel_unstable(props, ref) {
15
15
  'use no memo';
16
- const { align = 'center', circular = false, onActiveIndexChange, groupSize = 'auto', draggable = false, whitespace = false, announcement } = props;
16
+ const { align = 'center', circular = false, onActiveIndexChange, groupSize = 'auto', draggable = false, whitespace = false, announcement, motion = 'slide' } = props;
17
17
  const { dir } = useFluent();
18
- const { activeIndex, carouselApi, containerRef, subscribeForValues, enableAutoplay, resetAutoplay } = useEmblaCarousel({
18
+ const { activeIndex, carouselApi, containerRef, viewportRef, subscribeForValues, enableAutoplay, resetAutoplay } = useEmblaCarousel({
19
19
  align,
20
20
  direction: dir,
21
21
  loop: circular,
@@ -23,7 +23,9 @@ import { useAnnounce } from '@fluentui/react-shared-contexts';
23
23
  defaultActiveIndex: props.defaultActiveIndex,
24
24
  activeIndex: props.activeIndex,
25
25
  watchDrag: draggable,
26
- containScroll: whitespace ? false : 'keepSnaps'
26
+ containScroll: whitespace ? false : 'keepSnaps',
27
+ motion,
28
+ onDragIndexChange: onActiveIndexChange
27
29
  });
28
30
  const selectPageByElement = useEventCallback((event, element, jump)=>{
29
31
  const foundIndex = carouselApi.scrollToElement(element, jump);
@@ -51,7 +53,7 @@ import { useAnnounce } from '@fluentui/react-shared-contexts';
51
53
  });
52
54
  return nextPageIndex;
53
55
  });
54
- const mergedRefs = useMergedRefs(ref, containerRef);
56
+ const mergedContainerRef = useMergedRefs(ref, containerRef);
55
57
  // Announce carousel updates
56
58
  const announcementTextRef = React.useRef('');
57
59
  const totalNavLength = React.useRef(0);
@@ -98,7 +100,7 @@ import { useAnnounce } from '@fluentui/react-shared-contexts';
98
100
  root: 'div'
99
101
  },
100
102
  root: slot.always(getIntrinsicElementProps('div', {
101
- ref: mergedRefs,
103
+ ref: mergedContainerRef,
102
104
  role: 'region',
103
105
  ...props
104
106
  }), {
@@ -106,7 +108,8 @@ import { useAnnounce } from '@fluentui/react-shared-contexts';
106
108
  }),
107
109
  activeIndex,
108
110
  circular,
109
- containerRef: mergedRefs,
111
+ containerRef: mergedContainerRef,
112
+ viewportRef,
110
113
  selectPageByElement,
111
114
  selectPageByDirection,
112
115
  selectPageByIndex,
@@ -1 +1 @@
1
- {"version":3,"sources":["useCarousel.ts"],"sourcesContent":["import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport {\n getIntrinsicElementProps,\n slot,\n useEventCallback,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nimport type { CarouselProps, CarouselState } from './Carousel.types';\nimport type { CarouselContextValue } from '../CarouselContext.types';\nimport { useEmblaCarousel } from '../useEmblaCarousel';\nimport { useAnnounce } from '@fluentui/react-shared-contexts';\n\n/**\n * Create the state required to render Carousel.\n *\n * The returned state can be modified with hooks such as useCarouselStyles_unstable,\n * before being passed to renderCarousel_unstable.\n *\n * @param props - props from this instance of Carousel\n * @param ref - reference to root HTMLDivElement of Carousel\n */\nexport function useCarousel_unstable(props: CarouselProps, ref: React.Ref<HTMLDivElement>): CarouselState {\n 'use no memo';\n\n const {\n align = 'center',\n circular = false,\n onActiveIndexChange,\n groupSize = 'auto',\n draggable = false,\n whitespace = false,\n announcement,\n } = props;\n\n const { dir } = useFluent();\n const { activeIndex, carouselApi, containerRef, subscribeForValues, enableAutoplay, resetAutoplay } =\n useEmblaCarousel({\n align,\n direction: dir,\n loop: circular,\n slidesToScroll: groupSize,\n defaultActiveIndex: props.defaultActiveIndex,\n activeIndex: props.activeIndex,\n watchDrag: draggable,\n containScroll: whitespace ? false : 'keepSnaps',\n });\n\n const selectPageByElement: CarouselContextValue['selectPageByElement'] = useEventCallback((event, element, jump) => {\n const foundIndex = carouselApi.scrollToElement(element, jump);\n onActiveIndexChange?.(event, { event, type: 'focus', index: foundIndex });\n\n return foundIndex;\n });\n\n const selectPageByIndex: CarouselContextValue['selectPageByIndex'] = useEventCallback((event, index, jump) => {\n carouselApi.scrollToIndex(index, jump);\n\n onActiveIndexChange?.(event, { event, type: 'click', index });\n });\n\n const selectPageByDirection: CarouselContextValue['selectPageByDirection'] = useEventCallback((event, direction) => {\n const nextPageIndex = carouselApi.scrollInDirection(direction);\n onActiveIndexChange?.(event, { event, type: 'click', index: nextPageIndex });\n\n return nextPageIndex;\n });\n\n const mergedRefs = useMergedRefs(ref, containerRef);\n\n // Announce carousel updates\n const announcementTextRef = React.useRef<string>('');\n const totalNavLength = React.useRef<number>(0);\n const navGroupRef = React.useRef<number[][]>([]);\n\n const { announce } = useAnnounce();\n\n const updateAnnouncement = useEventCallback(() => {\n if (totalNavLength.current <= 0 || !announcement) {\n // Ignore announcements until slides discovered\n return;\n }\n\n const announcementText = announcement(activeIndex, totalNavLength.current, navGroupRef.current);\n\n if (announcementText !== announcementTextRef.current) {\n announcementTextRef.current = announcementText;\n announce(announcementText, { polite: true });\n }\n });\n\n useIsomorphicLayoutEffect(() => {\n // Subscribe to any non-index carousel state changes\n return subscribeForValues(data => {\n if (totalNavLength.current <= 0 && data.navItemsCount > 0 && announcement) {\n const announcementText = announcement(data.activeIndex, data.navItemsCount, data.groupIndexList);\n // Initialize our string to prevent updateAnnouncement from reading an initial load\n announcementTextRef.current = announcementText;\n }\n totalNavLength.current = data.navItemsCount;\n navGroupRef.current = data.groupIndexList;\n updateAnnouncement();\n });\n }, [subscribeForValues, updateAnnouncement, announcement]);\n\n useIsomorphicLayoutEffect(() => {\n updateAnnouncement();\n }, [activeIndex, updateAnnouncement]);\n\n return {\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref: mergedRefs,\n role: 'region',\n ...props,\n }),\n { elementType: 'div' },\n ),\n\n activeIndex,\n circular,\n containerRef: mergedRefs,\n selectPageByElement,\n selectPageByDirection,\n selectPageByIndex,\n subscribeForValues,\n enableAutoplay,\n resetAutoplay,\n };\n}\n"],"names":["useFluent_unstable","useFluent","getIntrinsicElementProps","slot","useEventCallback","useIsomorphicLayoutEffect","useMergedRefs","React","useEmblaCarousel","useAnnounce","useCarousel_unstable","props","ref","align","circular","onActiveIndexChange","groupSize","draggable","whitespace","announcement","dir","activeIndex","carouselApi","containerRef","subscribeForValues","enableAutoplay","resetAutoplay","direction","loop","slidesToScroll","defaultActiveIndex","watchDrag","containScroll","selectPageByElement","event","element","jump","foundIndex","scrollToElement","type","index","selectPageByIndex","scrollToIndex","selectPageByDirection","nextPageIndex","scrollInDirection","mergedRefs","announcementTextRef","useRef","totalNavLength","navGroupRef","announce","updateAnnouncement","current","announcementText","polite","data","navItemsCount","groupIndexList","components","root","always","role","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
1
+ {"version":3,"sources":["../src/components/Carousel/useCarousel.ts"],"sourcesContent":["import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport {\n getIntrinsicElementProps,\n slot,\n useEventCallback,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nimport type { CarouselProps, CarouselState } from './Carousel.types';\nimport type { CarouselContextValue } from '../CarouselContext.types';\nimport { useEmblaCarousel } from '../useEmblaCarousel';\nimport { useAnnounce } from '@fluentui/react-shared-contexts';\n\n/**\n * Create the state required to render Carousel.\n *\n * The returned state can be modified with hooks such as useCarouselStyles_unstable,\n * before being passed to renderCarousel_unstable.\n *\n * @param props - props from this instance of Carousel\n * @param ref - reference to root HTMLDivElement of Carousel\n */\nexport function useCarousel_unstable(props: CarouselProps, ref: React.Ref<HTMLDivElement>): CarouselState {\n 'use no memo';\n\n const {\n align = 'center',\n circular = false,\n onActiveIndexChange,\n groupSize = 'auto',\n draggable = false,\n whitespace = false,\n announcement,\n motion = 'slide',\n } = props;\n\n const { dir } = useFluent();\n const { activeIndex, carouselApi, containerRef, viewportRef, subscribeForValues, enableAutoplay, resetAutoplay } =\n useEmblaCarousel({\n align,\n direction: dir,\n loop: circular,\n slidesToScroll: groupSize,\n defaultActiveIndex: props.defaultActiveIndex,\n activeIndex: props.activeIndex,\n watchDrag: draggable,\n containScroll: whitespace ? false : 'keepSnaps',\n motion,\n onDragIndexChange: onActiveIndexChange,\n });\n\n const selectPageByElement: CarouselContextValue['selectPageByElement'] = useEventCallback((event, element, jump) => {\n const foundIndex = carouselApi.scrollToElement(element, jump);\n onActiveIndexChange?.(event, { event, type: 'focus', index: foundIndex });\n\n return foundIndex;\n });\n\n const selectPageByIndex: CarouselContextValue['selectPageByIndex'] = useEventCallback((event, index, jump) => {\n carouselApi.scrollToIndex(index, jump);\n\n onActiveIndexChange?.(event, { event, type: 'click', index });\n });\n\n const selectPageByDirection: CarouselContextValue['selectPageByDirection'] = useEventCallback((event, direction) => {\n const nextPageIndex = carouselApi.scrollInDirection(direction);\n onActiveIndexChange?.(event, { event, type: 'click', index: nextPageIndex });\n\n return nextPageIndex;\n });\n\n const mergedContainerRef = useMergedRefs(ref, containerRef);\n\n // Announce carousel updates\n const announcementTextRef = React.useRef<string>('');\n const totalNavLength = React.useRef<number>(0);\n const navGroupRef = React.useRef<number[][]>([]);\n\n const { announce } = useAnnounce();\n\n const updateAnnouncement = useEventCallback(() => {\n if (totalNavLength.current <= 0 || !announcement) {\n // Ignore announcements until slides discovered\n return;\n }\n\n const announcementText = announcement(activeIndex, totalNavLength.current, navGroupRef.current);\n\n if (announcementText !== announcementTextRef.current) {\n announcementTextRef.current = announcementText;\n announce(announcementText, { polite: true });\n }\n });\n\n useIsomorphicLayoutEffect(() => {\n // Subscribe to any non-index carousel state changes\n return subscribeForValues(data => {\n if (totalNavLength.current <= 0 && data.navItemsCount > 0 && announcement) {\n const announcementText = announcement(data.activeIndex, data.navItemsCount, data.groupIndexList);\n // Initialize our string to prevent updateAnnouncement from reading an initial load\n announcementTextRef.current = announcementText;\n }\n totalNavLength.current = data.navItemsCount;\n navGroupRef.current = data.groupIndexList;\n updateAnnouncement();\n });\n }, [subscribeForValues, updateAnnouncement, announcement]);\n\n useIsomorphicLayoutEffect(() => {\n updateAnnouncement();\n }, [activeIndex, updateAnnouncement]);\n\n return {\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref: mergedContainerRef,\n role: 'region',\n ...props,\n }),\n { elementType: 'div' },\n ),\n\n activeIndex,\n circular,\n containerRef: mergedContainerRef,\n viewportRef,\n selectPageByElement,\n selectPageByDirection,\n selectPageByIndex,\n subscribeForValues,\n enableAutoplay,\n resetAutoplay,\n };\n}\n"],"names":["useFluent_unstable","useFluent","getIntrinsicElementProps","slot","useEventCallback","useIsomorphicLayoutEffect","useMergedRefs","React","useEmblaCarousel","useAnnounce","useCarousel_unstable","props","ref","align","circular","onActiveIndexChange","groupSize","draggable","whitespace","announcement","motion","dir","activeIndex","carouselApi","containerRef","viewportRef","subscribeForValues","enableAutoplay","resetAutoplay","direction","loop","slidesToScroll","defaultActiveIndex","watchDrag","containScroll","onDragIndexChange","selectPageByElement","event","element","jump","foundIndex","scrollToElement","type","index","selectPageByIndex","scrollToIndex","selectPageByDirection","nextPageIndex","scrollInDirection","mergedContainerRef","announcementTextRef","useRef","totalNavLength","navGroupRef","announce","updateAnnouncement","current","announcementText","polite","data","navItemsCount","groupIndexList","components","root","always","role","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  export function useCarouselContextValues_unstable(state) {
3
- const { activeIndex, selectPageByElement, selectPageByDirection, selectPageByIndex, subscribeForValues, enableAutoplay, resetAutoplay, circular, containerRef } = state;
3
+ const { activeIndex, selectPageByElement, selectPageByDirection, selectPageByIndex, subscribeForValues, enableAutoplay, resetAutoplay, circular, containerRef, viewportRef } = state;
4
4
  const carousel = React.useMemo(()=>({
5
5
  activeIndex,
6
6
  selectPageByElement,
@@ -10,7 +10,8 @@ export function useCarouselContextValues_unstable(state) {
10
10
  enableAutoplay,
11
11
  resetAutoplay,
12
12
  circular,
13
- containerRef
13
+ containerRef,
14
+ viewportRef
14
15
  }), [
15
16
  activeIndex,
16
17
  selectPageByElement,
@@ -20,7 +21,8 @@ export function useCarouselContextValues_unstable(state) {
20
21
  enableAutoplay,
21
22
  resetAutoplay,
22
23
  circular,
23
- containerRef
24
+ containerRef,
25
+ viewportRef
24
26
  ]);
25
27
  return {
26
28
  carousel
@@ -1 +1 @@
1
- {"version":3,"sources":["useCarouselContextValues.ts"],"sourcesContent":["import * as React from 'react';\n\nimport type { CarouselContextValues } from '../CarouselContext.types';\nimport type { CarouselState } from './Carousel.types';\n\nexport function useCarouselContextValues_unstable(state: CarouselState): CarouselContextValues {\n const {\n activeIndex,\n selectPageByElement,\n selectPageByDirection,\n selectPageByIndex,\n subscribeForValues,\n enableAutoplay,\n resetAutoplay,\n circular,\n containerRef,\n } = state;\n\n const carousel = React.useMemo(\n () => ({\n activeIndex,\n selectPageByElement,\n selectPageByDirection,\n selectPageByIndex,\n subscribeForValues,\n enableAutoplay,\n resetAutoplay,\n circular,\n containerRef,\n }),\n [\n activeIndex,\n selectPageByElement,\n selectPageByDirection,\n selectPageByIndex,\n subscribeForValues,\n enableAutoplay,\n resetAutoplay,\n circular,\n containerRef,\n ],\n );\n\n return { carousel };\n}\n"],"names":["React","useCarouselContextValues_unstable","state","activeIndex","selectPageByElement","selectPageByDirection","selectPageByIndex","subscribeForValues","enableAutoplay","resetAutoplay","circular","containerRef","carousel","useMemo"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAK/B,OAAO,SAASC,kCAAkCC,KAAoB;IACpE,MAAM,EACJC,WAAW,EACXC,mBAAmB,EACnBC,qBAAqB,EACrBC,iBAAiB,EACjBC,kBAAkB,EAClBC,cAAc,EACdC,aAAa,EACbC,QAAQ,EACRC,YAAY,EACb,GAAGT;IAEJ,MAAMU,WAAWZ,MAAMa,OAAO,CAC5B,IAAO,CAAA;YACLV;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;QACF,CAAA,GACA;QACER;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;KACD;IAGH,OAAO;QAAEC;IAAS;AACpB"}
1
+ {"version":3,"sources":["../src/components/Carousel/useCarouselContextValues.ts"],"sourcesContent":["import * as React from 'react';\n\nimport type { CarouselContextValues } from '../CarouselContext.types';\nimport type { CarouselState } from './Carousel.types';\n\nexport function useCarouselContextValues_unstable(state: CarouselState): CarouselContextValues {\n const {\n activeIndex,\n selectPageByElement,\n selectPageByDirection,\n selectPageByIndex,\n subscribeForValues,\n enableAutoplay,\n resetAutoplay,\n circular,\n containerRef,\n viewportRef,\n } = state;\n\n const carousel = React.useMemo(\n () => ({\n activeIndex,\n selectPageByElement,\n selectPageByDirection,\n selectPageByIndex,\n subscribeForValues,\n enableAutoplay,\n resetAutoplay,\n circular,\n containerRef,\n viewportRef,\n }),\n [\n activeIndex,\n selectPageByElement,\n selectPageByDirection,\n selectPageByIndex,\n subscribeForValues,\n enableAutoplay,\n resetAutoplay,\n circular,\n containerRef,\n viewportRef,\n ],\n );\n\n return { carousel };\n}\n"],"names":["React","useCarouselContextValues_unstable","state","activeIndex","selectPageByElement","selectPageByDirection","selectPageByIndex","subscribeForValues","enableAutoplay","resetAutoplay","circular","containerRef","viewportRef","carousel","useMemo"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAK/B,OAAO,SAASC,kCAAkCC,KAAoB;IACpE,MAAM,EACJC,WAAW,EACXC,mBAAmB,EACnBC,qBAAqB,EACrBC,iBAAiB,EACjBC,kBAAkB,EAClBC,cAAc,EACdC,aAAa,EACbC,QAAQ,EACRC,YAAY,EACZC,WAAW,EACZ,GAAGV;IAEJ,MAAMW,WAAWb,MAAMc,OAAO,CAC5B,IAAO,CAAA;YACLX;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;QACF,CAAA,GACA;QACET;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;KACD;IAGH,OAAO;QAAEC;IAAS;AACpB"}
@@ -1,5 +1,4 @@
1
1
  import { __styles, mergeClasses } from '@griffel/react';
2
- import { tokens } from '@fluentui/react-theme';
3
2
  export const carouselClassNames = {
4
3
  root: 'fui-Carousel'
5
4
  };
@@ -8,17 +7,12 @@ export const carouselClassNames = {
8
7
  */
9
8
  const useStyles = /*#__PURE__*/__styles({
10
9
  root: {
11
- z8tnut: "fr4fn7s",
12
- B68tc82: 0,
13
- Bmxbyg5: 0,
14
- Bpg54ce: "f1a3p1vp",
10
+ B68tc82: "f1p9o1ba",
15
11
  Eiaeu8: "f1115ve7",
16
12
  qhf8xq: "f10pi13n"
17
13
  }
18
14
  }, {
19
- d: [".fr4fn7s{padding-top:var(--strokeWidthThick);}", [".f1a3p1vp{overflow:hidden;}", {
20
- p: -1
21
- }], ".f1115ve7{overflow-anchor:none;}", ".f10pi13n{position:relative;}"]
15
+ d: [".f1p9o1ba{overflow-x:hidden;}", ".f1115ve7{overflow-anchor:none;}", ".f10pi13n{position:relative;}"]
22
16
  });
23
17
  /**
24
18
  * Apply styling to the Carousel slots based on the state
@@ -29,5 +23,4 @@ export const useCarouselStyles_unstable = state => {
29
23
  const styles = useStyles();
30
24
  state.root.className = mergeClasses(carouselClassNames.root, styles.root, state.root.className);
31
25
  return state;
32
- };
33
- //# sourceMappingURL=useCarouselStyles.styles.js.map
26
+ };
@@ -1 +1 @@
1
- {"version":3,"names":["__styles","mergeClasses","tokens","carouselClassNames","root","useStyles","z8tnut","B68tc82","Bmxbyg5","Bpg54ce","Eiaeu8","qhf8xq","d","p","useCarouselStyles_unstable","state","styles","className"],"sources":["useCarouselStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const carouselClassNames = {\n root: 'fui-Carousel'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n paddingTop: tokens.strokeWidthThick,\n overflow: 'hidden',\n overflowAnchor: 'none',\n position: 'relative'\n }\n});\n/**\n * Apply styling to the Carousel slots based on the state\n */ export const useCarouselStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n state.root.className = mergeClasses(carouselClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,OAAO,MAAMC,kBAAkB,GAAG;EAC9BC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGL,QAAA;EAAAI,IAAA;IAAAE,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;IAAAC,CAAA;EAAA;AAAA,CAOrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,0BAA0B,GAAIC,KAAK,IAAG;EACnD,aAAa;;EACb,MAAMC,MAAM,GAAGX,SAAS,CAAC,CAAC;EAC1BU,KAAK,CAACX,IAAI,CAACa,SAAS,GAAGhB,YAAY,CAACE,kBAAkB,CAACC,IAAI,EAAEY,MAAM,CAACZ,IAAI,EAAEW,KAAK,CAACX,IAAI,CAACa,SAAS,CAAC;EAC/F,OAAOF,KAAK;AAChB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__styles","mergeClasses","carouselClassNames","root","useStyles","B68tc82","Eiaeu8","qhf8xq","d","useCarouselStyles_unstable","state","styles","className"],"sources":["useCarouselStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nexport const carouselClassNames = {\n root: 'fui-Carousel'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n // Only hide horizontal overflow to enable focus border to bleed bounds vertically\n overflowX: 'hidden',\n overflowAnchor: 'none',\n position: 'relative'\n }\n});\n/**\n * Apply styling to the Carousel slots based on the state\n */ export const useCarouselStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n state.root.className = mergeClasses(carouselClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,OAAO,MAAMC,kBAAkB,GAAG;EAC9BC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGJ,QAAA;EAAAG,IAAA;IAAAE,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAOrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,0BAA0B,GAAIC,KAAK,IAAG;EACnD,aAAa;;EACb,MAAMC,MAAM,GAAGP,SAAS,CAAC,CAAC;EAC1BM,KAAK,CAACP,IAAI,CAACS,SAAS,GAAGX,YAAY,CAACC,kBAAkB,CAACC,IAAI,EAAEQ,MAAM,CAACR,IAAI,EAAEO,KAAK,CAACP,IAAI,CAACS,SAAS,CAAC;EAC/F,OAAOF,KAAK;AAChB,CAAC","ignoreList":[]}
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import { useCarouselAutoplayButton_unstable } from './useCarouselAutoplayButton';
3
3
  import { renderCarouselAutoplayButton_unstable } from './renderCarouselAutoplayButton';
4
4
  import { useCarouselAutoplayButtonStyles_unstable } from './useCarouselAutoplayButtonStyles.styles';
5
+ import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
5
6
  /**
6
7
  * If the Carousel is on auto-play, the user may opt into pausing the auto-play feature via the
7
8
  * CarouselAutoplayButton which must be present for auto-play to be enabled.
@@ -10,9 +11,7 @@ import { useCarouselAutoplayButtonStyles_unstable } from './useCarouselAutoplayB
10
11
  */ export const CarouselAutoplayButton = /*#__PURE__*/ React.forwardRef((props, ref)=>{
11
12
  const state = useCarouselAutoplayButton_unstable(props, ref);
12
13
  useCarouselAutoplayButtonStyles_unstable(state);
13
- // TODO update types in packages/react-components/react-shared-contexts/src/CustomStyleHooksContext/CustomStyleHooksContext.ts
14
- // https://github.com/microsoft/fluentui/blob/master/rfcs/react-components/convergence/custom-styling.md
15
- // useCustomStyleHook_unstable('useCarouselAutoplayButtonStyles_unstable')(state);
14
+ useCustomStyleHook_unstable('useCarouselAutoplayButtonStyles_unstable')(state);
16
15
  return renderCarouselAutoplayButton_unstable(state);
17
16
  });
18
17
  CarouselAutoplayButton.displayName = 'CarouselAutoplayButton';
@@ -1 +1 @@
1
- {"version":3,"sources":["CarouselAutoplayButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCarouselAutoplayButton_unstable } from './useCarouselAutoplayButton';\nimport { renderCarouselAutoplayButton_unstable } from './renderCarouselAutoplayButton';\nimport { useCarouselAutoplayButtonStyles_unstable } from './useCarouselAutoplayButtonStyles.styles';\nimport type { CarouselAutoplayButtonProps } from './CarouselAutoplayButton.types';\n\n/**\n * If the Carousel is on auto-play, the user may opt into pausing the auto-play feature via the\n * CarouselAutoplayButton which must be present for auto-play to be enabled.\n *\n * If CarouselAutoplayButton is present, auto-play will default to true on mount.\n */\nexport const CarouselAutoplayButton: ForwardRefComponent<CarouselAutoplayButtonProps> = React.forwardRef(\n (props, ref) => {\n const state = useCarouselAutoplayButton_unstable(props, ref);\n\n useCarouselAutoplayButtonStyles_unstable(state);\n // TODO update types in packages/react-components/react-shared-contexts/src/CustomStyleHooksContext/CustomStyleHooksContext.ts\n // https://github.com/microsoft/fluentui/blob/master/rfcs/react-components/convergence/custom-styling.md\n // useCustomStyleHook_unstable('useCarouselAutoplayButtonStyles_unstable')(state);\n return renderCarouselAutoplayButton_unstable(state);\n },\n);\n\nCarouselAutoplayButton.displayName = 'CarouselAutoplayButton';\n"],"names":["React","useCarouselAutoplayButton_unstable","renderCarouselAutoplayButton_unstable","useCarouselAutoplayButtonStyles_unstable","CarouselAutoplayButton","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,kCAAkC,QAAQ,8BAA8B;AACjF,SAASC,qCAAqC,QAAQ,iCAAiC;AACvF,SAASC,wCAAwC,QAAQ,2CAA2C;AAGpG;;;;;CAKC,GACD,OAAO,MAAMC,uCAA2EJ,MAAMK,UAAU,CACtG,CAACC,OAAOC;IACN,MAAMC,QAAQP,mCAAmCK,OAAOC;IAExDJ,yCAAyCK;IACzC,8HAA8H;IAC9H,wGAAwG;IACxG,kFAAkF;IAClF,OAAON,sCAAsCM;AAC/C,GACA;AAEFJ,uBAAuBK,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/components/CarouselAutoplayButton/CarouselAutoplayButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCarouselAutoplayButton_unstable } from './useCarouselAutoplayButton';\nimport { renderCarouselAutoplayButton_unstable } from './renderCarouselAutoplayButton';\nimport { useCarouselAutoplayButtonStyles_unstable } from './useCarouselAutoplayButtonStyles.styles';\nimport type { CarouselAutoplayButtonProps } from './CarouselAutoplayButton.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * If the Carousel is on auto-play, the user may opt into pausing the auto-play feature via the\n * CarouselAutoplayButton which must be present for auto-play to be enabled.\n *\n * If CarouselAutoplayButton is present, auto-play will default to true on mount.\n */\nexport const CarouselAutoplayButton: ForwardRefComponent<CarouselAutoplayButtonProps> = React.forwardRef(\n (props, ref) => {\n const state = useCarouselAutoplayButton_unstable(props, ref);\n\n useCarouselAutoplayButtonStyles_unstable(state);\n useCustomStyleHook_unstable('useCarouselAutoplayButtonStyles_unstable')(state);\n\n return renderCarouselAutoplayButton_unstable(state);\n },\n);\n\nCarouselAutoplayButton.displayName = 'CarouselAutoplayButton';\n"],"names":["React","useCarouselAutoplayButton_unstable","renderCarouselAutoplayButton_unstable","useCarouselAutoplayButtonStyles_unstable","useCustomStyleHook_unstable","CarouselAutoplayButton","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,kCAAkC,QAAQ,8BAA8B;AACjF,SAASC,qCAAqC,QAAQ,iCAAiC;AACvF,SAASC,wCAAwC,QAAQ,2CAA2C;AAEpG,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;;;;CAKC,GACD,OAAO,MAAMC,uCAA2EL,MAAMM,UAAU,CACtG,CAACC,OAAOC;IACN,MAAMC,QAAQR,mCAAmCM,OAAOC;IAExDL,yCAAyCM;IACzCL,4BAA4B,4CAA4CK;IAExE,OAAOP,sCAAsCO;AAC/C,GACA;AAEFJ,uBAAuBK,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["CarouselAutoplayButton.types.ts"],"sourcesContent":["import { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport { ButtonSlots, ToggleButtonProps, ToggleButtonState } from '@fluentui/react-button';\nimport type { ComponentProps, ComponentState, EventData, EventHandler, Slot } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nexport type CarouselAutoplayButtonSlots = ButtonSlots & {\n root: NonNullable<Slot<ARIAButtonSlotProps>>;\n};\n\nexport type CarouselAutoplayChangeData = EventData<'click', React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>> & {\n /**\n * The updated autoplay value.\n */\n checked: boolean;\n};\n\nexport type CarouselAutoplayAriaLabelFunction = (autoplay: boolean) => string;\n\n/**\n * CarouselAutoplayButton Props\n */\nexport type CarouselAutoplayButtonProps = ToggleButtonProps &\n ComponentProps<CarouselAutoplayButtonSlots> & {\n /**\n * Callback that informs the user when internal autoplay value has changed\n */\n onCheckedChange?: EventHandler<CarouselAutoplayChangeData>;\n };\n\n/**\n * State used in rendering CarouselAutoplayButton\n */\nexport type CarouselAutoplayButtonState = ToggleButtonState & ComponentState<CarouselAutoplayButtonSlots>;\n"],"names":["React"],"rangeMappings":"","mappings":"AAGA,YAAYA,WAAW,QAAQ"}
1
+ {"version":3,"sources":["../src/components/CarouselAutoplayButton/CarouselAutoplayButton.types.ts"],"sourcesContent":["import { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport { ButtonSlots, ToggleButtonProps, ToggleButtonState } from '@fluentui/react-button';\nimport type { ComponentProps, ComponentState, EventData, EventHandler, Slot } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nexport type CarouselAutoplayButtonSlots = ButtonSlots & {\n root: NonNullable<Slot<ARIAButtonSlotProps>>;\n};\n\nexport type CarouselAutoplayChangeData = EventData<'click', React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>> & {\n /**\n * The updated autoplay value.\n */\n checked: boolean;\n};\n\nexport type CarouselAutoplayAriaLabelFunction = (autoplay: boolean) => string;\n\n/**\n * CarouselAutoplayButton Props\n */\nexport type CarouselAutoplayButtonProps = ToggleButtonProps &\n ComponentProps<CarouselAutoplayButtonSlots> & {\n /**\n * Callback that informs the user when internal autoplay value has changed\n */\n onCheckedChange?: EventHandler<CarouselAutoplayChangeData>;\n };\n\n/**\n * State used in rendering CarouselAutoplayButton\n */\nexport type CarouselAutoplayButtonState = ToggleButtonState & ComponentState<CarouselAutoplayButtonSlots>;\n"],"names":["React"],"rangeMappings":"","mappings":"AAGA,YAAYA,WAAW,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './CarouselAutoplayButton';\nexport * from './CarouselAutoplayButton.types';\nexport * from './renderCarouselAutoplayButton';\nexport * from './useCarouselAutoplayButton';\nexport * from './useCarouselAutoplayButtonStyles.styles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,2BAA2B;AACzC,cAAc,iCAAiC;AAC/C,cAAc,iCAAiC;AAC/C,cAAc,8BAA8B;AAC5C,cAAc,2CAA2C"}
1
+ {"version":3,"sources":["../src/components/CarouselAutoplayButton/index.ts"],"sourcesContent":["export * from './CarouselAutoplayButton';\nexport * from './CarouselAutoplayButton.types';\nexport * from './renderCarouselAutoplayButton';\nexport * from './useCarouselAutoplayButton';\nexport * from './useCarouselAutoplayButtonStyles.styles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,2BAA2B;AACzC,cAAc,iCAAiC;AAC/C,cAAc,iCAAiC;AAC/C,cAAc,8BAA8B;AAC5C,cAAc,2CAA2C"}
@@ -1,4 +1,4 @@
1
- import { assertSlots } from '@fluentui/react-utilities';
1
+ import { assertSlots } from '@fluentui/react-utilities';
2
2
  import { renderToggleButton_unstable } from '@fluentui/react-button';
3
3
  /**
4
4
  * Render the final JSX of CarouselAutoplayButton
@@ -1 +1 @@
1
- {"version":3,"sources":["renderCarouselAutoplayButton.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { CarouselAutoplayButtonState, CarouselAutoplayButtonSlots } from './CarouselAutoplayButton.types';\nimport { renderToggleButton_unstable } from '@fluentui/react-button';\n\n/**\n * Render the final JSX of CarouselAutoplayButton\n */\nexport const renderCarouselAutoplayButton_unstable = (state: CarouselAutoplayButtonState) => {\n assertSlots<CarouselAutoplayButtonSlots>(state);\n\n // We render the underlying react-button with injected carousel functionality\n return renderToggleButton_unstable(state);\n};\n"],"names":["assertSlots","renderToggleButton_unstable","renderCarouselAutoplayButton_unstable","state"],"rangeMappings":";;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD,GAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAExD,SAASC,2BAA2B,QAAQ,yBAAyB;AAErE;;CAEC,GACD,OAAO,MAAMC,wCAAwC,CAACC;IACpDH,YAAyCG;IAEzC,6EAA6E;IAC7E,OAAOF,4BAA4BE;AACrC,EAAE"}
1
+ {"version":3,"sources":["../src/components/CarouselAutoplayButton/renderCarouselAutoplayButton.tsx"],"sourcesContent":["import { assertSlots } from '@fluentui/react-utilities';\nimport type { CarouselAutoplayButtonState, CarouselAutoplayButtonSlots } from './CarouselAutoplayButton.types';\nimport { renderToggleButton_unstable } from '@fluentui/react-button';\n\n/**\n * Render the final JSX of CarouselAutoplayButton\n */\nexport const renderCarouselAutoplayButton_unstable = (state: CarouselAutoplayButtonState) => {\n assertSlots<CarouselAutoplayButtonSlots>(state);\n\n // We render the underlying react-button with injected carousel functionality\n return renderToggleButton_unstable(state);\n};\n"],"names":["assertSlots","renderToggleButton_unstable","renderCarouselAutoplayButton_unstable","state"],"rangeMappings":";;;;;;;;","mappings":"AAAA,SAASA,WAAW,QAAQ,4BAA4B;AAExD,SAASC,2BAA2B,QAAQ,yBAAyB;AAErE;;CAEC,GACD,OAAO,MAAMC,wCAAwC,CAACC;IACpDH,YAAyCG;IAEzC,6EAA6E;IAC7E,OAAOF,4BAA4BE;AACrC,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useCarouselAutoplayButton.tsx"],"sourcesContent":["import type { ARIAButtonElement } from '@fluentui/react-aria';\nimport { useToggleButton_unstable } from '@fluentui/react-button';\nimport { PlayCircleRegular, PauseCircleRegular } from '@fluentui/react-icons';\nimport {\n mergeCallbacks,\n slot,\n useControllableState,\n useEventCallback,\n useIsomorphicLayoutEffect,\n} from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nimport type { CarouselAutoplayButtonProps, CarouselAutoplayButtonState } from './CarouselAutoplayButton.types';\nimport { useCarouselContext_unstable as useCarouselContext } from '../CarouselContext';\n\n/**\n * Create the state required to render CarouselAutoplayButton.\n *\n * The returned state can be modified with hooks such as useCarouselAutoplayButtonStyles_unstable,\n * before being passed to renderCarouselAutoplayButton_unstable.\n *\n * @param props - props from this instance of CarouselAutoplayButton\n * @param ref - reference to root HTMLDivElement of CarouselAutoplayButton\n */\nexport const useCarouselAutoplayButton_unstable = (\n props: CarouselAutoplayButtonProps,\n ref: React.Ref<ARIAButtonElement>,\n): CarouselAutoplayButtonState => {\n const { onCheckedChange, checked, defaultChecked } = props;\n\n const [autoplay, setAutoplay] = useControllableState({\n state: checked,\n defaultState: defaultChecked,\n initialState: false,\n });\n const enableAutoplay = useCarouselContext(ctx => ctx.enableAutoplay);\n\n React.useEffect(() => {\n return () => {\n // We disable autoplay if the button gets unmounted.\n enableAutoplay(false);\n };\n }, [enableAutoplay]);\n\n useIsomorphicLayoutEffect(() => {\n // Enable/disable autoplay on state change\n enableAutoplay(autoplay);\n }, [autoplay, enableAutoplay]);\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement>) => {\n if (event.isDefaultPrevented()) {\n return;\n }\n\n const newValue = !autoplay;\n\n setAutoplay(newValue);\n onCheckedChange?.(event, { event, type: 'click', checked: newValue });\n };\n\n return {\n // We lean on react-button class to handle styling and icon enhancements\n ...useToggleButton_unstable(\n {\n icon: slot.optional(props.icon, {\n defaultProps: {\n children: autoplay ? <PauseCircleRegular /> : <PlayCircleRegular />,\n },\n renderByDefault: true,\n elementType: 'span',\n }),\n ...props,\n checked: autoplay,\n onClick: useEventCallback(mergeCallbacks(handleClick, props.onClick)),\n },\n ref as React.Ref<HTMLButtonElement>,\n ),\n };\n};\n"],"names":["useToggleButton_unstable","PlayCircleRegular","PauseCircleRegular","mergeCallbacks","slot","useControllableState","useEventCallback","useIsomorphicLayoutEffect","React","useCarouselContext_unstable","useCarouselContext","useCarouselAutoplayButton_unstable","props","ref","onCheckedChange","checked","defaultChecked","autoplay","setAutoplay","state","defaultState","initialState","enableAutoplay","ctx","useEffect","handleClick","event","isDefaultPrevented","newValue","type","icon","optional","defaultProps","children","renderByDefault","elementType","onClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AACA,SAASA,wBAAwB,QAAQ,yBAAyB;AAClE,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,wBAAwB;AAC9E,SACEC,cAAc,EACdC,IAAI,EACJC,oBAAoB,EACpBC,gBAAgB,EAChBC,yBAAyB,QACpB,4BAA4B;AACnC,YAAYC,WAAW,QAAQ;AAG/B,SAASC,+BAA+BC,kBAAkB,QAAQ,qBAAqB;AAEvF;;;;;;;;CAQC,GACD,OAAO,MAAMC,qCAAqC,CAChDC,OACAC;IAEA,MAAM,EAAEC,eAAe,EAAEC,OAAO,EAAEC,cAAc,EAAE,GAAGJ;IAErD,MAAM,CAACK,UAAUC,YAAY,GAAGb,qBAAqB;QACnDc,OAAOJ;QACPK,cAAcJ;QACdK,cAAc;IAChB;IACA,MAAMC,iBAAiBZ,mBAAmBa,CAAAA,MAAOA,IAAID,cAAc;IAEnEd,MAAMgB,SAAS,CAAC;QACd,OAAO;YACL,oDAAoD;YACpDF,eAAe;QACjB;IACF,GAAG;QAACA;KAAe;IAEnBf,0BAA0B;QACxB,0CAA0C;QAC1Ce,eAAeL;IACjB,GAAG;QAACA;QAAUK;KAAe;IAE7B,MAAMG,cAAc,CAACC;QACnB,IAAIA,MAAMC,kBAAkB,IAAI;YAC9B;QACF;QAEA,MAAMC,WAAW,CAACX;QAElBC,YAAYU;QACZd,4BAAAA,sCAAAA,gBAAkBY,OAAO;YAAEA;YAAOG,MAAM;YAASd,SAASa;QAAS;IACrE;IAEA,OAAO;QACL,wEAAwE;QACxE,GAAG5B,yBACD;YACE8B,MAAM1B,KAAK2B,QAAQ,CAACnB,MAAMkB,IAAI,EAAE;gBAC9BE,cAAc;oBACZC,UAAUhB,yBAAW,oBAACf,0CAAwB,oBAACD;gBACjD;gBACAiC,iBAAiB;gBACjBC,aAAa;YACf;YACA,GAAGvB,KAAK;YACRG,SAASE;YACTmB,SAAS9B,iBAAiBH,eAAesB,aAAab,MAAMwB,OAAO;QACrE,GACAvB,IACD;IACH;AACF,EAAE"}
1
+ {"version":3,"sources":["../src/components/CarouselAutoplayButton/useCarouselAutoplayButton.tsx"],"sourcesContent":["import type { ARIAButtonElement } from '@fluentui/react-aria';\nimport { useToggleButton_unstable } from '@fluentui/react-button';\nimport { PlayCircleRegular, PauseCircleRegular } from '@fluentui/react-icons';\nimport {\n mergeCallbacks,\n slot,\n useControllableState,\n useEventCallback,\n useIsomorphicLayoutEffect,\n} from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nimport type { CarouselAutoplayButtonProps, CarouselAutoplayButtonState } from './CarouselAutoplayButton.types';\nimport { useCarouselContext_unstable as useCarouselContext } from '../CarouselContext';\n\n/**\n * Create the state required to render CarouselAutoplayButton.\n *\n * The returned state can be modified with hooks such as useCarouselAutoplayButtonStyles_unstable,\n * before being passed to renderCarouselAutoplayButton_unstable.\n *\n * @param props - props from this instance of CarouselAutoplayButton\n * @param ref - reference to root HTMLDivElement of CarouselAutoplayButton\n */\nexport const useCarouselAutoplayButton_unstable = (\n props: CarouselAutoplayButtonProps,\n ref: React.Ref<ARIAButtonElement>,\n): CarouselAutoplayButtonState => {\n const { onCheckedChange, checked, defaultChecked } = props;\n\n const [autoplay, setAutoplay] = useControllableState({\n state: checked,\n defaultState: defaultChecked,\n initialState: false,\n });\n const enableAutoplay = useCarouselContext(ctx => ctx.enableAutoplay);\n\n React.useEffect(() => {\n return () => {\n // We disable autoplay if the button gets unmounted.\n enableAutoplay(false);\n };\n }, [enableAutoplay]);\n\n useIsomorphicLayoutEffect(() => {\n // Enable/disable autoplay on state change\n enableAutoplay(autoplay);\n }, [autoplay, enableAutoplay]);\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement>) => {\n if (event.isDefaultPrevented()) {\n return;\n }\n\n const newValue = !autoplay;\n\n setAutoplay(newValue);\n onCheckedChange?.(event, { event, type: 'click', checked: newValue });\n };\n\n return {\n // We lean on react-button class to handle styling and icon enhancements\n ...useToggleButton_unstable(\n {\n icon: slot.optional(props.icon, {\n defaultProps: {\n children: autoplay ? <PauseCircleRegular /> : <PlayCircleRegular />,\n },\n renderByDefault: true,\n elementType: 'span',\n }),\n ...props,\n checked: autoplay,\n onClick: useEventCallback(mergeCallbacks(handleClick, props.onClick)),\n },\n ref as React.Ref<HTMLButtonElement>,\n ),\n };\n};\n"],"names":["useToggleButton_unstable","PlayCircleRegular","PauseCircleRegular","mergeCallbacks","slot","useControllableState","useEventCallback","useIsomorphicLayoutEffect","React","useCarouselContext_unstable","useCarouselContext","useCarouselAutoplayButton_unstable","props","ref","onCheckedChange","checked","defaultChecked","autoplay","setAutoplay","state","defaultState","initialState","enableAutoplay","ctx","useEffect","handleClick","event","isDefaultPrevented","newValue","type","icon","optional","defaultProps","children","renderByDefault","elementType","onClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AACA,SAASA,wBAAwB,QAAQ,yBAAyB;AAClE,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,wBAAwB;AAC9E,SACEC,cAAc,EACdC,IAAI,EACJC,oBAAoB,EACpBC,gBAAgB,EAChBC,yBAAyB,QACpB,4BAA4B;AACnC,YAAYC,WAAW,QAAQ;AAG/B,SAASC,+BAA+BC,kBAAkB,QAAQ,qBAAqB;AAEvF;;;;;;;;CAQC,GACD,OAAO,MAAMC,qCAAqC,CAChDC,OACAC;IAEA,MAAM,EAAEC,eAAe,EAAEC,OAAO,EAAEC,cAAc,EAAE,GAAGJ;IAErD,MAAM,CAACK,UAAUC,YAAY,GAAGb,qBAAqB;QACnDc,OAAOJ;QACPK,cAAcJ;QACdK,cAAc;IAChB;IACA,MAAMC,iBAAiBZ,mBAAmBa,CAAAA,MAAOA,IAAID,cAAc;IAEnEd,MAAMgB,SAAS,CAAC;QACd,OAAO;YACL,oDAAoD;YACpDF,eAAe;QACjB;IACF,GAAG;QAACA;KAAe;IAEnBf,0BAA0B;QACxB,0CAA0C;QAC1Ce,eAAeL;IACjB,GAAG;QAACA;QAAUK;KAAe;IAE7B,MAAMG,cAAc,CAACC;QACnB,IAAIA,MAAMC,kBAAkB,IAAI;YAC9B;QACF;QAEA,MAAMC,WAAW,CAACX;QAElBC,YAAYU;QACZd,4BAAAA,sCAAAA,gBAAkBY,OAAO;YAAEA;YAAOG,MAAM;YAASd,SAASa;QAAS;IACrE;IAEA,OAAO;QACL,wEAAwE;QACxE,GAAG5B,yBACD;YACE8B,MAAM1B,KAAK2B,QAAQ,CAACnB,MAAMkB,IAAI,EAAE;gBAC9BE,cAAc;oBACZC,UAAUhB,yBAAW,oBAACf,0CAAwB,oBAACD;gBACjD;gBACAiC,iBAAiB;gBACjBC,aAAa;YACf;YACA,GAAGvB,KAAK;YACRG,SAASE;YACTmB,SAAS9B,iBAAiBH,eAAesB,aAAab,MAAMwB,OAAO;QACrE,GACAvB,IACD;IACH;AACF,EAAE"}
@@ -38,5 +38,4 @@ export const useCarouselAutoplayButtonStyles_unstable = state => {
38
38
  state.icon.className = mergeClasses(carouselAutoplayButtonClassNames.icon, state.icon.className);
39
39
  }
40
40
  return state;
41
- };
42
- //# sourceMappingURL=useCarouselAutoplayButtonStyles.styles.js.map
41
+ };