@salutejs/plasma-new-hope 0.325.0-canary.1993.15271190997.0 → 0.325.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/List/List.css +7 -0
- package/cjs/components/List/List.js +59 -0
- package/cjs/components/List/List.js.map +1 -0
- package/cjs/components/List/List.styles.js +9 -0
- package/cjs/components/List/List.styles.js.map +1 -0
- package/cjs/components/List/List.styles_97b8jq.css +1 -0
- package/cjs/components/List/List.tokens.js +44 -0
- package/cjs/components/List/List.tokens.js.map +1 -0
- package/cjs/components/List/ui/ListItem.css +18 -0
- package/cjs/components/List/ui/ListItem.js +28 -0
- package/cjs/components/List/ui/ListItem.js.map +1 -0
- package/cjs/components/List/ui/ListItem.styles.js +28 -0
- package/cjs/components/List/ui/ListItem.styles.js.map +1 -0
- package/cjs/components/List/ui/ListItem.styles_106alid.css +2 -0
- package/cjs/components/List/variations/_disabled/base.js +9 -0
- package/cjs/components/List/variations/_disabled/base.js.map +1 -0
- package/cjs/components/List/variations/_disabled/base_1p96e1z.css +1 -0
- package/cjs/components/List/variations/_size/base.js +9 -0
- package/cjs/components/List/variations/_size/base.js.map +1 -0
- package/cjs/components/List/variations/_size/base_jq4nc8.css +1 -0
- package/cjs/components/List/variations/_view/base.js +9 -0
- package/cjs/components/List/variations/_view/base.js.map +1 -0
- package/cjs/components/List/variations/_view/base_1fsqflm.css +1 -0
- 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/components/NumberFormat/NumberFormat.js +2 -7
- package/cjs/components/NumberFormat/NumberFormat.js.map +1 -1
- package/cjs/index.css +23 -12
- package/cjs/index.js +8 -0
- package/cjs/index.js.map +1 -1
- package/emotion/cjs/components/List/List.js +55 -0
- package/emotion/cjs/components/List/List.styles.js +17 -0
- package/emotion/cjs/components/List/List.template-doc.mdx +42 -0
- package/emotion/cjs/components/List/List.tokens.js +42 -0
- package/emotion/cjs/components/List/List.types.js +5 -0
- package/emotion/cjs/components/List/index.js +38 -0
- package/emotion/cjs/components/List/ui/ListItem.js +25 -0
- package/emotion/cjs/components/List/ui/ListItem.styles.js +21 -0
- package/emotion/cjs/components/List/ui/ListItem.types.js +5 -0
- package/emotion/cjs/components/List/variations/_disabled/base.js +10 -0
- package/emotion/cjs/components/List/variations/_disabled/tokens.json +1 -0
- package/emotion/cjs/components/List/variations/_size/base.js +9 -0
- package/emotion/cjs/components/List/variations/_size/tokens.json +1 -0
- package/emotion/cjs/components/List/variations/_view/base.js +10 -0
- package/emotion/cjs/components/List/variations/_view/tokens.json +1 -0
- 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/NumberFormat/NumberFormat.js +2 -7
- 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/List/List.config.js +29 -0
- package/emotion/cjs/examples/plasma_b2c/components/List/List.js +12 -0
- package/emotion/cjs/examples/plasma_b2c/components/List/List.stories.tsx +61 -0
- 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/List/List.config.js +29 -0
- package/emotion/cjs/examples/plasma_web/components/List/List.js +12 -0
- package/emotion/cjs/examples/plasma_web/components/List/List.stories.tsx +61 -0
- 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/cjs/index.js +11 -0
- package/emotion/es/components/List/List.js +45 -0
- package/emotion/es/components/List/List.styles.js +11 -0
- package/emotion/es/components/List/List.template-doc.mdx +42 -0
- package/emotion/es/components/List/List.tokens.js +36 -0
- package/emotion/es/components/List/List.types.js +1 -0
- package/emotion/es/components/List/index.js +3 -0
- package/emotion/es/components/List/ui/ListItem.js +18 -0
- package/emotion/es/components/List/ui/ListItem.styles.js +14 -0
- package/emotion/es/components/List/ui/ListItem.types.js +1 -0
- package/emotion/es/components/List/variations/_disabled/base.js +4 -0
- package/emotion/es/components/List/variations/_disabled/tokens.json +1 -0
- package/emotion/es/components/List/variations/_size/base.js +3 -0
- package/emotion/es/components/List/variations/_size/tokens.json +1 -0
- package/emotion/es/components/List/variations/_view/base.js +4 -0
- package/emotion/es/components/List/variations/_view/tokens.json +1 -0
- 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/NumberFormat/NumberFormat.js +2 -7
- 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/List/List.config.js +23 -0
- package/emotion/es/examples/plasma_b2c/components/List/List.js +6 -0
- package/emotion/es/examples/plasma_b2c/components/List/List.stories.tsx +61 -0
- 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/List/List.config.js +23 -0
- package/emotion/es/examples/plasma_web/components/List/List.js +6 -0
- package/emotion/es/examples/plasma_web/components/List/List.stories.tsx +61 -0
- 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/emotion/es/index.js +3 -1
- package/es/components/List/List.css +7 -0
- package/es/components/List/List.js +49 -0
- package/es/components/List/List.js.map +1 -0
- package/es/components/List/List.styles.js +5 -0
- package/es/components/List/List.styles.js.map +1 -0
- package/es/components/List/List.styles_97b8jq.css +1 -0
- package/es/components/List/List.tokens.js +39 -0
- package/es/components/List/List.tokens.js.map +1 -0
- package/es/components/List/ui/ListItem.css +18 -0
- package/es/components/List/ui/ListItem.js +20 -0
- package/es/components/List/ui/ListItem.js.map +1 -0
- package/es/components/List/ui/ListItem.styles.js +23 -0
- package/es/components/List/ui/ListItem.styles.js.map +1 -0
- package/es/components/List/ui/ListItem.styles_106alid.css +2 -0
- package/es/components/List/variations/_disabled/base.js +5 -0
- package/es/components/List/variations/_disabled/base.js.map +1 -0
- package/es/components/List/variations/_disabled/base_1p96e1z.css +1 -0
- package/es/components/List/variations/_size/base.js +5 -0
- package/es/components/List/variations/_size/base.js.map +1 -0
- package/es/components/List/variations/_size/base_jq4nc8.css +1 -0
- package/es/components/List/variations/_view/base.js +5 -0
- package/es/components/List/variations/_view/base.js.map +1 -0
- package/es/components/List/variations/_view/base_1fsqflm.css +1 -0
- 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/components/NumberFormat/NumberFormat.js +2 -7
- package/es/components/NumberFormat/NumberFormat.js.map +1 -1
- package/es/index.css +23 -12
- package/es/index.js +3 -0
- package/es/index.js.map +1 -1
- package/package.json +4 -4
- package/styled-components/cjs/components/List/List.js +55 -0
- package/styled-components/cjs/components/List/List.styles.js +8 -0
- package/styled-components/cjs/components/List/List.template-doc.mdx +42 -0
- package/styled-components/cjs/components/List/List.tokens.js +42 -0
- package/styled-components/cjs/components/List/List.types.js +5 -0
- package/styled-components/cjs/components/List/index.js +38 -0
- package/styled-components/cjs/components/List/ui/ListItem.js +25 -0
- package/styled-components/cjs/components/List/ui/ListItem.styles.js +19 -0
- package/styled-components/cjs/components/List/ui/ListItem.types.js +5 -0
- package/styled-components/cjs/components/List/variations/_disabled/base.js +10 -0
- package/styled-components/cjs/components/List/variations/_disabled/tokens.json +1 -0
- package/styled-components/cjs/components/List/variations/_size/base.js +9 -0
- package/styled-components/cjs/components/List/variations/_size/tokens.json +1 -0
- package/styled-components/cjs/components/List/variations/_view/base.js +10 -0
- package/styled-components/cjs/components/List/variations/_view/tokens.json +1 -0
- 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/NumberFormat/NumberFormat.js +2 -7
- 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/List/List.config.js +29 -0
- package/styled-components/cjs/examples/plasma_b2c/components/List/List.js +12 -0
- package/styled-components/cjs/examples/plasma_b2c/components/List/List.stories.tsx +61 -0
- 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/List/List.config.js +29 -0
- package/styled-components/cjs/examples/plasma_web/components/List/List.js +12 -0
- package/styled-components/cjs/examples/plasma_web/components/List/List.stories.tsx +61 -0
- 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/cjs/index.js +11 -0
- package/styled-components/es/components/List/List.js +45 -0
- package/styled-components/es/components/List/List.styles.js +2 -0
- package/styled-components/es/components/List/List.template-doc.mdx +42 -0
- package/styled-components/es/components/List/List.tokens.js +36 -0
- package/styled-components/es/components/List/List.types.js +1 -0
- package/styled-components/es/components/List/index.js +3 -0
- package/styled-components/es/components/List/ui/ListItem.js +18 -0
- package/styled-components/es/components/List/ui/ListItem.styles.js +12 -0
- package/styled-components/es/components/List/ui/ListItem.types.js +1 -0
- package/styled-components/es/components/List/variations/_disabled/base.js +4 -0
- package/styled-components/es/components/List/variations/_disabled/tokens.json +1 -0
- package/styled-components/es/components/List/variations/_size/base.js +3 -0
- package/styled-components/es/components/List/variations/_size/tokens.json +1 -0
- package/styled-components/es/components/List/variations/_view/base.js +4 -0
- package/styled-components/es/components/List/variations/_view/tokens.json +1 -0
- 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/NumberFormat/NumberFormat.js +2 -7
- 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/List/List.config.js +23 -0
- package/styled-components/es/examples/plasma_b2c/components/List/List.js +6 -0
- package/styled-components/es/examples/plasma_b2c/components/List/List.stories.tsx +61 -0
- 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/List/List.config.js +23 -0
- package/styled-components/es/examples/plasma_web/components/List/List.js +6 -0
- package/styled-components/es/examples/plasma_web/components/List/List.stories.tsx +61 -0
- 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/styled-components/es/index.js +3 -1
- package/types/components/List/List.d.ts +36 -0
- package/types/components/List/List.d.ts.map +1 -0
- package/types/components/List/List.styles.d.ts +2 -0
- package/types/components/List/List.styles.d.ts.map +1 -0
- package/types/components/List/List.tokens.d.ts +37 -0
- package/types/components/List/List.tokens.d.ts.map +1 -0
- package/types/components/List/List.types.d.ts +22 -0
- package/types/components/List/List.types.d.ts.map +1 -0
- package/types/components/List/index.d.ts +5 -0
- package/types/components/List/index.d.ts.map +1 -0
- package/types/components/List/ui/ListItem.d.ts +4 -0
- package/types/components/List/ui/ListItem.d.ts.map +1 -0
- package/types/components/List/ui/ListItem.styles.d.ts +34 -0
- package/types/components/List/ui/ListItem.styles.d.ts.map +1 -0
- package/types/components/List/ui/ListItem.types.d.ts +14 -0
- package/types/components/List/ui/ListItem.types.d.ts.map +1 -0
- package/types/components/List/variations/_disabled/base.d.ts +2 -0
- package/types/components/List/variations/_disabled/base.d.ts.map +1 -0
- package/types/components/List/variations/_size/base.d.ts +2 -0
- package/types/components/List/variations/_size/base.d.ts.map +1 -0
- package/types/components/List/variations/_view/base.d.ts +2 -0
- package/types/components/List/variations/_view/base.d.ts.map +1 -0
- 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/types/components/NumberFormat/NumberFormat.d.ts.map +1 -1
- package/types/index.d.ts +2 -0
- package/types/index.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
@@ -784,6 +784,17 @@ Object.keys(_Table).forEach(function (key) {
|
|
784
784
|
}
|
785
785
|
});
|
786
786
|
});
|
787
|
+
var _List = /*#__PURE__*/require("./components/List");
|
788
|
+
Object.keys(_List).forEach(function (key) {
|
789
|
+
if (key === "default" || key === "__esModule") return;
|
790
|
+
if (key in exports && exports[key] === _List[key]) return;
|
791
|
+
Object.defineProperty(exports, key, {
|
792
|
+
enumerable: true,
|
793
|
+
get: function get() {
|
794
|
+
return _List[key];
|
795
|
+
}
|
796
|
+
});
|
797
|
+
});
|
787
798
|
var _LinkButton = /*#__PURE__*/require("./components/LinkButton");
|
788
799
|
Object.keys(_LinkButton).forEach(function (key) {
|
789
800
|
if (key === "default" || key === "__esModule") return;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import React, { forwardRef } from 'react';
|
2
|
+
import cls from 'classnames';
|
3
|
+
import { base } from "./List.styles";
|
4
|
+
import { classes } from "./List.tokens";
|
5
|
+
import { base as viewCSS } from "./variations/_view/base";
|
6
|
+
import { base as sizeCSS } from "./variations/_size/base";
|
7
|
+
import { base as disabledCSS } from "./variations/_disabled/base";
|
8
|
+
export var listRoot = function listRoot(Root) {
|
9
|
+
return /*#__PURE__*/forwardRef(function (_ref, outerRootRef) {
|
10
|
+
var size = _ref.size,
|
11
|
+
view = _ref.view,
|
12
|
+
disabled = _ref.disabled,
|
13
|
+
variant = _ref.variant,
|
14
|
+
className = _ref.className,
|
15
|
+
children = _ref.children;
|
16
|
+
return /*#__PURE__*/React.createElement(Root, {
|
17
|
+
ref: outerRootRef,
|
18
|
+
size: size,
|
19
|
+
view: view,
|
20
|
+
disabled: disabled,
|
21
|
+
className: cls(classes.listRoot, className, variant === 'tight' ? classes.tightListItem : '', disabled ? classes.disabledList : '')
|
22
|
+
}, children);
|
23
|
+
});
|
24
|
+
};
|
25
|
+
export var listConfig = {
|
26
|
+
name: 'List',
|
27
|
+
tag: 'ul',
|
28
|
+
layout: listRoot,
|
29
|
+
base: base,
|
30
|
+
variations: {
|
31
|
+
view: {
|
32
|
+
css: viewCSS
|
33
|
+
},
|
34
|
+
size: {
|
35
|
+
css: sizeCSS
|
36
|
+
},
|
37
|
+
disabled: {
|
38
|
+
css: disabledCSS
|
39
|
+
}
|
40
|
+
},
|
41
|
+
defaults: {
|
42
|
+
view: 'default',
|
43
|
+
size: 'm'
|
44
|
+
}
|
45
|
+
};
|
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
id: list
|
3
|
+
title: List
|
4
|
+
---
|
5
|
+
|
6
|
+
import { PropsTable } from '@site/src/components';
|
7
|
+
|
8
|
+
# List
|
9
|
+
Компонент ячейки.
|
10
|
+
|
11
|
+
<PropsTable name="List" />
|
12
|
+
|
13
|
+
Компонент представляет собой спсиок состоящий из `ListItem`.
|
14
|
+
|
15
|
+
ListItem представляет собой простой компонент с текстом и иконкой
|
16
|
+
|
17
|
+
### Типы ListItem
|
18
|
+
<PropsTable name="ListItem" />
|
19
|
+
|
20
|
+
## Примеры
|
21
|
+
|
22
|
+
### Базовое использование
|
23
|
+
```tsx live
|
24
|
+
import React from 'react';
|
25
|
+
import { List, ListItem } from '@salutejs/{{ package }}';
|
26
|
+
import { IconChevronRight } from '@salutejs/plasma-icons';
|
27
|
+
|
28
|
+
export function App() {
|
29
|
+
return (
|
30
|
+
<div>
|
31
|
+
<List view="default" size="s" variant="normal">
|
32
|
+
<ListItem contentRight={<IconChevronRight color="inherit" size="xs" />}>Test Item 1</ListItem>
|
33
|
+
<ListItem contentRight={<IconChevronRight color="inherit" size="xs" />}>Test Item 2</ListItem>
|
34
|
+
<ListItem contentRight={<IconChevronRight color="inherit" size="xs" />} disabled>
|
35
|
+
Test Item 3
|
36
|
+
</ListItem>
|
37
|
+
<ListItem contentRight={<IconChevronRight color="inherit" size="xs" />}>Test Item 4</ListItem>
|
38
|
+
</List>
|
39
|
+
</div>
|
40
|
+
);
|
41
|
+
}
|
42
|
+
```
|
@@ -0,0 +1,36 @@
|
|
1
|
+
export var classes = {
|
2
|
+
listRoot: 'list-root',
|
3
|
+
listItem: 'list-item',
|
4
|
+
filledStretching: 'list-stretching-filled',
|
5
|
+
fixedStretching: 'list-stretching-fixed',
|
6
|
+
tightListItem: 'list-item-tight',
|
7
|
+
disabledList: 'list-item-disabled',
|
8
|
+
disabledListItem: 'list-item-disabled-item'
|
9
|
+
};
|
10
|
+
export var tokens = {
|
11
|
+
listGap: '--plasma-list-gap',
|
12
|
+
listWidth: '--plasma-list-width',
|
13
|
+
listItemBackground: '--plasma-list-item-background',
|
14
|
+
listItemBackgroundHover: '--plasma-list-item-background-hover',
|
15
|
+
listItemBorderRadius: '--plasma-list-item-border-radius',
|
16
|
+
listItemPaddingLeft: '--plasma-list-item-padding-left',
|
17
|
+
listItemPaddingRight: '--plasma-list-item-padding-right',
|
18
|
+
listItemPaddingTop: '--plasma-list-item-padding-top',
|
19
|
+
listItemPaddingBottom: '--plasma-list-item-padding-bottom',
|
20
|
+
listItemBorderColor: '--plasma-list-item-border-color',
|
21
|
+
listItemBorderColorHover: '--plasma-list-item-border-color-hover',
|
22
|
+
listItemBorderWidth: '--plasma-list-item-border-width',
|
23
|
+
listItemIconLeftColor: '--plasma-list-item-color-icon-left',
|
24
|
+
listItemIconRightColor: '--plasma-list-item-color-icon-right',
|
25
|
+
listItemGap: '--plasma-list-item-gap',
|
26
|
+
listItemTightDifference: '--plasma-list-item-tight-difference',
|
27
|
+
listItemColor: '--plasma-list-item-color',
|
28
|
+
listItemColorHover: '--plasma-list-item-color-hover',
|
29
|
+
listItemFontFamily: '--plasma-list-item-font-family',
|
30
|
+
listItemFontSize: '--plasma-list-item-font-size',
|
31
|
+
listItemFontStyle: '--plasma-list-item-font-style',
|
32
|
+
listItemFontWeight: '--plasma-list-item-font-weight',
|
33
|
+
listItemLetterSpacing: '--plasma-list-item-letter-spacing',
|
34
|
+
listItemLineHeight: '--plasma-list-item-line-height',
|
35
|
+
listDisabledOpacity: '--plasma-list-disabled-opacity'
|
36
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
var _excluded = ["children", "contentRight", "disabled"];
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
3
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
4
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
5
|
+
import React from 'react';
|
6
|
+
import { classes } from "../List.tokens";
|
7
|
+
import { StyledListItem, CellItem } from "./ListItem.styles";
|
8
|
+
export var ListItem = function ListItem(_ref) {
|
9
|
+
var children = _ref.children,
|
10
|
+
contentRight = _ref.contentRight,
|
11
|
+
disabled = _ref.disabled,
|
12
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
13
|
+
return /*#__PURE__*/React.createElement(StyledListItem, _extends({
|
14
|
+
className: disabled ? classes.disabledListItem : ''
|
15
|
+
}, rest), /*#__PURE__*/React.createElement(CellItem, {
|
16
|
+
contentRight: contentRight
|
17
|
+
}, children));
|
18
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import styled from 'styled-components';
|
2
|
+
import { tokens, classes } from "../List.tokens";
|
3
|
+
import { cellConfig, cellTokens } from "../../Cell";
|
4
|
+
import { component, mergeConfig } from "../../../engines";
|
5
|
+
var mergedCellConfig = /*#__PURE__*/mergeConfig(cellConfig);
|
6
|
+
var Cell = /*#__PURE__*/component(mergedCellConfig);
|
7
|
+
export var CellItem = /*#__PURE__*/styled(Cell).withConfig({
|
8
|
+
componentId: "plasma-new-hope__sc-1roh0z4-0"
|
9
|
+
})(["", ":100%;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":var(", ");", ":var(", ");", ":transparent;"], cellTokens.cellWidth, cellTokens.cellPadding, cellTokens.cellPaddingLeftContent, cellTokens.cellPaddingContent, cellTokens.cellPaddingRightContent, cellTokens.cellTextboxGap, cellTokens.cellGap, tokens.listItemGap, cellTokens.cellColor, tokens.listItemColor, cellTokens.cellBackgroundColor);
|
10
|
+
export var StyledListItem = /*#__PURE__*/styled.li.withConfig({
|
11
|
+
componentId: "plasma-new-hope__sc-1roh0z4-1"
|
12
|
+
})(["padding:var(", ") var(", ") var(", ") var(", ");border-radius:var(", ");background:var(", ");border:var(", ") solid var(", ");box-sizing:border-box;display:flex;justify-content:space-between;align-items:center;color:var(", ");font-size:var(", ");font-weight:var(", ");font-family:var(", ");font-style:var(", ");line-height:var(", ");letter-spacing:var(", ");&:hover{background:var(", ");border-color:var(", ");color:var(", ");}&.", "{cursor:not-allowed;opacity:var(", ");}"], tokens.listItemPaddingTop, tokens.listItemPaddingRight, tokens.listItemPaddingBottom, tokens.listItemPaddingLeft, tokens.listItemBorderRadius, tokens.listItemBackground, tokens.listItemBorderWidth, tokens.listItemBorderColor, tokens.listItemColor, tokens.listItemFontSize, tokens.listItemFontWeight, tokens.listItemFontFamily, tokens.listItemFontStyle, tokens.listItemLineHeight, tokens.listItemLetterSpacing, tokens.listItemBackgroundHover, tokens.listItemBorderColorHover, tokens.listItemColorHover, classes.disabledListItem, tokens.listDisabledOpacity);
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { css } from 'styled-components';
|
2
|
+
import { classes, tokens } from "../../List.tokens";
|
3
|
+
import { StyledListItem } from "../../ui/ListItem.styles";
|
4
|
+
export var base = /*#__PURE__*/css(["&.", "{", "{cursor:not-allowed;opacity:var(", ");}}"], classes.disabledList, StyledListItem, tokens.listDisabledOpacity);
|
@@ -0,0 +1 @@
|
|
1
|
+
[]
|
@@ -0,0 +1 @@
|
|
1
|
+
[]
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { css } from 'styled-components';
|
2
|
+
import { classes, tokens } from "../../List.tokens";
|
3
|
+
import { StyledListItem } from "../../ui/ListItem.styles";
|
4
|
+
export var base = /*#__PURE__*/css(["&.", "{", "{padding:calc(var(", ") - var(", ")) var(", ") calc(var(", ") - var(", ")) var(", ");}}"], classes.tightListItem, StyledListItem, tokens.listItemPaddingTop, tokens.listItemTightDifference, tokens.listItemPaddingRight, tokens.listItemPaddingBottom, tokens.listItemTightDifference, tokens.listItemPaddingLeft);
|
@@ -0,0 +1 @@
|
|
1
|
+
[]
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["role", "title", "children", "actions", "view", "size", "iconPlacement", "showCloseIcon", "layout", "icon", "closeIconType", "textColor", "titleColor", "backgroundColor", "onCloseButtonClick"];
|
1
|
+
var _excluded = ["role", "title", "children", "actions", "view", "size", "iconPlacement", "showCloseIcon", "layout", "icon", "closeIconType", "textColor", "titleColor", "backgroundColor", "width", "maxWidth", "onCloseButtonClick"];
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
3
3
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
@@ -37,6 +37,8 @@ export var notificationRoot = function notificationRoot(Root) {
|
|
37
37
|
textColor = props.textColor,
|
38
38
|
titleColor = props.titleColor,
|
39
39
|
backgroundColor = props.backgroundColor,
|
40
|
+
width = props.width,
|
41
|
+
maxWidth = props.maxWidth,
|
40
42
|
onCloseButtonClick = props.onCloseButtonClick,
|
41
43
|
rest = _objectWithoutProperties(props, _excluded);
|
42
44
|
var ariaLive = 'polite';
|
@@ -64,6 +66,8 @@ export var notificationRoot = function notificationRoot(Root) {
|
|
64
66
|
"aria-atomic": ariaAtomic
|
65
67
|
}, rest), /*#__PURE__*/React.createElement(Wrapper, {
|
66
68
|
backgroundColor: backgroundColor,
|
69
|
+
width: width,
|
70
|
+
maxWidth: maxWidth,
|
67
71
|
className: cx(classes.wrapper, getLayoutClass(layout), oneLineClass, withoutCloseIconClass)
|
68
72
|
}, /*#__PURE__*/React.createElement(ContentBox, {
|
69
73
|
iconPlacement: IconPlacementInternal,
|
@@ -15,57 +15,64 @@ export var CloseIconWrapper = /*#__PURE__*/styled(Button).withConfig({
|
|
15
15
|
})(["position:absolute;width:var(", ");height:var(", ");align-self:var(", ");color:var(", ");:hover{color:var(", ");}&.", "{position:relative;}"], tokens.closeIconButtonSize, tokens.closeIconButtonSize, tokens.horisontalIconCloseAlignSelf, tokens.closeIconColor, tokens.closeIconColorOnHover, classes.horizontal);
|
16
16
|
export var Wrapper = /*#__PURE__*/styled.div.withConfig({
|
17
17
|
componentId: "plasma-new-hope__sc-1iufy9r-1"
|
18
|
-
})(["position:relative;
|
19
|
-
var
|
18
|
+
})(["position:relative;width:", ";max-width:", ";border-radius:var(", ");border:var(", ") solid var(", ");background:", ";box-sizing:border-box;&.", "{display:flex;align-items:center;gap:var(", ");}"], function (_ref) {
|
19
|
+
var _ref$width = _ref.width,
|
20
|
+
width = _ref$width === void 0 ? "var(".concat(tokens.width, ")") : _ref$width;
|
21
|
+
return width;
|
22
|
+
}, function (_ref2) {
|
23
|
+
var maxWidth = _ref2.maxWidth;
|
24
|
+
return maxWidth || 'unset';
|
25
|
+
}, tokens.borderRadius, tokens.borderWidth, tokens.borderColor, function (_ref3) {
|
26
|
+
var backgroundColor = _ref3.backgroundColor;
|
20
27
|
return backgroundColor || "var(".concat(tokens.background, ")");
|
21
|
-
},
|
28
|
+
}, classes.horizontal, tokens.horizontalLayoutGap);
|
22
29
|
export var ButtonsWrapper = /*#__PURE__*/styled.div.withConfig({
|
23
30
|
componentId: "plasma-new-hope__sc-1iufy9r-2"
|
24
|
-
})(["margin-top:var(", ");margin-left:", ";align-self:var(", ");&.", "{margin-top:unset;margin-left:unset;}"], tokens.buttonsMarginTop, function (
|
25
|
-
var iconPlacement =
|
31
|
+
})(["margin-top:var(", ");margin-left:", ";align-self:var(", ");&.", "{margin-top:unset;margin-left:unset;}"], tokens.buttonsMarginTop, function (_ref4) {
|
32
|
+
var iconPlacement = _ref4.iconPlacement;
|
26
33
|
return iconPlacement === placements.left ? "var(".concat(tokens.buttonsMarginLeft, ")") : 'unset';
|
27
34
|
}, tokens.horisontalActionsAlignSelf, classes.horizontal);
|
28
35
|
export var IconWrapper = /*#__PURE__*/styled.div.withConfig({
|
29
36
|
componentId: "plasma-new-hope__sc-1iufy9r-3"
|
30
|
-
})(["width:var(", ");height:var(", ");align-self:var(", ");color:", ";margin-right:", ";margin-bottom:", ";&.", "{margin-right:var(", ");margin-bottom:unset;}"], tokens.contentLeftIconSize, tokens.contentLeftIconSize, tokens.horisontalIconLeftAlignSelf, function (
|
31
|
-
var iconColor =
|
37
|
+
})(["width:var(", ");height:var(", ");align-self:var(", ");color:", ";margin-right:", ";margin-bottom:", ";&.", "{margin-right:var(", ");margin-bottom:unset;}"], tokens.contentLeftIconSize, tokens.contentLeftIconSize, tokens.horisontalIconLeftAlignSelf, function (_ref5) {
|
38
|
+
var iconColor = _ref5.iconColor;
|
32
39
|
return iconColor || "var(".concat(tokens.contentLeftIconColor, ")");
|
33
|
-
}, function (
|
34
|
-
var iconPlacement =
|
40
|
+
}, function (_ref6) {
|
41
|
+
var iconPlacement = _ref6.iconPlacement;
|
35
42
|
return iconPlacement === placements.left ? "var(".concat(tokens.contentLeftIconMargin, ")") : 'unset';
|
36
|
-
}, function (
|
37
|
-
var iconPlacement =
|
43
|
+
}, function (_ref7) {
|
44
|
+
var iconPlacement = _ref7.iconPlacement;
|
38
45
|
return iconPlacement === placements.top ? "var(".concat(tokens.contentTopIconMargin, ")") : 'unset';
|
39
46
|
}, classes.horizontal, tokens.horizontalLayoutLeftIconMargin);
|
40
47
|
export var ContentBox = /*#__PURE__*/styled.div.withConfig({
|
41
48
|
componentId: "plasma-new-hope__sc-1iufy9r-4"
|
42
|
-
})(["display:", ";padding-top:", ";&.", "{padding:unset;display:flex;align-items:center;flex-grow:1;}"], function (
|
43
|
-
var iconPlacement =
|
49
|
+
})(["display:", ";padding-top:", ";&.", "{padding:unset;display:flex;align-items:center;flex-grow:1;}"], function (_ref8) {
|
50
|
+
var iconPlacement = _ref8.iconPlacement;
|
44
51
|
return iconPlacement === placements.left ? 'flex' : 'block';
|
45
|
-
}, function (
|
46
|
-
var iconPlacement =
|
52
|
+
}, function (_ref9) {
|
53
|
+
var iconPlacement = _ref9.iconPlacement;
|
47
54
|
return iconPlacement ? "var(".concat(tokens.contentPaddingTop, ")") : "var(".concat(tokens.contentPaddingTopWithoutIcon, ")");
|
48
55
|
}, classes.horizontal);
|
49
56
|
export var TextBox = /*#__PURE__*/styled.div.withConfig({
|
50
57
|
componentId: "plasma-new-hope__sc-1iufy9r-5"
|
51
|
-
})(["padding:var(", ") var(", ") var(", ") var(", ");padding-top:", ";padding-right:", ";display:flex;flex-direction:column;row-gap:var(", ");word-break:break-word;&.", "{padding:unset;}"], tokens.textboxPaddingTop, tokens.textboxPaddingRight, tokens.textboxPaddingBottom, tokens.textboxPaddingLeft, function (
|
52
|
-
var iconPlacement =
|
58
|
+
})(["padding:var(", ") var(", ") var(", ") var(", ");padding-top:", ";padding-right:", ";display:flex;flex-direction:column;row-gap:var(", ");word-break:break-word;&.", "{padding:unset;}"], tokens.textboxPaddingTop, tokens.textboxPaddingRight, tokens.textboxPaddingBottom, tokens.textboxPaddingLeft, function (_ref10) {
|
59
|
+
var iconPlacement = _ref10.iconPlacement;
|
53
60
|
return !iconPlacement || iconPlacement === placements.top ? "var(".concat(tokens.textboxPaddingTopWithTopIcon, ")") : "var(".concat(tokens.textboxPaddingTop, ")");
|
54
|
-
}, function (
|
55
|
-
var showCloseIcon =
|
56
|
-
iconPlacement =
|
61
|
+
}, function (_ref11) {
|
62
|
+
var showCloseIcon = _ref11.showCloseIcon,
|
63
|
+
iconPlacement = _ref11.iconPlacement;
|
57
64
|
return showCloseIcon && iconPlacement !== placements.top ? "var(".concat(tokens.textboxPaddingRightWithCloseIcon, ")") : "var(".concat(tokens.textboxPaddingRight, ")");
|
58
65
|
}, tokens.textboxGap, classes.horizontal);
|
59
66
|
export var StyledTitle = /*#__PURE__*/styled.div.withConfig({
|
60
67
|
componentId: "plasma-new-hope__sc-1iufy9r-6"
|
61
|
-
})(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");", ";color:", ";"], tokens.titleFontFamily, tokens.titleFontSize, tokens.titleFontStyle, tokens.titleFontWeight, tokens.titleFontLetterSpacing, tokens.titleFontLineHeight, /*#__PURE__*/String(applyHyphens), function (
|
62
|
-
var textColor =
|
68
|
+
})(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");", ";color:", ";"], tokens.titleFontFamily, tokens.titleFontSize, tokens.titleFontStyle, tokens.titleFontWeight, tokens.titleFontLetterSpacing, tokens.titleFontLineHeight, /*#__PURE__*/String(applyHyphens), function (_ref12) {
|
69
|
+
var textColor = _ref12.textColor;
|
63
70
|
return textColor || "var(".concat(tokens.titleColor, ")");
|
64
71
|
});
|
65
72
|
export var StyledContent = /*#__PURE__*/styled.div.withConfig({
|
66
73
|
componentId: "plasma-new-hope__sc-1iufy9r-7"
|
67
|
-
})(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");", ";color:", ";"], tokens.contentFontFamily, tokens.contentFontSize, tokens.contentFontStyle, tokens.contentFontWeight, tokens.contentFontLetterSpacing, tokens.contentFontLineHeight, /*#__PURE__*/String(applyHyphens), function (
|
68
|
-
var textColor =
|
74
|
+
})(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");", ";color:", ";"], tokens.contentFontFamily, tokens.contentFontSize, tokens.contentFontStyle, tokens.contentFontWeight, tokens.contentFontLetterSpacing, tokens.contentFontLineHeight, /*#__PURE__*/String(applyHyphens), function (_ref13) {
|
75
|
+
var textColor = _ref13.textColor;
|
69
76
|
return textColor || "var(".concat(tokens.contentColor, ")");
|
70
77
|
});
|
71
78
|
export var StyledItemWrapper = /*#__PURE__*/styled.div.withConfig({
|
@@ -73,7 +80,7 @@ export var StyledItemWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
73
80
|
})(["margin-top:1rem;opacity:1;&&.", "{animation:0.4s showAnimation ease-out;&.", "{animation:0.4s showLeftToRightAnimation ease-out;}&.", "{animation:0.4s showTopToCenterAnimation ease-out;}&.", "{animation:0.4s showBottomToCenterAnimation ease-out;}}&&.", "{animation:0.4s hideAnimation ease-out;&.", "{animation:0.4s hideLeftToRightAnimation ease-out;}}@keyframes showTopToCenterAnimation{0%{transform:translateY(-100%);opacity:0;}100%{transform:translateY(0);opacity:1;}}@keyframes showBottomToCenterAnimation{0%{transform:translateY(100%);opacity:0;}100%{transform:translateY(0);opacity:1;}}@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.notificationTopToCenterAnimation, classes.notificationBottomToCenterAnimation, classes.notificationItemHidden, classes.notificationLeftToRightAnimation);
|
74
81
|
export var StyledRoot = /*#__PURE__*/styled.div.withConfig({
|
75
82
|
componentId: "plasma-new-hope__sc-1iufy9r-9"
|
76
|
-
})(["display:flex;flex-direction:column-reverse;box-sizing:border-box;padding:0 1.5rem 1.5rem;max-height:100%;align-items:", ";"], function (
|
77
|
-
var placement =
|
83
|
+
})(["display:flex;flex-direction:column-reverse;box-sizing:border-box;padding:0 1.5rem 1.5rem;max-height:100%;align-items:", ";"], function (_ref14) {
|
84
|
+
var placement = _ref14.placement;
|
78
85
|
return placement === 'bottom-left' ? 'flex-start' : 'flex-end';
|
79
86
|
});
|
@@ -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
|
+
```
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { css } from 'styled-components';
|
2
2
|
import { classes, tokens } from "../../Notification.tokens";
|
3
|
-
export var base = /*#__PURE__*/css([".", "{
|
3
|
+
export var base = /*#__PURE__*/css([".", "{padding:var(", ");}.", ".", "{padding:var(", ");&.", "{padding-right:var(", ");}}.", ".", ".", "{padding:var(", ");}"], classes.wrapper, tokens.padding, classes.wrapper, classes.horizontal, tokens.horizontalLayoutPadding, classes.withoutCloseIcon, tokens.horizontalLayoutRightPaddingWithoutCloseIcon, classes.wrapper, classes.horizontal, classes.oneLine, tokens.paddingOneLineTextbox);
|
@@ -20,18 +20,13 @@ export var composeNumberFormat = function composeNumberFormat(InputComponent) {
|
|
20
20
|
onChange(changeEvent, values);
|
21
21
|
}
|
22
22
|
};
|
23
|
-
var InputComponentWithoutEllipsis = /*#__PURE__*/forwardRef(function (props, ref) {
|
24
|
-
return /*#__PURE__*/React.createElement(InputComponent, _extends({
|
25
|
-
ref: ref,
|
26
|
-
_textEllipsisDisable: true
|
27
|
-
}, props));
|
28
|
-
});
|
29
23
|
return /*#__PURE__*/React.createElement(NumericFormat, _extends({
|
30
24
|
thousandSeparator: thousandSeparator,
|
31
25
|
decimalScale: decimalScale,
|
32
26
|
decimalSeparator: decimalSeparator,
|
33
|
-
customInput:
|
27
|
+
customInput: InputComponent,
|
34
28
|
getInputRef: outerRef,
|
29
|
+
_textEllipsisDisable: true,
|
35
30
|
onValueChange: handleChangeValue
|
36
31
|
}, rest));
|
37
32
|
});
|
@@ -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
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
export var titles = ['Выполнено', 'Внимание', 'Ошибка'];
|
2
|
-
export var texts = ['
|
2
|
+
export var texts = ['Задача организации, в особенности же сплочённость команды профессионалов требует определения и уточнения глубокомысленных рассуждений.', 'Задача организации, в особенности же сплочённость команды профессионалов требует определения и уточнения глубокомысленных рассуждений.', 'Задача организации, в особенности же сплочённость команды профессионалов требует определения и уточнения глубокомысленных рассуждений.'];
|
3
3
|
export var size = ['xs', 'xxs'];
|
4
4
|
export var iconPlacement = ['top', 'left'];
|
5
5
|
export var notificationsPlacements = ['center', 'top', 'bottom', 'right', 'left', 'top-right', 'top-left', 'bottom-right', 'bottom-left'];
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { css } from 'styled-components';
|
2
|
+
import { listTokens } from "../../../../components/List";
|
3
|
+
export var config = {
|
4
|
+
defaults: {
|
5
|
+
view: 'default',
|
6
|
+
size: 's'
|
7
|
+
},
|
8
|
+
variations: {
|
9
|
+
view: {
|
10
|
+
"default": /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-primary);", ":transparent;", ":var(--surface-transparent-secondary);", ":transparent;", ":transparent;", ":0.4;"], listTokens.listItemColor, listTokens.listItemColorHover, listTokens.listItemBackground, listTokens.listItemBackgroundHover, listTokens.listItemBorderColor, listTokens.listItemBorderColorHover, listTokens.listDisabledOpacity)
|
11
|
+
},
|
12
|
+
size: {
|
13
|
+
xs: /*#__PURE__*/css(["", ":0.5rem;", ":0.5rem;", ":0.5rem;", ":0.5rem;", ":0.5rem;", ":0rem;", ":0.375rem;", ":0.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);"], listTokens.listItemPaddingTop, listTokens.listItemPaddingLeft, listTokens.listItemPaddingRight, listTokens.listItemPaddingBottom, listTokens.listItemBorderRadius, listTokens.listItemBorderWidth, listTokens.listItemGap, listTokens.listItemTightDifference, listTokens.listItemFontFamily, listTokens.listItemFontSize, listTokens.listItemFontStyle, listTokens.listItemFontWeight, listTokens.listItemLetterSpacing, listTokens.listItemLineHeight),
|
14
|
+
s: /*#__PURE__*/css(["", ":0.689rem;", ":0.75rem;", ":0.75rem;", ":0.689rem;", ":0.625rem;", ":0rem;", ":0.375rem;", ":0.25rem;", ":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);"], listTokens.listItemPaddingTop, listTokens.listItemPaddingLeft, listTokens.listItemPaddingRight, listTokens.listItemPaddingBottom, listTokens.listItemBorderRadius, listTokens.listItemBorderWidth, listTokens.listItemGap, listTokens.listItemTightDifference, listTokens.listItemFontFamily, listTokens.listItemFontSize, listTokens.listItemFontStyle, listTokens.listItemFontWeight, listTokens.listItemLetterSpacing, listTokens.listItemLineHeight),
|
15
|
+
m: /*#__PURE__*/css(["", ":0.75rem;", ":0.875rem;", ":0.875rem;", ":0.75rem;", ":0.75rem;", ":0rem;", ":0.5rem;", ":0.25rem;", ":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);"], listTokens.listItemPaddingTop, listTokens.listItemPaddingLeft, listTokens.listItemPaddingRight, listTokens.listItemPaddingBottom, listTokens.listItemBorderRadius, listTokens.listItemBorderWidth, listTokens.listItemGap, listTokens.listItemTightDifference, listTokens.listItemFontFamily, listTokens.listItemFontSize, listTokens.listItemFontStyle, listTokens.listItemFontWeight, listTokens.listItemLetterSpacing, listTokens.listItemLineHeight),
|
16
|
+
l: /*#__PURE__*/css(["", ":1rem;", ":1rem;", ":1rem;", ":1rem;", ":0.875rem;", ":0rem;", ":0.5rem;", ":0.25rem;", ":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);"], listTokens.listItemPaddingTop, listTokens.listItemPaddingLeft, listTokens.listItemPaddingRight, listTokens.listItemPaddingBottom, listTokens.listItemBorderRadius, listTokens.listItemBorderWidth, listTokens.listItemGap, listTokens.listItemTightDifference, listTokens.listItemFontFamily, listTokens.listItemFontSize, listTokens.listItemFontStyle, listTokens.listItemFontWeight, listTokens.listItemLetterSpacing, listTokens.listItemLineHeight),
|
17
|
+
xl: /*#__PURE__*/css(["", ":1.3125rem;", ":1.125rem;", ":1.125rem;", ":1.3125rem;", ":1rem;", ":0rem;", ":0.5rem;", ":0.25rem;", ":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);"], listTokens.listItemPaddingTop, listTokens.listItemPaddingLeft, listTokens.listItemPaddingRight, listTokens.listItemPaddingBottom, listTokens.listItemBorderRadius, listTokens.listItemBorderWidth, listTokens.listItemGap, listTokens.listItemTightDifference, listTokens.listItemFontFamily, listTokens.listItemFontSize, listTokens.listItemFontStyle, listTokens.listItemFontWeight, listTokens.listItemLetterSpacing, listTokens.listItemLineHeight)
|
18
|
+
},
|
19
|
+
disabled: {
|
20
|
+
"true": /*#__PURE__*/css([""])
|
21
|
+
}
|
22
|
+
}
|
23
|
+
};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { listConfig, ListItem as ListItemComponent } from "../../../../components/List";
|
2
|
+
import { component, mergeConfig } from "../../../../engines";
|
3
|
+
import { config } from "./List.config";
|
4
|
+
var mergedConfig = /*#__PURE__*/mergeConfig(listConfig, config);
|
5
|
+
export var List = /*#__PURE__*/component(mergedConfig);
|
6
|
+
export var ListItem = ListItemComponent;
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import type { Meta } from '@storybook/react';
|
3
|
+
import styled from 'styled-components';
|
4
|
+
|
5
|
+
import { IconChevronLeft } from '../../../../components/_Icon';
|
6
|
+
import { WithTheme } from '../../../_helpers';
|
7
|
+
|
8
|
+
import { List, ListItem } from './List';
|
9
|
+
|
10
|
+
const ChevronRight = styled(IconChevronLeft)`
|
11
|
+
transform: rotate(180deg);
|
12
|
+
`;
|
13
|
+
|
14
|
+
const meta: Meta<typeof List> = {
|
15
|
+
title: 'b2c/Data Display/List',
|
16
|
+
component: List,
|
17
|
+
decorators: [WithTheme],
|
18
|
+
argTypes: {
|
19
|
+
size: {
|
20
|
+
options: ['xl', 'l', 'm', 's', 'xs'],
|
21
|
+
control: {
|
22
|
+
type: 'select',
|
23
|
+
},
|
24
|
+
},
|
25
|
+
view: {
|
26
|
+
options: ['default'],
|
27
|
+
control: {
|
28
|
+
type: 'select',
|
29
|
+
},
|
30
|
+
},
|
31
|
+
variant: {
|
32
|
+
options: ['normal', 'tight'],
|
33
|
+
control: {
|
34
|
+
type: 'select',
|
35
|
+
},
|
36
|
+
},
|
37
|
+
},
|
38
|
+
};
|
39
|
+
|
40
|
+
export default meta;
|
41
|
+
|
42
|
+
export const Default: Story = {
|
43
|
+
args: {
|
44
|
+
view: 'default',
|
45
|
+
size: 'm',
|
46
|
+
variant: 'normal',
|
47
|
+
disabled: false,
|
48
|
+
},
|
49
|
+
render: ({ view, size, ...rest }: StoryProps) => {
|
50
|
+
return (
|
51
|
+
<List view={view} size={size} {...rest}>
|
52
|
+
<ListItem contentRight={<ChevronRight color="inherit" size="xs" />}>Test Item 1</ListItem>
|
53
|
+
<ListItem contentRight={<ChevronRight color="inherit" size="xs" />}>Test Item 2</ListItem>
|
54
|
+
<ListItem contentRight={<ChevronRight color="inherit" size="xs" />} disabled>
|
55
|
+
Test Item 3
|
56
|
+
</ListItem>
|
57
|
+
<ListItem contentRight={<ChevronRight color="inherit" size="xs" />}>Test Item 4</ListItem>
|
58
|
+
</List>
|
59
|
+
);
|
60
|
+
},
|
61
|
+
};
|
package/styled-components/es/examples/plasma_b2c/components/Notification/Notification.stories.tsx
CHANGED
@@ -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
|
};
|