@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
@@ -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
  };
@@ -13,7 +13,7 @@ var config = exports.config = {
13
13
  },
14
14
  variations: {
15
15
  view: {
16
- "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--text-primary-hover);", ":solid var(--surface-solid-default);", ":var(--text-primary);", ":var(--surface-clear);", ":var(--inverse-text-primary);", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--surface-solid-default-hover);", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--surface-transparent-secondary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-secondary);", ":var(--surface-accent);", ":0.4;"], _Steps.stepsTokens.activeTitleColor, _Steps.stepsTokens.activeTitleColorHover, _Steps.stepsTokens.activeIndicatorBorder, _Steps.stepsTokens.activeIndicatorColor, _Steps.stepsTokens.activeIndicatorBackground, _Steps.stepsTokens.completedIndicatorColor, _Steps.stepsTokens.completedIndicatorColorHover, _Steps.stepsTokens.completedIndicatorBackground, _Steps.stepsTokens.completedIndicatorBackgroundHover, _Steps.stepsTokens.inactiveTitleColor, _Steps.stepsTokens.inactiveTitleColorHover, _Steps.stepsTokens.inactiveIndicatorColor, _Steps.stepsTokens.inactiveIndicatorColorHover, _Steps.stepsTokens.inactiveIndicatorBackground, _Steps.stepsTokens.inactiveIndicatorBackgroundHover, _Steps.stepsTokens.contentColor, _Steps.stepsTokens.focusColor, _Steps.stepsTokens.disabledOpacity)
16
+ "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--text-primary-hover);", ":solid var(--surface-solid-default);", ":var(--text-primary);", ":var(--surface-clear);", ":var(--inverse-text-primary);", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--surface-solid-default-hover);", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--surface-transparent-secondary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-secondary);", ":0.4;"], _Steps.stepsTokens.activeTitleColor, _Steps.stepsTokens.activeTitleColorHover, _Steps.stepsTokens.activeIndicatorBorder, _Steps.stepsTokens.activeIndicatorColor, _Steps.stepsTokens.activeIndicatorBackground, _Steps.stepsTokens.completedIndicatorColor, _Steps.stepsTokens.completedIndicatorColorHover, _Steps.stepsTokens.completedIndicatorBackground, _Steps.stepsTokens.completedIndicatorBackgroundHover, _Steps.stepsTokens.inactiveTitleColor, _Steps.stepsTokens.inactiveTitleColorHover, _Steps.stepsTokens.inactiveIndicatorColor, _Steps.stepsTokens.inactiveIndicatorColorHover, _Steps.stepsTokens.inactiveIndicatorBackground, _Steps.stepsTokens.inactiveIndicatorBackgroundHover, _Steps.stepsTokens.contentColor, _Steps.stepsTokens.disabledOpacity)
17
17
  },
18
18
  size: {
19
19
  l: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.5rem;", ":2.25rem;", ":0.5rem;", ":1rem;", ":0.75rem;", ":0.375rem;", ":2rem;", ":1.0625rem;", ":0.75rem;", ":1rem;", ":0.625rem;", ":1.5rem;", ":1.25rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":0.125rem;"], _Steps.stepsTokens.indicatorSize, _Steps.stepsTokens.activeIndicatorSize, _Steps.stepsTokens.bulletSize, _Steps.stepsTokens.activeBulletSize, _Steps.stepsTokens.titlePaddingTop, _Steps.stepsTokens.contentPaddingTop, _Steps.stepsTokens.contentSidePadding, _Steps.stepsTokens.contentVerticalPadding, _Steps.stepsTokens.verticalContentPaddingLeft, _Steps.stepsTokens.smallIndicatorIndentHeight, _Steps.stepsTokens.largeIndicatorIndentHeight, _Steps.stepsTokens.smallBulletIndentHeight, _Steps.stepsTokens.largeBulletIndentHeight, _Steps.stepsTokens.indicatorFontFamily, _Steps.stepsTokens.indicatorFontSize, _Steps.stepsTokens.indicatorFontStyle, _Steps.stepsTokens.indicatorFontWeight, _Steps.stepsTokens.indicatorLetterSpacing, _Steps.stepsTokens.indicatorLineHeight, _Steps.stepsTokens.activeIndicatorFontFamily, _Steps.stepsTokens.activeIndicatorFontSize, _Steps.stepsTokens.activeIndicatorFontStyle, _Steps.stepsTokens.activeIndicatorFontWeight, _Steps.stepsTokens.activeIndicatorLetterSpacing, _Steps.stepsTokens.activeIndicatorLineHeight, _Steps.stepsTokens.titleFontFamily, _Steps.stepsTokens.titleFontSize, _Steps.stepsTokens.titleFontStyle, _Steps.stepsTokens.titleFontWeight, _Steps.stepsTokens.titleLetterSpacing, _Steps.stepsTokens.titleLineHeight, _Steps.stepsTokens.contentFontFamily, _Steps.stepsTokens.contentFontSize, _Steps.stepsTokens.contentFontStyle, _Steps.stepsTokens.contentFontWeight, _Steps.stepsTokens.contentLetterSpacing, _Steps.stepsTokens.contentLineHeight, _Steps.stepsTokens.dividerThickness),
