glints-aries 4.0.242 → 4.0.243

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.
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ export declare type AspectRatio = {
3
+ width: number;
4
+ height: number;
5
+ };
6
+ export interface CarouselProps {
7
+ autoRotate?: boolean;
8
+ children: React.ReactNode;
9
+ /** i.e: 16:9 The first number represents the width, and the second number represents the height.
10
+ * `AspectRatio: { width: number, height: number }`
11
+ */
12
+ aspectRatio?: AspectRatio;
13
+ /** sets height of Carousel*/
14
+ height?: string;
15
+ /** sets width of Carousel */
16
+ width?: string;
17
+ indicatorPosition?: 'top' | 'bottom' | 'left' | 'right' | 'outer';
18
+ indicatorType?: 'dot' | 'line' | 'slider';
19
+ /** When to show arrows*/
20
+ showArrow?: 'always' | 'hover' | 'never';
21
+ }
22
+ export declare const Carousel: ({ autoRotate, children, aspectRatio, height, width, indicatorPosition, indicatorType, }: CarouselProps) => JSX.Element;
@@ -0,0 +1,102 @@
1
+ import React, { useCallback, useEffect, useRef, useState } from 'react';
2
+ import { Icon } from '../Icon';
3
+ import { Neutral } from '../utilities/colors';
4
+ import { ArrowsContainer, CarouselContainer, Indicator, IndicatorsContainer, ItemsContainer, NextArrow, PreviousArrow, SlideContainer } from './CarouselStyle';
5
+ export var Carousel = function Carousel(_ref) {
6
+ var _ref$autoRotate = _ref.autoRotate,
7
+ autoRotate = _ref$autoRotate === void 0 ? false : _ref$autoRotate,
8
+ children = _ref.children,
9
+ aspectRatio = _ref.aspectRatio,
10
+ height = _ref.height,
11
+ width = _ref.width,
12
+ _ref$indicatorPositio = _ref.indicatorPosition,
13
+ indicatorPosition = _ref$indicatorPositio === void 0 ? 'outer' : _ref$indicatorPositio,
14
+ _ref$indicatorType = _ref.indicatorType,
15
+ indicatorType = _ref$indicatorType === void 0 ? 'line' : _ref$indicatorType;
16
+ var slideRef = useRef(null);
17
+ var _useState = useState(0),
18
+ activeIndex = _useState[0],
19
+ setActiveIndex = _useState[1];
20
+ var _useState2 = useState(autoRotate),
21
+ hideArrows = _useState2[0],
22
+ setHideArrows = _useState2[1];
23
+ var childrenList = React.Children.toArray(children).filter(function (child) {
24
+ return /*#__PURE__*/React.isValidElement(child);
25
+ });
26
+ var childrenLength = childrenList.length;
27
+ var updateActiveIndex = useCallback(function (index) {
28
+ if (index < 0) {
29
+ setActiveIndex(childrenLength - 1);
30
+ return;
31
+ }
32
+ if (index === childrenLength) {
33
+ setActiveIndex(0);
34
+ return;
35
+ }
36
+ setActiveIndex(index);
37
+ }, [childrenLength]);
38
+ var handlePreviousClick = function handlePreviousClick() {
39
+ updateActiveIndex(activeIndex - 1);
40
+ };
41
+ var handleNextClick = function handleNextClick() {
42
+ updateActiveIndex(activeIndex + 1);
43
+ };
44
+ var handleMouseEnter = function handleMouseEnter() {
45
+ if (autoRotate) {
46
+ setHideArrows(false);
47
+ return;
48
+ }
49
+ };
50
+ var handleMouseLeave = function handleMouseLeave() {
51
+ if (autoRotate) {
52
+ setHideArrows(true);
53
+ return;
54
+ }
55
+ };
56
+ useEffect(function () {
57
+ if (autoRotate) {
58
+ setTimeout(function () {
59
+ updateActiveIndex(activeIndex + 1);
60
+ }, 3000);
61
+ }
62
+ }, [activeIndex, autoRotate, updateActiveIndex]);
63
+ return /*#__PURE__*/React.createElement(CarouselContainer, {
64
+ aspectRatio: aspectRatio ? (aspectRatio == null ? void 0 : aspectRatio.width) + "/" + (aspectRatio == null ? void 0 : aspectRatio.height) : null,
65
+ height: height,
66
+ width: width,
67
+ onMouseEnter: handleMouseEnter,
68
+ onMouseLeave: handleMouseLeave
69
+ }, /*#__PURE__*/React.createElement(SlideContainer, {
70
+ ref: slideRef,
71
+ aspectRatio: aspectRatio ? (aspectRatio == null ? void 0 : aspectRatio.width) + "/" + (aspectRatio == null ? void 0 : aspectRatio.height) : null,
72
+ height: height,
73
+ width: width
74
+ }, /*#__PURE__*/React.createElement(ItemsContainer, {
75
+ activeIndex: activeIndex
76
+ }, childrenList)), /*#__PURE__*/React.createElement(ArrowsContainer, {
77
+ "data-hidden": hideArrows
78
+ }, /*#__PURE__*/React.createElement(PreviousArrow, {
79
+ onClick: handlePreviousClick
80
+ }, /*#__PURE__*/React.createElement(Icon, {
81
+ name: "ri-arrow-m-left-line",
82
+ fill: Neutral.B40
83
+ })), /*#__PURE__*/React.createElement(NextArrow, {
84
+ onClick: handleNextClick
85
+ }, /*#__PURE__*/React.createElement(Icon, {
86
+ name: "ri-arrow-m-right-line",
87
+ fill: Neutral.B40
88
+ }))), /*#__PURE__*/React.createElement(IndicatorsContainer, {
89
+ indicatorType: indicatorType,
90
+ indicatorPosition: indicatorPosition
91
+ }, /*#__PURE__*/React.createElement("div", null, Array.from(Array(childrenLength).keys()).map(function (n) {
92
+ var isActive = activeIndex === n;
93
+ return /*#__PURE__*/React.createElement(Indicator, {
94
+ indicatorType: indicatorType,
95
+ key: "carousel-indicator-" + n,
96
+ onClick: function onClick() {
97
+ return updateActiveIndex(n);
98
+ },
99
+ className: isActive ? 'active' : null
100
+ });
101
+ }))));
102
+ };
@@ -0,0 +1,4 @@
1
+ import { Meta } from '@storybook/react';
2
+ declare const _default: Meta<import("@storybook/react").Args>;
3
+ export default _default;
4
+ export declare const Interactive: any;
@@ -0,0 +1,16 @@
1
+ import { CarouselProps } from './Carousel';
2
+ interface StyledCarouselProps extends Omit<CarouselProps, 'aspectRatio'> {
3
+ aspectRatio?: string;
4
+ }
5
+ interface ItemsContainerProps {
6
+ activeIndex: number;
7
+ }
8
+ export declare const CarouselContainer: import("styled-components").StyledComponent<"div", any, StyledCarouselProps, never>;
9
+ export declare const SlideContainer: import("styled-components").StyledComponent<"div", any, StyledCarouselProps, never>;
10
+ export declare const ItemsContainer: import("styled-components").StyledComponent<"div", any, ItemsContainerProps, never>;
11
+ export declare const ArrowsContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
12
+ export declare const PreviousArrow: import("styled-components").StyledComponent<"button", any, {}, never>;
13
+ export declare const NextArrow: import("styled-components").StyledComponent<"button", any, {}, never>;
14
+ export declare const IndicatorsContainer: import("styled-components").StyledComponent<"div", any, Pick<CarouselProps, "indicatorPosition" | "indicatorType">, never>;
15
+ export declare const Indicator: import("styled-components").StyledComponent<"button", any, Pick<CarouselProps, "indicatorType">, never>;
16
+ export {};
@@ -0,0 +1,62 @@
1
+ var _indicatorPositionSty, _indicatorTypeSpaceMa, _indicatorTypeStyleMa;
2
+ import styled from 'styled-components';
3
+ import { borderRadius16, borderRadiusHalf } from '../utilities/borderRadius';
4
+ import { Neutral, Yellow } from '../utilities/colors';
5
+ import { space4, space8 } from '../utilities/spacing';
6
+ export var CarouselContainer = styled.div.withConfig({
7
+ displayName: "CarouselStyle__CarouselContainer",
8
+ componentId: "sc-pn0x62-0"
9
+ })(["position:relative;display:flex;flex-direction:column;aspect-ratio:", ";height:", ";width:", ";"], function (props) {
10
+ return props.aspectRatio;
11
+ }, function (props) {
12
+ return props.height;
13
+ }, function (props) {
14
+ return props.width;
15
+ });
16
+ export var SlideContainer = styled.div.withConfig({
17
+ displayName: "CarouselStyle__SlideContainer",
18
+ componentId: "sc-pn0x62-1"
19
+ })(["position:relative;display:flex;overflow:hidden;aspect-ratio:", ";height:", ";width:", ";"], function (props) {
20
+ return props.aspectRatio;
21
+ }, function (props) {
22
+ return props.height;
23
+ }, function (props) {
24
+ return props.width;
25
+ });
26
+ export var ItemsContainer = styled.div.withConfig({
27
+ displayName: "CarouselStyle__ItemsContainer",
28
+ componentId: "sc-pn0x62-2"
29
+ })(["display:flex;white-space:nowrap;width:100%;height:100%;transition-timing-function:cubic-bezier(0.34,0.69,0.1,1);transition-duration:500ms;transform:", ";"], function (props) {
30
+ return "translateX(-" + props.activeIndex * 100 + "%)";
31
+ });
32
+ export var ArrowsContainer = styled.div.withConfig({
33
+ displayName: "CarouselStyle__ArrowsContainer",
34
+ componentId: "sc-pn0x62-3"
35
+ })(["visibility:visible;opacity:1;transition:opacity 0.75s ease;button{z-index:2;position:absolute;display:flex;justify-content:center;align-items:center;width:32px;height:32px;border-radius:", ";border:none;background:", ";opacity:0.6;cursor:pointer;&:hover{opacity:1;transition:opacity 0.5s ease;}}&[data-hidden='true']{visibility:hidden;opacity:0;}"], borderRadiusHalf, Neutral.B99);
36
+ export var PreviousArrow = styled.button.withConfig({
37
+ displayName: "CarouselStyle__PreviousArrow",
38
+ componentId: "sc-pn0x62-4"
39
+ })(["left:0;margin-left:", ";top:50%;transform:translateY(-50%);"], space8);
40
+ export var NextArrow = styled.button.withConfig({
41
+ displayName: "CarouselStyle__NextArrow",
42
+ componentId: "sc-pn0x62-5"
43
+ })(["right:0;margin-right:", ";top:50%;transform:translateY(-50%);"], space8);
44
+
45
+ // use style mapping for indicator type and position
46
+ var indicatorPositionStyleMapping = (_indicatorPositionSty = {}, _indicatorPositionSty['top'] = "", _indicatorPositionSty['bottom'] = "", _indicatorPositionSty['left'] = "", _indicatorPositionSty['right'] = "", _indicatorPositionSty['outer'] = "bottom: -18px", _indicatorPositionSty);
47
+ var indicatorTypeSpaceMapping = (_indicatorTypeSpaceMa = {}, _indicatorTypeSpaceMa['dot'] = "", _indicatorTypeSpaceMa['line'] = "gap: " + space8 + ";", _indicatorTypeSpaceMa['slider'] = "", _indicatorTypeSpaceMa);
48
+ export var IndicatorsContainer = styled.div.withConfig({
49
+ displayName: "CarouselStyle__IndicatorsContainer",
50
+ componentId: "sc-pn0x62-6"
51
+ })(["display:flex;justify-content:center;z-index:2;position:absolute;width:100%;div{display:flex;background:rgba(248,250,252,0.6);padding:", " ", ";border-radius:100px;", "}", ""], space4, space8, function (props) {
52
+ return indicatorTypeSpaceMapping[props.indicatorType];
53
+ }, function (props) {
54
+ return indicatorPositionStyleMapping[props.indicatorPosition];
55
+ });
56
+ var indicatorTypeStyleMapping = (_indicatorTypeStyleMa = {}, _indicatorTypeStyleMa['dot'] = "", _indicatorTypeStyleMa['line'] = "\n width: 16px;\n height: 6px;\n border-radius: " + borderRadius16 + ";\n background: " + Neutral.B40 + ";\n border: none;\n ", _indicatorTypeStyleMa['slider'] = "", _indicatorTypeStyleMa);
57
+ export var Indicator = styled.button.withConfig({
58
+ displayName: "CarouselStyle__Indicator",
59
+ componentId: "sc-pn0x62-7"
60
+ })(["cursor:pointer;opacity:0.5;&.active{background:", ";}", ""], Yellow.Brand, function (props) {
61
+ return indicatorTypeStyleMapping[props.indicatorType];
62
+ });
@@ -0,0 +1 @@
1
+ export * from './Carousel';
@@ -0,0 +1 @@
1
+ export * from './Carousel';
@@ -12,6 +12,7 @@ export { Banner, BannerProps } from './Banner';
12
12
  export { Bar, BarProps } from './Bar';
