@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.
Files changed (129) 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/Pagination/Pagination.css +12 -12
  16. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +12 -12
  17. package/cjs/components/Select/Select.css +12 -12
  18. package/cjs/components/Select/Select.tokens.js +2 -1
  19. package/cjs/components/Select/Select.tokens.js.map +1 -1
  20. package/cjs/components/Select/ui/Inner/Inner.css +12 -12
  21. package/cjs/components/Select/ui/Inner/ui/Item/Item.css +12 -12
  22. package/cjs/components/Select/ui/Target/Target.css +12 -12
  23. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.css +12 -12
  24. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
  25. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
  26. package/cjs/components/Select/ui/Target/ui/Textfield/{Textfield.styles_11yj58s.css → Textfield.styles_jzeap2.css} +1 -1
  27. package/cjs/index.css +23 -23
  28. package/cjs/index.js +1 -1
  29. package/emotion/cjs/components/Notification/Notification.js +2 -2
  30. package/emotion/cjs/components/Notification/Notification.styles.js +14 -19
  31. package/emotion/cjs/components/Notification/Notification.template-doc.mdx +17 -8
  32. package/emotion/cjs/components/Notification/Notification.tokens.js +2 -1
  33. package/emotion/cjs/components/Notification/NotificationsPortal.js +9 -5
  34. package/emotion/cjs/components/Notification/NotificationsProvider.js +3 -1
  35. package/emotion/cjs/components/Notification/index.js +4 -4
  36. package/emotion/cjs/components/Select/Select.tokens.js +2 -1
  37. package/emotion/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +12 -21
  38. package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.js +5 -3
  39. package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  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/es/components/Notification/Notification.js +1 -1
  43. package/emotion/es/components/Notification/Notification.styles.js +14 -19
  44. package/emotion/es/components/Notification/Notification.template-doc.mdx +17 -8
  45. package/emotion/es/components/Notification/Notification.tokens.js +2 -1
  46. package/emotion/es/components/Notification/NotificationsPortal.js +9 -5
  47. package/emotion/es/components/Notification/NotificationsProvider.js +3 -1
  48. package/emotion/es/components/Notification/index.js +1 -1
  49. package/emotion/es/components/Select/Select.tokens.js +2 -1
  50. package/emotion/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +12 -21
  51. package/emotion/es/examples/plasma_b2c/components/Notification/Notification.js +6 -4
  52. package/emotion/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  53. package/emotion/es/examples/plasma_web/components/Notification/Notification.js +6 -4
  54. package/emotion/es/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
  55. package/es/components/Notification/Notification.css +11 -11
  56. package/es/components/Notification/Notification.js +2 -2
  57. package/es/components/Notification/Notification.js.map +1 -1
  58. package/es/components/Notification/Notification.styles.js +11 -2
  59. package/es/components/Notification/Notification.styles.js.map +1 -1
  60. package/es/components/Notification/{Notification.styles_7h8hp0.css → Notification.styles_e6274r.css} +2 -2
  61. package/es/components/Notification/Notification.tokens.js +2 -1
  62. package/es/components/Notification/Notification.tokens.js.map +1 -1
  63. package/es/components/Notification/Notification.types.js.map +1 -1
  64. package/es/components/Notification/NotificationsPortal.js +8 -4
  65. package/es/components/Notification/NotificationsPortal.js.map +1 -1
  66. package/es/components/Notification/NotificationsProvider.css +11 -11
  67. package/es/components/Notification/NotificationsProvider.js +3 -1
  68. package/es/components/Notification/NotificationsProvider.js.map +1 -1
  69. package/es/components/Pagination/Pagination.css +12 -12
  70. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +12 -12
  71. package/es/components/Select/Select.css +12 -12
  72. package/es/components/Select/Select.tokens.js +2 -1
  73. package/es/components/Select/Select.tokens.js.map +1 -1
  74. package/es/components/Select/ui/Inner/Inner.css +12 -12
  75. package/es/components/Select/ui/Inner/ui/Item/Item.css +12 -12
  76. package/es/components/Select/ui/Target/Target.css +12 -12
  77. package/es/components/Select/ui/Target/ui/Textfield/Textfield.css +12 -12
  78. package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
  79. package/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js.map +1 -1
  80. package/es/components/Select/ui/Target/ui/Textfield/{Textfield.styles_11yj58s.css → Textfield.styles_jzeap2.css} +1 -1
  81. package/es/index.css +23 -23
  82. package/es/index.js +1 -1
  83. package/package.json +2 -2
  84. package/styled-components/cjs/components/Notification/Notification.js +2 -2
  85. package/styled-components/cjs/components/Notification/Notification.styles.js +5 -2
  86. package/styled-components/cjs/components/Notification/Notification.template-doc.mdx +17 -8
  87. package/styled-components/cjs/components/Notification/Notification.tokens.js +2 -1
  88. package/styled-components/cjs/components/Notification/NotificationsPortal.js +8 -4
  89. package/styled-components/cjs/components/Notification/NotificationsProvider.js +3 -1
  90. package/styled-components/cjs/components/Notification/index.js +4 -4
  91. package/styled-components/cjs/components/Select/Select.tokens.js +2 -1
  92. package/styled-components/cjs/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
  93. package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.js +5 -3
  94. package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  95. package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.js +5 -3
  96. package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
  97. package/styled-components/es/components/Notification/Notification.js +1 -1
  98. package/styled-components/es/components/Notification/Notification.styles.js +5 -2
  99. package/styled-components/es/components/Notification/Notification.template-doc.mdx +17 -8
  100. package/styled-components/es/components/Notification/Notification.tokens.js +2 -1
  101. package/styled-components/es/components/Notification/NotificationsPortal.js +8 -4
  102. package/styled-components/es/components/Notification/NotificationsProvider.js +3 -1
  103. package/styled-components/es/components/Notification/index.js +1 -1
  104. package/styled-components/es/components/Select/Select.tokens.js +2 -1
  105. package/styled-components/es/components/Select/ui/Target/ui/Textfield/Textfield.styles.js +1 -1
  106. package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.js +6 -4
  107. package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
  108. package/styled-components/es/examples/plasma_web/components/Notification/Notification.js +6 -4
  109. package/styled-components/es/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
  110. package/types/components/Notification/Notification.d.ts +3 -3
  111. package/types/components/Notification/Notification.d.ts.map +1 -1
  112. package/types/components/Notification/Notification.styles.d.ts +4 -2
  113. package/types/components/Notification/Notification.styles.d.ts.map +1 -1
  114. package/types/components/Notification/Notification.tokens.d.ts +1 -0
  115. package/types/components/Notification/Notification.tokens.d.ts.map +1 -1
  116. package/types/components/Notification/Notification.types.d.ts +11 -5
  117. package/types/components/Notification/Notification.types.d.ts.map +1 -1
  118. package/types/components/Notification/NotificationsPortal.d.ts.map +1 -1
  119. package/types/components/Notification/NotificationsProvider.d.ts +4 -3
  120. package/types/components/Notification/NotificationsProvider.d.ts.map +1 -1
  121. package/types/components/Notification/index.d.ts +2 -2
  122. package/types/components/Notification/index.d.ts.map +1 -1
  123. package/types/components/Select/Select.tokens.d.ts +1 -0
  124. package/types/components/Select/Select.tokens.d.ts.map +1 -1
  125. package/types/components/Select/ui/Target/ui/Textfield/Textfield.styles.d.ts.map +1 -1
  126. package/types/examples/plasma_b2c/components/Notification/Notification.d.ts +4 -2
  127. package/types/examples/plasma_b2c/components/Notification/Notification.d.ts.map +1 -1
  128. package/types/examples/plasma_web/components/Notification/Notification.d.ts +4 -13
  129. 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.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
  };
@@ -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
  };
@@ -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,