@@ -118,7 +118,7 @@ const DefaultStory = (args) => {
118
118
  };
119
119
 
120
120
  return (
121
- <div style={{ maxWidth, height: '600px' }}>
121
+ <div style={{ maxWidth, height: '400px' }}>
122
122
  <Steps
123
123
  size={size}
124
124
  items={items}
@@ -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
  };
@@ -13,7 +13,7 @@ var config = exports.config = {
13
13
  },
14
14
  variations: {
15
15
  view: {
16
- "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--text-primary-hover);", ":solid var(--surface-solid-default);", ":var(--text-primary);", ":var(--surface-clear);", ":var(--inverse-text-primary);", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--surface-solid-default-hover);", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--surface-transparent-secondary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-secondary);", ":var(--surface-accent);", ":0.4;"], _Steps.stepsTokens.activeTitleColor, _Steps.stepsTokens.activeTitleColorHover, _Steps.stepsTokens.activeIndicatorBorder, _Steps.stepsTokens.activeIndicatorColor, _Steps.stepsTokens.activeIndicatorBackground, _Steps.stepsTokens.completedIndicatorColor, _Steps.stepsTokens.completedIndicatorColorHover, _Steps.stepsTokens.completedIndicatorBackground, _Steps.stepsTokens.completedIndicatorBackgroundHover, _Steps.stepsTokens.inactiveTitleColor, _Steps.stepsTokens.inactiveTitleColorHover, _Steps.stepsTokens.inactiveIndicatorColor, _Steps.stepsTokens.inactiveIndicatorColorHover, _Steps.stepsTokens.inactiveIndicatorBackground, _Steps.stepsTokens.inactiveIndicatorBackgroundHover, _Steps.stepsTokens.contentColor, _Steps.stepsTokens.focusColor, _Steps.stepsTokens.disabledOpacity)
16
+ "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--text-primary-hover);", ":solid var(--surface-solid-default);", ":var(--text-primary);", ":var(--surface-clear);", ":var(--inverse-text-primary);", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--surface-solid-default-hover);", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--surface-transparent-secondary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-secondary);", ":0.4;"], _Steps.stepsTokens.activeTitleColor, _Steps.stepsTokens.activeTitleColorHover, _Steps.stepsTokens.activeIndicatorBorder, _Steps.stepsTokens.activeIndicatorColor, _Steps.stepsTokens.activeIndicatorBackground, _Steps.stepsTokens.completedIndicatorColor, _Steps.stepsTokens.completedIndicatorColorHover, _Steps.stepsTokens.completedIndicatorBackground, _Steps.stepsTokens.completedIndicatorBackgroundHover, _Steps.stepsTokens.inactiveTitleColor, _Steps.stepsTokens.inactiveTitleColorHover, _Steps.stepsTokens.inactiveIndicatorColor, _Steps.stepsTokens.inactiveIndicatorColorHover, _Steps.stepsTokens.inactiveIndicatorBackground, _Steps.stepsTokens.inactiveIndicatorBackgroundHover, _Steps.stepsTokens.contentColor, _Steps.stepsTokens.disabledOpacity)
17
17
  },
