@salutejs/sdds-cs 0.318.0-canary.2013.15538813402.0 → 0.318.0-canary.2013.15558438626.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/components/Carousel/Carousel.config.d.ts +14 -0
  2. package/components/Carousel/Carousel.config.js +23 -0
  3. package/components/Carousel/Carousel.d.ts +9 -0
  4. package/components/Carousel/Carousel.js +10 -0
  5. package/components/Carousel/index.d.ts +2 -0
  6. package/components/Carousel/index.js +19 -0
  7. package/components/Notification/Notification.d.ts +7 -6
  8. package/components/Notification/Notification.js +3 -21
  9. package/components/Notification/index.d.ts +3 -2
  10. package/components/Notification/index.js +4 -3
  11. package/emotion/cjs/components/Carousel/Carousel.config.js +23 -0
  12. package/emotion/cjs/components/Carousel/Carousel.js +10 -0
  13. package/emotion/cjs/components/Carousel/Carousel.stories.tsx +139 -0
  14. package/emotion/cjs/components/Carousel/index.js +19 -0
  15. package/emotion/cjs/components/Notification/Notification.js +3 -21
  16. package/emotion/cjs/components/Notification/Notification.stories.tsx +3 -8
  17. package/emotion/cjs/components/Notification/index.js +4 -3
  18. package/emotion/cjs/index.js +11 -0
  19. package/emotion/es/components/Carousel/Carousel.config.js +17 -0
  20. package/emotion/es/components/Carousel/Carousel.js +5 -0
  21. package/emotion/es/components/Carousel/Carousel.stories.tsx +139 -0
  22. package/emotion/es/components/Carousel/index.js +2 -0
  23. package/emotion/es/components/Notification/Notification.js +4 -5
  24. package/emotion/es/components/Notification/Notification.stories.tsx +3 -8
  25. package/emotion/es/components/Notification/index.js +2 -1
  26. package/emotion/es/index.js +1 -0
  27. package/es/components/Carousel/Carousel.config.js +17 -0
  28. package/es/components/Carousel/Carousel.js +5 -0
  29. package/es/components/Carousel/index.js +2 -0
  30. package/es/components/Notification/Notification.js +4 -5
  31. package/es/components/Notification/index.js +2 -1
  32. package/es/index.js +1 -0
  33. package/index.d.ts +1 -0
  34. package/index.js +11 -0
  35. package/package.json +7 -7