13
13
  export { Button, ButtonProps, DestructiveButton, OutlineButton, OutlineMonochromeButton, PrimaryButton, } from './Button';
14
14
  export { ButtonGroup, ButtonGroupProps } from './ButtonGroup';
15
+ export { Carousel, CarouselProps } from './Carousel';
15
16
  export { Card, CardProps } from './Card';
16
17
  export { Checkbox, CheckboxProps } from './Checkbox';
17
18
  export { Combobox, ComboboxProps } from './Combobox';
package/es/@next/index.js CHANGED
@@ -13,6 +13,7 @@ export { Banner, BannerProps } from './Banner';
13
13
  export { Bar, BarProps } from './Bar';
14
14
  export { Button, ButtonProps, DestructiveButton, OutlineButton, OutlineMonochromeButton, PrimaryButton } from './Button';
15
15
  export { ButtonGroup, ButtonGroupProps } from './ButtonGroup';
16
+ export { Carousel, CarouselProps } from './Carousel';
16
17
  export { Card, CardProps } from './Card';
17
18
  export { Checkbox, CheckboxProps } from './Checkbox';
18
19
  export { Combobox, ComboboxProps } from './Combobox';
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ export declare type AspectRatio = {
3
+ width: number;
4
+ height: number;
5
+ };
6
+ export interface CarouselProps {
7
+ autoRotate?: boolean;
8
+ children: React.ReactNode;
9
+ /** i.e: 16:9 The first number represents the width, and the second number represents the height.
10
+ * `AspectRatio: { width: number, height: number }`
11
+ */
12
+ aspectRatio?: AspectRatio;
13
+ /** sets height of Carousel*/
14
+ height?: string;
15
+ /** sets width of Carousel */
16
+ width?: string;
17
+ indicatorPosition?: 'top' | 'bottom' | 'left' | 'right' | 'outer';
18
+ indicatorType?: 'dot' | 'line' | 'slider';
19
+ /** When to show arrows*/
20
+ showArrow?: 'always' | 'hover' | 'never';
21
+ }
22
+ export declare const Carousel: ({ autoRotate, children, aspectRatio, height, width, indicatorPosition, indicatorType, }: CarouselProps) => JSX.Element;
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.Carousel = void 0;
5
+ var _react = _interopRequireWildcard(require("react"));
6
+ var _Icon = require("../Icon");
7
+ var _colors = require("../utilities/colors");
8
+ var _CarouselStyle = require("./CarouselStyle");
9
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
10
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
+ var Carousel = function Carousel(_ref) {
12
+ var _ref$autoRotate = _ref.autoRotate,
13
+ autoRotate = _ref$autoRotate === void 0 ? false : _ref$autoRotate,
14
+ children = _ref.children,
15
+ aspectRatio = _ref.aspectRatio,
16
+ height = _ref.height,
17
+ width = _ref.width,
18
+ _ref$indicatorPositio = _ref.indicatorPosition,
19
+ indicatorPosition = _ref$indicatorPositio === void 0 ? 'outer' : _ref$indicatorPositio,
20
+ _ref$indicatorType = _ref.indicatorType,
21
+ indicatorType = _ref$indicatorType === void 0 ? 'line' : _ref$indicatorType;
22
+ var slideRef = (0, _react.useRef)(null);
23
+ var _useState = (0, _react.useState)(0),
24
+ activeIndex = _useState[0],
25
+ setActiveIndex = _useState[1];
26
+ var _useState2 = (0, _react.useState)(autoRotate),
27
+ hideArrows = _useState2[0],
28
+ setHideArrows = _useState2[1];
29
+ var childrenList = _react["default"].Children.toArray(children).filter(function (child) {
30
+ return /*#__PURE__*/_react["default"].isValidElement(child);
31
+ });
32
+ var childrenLength = childrenList.length;
33
+ var updateActiveIndex = (0, _react.useCallback)(function (index) {
34
+ if (index < 0) {
35
+ setActiveIndex(childrenLength - 1);
36
+ return;
37
+ }
38
+ if (index === childrenLength) {
39
+ setActiveIndex(0);
40
+ return;
41
+ }
42
+ setActiveIndex(index);
43
+ }, [childrenLength]);
44
+ var handlePreviousClick = function handlePreviousClick() {
45
+ updateActiveIndex(activeIndex - 1);
46
+ };
47
+ var handleNextClick = function handleNextClick() {
48
+ updateActiveIndex(activeIndex + 1);
49
+ };
50
+ var handleMouseEnter = function handleMouseEnter() {
51
+ if (autoRotate) {
52
+ setHideArrows(false);
53
+ return;
54
+ }
55
+ };
56
+ var handleMouseLeave = function handleMouseLeave() {
57
+ if (autoRotate) {
58
+ setHideArrows(true);
59
+ return;
60
+ }
61
+ };
62
+ (0, _react.useEffect)(function () {
63
+ if (autoRotate) {
64
+ setTimeout(function () {
65
+ updateActiveIndex(activeIndex + 1);
66
+ }, 3000);
67
+ }
68
+ }, [activeIndex, autoRotate, updateActiveIndex]);
69
+ return /*#__PURE__*/_react["default"].createElement(_CarouselStyle.CarouselContainer, {
70
+ aspectRatio: aspectRatio ? (aspectRatio == null ? void 0 : aspectRatio.width) + "/" + (aspectRatio == null ? void 0 : aspectRatio.height) : null,
71
+ height: height,
72
+ width: width,
73
+ onMouseEnter: handleMouseEnter,
74
+ onMouseLeave: handleMouseLeave
75
+ }, /*#__PURE__*/_react["default"].createElement(_CarouselStyle.SlideContainer, {
76
+ ref: slideRef,
77
+ aspectRatio: aspectRatio ? (aspectRatio == null ? void 0 : aspectRatio.width) + "/" + (aspectRatio == null ? void 0 : aspectRatio.height) : null,
78
+ height: height,
79
+ width: width
80
+ }, /*#__PURE__*/_react["default"].createElement(_CarouselStyle.ItemsContainer, {
81
+ activeIndex: activeIndex
82
+ }, childrenList)), /*#__PURE__*/_react["default"].createElement(_CarouselStyle.ArrowsContainer, {
83
+ "data-hidden": hideArrows
84
+ }, /*#__PURE__*/_react["default"].createElement(_CarouselStyle.PreviousArrow, {
85
+ onClick: handlePreviousClick
86
+ }, /*#__PURE__*/_react["default"].createElement(_Icon.Icon, {
87
+ name: "ri-arrow-m-left-line",
88
+ fill: _colors.Neutral.B40
89
+ })), /*#__PURE__*/_react["default"].createElement(_CarouselStyle.NextArrow, {
90
+ onClick: handleNextClick
91
+ }, /*#__PURE__*/_react["default"].createElement(_Icon.Icon, {
92
+ name: "ri-arrow-m-right-line",
93
+ fill: _colors.Neutral.B40
94
+ }))), /*#__PURE__*/_react["default"].createElement(_CarouselStyle.IndicatorsContainer, {
95
+ indicatorType: indicatorType,
96
+ indicatorPosition: indicatorPosition
97
+ }, /*#__PURE__*/_react["default"].createElement("div", null, Array.from(Array(childrenLength).keys()).map(function (n) {
98
+ var isActive = activeIndex === n;
99
+ return /*#__PURE__*/_react["default"].createElement(_CarouselStyle.Indicator, {
100
+ indicatorType: indicatorType,
101
+ key: "carousel-indicator-" + n,
102
+ onClick: function onClick() {
103
+ return updateActiveIndex(n);
104
+ },
105
+ className: isActive ? 'active' : null
106
+ });
107
+ }))));
108
+ };
109
+ exports.Carousel = Carousel;
@@ -0,0 +1,4 @@
1
+ import { Meta } from '@storybook/react';
2
+ declare const _default: Meta<import("@storybook/react").Args>;
3
+ export default _default;
4
+ export declare const Interactive: any;
@@ -0,0 +1,16 @@
1
+ import { CarouselProps } from './Carousel';
2
+ interface StyledCarouselProps extends Omit<CarouselProps, 'aspectRatio'> {
3
+ aspectRatio?: string;
4
+ }
5
+ interface ItemsContainerProps {
6
+ activeIndex: number;
7
+ }
8
+ export declare const CarouselContainer: import("styled-components").StyledComponent<"div", any, StyledCarouselProps, never>;
9
+ export declare const SlideContainer: import("styled-components").StyledComponent<"div", any, StyledCarouselProps, never>;
10
+ export declare const ItemsContainer: import("styled-components").StyledComponent<"div", any, ItemsContainerProps, never>;
11
+ export declare const ArrowsContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
12
+ export declare const PreviousArrow: import("styled-components").StyledComponent<"button", any, {}, never>;
13
+ export declare const NextArrow: import("styled-components").StyledComponent<"button", any, {}, never>;
14
+ export declare const IndicatorsContainer: import("styled-components").StyledComponent<"div", any, Pick<CarouselProps, "indicatorPosition" | "indicatorType">, never>;
15
+ export declare const Indicator: import("styled-components").StyledComponent<"button", any, Pick<CarouselProps, "indicatorType">, never>;
16
+ export {};
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ exports.__esModule = true;
5
+ exports.SlideContainer = exports.PreviousArrow = exports.NextArrow = exports.ItemsContainer = exports.IndicatorsContainer = exports.Indicator = exports.CarouselContainer = exports.ArrowsContainer = void 0;
6
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
7
+ var _borderRadius = require("../utilities/borderRadius");
8
+ var _colors = require("../utilities/colors");
9
+ var _spacing = require("../utilities/spacing");
10
+ var _indicatorPositionSty, _indicatorTypeSpaceMa, _indicatorTypeStyleMa;
11
+ var CarouselContainer = _styledComponents["default"].div.withConfig({
12
+ displayName: "CarouselStyle__CarouselContainer",
13
+ componentId: "sc-pn0x62-0"
14
+ })(["position:relative;display:flex;flex-direction:column;aspect-ratio:", ";height:", ";width:", ";"], function (props) {
15
+ return props.aspectRatio;
16
+ }, function (props) {
17
+ return props.height;
18
+ }, function (props) {
19
+ return props.width;
20
+ });
21
+ exports.CarouselContainer = CarouselContainer;
22
+ var SlideContainer = _styledComponents["default"].div.withConfig({
23
+ displayName: "CarouselStyle__SlideContainer",
24
+ componentId: "sc-pn0x62-1"
25
+ })(["position:relative;display:flex;overflow:hidden;aspect-ratio:", ";height:", ";width:", ";"], function (props) {
26
+ return props.aspectRatio;
27
+ }, function (props) {
28
+ return props.height;
29
+ }, function (props) {
30
+ return props.width;
31
+ });
32
+ exports.SlideContainer = SlideContainer;
33
+ var ItemsContainer = _styledComponents["default"].div.withConfig({
34
+ displayName: "CarouselStyle__ItemsContainer",
35
+ componentId: "sc-pn0x62-2"
36
+ })(["display:flex;white-space:nowrap;width:100%;height:100%;transition-timing-function:cubic-bezier(0.34,0.69,0.1,1);transition-duration:500ms;transform:", ";"], function (props) {
37
+ return "translateX(-" + props.activeIndex * 100 + "%)";
38
+ });
39
+ exports.ItemsContainer = ItemsContainer;
40
+ var ArrowsContainer = _styledComponents["default"].div.withConfig({
41
+ displayName: "CarouselStyle__ArrowsContainer",
42
+ componentId: "sc-pn0x62-3"
43
+ })(["visibility:visible;opacity:1;transition:opacity 0.75s ease;button{z-index:2;position:absolute;display:flex;justify-content:center;align-items:center;width:32px;height:32px;border-radius:", ";border:none;background:", ";opacity:0.6;cursor:pointer;&:hover{opacity:1;transition:opacity 0.5s ease;}}&[data-hidden='true']{visibility:hidden;opacity:0;}"], _borderRadius.borderRadiusHalf, _colors.Neutral.B99);
44
+ exports.ArrowsContainer = ArrowsContainer;
45
+ var PreviousArrow = _styledComponents["default"].button.withConfig({
46
+ displayName: "CarouselStyle__PreviousArrow",
47
+ componentId: "sc-pn0x62-4"
48
+ })(["left:0;margin-left:", ";top:50%;transform:translateY(-50%);"], _spacing.space8);
49
+ exports.PreviousArrow = PreviousArrow;
50
+ var NextArrow = _styledComponents["default"].button.withConfig({
51
+ displayName: "CarouselStyle__NextArrow",
52
+ componentId: "sc-pn0x62-5"
53
+ })(["right:0;margin-right:", ";top:50%;transform:translateY(-50%);"], _spacing.space8);
54
+
55
+ // use style mapping for indicator type and position
56
+ exports.NextArrow = NextArrow;
57
+ var indicatorPositionStyleMapping = (_indicatorPositionSty = {}, _indicatorPositionSty['top'] = "", _indicatorPositionSty['bottom'] = "", _indicatorPositionSty['left'] = "", _indicatorPositionSty['right'] = "", _indicatorPositionSty['outer'] = "bottom: -18px", _indicatorPositionSty);
58
+ var indicatorTypeSpaceMapping = (_indicatorTypeSpaceMa = {}, _indicatorTypeSpaceMa['dot'] = "", _indicatorTypeSpaceMa['line'] = "gap: " + _spacing.space8 + ";", _indicatorTypeSpaceMa['slider'] = "", _indicatorTypeSpaceMa);
59
+ var IndicatorsContainer = _styledComponents["default"].div.withConfig({
60
+ displayName: "CarouselStyle__IndicatorsContainer",
61
+ componentId: "sc-pn0x62-6"
62
+ })(["display:flex;justify-content:center;z-index:2;position:absolute;width:100%;div{display:flex;background:rgba(248,250,252,0.6);padding:", " ", ";border-radius:100px;", "}", ""], _spacing.space4, _spacing.space8, function (props) {
63
+ return indicatorTypeSpaceMapping[props.indicatorType];
64
+ }, function (props) {
65
+ return indicatorPositionStyleMapping[props.indicatorPosition];
66
+ });
67
+ exports.IndicatorsContainer = IndicatorsContainer;
68
+ var indicatorTypeStyleMapping = (_indicatorTypeStyleMa = {}, _indicatorTypeStyleMa['dot'] = "", _indicatorTypeStyleMa['line'] = "\n width: 16px;\n height: 6px;\n border-radius: " + _borderRadius.borderRadius16 + ";\n background: " + _colors.Neutral.B40 + ";\n border: none;\n ", _indicatorTypeStyleMa['slider'] = "", _indicatorTypeStyleMa);
69
+ var Indicator = _styledComponents["default"].button.withConfig({
70
+ displayName: "CarouselStyle__Indicator",
71
+ componentId: "sc-pn0x62-7"
72
+ })(["cursor:pointer;opacity:0.5;&.active{background:", ";}", ""], _colors.Yellow.Brand, function (props) {
73
+ return indicatorTypeStyleMapping[props.indicatorType];
74
+ });
75
+ exports.Indicator = Indicator;
@@ -0,0 +1 @@
1
+ export * from './Carousel';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ var _Carousel = require("./Carousel");
5
+ Object.keys(_Carousel).forEach(function (key) {
6
+ if (key === "default" || key === "__esModule") return;
7
+ if (key in exports && exports[key] === _Carousel[key]) return;
8
+ exports[key] = _Carousel[key];
9
+ });
@@ -12,6 +12,7 @@ export { Banner, BannerProps } from './Banner';
12
12
  export { Bar, BarProps } from './Bar';
