@salutejs/plasma-new-hope 0.324.1-canary.1997.15290839769.0 → 0.324.1-canary.1999.15295614542.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/Notification/Notification.css +12 -12
- package/cjs/components/Notification/Notification.js +5 -1
- package/cjs/components/Notification/Notification.js.map +1 -1
- package/cjs/components/Notification/Notification.styles.js +63 -48
- package/cjs/components/Notification/Notification.styles.js.map +1 -1
- package/cjs/components/Notification/{Notification.styles_1yt699o.css → Notification.styles_1uyb7ob.css} +1 -1
- package/cjs/components/Notification/Notification.types.js.map +1 -1
- package/cjs/components/Notification/NotificationsProvider.css +11 -11
- package/cjs/components/Notification/variations/_layout/base.js +1 -1
- package/cjs/components/Notification/variations/_layout/base.js.map +1 -1
- package/cjs/components/Notification/variations/_layout/base_1g9g70c.css +1 -0
- package/cjs/index.css +12 -12
- package/emotion/cjs/components/Notification/Notification.js +5 -1
- package/emotion/cjs/components/Notification/Notification.styles.js +43 -36
- package/emotion/cjs/components/Notification/Notification.template-doc.mdx +44 -0
- package/emotion/cjs/components/Notification/variations/_layout/base.js +1 -1
- package/emotion/cjs/components/TextField/TextField.template-doc.mdx +16 -1
- package/emotion/cjs/examples/fixtures/Notification.js +1 -1
- package/emotion/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +5 -1
- package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.config.js +23 -22
- package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +9 -4
- package/emotion/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +5 -1
- package/emotion/cjs/examples/plasma_web/components/TextField/TextField.config.js +23 -22
- package/emotion/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -5
- package/emotion/es/components/Notification/Notification.js +5 -1
- package/emotion/es/components/Notification/Notification.styles.js +43 -36
- package/emotion/es/components/Notification/Notification.template-doc.mdx +44 -0
- package/emotion/es/components/Notification/variations/_layout/base.js +1 -1
- package/emotion/es/components/TextField/TextField.template-doc.mdx +16 -1
- package/emotion/es/examples/fixtures/Notification.js +1 -1
- package/emotion/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +5 -1
- package/emotion/es/examples/plasma_b2c/components/TextField/TextField.config.js +23 -22
- package/emotion/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +9 -4
- package/emotion/es/examples/plasma_web/components/Notification/Notification.stories.tsx +5 -1
- package/emotion/es/examples/plasma_web/components/TextField/TextField.config.js +23 -22
- package/emotion/es/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -5
- package/es/components/Notification/Notification.css +12 -12
- package/es/components/Notification/Notification.js +5 -1
- package/es/components/Notification/Notification.js.map +1 -1
- package/es/components/Notification/Notification.styles.js +63 -48
- package/es/components/Notification/Notification.styles.js.map +1 -1
- package/es/components/Notification/{Notification.styles_1yt699o.css → Notification.styles_1uyb7ob.css} +1 -1
- package/es/components/Notification/Notification.types.js.map +1 -1
- package/es/components/Notification/NotificationsProvider.css +11 -11
- package/es/components/Notification/variations/_layout/base.js +1 -1
- package/es/components/Notification/variations/_layout/base.js.map +1 -1
- package/es/components/Notification/variations/_layout/base_1g9g70c.css +1 -0
- package/es/index.css +12 -12
- package/package.json +2 -2
- package/styled-components/cjs/components/Notification/Notification.js +5 -1
- package/styled-components/cjs/components/Notification/Notification.styles.js +33 -26
- package/styled-components/cjs/components/Notification/Notification.template-doc.mdx +44 -0
- package/styled-components/cjs/components/Notification/variations/_layout/base.js +1 -1
- package/styled-components/cjs/components/TextField/TextField.template-doc.mdx +16 -1
- package/styled-components/cjs/examples/fixtures/Notification.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Notification/Notification.stories.tsx +5 -1
- package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.config.js +2 -1
- package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +9 -4
- package/styled-components/cjs/examples/plasma_web/components/Notification/Notification.stories.tsx +5 -1
- package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.config.js +7 -6
- package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -5
- package/styled-components/es/components/Notification/Notification.js +5 -1
- package/styled-components/es/components/Notification/Notification.styles.js +33 -26
- package/styled-components/es/components/Notification/Notification.template-doc.mdx +44 -0
- package/styled-components/es/components/Notification/variations/_layout/base.js +1 -1
- package/styled-components/es/components/TextField/TextField.template-doc.mdx +16 -1
- package/styled-components/es/examples/fixtures/Notification.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx +5 -1
- package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.config.js +2 -1
- package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +9 -4
- package/styled-components/es/examples/plasma_web/components/Notification/Notification.stories.tsx +5 -1
- package/styled-components/es/examples/plasma_web/components/TextField/TextField.config.js +7 -6
- package/styled-components/es/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -5
- package/types/components/Notification/Notification.d.ts.map +1 -1
- package/types/components/Notification/Notification.styles.d.ts +3 -1
- package/types/components/Notification/Notification.styles.d.ts.map +1 -1
- package/types/components/Notification/Notification.types.d.ts +9 -0
- package/types/components/Notification/Notification.types.d.ts.map +1 -1
- package/cjs/components/Notification/variations/_layout/base_qkc3i4.css +0 -1
- package/es/components/Notification/variations/_layout/base_qkc3i4.css +0 -1
@@ -133,3 +133,47 @@ export function App() {
|
|
133
133
|
);
|
134
134
|
}
|
135
135
|
```
|
136
|
+
|
137
|
+
## Управление шириной уведомления
|
138
|
+
|
139
|
+
Для управления шириной компонента доступны следующие свойства:
|
140
|
+
|
141
|
+
- `width` — устанавливает ширину компонента.
|
142
|
+
- `maxWidth` — устанавливает максимальную ширину компонента.
|
143
|
+
|
144
|
+
Оба свойства принимает любые действительные CSS значения для [width](https://developer.mozilla.org/en-US/docs/Web/CSS/width#syntax) и [maxWidth](https://developer.mozilla.org/en-US/docs/Web/CSS/max-width#syntax)
|
145
|
+
|
146
|
+
```jsx live
|
147
|
+
import React, { useCallback } from 'react';
|
148
|
+
import { IconBell } from '@salutejs/plasma-icons';
|
149
|
+
import { Button, ButtonGroup, addNotification, closeNotification, NotificationsProvider } from '@salutejs/{{ package }}';
|
150
|
+
|
151
|
+
export function App() {
|
152
|
+
const handleShow = useCallback(() => {
|
153
|
+
addNotification({
|
154
|
+
id: 'incoming-call',
|
155
|
+
title: 'Входящий вызов',
|
156
|
+
icon: <IconBell color="inherit" size="xs" />,
|
157
|
+
children: 'Задача организации, в особенности же сплочённость команды профессионалов требует определения и уточнения глубокомысленных рассуждений.',
|
158
|
+
view: 'positive',
|
159
|
+
textColor: 'black',
|
160
|
+
titleColor: 'blue',
|
161
|
+
width: 'fit-content',
|
162
|
+
maxWidth: '30rem'
|
163
|
+
}, 3000);
|
164
|
+
}, []);
|
165
|
+
|
166
|
+
const handleHide = useCallback(() => {
|
167
|
+
closeNotification('incoming-call');
|
168
|
+
}, []);
|
169
|
+
|
170
|
+
return (
|
171
|
+
<NotificationsProvider>
|
172
|
+
<ButtonGroup>
|
173
|
+
<Button text="Показать оповещение" onClick={handleShow} />
|
174
|
+
<Button text="Скрыть оповещение" onClick={handleHide} />
|
175
|
+
</ButtonGroup>
|
176
|
+
</NotificationsProvider>
|
177
|
+
);
|
178
|
+
}
|
179
|
+
```
|
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.base = void 0;
|
7
7
|
var _react = /*#__PURE__*/require("@emotion/react");
|
8
8
|
var _Notification = /*#__PURE__*/require("../../Notification.tokens");
|
9
|
-
var base = exports.base = /*#__PURE__*/(0, _react.css)(".", _Notification.classes.wrapper, "{
|
9
|
+
var base = exports.base = /*#__PURE__*/(0, _react.css)(".", _Notification.classes.wrapper, "{padding:var(", _Notification.tokens.padding, ");}.", _Notification.classes.wrapper, ".", _Notification.classes.horizontal, "{padding:var(", _Notification.tokens.horizontalLayoutPadding, ");&.", _Notification.classes.withoutCloseIcon, "{padding-right:var(", _Notification.tokens.horizontalLayoutRightPaddingWithoutCloseIcon, ");}}.", _Notification.classes.wrapper, ".", _Notification.classes.horizontal, ".", _Notification.classes.oneLine, "{padding:var(", _Notification.tokens.paddingOneLineTextbox, ");};label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvTm90aWZpY2F0aW9uL3ZhcmlhdGlvbnMvX2xheW91dC9iYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUl1QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL05vdGlmaWNhdGlvbi92YXJpYXRpb25zL19sYXlvdXQvYmFzZS50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHsgY2xhc3NlcywgdG9rZW5zIH0gZnJvbSAnLi4vLi4vTm90aWZpY2F0aW9uLnRva2Vucyc7XG5cbmV4cG9ydCBjb25zdCBiYXNlID0gY3NzYFxuICAgIC4ke2NsYXNzZXMud3JhcHBlcn0ge1xuICAgICAgICBwYWRkaW5nOiB2YXIoJHt0b2tlbnMucGFkZGluZ30pO1xuICAgIH1cblxuICAgIC4ke2NsYXNzZXMud3JhcHBlcn0uJHtjbGFzc2VzLmhvcml6b250YWx9IHtcbiAgICAgICAgcGFkZGluZzogdmFyKCR7dG9rZW5zLmhvcml6b250YWxMYXlvdXRQYWRkaW5nfSk7XG5cbiAgICAgICAgJi4ke2NsYXNzZXMud2l0aG91dENsb3NlSWNvbn0ge1xuICAgICAgICAgICAgcGFkZGluZy1yaWdodDogdmFyKCR7dG9rZW5zLmhvcml6b250YWxMYXlvdXRSaWdodFBhZGRpbmdXaXRob3V0Q2xvc2VJY29ufSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAuJHtjbGFzc2VzLndyYXBwZXJ9LiR7Y2xhc3Nlcy5ob3Jpem9udGFsfS4ke2NsYXNzZXMub25lTGluZX0ge1xuICAgICAgICBwYWRkaW5nOiB2YXIoJHt0b2tlbnMucGFkZGluZ09uZUxpbmVUZXh0Ym94fSk7XG4gICAgfVxuYDtcbiJdfQ== */"));
|
@@ -37,7 +37,7 @@ export function App() {
|
|
37
37
|
```
|
38
38
|
|
39
39
|
### Размер поля
|
40
|
-
Размер поля задаётся с помощью свойства `size
|
40
|
+
Размер поля задаётся с помощью свойства `size`:
|
41
41
|
|
42
42
|
```tsx live
|
43
43
|
import React from 'react';
|
@@ -46,6 +46,11 @@ import { TextField } from '@salutejs/{{ package }}';
|
|
46
46
|
export function App() {
|
47
47
|
return (
|
48
48
|
<div>
|
49
|
+
<TextField
|
50
|
+
placeholder="Размер"
|
51
|
+
size="xl"
|
52
|
+
defaultValue="XL64"
|
53
|
+
/>
|
49
54
|
<TextField
|
50
55
|
placeholder="Размер"
|
51
56
|
size="l"
|
@@ -56,6 +61,16 @@ export function App() {
|
|
56
61
|
size="s"
|
57
62
|
defaultValue="S40"
|
58
63
|
/>
|
64
|
+
<TextField
|
65
|
+
placeholder="Размер"
|
66
|
+
size="s"
|
67
|
+
defaultValue="S32"
|
68
|
+
/>
|
69
|
+
<TextField
|
70
|
+
placeholder="Размер"
|
71
|
+
size="xs"
|
72
|
+
defaultValue="XS24"
|
73
|
+
/>
|
59
74
|
</div>
|
60
75
|
);
|
61
76
|
}
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.titles = exports.texts = exports.size = exports.notificationsPlacements = exports.longText = exports.iconPlacement = exports.IconPlacements = void 0;
|
7
7
|
var titles = exports.titles = ['Выполнено', 'Внимание', 'Ошибка'];
|
8
|
-
var texts = exports.texts = ['
|
8
|
+
var texts = exports.texts = ['Задача организации, в особенности же сплочённость команды профессионалов требует определения и уточнения глубокомысленных рассуждений.', 'Задача организации, в особенности же сплочённость команды профессионалов требует определения и уточнения глубокомысленных рассуждений.', 'Задача организации, в особенности же сплочённость команды профессионалов требует определения и уточнения глубокомысленных рассуждений.'];
|
9
9
|
var size = exports.size = ['xs', 'xxs'];
|
10
10
|
var iconPlacement = exports.iconPlacement = ['top', 'left'];
|
11
11
|
var notificationsPlacements = exports.notificationsPlacements = ['center', 'top', 'bottom', 'right', 'left', 'top-right', 'top-left', 'bottom-right', 'bottom-left'];
|
@@ -167,12 +167,14 @@ type StoryLiveDemoProps = ComponentProps<typeof Notification> & {
|
|
167
167
|
placement?: NotificationPlacement;
|
168
168
|
};
|
169
169
|
|
170
|
-
const StoryLiveDemo = ({ timeout, placement, ...rest }: StoryLiveDemoProps) => {
|
170
|
+
const StoryLiveDemo = ({ timeout, placement, width, maxWidth, ...rest }: StoryLiveDemoProps) => {
|
171
171
|
const count = useRef(0);
|
172
172
|
const handleClick = useCallback(() => {
|
173
173
|
addNotification(
|
174
174
|
{
|
175
175
|
icon: <IconDisclosureRight color="inherit" />,
|
176
|
+
width,
|
177
|
+
maxWidth,
|
176
178
|
...rest,
|
177
179
|
...getNotificationProps(count.current),
|
178
180
|
},
|
@@ -210,6 +212,8 @@ export const LiveDemo: StoryObj<StoryLiveDemoProps> = {
|
|
210
212
|
role: 'alert',
|
211
213
|
layout: 'vertical',
|
212
214
|
placement: 'bottom-right',
|
215
|
+
width: '',
|
216
|
+
maxWidth: '',
|
213
217
|
},
|
214
218
|
render: (args) => <StoryLiveDemo {...args} />,
|
215
219
|
};
|