@@ -0,0 +1,14 @@
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
+ };
@@ -0,0 +1,23 @@
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
+ };
@@ -0,0 +1,9 @@
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 };
@@ -0,0 +1,10 @@
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);
@@ -0,0 +1,2 @@
1
+ export { CarouselItem } from '@salutejs/plasma-new-hope/styled-components';
2
+ export { Carousel } from './Carousel';
@@ -0,0 +1,19 @@
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,7 +1,7 @@
1
- import React, { ReactNode } from 'react';
2
- import { NotificationProps, NotificationIconPlacement, NotificationPlacement, NotificationLayout, addNotification, closeNotification } from '@salutejs/plasma-new-hope/styled-components';
3
- export { modalClasses } from '../Modal';
4
- export declare const Notification: React.FunctionComponent<import("@salutejs/plasma-new-hope/types/engines/types").PropsType<{
1
+ import React, { ComponentProps, ForwardRefExoticComponent, ReactNode } from 'react';
2
+ import { NotificationProps as NotificationPropsNewHope, NotificationPlacement } from '@salutejs/plasma-new-hope/styled-components';
3
+ export type { NotificationPlacement };
4
+ export declare const NotificationNewHope: React.FunctionComponent<import("@salutejs/plasma-new-hope/types/engines/types").PropsType<{
5
5
  view: {
6
6
  default: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
7
7
  };
@@ -17,11 +17,12 @@ export declare const Notification: React.FunctionComponent<import("@salutejs/pla
17
17
  thin: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
18
18
  };
19
19
  }> & (React.HTMLAttributes<HTMLElement> | import("@salutejs/plasma-new-hope/types/engines/types").HTMLAttributesWithoutOnChange<HTMLElement> | import("@salutejs/plasma-new-hope/types/engines/types").HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>)>;
20
+ type ConfigProps = 'size' | 'view' | 'layout' | 'closeIconType';
21
+ type NotificationProps = Pick<ComponentProps<typeof NotificationNewHope>, ConfigProps> & Omit<NotificationPropsNewHope, ConfigProps>;
22
+ export declare const Notification: ForwardRefExoticComponent<NotificationProps>;
20
23
  export declare const NotificationsProvider: React.FC<{
21
24
  children: ReactNode;
22
25
  frame?: string;
23
26
  placement?: NotificationPlacement;
24
27
  UNSAFE_SSR_ENABLED?: boolean;
25
28
  }>;
26
- export type { NotificationIconPlacement, NotificationPlacement, NotificationLayout, NotificationProps };
27
- export { addNotification, closeNotification };
@@ -3,32 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.NotificationsProvider = exports.Notification = void 0;
7
- Object.defineProperty(exports, "addNotification", {
8
- enumerable: true,
9
- get: function get() {
10
- return _styledComponents.addNotification;
11
- }
12
- });
13
- Object.defineProperty(exports, "closeNotification", {
14
- enumerable: true,
15
- get: function get() {
16
- return _styledComponents.closeNotification;
17
- }
18
- });
19
- Object.defineProperty(exports, "modalClasses", {
20
- enumerable: true,
21
- get: function get() {
22
- return _Modal.modalClasses;
23
- }
24
- });
6
+ exports.NotificationsProvider = exports.NotificationNewHope = exports.Notification = void 0;
25
7
  var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
26
8
  var _styledComponents = /*#__PURE__*/require("@salutejs/plasma-new-hope/styled-components");
27
9
  var _Notification = /*#__PURE__*/require("./Notification.config");
28
- var _Modal = /*#__PURE__*/require("../Modal");
29
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
30
11
  var mergedConfig = /*#__PURE__*/(0, _styledComponents.mergeConfig)(_styledComponents.notificationConfig, _Notification.config);
31
- var Notification = exports.Notification = /*#__PURE__*/(0, _styledComponents.component)(mergedConfig);
12
+ var NotificationNewHope = exports.NotificationNewHope = /*#__PURE__*/(0, _styledComponents.component)(mergedConfig);
13
+ var Notification = exports.Notification = NotificationNewHope;
32
14
  var NotificationsProvider = exports.NotificationsProvider = function NotificationsProvider(_ref) {
33
15
  var children = _ref.children,
34
16
  _ref$frame = _ref.frame,
@@ -1,2 +1,3 @@
1
- export { NotificationsProvider, Notification, addNotification, closeNotification } from './Notification';
2
- export type { NotificationIconPlacement, NotificationLayout, NotificationProps } from './Notification';
1
+ export { NotificationsProvider, Notification } from './Notification';
2
+ export { addNotification, closeNotification } from '@salutejs/plasma-new-hope/styled-components';
3
+ export type { NotificationProps, NotificationLayout, NotificationIconPlacement, } from '@salutejs/plasma-new-hope/styled-components';
@@ -18,13 +18,14 @@ Object.defineProperty(exports, "NotificationsProvider", {
18
18
  Object.defineProperty(exports, "addNotification", {
19
19
  enumerable: true,
20
20
  get: function get() {
21
- return _Notification.addNotification;
21
+ return _styledComponents.addNotification;
22
22
  }
23
23
  });
24
24
  Object.defineProperty(exports, "closeNotification", {
25
25
  enumerable: true,
26
26
  get: function get() {
27
- return _Notification.closeNotification;
27
+ return _styledComponents.closeNotification;
28
28
  }
29
29
  });
30
- var _Notification = /*#__PURE__*/require("./Notification");
30
+ var _Notification = /*#__PURE__*/require("./Notification");
31
+ var _styledComponents = /*#__PURE__*/require("@salutejs/plasma-new-hope/styled-components");
@@ -0,0 +1,23 @@
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
+ };
@@ -0,0 +1,10 @@
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);
@@ -0,0 +1,139 @@
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
+ 'align',
73
+ 'visibleDots',
74
+ 'slides',
75
+ 'controlArrowsDisabled',
76
+ 'paginationDisabled',
77
+ 'paginationCentered',
78
+ 'gap',
79
+ ],
80
+ },
81
+ },
82
+ };
83
+
84
+ export default meta;
85
+
86
+ const StyledCard = styled.div`
87
+ display: flex;
88
+ align-items: center;
89
+ justify-content: center;
90
+ position: relative;
91
+ border-radius: 8px;
92
+ width: 400px;
93
+ height: 370px;
94
+ background-color: #add8e6;
95
+ font-size: 30px;
96
+ `;
97
+
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
+ }));
112
+
113
+ return (
114
+ <>
115
+ <div style={{ width: '600px' }}>
116
+ <Carousel
117
+ detectActive
118
+ scrollAlign={align}
119
+ paginationOptions={{
120
+ disabled: paginationDisabled,
121
+ visibleDots,
122
+ centered: paginationCentered,
123
+ }}
124
+ {...rest}
125
+ >
126
+ {items.map((item, i) => (
127
+ <CarouselItem key={i} scrollSnapAlign={align}>
128
+ <StyledCard>{item.title}</StyledCard>
129
+ </CarouselItem>
130
+ ))}
131
+ </Carousel>
132
+ </div>
133
+ </>
134
+ );
135
+ };
136
+
137
+ export const Default: StoryObj<StoryCarouselProps> = {
138
+ render: (args) => <StoryDefault {...args} />,
139
+ };
@@ -0,0 +1,19 @@
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");
@@ -3,32 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.NotificationsProvider = exports.Notification = void 0;
7
- Object.defineProperty(exports, "addNotification", {
8
- enumerable: true,
9
- get: function get() {
10
- return _emotion.addNotification;
11
- }
12
- });
13
- Object.defineProperty(exports, "closeNotification", {
14
- enumerable: true,
15
- get: function get() {
16
- return _emotion.closeNotification;
17
- }
18
- });
19
- Object.defineProperty(exports, "modalClasses", {
20
- enumerable: true,
21
- get: function get() {
22
- return _Modal.modalClasses;
23
- }
24
- });
6
+ exports.NotificationsProvider = exports.NotificationNewHope = exports.Notification = void 0;
25
7
  var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
