@salutejs/plasma-new-hope 0.175.3-canary.1512.11555735717.0 → 0.176.0-canary.1503.11559892364.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. package/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  2. package/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js.map +1 -1
  3. package/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  4. package/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js.map +1 -1
  5. package/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  6. package/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js.map +1 -1
  7. package/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  8. package/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js.map +1 -1
  9. package/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +2 -4
  10. package/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js.map +1 -1
  11. package/cjs/components/Notification/Notification.css +11 -11
  12. package/cjs/components/Notification/Notification.js +2 -2
  13. package/cjs/components/Notification/Notification.js.map +1 -1
  14. package/cjs/components/Notification/Notification.styles.js +11 -2
  15. package/cjs/components/Notification/Notification.styles.js.map +1 -1
  16. package/cjs/components/Notification/{Notification.styles_7h8hp0.css → Notification.styles_e6274r.css} +2 -2
  17. package/cjs/components/Notification/Notification.tokens.js +2 -1
  18. package/cjs/components/Notification/Notification.tokens.js.map +1 -1
  19. package/cjs/components/Notification/Notification.types.js.map +1 -1
  20. package/cjs/components/Notification/NotificationsPortal.js +8 -4
  21. package/cjs/components/Notification/NotificationsPortal.js.map +1 -1
  22. package/cjs/components/Notification/NotificationsProvider.css +11 -11
  23. package/cjs/components/Notification/NotificationsProvider.js +3 -1
  24. package/cjs/components/Notification/NotificationsProvider.js.map +1 -1
  25. package/cjs/components/Popover/Popover.js +1 -2
  26. package/cjs/components/Popover/Popover.js.map +1 -1
  27. package/cjs/index.css +11 -11
  28. package/cjs/index.js +1 -1
  29. package/cjs/utils/index.js.map +1 -1
  30. package/emotion/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  31. package/emotion/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  32. package/emotion/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  33. package/emotion/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  34. package/emotion/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +4 -6
  35. package/emotion/cjs/components/Notification/Notification.js +2 -2
  36. package/emotion/cjs/components/Notification/Notification.styles.js +14 -19
  37. package/emotion/cjs/components/Notification/Notification.template-doc.mdx +17 -8
  38. package/emotion/cjs/components/Notification/Notification.tokens.js +2 -1
  39. package/emotion/cjs/components/Notification/NotificationsPortal.js +9 -5
  40. package/emotion/cjs/components/Notification/NotificationsProvider.js +3 -1
  41. package/emotion/cjs/components/Notification/index.js +4 -4
  42. package/emotion/cjs/components/Popover/Popover.js +1 -2
  43. package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.js +5 -3
  44. package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  45. package/emotion/cjs/examples/plasma_web/components/Notification/Notification.js +5 -3
  46. package/emotion/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
  47. package/emotion/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  48. package/emotion/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  49. package/emotion/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  50. package/emotion/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  51. package/emotion/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +2 -4
  52. package/emotion/es/components/Notification/Notification.js +1 -1
  53. package/emotion/es/components/Notification/Notification.styles.js +14 -19
  54. package/emotion/es/components/Notification/Notification.template-doc.mdx +17 -8
  55. package/emotion/es/components/Notification/Notification.tokens.js +2 -1
  56. package/emotion/es/components/Notification/NotificationsPortal.js +9 -5
  57. package/emotion/es/components/Notification/NotificationsProvider.js +3 -1
  58. package/emotion/es/components/Notification/index.js +1 -1
  59. package/emotion/es/components/Popover/Popover.js +1 -2
  60. package/emotion/es/examples/plasma_b2c/components/Notification/Notification.js +6 -4
  61. package/emotion/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  62. package/emotion/es/examples/plasma_web/components/Notification/Notification.js +6 -4
  63. package/emotion/es/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
  64. package/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  65. package/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js.map +1 -1
  66. package/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  67. package/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js.map +1 -1
  68. package/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  69. package/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js.map +1 -1
  70. package/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  71. package/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js.map +1 -1
  72. package/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +2 -4
  73. package/es/components/Dropdown/ui/DropdownOld/DropdownOld.js.map +1 -1
  74. package/es/components/Notification/Notification.css +11 -11
  75. package/es/components/Notification/Notification.js +2 -2
  76. package/es/components/Notification/Notification.js.map +1 -1
  77. package/es/components/Notification/Notification.styles.js +11 -2
  78. package/es/components/Notification/Notification.styles.js.map +1 -1
  79. package/es/components/Notification/{Notification.styles_7h8hp0.css → Notification.styles_e6274r.css} +2 -2
  80. package/es/components/Notification/Notification.tokens.js +2 -1
  81. package/es/components/Notification/Notification.tokens.js.map +1 -1
  82. package/es/components/Notification/Notification.types.js.map +1 -1
  83. package/es/components/Notification/NotificationsPortal.js +8 -4
  84. package/es/components/Notification/NotificationsPortal.js.map +1 -1
  85. package/es/components/Notification/NotificationsProvider.css +11 -11
  86. package/es/components/Notification/NotificationsProvider.js +3 -1
  87. package/es/components/Notification/NotificationsProvider.js.map +1 -1
  88. package/es/components/Popover/Popover.js +1 -2
  89. package/es/components/Popover/Popover.js.map +1 -1
  90. package/es/index.css +11 -11
  91. package/es/index.js +1 -1
  92. package/es/utils/index.js.map +1 -1
  93. package/package.json +2 -2
  94. package/styled-components/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  95. package/styled-components/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  96. package/styled-components/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  97. package/styled-components/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  98. package/styled-components/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +4 -6
  99. package/styled-components/cjs/components/Notification/Notification.js +2 -2
  100. package/styled-components/cjs/components/Notification/Notification.styles.js +5 -2
  101. package/styled-components/cjs/components/Notification/Notification.template-doc.mdx +17 -8
  102. package/styled-components/cjs/components/Notification/Notification.tokens.js +2 -1
  103. package/styled-components/cjs/components/Notification/NotificationsPortal.js +8 -4
  104. package/styled-components/cjs/components/Notification/NotificationsProvider.js +3 -1
  105. package/styled-components/cjs/components/Notification/index.js +4 -4
  106. package/styled-components/cjs/components/Popover/Popover.js +1 -2
  107. package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.js +5 -3
  108. package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  109. package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.js +5 -3
  110. package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
  111. package/styled-components/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  112. package/styled-components/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  113. package/styled-components/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  114. package/styled-components/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  115. package/styled-components/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +2 -4
  116. package/styled-components/es/components/Notification/Notification.js +1 -1
  117. package/styled-components/es/components/Notification/Notification.styles.js +5 -2
  118. package/styled-components/es/components/Notification/Notification.template-doc.mdx +17 -8
  119. package/styled-components/es/components/Notification/Notification.tokens.js +2 -1
  120. package/styled-components/es/components/Notification/NotificationsPortal.js +8 -4
  121. package/styled-components/es/components/Notification/NotificationsProvider.js +3 -1
  122. package/styled-components/es/components/Notification/index.js +1 -1
  123. package/styled-components/es/components/Popover/Popover.js +1 -2
  124. package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.js +6 -4
  125. package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  126. package/styled-components/es/examples/plasma_web/components/Notification/Notification.js +6 -4
  127. package/styled-components/es/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
  128. package/types/components/Dropdown/ui/DropdownDivider/DropdownDivider.d.ts.map +1 -1
  129. package/types/components/Dropdown/ui/DropdownFooter/DropdownFooter.d.ts.map +1 -1
  130. package/types/components/Dropdown/ui/DropdownGroup/DropdownGroup.d.ts.map +1 -1
  131. package/types/components/Dropdown/ui/DropdownHeader/DropdownHeader.d.ts.map +1 -1
  132. package/types/components/Dropdown/ui/DropdownOld/DropdownOld.d.ts.map +1 -1
  133. package/types/components/Notification/Notification.d.ts +3 -3
  134. package/types/components/Notification/Notification.d.ts.map +1 -1
  135. package/types/components/Notification/Notification.styles.d.ts +4 -2
  136. package/types/components/Notification/Notification.styles.d.ts.map +1 -1
  137. package/types/components/Notification/Notification.tokens.d.ts +1 -0
  138. package/types/components/Notification/Notification.tokens.d.ts.map +1 -1
  139. package/types/components/Notification/Notification.types.d.ts +11 -5
  140. package/types/components/Notification/Notification.types.d.ts.map +1 -1
  141. package/types/components/Notification/NotificationsPortal.d.ts.map +1 -1
  142. package/types/components/Notification/NotificationsProvider.d.ts +4 -3
  143. package/types/components/Notification/NotificationsProvider.d.ts.map +1 -1
  144. package/types/components/Notification/index.d.ts +2 -2
  145. package/types/components/Notification/index.d.ts.map +1 -1
  146. package/types/components/Popover/Popover.d.ts.map +1 -1
  147. package/types/examples/plasma_b2c/components/Notification/Notification.d.ts +4 -2
  148. package/types/examples/plasma_b2c/components/Notification/Notification.d.ts.map +1 -1
  149. package/types/examples/plasma_web/components/Notification/Notification.d.ts +4 -13
  150. package/types/examples/plasma_web/components/Notification/Notification.d.ts.map +1 -1
  151. package/types/utils/index.d.ts +1 -1
  152. package/types/utils/index.d.ts.map +1 -1