18
18
  size: {
19
19
  l: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.5rem;", ":2.25rem;", ":0.5rem;", ":1rem;", ":0.75rem;", ":0.375rem;", ":2rem;", ":1.0625rem;", ":0.75rem;", ":1rem;", ":0.625rem;", ":1.5rem;", ":1.25rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":0.125rem;"], _Steps.stepsTokens.indicatorSize, _Steps.stepsTokens.activeIndicatorSize, _Steps.stepsTokens.bulletSize, _Steps.stepsTokens.activeBulletSize, _Steps.stepsTokens.titlePaddingTop, _Steps.stepsTokens.contentPaddingTop, _Steps.stepsTokens.contentSidePadding, _Steps.stepsTokens.contentVerticalPadding, _Steps.stepsTokens.verticalContentPaddingLeft, _Steps.stepsTokens.smallIndicatorIndentHeight, _Steps.stepsTokens.largeIndicatorIndentHeight, _Steps.stepsTokens.smallBulletIndentHeight, _Steps.stepsTokens.largeBulletIndentHeight, _Steps.stepsTokens.indicatorFontFamily, _Steps.stepsTokens.indicatorFontSize, _Steps.stepsTokens.indicatorFontStyle, _Steps.stepsTokens.indicatorFontWeight, _Steps.stepsTokens.indicatorLetterSpacing, _Steps.stepsTokens.indicatorLineHeight, _Steps.stepsTokens.activeIndicatorFontFamily, _Steps.stepsTokens.activeIndicatorFontSize, _Steps.stepsTokens.activeIndicatorFontStyle, _Steps.stepsTokens.activeIndicatorFontWeight, _Steps.stepsTokens.activeIndicatorLetterSpacing, _Steps.stepsTokens.activeIndicatorLineHeight, _Steps.stepsTokens.titleFontFamily, _Steps.stepsTokens.titleFontSize, _Steps.stepsTokens.titleFontStyle, _Steps.stepsTokens.titleFontWeight, _Steps.stepsTokens.titleLetterSpacing, _Steps.stepsTokens.titleLineHeight, _Steps.stepsTokens.contentFontFamily, _Steps.stepsTokens.contentFontSize, _Steps.stepsTokens.contentFontStyle, _Steps.stepsTokens.contentFontWeight, _Steps.stepsTokens.contentLetterSpacing, _Steps.stepsTokens.contentLineHeight, _Steps.stepsTokens.dividerThickness),
@@ -118,7 +118,7 @@ const DefaultStory = (args) => {
118
118
  };
119
119
 
