@salutejs/sdds-cs 0.319.0-canary.2017.15580400507.0 → 0.319.0-canary.2020.15698332896.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/CHANGELOG.md +49 -0
- package/emotion/cjs/index.js +0 -11
- package/emotion/es/index.js +0 -1
- package/es/index.js +0 -1
- package/index.d.ts +0 -1
- package/index.js +0 -11
- package/package.json +7 -7
- package/components/Carousel/Carousel.config.d.ts +0 -14
- package/components/Carousel/Carousel.config.js +0 -23
- package/components/Carousel/Carousel.d.ts +0 -9
- package/components/Carousel/Carousel.js +0 -10
- package/components/Carousel/index.d.ts +0 -2
- package/components/Carousel/index.js +0 -19
- package/emotion/cjs/components/Carousel/Carousel.config.js +0 -23
- package/emotion/cjs/components/Carousel/Carousel.js +0 -10
- package/emotion/cjs/components/Carousel/Carousel.stories.tsx +0 -137
- package/emotion/cjs/components/Carousel/index.js +0 -19
- package/emotion/es/components/Carousel/Carousel.config.js +0 -17
- package/emotion/es/components/Carousel/Carousel.js +0 -5
- package/emotion/es/components/Carousel/Carousel.stories.tsx +0 -137
- package/emotion/es/components/Carousel/index.js +0 -2
- package/es/components/Carousel/Carousel.config.js +0 -17
- package/es/components/Carousel/Carousel.js +0 -5
- package/es/components/Carousel/index.js +0 -2
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,52 @@
|
|
1
|
+
## 0.318.0 (11 июня 2025)
|
2
|
+
|
3
|
+
## Функциональные изменения в компонентах
|
4
|
+
|
5
|
+
### Select, Combobox
|
6
|
+
|
7
|
+
* добавлена возможность использовать кнопку `Выбрать всё` внутри выпадающего списка;
|
8
|
+
|
9
|
+