@@ -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.noticationConfig, _Notification2.config);
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
  };
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
5
  import React, { forwardRef } from 'react';
6
- import { safeUseId } from '../../../../utils';
6
+ import { useUniqId } from '@salutejs/plasma-core';
7
7
  import { base as viewCSS } from './variations/_view/base';
8
8
  import { base as sizeCSS } from './variations/_size/base';
9
9
  import { StyledDropdownDivider } from './DropdownDivider.styles';
@@ -17,7 +17,7 @@ export var dropdownDividerRoot = function dropdownDividerRoot(Root) {
17
17
  view = _ref.view,
18
18
  size = _ref.size,
19
19
  rest = _objectWithoutProperties(_ref, _excluded);
20
- var uniqId = safeUseId();
20
+ var uniqId = useUniqId();
21
21
  var innerId = id || uniqId;
22
22
  return /*#__PURE__*/React.createElement(Root, {
23
23
  id: innerId,
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
5
  import React, { forwardRef } from 'react';
6
- import { safeUseId } from '../../../../utils';
6
+ import { useUniqId } from '@salutejs/plasma-core';
7
7
  import { base as viewCSS } from './variations/_view/base';
8
8
  import { base as sizeCSS } from './variations/_size/base';
9
9
  import { StyledDropdownFooter } from './DropdownFooter.styles';
@@ -18,7 +18,7 @@ export var dropdownFooterRoot = function dropdownFooterRoot(Root) {
18
18
  view = _ref.view,
19
19
  size = _ref.size,
20
20
  rest = _objectWithoutProperties(_ref, _excluded);
21
- var uniqId = safeUseId();
21
+ var uniqId = useUniqId();
22
22
  var innerId = id || uniqId;
23
23
  return /*#__PURE__*/React.createElement(Root, {
24
24
  id: innerId,
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
5
  import React, { forwardRef } from 'react';
6
- import { safeUseId } from '../../../../utils';
6
+ import { useUniqId } from '@salutejs/plasma-core';
7
7
  import { base as viewCSS } from './variations/_view/base';
8
8
  import { base as sizeCSS } from './variations/_size/base';
9
9
  import { StyledDropdownGroup, StyledDropdownLabel } from './DropdownGroup.styles';
@@ -21,7 +21,7 @@ export var dropdownGroupRoot = function dropdownGroupRoot(Root) {
21
21
  view = _ref.view,
22
22
  size = _ref.size,
23
23
  rest = _objectWithoutProperties(_ref, _excluded);
24
- var uniqId = safeUseId();
24
+ var uniqId = useUniqId();
25
25
  var innerId = id || uniqId;
26
26
  return /*#__PURE__*/React.createElement(Root, {
27
27
  id: innerId,
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
5
  import React, { forwardRef } from 'react';
6
- import { safeUseId } from '../../../../utils';
6
+ import { useUniqId } from '@salutejs/plasma-core';
7
7
  import { base as viewCSS } from './variations/_view/base';
8
8
  import { base as sizeCSS } from './variations/_size/base';
9
9
  import { StyledDropdownHeader } from './DropdownHeader.styles';
@@ -18,7 +18,7 @@ export var dropdownHeaderRoot = function dropdownHeaderRoot(Root) {
18
18
  size = _ref.size,
19
19
  children = _ref.children,
20
20
  rest = _objectWithoutProperties(_ref, _excluded);
21
- var uniqId = safeUseId();
21
+ var uniqId = useUniqId();
22
22
  var innerId = id || uniqId;
23
23
  return /*#__PURE__*/React.createElement(Root, {
24
24
  id: innerId,
@@ -3,9 +3,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
5
  import React, { forwardRef, useRef } from 'react';
6
- import { useForkRef } from '@salutejs/plasma-core';
7
- import { useFocusTrap } from '../../../../hooks';
8
- import { safeUseId } from '../../../../utils';
6
+ import { useFocusTrap, useForkRef, useUniqId } from '@salutejs/plasma-core';
9
7
  import { base as viewCSS } from './variations/_view/base';
10
8
  import { base as sizeCSS } from './variations/_size/base';
11
9
  import { StyledDropdown, StyledPopover } from './Dropdown.styles';
@@ -44,7 +42,7 @@ export var dropdownOldRoot = function dropdownOldRoot(Root) {
44
42
  closeOnEsc = _ref$closeOnEsc === void 0 ? false : _ref$closeOnEsc,
45
43
  rest = _objectWithoutProperties(_ref, _excluded);
46
44
  var innerIsOpen = Boolean(isOpen || opened);
47
- var uniqId = safeUseId();
45
+ var uniqId = useUniqId();
48
46
  var innerId = id || uniqId;
49
47
  var rootRef = useRef(null);
50
48
  var dropdownRef = useRef(null);
@@ -86,7 +86,7 @@ export var notificationRoot = function notificationRoot(Root) {
86
86
  })))));
87
87
  });
88
88
  };
89
- export var noticationConfig = {
89
+ export var notificationConfig = {
90
90
  name: 'Notification',
91
91
  tag: 'div',
92
92
  layout: notificationRoot,
@@ -58,7 +58,10 @@ export var StyledContent = /*#__PURE__*/styled.div.withConfig({
58
58
  })(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");", ";color:var(", ");"], tokens.contentFontFamily, tokens.contentFontSize, tokens.contentFontStyle, tokens.contentFontWeight, tokens.contentFontLetterSpacing, tokens.contentFontLineHeight, /*#__PURE__*/String(applyHyphens), tokens.contentColor);
59
59
  export var StyledItemWrapper = /*#__PURE__*/styled.div.withConfig({
60
60
  componentId: "plasma-new-hope__sc-1iufy9r-8"
61
- })(["margin-top:1rem;opacity:1;&&.", "{animation:0.4s showAnimation ease-out;}&&.", "{animation:0.4s hideAnimation ease-out;}@keyframes showAnimation{0%{transform:translateX(100%);opacity:0;}100%{transform:translateX(0);opacity:1;}}@keyframes hideAnimation{0%{transform:translateX(0);opacity:1;}100%{transform:translateX(100%);opacity:0;}}"], classes.notificationItemOpened, classes.notificationItemHidden);
61
+ })(["margin-top:1rem;opacity:1;&&.", "{animation:0.4s showAnimation ease-out;&.", "{animation:0.4s showLeftToRightAnimation ease-out;}}&&.", "{animation:0.4s hideAnimation ease-out;&.", "{animation:0.4s hideLeftToRightAnimation ease-out;}}@keyframes showLeftToRightAnimation{0%{transform:translateX(-100%);opacity:0;}100%{transform:translateX(0);opacity:1;}}@keyframes hideLeftToRightAnimation{0%{transform:translateX(0);opacity:1;}100%{transform:translateX(-100%);opacity:0;}}@keyframes showAnimation{0%{transform:translateX(100%);opacity:0;}100%{transform:translateX(0);opacity:1;}}@keyframes hideAnimation{0%{transform:translateX(0);opacity:1;}100%{transform:translateX(100%);opacity:0;}}"], classes.notificationItemOpened, classes.notificationLeftToRightAnimation, classes.notificationItemHidden, classes.notificationLeftToRightAnimation);
62
62
  export var StyledRoot = /*#__PURE__*/styled.div.withConfig({
63
63
  componentId: "plasma-new-hope__sc-1iufy9r-9"
64
- })(["display:flex;flex-direction:column-reverse;box-sizing:border-box;padding:0 1.5rem 1.5rem;max-height:100%;align-items:flex-end;"]);
64
+ })(["display:flex;flex-direction:column-reverse;box-sizing:border-box;padding:0 1.5rem 1.5rem;max-height:100%;align-items:", ";"], function (_ref8) {
65
+ var placement = _ref8.placement;
66
+ return placement === 'bottom-left' ? 'flex-start' : 'flex-end';
67
+ });
@@ -10,14 +10,15 @@ import { PropsTable, Description } from '@site/src/components';
10
10
  <PropsTable name="Notification" />
11
11
 
12
12
  ## Использование
13
- Компонент `Notification` может использоваться для создания собственных систем оповещения.
13
+ Компонент `Notification` может использоваться для создания собственных систем оповещения.
14
14
  Вид компонента контролируется свойствами (props).
15
- Текстовая часть оповещения состоит из `title` и `children`.
15
+ Текстовая часть оповещения состоит из `title` и `children`.
16
16
  Слева или сверху от нее, также можно пробросить иконку через свойство `icon`.
17
17
  Также есть часть `actions`, в которой предполагается отображение кнопок для взаимодействия.
18
18
 
19
19
  ### Провайдер контекста
20
- Поместите `NotificationsProvider` в [корень приложения](../../#корень-приложения) или там, где будете применять модальные окна:
20
+ Поместите `NotificationsProvider` в [корень приложения](../../#корень-приложения) или там, где будете применять модальные окна.
21
+ В качестве свойств можно указать контейнер для оповещений через `frame` и расположение в контейнере через свойство `placement`, как `bottom-right` _(по умолчанию)_ или `bottom-left`.
21
22
 
22
23
  ```tsx title="index.ts"
23
24
  import ReactDOM from 'react-dom';
@@ -34,24 +35,32 @@ ReactDOM.render(
34
35
  ```
35
36
 
36
37
  ### Вызов уведомления
37
- После подключения `NotificationsProvider` станет возможен вызов функции `addNotification`,который приведет к отображению оповещения.
38
- Функция принимает значения свойств компонента `Notification`:
38
+ После подключения `NotificationsProvider` станет возможен вызов функции `addNotification`, который приведет к отображению оповещения.
39
+ Функция принимает значения свойств компонента `Notification`, включая необязательное поле `id`. И возвращает сгенерированный или переданный `id`, по которому можно закрыть оповещение через вызов `closeNotification`.
39
40
 
40
41
  ```tsx live
41
42
  import React from 'react';
42
- import { Button, addNotification, NotificationsProvider } from '@salutejs/{{ package }}';
43
+ import { Button, ButtonGroup, addNotification, closeNotification, NotificationsProvider } from '@salutejs/{{ package }}';
43
44
 
44
45
  export function App() {
45
- const handleClick = React.useCallback(() => {
46
+ const handleShow = React.useCallback(() => {
46
47
  addNotification({
48
+ id: 'incoming-call',
47
49
  title: 'Входящий вызов',
48
50
  children: 'Принять?',
49
51
  }, 1000);
50
52
  }, []);
51
53
 
54
+ const handleHide = React.useCallback(() => {
55
+ closeNotification('incoming-call');
56
+ }, []);
57
+
52
58
  return (
53
59
  <NotificationsProvider>
54
- <Button text="Показать оповещение" onClick={handleClick} />
60
+ <ButtonGroup>
61
+ <Button text="Показать оповещение" onClick={handleShow} />
62
+ <Button text="Скрыть оповещение" onClick={handleHide} />
63
+ </ButtonGroup>
55
64
  </NotificationsProvider>
56
65
  );
57
66
  }
@@ -13,7 +13,8 @@ export var classes = {
13
13
  withoutIcon: 'notification-without-icon',
14
14
  withoutCloseIcon: 'notification-without-close-icon',
15
15
  notificationItemOpened: 'notification-item-opened',
16
- notificationItemHidden: 'notification-item-hidden'
16
+ notificationItemHidden: 'notification-item-hidden',
17
+ notificationLeftToRightAnimation: 'notification-left-to-right-animation'
17
18
  };
18
19
  export var tokens = {
19
20
  background: '--plasma-notification-backgorund',
@@ -24,7 +24,9 @@ var StyledPopup = /*#__PURE__*/styled(Popup).withConfig({
24
24
  */
25
25
  export var NotificationsPortal = function NotificationsPortal(_ref) {
26
26
  var config = _ref.config,
27
- frame = _ref.frame;
27
+ frame = _ref.frame,
28
+ _ref$placement = _ref.placement,
29
+ placement = _ref$placement === void 0 ? 'bottom-right' : _ref$placement;
28
30
  var _useStoreon = useStoreon('notifications'),
29
31
  notifications = _useStoreon.notifications;
30
32
  var Notification = useMemo(function () {
@@ -33,15 +35,17 @@ export var NotificationsPortal = function NotificationsPortal(_ref) {
33
35
  return /*#__PURE__*/React.createElement(PopupProvider, null, notifications.length > 0 && /*#__PURE__*/React.createElement(StyledPopup, {
34
36
  opened: true,
35
37
  frame: frame,
36
- placement: "bottom-right",
38
+ placement: placement,
37
39
  zIndex: "9100"
38
- }, /*#__PURE__*/React.createElement(StyledRoot, null, notifications.map(function (_ref2) {
40
+ }, /*#__PURE__*/React.createElement(StyledRoot, {
41
+ placement: placement
42
+ }, notifications.map(function (_ref2) {
39
43
  var id = _ref2.id,
40
44
  isHidden = _ref2.isHidden,
41
45
  rest = _objectWithoutProperties(_ref2, _excluded);
42
46
  return /*#__PURE__*/React.createElement(StyledItemWrapper, {
43
47
  key: id,
44
- className: cx(isHidden ? classes.notificationItemHidden : classes.notificationItemOpened),
48
+ className: cx(isHidden ? classes.notificationItemHidden : classes.notificationItemOpened, placement === 'bottom-left' && classes.notificationLeftToRightAnimation),
45
49
  isHidden: isHidden || false
46
50
  }, /*#__PURE__*/React.createElement(Notification, _extends({
47
51
  key: id,
@@ -5,11 +5,13 @@ import { NotificationsPortal } from './NotificationsPortal';
5
5
  export var NotificationsProvider = function NotificationsProvider(_ref) {
6
6
  var children = _ref.children,
7
7
  config = _ref.config,
8
- frame = _ref.frame;
8
+ frame = _ref.frame,
9
+ placement = _ref.placement;
9
10
  return /*#__PURE__*/React.createElement(StoreContext.Provider, {
10
11
  value: NotificationsStore
11
12
  }, children, /*#__PURE__*/React.createElement(NotificationsPortal, {
12
13
  frame: frame,
14
+ placement: placement,
13
15
  config: config
14
16
  }));
15
17
  };
@@ -1,4 +1,4 @@
1
1
  export { NotificationsProvider } from './NotificationsProvider';
2
- export { notificationRoot, noticationConfig } from './Notification';
2
+ export { notificationRoot, notificationConfig } from './Notification';
3
3
  export { addNotification, closeNotification } from './NotificationsStore';
4
4
  export { classes as notificationClasses, tokens as notificationTokens } from './Notification.tokens';
@@ -16,8 +16,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
16
16
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
17
17
  import React, { useRef, useCallback, useEffect, useState, forwardRef } from 'react';
18
18
  import { usePopper } from 'react-popper';
19
- import { useForkRef } from '@salutejs/plasma-core';
20
- import { useFocusTrap } from '../../hooks';
19
+ import { useFocusTrap, useForkRef } from '@salutejs/plasma-core';
21
20
  import { cx } from '../../utils';
22
21
  import { Portal } from '../Portal';
23
22
  import { base as viewCSS } from './variations/_view/base';
@@ -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
  };
@@ -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
  };