120
120
  return (
121
- <div style={{ maxWidth, height: '600px' }}>
121
+ <div style={{ maxWidth, height: '400px' }}>
122
122
  <Steps
123
123
  size={size}
124
124
  items={items}
@@ -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';
@@ -56,7 +56,6 @@ export var tokens = {
56
56
  inactiveTitleColor: '--plasma-step-item-inactive-title-color',
57
57
  inactiveTitleColorHover: '--plasma-step-item-inactive-title-color-hover',
58
58
  contentColor: '--plasma-step-item-content-color',
59
- focusColor: '--plasma-step-item-focus-color',
60
59
  activeIndicatorBorder: '--plasma-step-item-active-indicator-border',
61
60
  activeIndicatorBorderHover: '--plasma-step-item-active-indicator-border-hover',
62
61
  activeIndicatorColor: '--plasma-step-item-active-indicator-color',
@@ -43,7 +43,6 @@ export var StepItem = function StepItem(_ref) {
43
43
  var prevItem = items[index - 1];
44
44
  var nextItem = items[index + 1];
45
45
  var isActive = status === 'active';
46
- var isNextActive = (nextItem === null || nextItem === void 0 ? void 0 : nextItem.status) === 'active';
47
46
  var isInactive = status === 'inactive';
48
47
  var isPrevInactive = prevItem && !(prevItem !== null && prevItem !== void 0 && prevItem.status) || (prevItem === null || prevItem === void 0 ? void 0 : prevItem.status) === 'inactive';
49
48
  var isNextInactive = !(nextItem !== null && nextItem !== void 0 && nextItem.status) || (nextItem === null || nextItem === void 0 ? void 0 : nextItem.status) === 'inactive';
@@ -81,31 +80,8 @@ export var StepItem = function StepItem(_ref) {
81
80
  setIsHovered(false);
82
81
  }
83
82
  }, [isDisabled]);
84
- if (isSimple) {
85
- var _cls;
86
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StepItemStyled, {
87
- className: cls((_cls = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_cls, classes.simple, isSimple), classes.active, isActive), classes.hovered, isHovered && !isActive), classes.inactive, isInactive), classes.centered, isCentered), classes.disabled, isDisabled), classes.clickable, clickable && !isActive), classes.hasIndicator, hasIndicator), classes.verticalOrientation, isVertical), "isFirst", isFirst), _defineProperty(_defineProperty(_defineProperty(_cls, "isLast", isLast), "isPrevInactive", isPrevInactive), "isNextInactive", isNextInactive)))
88
- }, /*#__PURE__*/React.createElement(BulletIndicatorWrapper, {
89
- className: cls(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, classes.verticalOrientation, isVertical), classes.centered, isCentered), classes.simple, isSimple), classes.hasIndicator, hasIndicator)),
90
- onClick: onClickHandler,
91
- onFocus: onMouseOver,
92
- onBlur: onMouseOut,
93
- onMouseOver: onMouseOver,
94
- onMouseOut: onMouseOut
95
- }, hasLoader && /*#__PURE__*/React.createElement(SpinnerStyled, {
96
- hasIndicator: hasIndicator
97
- }), !hasLoader && /*#__PURE__*/React.createElement(BulletNode, {
98
- className: cls(_defineProperty(_defineProperty({}, classes.active, isActive), classes.inactive, isInactive))
99
- }, typeof indicator === 'function' && indicator({
100
- status: status,
101
- item: item,
102
- size: size
103
- }), typeof indicator !== 'function' && indicator))), !isLast && /*#__PURE__*/React.createElement(StepItemDivider, {
104
- className: cls(classes.simple, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, classes.verticalOrientation, isVertical), classes.transparentDivider, !hasLine), classes.active, isActive), classes.inactive, isInactive || isNextInactive))
105
- }));
106
- }
107
83
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StepItemStyled, {
108
- className: cls(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, classes.simple, isSimple), classes.active, isActive), classes.hovered, isHovered && !isActive), classes.inactive, isInactive), classes.centered, isCentered), classes.disabled, isDisabled), classes.clickable, clickable && !isActive), classes.hasIndicator, hasIndicator), classes.verticalOrientation, isVertical), "isNextActive", isNextActive))
84
+ className: cls(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, classes.simple, isSimple), classes.active, isActive), classes.hovered, isHovered && !isActive), classes.inactive, isInactive), classes.centered, isCentered), classes.disabled, isDisabled), classes.clickable, clickable && !isActive), classes.hasIndicator, hasIndicator), classes.verticalOrientation, isVertical))
109
85
  }, /*#__PURE__*/React.createElement(BulletIndicatorWrapper, {
110
86
  className: cls(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, classes.verticalOrientation, isVertical), classes.centered, isCentered), classes.simple, isSimple), classes.hasIndicator, hasIndicator)),
111
87
  onClick: onClickHandler,
@@ -115,7 +91,7 @@ export var StepItem = function StepItem(_ref) {
115
91
  onMouseOut: onMouseOut
116
92
  }, contentAlign === 'center' && !isSimple && /*#__PURE__*/React.createElement(StepItemDivider, {
117
93
  className: cls(_defineProperty(_defineProperty(_defineProperty({}, classes.simple, isSimple), classes.transparentDivider, !hasLine || isFirst), classes.inactive, isInactive || isPrevInactive))
118
- }), isVertical && /*#__PURE__*/React.createElement(StepItemDivider, {
94
+ }), isVertical && (isSimple ? !isFirst : true) && /*#__PURE__*/React.createElement(StepItemDivider, {
119
95
  className: cls(classes.indentDivider, _defineProperty(_defineProperty(_defineProperty({}, classes.simple, isSimple), classes.transparentDivider, !hasLine || isFirst), classes.inactive, isInactive || isPrevInactive)),
120
96
  indentToken: indentToken
121
97
  }), hasLoader && /*#__PURE__*/React.createElement(SpinnerStyled, {
@@ -126,9 +102,9 @@ export var StepItem = function StepItem(_ref) {
126
102
  status: status,
127
103
  item: item,
128
104
  size: size
129
- }), typeof indicator !== 'function' && indicator), /*#__PURE__*/React.createElement(StepItemDivider, {
105
+ }), typeof indicator !== 'function' && indicator), !isSimple && /*#__PURE__*/React.createElement(StepItemDivider, {
130
106
  className: cls(_defineProperty(_defineProperty(_defineProperty({}, classes.simple, isSimple), classes.transparentDivider, !hasLine || isLast), classes.inactive, isInactive || isNextInactive))
131
- })), /*#__PURE__*/React.createElement(StepItemContentWrapper, {
107
+ })), !isSimple && /*#__PURE__*/React.createElement(StepItemContentWrapper, {
132
108
  className: cls(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, classes.verticalOrientation, isVertical), classes.centered, isCentered), classes.active, isActive), classes.hasIndicator, hasIndicator))