26
8
  var _emotion = /*#__PURE__*/require("@salutejs/plasma-new-hope/emotion");
27
9
  var _Notification = /*#__PURE__*/require("./Notification.config");
28
- var _Modal = /*#__PURE__*/require("../Modal");
29
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
30
11
  var mergedConfig = /*#__PURE__*/(0, _emotion.mergeConfig)(_emotion.notificationConfig, _Notification.config);
31
- var Notification = exports.Notification = /*#__PURE__*/(0, _emotion.component)(mergedConfig);
12
+ var NotificationNewHope = exports.NotificationNewHope = /*#__PURE__*/(0, _emotion.component)(mergedConfig);
13
+ var Notification = exports.Notification = NotificationNewHope;
32
14
  var NotificationsProvider = exports.NotificationsProvider = function NotificationsProvider(_ref) {
33
15
  var children = _ref.children,
34
16
  _ref$frame = _ref.frame,
@@ -4,19 +4,14 @@ import type { StoryObj, Meta } from '@storybook/react';
4
4
  import { IconDisclosureRight, IconSber } from '@salutejs/plasma-icons';
5
5
  import { disableProps, InSpacingDecorator } from '@salutejs/plasma-sb-utils';
6
6
  import { action } from '@storybook/addon-actions';
7
+ import { addNotification } from '@salutejs/plasma-new-hope';
8
+ import type { NotificationIconPlacement, NotificationLayout } from '@salutejs/plasma-new-hope';
7
9
 
8
10
  import { Button } from '../Button/Button';
9
11
  import { Modal } from '../Modal/Modal';
10
12
  import { PopupProvider } from '../Popup';
11
13
 
12
- import {
13
- Notification,
14
- NotificationsProvider,
15
- NotificationPlacement,
16
- NotificationIconPlacement,
17
- NotificationLayout,
18
- addNotification,
19
- } from './Notification';
14
+ import { Notification, NotificationsProvider, NotificationPlacement } from './Notification';
20
15
 
21
16
  const titles = ['Выполнено', 'Внимание', 'Ошибка'];
22
17
  const texts = ['SSH ключ успешно скопирован', 'Нельзя скопировать SSH ключ', 'Не удалось скопировать SSH ключ'];
@@ -18,13 +18,14 @@ Object.defineProperty(exports, "NotificationsProvider", {
18
18
  Object.defineProperty(exports, "addNotification", {
19
19
  enumerable: true,
20
20
  get: function get() {
21
- return _Notification.addNotification;
21
+ return _emotion.addNotification;
22
22
  }
23
23
  });
24
24
  Object.defineProperty(exports, "closeNotification", {
25
25
  enumerable: true,
26
26
  get: function get() {
27
- return _Notification.closeNotification;
27
+ return _emotion.closeNotification;
28
28
  }
29
29
  });
30
- var _Notification = /*#__PURE__*/require("./Notification");
30
+ var _Notification = /*#__PURE__*/require("./Notification");
31
+ var _emotion = /*#__PURE__*/require("@salutejs/plasma-new-hope/emotion");
@@ -707,6 +707,17 @@ 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
+ });
710
721
  var _mixins = /*#__PURE__*/require("./mixins");
711
722
  Object.keys(_mixins).forEach(function (key) {
712
723
  if (key === "default" || key === "__esModule") return;
@@ -0,0 +1,17 @@
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
+ };
@@ -0,0 +1,5 @@
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 };
@@ -0,0 +1,139 @@
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
+ 'align',
73
+ 'visibleDots',
74
+ 'slides',
75
+ 'controlArrowsDisabled',
76
+ 'paginationDisabled',
77
+ 'paginationCentered',
78
+ 'gap',
79
+ ],
80
+ },
81
+ },
82
+ };
83
+
84
+ export default meta;
85
+
86
+ const StyledCard = styled.div`
87
+ display: flex;
88
+ align-items: center;
89
+ justify-content: center;
90
+ position: relative;
91
+ border-radius: 8px;
92
+ width: 400px;
93
+ height: 370px;
94
+ background-color: #add8e6;
95
+ font-size: 30px;
96
+ `;
97
+
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
+ }));
112
+
113
+ return (
114
+ <>
115
+ <div style={{ width: '600px' }}>
116
+ <Carousel
117
+ detectActive
118
+ scrollAlign={align}
119
+ paginationOptions={{
120
+ disabled: paginationDisabled,
121
+ visibleDots,
122
+ centered: paginationCentered,
123
+ }}
124
+ {...rest}
125
+ >
126
+ {items.map((item, i) => (
127
+ <CarouselItem key={i} scrollSnapAlign={align}>
128
+ <StyledCard>{item.title}</StyledCard>
129
+ </CarouselItem>
130
+ ))}
131
+ </Carousel>
132
+ </div>
133
+ </>
134
+ );
135
+ };
136
+
137
+ export const Default: StoryObj<StoryCarouselProps> = {
138
+ render: (args) => <StoryDefault {...args} />,
139
+ };
@@ -0,0 +1,2 @@
1
+ export { CarouselItem } from '@salutejs/plasma-new-hope/emotion';
2
+ export { Carousel } from './Carousel';
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { component, mergeConfig, notificationConfig, NotificationsProvider as Provider, addNotification, closeNotification } from '@salutejs/plasma-new-hope/emotion';
2
+ import { notificationConfig, NotificationsProvider as Provider, component, mergeConfig } from '@salutejs/plasma-new-hope/emotion';
3
3
  import { config } from './Notification.config';
