@salutejs/plasma-new-hope 0.176.1-canary.1517.11571952534.0 → 0.177.0-canary.1503.11571511639.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. package/cjs/components/Notification/Notification.css +11 -11
  2. package/cjs/components/Notification/Notification.js +2 -2
  3. package/cjs/components/Notification/Notification.js.map +1 -1
  4. package/cjs/components/Notification/Notification.styles.js +11 -2
  5. package/cjs/components/Notification/Notification.styles.js.map +1 -1
  6. package/cjs/components/Notification/{Notification.styles_7h8hp0.css → Notification.styles_e6274r.css} +2 -2
  7. package/cjs/components/Notification/Notification.tokens.js +2 -1
  8. package/cjs/components/Notification/Notification.tokens.js.map +1 -1
  9. package/cjs/components/Notification/Notification.types.js.map +1 -1
  10. package/cjs/components/Notification/NotificationsPortal.js +8 -4
  11. package/cjs/components/Notification/NotificationsPortal.js.map +1 -1
  12. package/cjs/components/Notification/NotificationsProvider.css +11 -11
  13. package/cjs/components/Notification/NotificationsProvider.js +3 -1
  14. package/cjs/components/Notification/NotificationsProvider.js.map +1 -1
  15. package/cjs/components/Steps/Steps.css +9 -9
  16. package/cjs/components/Steps/Steps.tokens.js +0 -1
  17. package/cjs/components/Steps/Steps.tokens.js.map +1 -1
  18. package/cjs/components/Steps/ui/StepItem/StepItem.css +9 -9
  19. package/cjs/components/Steps/ui/StepItem/StepItem.js +7 -29
  20. package/cjs/components/Steps/ui/StepItem/StepItem.js.map +1 -1
  21. package/cjs/components/Steps/ui/StepItem/StepItem.styles.js +6 -6
  22. package/cjs/components/Steps/ui/StepItem/StepItem.styles.js.map +1 -1
  23. package/cjs/components/Steps/ui/StepItem/StepItem.styles_sp9rcd.css +9 -0
  24. package/cjs/index.css +20 -20
  25. package/cjs/index.js +1 -1
  26. package/emotion/cjs/components/Notification/Notification.js +2 -2
  27. package/emotion/cjs/components/Notification/Notification.styles.js +14 -19
  28. package/emotion/cjs/components/Notification/Notification.template-doc.mdx +17 -8
  29. package/emotion/cjs/components/Notification/Notification.tokens.js +2 -1
  30. package/emotion/cjs/components/Notification/NotificationsPortal.js +9 -5
  31. package/emotion/cjs/components/Notification/NotificationsProvider.js +3 -1
  32. package/emotion/cjs/components/Notification/index.js +4 -4
  33. package/emotion/cjs/components/Steps/Steps.tokens.js +0 -1
  34. package/emotion/cjs/components/Steps/ui/StepItem/StepItem.js +7 -29
  35. package/emotion/cjs/components/Steps/ui/StepItem/StepItem.styles.js +11 -17
  36. package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.js +5 -3
  37. package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  38. package/emotion/cjs/examples/plasma_b2c/components/Steps/Steps.config.js +5 -5
  39. package/emotion/cjs/examples/plasma_b2c/components/Steps/Steps.stories.tsx +1 -1
  40. package/emotion/cjs/examples/plasma_web/components/Notification/Notification.js +5 -3
  41. package/emotion/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
  42. package/emotion/cjs/examples/plasma_web/components/Steps/Steps.config.js +5 -5
  43. package/emotion/cjs/examples/plasma_web/components/Steps/Steps.stories.tsx +1 -1
  44. package/emotion/es/components/Notification/Notification.js +1 -1
  45. package/emotion/es/components/Notification/Notification.styles.js +14 -19
  46. package/emotion/es/components/Notification/Notification.template-doc.mdx +17 -8
  47. package/emotion/es/components/Notification/Notification.tokens.js +2 -1
  48. package/emotion/es/components/Notification/NotificationsPortal.js +9 -5
  49. package/emotion/es/components/Notification/NotificationsProvider.js +3 -1
  50. package/emotion/es/components/Notification/index.js +1 -1
  51. package/emotion/es/components/Steps/Steps.tokens.js +0 -1
  52. package/emotion/es/components/Steps/ui/StepItem/StepItem.js +7 -29
  53. package/emotion/es/components/Steps/ui/StepItem/StepItem.styles.js +11 -17
  54. package/emotion/es/examples/plasma_b2c/components/Notification/Notification.js +6 -4
  55. package/emotion/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  56. package/emotion/es/examples/plasma_b2c/components/Steps/Steps.config.js +5 -5
  57. package/emotion/es/examples/plasma_b2c/components/Steps/Steps.stories.tsx +1 -1
  58. package/emotion/es/examples/plasma_web/components/Notification/Notification.js +6 -4
  59. package/emotion/es/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
  60. package/emotion/es/examples/plasma_web/components/Steps/Steps.config.js +5 -5
  61. package/emotion/es/examples/plasma_web/components/Steps/Steps.stories.tsx +1 -1
  62. package/es/components/Notification/Notification.css +11 -11
  63. package/es/components/Notification/Notification.js +2 -2
  64. package/es/components/Notification/Notification.js.map +1 -1
  65. package/es/components/Notification/Notification.styles.js +11 -2
  66. package/es/components/Notification/Notification.styles.js.map +1 -1
  67. package/es/components/Notification/{Notification.styles_7h8hp0.css → Notification.styles_e6274r.css} +2 -2
  68. package/es/components/Notification/Notification.tokens.js +2 -1
  69. package/es/components/Notification/Notification.tokens.js.map +1 -1
  70. package/es/components/Notification/Notification.types.js.map +1 -1
  71. package/es/components/Notification/NotificationsPortal.js +8 -4
  72. package/es/components/Notification/NotificationsPortal.js.map +1 -1
  73. package/es/components/Notification/NotificationsProvider.css +11 -11
  74. package/es/components/Notification/NotificationsProvider.js +3 -1
  75. package/es/components/Notification/NotificationsProvider.js.map +1 -1
  76. package/es/components/Steps/Steps.css +9 -9
  77. package/es/components/Steps/Steps.tokens.js +0 -1
  78. package/es/components/Steps/Steps.tokens.js.map +1 -1
  79. package/es/components/Steps/ui/StepItem/StepItem.css +9 -9
  80. package/es/components/Steps/ui/StepItem/StepItem.js +8 -30
  81. package/es/components/Steps/ui/StepItem/StepItem.js.map +1 -1
  82. package/es/components/Steps/ui/StepItem/StepItem.styles.js +6 -6
  83. package/es/components/Steps/ui/StepItem/StepItem.styles.js.map +1 -1
  84. package/es/components/Steps/ui/StepItem/StepItem.styles_sp9rcd.css +9 -0
  85. package/es/index.css +20 -20
  86. package/es/index.js +1 -1
  87. package/package.json +2 -2
  88. package/styled-components/cjs/components/Notification/Notification.js +2 -2
  89. package/styled-components/cjs/components/Notification/Notification.styles.js +5 -2
  90. package/styled-components/cjs/components/Notification/Notification.template-doc.mdx +17 -8
  91. package/styled-components/cjs/components/Notification/Notification.tokens.js +2 -1
  92. package/styled-components/cjs/components/Notification/NotificationsPortal.js +8 -4
  93. package/styled-components/cjs/components/Notification/NotificationsProvider.js +3 -1
  94. package/styled-components/cjs/components/Notification/index.js +4 -4
  95. package/styled-components/cjs/components/Steps/Steps.tokens.js +0 -1
  96. package/styled-components/cjs/components/Steps/ui/StepItem/StepItem.js +7 -29
  97. package/styled-components/cjs/components/Steps/ui/StepItem/StepItem.styles.js +6 -12
  98. package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.js +5 -3
  99. package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  100. package/styled-components/cjs/examples/plasma_b2c/components/Steps/Steps.config.js +1 -1
  101. package/styled-components/cjs/examples/plasma_b2c/components/Steps/Steps.stories.tsx +1 -1
  102. package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.js +5 -3
  103. package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
  104. package/styled-components/cjs/examples/plasma_web/components/Steps/Steps.config.js +1 -1
  105. package/styled-components/cjs/examples/plasma_web/components/Steps/Steps.stories.tsx +1 -1
  106. package/styled-components/es/components/Notification/Notification.js +1 -1
  107. package/styled-components/es/components/Notification/Notification.styles.js +5 -2
  108. package/styled-components/es/components/Notification/Notification.template-doc.mdx +17 -8
  109. package/styled-components/es/components/Notification/Notification.tokens.js +2 -1
  110. package/styled-components/es/components/Notification/NotificationsPortal.js +8 -4
  111. package/styled-components/es/components/Notification/NotificationsProvider.js +3 -1
  112. package/styled-components/es/components/Notification/index.js +1 -1
  113. package/styled-components/es/components/Steps/Steps.tokens.js +0 -1
  114. package/styled-components/es/components/Steps/ui/StepItem/StepItem.js +7 -29
  115. package/styled-components/es/components/Steps/ui/StepItem/StepItem.styles.js +6 -12
  116. package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.js +6 -4
  117. package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  118. package/styled-components/es/examples/plasma_b2c/components/Steps/Steps.config.js +1 -1
  119. package/styled-components/es/examples/plasma_b2c/components/Steps/Steps.stories.tsx +1 -1
  120. package/styled-components/es/examples/plasma_web/components/Notification/Notification.js +6 -4
  121. package/styled-components/es/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
  122. package/styled-components/es/examples/plasma_web/components/Steps/Steps.config.js +1 -1
  123. package/styled-components/es/examples/plasma_web/components/Steps/Steps.stories.tsx +1 -1
  124. package/types/components/Notification/Notification.d.ts +3 -3
  125. package/types/components/Notification/Notification.d.ts.map +1 -1
  126. package/types/components/Notification/Notification.styles.d.ts +4 -2
  127. package/types/components/Notification/Notification.styles.d.ts.map +1 -1
  128. package/types/components/Notification/Notification.tokens.d.ts +1 -0
  129. package/types/components/Notification/Notification.tokens.d.ts.map +1 -1
  130. package/types/components/Notification/Notification.types.d.ts +11 -5
  131. package/types/components/Notification/Notification.types.d.ts.map +1 -1
  132. package/types/components/Notification/NotificationsPortal.d.ts.map +1 -1
  133. package/types/components/Notification/NotificationsProvider.d.ts +4 -3
  134. package/types/components/Notification/NotificationsProvider.d.ts.map +1 -1
  135. package/types/components/Notification/index.d.ts +2 -2
  136. package/types/components/Notification/index.d.ts.map +1 -1
  137. package/types/components/Steps/Steps.tokens.d.ts +0 -1
  138. package/types/components/Steps/Steps.tokens.d.ts.map +1 -1
  139. package/types/components/Steps/ui/StepItem/StepItem.d.ts.map +1 -1
  140. package/types/components/Steps/ui/StepItem/StepItem.styles.d.ts +2 -2
  141. package/types/components/Steps/ui/StepItem/StepItem.styles.d.ts.map +1 -1
  142. package/types/examples/plasma_b2c/components/Notification/Notification.d.ts +4 -2
  143. package/types/examples/plasma_b2c/components/Notification/Notification.d.ts.map +1 -1
  144. package/types/examples/plasma_b2c/components/Steps/Steps.config.d.ts.map +1 -1
  145. package/types/examples/plasma_web/components/Notification/Notification.d.ts +4 -13
  146. package/types/examples/plasma_web/components/Notification/Notification.d.ts.map +1 -1
  147. package/types/examples/plasma_web/components/Steps/Steps.config.d.ts.map +1 -1
  148. package/cjs/components/Steps/ui/StepItem/StepItem.styles_1oh5gqm.css +0 -9
  149. package/es/components/Steps/ui/StepItem/StepItem.styles_1oh5gqm.css +0 -9