133
109
  }, /*#__PURE__*/React.createElement(StepItemTitle, {
134
110
  onClick: onClickHandler,
@@ -136,5 +112,7 @@ export var StepItem = function StepItem(_ref) {
136
112
  onBlur: onMouseOut,
137
113
  onMouseOver: onMouseOver,
138
114
  onMouseOut: onMouseOut
139
- }, title), content && /*#__PURE__*/React.createElement(StepItemContent, null, typeof content === 'function' ? content(status, index, items) : content))));
115
+ }, title), content && /*#__PURE__*/React.createElement(StepItemContent, null, typeof content === 'function' ? content(status, index, items) : content))), isSimple && !isLast && /*#__PURE__*/React.createElement(StepItemDivider, {
116
+ className: cls(classes.simple, _defineProperty(_defineProperty(_defineProperty({}, classes.verticalOrientation, isVertical), classes.transparentDivider, !hasLine), classes.inactive, isInactive || isNextInactive))
117
+ }));
140
118
  };
@@ -2,7 +2,6 @@ import styled from 'styled-components';
2
2
  import { classes, tokens } from '../../Steps.tokens';
3
3
  import { component, mergeConfig } from '../../../../engines';
4
4
  import { spinnerConfig, spinnerTokens } from '../../../Spinner';
5
- import { addFocus } from '../../../../mixins';
6
5
  var mergedConfig = /*#__PURE__*/mergeConfig(spinnerConfig);
7
6
  var Spinner = /*#__PURE__*/component(mergedConfig);