4
- export { modalClasses } from '../Modal';
5
4
  var mergedConfig = /*#__PURE__*/mergeConfig(notificationConfig, config);
6
- export var Notification = /*#__PURE__*/component(mergedConfig);
5
+ export var NotificationNewHope = /*#__PURE__*/component(mergedConfig);
6
+ export var Notification = NotificationNewHope;
7
7
  export var NotificationsProvider = function NotificationsProvider(_ref) {
8
8
  var children = _ref.children,
9
9
  _ref$frame = _ref.frame,
@@ -16,5 +16,4 @@ export var NotificationsProvider = function NotificationsProvider(_ref) {
16
16
  placement: placement,
17
17
  UNSAFE_SSR_ENABLED: UNSAFE_SSR_ENABLED
18
18
  }, children);
19
- };
20
- export { addNotification, closeNotification };
19
+ };
@@ -4,19 +4,14 @@ import type { StoryObj, Meta } from '@storybook/react';
4
4
  import { IconDisclosureRight, IconSber } from '@salutejs/plasma-icons';
5
5
  import { disableProps, InSpacingDecorator } from '@salutejs/plasma-sb-utils';
6
6
  import { action } from '@storybook/addon-actions';
7
+ import { addNotification } from '@salutejs/plasma-new-hope';
8
+ import type { NotificationIconPlacement, NotificationLayout } from '@salutejs/plasma-new-hope';
7
9
 
8
10
  import { Button } from '../Button/Button';
9
11
  import { Modal } from '../Modal/Modal';
10
12
  import { PopupProvider } from '../Popup';
11
13
 
12
- import {
13
- Notification,
14
- NotificationsProvider,
15
- NotificationPlacement,
16
- NotificationIconPlacement,
17
- NotificationLayout,
18
- addNotification,
19
- } from './Notification';
14
+ import { Notification, NotificationsProvider, NotificationPlacement } from './Notification';
20
15
 
21
16
  const titles = ['Выполнено', 'Внимание', 'Ошибка'];
22
17
  const texts = ['SSH ключ успешно скопирован', 'Нельзя скопировать SSH ключ', 'Не удалось скопировать SSH ключ'];