13
13
  export { Button, ButtonProps, DestructiveButton, OutlineButton, OutlineMonochromeButton, PrimaryButton, } from './Button';
14
14
  export { ButtonGroup, ButtonGroupProps } from './ButtonGroup';
15
+ export { Carousel, CarouselProps } from './Carousel';
15
16
  export { Card, CardProps } from './Card';
16
17
  export { Checkbox, CheckboxProps } from './Checkbox';
17
18
  export { Combobox, ComboboxProps } from './Combobox';
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.useModal = exports.useIndexResourceState = exports.useAlert = exports.TypographyProps = exports.Typography = exports.TooltipProps = exports.TooltipPosition = exports.Tooltip = exports.TextInputProps = exports.TextInput = exports.TagProps = exports.Tag = exports.TabsProps = exports.Tabs = exports.TableRowProps = exports.TableHeaderProps = exports.TableCellProps = exports.TabProps = exports.TabModel = exports.Tab = exports.Switch = exports.SpinnerProps = exports.Spinner = exports.Spacing = exports.SkeletonTextProps = exports.SkeletonText = exports.SkeletonImageSquareProps = exports.SkeletonImageSquare = exports.SkeletonImageCircleProps = exports.SkeletonImageCircle = exports.SimplePagination = exports.SelectProps = exports.Select = exports.RadioButtonProps = exports.RadioButton = exports.PrimaryButton = exports.PopoverProps = exports.Popover = exports.PaginationProps = exports.Pagination = exports.OutlineMonochromeButton = exports.OutlineButton = exports.NumberInputProps = exports.NumberInput = exports.ModalProvider = exports.ModalProps = exports.ModalContext = exports.Modal = exports.MenuProps = exports.Menu = exports.LinkProps = exports.Link = exports.InlineErrorProps = exports.InlineError = exports.IndexTableProps = exports.IndexTable = exports.IconProps = exports.Icon = exports.Fonts = exports.EmptyState = exports.DropShadow = exports.Divider = exports.DestructiveButton = exports.DataTableProps = exports.DataTable = exports.CurrencyInputProps = exports.CurrencyInput = exports.ComboboxProps = exports.Combobox = exports.Colors = exports.CheckboxProps = exports.Checkbox = exports.CardProps = exports.Card = exports.ButtonProps = exports.ButtonGroupProps = exports.ButtonGroup = exports.Button = exports.Breakpoints = exports.BorderRadius = exports.BarProps = exports.Bar = exports.BannerProps = exports.Banner = exports.BadgeProps = exports.Badge = exports.AvatarProps = exports.Avatar = exports.AlertWithProvider = exports.AlertProvider = exports.AlertProps = exports.AlertContextProps = exports.AlertContext = exports.Alert = exports.ActionListSection = exports.ActionListProps = exports.ActionListItem = exports.ActionList = void 0;
4
+ exports.useModal = exports.useIndexResourceState = exports.useAlert = exports.TypographyProps = exports.Typography = exports.TooltipProps = exports.TooltipPosition = exports.Tooltip = exports.TextInputProps = exports.TextInput = exports.TagProps = exports.Tag = exports.TabsProps = exports.Tabs = exports.TableRowProps = exports.TableHeaderProps = exports.TableCellProps = exports.TabProps = exports.TabModel = exports.Tab = exports.Switch = exports.SpinnerProps = exports.Spinner = exports.Spacing = exports.SkeletonTextProps = exports.SkeletonText = exports.SkeletonImageSquareProps = exports.SkeletonImageSquare = exports.SkeletonImageCircleProps = exports.SkeletonImageCircle = exports.SimplePagination = exports.SelectProps = exports.Select = exports.RadioButtonProps = exports.RadioButton = exports.PrimaryButton = exports.PopoverProps = exports.Popover = exports.PaginationProps = exports.Pagination = exports.OutlineMonochromeButton = exports.OutlineButton = exports.NumberInputProps = exports.NumberInput = exports.ModalProvider = exports.ModalProps = exports.ModalContext = exports.Modal = exports.MenuProps = exports.Menu = exports.LinkProps = exports.Link = exports.InlineErrorProps = exports.InlineError = exports.IndexTableProps = exports.IndexTable = exports.IconProps = exports.Icon = exports.Fonts = exports.EmptyState = exports.DropShadow = exports.Divider = exports.DestructiveButton = exports.DataTableProps = exports.DataTable = exports.CurrencyInputProps = exports.CurrencyInput = exports.ComboboxProps = exports.Combobox = exports.Colors = exports.CheckboxProps = exports.Checkbox = exports.CarouselProps = exports.Carousel = exports.CardProps = exports.Card = exports.ButtonProps = exports.ButtonGroupProps = exports.ButtonGroup = exports.Button = exports.Breakpoints = exports.BorderRadius = exports.BarProps = exports.Bar = exports.BannerProps = exports.Banner = exports.BadgeProps = exports.Badge = exports.AvatarProps = exports.Avatar = exports.AlertWithProvider = exports.AlertProvider = exports.AlertProps = exports.AlertContextProps = exports.AlertContext = exports.Alert = exports.ActionListSection = exports.ActionListProps = exports.ActionListItem = exports.ActionList = void 0;
5
5
  var BorderRadius = _interopRequireWildcard(require("./utilities/borderRadius"));
6
6
  exports.BorderRadius = BorderRadius;
7
7
  var Breakpoints = _interopRequireWildcard(require("./utilities/breakpoints"));
@@ -49,6 +49,9 @@ exports.PrimaryButton = _Button.PrimaryButton;
49
49
  var _ButtonGroup = require("./ButtonGroup");
50
50
  exports.ButtonGroup = _ButtonGroup.ButtonGroup;
51
51
  exports.ButtonGroupProps = _ButtonGroup.ButtonGroupProps;
52
+ var _Carousel = require("./Carousel");
53
+ exports.Carousel = _Carousel.Carousel;
54
+ exports.CarouselProps = _Carousel.CarouselProps;
52
55
  var _Card = require("./Card");
53
56
  exports.Card = _Card.Card;
54
57
  exports.CardProps = _Card.CardProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glints-aries",
3
- "version": "4.0.242",
3
+ "version": "4.0.243",
4
4
  "description": "Glints ui-kit for frontend",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./es/index.js",