@fluentui/react-carousel 0.0.0-nightly-20241008-0405.1
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.
- package/CHANGELOG.md +129 -0
- package/LICENSE +15 -0
- package/README.md +33 -0
- package/dist/index.d.ts +625 -0
- package/lib/Carousel.js +1 -0
- package/lib/Carousel.js.map +1 -0
- package/lib/CarouselAutoplayButton.js +1 -0
- package/lib/CarouselAutoplayButton.js.map +1 -0
- package/lib/CarouselButton.js +1 -0
- package/lib/CarouselButton.js.map +1 -0
- package/lib/CarouselCard.js +1 -0
- package/lib/CarouselCard.js.map +1 -0
- package/lib/CarouselContext.js +2 -0
- package/lib/CarouselContext.js.map +1 -0
- package/lib/CarouselNav.js +1 -0
- package/lib/CarouselNav.js.map +1 -0
- package/lib/CarouselNavButton.js +1 -0
- package/lib/CarouselNavButton.js.map +1 -0
- package/lib/CarouselNavContainer.js +1 -0
- package/lib/CarouselNavContainer.js.map +1 -0
- package/lib/CarouselNavImageButton.js +1 -0
- package/lib/CarouselNavImageButton.js.map +1 -0
- package/lib/CarouselSlider.js +1 -0
- package/lib/CarouselSlider.js.map +1 -0
- package/lib/components/Carousel/Carousel.js +20 -0
- package/lib/components/Carousel/Carousel.js.map +1 -0
- package/lib/components/Carousel/Carousel.types.js +3 -0
- package/lib/components/Carousel/Carousel.types.js.map +1 -0
- package/lib/components/Carousel/index.js +5 -0
- package/lib/components/Carousel/index.js.map +1 -0
- package/lib/components/Carousel/renderCarousel.js +12 -0
- package/lib/components/Carousel/renderCarousel.js.map +1 -0
- package/lib/components/Carousel/useCarousel.js +117 -0
- package/lib/components/Carousel/useCarousel.js.map +1 -0
- package/lib/components/Carousel/useCarouselContextValues.js +28 -0
- package/lib/components/Carousel/useCarouselContextValues.js.map +1 -0
- package/lib/components/Carousel/useCarouselStyles.styles.js +33 -0
- package/lib/components/Carousel/useCarouselStyles.styles.js.map +1 -0
- package/lib/components/CarouselAutoplayButton/CarouselAutoplayButton.js +18 -0
- package/lib/components/CarouselAutoplayButton/CarouselAutoplayButton.js.map +1 -0
- package/lib/components/CarouselAutoplayButton/CarouselAutoplayButton.types.js +1 -0
- package/lib/components/CarouselAutoplayButton/CarouselAutoplayButton.types.js.map +1 -0
- package/lib/components/CarouselAutoplayButton/index.js +5 -0
- package/lib/components/CarouselAutoplayButton/index.js.map +1 -0
- package/lib/components/CarouselAutoplayButton/renderCarouselAutoplayButton.js +9 -0
- package/lib/components/CarouselAutoplayButton/renderCarouselAutoplayButton.js.map +1 -0
- package/lib/components/CarouselAutoplayButton/useCarouselAutoplayButton.js +64 -0
- package/lib/components/CarouselAutoplayButton/useCarouselAutoplayButton.js.map +1 -0
- package/lib/components/CarouselAutoplayButton/useCarouselAutoplayButtonStyles.styles.js +42 -0
- package/lib/components/CarouselAutoplayButton/useCarouselAutoplayButtonStyles.styles.js.map +1 -0
- package/lib/components/CarouselButton/CarouselButton.js +16 -0
- package/lib/components/CarouselButton/CarouselButton.js.map +1 -0
- package/lib/components/CarouselButton/CarouselButton.types.js +3 -0
- package/lib/components/CarouselButton/CarouselButton.types.js.map +1 -0
- package/lib/components/CarouselButton/index.js +5 -0
- package/lib/components/CarouselButton/index.js.map +1 -0
- package/lib/components/CarouselButton/renderCarouselButton.js +9 -0
- package/lib/components/CarouselButton/renderCarouselButton.js.map +1 -0
- package/lib/components/CarouselButton/useCarouselButton.js +87 -0
- package/lib/components/CarouselButton/useCarouselButton.js.map +1 -0
- package/lib/components/CarouselButton/useCarouselButtonStyles.styles.js +41 -0
- package/lib/components/CarouselButton/useCarouselButtonStyles.styles.js.map +1 -0
- package/lib/components/CarouselCard/CarouselCard.js +20 -0
- package/lib/components/CarouselCard/CarouselCard.js.map +1 -0
- package/lib/components/CarouselCard/CarouselCard.types.js +3 -0
- package/lib/components/CarouselCard/CarouselCard.types.js.map +1 -0
- package/lib/components/CarouselCard/index.js +5 -0
- package/lib/components/CarouselCard/index.js.map +1 -0
- package/lib/components/CarouselCard/renderCarouselCard.js +8 -0
- package/lib/components/CarouselCard/renderCarouselCard.js.map +1 -0
- package/lib/components/CarouselCard/useCarouselCard.js +91 -0
- package/lib/components/CarouselCard/useCarouselCard.js.map +1 -0
- package/lib/components/CarouselCard/useCarouselCardStyles.styles.js +45 -0
- package/lib/components/CarouselCard/useCarouselCardStyles.styles.js.map +1 -0
- package/lib/components/CarouselContext.js +23 -0
- package/lib/components/CarouselContext.js.map +1 -0
- package/lib/components/CarouselContext.types.js +1 -0
- package/lib/components/CarouselContext.types.js.map +1 -0
- package/lib/components/CarouselNav/CarouselNav.js +20 -0
- package/lib/components/CarouselNav/CarouselNav.js.map +1 -0
- package/lib/components/CarouselNav/CarouselNav.types.js +1 -0
- package/lib/components/CarouselNav/CarouselNav.types.js.map +1 -0
- package/lib/components/CarouselNav/CarouselNavContext.js +21 -0
- package/lib/components/CarouselNav/CarouselNavContext.js.map +1 -0
- package/lib/components/CarouselNav/CarouselNavIndexContext.js +8 -0
- package/lib/components/CarouselNav/CarouselNavIndexContext.js.map +1 -0
- package/lib/components/CarouselNav/index.js +5 -0
- package/lib/components/CarouselNav/index.js.map +1 -0
- package/lib/components/CarouselNav/renderCarouselNav.js +19 -0
- package/lib/components/CarouselNav/renderCarouselNav.js.map +1 -0
- package/lib/components/CarouselNav/useCarouselNav.js +49 -0
- package/lib/components/CarouselNav/useCarouselNav.js.map +1 -0
- package/lib/components/CarouselNav/useCarouselNavStyles.styles.js +63 -0
- package/lib/components/CarouselNav/useCarouselNavStyles.styles.js.map +1 -0
- package/lib/components/CarouselNavButton/CarouselNavButton.js +15 -0
- package/lib/components/CarouselNavButton/CarouselNavButton.js.map +1 -0
- package/lib/components/CarouselNavButton/CarouselNavButton.types.js +3 -0
- package/lib/components/CarouselNavButton/CarouselNavButton.types.js.map +1 -0
- package/lib/components/CarouselNavButton/index.js +5 -0
- package/lib/components/CarouselNavButton/index.js.map +1 -0
- package/lib/components/CarouselNavButton/renderCarouselNavButton.js +9 -0
- package/lib/components/CarouselNavButton/renderCarouselNavButton.js.map +1 -0
- package/lib/components/CarouselNavButton/useCarouselNavButton.js +73 -0
- package/lib/components/CarouselNavButton/useCarouselNavButton.js.map +1 -0
- package/lib/components/CarouselNavButton/useCarouselNavButtonStyles.styles.js +196 -0
- package/lib/components/CarouselNavButton/useCarouselNavButtonStyles.styles.js.map +1 -0
- package/lib/components/CarouselNavContainer/CarouselNavContainer.js +20 -0
- package/lib/components/CarouselNavContainer/CarouselNavContainer.js.map +1 -0
- package/lib/components/CarouselNavContainer/CarouselNavContainer.types.js +3 -0
- package/lib/components/CarouselNavContainer/CarouselNavContainer.types.js.map +1 -0
- package/lib/components/CarouselNavContainer/index.js +5 -0
- package/lib/components/CarouselNavContainer/index.js.map +1 -0
- package/lib/components/CarouselNavContainer/renderCarouselNavContainer.js +15 -0
- package/lib/components/CarouselNavContainer/renderCarouselNavContainer.js.map +1 -0
- package/lib/components/CarouselNavContainer/useCarouselNavContainer.js +51 -0
- package/lib/components/CarouselNavContainer/useCarouselNavContainer.js.map +1 -0
- package/lib/components/CarouselNavContainer/useCarouselNavContainerStyles.styles.js +104 -0
- package/lib/components/CarouselNavContainer/useCarouselNavContainerStyles.styles.js.map +1 -0
- package/lib/components/CarouselNavImageButton/CarouselNavImageButton.js +16 -0
- package/lib/components/CarouselNavImageButton/CarouselNavImageButton.js.map +1 -0
- package/lib/components/CarouselNavImageButton/CarouselNavImageButton.types.js +3 -0
- package/lib/components/CarouselNavImageButton/CarouselNavImageButton.types.js.map +1 -0
- package/lib/components/CarouselNavImageButton/index.js +5 -0
- package/lib/components/CarouselNavImageButton/index.js.map +1 -0
- package/lib/components/CarouselNavImageButton/renderCarouselNavImageButton.js +10 -0
- package/lib/components/CarouselNavImageButton/renderCarouselNavImageButton.js.map +1 -0
- package/lib/components/CarouselNavImageButton/useCarouselNavImageButton.js +76 -0
- package/lib/components/CarouselNavImageButton/useCarouselNavImageButton.js.map +1 -0
- package/lib/components/CarouselNavImageButton/useCarouselNavImageButtonStyles.styles.js +85 -0
- package/lib/components/CarouselNavImageButton/useCarouselNavImageButtonStyles.styles.js.map +1 -0
- package/lib/components/CarouselSlider/CarouselSlider.js +18 -0
- package/lib/components/CarouselSlider/CarouselSlider.js.map +1 -0
- package/lib/components/CarouselSlider/CarouselSlider.types.js +1 -0
- package/lib/components/CarouselSlider/CarouselSlider.types.js.map +1 -0
- package/lib/components/CarouselSlider/CarouselSliderContext.js +21 -0
- package/lib/components/CarouselSlider/CarouselSliderContext.js.map +1 -0
- package/lib/components/CarouselSlider/index.js +5 -0
- package/lib/components/CarouselSlider/index.js.map +1 -0
- package/lib/components/CarouselSlider/renderCarouselSlider.js +12 -0
- package/lib/components/CarouselSlider/renderCarouselSlider.js.map +1 -0
- package/lib/components/CarouselSlider/useCarouselSlider.js +36 -0
- package/lib/components/CarouselSlider/useCarouselSlider.js.map +1 -0
- package/lib/components/CarouselSlider/useCarouselSliderStyles.styles.js +26 -0
- package/lib/components/CarouselSlider/useCarouselSliderStyles.styles.js.map +1 -0
- package/lib/components/useEmblaCarousel.js +239 -0
- package/lib/components/useEmblaCarousel.js.map +1 -0
- package/lib/index.js +10 -0
- package/lib/index.js.map +1 -0
- package/lib-commonjs/Carousel.js +6 -0
- package/lib-commonjs/Carousel.js.map +1 -0
- package/lib-commonjs/CarouselAutoplayButton.js +6 -0
- package/lib-commonjs/CarouselAutoplayButton.js.map +1 -0
- package/lib-commonjs/CarouselButton.js +6 -0
- package/lib-commonjs/CarouselButton.js.map +1 -0
- package/lib-commonjs/CarouselCard.js +6 -0
- package/lib-commonjs/CarouselCard.js.map +1 -0
- package/lib-commonjs/CarouselContext.js +7 -0
- package/lib-commonjs/CarouselContext.js.map +1 -0
- package/lib-commonjs/CarouselNav.js +6 -0
- package/lib-commonjs/CarouselNav.js.map +1 -0
- package/lib-commonjs/CarouselNavButton.js +6 -0
- package/lib-commonjs/CarouselNavButton.js.map +1 -0
- package/lib-commonjs/CarouselNavContainer.js +6 -0
- package/lib-commonjs/CarouselNavContainer.js.map +1 -0
- package/lib-commonjs/CarouselNavImageButton.js +6 -0
- package/lib-commonjs/CarouselNavImageButton.js.map +1 -0
- package/lib-commonjs/CarouselSlider.js +6 -0
- package/lib-commonjs/CarouselSlider.js.map +1 -0
- package/lib-commonjs/components/Carousel/Carousel.js +26 -0
- package/lib-commonjs/components/Carousel/Carousel.js.map +1 -0
- package/lib-commonjs/components/Carousel/Carousel.types.js +6 -0
- package/lib-commonjs/components/Carousel/Carousel.types.js.map +1 -0
- package/lib-commonjs/components/Carousel/index.js +10 -0
- package/lib-commonjs/components/Carousel/index.js.map +1 -0
- package/lib-commonjs/components/Carousel/renderCarousel.js +20 -0
- package/lib-commonjs/components/Carousel/renderCarousel.js.map +1 -0
- package/lib-commonjs/components/Carousel/useCarousel.js +119 -0
- package/lib-commonjs/components/Carousel/useCarousel.js.map +1 -0
- package/lib-commonjs/components/Carousel/useCarouselContextValues.js +39 -0
- package/lib-commonjs/components/Carousel/useCarouselContextValues.js.map +1 -0
- package/lib-commonjs/components/Carousel/useCarouselStyles.styles.js +52 -0
- package/lib-commonjs/components/Carousel/useCarouselStyles.styles.js.map +1 -0
- package/lib-commonjs/components/CarouselAutoplayButton/CarouselAutoplayButton.js +24 -0
- package/lib-commonjs/components/CarouselAutoplayButton/CarouselAutoplayButton.js.map +1 -0
- package/lib-commonjs/components/CarouselAutoplayButton/CarouselAutoplayButton.types.js +6 -0
- package/lib-commonjs/components/CarouselAutoplayButton/CarouselAutoplayButton.types.js.map +1 -0
- package/lib-commonjs/components/CarouselAutoplayButton/index.js +10 -0
- package/lib-commonjs/components/CarouselAutoplayButton/index.js.map +1 -0
- package/lib-commonjs/components/CarouselAutoplayButton/renderCarouselAutoplayButton.js +17 -0
- package/lib-commonjs/components/CarouselAutoplayButton/renderCarouselAutoplayButton.js.map +1 -0
- package/lib-commonjs/components/CarouselAutoplayButton/useCarouselAutoplayButton.js +67 -0
- package/lib-commonjs/components/CarouselAutoplayButton/useCarouselAutoplayButton.js.map +1 -0
- package/lib-commonjs/components/CarouselAutoplayButton/useCarouselAutoplayButtonStyles.styles.js +71 -0
- package/lib-commonjs/components/CarouselAutoplayButton/useCarouselAutoplayButtonStyles.styles.js.map +1 -0
- package/lib-commonjs/components/CarouselButton/CarouselButton.js +24 -0
- package/lib-commonjs/components/CarouselButton/CarouselButton.js.map +1 -0
- package/lib-commonjs/components/CarouselButton/CarouselButton.types.js +6 -0
- package/lib-commonjs/components/CarouselButton/CarouselButton.types.js.map +1 -0
- package/lib-commonjs/components/CarouselButton/index.js +10 -0
- package/lib-commonjs/components/CarouselButton/index.js.map +1 -0
- package/lib-commonjs/components/CarouselButton/renderCarouselButton.js +17 -0
- package/lib-commonjs/components/CarouselButton/renderCarouselButton.js.map +1 -0
- package/lib-commonjs/components/CarouselButton/useCarouselButton.js +89 -0
- package/lib-commonjs/components/CarouselButton/useCarouselButton.js.map +1 -0
- package/lib-commonjs/components/CarouselButton/useCarouselButtonStyles.styles.js +60 -0
- package/lib-commonjs/components/CarouselButton/useCarouselButtonStyles.styles.js.map +1 -0
- package/lib-commonjs/components/CarouselCard/CarouselCard.js +24 -0
- package/lib-commonjs/components/CarouselCard/CarouselCard.js.map +1 -0
- package/lib-commonjs/components/CarouselCard/CarouselCard.types.js +6 -0
- package/lib-commonjs/components/CarouselCard/CarouselCard.types.js.map +1 -0
- package/lib-commonjs/components/CarouselCard/index.js +10 -0
- package/lib-commonjs/components/CarouselCard/index.js.map +1 -0
- package/lib-commonjs/components/CarouselCard/renderCarouselCard.js +16 -0
- package/lib-commonjs/components/CarouselCard/renderCarouselCard.js.map +1 -0
- package/lib-commonjs/components/CarouselCard/useCarouselCard.js +94 -0
- package/lib-commonjs/components/CarouselCard/useCarouselCard.js.map +1 -0
- package/lib-commonjs/components/CarouselCard/useCarouselCardStyles.styles.js +67 -0
- package/lib-commonjs/components/CarouselCard/useCarouselCardStyles.styles.js.map +1 -0
- package/lib-commonjs/components/CarouselContext.js +44 -0
- package/lib-commonjs/components/CarouselContext.js.map +1 -0
- package/lib-commonjs/components/CarouselContext.types.js +6 -0
- package/lib-commonjs/components/CarouselContext.types.js.map +1 -0
- package/lib-commonjs/components/CarouselNav/CarouselNav.js +26 -0
- package/lib-commonjs/components/CarouselNav/CarouselNav.js.map +1 -0
- package/lib-commonjs/components/CarouselNav/CarouselNav.types.js +6 -0
- package/lib-commonjs/components/CarouselNav/CarouselNav.types.js.map +1 -0
- package/lib-commonjs/components/CarouselNav/CarouselNavContext.js +46 -0
- package/lib-commonjs/components/CarouselNav/CarouselNavContext.js.map +1 -0
- package/lib-commonjs/components/CarouselNav/CarouselNavIndexContext.js +30 -0
- package/lib-commonjs/components/CarouselNav/CarouselNavIndexContext.js.map +1 -0
- package/lib-commonjs/components/CarouselNav/index.js +10 -0
- package/lib-commonjs/components/CarouselNav/index.js.map +1 -0
- package/lib-commonjs/components/CarouselNav/renderCarouselNav.js +27 -0
- package/lib-commonjs/components/CarouselNav/renderCarouselNav.js.map +1 -0
- package/lib-commonjs/components/CarouselNav/useCarouselNav.js +52 -0
- package/lib-commonjs/components/CarouselNav/useCarouselNav.js.map +1 -0
- package/lib-commonjs/components/CarouselNav/useCarouselNavStyles.styles.js +106 -0
- package/lib-commonjs/components/CarouselNav/useCarouselNavStyles.styles.js.map +1 -0
- package/lib-commonjs/components/CarouselNavButton/CarouselNavButton.js +24 -0
- package/lib-commonjs/components/CarouselNavButton/CarouselNavButton.js.map +1 -0
- package/lib-commonjs/components/CarouselNavButton/CarouselNavButton.types.js +6 -0
- package/lib-commonjs/components/CarouselNavButton/CarouselNavButton.types.js.map +1 -0
- package/lib-commonjs/components/CarouselNavButton/index.js +10 -0
- package/lib-commonjs/components/CarouselNavButton/index.js.map +1 -0
- package/lib-commonjs/components/CarouselNavButton/renderCarouselNavButton.js +17 -0
- package/lib-commonjs/components/CarouselNavButton/renderCarouselNavButton.js.map +1 -0
- package/lib-commonjs/components/CarouselNavButton/useCarouselNavButton.js +76 -0
- package/lib-commonjs/components/CarouselNavButton/useCarouselNavButton.js.map +1 -0
- package/lib-commonjs/components/CarouselNavButton/useCarouselNavButtonStyles.styles.js +293 -0
- package/lib-commonjs/components/CarouselNavButton/useCarouselNavButtonStyles.styles.js.map +1 -0
- package/lib-commonjs/components/CarouselNavContainer/CarouselNavContainer.js +29 -0
- package/lib-commonjs/components/CarouselNavContainer/CarouselNavContainer.js.map +1 -0
- package/lib-commonjs/components/CarouselNavContainer/CarouselNavContainer.types.js +6 -0
- package/lib-commonjs/components/CarouselNavContainer/CarouselNavContainer.types.js.map +1 -0
- package/lib-commonjs/components/CarouselNavContainer/index.js +10 -0
- package/lib-commonjs/components/CarouselNavContainer/index.js.map +1 -0
- package/lib-commonjs/components/CarouselNavContainer/renderCarouselNavContainer.js +23 -0
- package/lib-commonjs/components/CarouselNavContainer/renderCarouselNavContainer.js.map +1 -0
- package/lib-commonjs/components/CarouselNavContainer/useCarouselNavContainer.js +54 -0
- package/lib-commonjs/components/CarouselNavContainer/useCarouselNavContainer.js.map +1 -0
- package/lib-commonjs/components/CarouselNavContainer/useCarouselNavContainerStyles.styles.js +163 -0
- package/lib-commonjs/components/CarouselNavContainer/useCarouselNavContainerStyles.styles.js.map +1 -0
- package/lib-commonjs/components/CarouselNavImageButton/CarouselNavImageButton.js +24 -0
- package/lib-commonjs/components/CarouselNavImageButton/CarouselNavImageButton.js.map +1 -0
- package/lib-commonjs/components/CarouselNavImageButton/CarouselNavImageButton.types.js +6 -0
- package/lib-commonjs/components/CarouselNavImageButton/CarouselNavImageButton.types.js.map +1 -0
- package/lib-commonjs/components/CarouselNavImageButton/index.js +10 -0
- package/lib-commonjs/components/CarouselNavImageButton/index.js.map +1 -0
- package/lib-commonjs/components/CarouselNavImageButton/renderCarouselNavImageButton.js +18 -0
- package/lib-commonjs/components/CarouselNavImageButton/renderCarouselNavImageButton.js.map +1 -0
- package/lib-commonjs/components/CarouselNavImageButton/useCarouselNavImageButton.js +79 -0
- package/lib-commonjs/components/CarouselNavImageButton/useCarouselNavImageButton.js.map +1 -0
- package/lib-commonjs/components/CarouselNavImageButton/useCarouselNavImageButtonStyles.styles.js +132 -0
- package/lib-commonjs/components/CarouselNavImageButton/useCarouselNavImageButtonStyles.styles.js.map +1 -0
- package/lib-commonjs/components/CarouselSlider/CarouselSlider.js +26 -0
- package/lib-commonjs/components/CarouselSlider/CarouselSlider.js.map +1 -0
- package/lib-commonjs/components/CarouselSlider/CarouselSlider.types.js +4 -0
- package/lib-commonjs/components/CarouselSlider/CarouselSlider.types.js.map +1 -0
- package/lib-commonjs/components/CarouselSlider/CarouselSliderContext.js +46 -0
- package/lib-commonjs/components/CarouselSlider/CarouselSliderContext.js.map +1 -0
- package/lib-commonjs/components/CarouselSlider/index.js +10 -0
- package/lib-commonjs/components/CarouselSlider/index.js.map +1 -0
- package/lib-commonjs/components/CarouselSlider/renderCarouselSlider.js +20 -0
- package/lib-commonjs/components/CarouselSlider/renderCarouselSlider.js.map +1 -0
- package/lib-commonjs/components/CarouselSlider/useCarouselSlider.js +39 -0
- package/lib-commonjs/components/CarouselSlider/useCarouselSlider.js.map +1 -0
- package/lib-commonjs/components/CarouselSlider/useCarouselSliderStyles.styles.js +41 -0
- package/lib-commonjs/components/CarouselSlider/useCarouselSliderStyles.styles.js.map +1 -0
- package/lib-commonjs/components/useEmblaCarousel.js +262 -0
- package/lib-commonjs/components/useEmblaCarousel.js.map +1 -0
- package/lib-commonjs/index.js +166 -0
- package/lib-commonjs/index.js.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useCarousel_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useCarousel_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
13
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
14
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
15
|
+
const _useEmblaCarousel = require("../useEmblaCarousel");
|
|
16
|
+
function useCarousel_unstable(props, ref) {
|
|
17
|
+
'use no memo';
|
|
18
|
+
const { align = 'center', circular = false, onActiveIndexChange, groupSize = 'auto', draggable = false, whitespace = false, announcement } = props;
|
|
19
|
+
const { dir } = (0, _reactsharedcontexts.useFluent_unstable)();
|
|
20
|
+
const { activeIndex, carouselApi, containerRef, subscribeForValues, enableAutoplay, resetAutoplay } = (0, _useEmblaCarousel.useEmblaCarousel)({
|
|
21
|
+
align,
|
|
22
|
+
direction: dir,
|
|
23
|
+
loop: circular,
|
|
24
|
+
slidesToScroll: groupSize,
|
|
25
|
+
defaultActiveIndex: props.defaultActiveIndex,
|
|
26
|
+
activeIndex: props.activeIndex,
|
|
27
|
+
watchDrag: draggable,
|
|
28
|
+
containScroll: whitespace ? false : 'keepSnaps'
|
|
29
|
+
});
|
|
30
|
+
const selectPageByElement = (0, _reactutilities.useEventCallback)((event, element, jump)=>{
|
|
31
|
+
const foundIndex = carouselApi.scrollToElement(element, jump);
|
|
32
|
+
onActiveIndexChange === null || onActiveIndexChange === void 0 ? void 0 : onActiveIndexChange(event, {
|
|
33
|
+
event,
|
|
34
|
+
type: 'focus',
|
|
35
|
+
index: foundIndex
|
|
36
|
+
});
|
|
37
|
+
return foundIndex;
|
|
38
|
+
});
|
|
39
|
+
const selectPageByIndex = (0, _reactutilities.useEventCallback)((event, index, jump)=>{
|
|
40
|
+
carouselApi.scrollToIndex(index, jump);
|
|
41
|
+
onActiveIndexChange === null || onActiveIndexChange === void 0 ? void 0 : onActiveIndexChange(event, {
|
|
42
|
+
event,
|
|
43
|
+
type: 'click',
|
|
44
|
+
index
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
const selectPageByDirection = (0, _reactutilities.useEventCallback)((event, direction)=>{
|
|
48
|
+
const nextPageIndex = carouselApi.scrollInDirection(direction);
|
|
49
|
+
onActiveIndexChange === null || onActiveIndexChange === void 0 ? void 0 : onActiveIndexChange(event, {
|
|
50
|
+
event,
|
|
51
|
+
type: 'click',
|
|
52
|
+
index: nextPageIndex
|
|
53
|
+
});
|
|
54
|
+
return nextPageIndex;
|
|
55
|
+
});
|
|
56
|
+
const mergedRefs = (0, _reactutilities.useMergedRefs)(ref, containerRef);
|
|
57
|
+
// Announce carousel updates
|
|
58
|
+
const announcementTextRef = _react.useRef('');
|
|
59
|
+
const totalNavLength = _react.useRef(0);
|
|
60
|
+
const navGroupRef = _react.useRef([]);
|
|
61
|
+
const { announce } = (0, _reactsharedcontexts.useAnnounce)();
|
|
62
|
+
const updateAnnouncement = (0, _reactutilities.useEventCallback)(()=>{
|
|
63
|
+
if (totalNavLength.current <= 0 || !announcement) {
|
|
64
|
+
// Ignore announcements until slides discovered
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const announcementText = announcement(activeIndex, totalNavLength.current, navGroupRef.current);
|
|
68
|
+
if (announcementText !== announcementTextRef.current) {
|
|
69
|
+
announcementTextRef.current = announcementText;
|
|
70
|
+
announce(announcementText, {
|
|
71
|
+
polite: true
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
(0, _reactutilities.useIsomorphicLayoutEffect)(()=>{
|
|
76
|
+
// Subscribe to any non-index carousel state changes
|
|
77
|
+
return subscribeForValues((data)=>{
|
|
78
|
+
if (totalNavLength.current <= 0 && data.navItemsCount > 0 && announcement) {
|
|
79
|
+
const announcementText = announcement(data.activeIndex, data.navItemsCount, data.groupIndexList);
|
|
80
|
+
// Initialize our string to prevent updateAnnouncement from reading an initial load
|
|
81
|
+
announcementTextRef.current = announcementText;
|
|
82
|
+
}
|
|
83
|
+
totalNavLength.current = data.navItemsCount;
|
|
84
|
+
navGroupRef.current = data.groupIndexList;
|
|
85
|
+
updateAnnouncement();
|
|
86
|
+
});
|
|
87
|
+
}, [
|
|
88
|
+
subscribeForValues,
|
|
89
|
+
updateAnnouncement,
|
|
90
|
+
announcement
|
|
91
|
+
]);
|
|
92
|
+
(0, _reactutilities.useIsomorphicLayoutEffect)(()=>{
|
|
93
|
+
updateAnnouncement();
|
|
94
|
+
}, [
|
|
95
|
+
activeIndex,
|
|
96
|
+
updateAnnouncement
|
|
97
|
+
]);
|
|
98
|
+
return {
|
|
99
|
+
components: {
|
|
100
|
+
root: 'div'
|
|
101
|
+
},
|
|
102
|
+
root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('div', {
|
|
103
|
+
ref: mergedRefs,
|
|
104
|
+
role: 'region',
|
|
105
|
+
...props
|
|
106
|
+
}), {
|
|
107
|
+
elementType: 'div'
|
|
108
|
+
}),
|
|
109
|
+
activeIndex,
|
|
110
|
+
circular,
|
|
111
|
+
containerRef: mergedRefs,
|
|
112
|
+
selectPageByElement,
|
|
113
|
+
selectPageByDirection,
|
|
114
|
+
selectPageByIndex,
|
|
115
|
+
subscribeForValues,
|
|
116
|
+
enableAutoplay,
|
|
117
|
+
resetAutoplay
|
|
118
|
+
};
|
|
119
|
+
}
|
|
@@ -0,0 +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":["useCarousel_unstable","props","ref","align","circular","onActiveIndexChange","groupSize","draggable","whitespace","announcement","dir","useFluent","activeIndex","carouselApi","containerRef","subscribeForValues","enableAutoplay","resetAutoplay","useEmblaCarousel","direction","loop","slidesToScroll","defaultActiveIndex","watchDrag","containScroll","selectPageByElement","useEventCallback","event","element","jump","foundIndex","scrollToElement","type","index","selectPageByIndex","scrollToIndex","selectPageByDirection","nextPageIndex","scrollInDirection","mergedRefs","useMergedRefs","announcementTextRef","React","useRef","totalNavLength","navGroupRef","announce","useAnnounce","updateAnnouncement","current","announcementText","polite","useIsomorphicLayoutEffect","data","navItemsCount","groupIndexList","components","root","slot","always","getIntrinsicElementProps","role","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAwBgBA;;;eAAAA;;;;qCAxBgC;gCAOzC;iEACgB;kCAIU;AAY1B,SAASA,qBAAqBC,KAAoB,EAAEC,GAA8B;IACvF;IAEA,MAAM,EACJC,QAAQ,QAAQ,EAChBC,WAAW,KAAK,EAChBC,mBAAmB,EACnBC,YAAY,MAAM,EAClBC,YAAY,KAAK,EACjBC,aAAa,KAAK,EAClBC,YAAY,EACb,GAAGR;IAEJ,MAAM,EAAES,GAAG,EAAE,GAAGC,IAAAA,uCAAAA;IAChB,MAAM,EAAEC,WAAW,EAAEC,WAAW,EAAEC,YAAY,EAAEC,kBAAkB,EAAEC,cAAc,EAAEC,aAAa,EAAE,GACjGC,IAAAA,kCAAAA,EAAiB;QACff;QACAgB,WAAWT;QACXU,MAAMhB;QACNiB,gBAAgBf;QAChBgB,oBAAoBrB,MAAMqB,kBAAkB;QAC5CV,aAAaX,MAAMW,WAAW;QAC9BW,WAAWhB;QACXiB,eAAehB,aAAa,QAAQ;IACtC;IAEF,MAAMiB,sBAAmEC,IAAAA,gCAAAA,EAAiB,CAACC,OAAOC,SAASC;QACzG,MAAMC,aAAajB,YAAYkB,eAAe,CAACH,SAASC;QACxDxB,wBAAAA,QAAAA,wBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,oBAAsBsB,OAAO;YAAEA;YAAOK,MAAM;YAASC,OAAOH;QAAW;QAEvE,OAAOA;IACT;IAEA,MAAMI,oBAA+DR,IAAAA,gCAAAA,EAAiB,CAACC,OAAOM,OAAOJ;QACnGhB,YAAYsB,aAAa,CAACF,OAAOJ;QAEjCxB,wBAAAA,QAAAA,wBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,oBAAsBsB,OAAO;YAAEA;YAAOK,MAAM;YAASC;QAAM;IAC7D;IAEA,MAAMG,wBAAuEV,IAAAA,gCAAAA,EAAiB,CAACC,OAAOR;QACpG,MAAMkB,gBAAgBxB,YAAYyB,iBAAiB,CAACnB;QACpDd,wBAAAA,QAAAA,wBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,oBAAsBsB,OAAO;YAAEA;YAAOK,MAAM;YAASC,OAAOI;QAAc;QAE1E,OAAOA;IACT;IAEA,MAAME,aAAaC,IAAAA,6BAAAA,EAActC,KAAKY;IAEtC,4BAA4B;IAC5B,MAAM2B,sBAAsBC,OAAMC,MAAM,CAAS;IACjD,MAAMC,iBAAiBF,OAAMC,MAAM,CAAS;IAC5C,MAAME,cAAcH,OAAMC,MAAM,CAAa,EAAE;IAE/C,MAAM,EAAEG,QAAQ,EAAE,GAAGC,IAAAA,gCAAAA;IAErB,MAAMC,qBAAqBtB,IAAAA,gCAAAA,EAAiB;QAC1C,IAAIkB,eAAeK,OAAO,IAAI,KAAK,CAACxC,cAAc;YAChD,+CAA+C;YAC/C;QACF;QAEA,MAAMyC,mBAAmBzC,aAAaG,aAAagC,eAAeK,OAAO,EAAEJ,YAAYI,OAAO;QAE9F,IAAIC,qBAAqBT,oBAAoBQ,OAAO,EAAE;YACpDR,oBAAoBQ,OAAO,GAAGC;YAC9BJ,SAASI,kBAAkB;gBAAEC,QAAQ;YAAK;QAC5C;IACF;IAEAC,IAAAA,yCAAAA,EAA0B;QACxB,oDAAoD;QACpD,OAAOrC,mBAAmBsC,CAAAA;YACxB,IAAIT,eAAeK,OAAO,IAAI,KAAKI,KAAKC,aAAa,GAAG,KAAK7C,cAAc;gBACzE,MAAMyC,mBAAmBzC,aAAa4C,KAAKzC,WAAW,EAAEyC,KAAKC,aAAa,EAAED,KAAKE,cAAc;gBAC/F,mFAAmF;gBACnFd,oBAAoBQ,OAAO,GAAGC;YAChC;YACAN,eAAeK,OAAO,GAAGI,KAAKC,aAAa;YAC3CT,YAAYI,OAAO,GAAGI,KAAKE,cAAc;YACzCP;QACF;IACF,GAAG;QAACjC;QAAoBiC;QAAoBvC;KAAa;IAEzD2C,IAAAA,yCAAAA,EAA0B;QACxBJ;IACF,GAAG;QAACpC;QAAaoC;KAAmB;IAEpC,OAAO;QACLQ,YAAY;YACVC,MAAM;QACR;QACAA,MAAMC,oBAAAA,CAAKC,MAAM,CACfC,IAAAA,wCAAAA,EAAyB,OAAO;YAC9B1D,KAAKqC;YACLsB,MAAM;YACN,GAAG5D,KAAK;QACV,IACA;YAAE6D,aAAa;QAAM;QAGvBlD;QACAR;QACAU,cAAcyB;QACdd;QACAW;QACAF;QACAnB;QACAC;QACAC;IACF;AACF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useCarouselContextValues_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useCarouselContextValues_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
function useCarouselContextValues_unstable(state) {
|
|
14
|
+
const { activeIndex, selectPageByElement, selectPageByDirection, selectPageByIndex, subscribeForValues, enableAutoplay, resetAutoplay, circular, containerRef } = state;
|
|
15
|
+
const carousel = _react.useMemo(()=>({
|
|
16
|
+
activeIndex,
|
|
17
|
+
selectPageByElement,
|
|
18
|
+
selectPageByDirection,
|
|
19
|
+
selectPageByIndex,
|
|
20
|
+
subscribeForValues,
|
|
21
|
+
enableAutoplay,
|
|
22
|
+
resetAutoplay,
|
|
23
|
+
circular,
|
|
24
|
+
containerRef
|
|
25
|
+
}), [
|
|
26
|
+
activeIndex,
|
|
27
|
+
selectPageByElement,
|
|
28
|
+
selectPageByDirection,
|
|
29
|
+
selectPageByIndex,
|
|
30
|
+
subscribeForValues,
|
|
31
|
+
enableAutoplay,
|
|
32
|
+
resetAutoplay,
|
|
33
|
+
circular,
|
|
34
|
+
containerRef
|
|
35
|
+
]);
|
|
36
|
+
return {
|
|
37
|
+
carousel
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -0,0 +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":["useCarouselContextValues_unstable","state","activeIndex","selectPageByElement","selectPageByDirection","selectPageByIndex","subscribeForValues","enableAutoplay","resetAutoplay","circular","containerRef","carousel","React","useMemo"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAKgBA;;;eAAAA;;;;iEALO;AAKhB,SAASA,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,WAAWC,OAAMC,OAAO,CAC5B,IAAO,CAAA;YACLX;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"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
carouselClassNames: function() {
|
|
13
|
+
return carouselClassNames;
|
|
14
|
+
},
|
|
15
|
+
useCarouselStyles_unstable: function() {
|
|
16
|
+
return useCarouselStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _react = require("@griffel/react");
|
|
20
|
+
const carouselClassNames = {
|
|
21
|
+
root: 'fui-Carousel'
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Styles for the root slot
|
|
25
|
+
*/ const useStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
26
|
+
root: {
|
|
27
|
+
z8tnut: "fr4fn7s",
|
|
28
|
+
B68tc82: 0,
|
|
29
|
+
Bmxbyg5: 0,
|
|
30
|
+
Bpg54ce: "f1a3p1vp",
|
|
31
|
+
Eiaeu8: "f1115ve7",
|
|
32
|
+
qhf8xq: "f10pi13n"
|
|
33
|
+
}
|
|
34
|
+
}, {
|
|
35
|
+
d: [
|
|
36
|
+
".fr4fn7s{padding-top:var(--strokeWidthThick);}",
|
|
37
|
+
[
|
|
38
|
+
".f1a3p1vp{overflow:hidden;}",
|
|
39
|
+
{
|
|
40
|
+
p: -1
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
".f1115ve7{overflow-anchor:none;}",
|
|
44
|
+
".f10pi13n{position:relative;}"
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
const useCarouselStyles_unstable = (state)=>{
|
|
48
|
+
'use no memo';
|
|
49
|
+
const styles = useStyles();
|
|
50
|
+
state.root.className = (0, _react.mergeClasses)(carouselClassNames.root, styles.root, state.root.className);
|
|
51
|
+
return state;
|
|
52
|
+
}; //# sourceMappingURL=useCarouselStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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"],"names":["carouselClassNames","useCarouselStyles_unstable","root","useStyles","__styles","z8tnut","B68tc82","Bmxbyg5","Bpg54ce","Eiaeu8","qhf8xq","d","p","state","styles","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEaA,kBAAkB;eAAlBA;;IAeIC,0BAA0B;eAA1BA;;;uBAjBwB;AAElC,MAAMD,qBAAqB;IAC9BE,MAAM;AACV;AACA;;CAEA,GAAI,MAAMC,YAAS,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAF,MAAA;QAAAG,QAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,QAAA;IAAA;AAAA,GAAA;IAAAC,GAAA;QAAA;QAAA;YAAA;YAAA;gBAAAC,GAAA,CAAA;YAAA;SAAA;QAAA;QAAA;KAAA;AAAA;AAUX,MAAMX,6BAA8BY,CAAAA;IAC3C;IACA,MAAMC,SAASX;IACfU,MAAMX,IAAI,CAACa,SAAS,GAAGC,IAAAA,mBAAY,EAAChB,mBAAmBE,IAAI,EAAEY,OAAOZ,IAAI,EAAEW,MAAMX,IAAI,CAACa,SAAS;IAC9F,OAAOF;AACX"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "CarouselAutoplayButton", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return CarouselAutoplayButton;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _useCarouselAutoplayButton = require("./useCarouselAutoplayButton");
|
|
14
|
+
const _renderCarouselAutoplayButton = require("./renderCarouselAutoplayButton");
|
|
15
|
+
const _useCarouselAutoplayButtonStylesstyles = require("./useCarouselAutoplayButtonStyles.styles");
|
|
16
|
+
const CarouselAutoplayButton = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
17
|
+
const state = (0, _useCarouselAutoplayButton.useCarouselAutoplayButton_unstable)(props, ref);
|
|
18
|
+
(0, _useCarouselAutoplayButtonStylesstyles.useCarouselAutoplayButtonStyles_unstable)(state);
|
|
19
|
+
// TODO update types in packages/react-components/react-shared-contexts/src/CustomStyleHooksContext/CustomStyleHooksContext.ts
|
|
20
|
+
// https://github.com/microsoft/fluentui/blob/master/rfcs/react-components/convergence/custom-styling.md
|
|
21
|
+
// useCustomStyleHook_unstable('useCarouselAutoplayButtonStyles_unstable')(state);
|
|
22
|
+
return (0, _renderCarouselAutoplayButton.renderCarouselAutoplayButton_unstable)(state);
|
|
23
|
+
});
|
|
24
|
+
CarouselAutoplayButton.displayName = 'CarouselAutoplayButton';
|
|
@@ -0,0 +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":["CarouselAutoplayButton","React","forwardRef","props","ref","state","useCarouselAutoplayButton_unstable","useCarouselAutoplayButtonStyles_unstable","renderCarouselAutoplayButton_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAaaA;;;eAAAA;;;;iEAbU;2CAE4B;8CACG;uDACG;AASlD,MAAMA,yBAAAA,WAAAA,GAA2EC,OAAMC,UAAU,CACtG,CAACC,OAAOC;IACN,MAAMC,QAAQC,IAAAA,6DAAAA,EAAmCH,OAAOC;IAExDG,IAAAA,+EAAAA,EAAyCF;IACzC,8HAA8H;IAC9H,wGAAwG;IACxG,kFAAkF;IAClF,OAAOG,IAAAA,mEAAAA,EAAsCH;AAC/C;AAGFL,uBAAuBS,WAAW,GAAG"}
|
|
@@ -0,0 +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":[],"rangeMappings":";;;;;","mappings":";;;;;iEAGuB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
|
6
|
+
_export_star._(require("./CarouselAutoplayButton"), exports);
|
|
7
|
+
_export_star._(require("./CarouselAutoplayButton.types"), exports);
|
|
8
|
+
_export_star._(require("./renderCarouselAutoplayButton"), exports);
|
|
9
|
+
_export_star._(require("./useCarouselAutoplayButton"), exports);
|
|
10
|
+
_export_star._(require("./useCarouselAutoplayButtonStyles.styles"), exports);
|
|
@@ -0,0 +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":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderCarouselAutoplayButton_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return renderCarouselAutoplayButton_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
12
|
+
const _reactbutton = require("@fluentui/react-button");
|
|
13
|
+
const renderCarouselAutoplayButton_unstable = (state)=>{
|
|
14
|
+
(0, _reactutilities.assertSlots)(state);
|
|
15
|
+
// We render the underlying react-button with injected carousel functionality
|
|
16
|
+
return (0, _reactbutton.renderToggleButton_unstable)(state);
|
|
17
|
+
};
|
|
@@ -0,0 +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":["renderCarouselAutoplayButton_unstable","state","assertSlots","renderToggleButton_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;gCATb;6BAI4C;AAKrC,MAAMA,wCAAwC,CAACC;IACpDC,IAAAA,2BAAAA,EAAyCD;IAEzC,6EAA6E;IAC7E,OAAOE,IAAAA,wCAAAA,EAA4BF;AACrC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useCarouselAutoplayButton_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useCarouselAutoplayButton_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _reactbutton = require("@fluentui/react-button");
|
|
13
|
+
const _reacticons = require("@fluentui/react-icons");
|
|
14
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
15
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
16
|
+
const _CarouselContext = require("../CarouselContext");
|
|
17
|
+
const useCarouselAutoplayButton_unstable = (props, ref)=>{
|
|
18
|
+
const { onCheckedChange, checked, defaultChecked } = props;
|
|
19
|
+
const [autoplay, setAutoplay] = (0, _reactutilities.useControllableState)({
|
|
20
|
+
state: checked,
|
|
21
|
+
defaultState: defaultChecked,
|
|
22
|
+
initialState: false
|
|
23
|
+
});
|
|
24
|
+
const enableAutoplay = (0, _CarouselContext.useCarouselContext_unstable)((ctx)=>ctx.enableAutoplay);
|
|
25
|
+
_react.useEffect(()=>{
|
|
26
|
+
return ()=>{
|
|
27
|
+
// We disable autoplay if the button gets unmounted.
|
|
28
|
+
enableAutoplay(false);
|
|
29
|
+
};
|
|
30
|
+
}, [
|
|
31
|
+
enableAutoplay
|
|
32
|
+
]);
|
|
33
|
+
(0, _reactutilities.useIsomorphicLayoutEffect)(()=>{
|
|
34
|
+
// Enable/disable autoplay on state change
|
|
35
|
+
enableAutoplay(autoplay);
|
|
36
|
+
}, [
|
|
37
|
+
autoplay,
|
|
38
|
+
enableAutoplay
|
|
39
|
+
]);
|
|
40
|
+
const handleClick = (event)=>{
|
|
41
|
+
if (event.isDefaultPrevented()) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const newValue = !autoplay;
|
|
45
|
+
setAutoplay(newValue);
|
|
46
|
+
onCheckedChange === null || onCheckedChange === void 0 ? void 0 : onCheckedChange(event, {
|
|
47
|
+
event,
|
|
48
|
+
type: 'click',
|
|
49
|
+
checked: newValue
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
// We lean on react-button class to handle styling and icon enhancements
|
|
54
|
+
...(0, _reactbutton.useToggleButton_unstable)({
|
|
55
|
+
icon: _reactutilities.slot.optional(props.icon, {
|
|
56
|
+
defaultProps: {
|
|
57
|
+
children: autoplay ? /*#__PURE__*/ _react.createElement(_reacticons.PauseCircleRegular, null) : /*#__PURE__*/ _react.createElement(_reacticons.PlayCircleRegular, null)
|
|
58
|
+
},
|
|
59
|
+
renderByDefault: true,
|
|
60
|
+
elementType: 'span'
|
|
61
|
+
}),
|
|
62
|
+
...props,
|
|
63
|
+
checked: autoplay,
|
|
64
|
+
onClick: (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(handleClick, props.onClick))
|
|
65
|
+
}, ref)
|
|
66
|
+
};
|
|
67
|
+
};
|
|
@@ -0,0 +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":["useCarouselAutoplayButton_unstable","props","ref","onCheckedChange","checked","defaultChecked","autoplay","setAutoplay","useControllableState","state","defaultState","initialState","enableAutoplay","useCarouselContext","ctx","React","useEffect","useIsomorphicLayoutEffect","handleClick","event","isDefaultPrevented","newValue","type","useToggleButton_unstable","icon","slot","optional","defaultProps","children","createElement","PauseCircleRegular","PlayCircleRegular","renderByDefault","elementType","onClick","useEventCallback","mergeCallbacks"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAwBaA;;;eAAAA;;;;6BAvB4B;4BACa;gCAO/C;iEACgB;iCAG2C;AAW3D,MAAMA,qCAAqC,CAChDC,OACAC;IAEA,MAAM,EAAEC,eAAe,EAAEC,OAAO,EAAEC,cAAc,EAAE,GAAGJ;IAErD,MAAM,CAACK,UAAUC,YAAY,GAAGC,IAAAA,oCAAAA,EAAqB;QACnDC,OAAOL;QACPM,cAAcL;QACdM,cAAc;IAChB;IACA,MAAMC,iBAAiBC,IAAAA,4CAAAA,EAAmBC,CAAAA,MAAOA,IAAIF,cAAc;IAEnEG,OAAMC,SAAS,CAAC;QACd,OAAO;YACL,oDAAoD;YACpDJ,eAAe;QACjB;IACF,GAAG;QAACA;KAAe;IAEnBK,IAAAA,yCAAAA,EAA0B;QACxB,0CAA0C;QAC1CL,eAAeN;IACjB,GAAG;QAACA;QAAUM;KAAe;IAE7B,MAAMM,cAAc,CAACC;QACnB,IAAIA,MAAMC,kBAAkB,IAAI;YAC9B;QACF;QAEA,MAAMC,WAAW,CAACf;QAElBC,YAAYc;QACZlB,oBAAAA,QAAAA,oBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,gBAAkBgB,OAAO;YAAEA;YAAOG,MAAM;YAASlB,SAASiB;QAAS;IACrE;IAEA,OAAO;QACL,wEAAwE;QACxE,GAAGE,IAAAA,qCAAAA,EACD;YACEC,MAAMC,oBAAAA,CAAKC,QAAQ,CAACzB,MAAMuB,IAAI,EAAE;gBAC9BG,cAAc;oBACZC,UAAUtB,WAAAA,WAAAA,GAAWS,OAAAc,aAAA,CAACC,8BAAAA,EAAAA,QAAAA,WAAAA,GAAwBf,OAAAc,aAAA,CAACE,6BAAAA,EAAAA;gBACjD;gBACAC,iBAAiB;gBACjBC,aAAa;YACf;YACA,GAAGhC,KAAK;YACRG,SAASE;YACT4B,SAASC,IAAAA,gCAAAA,EAAiBC,IAAAA,8BAAAA,EAAelB,aAAajB,MAAMiC,OAAO;QACrE,GACAhC,IACD;IACH;AACF"}
|
package/lib-commonjs/components/CarouselAutoplayButton/useCarouselAutoplayButtonStyles.styles.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
carouselAutoplayButtonClassNames: function() {
|
|
13
|
+
return carouselAutoplayButtonClassNames;
|
|
14
|
+
},
|
|
15
|
+
useCarouselAutoplayButtonStyles_unstable: function() {
|
|
16
|
+
return useCarouselAutoplayButtonStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _react = require("@griffel/react");
|
|
20
|
+
const _reactbutton = require("@fluentui/react-button");
|
|
21
|
+
const carouselAutoplayButtonClassNames = {
|
|
22
|
+
root: 'fui-CarouselAutoplayButton',
|
|
23
|
+
icon: 'fui-CarouselAutoplayButton__icon'
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Styles for the root slot
|
|
27
|
+
*/ const useStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
28
|
+
root: {
|
|
29
|
+
Bkecrkj: "fc5wo7j",
|
|
30
|
+
B6of3ja: "fgr6219",
|
|
31
|
+
jrapky: "f10jk5vf",
|
|
32
|
+
g2u3we: "fghlq4f",
|
|
33
|
+
h3c5rm: [
|
|
34
|
+
"f1gn591s",
|
|
35
|
+
"fjscplz"
|
|
36
|
+
],
|
|
37
|
+
B9xav0g: "fb073pr",
|
|
38
|
+
zhjwy3: [
|
|
39
|
+
"fjscplz",
|
|
40
|
+
"f1gn591s"
|
|
41
|
+
],
|
|
42
|
+
sj55zd: "fkfq4zb",
|
|
43
|
+
De3pzq: "fkfdr9r",
|
|
44
|
+
eoavqd: "f8491dx"
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
d: [
|
|
48
|
+
".fc5wo7j{pointer-events:all;}",
|
|
49
|
+
".fgr6219{margin-top:auto;}",
|
|
50
|
+
".f10jk5vf{margin-bottom:auto;}",
|
|
51
|
+
".fghlq4f{border-top-color:var(--colorTransparentStroke);}",
|
|
52
|
+
".f1gn591s{border-right-color:var(--colorTransparentStroke);}",
|
|
53
|
+
".fjscplz{border-left-color:var(--colorTransparentStroke);}",
|
|
54
|
+
".fb073pr{border-bottom-color:var(--colorTransparentStroke);}",
|
|
55
|
+
".fkfq4zb{color:var(--colorNeutralForeground2);}",
|
|
56
|
+
".fkfdr9r{background-color:var(--colorNeutralBackgroundAlpha);}"
|
|
57
|
+
],
|
|
58
|
+
h: [
|
|
59
|
+
".f8491dx:hover{cursor:pointer;}"
|
|
60
|
+
]
|
|
61
|
+
});
|
|
62
|
+
const useCarouselAutoplayButtonStyles_unstable = (state)=>{
|
|
63
|
+
'use no memo';
|
|
64
|
+
const styles = useStyles();
|
|
65
|
+
(0, _reactbutton.useToggleButtonStyles_unstable)(state);
|
|
66
|
+
state.root.className = (0, _react.mergeClasses)(carouselAutoplayButtonClassNames.root, styles.root, state.root.className);
|
|
67
|
+
if (state.icon) {
|
|
68
|
+
state.icon.className = (0, _react.mergeClasses)(carouselAutoplayButtonClassNames.icon, state.icon.className);
|
|
69
|
+
}
|
|
70
|
+
return state;
|
|
71
|
+
}; //# sourceMappingURL=useCarouselAutoplayButtonStyles.styles.js.map
|
package/lib-commonjs/components/CarouselAutoplayButton/useCarouselAutoplayButtonStyles.styles.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useCarouselAutoplayButtonStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { useToggleButtonStyles_unstable } from '@fluentui/react-button';\nimport { tokens } from '@fluentui/react-theme';\nexport const carouselAutoplayButtonClassNames = {\n root: 'fui-CarouselAutoplayButton',\n icon: 'fui-CarouselAutoplayButton__icon'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n pointerEvents: 'all',\n marginTop: 'auto',\n marginBottom: 'auto',\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n color: tokens.colorNeutralForeground2,\n backgroundColor: tokens.colorNeutralBackgroundAlpha,\n ':hover': {\n cursor: 'pointer'\n }\n }\n});\n/**\n * Apply styling to the CarouselAutoplayButton slots based on the state\n */ export const useCarouselAutoplayButtonStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n useToggleButtonStyles_unstable(state);\n state.root.className = mergeClasses(carouselAutoplayButtonClassNames.root, styles.root, state.root.className);\n if (state.icon) {\n state.icon.className = mergeClasses(carouselAutoplayButtonClassNames.icon, state.icon.className);\n }\n return state;\n};\n"],"names":["carouselAutoplayButtonClassNames","useCarouselAutoplayButtonStyles_unstable","root","icon","useStyles","__styles","Bkecrkj","B6of3ja","jrapky","g2u3we","h3c5rm","B9xav0g","zhjwy3","sj55zd","De3pzq","eoavqd","d","h","state","styles","useToggleButtonStyles_unstable","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAGaA,gCAAgC;eAAhCA;;IAqBIC,wCAAwC;eAAxCA;;;uBAxBoC;6BACN;AAExC,MAAMD,mCAAmC;IAC5CE,MAAM;IACNC,MAAM;AACV;AACA;;CAEA,GAAI,MAAMC,YAAS,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAH,MAAA;QAAAI,SAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,QAAA;YAAA;YAAA;SAAA;QAAAC,SAAA;QAAAC,QAAA;YAAA;YAAA;SAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,QAAA;IAAA;AAAA,GAAA;IAAAC,GAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;IAAAC,GAAA;QAAA;KAAA;AAAA;AAeX,MAAMhB,2CAA4CiB,CAAAA;IACzD;IACA,MAAMC,SAASf;IACfgB,IAAAA,2CAA8B,EAACF;IAC/BA,MAAMhB,IAAI,CAACmB,SAAS,GAAGC,IAAAA,mBAAY,EAACtB,iCAAiCE,IAAI,EAAEiB,OAAOjB,IAAI,EAAEgB,MAAMhB,IAAI,CAACmB,SAAS;IAC5G,IAAIH,MAAMf,IAAI,EAAE;QACZe,MAAMf,IAAI,CAACkB,SAAS,GAAGC,IAAAA,mBAAY,EAACtB,iCAAiCG,IAAI,EAAEe,MAAMf,IAAI,CAACkB,SAAS;IACnG;IACA,OAAOH;AACX"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "CarouselButton", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return CarouselButton;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _useCarouselButton = require("./useCarouselButton");
|
|
14
|
+
const _renderCarouselButton = require("./renderCarouselButton");
|
|
15
|
+
const _useCarouselButtonStylesstyles = require("./useCarouselButtonStyles.styles");
|
|
16
|
+
const CarouselButton = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
17
|
+
const state = (0, _useCarouselButton.useCarouselButton_unstable)(props, ref);
|
|
18
|
+
(0, _useCarouselButtonStylesstyles.useCarouselButtonStyles_unstable)(state);
|
|
19
|
+
// TODO update types in packages/react-components/react-shared-contexts/src/CustomStyleHooksContext/CustomStyleHooksContext.ts
|
|
20
|
+
// https://github.com/microsoft/fluentui/blob/master/rfcs/react-components/convergence/custom-styling.md
|
|
21
|
+
// useCustomStyleHook_unstable('useCarouselButtonStyles_unstable')(state);
|
|
22
|
+
return (0, _renderCarouselButton.renderCarouselButton_unstable)(state);
|
|
23
|
+
});
|
|
24
|
+
CarouselButton.displayName = 'CarouselButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["CarouselButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCarouselButton_unstable } from './useCarouselButton';\nimport { renderCarouselButton_unstable } from './renderCarouselButton';\nimport { useCarouselButtonStyles_unstable } from './useCarouselButtonStyles.styles';\nimport type { CarouselButtonProps } from './CarouselButton.types';\n\n/**\n * A default navigation button that will set value to the next/previous page,\n * driven by it's type 'next' or 'previous'.\n */\nexport const CarouselButton: ForwardRefComponent<CarouselButtonProps> = React.forwardRef((props, ref) => {\n const state = useCarouselButton_unstable(props, ref);\n\n useCarouselButtonStyles_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('useCarouselButtonStyles_unstable')(state);\n\n return renderCarouselButton_unstable(state);\n});\n\nCarouselButton.displayName = 'CarouselButton';\n"],"names":["CarouselButton","React","forwardRef","props","ref","state","useCarouselButton_unstable","useCarouselButtonStyles_unstable","renderCarouselButton_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;mCAEoB;sCACG;+CACG;AAO1C,MAAMA,iBAAAA,WAAAA,GAA2DC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQC,IAAAA,6CAAAA,EAA2BH,OAAOC;IAEhDG,IAAAA,+DAAAA,EAAiCF;IACjC,8HAA8H;IAC9H,wGAAwG;IACxG,0EAA0E;IAE1E,OAAOG,IAAAA,mDAAAA,EAA8BH;AACvC;AAEAL,eAAeS,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["CarouselButton.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport { ButtonProps, ButtonSlots, ButtonState } from '@fluentui/react-button';\n\nexport type CarouselButtonSlots = ButtonSlots & {\n root: NonNullable<Slot<ARIAButtonSlotProps>>;\n};\n\n/**\n * CarouselButton Props\n */\nexport type CarouselButtonProps = Partial<ButtonProps> &\n ComponentProps<CarouselButtonSlots> & {\n /**\n * Dictates whether button will be of type go next or go previous\n * Default: 'next'\n */\n navType?: 'prev' | 'next';\n };\n\n/**\n * State used in rendering CarouselButton\n */\nexport type CarouselButtonState = ButtonState &\n ComponentState<CarouselButtonSlots> &\n Required<Pick<CarouselButtonProps, 'navType'>>;\n"],"names":[],"rangeMappings":";;","mappings":"AAoBA;;CAEC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
|
6
|
+
_export_star._(require("./CarouselButton"), exports);
|
|
7
|
+
_export_star._(require("./CarouselButton.types"), exports);
|
|
8
|
+
_export_star._(require("./renderCarouselButton"), exports);
|
|
9
|
+
_export_star._(require("./useCarouselButton"), exports);
|
|
10
|
+
_export_star._(require("./useCarouselButtonStyles.styles"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './CarouselButton';\nexport * from './CarouselButton.types';\nexport * from './renderCarouselButton';\nexport * from './useCarouselButton';\nexport * from './useCarouselButtonStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderCarouselButton_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return renderCarouselButton_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
12
|
+
const _reactbutton = require("@fluentui/react-button");
|
|
13
|
+
const renderCarouselButton_unstable = (state)=>{
|
|
14
|
+
(0, _reactutilities.assertSlots)(state);
|
|
15
|
+
// We render the underlying react-button with injected carousel functionality
|
|
16
|
+
return (0, _reactbutton.renderButton_unstable)(state);
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderCarouselButton.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { CarouselButtonState, CarouselButtonSlots } from './CarouselButton.types';\nimport { renderButton_unstable } from '@fluentui/react-button';\n\n/**\n * Render the final JSX of CarouselButton\n */\nexport const renderCarouselButton_unstable = (state: CarouselButtonState) => {\n assertSlots<CarouselButtonSlots>(state);\n\n // We render the underlying react-button with injected carousel functionality\n return renderButton_unstable(state);\n};\n"],"names":["renderCarouselButton_unstable","state","assertSlots","renderButton_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;gCATb;6BAIsC;AAK/B,MAAMA,gCAAgC,CAACC;IAC5CC,IAAAA,2BAAAA,EAAiCD;IAEjC,6EAA6E;IAC7E,OAAOE,IAAAA,kCAAAA,EAAsBF;AAC/B"}
|