@@ -1,16 +1,18 @@
1
1
  import React from 'react';
2
- import { noticationConfig, NotificationsProvider as Provider } from '../../../../components/Notification';
2
+ import { notificationConfig, NotificationsProvider as Provider } from '../../../../components/Notification';
3
3
  import { component, mergeConfig } from '../../../../engines';
4
4
  import { config } from './Notification.config';
5
5
  export { modalClasses } from '../../../../components/Modal';
6
- var mergedConfig = /*#__PURE__*/mergeConfig(noticationConfig, config);
6
+ var mergedConfig = /*#__PURE__*/mergeConfig(notificationConfig, config);
7
7
  export var Notification = /*#__PURE__*/component(mergedConfig);
8
8
  export var NotificationsProvider = function NotificationsProvider(_ref) {
9
9
  var children = _ref.children,
10
10
  _ref$frame = _ref.frame,
11
- frame = _ref$frame === void 0 ? 'theme-root' : _ref$frame;
11
+ frame = _ref$frame === void 0 ? 'theme-root' : _ref$frame,
12
+ placement = _ref.placement;
12
13
  return /*#__PURE__*/React.createElement(Provider, {
13
14
  config: mergedConfig,
14
- frame: frame
15
+ frame: frame,
16
+ placement: placement
15
17
  }, children);
16
18
  };
@@ -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
  };