@@ -1 +1,2 @@
1
- export { NotificationsProvider, Notification, addNotification, closeNotification } from './Notification';
1
+ export { NotificationsProvider, Notification } from './Notification';
2
+ export { addNotification, closeNotification } from '@salutejs/plasma-new-hope/emotion';
@@ -62,5 +62,6 @@ export * from './components/Tree';
62
62
  export * from './components/NumberFormat';
63
63
  export * from './components/Table';
64
64
  export * from './components/ToastNew';
65
+ export * from './components/Carousel';
65
66
  export * from './mixins';
66
67
  export * from './tokens';
@@ -0,0 +1,17 @@
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
+ };
@@ -0,0 +1,5 @@
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 };
@@ -0,0 +1,2 @@
1
+ export { CarouselItem } from '@salutejs/plasma-new-hope/styled-components';
2
+ export { Carousel } from './Carousel';
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { component, mergeConfig, notificationConfig, NotificationsProvider as Provider, addNotification, closeNotification } from '@salutejs/plasma-new-hope/styled-components';
2
+ import { notificationConfig, NotificationsProvider as Provider, component, mergeConfig } from '@salutejs/plasma-new-hope/styled-components';
3
3
  import { config } from './Notification.config';
4
- export { modalClasses } from '../Modal';
5
4
  var mergedConfig = /*#__PURE__*/mergeConfig(notificationConfig, config);
6
- export var Notification = /*#__PURE__*/component(mergedConfig);
5
+ export var NotificationNewHope = /*#__PURE__*/component(mergedConfig);
6
+ export var Notification = NotificationNewHope;
7
7
  export var NotificationsProvider = function NotificationsProvider(_ref) {
8
8
  var children = _ref.children,
9
9
  _ref$frame = _ref.frame,
@@ -16,5 +16,4 @@ export var NotificationsProvider = function NotificationsProvider(_ref) {
16
16
  placement: placement,
17
17
  UNSAFE_SSR_ENABLED: UNSAFE_SSR_ENABLED
18
18
  }, children);
19
- };
20
- export { addNotification, closeNotification };
19
+ };
@@ -1 +1,2 @@
1
- export { NotificationsProvider, Notification, addNotification, closeNotification } from './Notification';
1
+ export { NotificationsProvider, Notification } from './Notification';
2
+ export { addNotification, closeNotification } from '@salutejs/plasma-new-hope/styled-components';
package/es/index.js CHANGED
@@ -62,5 +62,6 @@ export * from './components/Tree';
62
62
  export * from './components/NumberFormat';
63
63
  export * from './components/Table';
64
64
  export * from './components/ToastNew';
65
+ export * from './components/Carousel';
65
66
  export * from './mixins';
66
67
  export * from './tokens';
package/index.d.ts CHANGED
@@ -62,5 +62,6 @@ export * from './components/Tree';
62
62
  export * from './components/NumberFormat';
63
63
  export * from './components/Table';
64
64
  export * from './components/ToastNew';
65
+ export * from './components/Carousel';
65
66
  export * from './mixins';
66
67
  export * from './tokens';
package/index.js CHANGED
@@ -707,6 +707,17 @@ 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
+ });
710
721
  var _mixins = /*#__PURE__*/require("./mixins");
711
722
  Object.keys(_mixins).forEach(function (key) {
712
723
  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.318.0-canary.2013.15538813402.0",
3
+ "version": "0.318.0-canary.2013.15558438626.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.326.0-canary.2013.15538813402.0",
34
- "@salutejs/sdds-themes": "0.38.0-canary.2013.15538813402.0"
33
+ "@salutejs/plasma-new-hope": "0.326.0-canary.2013.15558438626.0",
34
+ "@salutejs/sdds-themes": "0.38.0-canary.2013.15558438626.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.198.0-canary.2013.15538813402.0",
58
- "@salutejs/plasma-cy-utils": "0.129.0-canary.2013.15538813402.0",
57
+ "@salutejs/plasma-core": "1.198.0-canary.2013.15558438626.0",
58
+ "@salutejs/plasma-cy-utils": "0.129.0-canary.2013.15558438626.0",
59
59
  "@salutejs/plasma-icons": "1.218.0",
60
- "@salutejs/plasma-sb-utils": "0.199.0-canary.2013.15538813402.0",
60
+ "@salutejs/plasma-sb-utils": "0.199.0-canary.2013.15558438626.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": "c9773f0abdb0d59770e720e4428fc9b8b0b1b9c1"
126
+ "gitHead": "b928acc663c38a8dc645267f0cc4f9b65bb28ffc"
127
127
  }