|
10
|
+
|
11
|
+
[PR](https://github.com/salute-developers/plasma/pull/1986)
|
12
|
+
|
13
|
+
### Popover
|
14
|
+
|
15
|
+
* добавлена обработка случая, когда frame передан как ID
|
16
|
+
|
17
|
+
[PR](https://github.com/salute-developers/plasma/pull/2001)
|
18
|
+
|
19
|
+
### Sheet
|
20
|
+
|
21
|
+
* добавлена проверка `canUseDOM` перед использованием document
|
22
|
+
|
23
|
+
[PR](https://github.com/salute-developers/plasma/pull/2014)
|
24
|
+
|
25
|
+
### DatePicker
|
26
|
+
|
27
|
+
* добавлено свойство `closeAfterDateSelect` в одиночный DatePicker
|
28
|
+
|
29
|
+

|
30
|
+
|
31
|
+
[PR](https://github.com/salute-developers/plasma/pull/2012)
|
32
|
+
|
33
|
+
### Notification
|
34
|
+
|
35
|
+
* добавлен `type-cast` для корректной типизации
|
36
|
+
|
37
|
+
<img width="977" alt="image" src="https://github.com/user-attachments/assets/99858965-49ff-4fc0-bec9-b3f79d2fa965" />
|
38
|
+
|
39
|
+
[PR](https://github.com/salute-developers/plasma/pull/2015)
|
40
|
+
|
41
|
+
### Carousel
|
42
|
+
|
43
|
+
* добавлена элементы управления: пагинация, стрелочки
|
44
|
+
|
45
|
+

|
46
|
+
|
47
|
+
[PR](https://github.com/salute-developers/plasma/pull/2013)
|
48
|
+
|
49
|
+
|
1
50
|
## 0.317.0 (29 мая 2025)
|
2
51
|
|
3
52
|
## Функциональные изменения в компонентах
|
package/emotion/cjs/index.js
CHANGED
@@ -707,17 +707,6 @@ Object.keys(_ToastNew).forEach(function (key) {
|
|
707
707
|
}
|
708
708
|
});
|
709
709
|
});
|
710
|
-
var _Carousel = /*#__PURE__*/require("./components/Carousel");
|
711
|
-
Object.keys(_Carousel).forEach(function (key) {
|
712
|
-
if (key === "default" || key === "__esModule") return;
|
713
|
-
if (key in exports && exports[key] === _Carousel[key]) return;
|
714
|
-
Object.defineProperty(exports, key, {
|
715
|
-
enumerable: true,
|
716
|
-
get: function get() {
|
717
|
-
return _Carousel[key];
|
718
|
-
}
|
719
|
-
});
|
720
|
-
});
|
721
710
|
var _mixins = /*#__PURE__*/require("./mixins");
|
722
711
|
Object.keys(_mixins).forEach(function (key) {
|
723
712
|
if (key === "default" || key === "__esModule") return;
|
package/emotion/es/index.js
CHANGED
package/es/index.js
CHANGED
package/index.d.ts
CHANGED
package/index.js
CHANGED
@@ -707,17 +707,6 @@ Object.keys(_ToastNew).forEach(function (key) {
|
|
707
707
|
}
|
708
708
|
});
|
709
709
|
});
|
710
|
-
var _Carousel = /*#__PURE__*/require("./components/Carousel");
|
711
|
-
Object.keys(_Carousel).forEach(function (key) {
|
712
|
-
if (key === "default" || key === "__esModule") return;
|
713
|
-
if (key in exports && exports[key] === _Carousel[key]) return;
|
714
|
-
Object.defineProperty(exports, key, {
|
715
|
-
enumerable: true,
|
716
|
-
get: function get() {
|
717
|
-
return _Carousel[key];
|
718
|
-
}
|
719
|
-
});
|
720
|
-
});
|
721
710
|
var _mixins = /*#__PURE__*/require("./mixins");
|
722
711
|
Object.keys(_mixins).forEach(function (key) {
|
723
712
|
if (key === "default" || key === "__esModule") return;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/sdds-cs",
|
3
|
-
"version": "0.319.0-canary.
|
3
|
+
"version": "0.319.0-canary.2020.15698332896.0",
|
4
4
|
"description": "Salute Design System / React UI kit for SDDS CS web applications",
|
5
5
|
"author": "Salute Frontend Team <salute.developers@gmail.com>",
|
6
6
|
"license": "MIT",
|
@@ -30,8 +30,8 @@
|
|
30
30
|
"directory": "packages/sdds-cs"
|
31
31
|
},
|
32
32
|
"dependencies": {
|
33
|
-
"@salutejs/plasma-new-hope": "0.327.0-canary.
|
34
|
-
"@salutejs/sdds-themes": "0.
|
33
|
+
"@salutejs/plasma-new-hope": "0.327.0-canary.2020.15698332896.0",
|
34
|
+
"@salutejs/sdds-themes": "0.38.0"
|
35
35
|
},
|
36
36
|
"peerDependencies": {
|
37
37
|
"@emotion/react": ">=11",
|
@@ -54,10 +54,10 @@
|
|
54
54
|
"@microsoft/api-extractor": "7.38.3",
|
55
55
|
"@originjs/vite-plugin-commonjs": "1.0.3",
|
56
56
|
"@salutejs/plasma-colors": "0.15.0",
|
57
|
-
"@salutejs/plasma-core": "1.199.0-canary.
|
58
|
-
"@salutejs/plasma-cy-utils": "0.130.0-canary.
|
57
|
+
"@salutejs/plasma-core": "1.199.0-canary.2020.15698332896.0",
|
58
|
+
"@salutejs/plasma-cy-utils": "0.130.0-canary.2020.15698332896.0",
|
59
59
|
"@salutejs/plasma-icons": "1.218.0",
|
60
|
-
"@salutejs/plasma-sb-utils": "0.200.0-canary.
|
60
|
+
"@salutejs/plasma-sb-utils": "0.200.0-canary.2020.15698332896.0",
|
61
61
|
"@storybook/addon-docs": "7.6.17",
|
62
62
|
"@storybook/addon-essentials": "7.6.17",
|
63
63
|
"@storybook/addons": "7.6.17",
|
@@ -123,5 +123,5 @@
|
|
123
123
|
"Anton Vinogradov"
|
124
124
|
],
|
125
125
|
"sideEffects": false,
|
126
|
-
"gitHead": "
|
126
|
+
"gitHead": "cac49b2573417e0bd77e5ddcb06c055122324b92"
|
127
127
|
}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
export declare const config: {
|
2
|
-
defaults: {
|
3
|
-
view: string;
|
4
|
-
size: string;
|
5
|
-
};
|
6
|
-
variations: {
|
7
|
-
view: {
|
8
|
-
default: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
|
9
|
-
};
|
10
|
-
size: {
|
11
|
-
s: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
|
12
|
-
};
|
13
|
-
};
|
14
|
-
};
|
@@ -1,23 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.config = void 0;
|
7
|
-
var _styledComponents = /*#__PURE__*/require("@salutejs/plasma-new-hope/styled-components");
|
8
|
-
var _templateObject, _templateObject2;
|
9
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
10
|
-
var config = exports.config = {
|
11
|
-
defaults: {
|
12
|
-
view: 'default',
|
13
|
-
size: 's'
|
14
|
-
},
|
15
|
-
variations: {
|
16
|
-
view: {
|
17
|
-
"default": /*#__PURE__*/(0, _styledComponents.css)(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteral(["\n ", ": var(--surface-transparent-tertiary);\n ", ": var(--surface-solid-default);\n "])), _styledComponents.carouselNewTokens.paginationDotBackground, _styledComponents.carouselNewTokens.paginationDotActiveBackground)
|
18
|
-
},
|
19
|
-
size: {
|
20
|
-
s: /*#__PURE__*/(0, _styledComponents.css)(_templateObject2 || (_templateObject2 = /*#__PURE__*/_taggedTemplateLiteral([""])))
|
21
|
-
}
|
22
|
-
}
|
23
|
-
};
|
@@ -1,9 +0,0 @@
|
|
1
|
-
declare const Carousel: import("react").FunctionComponent<import("@salutejs/plasma-new-hope/types/engines/types").PropsType<{
|
2
|
-
view: {
|
3
|
-
default: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
|
4
|
-
};
|
5
|
-
size: {
|
6
|
-
s: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
|
7
|
-
};
|
8
|
-
}> & import("@salutejs/plasma-new-hope/styled-components").CarouselNewProps & import("react").RefAttributes<HTMLDivElement>>;
|
9
|
-
export { Carousel };
|
@@ -1,10 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.Carousel = void 0;
|
7
|
-
var _styledComponents = /*#__PURE__*/require("@salutejs/plasma-new-hope/styled-components");
|
8
|
-
var _Carousel = /*#__PURE__*/require("./Carousel.config");
|
9
|
-
var mergedConfig = /*#__PURE__*/(0, _styledComponents.mergeConfig)(_styledComponents.carouselNewConfig, _Carousel.config);
|
10
|
-
var Carousel = exports.Carousel = /*#__PURE__*/(0, _styledComponents.component)(mergedConfig);
|
@@ -1,19 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
Object.defineProperty(exports, "Carousel", {
|
7
|
-
enumerable: true,
|
8
|
-
get: function get() {
|
9
|
-
return _Carousel.Carousel;
|
10
|
-
}
|
11
|
-
});
|
12
|
-
Object.defineProperty(exports, "CarouselItem", {
|
13
|
-
enumerable: true,
|
14
|
-
get: function get() {
|
15
|
-
return _styledComponents.CarouselItem;
|
16
|
-
}
|
17
|
-
});
|
18
|
-
var _styledComponents = /*#__PURE__*/require("@salutejs/plasma-new-hope/styled-components");
|
19
|
-
var _Carousel = /*#__PURE__*/require("./Carousel");
|
@@ -1,23 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.config = void 0;
|
7
|
-
var _emotion = /*#__PURE__*/require("@salutejs/plasma-new-hope/emotion");
|
8
|
-
var _templateObject, _templateObject2;
|
9
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
10
|
-
var config = exports.config = {
|
11
|
-
defaults: {
|
12
|
-
view: 'default',
|
13
|
-
size: 's'
|
14
|
-
},
|
15
|
-
variations: {
|
16
|
-
view: {
|
17
|
-
"default": /*#__PURE__*/(0, _emotion.css)(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteral(["\n ", ": var(--surface-transparent-tertiary);\n ", ": var(--surface-solid-default);\n "])), _emotion.carouselNewTokens.paginationDotBackground, _emotion.carouselNewTokens.paginationDotActiveBackground)
|
18
|
-
},
|
19
|
-
size: {
|
20
|
-
s: /*#__PURE__*/(0, _emotion.css)(_templateObject2 || (_templateObject2 = /*#__PURE__*/_taggedTemplateLiteral([""])))
|
21
|
-
}
|
22
|
-
}
|
23
|
-
};
|
@@ -1,10 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.Carousel = void 0;
|
7
|
-
var _emotion = /*#__PURE__*/require("@salutejs/plasma-new-hope/emotion");
|
8
|
-
var _Carousel = /*#__PURE__*/require("./Carousel.config");
|
9
|
-
var mergedConfig = /*#__PURE__*/(0, _emotion.mergeConfig)(_emotion.carouselNewConfig, _Carousel.config);
|
10
|
-
var Carousel = exports.Carousel = /*#__PURE__*/(0, _emotion.component)(mergedConfig);
|
@@ -1,137 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { ComponentProps } from 'react';
|
3
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
4
|
-
import styled from 'styled-components';
|
5
|
-
import { getConfigVariations, InSpacingDecorator } from '@salutejs/plasma-sb-utils';
|
6
|
-
|
7
|
-
import { config } from './Carousel.config';
|
8
|
-
import { Carousel } from './Carousel';
|
9
|
-
|
10
|
-
import { CarouselItem } from './index';
|
11
|
-
|
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);
|
20
|
-
|
21
|
-
const meta: Meta<StoryCarouselProps> = {
|
22
|
-
title: 'Navigation/Carousel',
|
23
|
-
component: Carousel,
|
24
|
-
decorators: [InSpacingDecorator],
|
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
|
-
},
|
38
|
-
align: {
|
39
|
-
options: ['start', 'center', 'end', 'activeDirection'],
|
40
|
-
control: {
|
41
|
-
type: 'inline-radio',
|
42
|
-
},
|
43
|
-
},
|
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: {
|
57
|
-
control: 'boolean',
|
58
|
-
},
|
59
|
-
},
|
60
|
-
args: {
|
61
|
-
view: 'default',
|
62
|
-
size: 's',
|
63
|
-
align: 'center',
|
64
|
-
slides: 10,
|
65
|
-
controlArrowsDisabled: false,
|
66
|
-
paginationDisabled: false,
|
67
|
-
paginationCentered: false,
|
68
|
-
},
|
69
|
-
parameters: {
|
70
|
-
controls: {
|
71
|
-
include: [
|
72
|
-
'visibleDots',
|
73
|
-
'slides',
|
74
|
-
'controlArrowsDisabled',
|
75
|
-
'paginationDisabled',
|
76
|
-
'paginationCentered',
|
77
|
-
'gap',
|
78
|
-
],
|
79
|
-
},
|
80
|
-
},
|
81
|
-
};
|
82
|
-
|
83
|
-
export default meta;
|
84
|
-
|
85
|
-
const StyledCard = styled.div`
|
86
|
-
display: flex;
|
87
|
-
align-items: center;
|
88
|
-
justify-content: center;
|
89
|
-
position: relative;
|
90
|
-
border-radius: 8px;
|
91
|
-
width: 400px;
|
92
|
-
height: 370px;
|
93
|
-
background-color: #add8e6;
|
94
|
-
font-size: 30px;
|
95
|
-
`;
|
96
|
-
|
97
|
-
const StoryDefault = ({
|
98
|
-
align,
|
99
|
-
visibleDots,
|
100
|
-
slides,
|
101
|
-
paginationDisabled,
|
102
|
-
paginationCentered,
|
103
|
-
...rest
|
104
|
-
}: StoryCarouselProps) => {
|
105
|
-
const items = Array(slides)
|
106
|
-
.fill(1)
|
107
|
-
.map((_, i) => ({
|
108
|
-
id: i,
|
109
|
-
title: i,
|
110
|
-
}));
|
111
|
-
|
112
|
-
return (
|
113
|
-
<>
|
114
|
-
<div style={{ width: '600px' }}>
|
115
|
-
<Carousel
|
116
|
-
scrollAlign={align}
|
117
|
-
paginationOptions={{
|
118
|
-
disabled: paginationDisabled,
|
119
|
-
visibleDots,
|
120
|
-
centered: paginationCentered,
|
121
|
-
}}
|
122
|
-
{...rest}
|
123
|
-
>
|
124
|
-
{items.map((item, i) => (
|
125
|
-
<CarouselItem key={i}>
|
126
|
-
<StyledCard>{item.title}</StyledCard>
|
127
|
-
</CarouselItem>
|
128
|
-
))}
|
129
|
-
</Carousel>
|
130
|
-
</div>
|
131
|
-
</>
|
132
|
-
);
|
133
|
-
};
|
134
|
-
|
135
|
-
export const Default: StoryObj<StoryCarouselProps> = {
|
136
|
-
render: (args) => <StoryDefault {...args} />,
|
137
|
-
};
|
@@ -1,19 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
Object.defineProperty(exports, "Carousel", {
|
7
|
-
enumerable: true,
|
8
|
-
get: function get() {
|
9
|
-
return _Carousel.Carousel;
|
10
|
-
}
|
11
|
-
});
|
12
|
-
Object.defineProperty(exports, "CarouselItem", {
|
13
|
-
enumerable: true,
|
14
|
-
get: function get() {
|
15
|
-
return _emotion.CarouselItem;
|
16
|
-
}
|
17
|
-
});
|
18
|
-
var _emotion = /*#__PURE__*/require("@salutejs/plasma-new-hope/emotion");
|
19
|
-
var _Carousel = /*#__PURE__*/require("./Carousel");
|
@@ -1,17 +0,0 @@
|
|
1
|
-
var _templateObject, _templateObject2;
|
2
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
3
|
-
import { css, carouselNewTokens as tokens } from '@salutejs/plasma-new-hope/emotion';
|
4
|
-
export var config = {
|
5
|
-
defaults: {
|
6
|
-
view: 'default',
|
7
|
-
size: 's'
|
8
|
-
},
|
9
|
-
variations: {
|
10
|
-
view: {
|
11
|
-
"default": /*#__PURE__*/css(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteral(["\n ", ": var(--surface-transparent-tertiary);\n ", ": var(--surface-solid-default);\n "])), tokens.paginationDotBackground, tokens.paginationDotActiveBackground)
|
12
|
-
},
|
13
|
-
size: {
|
14
|
-
s: /*#__PURE__*/css(_templateObject2 || (_templateObject2 = /*#__PURE__*/_taggedTemplateLiteral([""])))
|
15
|
-
}
|
16
|
-
}
|
17
|
-
};
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import { carouselNewConfig, component, mergeConfig } from '@salutejs/plasma-new-hope/emotion';
|
2
|
-
import { config } from './Carousel.config';
|
3
|
-
var mergedConfig = /*#__PURE__*/mergeConfig(carouselNewConfig, config);
|
4
|
-
var Carousel = /*#__PURE__*/component(mergedConfig);
|
5
|
-
export { Carousel };
|
@@ -1,137 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { ComponentProps } from 'react';
|
3
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
4
|
-
import styled from 'styled-components';
|
5
|
-
import { getConfigVariations, InSpacingDecorator } from '@salutejs/plasma-sb-utils';
|
6
|
-
|
7
|
-
import { config } from './Carousel.config';
|
8
|
-
import { Carousel } from './Carousel';
|
9
|
-
|
10
|
-
import { CarouselItem } from './index';
|
11
|
-
|
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);
|
20
|
-
|
21
|
-
const meta: Meta<StoryCarouselProps> = {
|
22
|
-
title: 'Navigation/Carousel',
|
23
|
-
component: Carousel,
|
24
|
-
decorators: [InSpacingDecorator],
|
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
|
-
},
|
38
|
-
align: {
|
39
|
-
options: ['start', 'center', 'end', 'activeDirection'],
|
40
|
-
control: {
|
41
|
-
type: 'inline-radio',
|
42
|
-
},
|
43
|
-
},
|
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: {
|
57
|
-
control: 'boolean',
|
58
|
-
},
|
59
|
-
},
|
60
|
-
args: {
|
61
|
-
view: 'default',
|
62
|
-
size: 's',
|
63
|
-
align: 'center',
|
64
|
-
slides: 10,
|
65
|
-
controlArrowsDisabled: false,
|
66
|
-
paginationDisabled: false,
|
67
|
-
paginationCentered: false,
|
68
|
-
},
|
69
|
-
parameters: {
|
70
|
-
controls: {
|
71
|
-
include: [
|
72
|
-
'visibleDots',
|
73
|
-
'slides',
|
74
|
-
'controlArrowsDisabled',
|
75
|
-
'paginationDisabled',
|
76
|
-
'paginationCentered',
|
77
|
-
'gap',
|
78
|
-
],
|
79
|
-
},
|
80
|
-
},
|
81
|
-
};
|
82
|
-
|
83
|
-
export default meta;
|
84
|
-
|
85
|
-
const StyledCard = styled.div`
|
86
|
-
display: flex;
|
87
|
-
align-items: center;
|
88
|
-
justify-content: center;
|
89
|
-
position: relative;
|
90
|
-
border-radius: 8px;
|
91
|
-
width: 400px;
|
92
|
-
height: 370px;
|
93
|
-
background-color: #add8e6;
|
94
|
-
font-size: 30px;
|
95
|
-
`;
|
96
|
-
|
97
|
-
const StoryDefault = ({
|
98
|
-
align,
|
99
|
-
visibleDots,
|
100
|
-
slides,
|
101
|
-
paginationDisabled,
|
102
|
-
paginationCentered,
|
103
|
-
...rest
|
104
|
-
}: StoryCarouselProps) => {
|
105
|
-
const items = Array(slides)
|
106
|
-
.fill(1)
|
107
|
-
.map((_, i) => ({
|
108
|
-
id: i,
|
109
|
-
title: i,
|
110
|
-
}));
|
111
|
-
|
112
|
-
return (
|
113
|
-
<>
|
114
|
-
<div style={{ width: '600px' }}>
|
115
|
-
<Carousel
|
116
|
-
scrollAlign={align}
|
117
|
-
paginationOptions={{
|
118
|
-
disabled: paginationDisabled,
|
119
|
-
visibleDots,
|
120
|
-
centered: paginationCentered,
|
121
|
-
}}
|
122
|
-
{...rest}
|
123
|
-
>
|
124
|
-
{items.map((item, i) => (
|
125
|
-
<CarouselItem key={i}>
|
126
|
-
<StyledCard>{item.title}</StyledCard>
|
127
|
-
</CarouselItem>
|
128
|
-
))}
|
129
|
-
</Carousel>
|
130
|
-
</div>
|
131
|
-
</>
|
132
|
-
);
|
133
|
-
};
|
134
|
-
|
135
|
-
export const Default: StoryObj<StoryCarouselProps> = {
|
136
|
-
render: (args) => <StoryDefault {...args} />,
|
137
|
-
};
|
@@ -1,17 +0,0 @@
|
|
1
|
-
var _templateObject, _templateObject2;
|
2
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
3
|
-
import { css, carouselNewTokens as tokens } from '@salutejs/plasma-new-hope/styled-components';
|
4
|
-
export var config = {
|
5
|
-
defaults: {
|
6
|
-
view: 'default',
|
7
|
-
size: 's'
|
8
|
-
},
|
9
|
-
variations: {
|
10
|
-
view: {
|
11
|
-
"default": /*#__PURE__*/css(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteral(["\n ", ": var(--surface-transparent-tertiary);\n ", ": var(--surface-solid-default);\n "])), tokens.paginationDotBackground, tokens.paginationDotActiveBackground)
|
12
|
-
},
|
13
|
-
size: {
|
14
|
-
s: /*#__PURE__*/css(_templateObject2 || (_templateObject2 = /*#__PURE__*/_taggedTemplateLiteral([""])))
|
15
|
-
}
|
16
|
-
}
|
17
|
-
};
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import { carouselNewConfig, component, mergeConfig } from '@salutejs/plasma-new-hope/styled-components';
|
2
|
-
import { config } from './Carousel.config';
|
3
|
-
var mergedConfig = /*#__PURE__*/mergeConfig(carouselNewConfig, config);
|
4
|
-
var Carousel = /*#__PURE__*/component(mergedConfig);
|
5
|
-
export { Carousel };
|