@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.
- package/cjs/components/Notification/Notification.css +11 -11
- package/cjs/components/Notification/Notification.js +2 -2
- package/cjs/components/Notification/Notification.js.map +1 -1
- package/cjs/components/Notification/Notification.styles.js +11 -2
- package/cjs/components/Notification/Notification.styles.js.map +1 -1
- package/cjs/components/Notification/{Notification.styles_7h8hp0.css → Notification.styles_e6274r.css} +2 -2
- package/cjs/components/Notification/Notification.tokens.js +2 -1
- package/cjs/components/Notification/Notification.tokens.js.map +1 -1
- package/cjs/components/Notification/Notification.types.js.map +1 -1
- package/cjs/components/Notification/NotificationsPortal.js +8 -4
- package/cjs/components/Notification/NotificationsPortal.js.map +1 -1
- package/cjs/components/Notification/NotificationsProvider.css +11 -11
- package/cjs/components/Notification/NotificationsProvider.js +3 -1
- package/cjs/components/Notification/NotificationsProvider.js.map +1 -1
- package/cjs/components/Steps/Steps.css +9 -9
- package/cjs/components/Steps/Steps.tokens.js +0 -1
- package/cjs/components/Steps/Steps.tokens.js.map +1 -1
- package/cjs/components/Steps/ui/StepItem/StepItem.css +9 -9
- package/cjs/components/Steps/ui/StepItem/StepItem.js +7 -29
- package/cjs/components/Steps/ui/StepItem/StepItem.js.map +1 -1
- package/cjs/components/Steps/ui/StepItem/StepItem.styles.js +6 -6
- package/cjs/components/Steps/ui/StepItem/StepItem.styles.js.map +1 -1
- package/cjs/components/Steps/ui/StepItem/StepItem.styles_sp9rcd.css +9 -0
- package/cjs/index.css +20 -20
- package/cjs/index.js +1 -1
- package/emotion/cjs/components/Notification/Notification.js +2 -2
- package/emotion/cjs/components/Notification/Notification.styles.js +14 -19
- package/emotion/cjs/components/Notification/Notification.template-doc.mdx +17 -8
- package/emotion/cjs/components/Notification/Notification.tokens.js +2 -1
- package/emotion/cjs/components/Notification/NotificationsPortal.js +9 -5
- package/emotion/cjs/components/Notification/NotificationsProvider.js +3 -1
- package/emotion/cjs/components/Notification/index.js +4 -4
- package/emotion/cjs/components/Steps/Steps.tokens.js +0 -1
- package/emotion/cjs/components/Steps/ui/StepItem/StepItem.js +7 -29
- package/emotion/cjs/components/Steps/ui/StepItem/StepItem.styles.js +11 -17
- package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.js +5 -3
- package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
- package/emotion/cjs/examples/plasma_b2c/components/Steps/Steps.config.js +5 -5
- package/emotion/cjs/examples/plasma_b2c/components/Steps/Steps.stories.tsx +1 -1
- package/emotion/cjs/examples/plasma_web/components/Notification/Notification.js +5 -3
- package/emotion/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
- package/emotion/cjs/examples/plasma_web/components/Steps/Steps.config.js +5 -5
- package/emotion/cjs/examples/plasma_web/components/Steps/Steps.stories.tsx +1 -1
- package/emotion/es/components/Notification/Notification.js +1 -1
- package/emotion/es/components/Notification/Notification.styles.js +14 -19
- package/emotion/es/components/Notification/Notification.template-doc.mdx +17 -8
- package/emotion/es/components/Notification/Notification.tokens.js +2 -1
- package/emotion/es/components/Notification/NotificationsPortal.js +9 -5
- package/emotion/es/components/Notification/NotificationsProvider.js +3 -1
- package/emotion/es/components/Notification/index.js +1 -1
- package/emotion/es/components/Steps/Steps.tokens.js +0 -1
- package/emotion/es/components/Steps/ui/StepItem/StepItem.js +7 -29
- package/emotion/es/components/Steps/ui/StepItem/StepItem.styles.js +11 -17
- package/emotion/es/examples/plasma_b2c/components/Notification/Notification.js +6 -4
- package/emotion/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
- package/emotion/es/examples/plasma_b2c/components/Steps/Steps.config.js +5 -5
- package/emotion/es/examples/plasma_b2c/components/Steps/Steps.stories.tsx +1 -1
- package/emotion/es/examples/plasma_web/components/Notification/Notification.js +6 -4
- package/emotion/es/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
- package/emotion/es/examples/plasma_web/components/Steps/Steps.config.js +5 -5
- package/emotion/es/examples/plasma_web/components/Steps/Steps.stories.tsx +1 -1
- package/es/components/Notification/Notification.css +11 -11
- package/es/components/Notification/Notification.js +2 -2
- package/es/components/Notification/Notification.js.map +1 -1
- package/es/components/Notification/Notification.styles.js +11 -2
- package/es/components/Notification/Notification.styles.js.map +1 -1
- package/es/components/Notification/{Notification.styles_7h8hp0.css → Notification.styles_e6274r.css} +2 -2
- package/es/components/Notification/Notification.tokens.js +2 -1
- package/es/components/Notification/Notification.tokens.js.map +1 -1
- package/es/components/Notification/Notification.types.js.map +1 -1
- package/es/components/Notification/NotificationsPortal.js +8 -4
- package/es/components/Notification/NotificationsPortal.js.map +1 -1
- package/es/components/Notification/NotificationsProvider.css +11 -11
- package/es/components/Notification/NotificationsProvider.js +3 -1
- package/es/components/Notification/NotificationsProvider.js.map +1 -1
- package/es/components/Steps/Steps.css +9 -9
- package/es/components/Steps/Steps.tokens.js +0 -1
- package/es/components/Steps/Steps.tokens.js.map +1 -1
- package/es/components/Steps/ui/StepItem/StepItem.css +9 -9
- package/es/components/Steps/ui/StepItem/StepItem.js +8 -30
- package/es/components/Steps/ui/StepItem/StepItem.js.map +1 -1
- package/es/components/Steps/ui/StepItem/StepItem.styles.js +6 -6
- package/es/components/Steps/ui/StepItem/StepItem.styles.js.map +1 -1
- package/es/components/Steps/ui/StepItem/StepItem.styles_sp9rcd.css +9 -0
- package/es/index.css +20 -20
- package/es/index.js +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Notification/Notification.js +2 -2
- package/styled-components/cjs/components/Notification/Notification.styles.js +5 -2
- package/styled-components/cjs/components/Notification/Notification.template-doc.mdx +17 -8
- package/styled-components/cjs/components/Notification/Notification.tokens.js +2 -1
- package/styled-components/cjs/components/Notification/NotificationsPortal.js +8 -4
- package/styled-components/cjs/components/Notification/NotificationsProvider.js +3 -1
- package/styled-components/cjs/components/Notification/index.js +4 -4
- package/styled-components/cjs/components/Steps/Steps.tokens.js +0 -1
- package/styled-components/cjs/components/Steps/ui/StepItem/StepItem.js +7 -29
- package/styled-components/cjs/components/Steps/ui/StepItem/StepItem.styles.js +6 -12
- package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.js +5 -3
- package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
- package/styled-components/cjs/examples/plasma_b2c/components/Steps/Steps.config.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Steps/Steps.stories.tsx +1 -1
- package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.js +5 -3
- package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
- package/styled-components/cjs/examples/plasma_web/components/Steps/Steps.config.js +1 -1
- package/styled-components/cjs/examples/plasma_web/components/Steps/Steps.stories.tsx +1 -1
- package/styled-components/es/components/Notification/Notification.js +1 -1
- package/styled-components/es/components/Notification/Notification.styles.js +5 -2
- package/styled-components/es/components/Notification/Notification.template-doc.mdx +17 -8
- package/styled-components/es/components/Notification/Notification.tokens.js +2 -1
- package/styled-components/es/components/Notification/NotificationsPortal.js +8 -4
- package/styled-components/es/components/Notification/NotificationsProvider.js +3 -1
- package/styled-components/es/components/Notification/index.js +1 -1
- package/styled-components/es/components/Steps/Steps.tokens.js +0 -1
- package/styled-components/es/components/Steps/ui/StepItem/StepItem.js +7 -29
- package/styled-components/es/components/Steps/ui/StepItem/StepItem.styles.js +6 -12
- package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.js +6 -4
- package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +25 -4
- package/styled-components/es/examples/plasma_b2c/components/Steps/Steps.config.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Steps/Steps.stories.tsx +1 -1
- package/styled-components/es/examples/plasma_web/components/Notification/Notification.js +6 -4
- package/styled-components/es/examples/plasma_web/components/Notification/Notification.stories.tsx +25 -4
- package/styled-components/es/examples/plasma_web/components/Steps/Steps.config.js +1 -1
- package/styled-components/es/examples/plasma_web/components/Steps/Steps.stories.tsx +1 -1
- package/types/components/Notification/Notification.d.ts +3 -3
- package/types/components/Notification/Notification.d.ts.map +1 -1
- package/types/components/Notification/Notification.styles.d.ts +4 -2
- package/types/components/Notification/Notification.styles.d.ts.map +1 -1
- package/types/components/Notification/Notification.tokens.d.ts +1 -0
- package/types/components/Notification/Notification.tokens.d.ts.map +1 -1
- package/types/components/Notification/Notification.types.d.ts +11 -5
- package/types/components/Notification/Notification.types.d.ts.map +1 -1
- package/types/components/Notification/NotificationsPortal.d.ts.map +1 -1
- package/types/components/Notification/NotificationsProvider.d.ts +4 -3
- package/types/components/Notification/NotificationsProvider.d.ts.map +1 -1
- package/types/components/Notification/index.d.ts +2 -2
- package/types/components/Notification/index.d.ts.map +1 -1
- package/types/components/Steps/Steps.tokens.d.ts +0 -1
- package/types/components/Steps/Steps.tokens.d.ts.map +1 -1
- package/types/components/Steps/ui/StepItem/StepItem.d.ts.map +1 -1
- package/types/components/Steps/ui/StepItem/StepItem.styles.d.ts +2 -2
- package/types/components/Steps/ui/StepItem/StepItem.styles.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Notification/Notification.d.ts +4 -2
- package/types/examples/plasma_b2c/components/Notification/Notification.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Steps/Steps.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Notification/Notification.d.ts +4 -13
- package/types/examples/plasma_web/components/Notification/Notification.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Steps/Steps.config.d.ts.map +1 -1
- package/cjs/components/Steps/ui/StepItem/StepItem.styles_1oh5gqm.css +0 -9
- package/es/components/Steps/ui/StepItem/StepItem.styles_1oh5gqm.css +0 -9
package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx
CHANGED
@@ -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);", ":
|
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),
|
@@ -16,14 +16,16 @@ var _engines = /*#__PURE__*/require("../../../../engines");
|
|
16
16
|
var _Notification2 = /*#__PURE__*/require("./Notification.config");
|
17
17
|
var _Modal = /*#__PURE__*/require("../../../../components/Modal");
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
19
|
-
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Notification.
|
19
|
+
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Notification.notificationConfig, _Notification2.config);
|
20
20
|
var Notification = exports.Notification = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
21
21
|
var NotificationsProvider = exports.NotificationsProvider = function NotificationsProvider(_ref) {
|
22
22
|
var children = _ref.children,
|
23
23
|
_ref$frame = _ref.frame,
|
24
|
-
frame = _ref$frame === void 0 ? 'theme-root' : _ref$frame
|
24
|
+
frame = _ref$frame === void 0 ? 'theme-root' : _ref$frame,
|
25
|
+
placement = _ref.placement;
|
25
26
|
return /*#__PURE__*/_react["default"].createElement(_Notification.NotificationsProvider, {
|
26
27
|
config: mergedConfig,
|
27
|
-
frame: frame
|
28
|
+
frame: frame,
|
29
|
+
placement: placement
|
28
30
|
}, children);
|
29
31
|
};
|
package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx
CHANGED
@@ -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);", ":
|
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),
|
@@ -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:
|
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
|
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
|
-
<
|
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:
|
38
|
+
placement: placement,
|
37
39
|
zIndex: "9100"
|
38
|
-
}, /*#__PURE__*/React.createElement(StyledRoot,
|
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,
|
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(
|
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
|
23
|
-
export var BulletIndicator = /*#__PURE__*/styled.
|
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;
|
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
|
-
})(["
|
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 {
|
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(
|
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
|
};
|