@salutejs/plasma-new-hope 0.326.0-canary.2016.15556762192.0 → 0.326.0-dev.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.
- package/cjs/components/Carousel/CarouselNew/Carousel.css +41 -0
- package/cjs/components/Carousel/CarouselNew/Carousel.js +110 -0
- package/cjs/components/Carousel/CarouselNew/Carousel.js.map +1 -0
- package/cjs/components/Carousel/CarouselNew/Carousel.styles.js +43 -0
- package/cjs/components/Carousel/CarouselNew/Carousel.styles.js.map +1 -0
- package/cjs/components/Carousel/CarouselNew/Carousel.styles_151pk3s.css +5 -0
- package/cjs/components/Carousel/CarouselNew/Carousel.tokens.js +24 -0
- package/cjs/components/Carousel/CarouselNew/Carousel.tokens.js.map +1 -0
- package/cjs/components/Carousel/CarouselNew/hooks/useCarousel.js +384 -0
- package/cjs/components/Carousel/CarouselNew/hooks/useCarousel.js.map +1 -0
- package/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.css +5 -0
- package/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.js +227 -0
- package/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.js.map +1 -0
- package/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.styles.js +39 -0
- package/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.styles.js.map +1 -0
- package/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.styles_ea836d.css +5 -0
- package/cjs/components/Carousel/CarouselNew/ui/Dots/utils/index.js +47 -0
- package/cjs/components/Carousel/CarouselNew/ui/Dots/utils/index.js.map +1 -0
- package/cjs/components/Carousel/CarouselNew/variations/_size/base.js +9 -0
- package/cjs/components/Carousel/CarouselNew/variations/_size/base.js.map +1 -0
- package/cjs/components/Carousel/CarouselNew/variations/_size/base_x642ct.css +1 -0
- package/cjs/components/Carousel/CarouselNew/variations/_view/base.js +9 -0
- package/cjs/components/Carousel/CarouselNew/variations/_view/base.js.map +1 -0
- package/cjs/components/Carousel/CarouselNew/variations/_view/base_x642ct.css +1 -0
- package/cjs/components/Carousel/CarouselOld/Carousel.css +4 -0
- package/cjs/components/Carousel/{Carousel.js → CarouselOld/Carousel.js} +1 -1
- package/cjs/components/Carousel/CarouselOld/Carousel.js.map +1 -0
- package/cjs/components/Carousel/{Carousel.styles.js → CarouselOld/Carousel.styles.js} +9 -9
- package/cjs/components/Carousel/CarouselOld/Carousel.styles.js.map +1 -0
- package/cjs/components/Carousel/CarouselOld/Carousel.styles_12r304j.css +4 -0
- package/cjs/components/Carousel/{CarouselItem.js → CarouselOld/CarouselItem.js} +5 -5
- package/cjs/components/Carousel/CarouselOld/CarouselItem.js.map +1 -0
- package/cjs/components/Carousel/CarouselOld/CarouselItem_cghzk7.css +1 -0
- package/cjs/components/Carousel/CarouselOld/useCarousel.js.map +1 -0
- package/cjs/components/Carousel/{useDragScroll.js → CarouselOld/useDragScroll.js} +1 -1
- package/cjs/components/Carousel/CarouselOld/useDragScroll.js.map +1 -0
- package/cjs/components/Mask/Mask.js +3 -3
- package/cjs/components/Mask/Mask.js.map +1 -1
- package/cjs/hooks/useDidMountLayoutEffect.js +19 -0
- package/cjs/hooks/useDidMountLayoutEffect.js.map +1 -0
- package/cjs/index.css +17 -5
- package/cjs/index.js +10 -3
- package/cjs/index.js.map +1 -1
- package/emotion/cjs/components/Carousel/CarouselNew/Carousel.js +110 -0
- package/emotion/cjs/components/Carousel/CarouselNew/Carousel.styles.js +64 -0
- package/emotion/cjs/components/Carousel/CarouselNew/Carousel.tokens.js +22 -0
- package/emotion/cjs/components/Carousel/CarouselNew/hooks/useCarousel.js +376 -0
- package/emotion/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.js +229 -0
- package/emotion/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.styles.js +38 -0
- package/emotion/cjs/components/Carousel/CarouselNew/ui/Dots/utils/index.js +44 -0
- package/emotion/cjs/components/Carousel/CarouselNew/ui/index.js +16 -0
- package/emotion/cjs/components/Carousel/CarouselNew/variations/_size/base.js +8 -0
- package/emotion/cjs/components/Carousel/CarouselNew/variations/_size/tokens.json +1 -0
- package/emotion/cjs/components/Carousel/CarouselNew/variations/_view/base.js +8 -0
- package/emotion/cjs/components/Carousel/CarouselNew/variations/_view/tokens.json +1 -0
- package/emotion/cjs/components/Carousel/CarouselOld/Carousel.styles.js +49 -0
- package/emotion/cjs/components/Carousel/CarouselOld/Carousel.types.js +5 -0
- package/emotion/cjs/components/Carousel/{CarouselItem.js → CarouselOld/CarouselItem.js} +2 -2
- package/emotion/cjs/components/Carousel/CarouselOld/index.js +32 -0
- package/emotion/cjs/components/Carousel/index.js +23 -3
- package/emotion/cjs/components/Mask/Mask.js +3 -3
- package/emotion/cjs/examples/plasma_b2c/components/Carousel/Carousel.config.js +14 -2
- package/emotion/cjs/examples/plasma_b2c/components/Carousel/Carousel.js +1 -1
- package/emotion/cjs/examples/plasma_b2c/components/Carousel/Carousel.stories.tsx +90 -32
- package/emotion/cjs/examples/plasma_web/components/Carousel/Carousel.config.js +14 -2
- package/emotion/cjs/examples/plasma_web/components/Carousel/Carousel.js +1 -1
- package/emotion/cjs/examples/plasma_web/components/Carousel/Carousel.stories.tsx +91 -32
- package/emotion/cjs/hooks/index.js +7 -0
- package/emotion/cjs/hooks/useDidMountLayoutEffect.js +17 -0
- package/emotion/es/components/Carousel/CarouselNew/Carousel.js +101 -0
- package/emotion/es/components/Carousel/CarouselNew/Carousel.styles.js +57 -0
- package/emotion/es/components/Carousel/CarouselNew/Carousel.tokens.js +16 -0
- package/emotion/es/components/Carousel/CarouselNew/hooks/useCarousel.js +366 -0
- package/emotion/es/components/Carousel/CarouselNew/ui/Dots/Dots.js +219 -0
- package/emotion/es/components/Carousel/CarouselNew/ui/Dots/Dots.styles.js +31 -0
- package/emotion/es/components/Carousel/CarouselNew/ui/Dots/utils/index.js +38 -0
- package/emotion/es/components/Carousel/CarouselNew/ui/index.js +1 -0
- package/emotion/es/components/Carousel/CarouselNew/variations/_size/base.js +2 -0
- package/emotion/es/components/Carousel/CarouselNew/variations/_size/tokens.json +1 -0
- package/emotion/es/components/Carousel/CarouselNew/variations/_view/base.js +2 -0
- package/emotion/es/components/Carousel/CarouselNew/variations/_view/tokens.json +1 -0
- package/emotion/es/components/Carousel/CarouselOld/Carousel.styles.js +42 -0
- package/emotion/es/components/Carousel/CarouselOld/Carousel.types.js +1 -0
- package/emotion/es/components/Carousel/{CarouselItem.js → CarouselOld/CarouselItem.js} +2 -2
- package/emotion/es/components/Carousel/CarouselOld/index.js +3 -0
- package/emotion/es/components/Carousel/index.js +7 -3
- package/emotion/es/components/Mask/Mask.js +3 -3
- package/emotion/es/examples/plasma_b2c/components/Carousel/Carousel.config.js +14 -2
- package/emotion/es/examples/plasma_b2c/components/Carousel/Carousel.js +2 -2
- package/emotion/es/examples/plasma_b2c/components/Carousel/Carousel.stories.tsx +90 -32
- package/emotion/es/examples/plasma_web/components/Carousel/Carousel.config.js +14 -2
- package/emotion/es/examples/plasma_web/components/Carousel/Carousel.js +2 -2
- package/emotion/es/examples/plasma_web/components/Carousel/Carousel.stories.tsx +91 -32
- package/emotion/es/hooks/index.js +1 -0
- package/emotion/es/hooks/useDidMountLayoutEffect.js +11 -0
- package/es/components/Carousel/CarouselNew/Carousel.css +41 -0
- package/es/components/Carousel/CarouselNew/Carousel.js +101 -0
- package/es/components/Carousel/CarouselNew/Carousel.js.map +1 -0
- package/es/components/Carousel/CarouselNew/Carousel.styles.js +34 -0
- package/es/components/Carousel/CarouselNew/Carousel.styles.js.map +1 -0
- package/es/components/Carousel/CarouselNew/Carousel.styles_151pk3s.css +5 -0
- package/es/components/Carousel/CarouselNew/Carousel.tokens.js +19 -0
- package/es/components/Carousel/CarouselNew/Carousel.tokens.js.map +1 -0
- package/es/components/Carousel/CarouselNew/hooks/useCarousel.js +369 -0
- package/es/components/Carousel/CarouselNew/hooks/useCarousel.js.map +1 -0
- package/es/components/Carousel/CarouselNew/ui/Dots/Dots.css +5 -0
- package/es/components/Carousel/CarouselNew/ui/Dots/Dots.js +218 -0
- package/es/components/Carousel/CarouselNew/ui/Dots/Dots.js.map +1 -0
- package/es/components/Carousel/CarouselNew/ui/Dots/Dots.styles.js +31 -0
- package/es/components/Carousel/CarouselNew/ui/Dots/Dots.styles.js.map +1 -0
- package/es/components/Carousel/CarouselNew/ui/Dots/Dots.styles_ea836d.css +5 -0
- package/es/components/Carousel/CarouselNew/ui/Dots/utils/index.js +41 -0
- package/es/components/Carousel/CarouselNew/ui/Dots/utils/index.js.map +1 -0
- package/es/components/Carousel/CarouselNew/variations/_size/base.js +5 -0
- package/es/components/Carousel/CarouselNew/variations/_size/base.js.map +1 -0
- package/es/components/Carousel/CarouselNew/variations/_size/base_x642ct.css +1 -0
- package/es/components/Carousel/CarouselNew/variations/_view/base.js +5 -0
- package/es/components/Carousel/CarouselNew/variations/_view/base.js.map +1 -0
- package/es/components/Carousel/CarouselNew/variations/_view/base_x642ct.css +1 -0
- package/es/components/Carousel/CarouselOld/Carousel.css +4 -0
- package/es/components/Carousel/{Carousel.js → CarouselOld/Carousel.js} +1 -1
- package/es/components/Carousel/CarouselOld/Carousel.js.map +1 -0
- package/es/components/Carousel/{Carousel.styles.js → CarouselOld/Carousel.styles.js} +9 -9
- package/es/components/Carousel/CarouselOld/Carousel.styles.js.map +1 -0
- package/es/components/Carousel/CarouselOld/Carousel.styles_12r304j.css +4 -0
- package/es/components/Carousel/{CarouselItem.js → CarouselOld/CarouselItem.js} +5 -5
- package/es/components/Carousel/CarouselOld/CarouselItem.js.map +1 -0
- package/es/components/Carousel/CarouselOld/CarouselItem_cghzk7.css +1 -0
- package/es/components/Carousel/CarouselOld/useCarousel.js.map +1 -0
- package/es/components/Carousel/{useDragScroll.js → CarouselOld/useDragScroll.js} +1 -1
- package/es/components/Carousel/CarouselOld/useDragScroll.js.map +1 -0
- package/es/components/Mask/Mask.js +3 -3
- package/es/components/Mask/Mask.js.map +1 -1
- package/es/hooks/useDidMountLayoutEffect.js +15 -0
- package/es/hooks/useDidMountLayoutEffect.js.map +1 -0
- package/es/index.css +17 -5
- package/es/index.js +6 -3
- package/es/index.js.map +1 -1
- package/package.json +5 -5
- package/styled-components/cjs/components/Carousel/CarouselNew/Carousel.js +110 -0
- package/styled-components/cjs/components/Carousel/CarouselNew/Carousel.styles.js +28 -0
- package/styled-components/cjs/components/Carousel/CarouselNew/Carousel.tokens.js +22 -0
- package/styled-components/cjs/components/Carousel/CarouselNew/Carousel.types.js +5 -0
- package/styled-components/cjs/components/Carousel/CarouselNew/hooks/useCarousel.js +376 -0
- package/styled-components/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.js +229 -0
- package/styled-components/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.styles.js +24 -0
- package/styled-components/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.types.js +5 -0
- package/styled-components/cjs/components/Carousel/CarouselNew/ui/Dots/utils/index.js +44 -0
- package/styled-components/cjs/components/Carousel/CarouselNew/ui/index.js +16 -0
- package/styled-components/cjs/components/Carousel/CarouselNew/variations/_size/base.js +8 -0
- package/styled-components/cjs/components/Carousel/CarouselNew/variations/_size/tokens.json +1 -0
- package/styled-components/cjs/components/Carousel/CarouselNew/variations/_view/base.js +8 -0
- package/styled-components/cjs/components/Carousel/CarouselNew/variations/_view/tokens.json +1 -0
- package/styled-components/cjs/components/Carousel/{Carousel.styles.js → CarouselOld/Carousel.styles.js} +3 -3
- package/styled-components/cjs/components/Carousel/CarouselOld/Carousel.types.js +5 -0
- package/styled-components/cjs/components/Carousel/{CarouselItem.js → CarouselOld/CarouselItem.js} +2 -2
- package/styled-components/cjs/components/Carousel/CarouselOld/index.js +32 -0
- package/styled-components/cjs/components/Carousel/index.js +23 -3
- package/styled-components/cjs/components/Mask/Mask.js +3 -3
- package/styled-components/cjs/examples/plasma_b2c/components/Carousel/Carousel.config.js +14 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Carousel/Carousel.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Carousel/Carousel.stories.tsx +90 -32
- package/styled-components/cjs/examples/plasma_web/components/Carousel/Carousel.config.js +14 -2
- package/styled-components/cjs/examples/plasma_web/components/Carousel/Carousel.js +1 -1
- package/styled-components/cjs/examples/plasma_web/components/Carousel/Carousel.stories.tsx +91 -32
- package/styled-components/cjs/hooks/index.js +7 -0
- package/styled-components/cjs/hooks/useDidMountLayoutEffect.js +17 -0
- package/styled-components/es/components/Carousel/CarouselNew/Carousel.js +101 -0
- package/styled-components/es/components/Carousel/CarouselNew/Carousel.styles.js +20 -0
- package/styled-components/es/components/Carousel/CarouselNew/Carousel.tokens.js +16 -0
- package/styled-components/es/components/Carousel/CarouselNew/Carousel.types.js +1 -0
- package/styled-components/es/components/Carousel/CarouselNew/hooks/useCarousel.js +366 -0
- package/styled-components/es/components/Carousel/CarouselNew/ui/Dots/Dots.js +219 -0
- package/styled-components/es/components/Carousel/CarouselNew/ui/Dots/Dots.styles.js +17 -0
- package/styled-components/es/components/Carousel/CarouselNew/ui/Dots/Dots.types.js +1 -0
- package/styled-components/es/components/Carousel/CarouselNew/ui/Dots/utils/index.js +38 -0
- package/styled-components/es/components/Carousel/CarouselNew/ui/index.js +1 -0
- package/styled-components/es/components/Carousel/CarouselNew/variations/_size/base.js +2 -0
- package/styled-components/es/components/Carousel/CarouselNew/variations/_size/tokens.json +1 -0
- package/styled-components/es/components/Carousel/CarouselNew/variations/_view/base.js +2 -0
- package/styled-components/es/components/Carousel/CarouselNew/variations/_view/tokens.json +1 -0
- package/styled-components/es/components/Carousel/{Carousel.styles.js → CarouselOld/Carousel.styles.js} +3 -3
- package/styled-components/es/components/Carousel/CarouselOld/Carousel.types.js +1 -0
- package/styled-components/es/components/Carousel/{CarouselItem.js → CarouselOld/CarouselItem.js} +2 -2
- package/styled-components/es/components/Carousel/CarouselOld/index.js +3 -0
- package/styled-components/es/components/Carousel/index.js +7 -3
- package/styled-components/es/components/Mask/Mask.js +3 -3
- package/styled-components/es/examples/plasma_b2c/components/Carousel/Carousel.config.js +14 -2
- package/styled-components/es/examples/plasma_b2c/components/Carousel/Carousel.js +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Carousel/Carousel.stories.tsx +90 -32
- package/styled-components/es/examples/plasma_web/components/Carousel/Carousel.config.js +14 -2
- package/styled-components/es/examples/plasma_web/components/Carousel/Carousel.js +2 -2
- package/styled-components/es/examples/plasma_web/components/Carousel/Carousel.stories.tsx +91 -32
- package/styled-components/es/hooks/index.js +1 -0
- package/styled-components/es/hooks/useDidMountLayoutEffect.js +11 -0
- package/types/components/Carousel/CarouselNew/Carousel.d.ts +26 -0
- package/types/components/Carousel/CarouselNew/Carousel.d.ts.map +1 -0
- package/types/components/Carousel/CarouselNew/Carousel.styles.d.ts +91 -0
- package/types/components/Carousel/CarouselNew/Carousel.styles.d.ts.map +1 -0
- package/types/components/Carousel/CarouselNew/Carousel.tokens.d.ts +17 -0
- package/types/components/Carousel/CarouselNew/Carousel.tokens.d.ts.map +1 -0
- package/types/components/Carousel/CarouselNew/Carousel.types.d.ts +45 -0
- package/types/components/Carousel/CarouselNew/Carousel.types.d.ts.map +1 -0
- package/types/components/Carousel/CarouselNew/hooks/useCarousel.d.ts +63 -0
- package/types/components/Carousel/CarouselNew/hooks/useCarousel.d.ts.map +1 -0
- package/types/components/Carousel/CarouselNew/ui/Dots/Dots.d.ts +4 -0
- package/types/components/Carousel/CarouselNew/ui/Dots/Dots.d.ts.map +1 -0
- package/types/components/Carousel/CarouselNew/ui/Dots/Dots.styles.d.ts +6 -0
- package/types/components/Carousel/CarouselNew/ui/Dots/Dots.styles.d.ts.map +1 -0
- package/types/components/Carousel/CarouselNew/ui/Dots/Dots.types.d.ts +29 -0
- package/types/components/Carousel/CarouselNew/ui/Dots/Dots.types.d.ts.map +1 -0
- package/types/components/Carousel/CarouselNew/ui/Dots/utils/index.d.ts +4 -0
- package/types/components/Carousel/CarouselNew/ui/Dots/utils/index.d.ts.map +1 -0
- package/types/components/Carousel/CarouselNew/ui/index.d.ts +2 -0
- package/types/components/Carousel/CarouselNew/ui/index.d.ts.map +1 -0
- package/types/components/Carousel/CarouselNew/variations/_size/base.d.ts +2 -0
- package/types/components/Carousel/CarouselNew/variations/_size/base.d.ts.map +1 -0
- package/types/components/Carousel/CarouselNew/variations/_view/base.d.ts +2 -0
- package/types/components/Carousel/CarouselNew/variations/_view/base.d.ts.map +1 -0
- package/types/components/Carousel/{Carousel.d.ts → CarouselOld/Carousel.d.ts} +1 -1
- package/types/components/Carousel/CarouselOld/Carousel.d.ts.map +1 -0
- package/types/components/Carousel/CarouselOld/Carousel.styles.d.ts.map +1 -0
- package/types/components/Carousel/{Carousel.types.d.ts → CarouselOld/Carousel.types.d.ts} +1 -1
- package/types/components/Carousel/CarouselOld/Carousel.types.d.ts.map +1 -0
- package/types/components/Carousel/CarouselOld/CarouselItem.d.ts.map +1 -0
- package/types/components/Carousel/CarouselOld/index.d.ts +5 -0
- package/types/components/Carousel/CarouselOld/index.d.ts.map +1 -0
- package/types/components/Carousel/CarouselOld/useCarousel.d.ts.map +1 -0
- package/types/components/Carousel/CarouselOld/useDragScroll.d.ts.map +1 -0
- package/types/components/Carousel/index.d.ts +7 -4
- package/types/components/Carousel/index.d.ts.map +1 -1
- package/types/hooks/index.d.ts +1 -0
- package/types/hooks/index.d.ts.map +1 -1
- package/types/hooks/useDidMountLayoutEffect.d.ts +2 -0
- package/types/hooks/useDidMountLayoutEffect.d.ts.map +1 -0
- package/cjs/components/Carousel/Carousel.css +0 -4
- package/cjs/components/Carousel/Carousel.js.map +0 -1
- package/cjs/components/Carousel/Carousel.styles.js.map +0 -1
- package/cjs/components/Carousel/Carousel.styles_zmchjj.css +0 -4
- package/cjs/components/Carousel/CarouselItem.js.map +0 -1
- package/cjs/components/Carousel/CarouselItem_cqjszm.css +0 -1
- package/cjs/components/Carousel/useCarousel.js.map +0 -1
- package/cjs/components/Carousel/useDragScroll.js.map +0 -1
- package/emotion/cjs/components/Carousel/Carousel.styles.js +0 -49
- package/emotion/es/components/Carousel/Carousel.styles.js +0 -42
- package/es/components/Carousel/Carousel.css +0 -4
- package/es/components/Carousel/Carousel.js.map +0 -1
- package/es/components/Carousel/Carousel.styles.js.map +0 -1
- package/es/components/Carousel/Carousel.styles_zmchjj.css +0 -4
- package/es/components/Carousel/CarouselItem.js.map +0 -1
- package/es/components/Carousel/CarouselItem_cqjszm.css +0 -1
- package/es/components/Carousel/useCarousel.js.map +0 -1
- package/es/components/Carousel/useDragScroll.js.map +0 -1
- package/types/components/Carousel/Carousel.d.ts.map +0 -1
- package/types/components/Carousel/Carousel.styles.d.ts.map +0 -1
- package/types/components/Carousel/Carousel.types.d.ts.map +0 -1
- package/types/components/Carousel/CarouselItem.d.ts.map +0 -1
- package/types/components/Carousel/useCarousel.d.ts.map +0 -1
- package/types/components/Carousel/useDragScroll.d.ts.map +0 -1
- /package/cjs/components/Carousel/{useCarousel.js → CarouselOld/useCarousel.js} +0 -0
- /package/emotion/cjs/components/Carousel/{Carousel.types.js → CarouselNew/Carousel.types.js} +0 -0
- /package/{styled-components/cjs/components/Carousel/Carousel.types.js → emotion/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.types.js} +0 -0
- /package/emotion/cjs/components/Carousel/{Carousel.js → CarouselOld/Carousel.js} +0 -0
- /package/emotion/cjs/components/Carousel/{useCarousel.js → CarouselOld/useCarousel.js} +0 -0
- /package/emotion/cjs/components/Carousel/{useDragScroll.js → CarouselOld/useDragScroll.js} +0 -0
- /package/emotion/es/components/Carousel/{Carousel.types.js → CarouselNew/Carousel.types.js} +0 -0
- /package/{styled-components/es/components/Carousel/Carousel.types.js → emotion/es/components/Carousel/CarouselNew/ui/Dots/Dots.types.js} +0 -0
- /package/emotion/es/components/Carousel/{Carousel.js → CarouselOld/Carousel.js} +0 -0
- /package/emotion/es/components/Carousel/{useCarousel.js → CarouselOld/useCarousel.js} +0 -0
- /package/emotion/es/components/Carousel/{useDragScroll.js → CarouselOld/useDragScroll.js} +0 -0
- /package/es/components/Carousel/{useCarousel.js → CarouselOld/useCarousel.js} +0 -0
- /package/styled-components/cjs/components/Carousel/{Carousel.js → CarouselOld/Carousel.js} +0 -0
- /package/styled-components/cjs/components/Carousel/{useCarousel.js → CarouselOld/useCarousel.js} +0 -0
- /package/styled-components/cjs/components/Carousel/{useDragScroll.js → CarouselOld/useDragScroll.js} +0 -0
- /package/styled-components/es/components/Carousel/{Carousel.js → CarouselOld/Carousel.js} +0 -0
- /package/styled-components/es/components/Carousel/{useCarousel.js → CarouselOld/useCarousel.js} +0 -0
- /package/styled-components/es/components/Carousel/{useDragScroll.js → CarouselOld/useDragScroll.js} +0 -0
- /package/types/components/Carousel/{Carousel.styles.d.ts → CarouselOld/Carousel.styles.d.ts} +0 -0
- /package/types/components/Carousel/{CarouselItem.d.ts → CarouselOld/CarouselItem.d.ts} +0 -0
- /package/types/components/Carousel/{useCarousel.d.ts → CarouselOld/useCarousel.d.ts} +0 -0
- /package/types/components/Carousel/{useDragScroll.d.ts → CarouselOld/useDragScroll.d.ts} +0 -0
@@ -0,0 +1,219 @@
|
|
1
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
6
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
7
|
+
import React, { memo, useRef, useLayoutEffect } from 'react';
|
8
|
+
import cls from 'classnames';
|
9
|
+
import { useDidMountLayoutEffect } from "../../../../../hooks";
|
10
|
+
import { classes } from "../../Carousel.tokens";
|
11
|
+
import { getActiveIndex, getTargetIndex, getInitialData } from "./utils/index";
|
12
|
+
import { Wrapper, DotWrapper, RightAnimationWrapper, LeftAnimationWrapper, TransitionWrapper } from "./Dots.styles";
|
13
|
+
var SIZE = 16; // размер точки в px
|
14
|
+
var ANIMATION_DURATION = 0.3; // скорость анимации в секундах
|
15
|
+
|
16
|
+
export var Dots = /*#__PURE__*/memo(function (_ref) {
|
17
|
+
var _ref$index = _ref.index,
|
18
|
+
originalIndex = _ref$index === void 0 ? 0 : _ref$index,
|
19
|
+
onChange = _ref.onChange,
|
20
|
+
_ref$centered = _ref.centered,
|
21
|
+
centered = _ref$centered === void 0 ? false : _ref$centered,
|
22
|
+
_ref$count = _ref.count,
|
23
|
+
count = _ref$count === void 0 ? 0 : _ref$count,
|
24
|
+
_ref$visibleCount = _ref.visibleCount,
|
25
|
+
originalVisibleCount = _ref$visibleCount === void 0 ? 0 : _ref$visibleCount;
|
26
|
+
// Трансформируем входные параметры для корректной работы в дальнейшем
|
27
|
+
var _getInitialData = getInitialData(originalIndex, count, originalVisibleCount),
|
28
|
+
_getInitialData2 = _slicedToArray(_getInitialData, 2),
|
29
|
+
index = _getInitialData2[0],
|
30
|
+
visibleCount = _getInitialData2[1];
|
31
|
+
|
32
|
+
// Рефки на DOM-ноды
|
33
|
+
var transitionWrapperRef = useRef(null);
|
34
|
+
var dotWrapperRef = useRef(null);
|
35
|
+
var leftAnimationWrapperRef = useRef(null);
|
36
|
+
var rightAnimationWrapperRef = useRef(null);
|
37
|
+
|
38
|
+
// Консистентные переменные
|
39
|
+
var isAnimating = useRef(false);
|
40
|
+
var prevIndex = useRef(-Infinity);
|
41
|
+
var prevActiveIndex = useRef(Infinity);
|
42
|
+
var isRightDirection = index > prevIndex.current;
|
43
|
+
var diffDotsRange = Math.abs(index - prevIndex.current);
|
44
|
+
var activeIndex = getActiveIndex(index, isRightDirection, count, visibleCount);
|
45
|
+
var hiddenDotsLeft = activeIndex < index;
|
46
|
+
var hiddenDotsRight = index + (visibleCount - 1 - activeIndex) < count - 1;
|
47
|
+
var handleClick = function handleClick(i) {
|
48
|
+
if (isAnimating.current) return;
|
49
|
+
if (onChange) {
|
50
|
+
onChange(index + (i - activeIndex));
|
51
|
+
}
|
52
|
+
};
|
53
|
+
var handleTransitionEnd = function handleTransitionEnd() {
|
54
|
+
if (!dotWrapperRef || !dotWrapperRef.current || !transitionWrapperRef || !transitionWrapperRef.current || !rightAnimationWrapperRef || !rightAnimationWrapperRef.current || !leftAnimationWrapperRef || !leftAnimationWrapperRef.current) {
|
55
|
+
return;
|
56
|
+
}
|
57
|
+
dotWrapperRef.current.classList.remove(classes.animating);
|
58
|
+
transitionWrapperRef.current.classList.remove(classes.animating);
|
59
|
+
Array.from(dotWrapperRef.current.children).forEach(function (child) {
|
60
|
+
var _child$classList;
|
61
|
+
(_child$classList = child.classList).remove.apply(_child$classList, [classes.active, classes.animateOut, classes.temporaryNatural, classes.shrinking]);
|
62
|
+
});
|
63
|
+
dotWrapperRef.current.children[activeIndex].classList.add(classes.active);
|
64
|
+
if (centered) {
|
65
|
+
transitionWrapperRef.current.style.transform = "translateX(".concat(visibleCount * SIZE / 2 - SIZE / 2 - activeIndex * SIZE, "px)");
|
66
|
+
} else {
|
67
|
+
transitionWrapperRef.current.style.transform = 'translateX(0)';
|
68
|
+
}
|
69
|
+
setTimeout(function () {
|
70
|
+
if (transitionWrapperRef && transitionWrapperRef.current) {
|
71
|
+
isAnimating.current = false;
|
72
|
+
}
|
73
|
+
});
|
74
|
+
|
75
|
+
// Очищаем блоки с анимированными точками
|
76
|
+
leftAnimationWrapperRef.current.innerText = '';
|
77
|
+
rightAnimationWrapperRef.current.innerText = '';
|
78
|
+
prevIndex.current = index;
|
79
|
+
prevActiveIndex.current = activeIndex;
|
80
|
+
isAnimating.current = false;
|
81
|
+
};
|
82
|
+
useLayoutEffect(function () {
|
83
|
+
if (!dotWrapperRef || !dotWrapperRef.current || !transitionWrapperRef || !transitionWrapperRef.current) {
|
84
|
+
return;
|
85
|
+
}
|
86
|
+
|
87
|
+
// Вычисляем начальный сдвиг по горизонтали, чтобы точка стала по центру
|
88
|
+
if (centered) {
|
89
|
+
transitionWrapperRef.current.style.transform = "translateX(".concat(visibleCount * SIZE / 2 - SIZE / 2 - activeIndex * SIZE, "px)");
|
90
|
+
}
|
91
|
+
prevIndex.current = index;
|
92
|
+
prevActiveIndex.current = activeIndex;
|
93
|
+
}, []);
|
94
|
+
useDidMountLayoutEffect(function () {
|
95
|
+
var _dotWrapperRef$curren;
|
96
|
+
if (!dotWrapperRef || !dotWrapperRef.current || !transitionWrapperRef || !transitionWrapperRef.current || !leftAnimationWrapperRef || !leftAnimationWrapperRef.current || !rightAnimationWrapperRef || !rightAnimationWrapperRef.current || isAnimating.current) {
|
97
|
+
return;
|
98
|
+
}
|
99
|
+
isAnimating.current = true;
|
100
|
+
dotWrapperRef.current.classList.add(classes.animating);
|
101
|
+
transitionWrapperRef.current.classList.add(classes.animating);
|
102
|
+
var targetIndex = getTargetIndex(index, prevIndex.current, prevActiveIndex.current, diffDotsRange);
|
103
|
+
var dotsToAdd = Math.abs(targetIndex - activeIndex);
|
104
|
+
if (centered) {
|
105
|
+
transitionWrapperRef.current.style.transform = "translateX(".concat(visibleCount * SIZE / 2 - SIZE / 2 - targetIndex * SIZE, "px)");
|
106
|
+
} else if (dotsToAdd > 0) {
|
107
|
+
transitionWrapperRef.current.style.transform = "translateX(".concat(-SIZE * (targetIndex - activeIndex), "px)");
|
108
|
+
}
|
109
|
+
|
110
|
+
// Стираем все активные классы и устанавливаем активный класс на таргет.
|
111
|
+
// В конце анимации произойдет переопределение активного класса.
|
112
|
+
Array.from(dotWrapperRef.current.children).forEach(function (child) {
|
113
|
+
child.classList.remove(classes.active);
|
114
|
+
});
|
115
|
+
(_dotWrapperRef$curren = dotWrapperRef.current.children[targetIndex]) === null || _dotWrapperRef$curren === void 0 || _dotWrapperRef$curren.classList.add(classes.active);
|
116
|
+
if (index > prevIndex.current) {
|
117
|
+
// Двигаемся вправо
|
118
|
+
|
119
|
+
// Если мы добавляем 1 и более точек, то нужно начать
|
120
|
+
// приводить размер крайней правой точки (что будет в m размере?)
|
121
|
+
// к натуральному размеру
|
122
|
+
if (dotsToAdd >= 1) {
|
123
|
+
var _dotWrapperRef$curren2;
|
124
|
+
(_dotWrapperRef$curren2 = dotWrapperRef.current.children[visibleCount - 1]) === null || _dotWrapperRef$curren2 === void 0 || _dotWrapperRef$curren2.classList.add(classes.temporaryNatural);
|
125
|
+
}
|
126
|
+
|
127
|
+
// Т.к. мы двигаемся вправо, то нужно начать уменьшать размер крайней левой точки
|
128
|
+
// (опять же, что в m size?)
|
129
|
+
if (dotsToAdd >= 1) {
|
130
|
+
var _dotWrapperRef$curren3;
|
131
|
+
(_dotWrapperRef$curren3 = dotWrapperRef.current.children[dotsToAdd]) === null || _dotWrapperRef$curren3 === void 0 || _dotWrapperRef$curren3.classList.add(classes.shrinking);
|
132
|
+
}
|
133
|
+
if (dotsToAdd > 0) {
|
134
|
+
var _loop = function _loop() {
|
135
|
+
var _dotWrapperRef$curren4;
|
136
|
+
var node = document.createElement('div');
|
137
|
+
node.textContent = '';
|
138
|
+
node.classList.add(classes.dot);
|
139
|
+
node.style.opacity = '0';
|
140
|
+
var delay = i * (ANIMATION_DURATION / dotsToAdd);
|
141
|
+
node.style.animationDelay = "".concat(delay, "s");
|
142
|
+
rightAnimationWrapperRef.current.appendChild(node);
|
143
|
+
var duration = ANIMATION_DURATION / dotsToAdd;
|
144
|
+
requestAnimationFrame(function () {
|
145
|
+
node.classList.add(classes.animateIn);
|
146
|
+
node.style.animationDuration = "".concat(duration, "s");
|
147
|
+
});
|
148
|
+
var currentDomNode = (_dotWrapperRef$curren4 = dotWrapperRef.current.children) === null || _dotWrapperRef$curren4 === void 0 ? void 0 : _dotWrapperRef$curren4[i];
|
149
|
+
currentDomNode === null || currentDomNode === void 0 || currentDomNode.classList.add(classes.animateOut);
|
150
|
+
currentDomNode.style.animationDelay = "".concat(delay, "s");
|
151
|
+
currentDomNode.style.animationDuration = "".concat(duration, "s");
|
152
|
+
};
|
153
|
+
for (var i = 0; i < dotsToAdd; i++) {
|
154
|
+
_loop();
|
155
|
+
}
|
156
|
+
}
|
157
|
+
} else {
|
158
|
+
// Двигаемся влево
|
159
|
+
|
160
|
+
// Если мы добавляем 1 и более точек, то нужно начать
|
161
|
+
// приводить размер крайней левой точки (что будет в m размере?)
|
162
|
+
// к натуральному размеру.
|
163
|
+
if (dotsToAdd >= 1) {
|
164
|
+
var _dotWrapperRef$curren5;
|
165
|
+
(_dotWrapperRef$curren5 = dotWrapperRef.current.children[0]) === null || _dotWrapperRef$curren5 === void 0 || _dotWrapperRef$curren5.classList.add(classes.temporaryNatural);
|
166
|
+
}
|
167
|
+
|
168
|
+
// Т.к. мы двигаемся влево, то нужно начать уменьшать размер крайней правой точки
|
169
|
+
// (опять же, что в m size?)
|
170
|
+
if (dotsToAdd >= 1) {
|
171
|
+
var _dotWrapperRef$curren6;
|
172
|
+
(_dotWrapperRef$curren6 = dotWrapperRef.current.children[visibleCount - 1 - dotsToAdd]) === null || _dotWrapperRef$curren6 === void 0 || _dotWrapperRef$curren6.classList.add(classes.shrinking);
|
173
|
+
}
|
174
|
+
if (dotsToAdd > 0) {
|
175
|
+
var _loop2 = function _loop2() {
|
176
|
+
var _dotWrapperRef$curren7;
|
177
|
+
var node = document.createElement('div');
|
178
|
+
node.textContent = '';
|
179
|
+
node.classList.add(classes.dot);
|
180
|
+
node.style.opacity = '0';
|
181
|
+
var delay = (dotsToAdd - 1 - _i) * (ANIMATION_DURATION / dotsToAdd);
|
182
|
+
node.style.animationDelay = "".concat(delay, "s");
|
183
|
+
leftAnimationWrapperRef.current.prepend(node);
|
184
|
+
var duration = ANIMATION_DURATION / dotsToAdd;
|
185
|
+
requestAnimationFrame(function () {
|
186
|
+
node.classList.add(classes.animateIn);
|
187
|
+
node.style.animationDuration = "".concat(duration, "s");
|
188
|
+
});
|
189
|
+
var currentDomNode = (_dotWrapperRef$curren7 = dotWrapperRef.current.children) === null || _dotWrapperRef$curren7 === void 0 ? void 0 : _dotWrapperRef$curren7[dotWrapperRef.current.children.length - 1 - _i];
|
190
|
+
currentDomNode === null || currentDomNode === void 0 || currentDomNode.classList.add(classes.animateOut);
|
191
|
+
currentDomNode.style.animationDelay = "".concat(_i * (ANIMATION_DURATION / dotsToAdd), "s");
|
192
|
+
currentDomNode.style.animationDuration = "".concat(duration, "s");
|
193
|
+
};
|
194
|
+
for (var _i = dotsToAdd - 1; _i >= 0; _i--) {
|
195
|
+
_loop2();
|
196
|
+
}
|
197
|
+
}
|
198
|
+
}
|
199
|
+
}, [index]);
|
200
|
+
return /*#__PURE__*/React.createElement(Wrapper, null, /*#__PURE__*/React.createElement(TransitionWrapper, {
|
201
|
+
ref: transitionWrapperRef,
|
202
|
+
onTransitionEnd: handleTransitionEnd
|
203
|
+
}, /*#__PURE__*/React.createElement(LeftAnimationWrapper, {
|
204
|
+
ref: leftAnimationWrapperRef
|
205
|
+
}), /*#__PURE__*/React.createElement(DotWrapper, {
|
206
|
+
ref: dotWrapperRef,
|
207
|
+
className: cls(hiddenDotsLeft && classes.availableDotsLeft, hiddenDotsRight && classes.availableDotsRight)
|
208
|
+
}, Array(visibleCount).fill(0).map(function (_, i) {
|
209
|
+
return /*#__PURE__*/React.createElement("div", {
|
210
|
+
key: i,
|
211
|
+
className: cls(classes.dot, i === activeIndex && classes.active),
|
212
|
+
onClick: function onClick() {
|
213
|
+
return handleClick(i);
|
214
|
+
}
|
215
|
+
});
|
216
|
+
})), /*#__PURE__*/React.createElement(RightAnimationWrapper, {
|
217
|
+
ref: rightAnimationWrapperRef
|
218
|
+
})));
|
219
|
+
});
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import styled from 'styled-components';
|
2
|
+
import { classes, tokens } from "../../Carousel.tokens";
|
3
|
+
export var Wrapper = /*#__PURE__*/styled.div.withConfig({
|
4
|
+
componentId: "plasma-new-hope__sc-feybgn-0"
|
5
|
+
})(["display:flex;align-items:center;justify-content:center;margin-top:0.75rem;--duration:0.3s;--half-duration:0.15s;"]);
|
6
|
+
export var TransitionWrapper = /*#__PURE__*/styled.div.withConfig({
|
7
|
+
componentId: "plasma-new-hope__sc-feybgn-1"
|
8
|
+
})(["position:relative;display:flex;transition:transform 0s ease;&.", "{transition:transform var(--duration) ease;}& .", "{width:0.5rem;height:0.5rem;margin:0 0.25rem;cursor:pointer;background-color:var(", ");border-radius:100%;&.", "{background-color:var(", ");}@keyframes fadeOut{from{transform:scale(0.75);opacity:1;}to{transform:scale(0);opacity:0;}}&.", "{animation:fadeOut var(--half-duration) ease forwards;}@keyframes shrinking{from{transform:scale(1);}to{transform:scale(0.75);}}&.", "{animation:shrinking var(--half-duration) var(--half-duration) ease forwards;}}"], classes.animating, classes.dot, tokens.paginationDotBackground, classes.active, tokens.paginationDotActiveBackground, classes.animateOut, classes.shrinking);
|
9
|
+
export var DotWrapper = /*#__PURE__*/styled.div.withConfig({
|
10
|
+
componentId: "plasma-new-hope__sc-feybgn-2"
|
11
|
+
})(["display:flex;&.", "{.", ":not(.", "):first-child{transform:scale(0.75);}}&.", "{.", ":not(.", "):last-child{transform:scale(0.75);}}&.", " .", "{transition:background-color var(--duration) ease;}"], classes.availableDotsLeft, classes.dot, classes.temporaryNatural, classes.availableDotsRight, classes.dot, classes.temporaryNatural, classes.animating, classes.dot);
|
12
|
+
export var LeftAnimationWrapper = /*#__PURE__*/styled.div.withConfig({
|
13
|
+
componentId: "plasma-new-hope__sc-feybgn-3"
|
14
|
+
})(["position:absolute;top:0;right:100%;bottom:0;display:flex;& .", "{transition:transform var(--duration) ease;@keyframes fadeIn{from{transform:scale(0);opacity:0;}to{transform:scale(1);opacity:1;}}&.", "{animation:fadeIn var(--half-duration) ease forwards;}&:first-child{@keyframes fadeInFirst{from{transform:scale(0);opacity:0;}to{transform:scale(0.75);opacity:1;}}&.", "{animation:fadeInFirst var(--half-duration) ease forwards;}}}"], classes.dot, classes.animateIn, classes.animateIn);
|
15
|
+
export var RightAnimationWrapper = /*#__PURE__*/styled.div.withConfig({
|
16
|
+
componentId: "plasma-new-hope__sc-feybgn-4"
|
17
|
+
})(["position:absolute;top:0;left:100%;bottom:0;display:flex;& .", "{transition:transform var(--duration) ease;@keyframes fadeIn{from{transform:scale(0);opacity:0;}to{transform:scale(1);opacity:1;}}&.", "{animation:fadeIn var(--half-duration) ease forwards;}&:last-child{@keyframes fadeInLast{from{transform:scale(0);opacity:0;}to{transform:scale(0.75);opacity:1;}}&.", "{animation:fadeInLast var(--half-duration) ease forwards;}}}"], classes.dot, classes.animateIn, classes.animateIn);
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,38 @@
|
|
1
|
+
export var getInitialData = function getInitialData(index, count, visibleCount) {
|
2
|
+
var newIndex = index;
|
3
|
+
var newVisibleCount = visibleCount;
|
4
|
+
|
5
|
+
// Ограничения на макс. и мин. значения индекса
|
6
|
+
if (index < 0) {
|
7
|
+
newIndex = 0;
|
8
|
+
} else if (index >= count) {
|
9
|
+
newIndex = count - 1;
|
10
|
+
}
|
11
|
+
|
12
|
+
// Ограничение на количество точек
|
13
|
+
if (visibleCount > count) {
|
14
|
+
newVisibleCount = count;
|
15
|
+
}
|
16
|
+
return [newIndex, newVisibleCount];
|
17
|
+
};
|
18
|
+
export var getActiveIndex = function getActiveIndex(index, isRightDirection, count, visibleCount) {
|
19
|
+
if (index < Math.trunc(visibleCount / 2)) {
|
20
|
+
return index;
|
21
|
+
}
|
22
|
+
if (count - 1 - index < Math.trunc(visibleCount / 2)) {
|
23
|
+
return visibleCount - 1 - (count - 1 - index);
|
24
|
+
}
|
25
|
+
if (visibleCount % 2) {
|
26
|
+
return Math.trunc(visibleCount / 2);
|
27
|
+
}
|
28
|
+
if (isRightDirection) {
|
29
|
+
return visibleCount / 2;
|
30
|
+
}
|
31
|
+
return visibleCount / 2 - 1;
|
32
|
+
};
|
33
|
+
export var getTargetIndex = function getTargetIndex(index, prevIndex, prevActiveIndex, diffDotsRange) {
|
34
|
+
if (index > prevIndex) {
|
35
|
+
return prevActiveIndex + diffDotsRange;
|
36
|
+
}
|
37
|
+
return prevActiveIndex - diffDotsRange;
|
38
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./Dots/Dots";
|
@@ -0,0 +1 @@
|
|
1
|
+
[]
|
@@ -0,0 +1 @@
|
|
1
|
+
[]
|
@@ -8,16 +8,16 @@ export var base = /*#__PURE__*/css([""]);
|
|
8
8
|
* Стилизованный компонент, обладающий всеми свойствами ``div``.
|
9
9
|
*/
|
10
10
|
export var CarouselGridWrapper = /*#__PURE__*/styled.div.withConfig({
|
11
|
-
componentId: "plasma-new-hope__sc-
|
11
|
+
componentId: "plasma-new-hope__sc-15fotdl-0"
|
12
12
|
})(["overflow:hidden;margin-left:calc(var(--plasma-grid-margin) * -1);margin-right:calc(var(--plasma-grid-margin) * -1);"]);
|
13
13
|
export var CarouselWrapper = /*#__PURE__*/styled.div.withConfig({
|
14
|
-
componentId: "plasma-new-hope__sc-
|
14
|
+
componentId: "plasma-new-hope__sc-15fotdl-1"
|
15
15
|
})(["position:relative;margin:0;padding:0;list-style:none;-ms-overflow-style:none;scrollbar-width:none;::-webkit-scrollbar{display:none;}overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:", ";", " &{scroll-padding:0 var(--plasma-grid-margin);padding-left:var(--plasma-grid-margin);}user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);"], function (_ref) {
|
16
16
|
var scrollSnapType = _ref.scrollSnapType;
|
17
17
|
return "x ".concat(scrollSnapType);
|
18
18
|
}, CarouselGridWrapper);
|
19
19
|
export var CarouselTrack = /*#__PURE__*/styled.div.withConfig({
|
20
|
-
componentId: "plasma-new-hope__sc-
|
20
|
+
componentId: "plasma-new-hope__sc-15fotdl-2"
|
21
21
|
})(["display:inline-flex;flex-direction:row;padding-left:", ";padding-right:", ";", " &{padding-right:", ";}"], function (_ref2) {
|
22
22
|
var paddingStart = _ref2.paddingStart;
|
23
23
|
return paddingStart || 0;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/styled-components/es/components/Carousel/{CarouselItem.js → CarouselOld/CarouselItem.js}
RENAMED
@@ -5,8 +5,8 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
5
5
|
import React from 'react';
|
6
6
|
import styled from 'styled-components';
|
7
7
|
var StyledItem = /*#__PURE__*/styled.div.withConfig({
|
8
|
-
componentId: "plasma-new-hope__sc-
|
9
|
-
})(["scroll-snap-align:", ";scroll-snap-stop:", ";"], function (_ref) {
|
8
|
+
componentId: "plasma-new-hope__sc-1b1k2uh-0"
|
9
|
+
})(["scroll-snap-align:", ";scroll-snap-stop:", ";padding:0 var(--plasma_private-carousel-padding);"], function (_ref) {
|
10
10
|
var scrollSnapAlign = _ref.scrollSnapAlign;
|
11
11
|
return scrollSnapAlign || 'none';
|
12
12
|
}, function (_ref2) {
|
@@ -1,3 +1,7 @@
|
|
1
|
-
export { carouselConfig, carouselRoot } from "./Carousel";
|
2
|
-
export { CarouselGridWrapper } from "./Carousel.styles";
|
3
|
-
export { CarouselItem } from "./CarouselItem";
|
1
|
+
export { carouselConfig, carouselRoot } from "./CarouselOld/Carousel";
|
2
|
+
export { CarouselGridWrapper } from "./CarouselOld/Carousel.styles";
|
3
|
+
export { CarouselItem } from "./CarouselOld/CarouselItem";
|
4
|
+
|
5
|
+
// New Carousel
|
6
|
+
export { carouselNewConfig, carouselNewRoot } from "./CarouselNew/Carousel";
|
7
|
+
export { tokens as carouselNewTokens } from "./CarouselNew/Carousel.tokens";
|
@@ -11,11 +11,11 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
11
11
|
import React, { forwardRef, useImperativeHandle, useState } from 'react';
|
12
12
|
import maskInputCompose from '@salutejs/react-maskinput';
|
13
13
|
var defaultFormatChars = [{
|
14
|
-
str: '*',
|
15
|
-
regexp: /./
|
16
|
-
}, {
|
17
14
|
str: '0',
|
18
15
|
regexp: /[0-9]/
|
16
|
+
}, {
|
17
|
+
str: '*',
|
18
|
+
regexp: /./
|
19
19
|
}, {
|
20
20
|
str: 'a',
|
21
21
|
regexp: /[a-zA-Z]/
|
@@ -1,4 +1,16 @@
|
|
1
|
+
import { css } from 'styled-components';
|
2
|
+
import { carouselNewTokens as tokens } from "../../../../components/Carousel";
|
1
3
|
export var config = {
|
2
|
-
defaults: {
|
3
|
-
|
4
|
+
defaults: {
|
5
|
+
view: 'default',
|
6
|
+
size: 's'
|
7
|
+
},
|
8
|
+
variations: {
|
9
|
+
view: {
|
10
|
+
"default": /*#__PURE__*/css(["", ":var(--surface-transparent-tertiary);", ":var(--surface-solid-default);"], tokens.paginationDotBackground, tokens.paginationDotActiveBackground)
|
11
|
+
},
|
12
|
+
size: {
|
13
|
+
s: /*#__PURE__*/css([""])
|
14
|
+
}
|
15
|
+
}
|
4
16
|
};
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import { carouselNewConfig, CarouselItem } from "../../../../components/Carousel";
|
2
2
|
import { component, mergeConfig } from "../../../../engines";
|
3
3
|
import { config } from "./Carousel.config";
|
4
|
-
export var mergedConfig = /*#__PURE__*/mergeConfig(
|
4
|
+
export var mergedConfig = /*#__PURE__*/mergeConfig(carouselNewConfig, config);
|
5
5
|
export var Carousel = /*#__PURE__*/component(mergedConfig);
|
6
6
|
export { CarouselItem };
|
@@ -2,76 +2,134 @@ import * as React from 'react';
|
|
2
2
|
import type { ComponentProps } from 'react';
|
3
3
|
import type { Meta, StoryObj } from '@storybook/react';
|
4
4
|
import styled from 'styled-components';
|
5
|
+
import { getConfigVariations } from '@salutejs/plasma-sb-utils';
|
5
6
|
|
6
7
|
import { WithTheme } from '../../../_helpers';
|
7
8
|
|
9
|
+
import { config } from './Carousel.config';
|
8
10
|
import { Carousel, CarouselItem } from './Carousel';
|
9
11
|
|
10
|
-
type StoryCarouselProps = ComponentProps<typeof Carousel
|
12
|
+
type StoryCarouselProps = ComponentProps<typeof Carousel> & {
|
13
|
+
slides: number;
|
14
|
+
visibleDots: number;
|
15
|
+
paginationDisabled: boolean;
|
16
|
+
paginationCentered: boolean;
|
17
|
+
};
|
18
|
+
|
19
|
+
const { views, sizes } = getConfigVariations(config);
|
11
20
|
|
12
21
|
const meta: Meta<StoryCarouselProps> = {
|
13
22
|
title: 'b2c/Navigation/Carousel',
|
14
23
|
component: Carousel,
|
15
24
|
decorators: [WithTheme],
|
16
25
|
argTypes: {
|
26
|
+
view: {
|
27
|
+
options: views,
|
28
|
+
control: {
|
29
|
+
type: 'select',
|
30
|
+
},
|
31
|
+
},
|
32
|
+
size: {
|
33
|
+
options: sizes,
|
34
|
+
control: {
|
35
|
+
type: 'inline-radio',
|
36
|
+
},
|
37
|
+
},
|
17
38
|
align: {
|
18
|
-
options: ['
|
39
|
+
options: ['start', 'center', 'end', 'activeDirection'],
|
19
40
|
control: {
|
20
41
|
type: 'inline-radio',
|
21
42
|
},
|
22
43
|
},
|
23
|
-
|
44
|
+
slides: {
|
45
|
+
control: 'number',
|
46
|
+
},
|
47
|
+
visibleDots: {
|
48
|
+
control: 'number',
|
49
|
+
},
|
50
|
+
controlArrowsDisabled: {
|
51
|
+
control: 'boolean',
|
52
|
+
},
|
53
|
+
paginationDisabled: {
|
54
|
+
control: 'boolean',
|
55
|
+
},
|
56
|
+
paginationCentered: {
|
24
57
|
control: 'boolean',
|
25
58
|
},
|
26
59
|
},
|
27
60
|
args: {
|
61
|
+
view: 'default',
|
62
|
+
size: 's',
|
28
63
|
align: 'center',
|
29
|
-
|
64
|
+
slides: 10,
|
65
|
+
controlArrowsDisabled: false,
|
66
|
+
paginationDisabled: false,
|
67
|
+
paginationCentered: false,
|
30
68
|
},
|
31
69
|
parameters: {
|
32
70
|
controls: {
|
33
|
-
include: [
|
71
|
+
include: [
|
72
|
+
'align',
|
73
|
+
'visibleDots',
|
74
|
+
'slides',
|
75
|
+
'controlArrowsDisabled',
|
76
|
+
'paginationDisabled',
|
77
|
+
'paginationCentered',
|
78
|
+
'gap',
|
79
|
+
],
|
34
80
|
},
|
35
81
|
},
|
36
82
|
};
|
37
83
|
|
38
84
|
export default meta;
|
39
85
|
|
40
|
-
const items = Array(25)
|
41
|
-
.fill({
|
42
|
-
title: 'Заголовок',
|
43
|
-
})
|
44
|
-
.map(({ title }, i) => ({
|
45
|
-
id: i,
|
46
|
-
title: `${title} ${i}`,
|
47
|
-
}));
|
48
|
-
|
49
86
|
const StyledCard = styled.div`
|
87
|
+
display: flex;
|
88
|
+
align-items: center;
|
89
|
+
justify-content: center;
|
50
90
|
position: relative;
|
51
91
|
border-radius: 8px;
|
52
|
-
width:
|
53
|
-
height:
|
54
|
-
padding: 8px;
|
92
|
+
width: 400px;
|
93
|
+
height: 370px;
|
55
94
|
background-color: #add8e6;
|
95
|
+
font-size: 30px;
|
56
96
|
`;
|
57
97
|
|
58
|
-
const StoryDefault = ({
|
59
|
-
|
98
|
+
const StoryDefault = ({
|
99
|
+
align,
|
100
|
+
visibleDots,
|
101
|
+
slides,
|
102
|
+
paginationDisabled,
|
103
|
+
paginationCentered,
|
104
|
+
...rest
|
105
|
+
}: StoryCarouselProps) => {
|
106
|
+
const items = Array(slides)
|
107
|
+
.fill(1)
|
108
|
+
.map((_, i) => ({
|
109
|
+
id: i,
|
110
|
+
title: i,
|
111
|
+
}));
|
60
112
|
|
61
113
|
return (
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
114
|
+
<>
|
115
|
+
<div style={{ width: '600px' }}>
|
116
|
+
<Carousel
|
117
|
+
scrollAlign={align}
|
118
|
+
paginationOptions={{
|
119
|
+
disabled: paginationDisabled,
|
120
|
+
visibleDots,
|
121
|
+
centered: paginationCentered,
|
122
|
+
}}
|
123
|
+
{...rest}
|
124
|
+
>
|
125
|
+
{items.map((item, i) => (
|
126
|
+
<CarouselItem key={i}>
|
127
|
+
<StyledCard>{item.title}</StyledCard>
|
128
|
+
</CarouselItem>
|
129
|
+
))}
|
130
|
+
</Carousel>
|
131
|
+
</div>
|
132
|
+
</>
|
75
133
|
);
|
76
134
|
};
|
77
135
|
|
@@ -1,4 +1,16 @@
|
|
1
|
+
import { css } from 'styled-components';
|
2
|
+
import { carouselNewTokens as tokens } from "../../../../components/Carousel";
|
1
3
|
export var config = {
|
2
|
-
defaults: {
|
3
|
-
|
4
|
+
defaults: {
|
5
|
+
view: 'default',
|
6
|
+
size: 's'
|
7
|
+
},
|
8
|
+
variations: {
|
9
|
+
view: {
|
10
|
+
"default": /*#__PURE__*/css(["", ":var(--surface-transparent-tertiary);", ":var(--surface-solid-default);"], tokens.paginationDotBackground, tokens.paginationDotActiveBackground)
|
11
|
+
},
|
12
|
+
size: {
|
13
|
+
s: /*#__PURE__*/css([""])
|
14
|
+
}
|
15
|
+
}
|
4
16
|
};
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import { carouselNewConfig, CarouselItem } from "../../../../components/Carousel";
|
2
2
|
import { component, mergeConfig } from "../../../../engines";
|
3
3
|
import { config } from "./Carousel.config";
|
4
|
-
export var mergedConfig = /*#__PURE__*/mergeConfig(
|
4
|
+
export var mergedConfig = /*#__PURE__*/mergeConfig(carouselNewConfig, config);
|
5
5
|
export var Carousel = /*#__PURE__*/component(mergedConfig);
|
6
6
|
export { CarouselItem };
|