@salutejs/plasma-new-hope 0.176.0-dev.0 → 0.176.1-canary.1510.11572230988.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Notification/Notification.css +11 -11
- package/cjs/components/Notification/Notification.js +2 -2
- package/cjs/components/Notification/Notification.js.map +1 -1
- package/cjs/components/Notification/Notification.styles.js +11 -2
- package/cjs/components/Notification/Notification.styles.js.map +1 -1
- package/cjs/components/Notification/{Notification.styles_7h8hp0.css → Notification.styles_e6274r.css} +2 -2
- package/cjs/components/Notification/Notification.tokens.js +2 -1
- package/cjs/components/Notification/Notification.tokens.js.map +1 -1
- package/cjs/components/Notification/Notification.types.js.map +1 -1
- package/cjs/components/Notification/NotificationsPortal.js +8 -4
- package/cjs/components/Notification/NotificationsPortal.js.map +1 -1
- package/cjs/components/Notification/NotificationsProvider.css +11 -11
- package/cjs/components/Notification/NotificationsProvider.js +3 -1
- package/cjs/components/Notification/NotificationsProvider.js.map +1 -1
- package/cjs/components/Pagination/Pagination.css +12 -12
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +12 -12
- package/cjs/components/Select/Select.css +12 -12
- package/cjs/components/Select/Select.tokens.js +2 -1
- package/cjs/components/Select/Select.tokens.js.map +1 -1
- package/cjs/components/Select/ui/Inner/Inner.css +12 -12
- package/cjs/components/Select/ui/Inner/ui/Item/Item.css +12 -12
- package/cjs/components/Select/ui/Target/Target.css +12 -12
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.css +12 -12
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
- package/cjs/components/Select/ui/Target/ui/Textfield/{Textfield.styles_11yj58s.css → Textfield.styles_jzeap2.css} +1 -1
- package/cjs/index.css +23 -23
- package/cjs/index.js +1 -1
- package/emotion/cjs/components/Notification/Notification.js +2 -2
- package/emotion/cjs/components/Notification/Notification.styles.js +14 -19
- package/emotion/cjs/components/Notification/Notification.template-doc.mdx +17 -8
- package/emotion/cjs/components/Notification/Notification.tokens.js +2 -1
- package/emotion/cjs/components/Notification/NotificationsPortal.js +9 -5
- package/emotion/cjs/components/Notification/NotificationsProvider.js +3 -1
- package/emotion/cjs/components/Notification/index.js +4 -4
- package/emotion/cjs/components/Select/Select.tokens.js +2 -1
- package/emotion/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +12 -21
- package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.js +5 -3
- package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
- package/emotion/cjs/examples/plasma_web/components/Notification/Notification.js +5 -3
- package/emotion/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
- package/emotion/es/components/Notification/Notification.js +1 -1
- package/emotion/es/components/Notification/Notification.styles.js +14 -19
- package/emotion/es/components/Notification/Notification.template-doc.mdx +17 -8
- package/emotion/es/components/Notification/Notification.tokens.js +2 -1
- package/emotion/es/components/Notification/NotificationsPortal.js +9 -5
- package/emotion/es/components/Notification/NotificationsProvider.js +3 -1
- package/emotion/es/components/Notification/index.js +1 -1
- package/emotion/es/components/Select/Select.tokens.js +2 -1
- package/emotion/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +12 -21
- package/emotion/es/examples/plasma_b2c/components/Notification/Notification.js +6 -4
- package/emotion/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
- package/emotion/es/examples/plasma_web/components/Notification/Notification.js +6 -4
- package/emotion/es/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
- package/es/components/Notification/Notification.css +11 -11
- package/es/components/Notification/Notification.js +2 -2
- package/es/components/Notification/Notification.js.map +1 -1
- package/es/components/Notification/Notification.styles.js +11 -2
- package/es/components/Notification/Notification.styles.js.map +1 -1
- package/es/components/Notification/{Notification.styles_7h8hp0.css → Notification.styles_e6274r.css} +2 -2
- package/es/components/Notification/Notification.tokens.js +2 -1
- package/es/components/Notification/Notification.tokens.js.map +1 -1
- package/es/components/Notification/Notification.types.js.map +1 -1
- package/es/components/Notification/NotificationsPortal.js +8 -4
- package/es/components/Notification/NotificationsPortal.js.map +1 -1
- package/es/components/Notification/NotificationsProvider.css +11 -11
- package/es/components/Notification/NotificationsProvider.js +3 -1
- package/es/components/Notification/NotificationsProvider.js.map +1 -1
- package/es/components/Pagination/Pagination.css +12 -12
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +12 -12
- package/es/components/Select/Select.css +12 -12
- package/es/components/Select/Select.tokens.js +2 -1
- package/es/components/Select/Select.tokens.js.map +1 -1
- package/es/components/Select/ui/Inner/Inner.css +12 -12
- package/es/components/Select/ui/Inner/ui/Item/Item.css +12 -12
- package/es/components/Select/ui/Target/Target.css +12 -12
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.css +12 -12
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
- package/es/components/Select/ui/Target/ui/Textfield/{Textfield.styles_11yj58s.css → Textfield.styles_jzeap2.css} +1 -1
- package/es/index.css +23 -23
- package/es/index.js +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Notification/Notification.js +2 -2
- package/styled-components/cjs/components/Notification/Notification.styles.js +5 -2
- package/styled-components/cjs/components/Notification/Notification.template-doc.mdx +17 -8
- package/styled-components/cjs/components/Notification/Notification.tokens.js +2 -1
- package/styled-components/cjs/components/Notification/NotificationsPortal.js +8 -4
- package/styled-components/cjs/components/Notification/NotificationsProvider.js +3 -1
- package/styled-components/cjs/components/Notification/index.js +4 -4
- package/styled-components/cjs/components/Select/Select.tokens.js +2 -1
- package/styled-components/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.js +5 -3
- package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
- package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.js +5 -3
- package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
- package/styled-components/es/components/Notification/Notification.js +1 -1
- package/styled-components/es/components/Notification/Notification.styles.js +5 -2
- package/styled-components/es/components/Notification/Notification.template-doc.mdx +17 -8
- package/styled-components/es/components/Notification/Notification.tokens.js +2 -1
- package/styled-components/es/components/Notification/NotificationsPortal.js +8 -4
- package/styled-components/es/components/Notification/NotificationsProvider.js +3 -1
- package/styled-components/es/components/Notification/index.js +1 -1
- package/styled-components/es/components/Select/Select.tokens.js +2 -1
- package/styled-components/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.js +6 -4
- package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
- package/styled-components/es/examples/plasma_web/components/Notification/Notification.js +6 -4
- package/styled-components/es/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
- package/types/components/Notification/Notification.d.ts +3 -3
- package/types/components/Notification/Notification.d.ts.map +1 -1
- package/types/components/Notification/Notification.styles.d.ts +4 -2
- package/types/components/Notification/Notification.styles.d.ts.map +1 -1
- package/types/components/Notification/Notification.tokens.d.ts +1 -0
- package/types/components/Notification/Notification.tokens.d.ts.map +1 -1
- package/types/components/Notification/Notification.types.d.ts +11 -5
- package/types/components/Notification/Notification.types.d.ts.map +1 -1
- package/types/components/Notification/NotificationsPortal.d.ts.map +1 -1
- package/types/components/Notification/NotificationsProvider.d.ts +4 -3
- package/types/components/Notification/NotificationsProvider.d.ts.map +1 -1
- package/types/components/Notification/index.d.ts +2 -2
- package/types/components/Notification/index.d.ts.map +1 -1
- package/types/components/Select/Select.tokens.d.ts +1 -0
- package/types/components/Select/Select.tokens.d.ts.map +1 -1
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.styles.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Notification/Notification.d.ts +4 -2
- package/types/examples/plasma_b2c/components/Notification/Notification.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Notification/Notification.d.ts +4 -13
- package/types/examples/plasma_web/components/Notification/Notification.d.ts.map +1 -1
@@ -16,14 +16,16 @@ var _engines = /*#__PURE__*/require("../../../../engines");
|
|
16
16
|
var _Notification2 = /*#__PURE__*/require("./Notification.config");
|
17
17
|
var _Modal = /*#__PURE__*/require("../../../../components/Modal");
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
19
|
-
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Notification.
|
19
|
+
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Notification.notificationConfig, _Notification2.config);
|
20
20
|
var Notification = exports.Notification = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
21
21
|
var NotificationsProvider = exports.NotificationsProvider = function NotificationsProvider(_ref) {
|
22
22
|
var children = _ref.children,
|
23
23
|
_ref$frame = _ref.frame,
|
24
|
-
frame = _ref$frame === void 0 ? 'theme-root' : _ref$frame
|
24
|
+
frame = _ref$frame === void 0 ? 'theme-root' : _ref$frame,
|
25
|
+
placement = _ref.placement;
|
25
26
|
return /*#__PURE__*/_react["default"].createElement(_Notification.NotificationsProvider, {
|
26
27
|
config: mergedConfig,
|
27
|
-
frame: frame
|
28
|
+
frame: frame,
|
29
|
+
placement: placement
|
28
30
|
}, children);
|
29
31
|
};
|
@@ -5,6 +5,7 @@ import type { StoryObj, Meta } from '@storybook/react';
|
|
5
5
|
import { Button } from '../Button/Button';
|
6
6
|
import { Modal } from '../Modal/Modal';
|
7
7
|
import {
|
8
|
+
NotificationPlacement,
|
8
9
|
NotificationIconPlacement,
|
9
10
|
NotificationLayout,
|
10
11
|
addNotification,
|
@@ -20,6 +21,7 @@ const titles = ['Выполнено', 'Внимание', 'Ошибка'];
|
|
20
21
|
const texts = ['SSH ключ успешно скопирован', 'Нельзя скопировать SSH ключ', 'Не удалось скопировать SSH ключ'];
|
21
22
|
const size = ['xs', 'xxs'];
|
22
23
|
const iconPlacement = ['top', 'left'];
|
24
|
+
const notificationsPlacements = ['bottom-right', 'bottom-left'];
|
23
25
|
|
24
26
|
const longText = `JavaScript frameworks are an essential part of modern front-end web development,
|
25
27
|
providing developers with proven tools for building scalable, interactive web applications.
|
@@ -49,6 +51,7 @@ interface StoryDefaultProps {
|
|
49
51
|
layout: NotificationLayout;
|
50
52
|
size: 'xs' | 'xxs';
|
51
53
|
iconPlacement: NotificationIconPlacement;
|
54
|
+
placement?: NotificationPlacement;
|
52
55
|
}
|
53
56
|
|
54
57
|
const StoryDefault = ({ title, children, iconPlacement, size, layout, showLeftIcon, ...rest }: StoryDefaultProps) => {
|
@@ -111,9 +114,10 @@ type StoryLiveDemoProps = ComponentProps<typeof Notification> & {
|
|
111
114
|
layout: NotificationLayout;
|
112
115
|
size: 'xs' | 'xxs';
|
113
116
|
iconPlacement: NotificationIconPlacement;
|
117
|
+
placement?: NotificationPlacement;
|
114
118
|
};
|
115
119
|
|
116
|
-
const StoryLiveDemo = ({ timeout, ...rest }: StoryLiveDemoProps) => {
|
120
|
+
const StoryLiveDemo = ({ timeout, placement, ...rest }: StoryLiveDemoProps) => {
|
117
121
|
const count = useRef(0);
|
118
122
|
const handleClick = useCallback(() => {
|
119
123
|
addNotification({ icon: <IconDisclosureRight />, ...rest, ...getNotificationProps(count.current) }, timeout);
|
@@ -121,7 +125,7 @@ const StoryLiveDemo = ({ timeout, ...rest }: StoryLiveDemoProps) => {
|
|
121
125
|
}, [count, rest]);
|
122
126
|
|
123
127
|
return (
|
124
|
-
<NotificationsProvider>
|
128
|
+
<NotificationsProvider placement={placement}>
|
125
129
|
<Button text="Добавить уведомление" onClick={handleClick} />
|
126
130
|
</NotificationsProvider>
|
127
131
|
);
|
@@ -135,20 +139,28 @@ export const LiveDemo: StoryObj<StoryLiveDemoProps> = {
|
|
135
139
|
type: 'select',
|
136
140
|
},
|
137
141
|
},
|
142
|
+
placement: {
|
143
|
+
options: notificationsPlacements,
|
144
|
+
control: {
|
145
|
+
type: 'select',
|
146
|
+
},
|
147
|
+
},
|
138
148
|
},
|
139
149
|
args: {
|
140
150
|
timeout: 3000,
|
141
151
|
role: 'alert',
|
142
152
|
layout: 'vertical',
|
153
|
+
placement: 'bottom-right',
|
143
154
|
},
|
144
155
|
render: (args) => <StoryLiveDemo {...args} />,
|
145
156
|
};
|
146
157
|
|
147
158
|
type StoryWithModalProps = ComponentProps<typeof Notification> & {
|
148
159
|
timeout: number;
|
160
|
+
placement?: NotificationPlacement;
|
149
161
|
};
|
150
162
|
|
151
|
-
const StoryWithModal = ({ timeout }: StoryWithModalProps) => {
|
163
|
+
const StoryWithModal = ({ timeout, placement }: StoryWithModalProps) => {
|
152
164
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
153
165
|
const count = useRef(0);
|
154
166
|
const handleClick = useCallback(() => {
|
@@ -157,7 +169,7 @@ const StoryWithModal = ({ timeout }: StoryWithModalProps) => {
|
|
157
169
|
}, [count]);
|
158
170
|
|
159
171
|
return (
|
160
|
-
<NotificationsProvider>
|
172
|
+
<NotificationsProvider placement={placement}>
|
161
173
|
<PopupProvider>
|
162
174
|
<Button text="Open modal" onClick={() => setIsModalOpen(true)} />
|
163
175
|
<Modal frame="theme-root" opened={isModalOpen} onClose={() => setIsModalOpen(false)}>
|
@@ -172,6 +184,15 @@ const StoryWithModal = ({ timeout }: StoryWithModalProps) => {
|
|
172
184
|
export const WithModal: StoryObj<StoryLiveDemoProps> = {
|
173
185
|
args: {
|
174
186
|
timeout: 3500,
|
187
|
+
placement: 'bottom-right',
|
188
|
+
},
|
189
|
+
argTypes: {
|
190
|
+
placement: {
|
191
|
+
options: notificationsPlacements,
|
192
|
+
control: {
|
193
|
+
type: 'select',
|
194
|
+
},
|
195
|
+
},
|
175
196
|
},
|
176
197
|
render: (args) => <StoryWithModal {...args} />,
|
177
198
|
};
|
@@ -16,14 +16,16 @@ var _engines = /*#__PURE__*/require("../../../../engines");
|
|
16
16
|
var _Notification2 = /*#__PURE__*/require("./Notification.config");
|
17
17
|
var _Modal = /*#__PURE__*/require("../../../../components/Modal");
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
19
|
-
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Notification.
|
19
|
+
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Notification.notificationConfig, _Notification2.config);
|
20
20
|
var Notification = exports.Notification = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
21
21
|
var NotificationsProvider = exports.NotificationsProvider = function NotificationsProvider(_ref) {
|
22
22
|
var children = _ref.children,
|
23
23
|
_ref$frame = _ref.frame,
|
24
|
-
frame = _ref$frame === void 0 ? 'theme-root' : _ref$frame
|
24
|
+
frame = _ref$frame === void 0 ? 'theme-root' : _ref$frame,
|
25
|
+
placement = _ref.placement;
|
25
26
|
return /*#__PURE__*/_react["default"].createElement(_Notification.NotificationsProvider, {
|
26
27
|
config: mergedConfig,
|
27
|
-
frame: frame
|
28
|
+
frame: frame,
|
29
|
+
placement: placement
|
28
30
|
}, children);
|
29
31
|
};
|
@@ -5,6 +5,7 @@ import type { StoryObj, Meta } from '@storybook/react';
|
|
5
5
|
import { Button } from '../Button/Button';
|
6
6
|
import { Modal } from '../Modal/Modal';
|
7
7
|
import {
|
8
|
+
NotificationPlacement,
|
8
9
|
NotificationIconPlacement,
|
9
10
|
NotificationLayout,
|
10
11
|
addNotification,
|
@@ -20,6 +21,7 @@ const titles = ['Выполнено', 'Внимание', 'Ошибка'];
|
|
20
21
|
const texts = ['SSH ключ успешно скопирован', 'Нельзя скопировать SSH ключ', 'Не удалось скопировать SSH ключ'];
|
21
22
|
const size = ['xs', 'xxs'];
|
22
23
|
const iconPlacement = ['top', 'left'];
|
24
|
+
const notificationsPlacements = ['bottom-right', 'bottom-left'];
|
23
25
|
|
24
26
|
const longText = `JavaScript frameworks are an essential part of modern front-end web development,
|
25
27
|
providing developers with proven tools for building scalable, interactive web applications.
|
@@ -49,6 +51,7 @@ interface StoryDefaultProps {
|
|
49
51
|
layout: NotificationLayout;
|
50
52
|
size: 'xs' | 'xxs';
|
51
53
|
iconPlacement: NotificationIconPlacement;
|
54
|
+
placement?: NotificationPlacement;
|
52
55
|
}
|
53
56
|
|
54
57
|
const StoryDefault = ({ title, children, iconPlacement, size, layout, showLeftIcon, ...rest }: StoryDefaultProps) => {
|
@@ -111,9 +114,10 @@ type StoryLiveDemoProps = ComponentProps<typeof Notification> & {
|
|
111
114
|
layout: NotificationLayout;
|
112
115
|
size: 'xs' | 'xxs';
|
113
116
|
iconPlacement: NotificationIconPlacement;
|
117
|
+
placement?: NotificationPlacement;
|
114
118
|
};
|
115
119
|
|
116
|
-
const StoryLiveDemo = ({ timeout, ...rest }: StoryLiveDemoProps) => {
|
120
|
+
const StoryLiveDemo = ({ timeout, placement, ...rest }: StoryLiveDemoProps) => {
|
117
121
|
const count = useRef(0);
|
118
122
|
const handleClick = useCallback(() => {
|
119
123
|
addNotification({ icon: <IconDisclosureRight />, ...rest, ...getNotificationProps(count.current) }, timeout);
|
@@ -121,7 +125,7 @@ const StoryLiveDemo = ({ timeout, ...rest }: StoryLiveDemoProps) => {
|
|
121
125
|
}, [count, rest]);
|
122
126
|
|
123
127
|
return (
|
124
|
-
<NotificationsProvider>
|
128
|
+
<NotificationsProvider placement={placement}>
|
125
129
|
<Button text="Добавить уведомление" onClick={handleClick} />
|
126
130
|
</NotificationsProvider>
|
127
131
|
);
|
@@ -135,20 +139,28 @@ export const LiveDemo: StoryObj<StoryLiveDemoProps> = {
|
|
135
139
|
type: 'select',
|
136
140
|
},
|
137
141
|
},
|
142
|
+
placement: {
|
143
|
+
options: notificationsPlacements,
|
144
|
+
control: {
|
145
|
+
type: 'select',
|
146
|
+
},
|
147
|
+
},
|
138
148
|
},
|
139
149
|
args: {
|
140
150
|
timeout: 3000,
|
141
151
|
role: 'alert',
|
142
152
|
layout: 'vertical',
|
153
|
+
placement: 'bottom-right',
|
143
154
|
},
|
144
155
|
render: (args) => <StoryLiveDemo {...args} />,
|
145
156
|
};
|
146
157
|
|
147
158
|
type StoryWithModalProps = ComponentProps<typeof Notification> & {
|
148
159
|
timeout: number;
|
160
|
+
placement?: NotificationPlacement;
|
149
161
|
};
|
150
162
|
|
151
|
-
const StoryWithModal = ({ timeout }: StoryWithModalProps) => {
|
163
|
+
const StoryWithModal = ({ timeout, placement }: StoryWithModalProps) => {
|
152
164
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
153
165
|
const count = useRef(0);
|
154
166
|
const handleClick = useCallback(() => {
|
@@ -157,7 +169,7 @@ const StoryWithModal = ({ timeout }: StoryWithModalProps) => {
|
|
157
169
|
}, [count]);
|
158
170
|
|
159
171
|
return (
|
160
|
-
<NotificationsProvider>
|
172
|
+
<NotificationsProvider placement={placement}>
|
161
173
|
<PopupProvider>
|
162
174
|
<Button text="Open modal" onClick={() => setIsModalOpen(true)} />
|
163
175
|
<Modal frame="theme-root" opened={isModalOpen} onClose={() => setIsModalOpen(false)}>
|
@@ -172,6 +184,15 @@ const StoryWithModal = ({ timeout }: StoryWithModalProps) => {
|
|
172
184
|
export const WithModal: StoryObj<StoryLiveDemoProps> = {
|
173
185
|
args: {
|
174
186
|
timeout: 3500,
|
187
|
+
placement: 'bottom-right',
|
188
|
+
},
|
189
|
+
argTypes: {
|
190
|
+
placement: {
|
191
|
+
options: notificationsPlacements,
|
192
|
+
control: {
|
193
|
+
type: 'select',
|
194
|
+
},
|
195
|
+
},
|
175
196
|
},
|
176
197
|
render: (args) => <StoryWithModal {...args} />,
|
177
198
|
};
|