8
7
  export var SpinnerStyled = /*#__PURE__*/styled(Spinner).withConfig({
@@ -19,21 +18,16 @@ export var StepItemContent = /*#__PURE__*/styled.div.withConfig({
19
18
  })(["padding-top:var(", ");padding-right:var(", ");font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");word-break:break-word;color:var(", ");"], tokens.contentPaddingTop, tokens.contentSidePadding, tokens.contentFontFamily, tokens.contentFontSize, tokens.contentFontStyle, tokens.contentFontWeight, tokens.contentLetterSpacing, tokens.contentLineHeight, tokens.contentColor);
20
19
  export var BulletIndicatorWrapper = /*#__PURE__*/styled.div.withConfig({
21
20
  componentId: "plasma-new-hope__sc-bjma6z-3"
22
- })(["display:flex;align-items:center;&:not(.", "){flex:0;&.", "{width:100%;min-height:var(", ");}&:not(.", "){width:100%;min-height:var(", ");}&.", "{padding-right:var(", ");}}&.", "{flex:0;justify-content:center;&.", "{width:var(", ");min-height:var(", ");}&:not(.", "){width:var(", ");min-height:var(", ");}}&.", "{flex-direction:column;align-items:center;justify-content:center;min-height:100%;&.", "{min-width:var(", ");}&:not(.", "){min-width:var(", ");}}&.", "{justify-content:center;}"], classes.simple, classes.hasIndicator, tokens.activeIndicatorSize, classes.hasIndicator, tokens.activeBulletSize, classes.verticalOrientation, tokens.verticalContentPaddingLeft, classes.simple, classes.hasIndicator, tokens.activeIndicatorSize, tokens.activeIndicatorSize, classes.hasIndicator, tokens.activeBulletSize, tokens.activeBulletSize, classes.verticalOrientation, classes.hasIndicator, tokens.activeIndicatorSize, classes.hasIndicator, tokens.activeBulletSize, classes.centered);
23
- export var BulletIndicator = /*#__PURE__*/styled.button.withConfig({
21
+ })(["display:flex;align-items:center;&:not(.", "){flex:0;&.", "{width:100%;min-height:var(", ");}&:not(.", "){width:100%;min-height:var(", ");}&.", "{padding-right:var(", ");}}&.", "{flex-direction:column;align-items:center;justify-content:center;min-height:100%;&.", "{min-width:var(", ");}&:not(.", "){min-width:var(", ");}}&.", "{justify-content:center;}"], classes.simple, classes.hasIndicator, tokens.activeIndicatorSize, classes.hasIndicator, tokens.activeBulletSize, classes.verticalOrientation, tokens.verticalContentPaddingLeft, classes.verticalOrientation, classes.hasIndicator, tokens.activeIndicatorSize, classes.hasIndicator, tokens.activeBulletSize, classes.centered);
22
+ export var BulletIndicator = /*#__PURE__*/styled.div.withConfig({
24
23
  componentId: "plasma-new-hope__sc-bjma6z-4"
25
- })(["display:flex;align-items:center;justify-content:center;width:var(", ");height:var(", ");border-radius:50%;box-sizing:border-box;position:relative;outline:none;padding:0;margin:0;border:none;color:var(", ");background-color:var(", ");font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");", " &.", "{width:var(", ");height:var(", ");border:var(", ") var(", ");font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");color:var(", ");background:var(", ");}&.", "{color:var(", ");background:var(", ");&.", "{&:before,&:after{background:var(", ");}}}"], tokens.indicatorSize, tokens.indicatorSize, tokens.completedIndicatorColor, tokens.completedIndicatorBackground, tokens.indicatorFontFamily, tokens.indicatorFontSize, tokens.indicatorFontStyle, tokens.indicatorFontWeight, tokens.indicatorLetterSpacing, tokens.indicatorLineHeight, /*#__PURE__*/addFocus({
26
- outlineOffset: '-0.1875rem',
27
- outlineSize: '0.0625rem',
28
- outlineRadius: '50%',
29
- outlineColor: /*#__PURE__*/"var(".concat(tokens.focusColor, ")")
30
- }), classes.active, tokens.activeIndicatorSize, tokens.activeIndicatorSize, tokens.dividerThickness, tokens.activeIndicatorBorder, tokens.activeIndicatorFontFamily, tokens.activeIndicatorFontSize, tokens.activeIndicatorFontStyle, tokens.activeIndicatorFontWeight, tokens.activeIndicatorLetterSpacing, tokens.activeIndicatorLineHeight, tokens.activeIndicatorColor, tokens.activeIndicatorBackground, classes.inactive, tokens.inactiveIndicatorColor, tokens.inactiveIndicatorBackground, classes.simple, tokens.inactiveIndicatorBackground);
24
+ })(["display:flex;align-items:center;justify-content:center;width:var(", ");height:var(", ");border-radius:50%;box-sizing:border-box;position:relative;color:var(", ");background-color:var(", ");font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");&.", "{width:var(", ");height:var(", ");border:var(", ") var(", ");font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");color:var(", ");background:var(", ");}&.", "{color:var(", ");background:var(", ");&:before,&:after{background:var(", ");}}"], tokens.indicatorSize, tokens.indicatorSize, tokens.completedIndicatorColor, tokens.completedIndicatorBackground, tokens.indicatorFontFamily, tokens.indicatorFontSize, tokens.indicatorFontStyle, tokens.indicatorFontWeight, tokens.indicatorLetterSpacing, tokens.indicatorLineHeight, classes.active, tokens.activeIndicatorSize, tokens.activeIndicatorSize, tokens.dividerThickness, tokens.activeIndicatorBorder, tokens.activeIndicatorFontFamily, tokens.activeIndicatorFontSize, tokens.activeIndicatorFontStyle, tokens.activeIndicatorFontWeight, tokens.activeIndicatorLetterSpacing, tokens.activeIndicatorLineHeight, tokens.activeIndicatorColor, tokens.activeIndicatorBackground, classes.inactive, tokens.inactiveIndicatorColor, tokens.inactiveIndicatorBackground, tokens.inactiveIndicatorBackground);
31
25
  export var Bullet = /*#__PURE__*/styled(BulletIndicator).withConfig({
32
26
  componentId: "plasma-new-hope__sc-bjma6z-5"
33
- })(["width:var(", ");height:var(", ");&.", "{width:var(", ");height:var(", ");border:var(", ") var(", ");background:var(", ");}"], tokens.bulletSize, tokens.bulletSize, classes.active, tokens.activeBulletSize, tokens.activeBulletSize, tokens.dividerThickness, tokens.activeIndicatorBorder, tokens.activeIndicatorBackground);
27
+ })(["width:var(", ");height:var(", ");&.", "{width:var(", ");height:var(", ");border:var(", ") var(", ");background-color:var(", ");}"], tokens.bulletSize, tokens.bulletSize, classes.active, tokens.activeBulletSize, tokens.activeBulletSize, tokens.dividerThickness, tokens.activeIndicatorBorder, tokens.activeIndicatorBackground);
34
28
  export var StepItemDivider = /*#__PURE__*/styled.div.withConfig({
35
29
  componentId: "plasma-new-hope__sc-bjma6z-6"
36
- })(["width:100%;height:var(", ");flex:1;background:var(", ");&.", "{background:var(", ");}&.", "{background:transparent;}&.", "{width:var(", ");height:100%;}&.", "{height:", ";min-height:", ";max-height:", ";&.", "{height:auto;max-height:none;}}"], tokens.dividerThickness, tokens.activeIndicatorColor, classes.inactive, tokens.inactiveIndicatorBackground, classes.transparentDivider, classes.verticalOrientation, tokens.dividerThickness, classes.indentDivider, function (_ref2) {
30
+ })(["width:100%;height:var(", ");flex:1;background-color:var(", ");&.", "{background-color:var(", ");}&.", "{background-color:transparent;}&.", "{width:var(", ");height:100%;}&.", "{height:", ";min-height:", ";max-height:", ";&.", "{height:auto;max-height:none;}}"], tokens.dividerThickness, tokens.activeIndicatorColor, classes.inactive, tokens.inactiveIndicatorBackground, classes.transparentDivider, classes.verticalOrientation, tokens.dividerThickness, classes.indentDivider, function (_ref2) {
37
31
  var indentToken = _ref2.indentToken;
38
32
  return indentToken || '';
39
33
  }, function (_ref3) {
@@ -48,4 +42,4 @@ export var StepItemContentWrapper = /*#__PURE__*/styled.div.withConfig({
48
42
  })(["&.", "{", "{padding-top:var(", ");padding-right:0;}", "{padding-top:var(", ");padding-bottom:var(", ");padding-right:0;}}"], classes.verticalOrientation, StepItemTitle, tokens.contentVerticalPadding, StepItemContent, tokens.contentVerticalPadding, tokens.contentVerticalPadding);
49
43
  export var StepItemStyled = /*#__PURE__*/styled.div.withConfig({
50
44
  componentId: "plasma-new-hope__sc-bjma6z-8"
51
- })(["position:relative;display:flex;flex-direction:column;align-items:flex-start;flex:1;color:var(", ");&.", "{flex-direction:row;align-items:stretch;", "{width:var(", ");height:100%;}}&.", "{", "{color:var(", ");}}&.", "{color:var(", ");", "{color:var(", ");}}&.", "{flex:0;align-items:center;justify-content:center;&.", "{min-width:var(", ");}&:not(.", "){min-width:var(", ");}&.", ",&:not(.", "){&:before,&:after{position:absolute;top:0;bottom:0;left:0;content:'';display:flex;align-self:center;width:calc((var(", ") - var(", ")) / 2);height:var(", ");background:var(", ");}&:after{left:auto;right:0;}&.", "{&:before,&:after{width:var(", ");height:calc((var(", ") - var(", ")) / 2);margin:0 auto;align-self:auto;}&:before{top:0;left:0;right:0;}&:after{top:auto;left:0;right:0;bottom:0;margin:0 auto;}}&.isFirst{&:before{display:none;}}&.isLast{&:after{display:none;}}}&.", "{&:after,&:before{background:var(", ");}}&.isPrevInactive{&:before{background:var(", ");}}&.isNextInactive{&:after{background:var(", ");}}}&:not(.", "):not(.", "){&.isNextActive{", "{width:calc(100% - (var(", ") - var(", ")) / 2);}}&.", "{", "{margin-left:calc((var(", ") - var(", ")) / -2);width:calc(100% + (var(", ") - var(", ")) / 2);}}}&.", "{&:not(.", "){", "{cursor:pointer;color:var(", ");}", ",", "{color:var(", ");background:var(", ");}}&.", "{", "{color:var(", ");}", ",", "{color:var(", ");background:var(", ");}}", "{cursor:pointer;}}&.", "{align-items:center;", "{display:flex;flex-direction:column;align-items:center;padding-left:calc(var(", ") / 2);padding-right:calc(var(", ") / 2);", "{width:100%;}", ",", "{padding-right:0;text-align:center;}}}&.", "{opacity:var(", ");}"], tokens.activeIndicatorColor, classes.verticalOrientation, StepItemDivider, tokens.dividerThickness, classes.active, StepItemTitle, tokens.activeTitleColor, classes.inactive, tokens.inactiveIndicatorColor, StepItemTitle, tokens.inactiveTitleColor, classes.simple, classes.hasIndicator, tokens.activeIndicatorSize, classes.hasIndicator, tokens.activeBulletSize, classes.inactive, classes.active, tokens.activeIndicatorSize, tokens.indicatorSize, tokens.dividerThickness, tokens.activeIndicatorColor, classes.verticalOrientation, tokens.dividerThickness, tokens.activeIndicatorSize, tokens.indicatorSize, classes.inactive, tokens.inactiveIndicatorBackground, tokens.inactiveIndicatorBackground, tokens.inactiveIndicatorBackground, classes.simple, classes.verticalOrientation, BulletIndicatorWrapper, tokens.activeIndicatorSize, tokens.indicatorSize, classes.active, BulletIndicatorWrapper, tokens.activeIndicatorSize, tokens.indicatorSize, tokens.activeIndicatorSize, tokens.indicatorSize, classes.hovered, classes.active, StepItemTitle, tokens.activeTitleColorHover, BulletIndicator, Bullet, tokens.completedIndicatorColorHover, tokens.completedIndicatorBackgroundHover, classes.inactive, StepItemTitle, tokens.inactiveTitleColorHover, BulletIndicator, Bullet, tokens.inactiveIndicatorColorHover, tokens.inactiveIndicatorBackgroundHover, BulletIndicatorWrapper, classes.centered, StepItemContentWrapper, tokens.contentSidePadding, tokens.contentSidePadding, StepItemTitle, StepItemTitle, StepItemContent, classes.disabled, tokens.disabledOpacity);
45
+ })(["display:flex;flex-direction:column;align-items:flex-start;flex:1;&.", "{flex-direction:row;align-items:stretch;", "{width:var(", ");height:100%;}}&.", "{", "{color:var(", ");}}&.", "{", "{color:var(", ");}}&.", "{&:not(.", "){", "{cursor:pointer;color:var(", ");}", ",", "{color:var(", ");background:var(", ");}}&.", "{", "{color:var(", ");}", ",", "{color:var(", ");background:var(", ");}}", "{cursor:pointer;}}&.", "{align-items:center;", "{display:flex;flex-direction:column;align-items:center;padding-left:calc(var(", ") / 2);padding-right:calc(var(", ") / 2);", "{width:100%;}", ",", "{padding-right:0;text-align:center;}}}&.", "{flex:0;}&.", "{opacity:var(", ");}"], classes.verticalOrientation, StepItemDivider, tokens.dividerThickness, classes.active, StepItemTitle, tokens.activeTitleColor, classes.inactive, StepItemTitle, tokens.inactiveTitleColor, classes.hovered, classes.active, StepItemTitle, tokens.activeTitleColorHover, BulletIndicator, Bullet, tokens.completedIndicatorColorHover, tokens.completedIndicatorBackgroundHover, classes.inactive, StepItemTitle, tokens.inactiveTitleColorHover, BulletIndicator, Bullet, tokens.inactiveIndicatorColorHover, tokens.inactiveIndicatorBackgroundHover, BulletIndicatorWrapper, classes.centered, StepItemContentWrapper, tokens.contentSidePadding, tokens.contentSidePadding, StepItemTitle, StepItemTitle, StepItemContent, classes.simple, classes.disabled, tokens.disabledOpacity);
@@ -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
  };