@salutejs/plasma-new-hope 0.325.0-canary.1954.15294244136.0 → 0.325.0-canary.1954.15296930381.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 +4 -0
- package/cjs/components/List/List.js +4 -9
- package/cjs/components/List/List.js.map +1 -1
- package/cjs/components/List/List.tokens.js +5 -2
- package/cjs/components/List/List.tokens.js.map +1 -1
- package/cjs/components/List/ui/ListItem.css +2 -2
- package/cjs/components/List/ui/ListItem.js +2 -1
- package/cjs/components/List/ui/ListItem.js.map +1 -1
- package/cjs/components/List/ui/ListItem.styles.js +1 -1
- package/cjs/components/List/ui/ListItem.styles.js.map +1 -1
- package/cjs/components/List/ui/ListItem.styles_106alid.css +2 -0
- package/cjs/components/List/variations/_disabled/base.js +1 -1
- package/cjs/components/List/variations/_disabled/base.js.map +1 -1
- package/cjs/components/List/variations/_disabled/base_1p96e1z.css +1 -0
- package/cjs/components/List/variations/_view/base.js +1 -1
- package/cjs/components/List/variations/_view/base.js.map +1 -1
- 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 +18 -14
- package/emotion/cjs/components/List/List.js +8 -13
- package/emotion/cjs/components/List/List.tokens.js +5 -2
- package/emotion/cjs/components/List/ui/ListItem.js +2 -1
- package/emotion/cjs/components/List/ui/ListItem.styles.js +2 -2
- package/emotion/cjs/components/List/variations/_disabled/base.js +3 -1
- package/emotion/cjs/components/List/variations/_view/base.js +3 -1
- 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 +8 -13
- package/emotion/cjs/examples/plasma_b2c/components/List/List.stories.tsx +1 -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 +8 -13
- package/emotion/cjs/examples/plasma_web/components/List/List.stories.tsx +1 -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/es/components/List/List.js +2 -7
- package/emotion/es/components/List/List.tokens.js +5 -2
- package/emotion/es/components/List/ui/ListItem.js +2 -1
- package/emotion/es/components/List/ui/ListItem.styles.js +3 -3
- package/emotion/es/components/List/variations/_disabled/base.js +3 -1
- package/emotion/es/components/List/variations/_view/base.js +3 -1
- 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 +8 -13
- package/emotion/es/examples/plasma_b2c/components/List/List.stories.tsx +1 -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 +8 -13
- package/emotion/es/examples/plasma_web/components/List/List.stories.tsx +1 -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/es/components/List/List.css +4 -0
- package/es/components/List/List.js +4 -9
- package/es/components/List/List.js.map +1 -1
- package/es/components/List/List.tokens.js +5 -2
- package/es/components/List/List.tokens.js.map +1 -1
- package/es/components/List/ui/ListItem.css +2 -2
- package/es/components/List/ui/ListItem.js +2 -1
- package/es/components/List/ui/ListItem.js.map +1 -1
- package/es/components/List/ui/ListItem.styles.js +1 -1
- package/es/components/List/ui/ListItem.styles.js.map +1 -1
- package/es/components/List/ui/ListItem.styles_106alid.css +2 -0
- package/es/components/List/variations/_disabled/base.js +1 -1
- package/es/components/List/variations/_disabled/base.js.map +1 -1
- package/es/components/List/variations/_disabled/base_1p96e1z.css +1 -0
- package/es/components/List/variations/_view/base.js +1 -1
- package/es/components/List/variations/_view/base.js.map +1 -1
- 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 +18 -14
- package/package.json +2 -2
- package/styled-components/cjs/components/List/List.js +8 -13
- package/styled-components/cjs/components/List/List.tokens.js +5 -2
- package/styled-components/cjs/components/List/ui/ListItem.js +2 -1
- package/styled-components/cjs/components/List/ui/ListItem.styles.js +1 -1
- package/styled-components/cjs/components/List/variations/_disabled/base.js +3 -1
- package/styled-components/cjs/components/List/variations/_view/base.js +3 -1
- 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 +8 -13
- package/styled-components/cjs/examples/plasma_b2c/components/List/List.stories.tsx +1 -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 +8 -13
- package/styled-components/cjs/examples/plasma_web/components/List/List.stories.tsx +1 -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/es/components/List/List.js +2 -7
- package/styled-components/es/components/List/List.tokens.js +5 -2
- package/styled-components/es/components/List/ui/ListItem.js +2 -1
- package/styled-components/es/components/List/ui/ListItem.styles.js +2 -2
- package/styled-components/es/components/List/variations/_disabled/base.js +3 -1
- package/styled-components/es/components/List/variations/_view/base.js +3 -1
- 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 +8 -13
- package/styled-components/es/examples/plasma_b2c/components/List/List.stories.tsx +1 -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 +8 -13
- package/styled-components/es/examples/plasma_web/components/List/List.stories.tsx +1 -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/types/components/List/List.d.ts +2 -9
- package/types/components/List/List.d.ts.map +1 -1
- package/types/components/List/List.tokens.d.ts +4 -1
- package/types/components/List/List.tokens.d.ts.map +1 -1
- package/types/components/List/List.types.d.ts +2 -4
- package/types/components/List/List.types.d.ts.map +1 -1
- package/types/components/List/ui/ListItem.d.ts.map +1 -1
- package/types/components/List/ui/ListItem.styles.d.ts +1 -3
- package/types/components/List/ui/ListItem.styles.d.ts.map +1 -1
- package/types/components/List/ui/ListItem.types.d.ts +0 -1
- package/types/components/List/ui/ListItem.types.d.ts.map +1 -1
- package/types/components/List/variations/_disabled/base.d.ts.map +1 -1
- package/types/components/List/variations/_view/base.d.ts.map +1 -1
- 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/cjs/components/List/ui/ListItem.styles_1eo5k14.css +0 -2
- package/cjs/components/List/variations/_disabled/base_x642ct.css +0 -1
- package/cjs/components/List/variations/_variant/base.js +0 -9
- package/cjs/components/List/variations/_variant/base.js.map +0 -1
- package/cjs/components/List/variations/_variant/base_x642ct.css +0 -1
- package/cjs/components/List/variations/_view/base_x642ct.css +0 -1
- package/cjs/components/Notification/variations/_layout/base_qkc3i4.css +0 -1
- package/emotion/cjs/components/List/variations/_variant/base.js +0 -8
- package/emotion/cjs/components/List/variations/_variant/tokens.json +0 -1
- package/emotion/es/components/List/variations/_variant/base.js +0 -2
- package/emotion/es/components/List/variations/_variant/tokens.json +0 -1
- package/es/components/List/ui/ListItem.styles_1eo5k14.css +0 -2
- package/es/components/List/variations/_disabled/base_x642ct.css +0 -1
- package/es/components/List/variations/_variant/base.js +0 -5
- package/es/components/List/variations/_variant/base.js.map +0 -1
- package/es/components/List/variations/_variant/base_x642ct.css +0 -1
- package/es/components/List/variations/_view/base_x642ct.css +0 -1
- package/es/components/Notification/variations/_layout/base_qkc3i4.css +0 -1
- package/styled-components/cjs/components/List/variations/_variant/base.js +0 -8
- package/styled-components/cjs/components/List/variations/_variant/tokens.json +0 -1
- package/styled-components/es/components/List/variations/_variant/base.js +0 -2
- package/styled-components/es/components/List/variations/_variant/tokens.json +0 -1
- package/types/components/List/variations/_variant/base.d.ts +0 -2
- package/types/components/List/variations/_variant/base.d.ts.map +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
|
+
```
|
@@ -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'];
|
@@ -3,26 +3,21 @@ import { listTokens } from "../../../../components/List";
|
|
3
3
|
export var config = {
|
4
4
|
defaults: {
|
5
5
|
view: 'default',
|
6
|
-
size: 's'
|
7
|
-
variant: 'normal'
|
6
|
+
size: 's'
|
8
7
|
},
|
9
8
|
variations: {
|
10
9
|
view: {
|
11
|
-
"default": /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-primary);", ":transparent;", ":var(--surface-transparent-secondary);", ":transparent;", ":transparent;"], listTokens.listItemColor, listTokens.listItemColorHover, listTokens.listItemBackground, listTokens.listItemBackgroundHover, listTokens.listItemBorderColor, listTokens.listItemBorderColorHover)
|
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)
|
12
11
|
},
|
13
12
|
size: {
|
14
|
-
xs: /*#__PURE__*/css(["", ":0.5rem;", ":0.5rem;", ":0.5rem;", ":0.5rem;", ":0.5rem;", ":0rem;", ":0.375rem;", ":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.listItemFontFamily, listTokens.listItemFontSize, listTokens.listItemFontStyle, listTokens.listItemFontWeight, listTokens.listItemLetterSpacing, listTokens.listItemLineHeight),
|
15
|
-
s: /*#__PURE__*/css(["", ":0.689rem;", ":0.75rem;", ":0.75rem;", ":0.689rem;", ":0.625rem;", ":0rem;", ":0.375rem;", ":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.listItemFontFamily, listTokens.listItemFontSize, listTokens.listItemFontStyle, listTokens.listItemFontWeight, listTokens.listItemLetterSpacing, listTokens.listItemLineHeight),
|
16
|
-
m: /*#__PURE__*/css(["", ":0.75rem;", ":0.875rem;", ":0.875rem;", ":0.75rem;", ":0.75rem;", ":0rem;", ":0.5rem;", ":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.listItemFontFamily, listTokens.listItemFontSize, listTokens.listItemFontStyle, listTokens.listItemFontWeight, listTokens.listItemLetterSpacing, listTokens.listItemLineHeight),
|
17
|
-
l: /*#__PURE__*/css(["", ":1rem;", ":1rem;", ":1rem;", ":1rem;", ":0.875rem;", ":0rem;", ":0.5rem;", ":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.listItemFontFamily, listTokens.listItemFontSize, listTokens.listItemFontStyle, listTokens.listItemFontWeight, listTokens.listItemLetterSpacing, listTokens.listItemLineHeight),
|
18
|
-
xl: /*#__PURE__*/css(["", ":1.3125rem;", ":1.125rem;", ":1.125rem;", ":1.3125rem;", ":1rem;", ":0rem;", ":0.5rem;", ":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.listItemFontFamily, listTokens.listItemFontSize, listTokens.listItemFontStyle, listTokens.listItemFontWeight, listTokens.listItemLetterSpacing, listTokens.listItemLineHeight)
|
19
|
-
},
|
20
|
-
variant: {
|
21
|
-
normal: /*#__PURE__*/css(["", ":0.4;", ":0rem;"], listTokens.listDisabledOpacity, listTokens.listItemVariantDifference),
|
22
|
-
tight: /*#__PURE__*/css(["", ":0.25rem;", ":0.4;"], listTokens.listItemVariantDifference, listTokens.listDisabledOpacity)
|
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)
|
23
18
|
},
|
24
19
|
disabled: {
|
25
|
-
"true": /*#__PURE__*/css([""
|
20
|
+
"true": /*#__PURE__*/css([""])
|
26
21
|
}
|
27
22
|
}
|
28
23
|
};
|
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
|
};
|
@@ -14,6 +14,7 @@ export var config = {
|
|
14
14
|
negative: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-negative);", ":var(--text-secondary);", ":var(--text-tertiary);", ":var(--text-negative);", ":var(--text-negative);", ":var(--surface-transparent-negative);", ":var(--surface-transparent-negative-hover);", ":var(--surface-transparent-negative-active);", ":var(--text-accent);", ":var(--text-tertiary);", ":var(--text-tertiary);", ":var(--text-primary);", ":var(--text-negative);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(--text-secondary-active);", ":var(--surface-negative);", ":var(--surface-negative);", ":var(--surface-accent);", ":var(--text-accent);", ":var(--surface-negative);", ":var(--text-tertiary);"], tokens.color, tokens.clearColor, tokens.placeholderColor, tokens.placeholderColorFocus, tokens.clearPlaceholderColor, tokens.clearPlaceholderColorFocus, tokens.backgroundColor, tokens.backgroundColorHover, tokens.backgroundColorFocus, tokens.caretColor, tokens.textBeforeColor, tokens.textAfterColor, tokens.labelColor, tokens.leftHelperColor, tokens.titleCaptionColor, tokens.hintIconColor, tokens.contentSlotColor, tokens.contentSlotColorHover, tokens.contentSlotColorActive, tokens.dividerColor, tokens.dividerColorHover, tokens.dividerColorFocus, tokens.focusColor, tokens.indicatorColor, tokens.optionalColor)
|
15
15
|
},
|
16
16
|
size: {
|
17
|
+
xl: /*#__PURE__*/css(["", ":4rem;", ":1.3125rem 1.125rem;", ":0.375rem;", ":1rem;", ":-0.0625rem 0.5rem -0.0625rem 0rem;", ":-0.0625rem 0rem -0.0625rem 0.75rem;", ":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);", ":0.75rem;", ":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);", ":-0.688rem -0.5rem;", ":2.375rem;", ":0.82rem -2.938rem auto auto;", ":0.82rem -2.063rem auto auto;", ":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);", ":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);", ":0.8125rem 0 0.125rem 0;", ":1.813rem 0 0.813rem 0;", ":0 0.25rem 0 0;", ":0 0 0 0.25rem;", ":0.125rem;", ":1rem;", ":0.625rem;", ":auto;", ":3.25rem;", ":0 0.75rem 0 1rem;", ":0.625rem;", ":0rem;", ":1.5rem;", ":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-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);", ":0.5rem;", ":0.375rem;", ":0 0 0 0;", ":0.5rem auto auto -0.75rem;", ":0 0 auto auto;", ":0.25rem -0.625rem auto auto;", ":1.75rem auto auto -0.875rem;", ":1.75rem -0.875rem auto auto;", ":1.75rem -2.488rem auto auto;"], tokens.height, tokens.padding, tokens.paddingWithChips, tokens.borderRadius, tokens.leftContentMargin, tokens.rightContentMargin, tokens.fontFamily, tokens.fontSize, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, tokens.lineHeight, tokens.labelOffset, tokens.clearLabelOffset, tokens.labelFontFamily, tokens.labelFontSize, tokens.labelFontStyle, tokens.labelFontWeight, tokens.labelLetterSpacing, tokens.labelLineHeight, tokens.hintMargin, tokens.hintTargetSize, tokens.hintInnerLabelPlacementOffset, tokens.clearHintInnerLabelPlacementOffset, tokens.titleCaptionInnerLabelOffset, tokens.titleCaptionFontFamily, tokens.titleCaptionFontSize, tokens.titleCaptionFontStyle, tokens.titleCaptionFontWeight, tokens.titleCaptionLetterSpacing, tokens.titleCaptionLineHeight, tokens.leftHelperOffset, tokens.leftHelperFontFamily, tokens.leftHelperFontSize, tokens.leftHelperFontStyle, tokens.leftHelperFontWeight, tokens.leftHelperLetterSpacing, tokens.leftHelperLineHeight, tokens.labelInnerPadding, tokens.contentLabelInnerPadding, tokens.textBeforeMargin, tokens.textAfterMargin, tokens.chipGap, tokens.chipMarginRight, tokens.chipBorderRadius, tokens.chipWidth, tokens.chipHeight, tokens.chipPadding, tokens.chipClearContentMarginLeft, tokens.chipClearContentMarginRight, tokens.chipCloseIconSize, tokens.chipFontFamily, tokens.chipFontSize, tokens.chipFontStyle, tokens.chipFontWeight, tokens.chipLetterSpacing, tokens.chipLineHeight, tokens.labelInnerFontFamily, tokens.labelInnerFontSize, tokens.labelInnerFontStyle, tokens.labelInnerFontWeight, tokens.labelInnerLetterSpacing, tokens.labelInnerLineHeight, tokens.indicatorSizeInner, tokens.indicatorSizeOuter, tokens.indicatorLabelPlacementInner, tokens.indicatorLabelPlacementOuter, tokens.indicatorLabelPlacementInnerRight, tokens.indicatorLabelPlacementOuterRight, tokens.clearIndicatorLabelPlacementInner, tokens.clearIndicatorLabelPlacementInnerRight, tokens.clearIndicatorHintInnerRight),
|
17
18
|
l: /*#__PURE__*/css(["", ":3.5rem;", ":1.0625rem 1.125rem 1.0625rem 1.125rem;", ":0.375rem;", ":0.875rem;", ":0.0625rem;", ":-0.0625rem 0.5rem -0.0625rem -0.125rem;", ":-0.0625rem -0.125rem -0.0625rem 0.75rem;", ":-0.0625rem -0.438rem -0.0625rem 0.75rem;", ":0.25rem;", ":-0.438rem -0.438rem -0.438rem 0;", ":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);", ":0.75rem;", ":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);", ":-0.688rem -0.5rem;", ":2.375rem;", ":0.563rem -2.938rem auto auto;", ":0.563rem -2.188rem auto auto;", ":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);", ":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);", ":0.5625rem 0 0.125rem 0;", ":1.5625rem 0 0.5625rem 0;", ":0.25rem;", ":0.5rem;", ":auto;", ":2.75rem;", ":0 0.75rem 0 1rem;", ":0.625rem;", ":0rem;", ":1.5rem;", ":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);", ":0.5rem;", ":0.375rem;", ":0 0 0 0;", ":0.5rem auto auto -0.75rem;", ":0 0 auto auto;", ":0.25rem -0.625rem auto auto;", ":1.5rem auto auto -0.875rem;", ":1.5rem -0.875rem auto auto;", ":1.5rem -2.488rem auto auto;", ":0 0.25rem 0 0;", ":0 0 0 0.25rem;"], tokens.height, tokens.padding, tokens.paddingWithChips, tokens.borderRadius, tokens.borderWidth, tokens.leftContentMargin, tokens.rightContentMargin, tokens.rightContentWithHintMargin, tokens.contentRightWrapperGap, tokens.contentRightWrapperMargin, tokens.fontFamily, tokens.fontSize, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, tokens.lineHeight, tokens.labelOffset, tokens.clearLabelOffset, tokens.labelFontFamily, tokens.labelFontSize, tokens.labelFontStyle, tokens.labelFontWeight, tokens.labelLetterSpacing, tokens.labelLineHeight, tokens.hintMargin, tokens.hintTargetSize, tokens.hintInnerLabelPlacementOffset, tokens.clearHintInnerLabelPlacementOffset, tokens.titleCaptionInnerLabelOffset, tokens.titleCaptionFontFamily, tokens.titleCaptionFontSize, tokens.titleCaptionFontStyle, tokens.titleCaptionFontWeight, tokens.titleCaptionLetterSpacing, tokens.titleCaptionLineHeight, tokens.leftHelperOffset, tokens.leftHelperFontFamily, tokens.leftHelperFontSize, tokens.leftHelperFontStyle, tokens.leftHelperFontWeight, tokens.leftHelperLetterSpacing, tokens.leftHelperLineHeight, tokens.labelInnerPadding, tokens.contentLabelInnerPadding, tokens.chipGap, tokens.chipBorderRadius, tokens.chipWidth, tokens.chipHeight, tokens.chipPadding, tokens.chipClearContentMarginLeft, tokens.chipClearContentMarginRight, tokens.chipCloseIconSize, tokens.chipFontFamily, tokens.chipFontSize, tokens.chipFontStyle, tokens.chipFontWeight, tokens.chipLetterSpacing, tokens.chipLineHeight, tokens.indicatorSizeInner, tokens.indicatorSizeOuter, tokens.indicatorLabelPlacementInner, tokens.indicatorLabelPlacementOuter, tokens.indicatorLabelPlacementInnerRight, tokens.indicatorLabelPlacementOuterRight, tokens.clearIndicatorLabelPlacementInner, tokens.clearIndicatorLabelPlacementInnerRight, tokens.clearIndicatorHintInnerRight, tokens.textBeforeMargin, tokens.textAfterMargin),
|
18
19
|
m: /*#__PURE__*/css(["", ":3rem;", ":0.875rem 1rem 0.875rem 1rem;", ":0.375rem;", ":0.75rem;", ":0.0625rem;", ":-0.125rem 0.375rem -0.125rem -0.125rem;", ":-0.125rem -0.125rem -0.125rem 0.75rem;", ":-0.125rem -0.438rem -0.125rem 0.75rem;", ":0.25rem;", ":-0.438rem -0.438rem -0.438rem 0;", ":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.625rem;", ":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);", ":-0.688rem -0.5rem;", ":2.375rem;", ":0.312rem -2.813rem auto auto;", ":0.312rem -2.188rem auto auto;", ":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);", ":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);", ":0.375rem 0 0.125rem 0;", ":1.375rem 0 0.375rem 0;", ":0.25rem;", ":0.375rem;", ":auto;", ":2.25rem;", ":0 0.625rem 0 0.875rem;", ":0.5rem;", ":0rem;", ":1.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);", ":0.5rem;", ":0.375rem;", ":0 0 0 0;", ":0.375rem auto auto -0.75rem;", ":0 0 auto auto;", ":0.25rem -0.6875rem auto auto;", ":1.25rem auto auto -0.875rem;", ":1.25rem -0.875rem auto auto;", ":1.25rem -2.488rem auto auto;", ":0 0.25rem 0 0;", ":0 0 0 0.25rem;"], tokens.height, tokens.padding, tokens.paddingWithChips, tokens.borderRadius, tokens.borderWidth, tokens.leftContentMargin, tokens.rightContentMargin, tokens.rightContentWithHintMargin, tokens.contentRightWrapperGap, tokens.contentRightWrapperMargin, tokens.fontFamily, tokens.fontSize, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, tokens.lineHeight, tokens.labelOffset, tokens.clearLabelOffset, tokens.labelFontFamily, tokens.labelFontSize, tokens.labelFontStyle, tokens.labelFontWeight, tokens.labelLetterSpacing, tokens.labelLineHeight, tokens.hintMargin, tokens.hintTargetSize, tokens.hintInnerLabelPlacementOffset, tokens.clearHintInnerLabelPlacementOffset, tokens.titleCaptionInnerLabelOffset, tokens.titleCaptionFontFamily, tokens.titleCaptionFontSize, tokens.titleCaptionFontStyle, tokens.titleCaptionFontWeight, tokens.titleCaptionLetterSpacing, tokens.titleCaptionLineHeight, tokens.leftHelperOffset, tokens.leftHelperFontFamily, tokens.leftHelperFontSize, tokens.leftHelperFontStyle, tokens.leftHelperFontWeight, tokens.leftHelperLetterSpacing, tokens.leftHelperLineHeight, tokens.labelInnerPadding, tokens.contentLabelInnerPadding, tokens.chipGap, tokens.chipBorderRadius, tokens.chipWidth, tokens.chipHeight, tokens.chipPadding, tokens.chipClearContentMarginLeft, tokens.chipClearContentMarginRight, tokens.chipCloseIconSize, tokens.chipFontFamily, tokens.chipFontSize, tokens.chipFontStyle, tokens.chipFontWeight, tokens.chipLetterSpacing, tokens.chipLineHeight, tokens.indicatorSizeInner, tokens.indicatorSizeOuter, tokens.indicatorLabelPlacementInner, tokens.indicatorLabelPlacementOuter, tokens.indicatorLabelPlacementInnerRight, tokens.indicatorLabelPlacementOuterRight, tokens.clearIndicatorLabelPlacementInner, tokens.clearIndicatorLabelPlacementInnerRight, tokens.clearIndicatorHintInnerRight, tokens.textBeforeMargin, tokens.textAfterMargin),
|
19
20
|
s: /*#__PURE__*/css(["", ":2.5rem;", ":0.6875rem 0.875rem 0.6875rem 0.875rem;", ":0.375rem;", ":0.625rem;", ":0.0625rem;", ":-0.1875rem 0.25rem -0.1875rem -0.125rem;", ":-0.1875rem -0.125rem -0.1875rem 0.75rem;", ":-0.1875rem -0.438rem -0.1875rem 0.75rem;", ":0.25rem;", ":-0.438rem -0.438rem -0.438rem 0;", ":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);", ":0.5rem;", ":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);", ":-0.688rem -0.5rem;", ":2.375rem;", ":0.062rem -2.688rem auto auto;", ":0.062rem -2.188rem auto auto;", ":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);", ":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);", ":0.3125rem 0 0 0;", ":1.0625rem 0 0.3125rem 0;", ":0.25rem;", ":0.25rem;", ":auto;", ":1.75rem;", ":0 0.5rem 0 0.75rem;", ":0.375rem;", ":0rem;", ":1rem;", ":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);", ":0.375rem;", ":0.375rem;", ":0 0 0 0;", ":0.3125rem auto auto -0.6875rem;", ":0 0 auto auto;", ":0.25rem -0.625rem auto auto;", ":1.063rem auto auto -0.75rem;", ":1.063rem -0.75rem auto auto;", ":1.063rem -2.238rem auto auto;", ":0 0.25rem 0 0;", ":0 0 0 0.25rem;"], tokens.height, tokens.padding, tokens.paddingWithChips, tokens.borderRadius, tokens.borderWidth, tokens.leftContentMargin, tokens.rightContentMargin, tokens.rightContentWithHintMargin, tokens.contentRightWrapperGap, tokens.contentRightWrapperMargin, tokens.fontFamily, tokens.fontSize, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, tokens.lineHeight, tokens.labelOffset, tokens.clearLabelOffset, tokens.labelFontFamily, tokens.labelFontSize, tokens.labelFontStyle, tokens.labelFontWeight, tokens.labelLetterSpacing, tokens.labelLineHeight, tokens.hintMargin, tokens.hintTargetSize, tokens.hintInnerLabelPlacementOffset, tokens.clearHintInnerLabelPlacementOffset, tokens.titleCaptionInnerLabelOffset, tokens.titleCaptionFontFamily, tokens.titleCaptionFontSize, tokens.titleCaptionFontStyle, tokens.titleCaptionFontWeight, tokens.titleCaptionLetterSpacing, tokens.titleCaptionLineHeight, tokens.leftHelperOffset, tokens.leftHelperFontFamily, tokens.leftHelperFontSize, tokens.leftHelperFontStyle, tokens.leftHelperFontWeight, tokens.leftHelperLetterSpacing, tokens.leftHelperLineHeight, tokens.labelInnerPadding, tokens.contentLabelInnerPadding, tokens.chipGap, tokens.chipBorderRadius, tokens.chipWidth, tokens.chipHeight, tokens.chipPadding, tokens.chipClearContentMarginLeft, tokens.chipClearContentMarginRight, tokens.chipCloseIconSize, tokens.chipFontFamily, tokens.chipFontSize, tokens.chipFontStyle, tokens.chipFontWeight, tokens.chipLetterSpacing, tokens.chipLineHeight, tokens.indicatorSizeInner, tokens.indicatorSizeOuter, tokens.indicatorLabelPlacementInner, tokens.indicatorLabelPlacementOuter, tokens.indicatorLabelPlacementInnerRight, tokens.indicatorLabelPlacementOuterRight, tokens.clearIndicatorLabelPlacementInner, tokens.clearIndicatorLabelPlacementInnerRight, tokens.clearIndicatorHintInnerRight, tokens.textBeforeMargin, tokens.textAfterMargin),
|
@@ -35,7 +36,7 @@ export var config = {
|
|
35
36
|
negative: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--surface-negative-hover);", ":var(--on-dark-text-primary);", ":var(--surface-negative-active);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":1;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly)
|
36
37
|
},
|
37
38
|
hintView: {
|
38
|
-
"default": /*#__PURE__*/css(["", ":var(--surface-solid-card-brightness);", ":var(--shadow-down-hard-m,0px 4px 12px 0px rgba(0,0,0,0.16),0px 1px 4px 0px rgba(0,0,0,0.08));", ":var(--text-primary);", ":var(--surface-solid-card);"], tokens.tooltipBackgroundColor, tokens.tooltipBoxShadow, tokens.tooltipColor, tokens.tooltipArrowBackground)
|
39
|
+
"default": /*#__PURE__*/css(["", ":var(--surface-solid-card-brightness);", ":var(--shadow-down-hard-m,0px 4px 12px 0px rgba(0,0,0,0.16),0px 1px 4px 0px rgba(0,0,0,0.08));", ":var(--text-primary);", ":var(--surface-solid-card-brightness);"], tokens.tooltipBackgroundColor, tokens.tooltipBoxShadow, tokens.tooltipColor, tokens.tooltipArrowBackground)
|
39
40
|
},
|
40
41
|
hintSize: {
|
41
42
|
m: /*#__PURE__*/css(["", ":0.6875rem;", ":0.875rem;", ":0.6875rem;", ":0.875rem;", ":2.5rem;", ":0.625rem;", ":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);", ":0.375rem;", ":1.25rem;", ":1.25rem;", ":url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggY2xpcC1ydWxlPSJldmVub2RkIiBkPSJtMC4xNywxMS44M2wyMCwwYy01LjUyLDAgLTEwLDMuNTkgLTEwLDhjMCwtNC40MSAtNC40OCwtOCAtMTAsLTh6IiBmaWxsPSIjMTcxNzE3IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGlkPSJUYWlsIi8+Cjwvc3ZnPg==\");", ":0.5rem;", ":0.625rem;"], tokens.tooltipPaddingTop, tokens.tooltipPaddingRight, tokens.tooltipPaddingBottom, tokens.tooltipPaddingLeft, tokens.tooltipMinHeight, tokens.tooltipBorderRadius, tokens.tooltipTextFontFamily, tokens.tooltipTextFontSize, tokens.tooltipTextFontStyle, tokens.tooltipTextFontWeight, tokens.tooltipTextFontLetterSpacing, tokens.tooltipTextFontLineHeight, tokens.tooltipContentLeftMargin, tokens.tooltipArrowMaskWidth, tokens.tooltipArrowMaskHeight, tokens.tooltipArrowMaskImage, tokens.tooltipArrowHeight, tokens.tooltipArrowEdgeMargin),
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import React, { ComponentProps, useState } from 'react';
|
2
2
|
import type { StoryObj, Meta } from '@storybook/react';
|
3
3
|
import { action } from '@storybook/addon-actions';
|
4
|
-
import { IconPlaceholder } from '@salutejs/plasma-sb-utils';
|
4
|
+
import { IconPlaceholder, getConfigVariations } from '@salutejs/plasma-sb-utils';
|
5
5
|
|
6
6
|
import { WithTheme } from '../../../_helpers';
|
7
7
|
import { IconCross, IconLock } from '../../../../components/_Icon';
|
8
8
|
import type { PopoverPlacement } from '../Popover/Popover';
|
9
9
|
|
10
10
|
import { TextField } from './TextField';
|
11
|
+
import { config } from './TextField.config';
|
11
12
|
|
12
13
|
const onChange = action('onChange');
|
13
14
|
const onFocus = action('onFocus');
|
@@ -15,8 +16,8 @@ const onBlur = action('onBlur');
|
|
15
16
|
const onSearch = action('onSearch');
|
16
17
|
const onChipsChange = action('onChipsChange');
|
17
18
|
|
18
|
-
const
|
19
|
-
|
19
|
+
const { views, sizes } = getConfigVariations(config);
|
20
|
+
|
20
21
|
const chipViews = ['default', 'secondary', 'accent', 'positive', 'warning', 'negative'];
|
21
22
|
const hintViews = ['default'];
|
22
23
|
const hintSizes = ['m', 's'];
|
@@ -63,6 +64,10 @@ const meta: Meta<typeof TextField> = {
|
|
63
64
|
control: {
|
64
65
|
type: 'select',
|
65
66
|
},
|
67
|
+
if: {
|
68
|
+
arg: 'optional',
|
69
|
+
truthy: false,
|
70
|
+
},
|
66
71
|
},
|
67
72
|
required: {
|
68
73
|
control: {
|
@@ -328,7 +333,7 @@ export const Default: StoryObj<StoryPropsDefault> = {
|
|
328
333
|
},
|
329
334
|
parameters: {
|
330
335
|
controls: {
|
331
|
-
exclude: ['chipType'],
|
336
|
+
exclude: ['chipType', 'chipView'],
|
332
337
|
},
|
333
338
|
},
|
334
339
|
render: (args) => <StoryDemo {...args} />,
|
@@ -3,26 +3,21 @@ import { listTokens } from "../../../../components/List";
|
|
3
3
|
export var config = {
|
4
4
|
defaults: {
|
5
5
|
view: 'default',
|
6
|
-
size: 's'
|
7
|
-
variant: 'normal'
|
6
|
+
size: 's'
|
8
7
|
},
|
9
8
|
variations: {
|
10
9
|
view: {
|
11
|
-
"default": /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-primary);", ":transparent;", ":var(--surface-transparent-secondary);", ":transparent;", ":transparent;"], listTokens.listItemColor, listTokens.listItemColorHover, listTokens.listItemBackground, listTokens.listItemBackgroundHover, listTokens.listItemBorderColor, listTokens.listItemBorderColorHover)
|
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)
|
12
11
|
},
|
13
12
|
size: {
|
14
|
-
xs: /*#__PURE__*/css(["", ":0.5rem;", ":0.5rem;", ":0.5rem;", ":0.5rem;", ":0.5rem;", ":0rem;", ":0.375rem;", ":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.listItemFontFamily, listTokens.listItemFontSize, listTokens.listItemFontStyle, listTokens.listItemFontWeight, listTokens.listItemLetterSpacing, listTokens.listItemLineHeight),
|
15
|
-
s: /*#__PURE__*/css(["", ":0.689rem;", ":0.75rem;", ":0.75rem;", ":0.689rem;", ":0.625rem;", ":0rem;", ":0.375rem;", ":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.listItemFontFamily, listTokens.listItemFontSize, listTokens.listItemFontStyle, listTokens.listItemFontWeight, listTokens.listItemLetterSpacing, listTokens.listItemLineHeight),
|
16
|
-
m: /*#__PURE__*/css(["", ":0.75rem;", ":0.875rem;", ":0.875rem;", ":0.75rem;", ":0.75rem;", ":0rem;", ":0.5rem;", ":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.listItemFontFamily, listTokens.listItemFontSize, listTokens.listItemFontStyle, listTokens.listItemFontWeight, listTokens.listItemLetterSpacing, listTokens.listItemLineHeight),
|
17
|
-
l: /*#__PURE__*/css(["", ":1rem;", ":1rem;", ":1rem;", ":1rem;", ":0.875rem;", ":0rem;", ":0.5rem;", ":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.listItemFontFamily, listTokens.listItemFontSize, listTokens.listItemFontStyle, listTokens.listItemFontWeight, listTokens.listItemLetterSpacing, listTokens.listItemLineHeight),
|
18
|
-
xl: /*#__PURE__*/css(["", ":1.3125rem;", ":1.125rem;", ":1.125rem;", ":1.3125rem;", ":1rem;", ":0rem;", ":0.5rem;", ":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.listItemFontFamily, listTokens.listItemFontSize, listTokens.listItemFontStyle, listTokens.listItemFontWeight, listTokens.listItemLetterSpacing, listTokens.listItemLineHeight)
|
19
|
-
},
|
20
|
-
variant: {
|
21
|
-
normal: /*#__PURE__*/css(["", ":0.4;", ":0rem;"], listTokens.listDisabledOpacity, listTokens.listItemVariantDifference),
|
22
|
-
tight: /*#__PURE__*/css(["", ":0.25rem;", ":0.4;"], listTokens.listItemVariantDifference, listTokens.listDisabledOpacity)
|
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)
|
23
18
|
},
|
24
19
|
disabled: {
|
25
|
-
"true": /*#__PURE__*/css([""
|
20
|
+
"true": /*#__PURE__*/css([""])
|
26
21
|
}
|
27
22
|
}
|
28
23
|
};
|
package/styled-components/es/examples/plasma_web/components/Notification/Notification.stories.tsx
CHANGED
@@ -170,12 +170,14 @@ type StoryLiveDemoProps = ComponentProps<typeof Notification> & {
|
|
170
170
|
placement?: NotificationPlacement;
|
171
171
|
};
|
172
172
|
|
173
|
-
const StoryLiveDemo = ({ timeout, placement, ...rest }: StoryLiveDemoProps) => {
|
173
|
+
const StoryLiveDemo = ({ timeout, placement, width, maxWidth, ...rest }: StoryLiveDemoProps) => {
|
174
174
|
const count = useRef(0);
|
175
175
|
const handleClick = useCallback(() => {
|
176
176
|
addNotification(
|
177
177
|
{
|
178
178
|
icon: <IconDisclosureRight color="inherit" />,
|
179
|
+
width,
|
180
|
+
maxWidth,
|
179
181
|
...rest,
|
180
182
|
...getNotificationProps(count.current),
|
181
183
|
},
|
@@ -213,6 +215,8 @@ export const LiveDemo: StoryObj<StoryLiveDemoProps> = {
|
|
213
215
|
role: 'alert',
|
214
216
|
layout: 'vertical',
|
215
217
|
placement: 'bottom-right',
|
218
|
+
width: '',
|
219
|
+
maxWidth: '',
|
216
220
|
},
|
217
221
|
render: (args) => <StoryLiveDemo {...args} />,
|
218
222
|
};
|
@@ -8,12 +8,13 @@ export var config = {
|
|
8
8
|
},
|
9
9
|
variations: {
|
10
10
|
view: {
|
11
|
-
"default": /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-primary);", ":var(--
|
12
|
-
positive: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-positive);", ":var(--text-
|
13
|
-
warning: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-warning);", ":var(--text-
|
14
|
-
negative: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-negative);", ":var(--text-
|
11
|
+
"default": /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-primary);", ":var(--text-secondary);", ":var(--text-tertiary);", ":var(--text-secondary);", ":var(--text-tertiary);", ":var(--surface-transparent-primary);", ":var(--surface-transparent-primary-hover);", ":var(--surface-transparent-secondary);", ":var(--text-accent);", ":var(--text-tertiary);", ":var(--text-tertiary);", ":var(--text-primary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(--text-secondary-active);", ":var(--outline-transparent-primary);", ":var(--outline-transparent-primary-hover);", ":var(--surface-accent);", ":var(--surface-transparent-tertiary);", ":var(--text-secondary);", ":var(--surface-accent);", ":var(--text-accent);", ":var(--surface-negative);", ":var(--text-tertiary);"], tokens.color, tokens.clearColor, tokens.placeholderColor, tokens.placeholderColorFocus, tokens.clearPlaceholderColor, tokens.clearPlaceholderColorFocus, tokens.backgroundColor, tokens.backgroundColorHover, tokens.backgroundColorFocus, tokens.caretColor, tokens.textBeforeColor, tokens.textAfterColor, tokens.labelColor, tokens.leftHelperColor, tokens.titleCaptionColor, tokens.hintIconColor, tokens.contentSlotColor, tokens.contentSlotColorHover, tokens.contentSlotColorActive, tokens.borderColor, tokens.borderColorHover, tokens.borderColorFocus, tokens.dividerColor, tokens.dividerColorHover, tokens.dividerColorFocus, tokens.focusColor, tokens.indicatorColor, tokens.optionalColor),
|
12
|
+
positive: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-positive);", ":var(--text-secondary);", ":var(--text-tertiary);", ":var(--text-positive);", ":var(--text-positive);", ":var(--surface-transparent-positive);", ":var(--surface-transparent-positive-hover);", ":var(--surface-transparent-positive-active);", ":var(--text-accent);", ":var(--text-tertiary);", ":var(--text-tertiary);", ":var(--text-primary);", ":var(--text-positive);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(--text-secondary-active);", ":var(--surface-positive);", ":var(--surface-positive);", ":var(--surface-accent);", ":var(--text-accent);", ":var(--surface-negative);", ":var(--text-tertiary);"], tokens.color, tokens.clearColor, tokens.placeholderColor, tokens.placeholderColorFocus, tokens.clearPlaceholderColor, tokens.clearPlaceholderColorFocus, tokens.backgroundColor, tokens.backgroundColorHover, tokens.backgroundColorFocus, tokens.caretColor, tokens.textBeforeColor, tokens.textAfterColor, tokens.labelColor, tokens.leftHelperColor, tokens.titleCaptionColor, tokens.hintIconColor, tokens.contentSlotColor, tokens.contentSlotColorHover, tokens.contentSlotColorActive, tokens.dividerColor, tokens.dividerColorHover, tokens.dividerColorFocus, tokens.focusColor, tokens.indicatorColor, tokens.optionalColor),
|
13
|
+
warning: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-warning);", ":var(--text-secondary);", ":var(--text-tertiary);", ":var(--text-warning);", ":var(--text-warning);", ":var(--surface-transparent-warning);", ":var(--surface-transparent-warning-hover);", ":var(--surface-transparent-warning-active);", ":var(--text-accent);", ":var(--text-tertiary);", ":var(--text-tertiary);", ":var(--text-primary);", ":var(--text-warning);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(--text-secondary-active);", ":var(--surface-warning);", ":var(--surface-warning);", ":var(--surface-accent);", ":var(--text-accent);", ":var(--surface-negative);", ":var(--text-tertiary);"], tokens.color, tokens.clearColor, tokens.placeholderColor, tokens.placeholderColorFocus, tokens.clearPlaceholderColor, tokens.clearPlaceholderColorFocus, tokens.backgroundColor, tokens.backgroundColorHover, tokens.backgroundColorFocus, tokens.caretColor, tokens.textBeforeColor, tokens.textAfterColor, tokens.labelColor, tokens.leftHelperColor, tokens.titleCaptionColor, tokens.hintIconColor, tokens.contentSlotColor, tokens.contentSlotColorHover, tokens.contentSlotColorActive, tokens.dividerColor, tokens.dividerColorHover, tokens.dividerColorFocus, tokens.focusColor, tokens.indicatorColor, tokens.optionalColor),
|
14
|
+
negative: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-negative);", ":var(--text-secondary);", ":var(--text-tertiary);", ":var(--text-negative);", ":var(--text-negative);", ":var(--surface-transparent-negative);", ":var(--surface-transparent-negative-hover);", ":var(--surface-transparent-negative-active);", ":var(--text-accent);", ":var(--text-tertiary);", ":var(--text-tertiary);", ":var(--text-primary);", ":var(--text-negative);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(--text-secondary-active);", ":var(--surface-negative);", ":var(--surface-negative);", ":var(--surface-accent);", ":var(--text-accent);", ":var(--surface-negative);", ":var(--text-tertiary);"], tokens.color, tokens.clearColor, tokens.placeholderColor, tokens.placeholderColorFocus, tokens.clearPlaceholderColor, tokens.clearPlaceholderColorFocus, tokens.backgroundColor, tokens.backgroundColorHover, tokens.backgroundColorFocus, tokens.caretColor, tokens.textBeforeColor, tokens.textAfterColor, tokens.labelColor, tokens.leftHelperColor, tokens.titleCaptionColor, tokens.hintIconColor, tokens.contentSlotColor, tokens.contentSlotColorHover, tokens.contentSlotColorActive, tokens.dividerColor, tokens.dividerColorHover, tokens.dividerColorFocus, tokens.focusColor, tokens.indicatorColor, tokens.optionalColor)
|
15
15
|
},
|
16
16
|
size: {
|
17
|
+
xl: /*#__PURE__*/css(["", ":4rem;", ":1.3125rem 1.125rem;", ":0.375rem;", ":1rem;", ":0.0625rem;", ":-0.0625rem 0.5rem -0.0625rem 0rem;", ":-0.0625rem 0rem -0.0625rem 0.75rem;", ":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);", ":0.75rem;", ":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);", ":-0.688rem -0.5rem;", ":2.375rem;", ":0.82rem -2.938rem auto auto;", ":0.82rem -2.063rem auto auto;", ":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);", ":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);", ":0.8125rem 0 0.125rem 0;", ":1.813rem 0 0.813rem 0;", ":0 0.25rem 0 0;", ":0 0 0 0.25rem;", ":0.125rem;", ":1rem;", ":0.625rem;", ":auto;", ":3.25rem;", ":0 0.75rem 0 1rem;", ":0.625rem;", ":0rem;", ":1.5rem;", ":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-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);", ":0.5rem;", ":0.375rem;", ":0 0 0 0;", ":0.5rem auto auto -0.75rem;", ":0 0 auto auto;", ":0.25rem -0.625rem auto auto;", ":-0.25rem;", ":1.75rem auto auto -0.875rem;", ":1.75rem -0.875rem auto auto;", ":1.75rem -2.488rem auto auto;"], tokens.height, tokens.padding, tokens.paddingWithChips, tokens.borderRadius, tokens.borderWidth, tokens.leftContentMargin, tokens.rightContentMargin, tokens.fontFamily, tokens.fontSize, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, tokens.lineHeight, tokens.labelOffset, tokens.clearLabelOffset, tokens.labelFontFamily, tokens.labelFontSize, tokens.labelFontStyle, tokens.labelFontWeight, tokens.labelLetterSpacing, tokens.labelLineHeight, tokens.hintMargin, tokens.hintTargetSize, tokens.hintInnerLabelPlacementOffset, tokens.clearHintInnerLabelPlacementOffset, tokens.titleCaptionInnerLabelOffset, tokens.titleCaptionFontFamily, tokens.titleCaptionFontSize, tokens.titleCaptionFontStyle, tokens.titleCaptionFontWeight, tokens.titleCaptionLetterSpacing, tokens.titleCaptionLineHeight, tokens.leftHelperOffset, tokens.leftHelperFontFamily, tokens.leftHelperFontSize, tokens.leftHelperFontStyle, tokens.leftHelperFontWeight, tokens.leftHelperLetterSpacing, tokens.leftHelperLineHeight, tokens.labelInnerPadding, tokens.contentLabelInnerPadding, tokens.textBeforeMargin, tokens.textAfterMargin, tokens.chipGap, tokens.chipMarginRight, tokens.chipBorderRadius, tokens.chipWidth, tokens.chipHeight, tokens.chipPadding, tokens.chipClearContentMarginLeft, tokens.chipClearContentMarginRight, tokens.chipCloseIconSize, tokens.chipFontFamily, tokens.chipFontSize, tokens.chipFontStyle, tokens.chipFontWeight, tokens.chipLetterSpacing, tokens.chipLineHeight, tokens.labelInnerFontFamily, tokens.labelInnerFontSize, tokens.labelInnerFontStyle, tokens.labelInnerFontWeight, tokens.labelInnerLetterSpacing, tokens.labelInnerLineHeight, tokens.indicatorSizeInner, tokens.indicatorSizeOuter, tokens.indicatorLabelPlacementInner, tokens.indicatorLabelPlacementOuter, tokens.indicatorLabelPlacementInnerRight, tokens.indicatorLabelPlacementOuterRight, tokens.indicatorLabelPlacementHintOuterRight, tokens.clearIndicatorLabelPlacementInner, tokens.clearIndicatorLabelPlacementInnerRight, tokens.clearIndicatorHintInnerRight),
|
17
18
|
l: /*#__PURE__*/css(["", ":3.5rem;", ":1.0625rem 1.125rem 1.0625rem 1.125rem;", ":0.375rem;", ":0.875rem;", ":0.0625rem;", ":-0.0625rem 0.5rem -0.0625rem -0.125rem;", ":-0.0625rem -0.125rem -0.0625rem 0.75rem;", ":-0.0625rem -0.438rem -0.0625rem 0.75rem;", ":0.25rem;", ":-0.438rem -0.438rem -0.438rem 0;", ":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);", ":0.75rem;", ":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);", ":-0.688rem -0.5rem;", ":2.375rem;", ":0.563rem -2.938rem auto auto;", ":0.563rem -2.188rem auto auto;", ":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);", ":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);", ":0.5625rem 0 0.125rem 0;", ":1.5625rem 0 0.5625rem 0;", ":0.25rem;", ":0.5rem;", ":auto;", ":2.75rem;", ":0 0.75rem 0 1rem;", ":0.625rem;", ":0rem;", ":1.5rem;", ":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);", ":0.5rem;", ":0.375rem;", ":0 0 0 0;", ":0.5rem auto auto -0.75rem;", ":0 0 auto auto;", ":0.25rem -0.625rem auto auto;", ":1.5rem auto auto -0.875rem;", ":1.5rem -0.875rem auto auto;", ":1.5rem -2.488rem auto auto;", ":0 0.25rem 0 0;", ":0 0 0 0.25rem;"], tokens.height, tokens.padding, tokens.paddingWithChips, tokens.borderRadius, tokens.borderWidth, tokens.leftContentMargin, tokens.rightContentMargin, tokens.rightContentWithHintMargin, tokens.contentRightWrapperGap, tokens.contentRightWrapperMargin, tokens.fontFamily, tokens.fontSize, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, tokens.lineHeight, tokens.labelOffset, tokens.clearLabelOffset, tokens.labelFontFamily, tokens.labelFontSize, tokens.labelFontStyle, tokens.labelFontWeight, tokens.labelLetterSpacing, tokens.labelLineHeight, tokens.hintMargin, tokens.hintTargetSize, tokens.hintInnerLabelPlacementOffset, tokens.clearHintInnerLabelPlacementOffset, tokens.titleCaptionInnerLabelOffset, tokens.titleCaptionFontFamily, tokens.titleCaptionFontSize, tokens.titleCaptionFontStyle, tokens.titleCaptionFontWeight, tokens.titleCaptionLetterSpacing, tokens.titleCaptionLineHeight, tokens.leftHelperOffset, tokens.leftHelperFontFamily, tokens.leftHelperFontSize, tokens.leftHelperFontStyle, tokens.leftHelperFontWeight, tokens.leftHelperLetterSpacing, tokens.leftHelperLineHeight, tokens.labelInnerPadding, tokens.contentLabelInnerPadding, tokens.chipGap, tokens.chipBorderRadius, tokens.chipWidth, tokens.chipHeight, tokens.chipPadding, tokens.chipClearContentMarginLeft, tokens.chipClearContentMarginRight, tokens.chipCloseIconSize, tokens.chipFontFamily, tokens.chipFontSize, tokens.chipFontStyle, tokens.chipFontWeight, tokens.chipLetterSpacing, tokens.chipLineHeight, tokens.indicatorSizeInner, tokens.indicatorSizeOuter, tokens.indicatorLabelPlacementInner, tokens.indicatorLabelPlacementOuter, tokens.indicatorLabelPlacementInnerRight, tokens.indicatorLabelPlacementOuterRight, tokens.clearIndicatorLabelPlacementInner, tokens.clearIndicatorLabelPlacementInnerRight, tokens.clearIndicatorHintInnerRight, tokens.textBeforeMargin, tokens.textAfterMargin),
|
18
19
|
m: /*#__PURE__*/css(["", ":3rem;", ":0.875rem 1rem 0.875rem 1rem;", ":0.375rem;", ":0.75rem;", ":0.0625rem;", ":-0.125rem 0.375rem -0.125rem -0.125rem;", ":-0.125rem -0.125rem -0.125rem 0.75rem;", ":-0.125rem -0.438rem -0.125rem 0.75rem;", ":0.25rem;", ":-0.438rem -0.438rem -0.438rem 0;", ":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.625rem;", ":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);", ":-0.688rem -0.5rem;", ":2.375rem;", ":0.312rem -2.813rem auto auto;", ":0.312rem -2.188rem auto auto;", ":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);", ":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);", ":0.375rem 0 0.125rem 0;", ":1.375rem 0 0.375rem 0;", ":0.25rem;", ":0.375rem;", ":auto;", ":2.25rem;", ":0 0.625rem 0 0.875rem;", ":0.5rem;", ":0rem;", ":1.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);", ":0.5rem;", ":0.375rem;", ":0 0 0 0;", ":0.375rem auto auto -0.75rem;", ":0 0 auto auto;", ":0.25rem -0.6875rem auto auto;", ":1.25rem auto auto -0.875rem;", ":1.25rem -0.875rem auto auto;", ":1.25rem -2.488rem auto auto;", ":0 0.25rem 0 0;", ":0 0 0 0.25rem;"], tokens.height, tokens.padding, tokens.paddingWithChips, tokens.borderRadius, tokens.borderWidth, tokens.leftContentMargin, tokens.rightContentMargin, tokens.rightContentWithHintMargin, tokens.contentRightWrapperGap, tokens.contentRightWrapperMargin, tokens.fontFamily, tokens.fontSize, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, tokens.lineHeight, tokens.labelOffset, tokens.clearLabelOffset, tokens.labelFontFamily, tokens.labelFontSize, tokens.labelFontStyle, tokens.labelFontWeight, tokens.labelLetterSpacing, tokens.labelLineHeight, tokens.hintMargin, tokens.hintTargetSize, tokens.hintInnerLabelPlacementOffset, tokens.clearHintInnerLabelPlacementOffset, tokens.titleCaptionInnerLabelOffset, tokens.titleCaptionFontFamily, tokens.titleCaptionFontSize, tokens.titleCaptionFontStyle, tokens.titleCaptionFontWeight, tokens.titleCaptionLetterSpacing, tokens.titleCaptionLineHeight, tokens.leftHelperOffset, tokens.leftHelperFontFamily, tokens.leftHelperFontSize, tokens.leftHelperFontStyle, tokens.leftHelperFontWeight, tokens.leftHelperLetterSpacing, tokens.leftHelperLineHeight, tokens.labelInnerPadding, tokens.contentLabelInnerPadding, tokens.chipGap, tokens.chipBorderRadius, tokens.chipWidth, tokens.chipHeight, tokens.chipPadding, tokens.chipClearContentMarginLeft, tokens.chipClearContentMarginRight, tokens.chipCloseIconSize, tokens.chipFontFamily, tokens.chipFontSize, tokens.chipFontStyle, tokens.chipFontWeight, tokens.chipLetterSpacing, tokens.chipLineHeight, tokens.indicatorSizeInner, tokens.indicatorSizeOuter, tokens.indicatorLabelPlacementInner, tokens.indicatorLabelPlacementOuter, tokens.indicatorLabelPlacementInnerRight, tokens.indicatorLabelPlacementOuterRight, tokens.clearIndicatorLabelPlacementInner, tokens.clearIndicatorLabelPlacementInnerRight, tokens.clearIndicatorHintInnerRight, tokens.textBeforeMargin, tokens.textAfterMargin),
|
19
20
|
s: /*#__PURE__*/css(["", ":2.5rem;", ":0.6875rem 0.875rem 0.6875rem 0.875rem;", ":0.375rem;", ":0.625rem;", ":0.0625rem;", ":-0.1875rem 0.25rem -0.1875rem -0.125rem;", ":-0.1875rem -0.125rem -0.1875rem 0.75rem;", ":-0.1875rem -0.438rem -0.1875rem 0.75rem;", ":0.25rem;", ":-0.438rem -0.438rem -0.438rem 0;", ":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);", ":0.5rem;", ":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);", ":-0.688rem -0.5rem;", ":2.375rem;", ":0.062rem -2.688rem auto auto;", ":0.062rem -2.188rem auto auto;", ":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);", ":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);", ":0.3125rem 0 0 0;", ":1.0625rem 0 0.3125rem 0;", ":0.25rem;", ":0.25rem;", ":auto;", ":1.75rem;", ":0 0.5rem 0 0.75rem;", ":0.375rem;", ":0rem;", ":1rem;", ":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);", ":0.375rem;", ":0.375rem;", ":0 0 0 0;", ":0.3125rem auto auto -0.6875rem;", ":0 0 auto auto;", ":0.25rem -0.625rem auto auto;", ":1.063rem auto auto -0.75rem;", ":1.063rem -0.75rem auto auto;", ":1.063rem -2.238rem auto auto;", ":0 0.25rem 0 0;", ":0 0 0 0.25rem;"], tokens.height, tokens.padding, tokens.paddingWithChips, tokens.borderRadius, tokens.borderWidth, tokens.leftContentMargin, tokens.rightContentMargin, tokens.rightContentWithHintMargin, tokens.contentRightWrapperGap, tokens.contentRightWrapperMargin, tokens.fontFamily, tokens.fontSize, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, tokens.lineHeight, tokens.labelOffset, tokens.clearLabelOffset, tokens.labelFontFamily, tokens.labelFontSize, tokens.labelFontStyle, tokens.labelFontWeight, tokens.labelLetterSpacing, tokens.labelLineHeight, tokens.hintMargin, tokens.hintTargetSize, tokens.hintInnerLabelPlacementOffset, tokens.clearHintInnerLabelPlacementOffset, tokens.titleCaptionInnerLabelOffset, tokens.titleCaptionFontFamily, tokens.titleCaptionFontSize, tokens.titleCaptionFontStyle, tokens.titleCaptionFontWeight, tokens.titleCaptionLetterSpacing, tokens.titleCaptionLineHeight, tokens.leftHelperOffset, tokens.leftHelperFontFamily, tokens.leftHelperFontSize, tokens.leftHelperFontStyle, tokens.leftHelperFontWeight, tokens.leftHelperLetterSpacing, tokens.leftHelperLineHeight, tokens.labelInnerPadding, tokens.contentLabelInnerPadding, tokens.chipGap, tokens.chipBorderRadius, tokens.chipWidth, tokens.chipHeight, tokens.chipPadding, tokens.chipClearContentMarginLeft, tokens.chipClearContentMarginRight, tokens.chipCloseIconSize, tokens.chipFontFamily, tokens.chipFontSize, tokens.chipFontStyle, tokens.chipFontWeight, tokens.chipLetterSpacing, tokens.chipLineHeight, tokens.indicatorSizeInner, tokens.indicatorSizeOuter, tokens.indicatorLabelPlacementInner, tokens.indicatorLabelPlacementOuter, tokens.indicatorLabelPlacementInnerRight, tokens.indicatorLabelPlacementOuterRight, tokens.clearIndicatorLabelPlacementInner, tokens.clearIndicatorLabelPlacementInnerRight, tokens.clearIndicatorHintInnerRight, tokens.textBeforeMargin, tokens.textAfterMargin),
|
@@ -35,7 +36,7 @@ export var config = {
|
|
35
36
|
negative: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--surface-negative-hover);", ":var(--on-dark-text-primary);", ":var(--surface-negative-active);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":1;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly)
|
36
37
|
},
|
37
38
|
hintView: {
|
38
|
-
"default": /*#__PURE__*/css(["", ":var(--surface-solid-card-brightness);", ":var(--shadow-down-hard-m,0px 4px 12px 0px rgba(0,0,0,0.16),0px 1px 4px 0px rgba(0,0,0,0.08));", ":var(--text-primary);", ":var(--surface-solid-card);"], tokens.tooltipBackgroundColor, tokens.tooltipBoxShadow, tokens.tooltipColor, tokens.tooltipArrowBackground)
|
39
|
+
"default": /*#__PURE__*/css(["", ":var(--surface-solid-card-brightness);", ":var(--shadow-down-hard-m,0px 4px 12px 0px rgba(0,0,0,0.16),0px 1px 4px 0px rgba(0,0,0,0.08));", ":var(--text-primary);", ":var(--surface-solid-card-brightness);"], tokens.tooltipBackgroundColor, tokens.tooltipBoxShadow, tokens.tooltipColor, tokens.tooltipArrowBackground)
|
39
40
|
},
|
40
41
|
hintSize: {
|
41
42
|
m: /*#__PURE__*/css(["", ":0.6875rem;", ":0.875rem;", ":0.6875rem;", ":0.875rem;", ":2.5rem;", ":0.625rem;", ":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);", ":0.375rem;", ":1.25rem;", ":1.25rem;", ":url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggY2xpcC1ydWxlPSJldmVub2RkIiBkPSJtMC4xNywxMS44M2wyMCwwYy01LjUyLDAgLTEwLDMuNTkgLTEwLDhjMCwtNC40MSAtNC40OCwtOCAtMTAsLTh6IiBmaWxsPSIjMTcxNzE3IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGlkPSJUYWlsIi8+Cjwvc3ZnPg==\");", ":0.5rem;", ":0.625rem;"], tokens.tooltipPaddingTop, tokens.tooltipPaddingRight, tokens.tooltipPaddingBottom, tokens.tooltipPaddingLeft, tokens.tooltipMinHeight, tokens.tooltipBorderRadius, tokens.tooltipTextFontFamily, tokens.tooltipTextFontSize, tokens.tooltipTextFontStyle, tokens.tooltipTextFontWeight, tokens.tooltipTextFontLetterSpacing, tokens.tooltipTextFontLineHeight, tokens.tooltipContentLeftMargin, tokens.tooltipArrowMaskWidth, tokens.tooltipArrowMaskHeight, tokens.tooltipArrowMaskImage, tokens.tooltipArrowHeight, tokens.tooltipArrowEdgeMargin),
|
@@ -45,7 +46,7 @@ export var config = {
|
|
45
46
|
"true": /*#__PURE__*/css(["", ":0.4;"], tokens.disabledOpacity)
|
46
47
|
},
|
47
48
|
readOnly: {
|
48
|
-
"true": /*#__PURE__*/css(["", ":0.4;", ":var(--text-primary);", ":var(--surface-clear);", ":var(--outline-transparent-primary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-primary);", ":var(--surface-transparent-primary);"], tokens.readOnlyOpacity, tokens.colorReadOnly, tokens.backgroundColorReadOnly, tokens.borderColorReadOnly, tokens.placeholderColorReadOnly, tokens.leftHelperColorReadOnly, tokens.titleCaptionColorReadOnly, tokens.labelColorReadOnly, tokens.dividerColorReadOnly)
|
49
|
+
"true": /*#__PURE__*/css(["", ":var(--text-secondary);", ":var(--surface-transparent-primary);", ":0.4;", ":var(--text-primary);", ":var(--surface-clear);", ":var(--outline-transparent-primary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--surface-transparent-primary);", ":var(--text-primary);", ":var(--surface-transparent-primary);"], tokens.colorReadOnly, tokens.backgroundColorReadOnly, tokens.readOnlyOpacity, tokens.colorReadOnly, tokens.backgroundColorReadOnly, tokens.borderColorReadOnly, tokens.placeholderColorReadOnly, tokens.leftHelperColorReadOnly, tokens.titleCaptionColorReadOnly, tokens.labelColorReadOnly, tokens.dividerColorReadOnly, tokens.labelColorReadOnly, tokens.dividerColorReadOnly)
|
49
50
|
}
|
50
51
|
}
|
51
52
|
};
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import React, { ComponentProps, useState } from 'react';
|
2
2
|
import type { StoryObj, Meta } from '@storybook/react';
|
3
3
|
import { action } from '@storybook/addon-actions';
|
4
|
-
import { IconPlaceholder } from '@salutejs/plasma-sb-utils';
|
4
|
+
import { IconPlaceholder, getConfigVariations } from '@salutejs/plasma-sb-utils';
|
5
5
|
|
6
6
|
import { WithTheme } from '../../../_helpers';
|
7
7
|
import { IconCross, IconLock } from '../../../../components/_Icon';
|
8
8
|
import type { PopoverPlacement } from '../Popover/Popover';
|
9
9
|
|
10
10
|
import { TextField } from './TextField';
|
11
|
+
import { config } from './TextField.config';
|
11
12
|
|
12
13
|
const onChange = action('onChange');
|
13
14
|
const onFocus = action('onFocus');
|
@@ -15,14 +16,14 @@ const onBlur = action('onBlur');
|
|
15
16
|
const onSearch = action('onSearch');
|
16
17
|
const onChipsChange = action('onChipsChange');
|
17
18
|
|
18
|
-
const
|
19
|
-
|
19
|
+
const { views, sizes } = getConfigVariations(config);
|
20
|
+
|
20
21
|
const chipViews = ['default', 'secondary', 'accent', 'positive', 'warning', 'negative'];
|
21
22
|
const hintViews = ['default'];
|
22
23
|
const hintSizes = ['m', 's'];
|
23
24
|
const hintTriggers = ['hover', 'click'];
|
24
|
-
const hintTargetPlacements = ['outer', 'inner'];
|
25
25
|
const labelPlacements = ['outer', 'inner'];
|
26
|
+
const hintTargetPlacements = ['outer', 'inner'];
|
26
27
|
const placements: Array<PopoverPlacement> = [
|
27
28
|
'top',
|
28
29
|
'top-start',
|
@@ -63,6 +64,10 @@ const meta: Meta<typeof TextField> = {
|
|
63
64
|
control: {
|
64
65
|
type: 'select',
|
65
66
|
},
|
67
|
+
if: {
|
68
|
+
arg: 'optional',
|
69
|
+
truthy: false,
|
70
|
+
},
|
66
71
|
},
|
67
72
|
required: {
|
68
73
|
control: {
|
@@ -322,7 +327,7 @@ export const Default: StoryObj<StoryPropsDefault> = {
|
|
322
327
|
},
|
323
328
|
parameters: {
|
324
329
|
controls: {
|
325
|
-
exclude: ['chipType'],
|
330
|
+
exclude: ['chipType', 'chipView'],
|
326
331
|
},
|
327
332
|
},
|
328
333
|
render: (args) => <StoryDemo {...args} />,
|