@salutejs/plasma-new-hope 0.67.0-canary.1148.8444175533.0 → 0.67.0-canary.1148.8449780048.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Cell/Cell.js +3 -0
- package/cjs/components/Cell/Cell.js.map +1 -1
- package/cjs/components/Cell/Cell.tokens.js +2 -3
- package/cjs/components/Cell/Cell.tokens.js.map +1 -1
- package/es/components/Cell/Cell.js +3 -0
- package/es/components/Cell/Cell.js.map +1 -1
- package/es/components/Cell/Cell.tokens.js +2 -3
- package/es/components/Cell/Cell.tokens.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Avatar/Avatar.template-doc.mdx +97 -0
- package/styled-components/cjs/components/AvatarGroup/AvatarGroup.template-doc.mdx +29 -0
- package/styled-components/cjs/components/Badge/Badge.template-doc.mdx +131 -0
- package/styled-components/cjs/components/Button/Button.template-doc.mdx +162 -0
- package/styled-components/cjs/components/ButtonGroup/ButtonGroup.template-doc.mdx +123 -0
- package/styled-components/cjs/components/Calendar/Calendar.template-doc.mdx +208 -0
- package/styled-components/cjs/components/Cell/Cell.js +3 -0
- package/styled-components/cjs/components/Cell/Cell.tokens.js +2 -3
- package/styled-components/cjs/components/Checkbox/Checkbox.template-doc.mdx +44 -0
- package/styled-components/cjs/components/Chip/Chip.template-doc.mdx +90 -0
- package/styled-components/cjs/components/Combobox/Combobox.template-doc.mdx +237 -0
- package/styled-components/cjs/components/Counter/Counter.template-doc.mdx +76 -0
- package/styled-components/cjs/components/Drawer/Drawer.template-doc.mdx +170 -0
- package/styled-components/cjs/components/Dropdown/Dropdown.template-doc.mdx +80 -0
- package/styled-components/cjs/components/Grid/Grid.template-doc.mdx +142 -0
- package/styled-components/cjs/components/Image/Image.template-doc.mdx +26 -0
- package/styled-components/cjs/components/Indicator/Indicator.template-doc.mdx +76 -0
- package/styled-components/cjs/components/Link/Link.template-doc.mdx +23 -0
- package/styled-components/cjs/components/Modal/Modal.template-doc.mdx +56 -0
- package/styled-components/cjs/components/Notification/Notification.template-doc.mdx +59 -0
- package/styled-components/cjs/components/Overlay/Overlay.template-doc.mdx +10 -0
- package/styled-components/cjs/components/Popover/Popover.template-doc.mdx +72 -0
- package/styled-components/cjs/components/Popup/Popup.template-doc.mdx +209 -0
- package/styled-components/cjs/components/Radiobox/Radiobox.template-doc.mdx +38 -0
- package/styled-components/cjs/components/Segment/Segment.template-doc.mdx +61 -0
- package/styled-components/cjs/components/Select/Select.template-doc.mdx +115 -0
- package/styled-components/cjs/components/Skeleton/Skeleton.template-doc.mdx +103 -0
- package/styled-components/cjs/components/Spinner/Spinner.template-doc.mdx +21 -0
- package/styled-components/cjs/components/Switch/Switch.template-doc.mdx +24 -0
- package/styled-components/cjs/components/Tabs/Tabs.template-doc.mdx +94 -0
- package/styled-components/cjs/components/TextArea/TextArea.template-doc.mdx +88 -0
- package/styled-components/cjs/components/TextField/TextField.template-doc.mdx +112 -0
- package/styled-components/cjs/components/Toast/Toast.template-doc.mdx +153 -0
- package/styled-components/cjs/components/Tooltip/Tooltip.template-doc.mdx +30 -0
- package/styled-components/cjs/components/Typography/Typography.template-doc.mdx +127 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Cell/Cell.config.js +5 -5
- package/styled-components/cjs/examples/plasma_b2c/components/Cell/Cell.stories.tsx +16 -19
- package/styled-components/cjs/examples/plasma_web/components/Cell/Cell.config.js +5 -5
- package/styled-components/cjs/examples/plasma_web/components/Cell/Cell.stories.tsx +16 -19
- package/styled-components/es/components/Avatar/Avatar.template-doc.mdx +97 -0
- package/styled-components/es/components/AvatarGroup/AvatarGroup.template-doc.mdx +29 -0
- package/styled-components/es/components/Badge/Badge.template-doc.mdx +131 -0
- package/styled-components/es/components/Button/Button.template-doc.mdx +162 -0
- package/styled-components/es/components/ButtonGroup/ButtonGroup.template-doc.mdx +123 -0
- package/styled-components/es/components/Calendar/Calendar.template-doc.mdx +208 -0
- package/styled-components/es/components/Cell/Cell.js +3 -0
- package/styled-components/es/components/Cell/Cell.tokens.js +2 -3
- package/styled-components/es/components/Checkbox/Checkbox.template-doc.mdx +44 -0
- package/styled-components/es/components/Chip/Chip.template-doc.mdx +90 -0
- package/styled-components/es/components/Combobox/Combobox.template-doc.mdx +237 -0
- package/styled-components/es/components/Counter/Counter.template-doc.mdx +76 -0
- package/styled-components/es/components/Drawer/Drawer.template-doc.mdx +170 -0
- package/styled-components/es/components/Dropdown/Dropdown.template-doc.mdx +80 -0
- package/styled-components/es/components/Grid/Grid.template-doc.mdx +142 -0
- package/styled-components/es/components/Image/Image.template-doc.mdx +26 -0
- package/styled-components/es/components/Indicator/Indicator.template-doc.mdx +76 -0
- package/styled-components/es/components/Link/Link.template-doc.mdx +23 -0
- package/styled-components/es/components/Modal/Modal.template-doc.mdx +56 -0
- package/styled-components/es/components/Notification/Notification.template-doc.mdx +59 -0
- package/styled-components/es/components/Overlay/Overlay.template-doc.mdx +10 -0
- package/styled-components/es/components/Popover/Popover.template-doc.mdx +72 -0
- package/styled-components/es/components/Popup/Popup.template-doc.mdx +209 -0
- package/styled-components/es/components/Radiobox/Radiobox.template-doc.mdx +38 -0
- package/styled-components/es/components/Segment/Segment.template-doc.mdx +61 -0
- package/styled-components/es/components/Select/Select.template-doc.mdx +115 -0
- package/styled-components/es/components/Skeleton/Skeleton.template-doc.mdx +103 -0
- package/styled-components/es/components/Spinner/Spinner.template-doc.mdx +21 -0
- package/styled-components/es/components/Switch/Switch.template-doc.mdx +24 -0
- package/styled-components/es/components/Tabs/Tabs.template-doc.mdx +94 -0
- package/styled-components/es/components/TextArea/TextArea.template-doc.mdx +88 -0
- package/styled-components/es/components/TextField/TextField.template-doc.mdx +112 -0
- package/styled-components/es/components/Toast/Toast.template-doc.mdx +153 -0
- package/styled-components/es/components/Tooltip/Tooltip.template-doc.mdx +30 -0
- package/styled-components/es/components/Typography/Typography.template-doc.mdx +127 -0
- package/styled-components/es/examples/plasma_b2c/components/Cell/Cell.config.js +5 -5
- package/styled-components/es/examples/plasma_b2c/components/Cell/Cell.stories.tsx +16 -19
- package/styled-components/es/examples/plasma_web/components/Cell/Cell.config.js +5 -5
- package/styled-components/es/examples/plasma_web/components/Cell/Cell.stories.tsx +16 -19
- package/types/components/Cell/Cell.d.ts +4 -2
- package/types/components/Cell/Cell.d.ts.map +1 -1
- package/types/components/Cell/Cell.tokens.d.ts +0 -1
- package/types/components/Cell/Cell.tokens.d.ts.map +1 -1
- package/types/components/Cell/Cell.types.d.ts +5 -2
- package/types/components/Cell/Cell.types.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Cell/Cell.d.ts +2 -1
- package/types/examples/plasma_b2c/components/Cell/Cell.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Cell/Cell.d.ts +2 -1
- package/types/examples/plasma_web/components/Cell/Cell.d.ts.map +1 -1
@@ -0,0 +1,153 @@
|
|
1
|
+
---
|
2
|
+
id: toast
|
3
|
+
title: Toast
|
4
|
+
---
|
5
|
+
|
6
|
+
import { PropsTable, Description } from '@site/src/components';
|
7
|
+
|
8
|
+
# Toast
|
9
|
+
<Description name="Toast" />
|
10
|
+
<PropsTable name="Toast" />
|
11
|
+
|
12
|
+
## Система подсказок
|
13
|
+
Существует готовая система текстовых подсказок, для использования которой необходимо обернуть приложение в `ToastProvider`:
|
14
|
+
|
15
|
+
```jsx title="App.tsx"
|
16
|
+
import React from 'react';
|
17
|
+
import { ToastProvider } from '@salutejs/{{ package }}';
|
18
|
+
|
19
|
+
export const App = () => (
|
20
|
+
<ToastProvider>
|
21
|
+
<div className="App">Hello, world!</div>
|
22
|
+
</ToastProvider>
|
23
|
+
);
|
24
|
+
```
|
25
|
+
|
26
|
+
После этого, с помощью хука `useToast` можно получить доступ к управлению подсказками.
|
27
|
+
|
28
|
+
```jsx title="MyComponent.tsx"
|
29
|
+
import React from 'react'
|
30
|
+
import { useToast, Button } from '@salutejs/{{ package }}'
|
31
|
+
|
32
|
+
export const MyComponent = () => {
|
33
|
+
const { showToast, hideToast } = useToast()
|
34
|
+
|
35
|
+
const onHide = () => {}
|
36
|
+
|
37
|
+
return (
|
38
|
+
<Button onClick={() => showToast({ text, position, timeout, fade, contentLeft, role, onHide })} />
|
39
|
+
)
|
40
|
+
}
|
41
|
+
```
|
42
|
+
|
43
|
+
`showToast` имеет необязательный аргумент `position`, отвечающий за позиционирование подсказки.
|
44
|
+
|
45
|
+
```ts
|
46
|
+
type Position = 'top' | 'bottom';
|
47
|
+
```
|
48
|
+
|
49
|
+
`showToast` имеет необязательный аргумент `timeout`, отвечающий за время отображения подсказки.
|
50
|
+
Если аргумент не передается, по умолчанию подсказка отображается пока пользователь ее не закроет.
|
51
|
+
|
52
|
+
Скрыть текущую подсказку в любой момент можно с помощью функции `hideToast`.
|
53
|
+
|
54
|
+
## Аргументы функции `showToast`
|
55
|
+
| Название | Тип | Значение | Описание |
|
56
|
+
|----------|-----------------|----------|--------------------|
|
57
|
+
| `args` | `ShowToastArgs` | | Конфигурация toast |
|
58
|
+
|
59
|
+
```ts
|
60
|
+
import type { ReactNode } from 'react';
|
61
|
+
|
62
|
+
export interface ShowToastArgs {
|
63
|
+
/**
|
64
|
+
* Текстовая надпись
|
65
|
+
*/
|
66
|
+
text?: string;
|
67
|
+
/**
|
68
|
+
* Слот для контента слева, например `Icon`
|
69
|
+
*/
|
70
|
+
contentLeft?: ReactNode;
|
71
|
+
/**
|
72
|
+
* Место отображения подсказки
|
73
|
+
*/
|
74
|
+
position?: ToastPosition;
|
75
|
+
/**
|
76
|
+
* WAI-ARIA роль
|
77
|
+
*/
|
78
|
+
role?: ToastRole;
|
79
|
+
/**
|
80
|
+
* Отображать ли подложку блока подсказки
|
81
|
+
*/
|
82
|
+
fade?: boolean;
|
83
|
+
/**
|
84
|
+
* Значение для дополнительно отступа блока подсказки, считается в rem.
|
85
|
+
*/
|
86
|
+
offset?: number;
|
87
|
+
/**
|
88
|
+
* Блок подсказки c округлым border-radius
|
89
|
+
*/
|
90
|
+
pilled?: boolean;
|
91
|
+
/**
|
92
|
+
* Отображать ли иконку закрытия
|
93
|
+
*/
|
94
|
+
hasClose?: boolean;
|
95
|
+
/**
|
96
|
+
* Размер блока подсказки
|
97
|
+
*/
|
98
|
+
size?: string;
|
99
|
+
/**
|
100
|
+
* Вид блока подсказки
|
101
|
+
*/
|
102
|
+
view?: string;
|
103
|
+
/**
|
104
|
+
* Время отображения подсказки. Если не передать значение, подсказка будет отображаться пока ее не закроют.
|
105
|
+
*/
|
106
|
+
timeout?: number;
|
107
|
+
/**
|
108
|
+
* callback срабатывающий в момент события hideToast
|
109
|
+
*/
|
110
|
+
onHide?: () => void;
|
111
|
+
/**
|
112
|
+
* callback срабатывающий в момент события showToast
|
113
|
+
*/
|
114
|
+
onShow?: () => void;
|
115
|
+
}
|
116
|
+
```
|
117
|
+
|
118
|
+
## Пример использования
|
119
|
+
|
120
|
+
```jsx live
|
121
|
+
import React from 'react'
|
122
|
+
import { useToast, ToastProvider, Button } from '@salutejs/{{ package }}'
|
123
|
+
|
124
|
+
export function App() {
|
125
|
+
|
126
|
+
const ToastExample = () => {
|
127
|
+
const { showToast, hideToast } = useToast()
|
128
|
+
|
129
|
+
const onShow = () => {}
|
130
|
+
const onHide = () => {}
|
131
|
+
const toastData = {
|
132
|
+
text: 'Подсказка вызванная showToast',
|
133
|
+
position: 'bottom',
|
134
|
+
role: 'status',
|
135
|
+
hasClose: true,
|
136
|
+
fade: false,
|
137
|
+
size: 'm',
|
138
|
+
view: 'dark',
|
139
|
+
timeout: 3000,
|
140
|
+
onShow,
|
141
|
+
onHide
|
142
|
+
}
|
143
|
+
|
144
|
+
return <Button onClick={() => showToast(toastData)} text="Вызвать подсказку" />
|
145
|
+
}
|
146
|
+
|
147
|
+
return (
|
148
|
+
<ToastProvider>
|
149
|
+
<ToastExample />
|
150
|
+
</ToastProvider>
|
151
|
+
)
|
152
|
+
}
|
153
|
+
```
|
@@ -0,0 +1,30 @@
|
|
1
|
+
---
|
2
|
+
id: Tooltip
|
3
|
+
title: Tooltip
|
4
|
+
---
|
5
|
+
|
6
|
+
import { PropsTable, Description } from '@site/src/components';
|
7
|
+
|
8
|
+
# Tooltip
|
9
|
+
<Description name="Tooltip" />
|
10
|
+
<PropsTable name="Tooltip" />
|
11
|
+
|
12
|
+
## Базовое применение
|
13
|
+
|
14
|
+
`Tooltip` оборачивает собой любой компонент и открывается в заданную сторону(причем можно передавать массив, тогда сторона будет определяться автоматически из переданных).
|
15
|
+
|
16
|
+
Предполагается оборачивать иконки из пакета `@salutejs/plasma-icons`
|
17
|
+
|
18
|
+
```tsx live
|
19
|
+
import React from 'react';
|
20
|
+
import { Tooltip } from '@salutejs/{{ package }}';
|
21
|
+
import { IconApps } from '@salutejs/plasma-icons';
|
22
|
+
|
23
|
+
export function App() {
|
24
|
+
return (
|
25
|
+
<div style=\{{marginLeft: '100px',marginBottom: '35px'}}>
|
26
|
+
<Tooltip target={( <IconApps />)} text="Высокое качество воспроизведения" placement="bottom" hasArrow isOpen />
|
27
|
+
</div>
|
28
|
+
);
|
29
|
+
}
|
30
|
+
```
|
@@ -0,0 +1,127 @@
|
|
1
|
+
---
|
2
|
+
id: typography
|
3
|
+
title: Typography
|
4
|
+
---
|
5
|
+
|
6
|
+
# Typography
|
7
|
+
В состав Plasma Web входят компоненты, реализующие типографическую систему [типографическую систему Plasma](../../design/typography).
|
8
|
+
Они заменяют обычные HTML-теги, такие, как `h1`, `h2`, `h3`, `h4`, `p`, etc.
|
9
|
+
|
10
|
+
## Установка шрифта
|
11
|
+
Компоненты типографики используют фирменный шрифт **SB Sans Text**.
|
12
|
+
О том, как установить данный шрифт, смотрите на странице [Типографическая система](../../design/typography#установка-шрифта).
|
13
|
+
|
14
|
+
## Отступы
|
15
|
+
По умолчанию типографика поддерживает стандартные отступы.
|
16
|
+
О том, как использовать отступы, читайте на странице [Стандартные отступы](../../design/spacing#встроенные-отступы-в-типографике).
|
17
|
+
|
18
|
+
## Переносы
|
19
|
+
По умолчанию в типографике слова переносятся по слогам.
|
20
|
+
Чтобы отключить данный функционал, необходимо установить свойство `breakWord` в значении `false`.
|
21
|
+
|
22
|
+
## Состав
|
23
|
+
|
24
|
+
### Hero unit
|
25
|
+
|
26
|
+
```tsx live
|
27
|
+
import React from 'react';
|
28
|
+
import { DsplL, DsplM, DsplS } from '@salutejs/{{ package }}';
|
29
|
+
|
30
|
+
export function App() {
|
31
|
+
return (
|
32
|
+
<div style=\{{ display: 'block' }}>
|
33
|
+
<DsplL bold={false}>DsplL</DsplL>
|
34
|
+
<DsplL>DsplL Bold</DsplL>
|
35
|
+
|
36
|
+
<DsplM bold={false}>DsplM</DsplM>
|
37
|
+
<DsplM>DsplM Bold</DsplM>
|
38
|
+
|
39
|
+
<DsplS bold={false}>DsplS</DsplS>
|
40
|
+
<DsplS>DsplS Bold</DsplS>
|
41
|
+
</div>
|
42
|
+
);
|
43
|
+
}
|
44
|
+
```
|
45
|
+
|
46
|
+
### Заголовки
|
47
|
+
|
48
|
+
```tsx live
|
49
|
+
import React from 'react';
|
50
|
+
import { H1, H2, H3, H4, H5 } from '@salutejs/{{ package }}';
|
51
|
+
|
52
|
+
export function App() {
|
53
|
+
return (
|
54
|
+
<div style=\{{ display: 'block' }}>
|
55
|
+
<H1 bold={false}>H1</H1>
|
56
|
+
<H1>H1 Bold</H1>
|
57
|
+
|
58
|
+
<H2 bold={false}>H2</H2>
|
59
|
+
<H2>H2 Bold</H2>
|
60
|
+
|
61
|
+
<H3 bold={false}>H3</H3>
|
62
|
+
<H3>H3 Bold</H3>
|
63
|
+
|
64
|
+
<H4 bold={false}>H4</H4>
|
65
|
+
<H4>H4 Bold</H4>
|
66
|
+
|
67
|
+
<H5 bold={false}>H5</H5>
|
68
|
+
<H5>H5 Bold</H5>
|
69
|
+
</div>
|
70
|
+
);
|
71
|
+
}
|
72
|
+
```
|
73
|
+
|
74
|
+
### Интерфейсы
|
75
|
+
Типографика для таких частей интерфейса, как button, label, подписи, и т.п.
|
76
|
+
|
77
|
+
```tsx live
|
78
|
+
import React from 'react';
|
79
|
+
import { BodyL, BodyM, BodyS, BodyXS, BodyXXS } from '@salutejs/{{ package }}';
|
80
|
+
|
81
|
+
export function App() {
|
82
|
+
return (
|
83
|
+
<div style=\{{ display: 'block' }}>
|
84
|
+
<BodyL>BodyL</BodyL>
|
85
|
+
<BodyL bold>BodyL полужирный</BodyL>
|
86
|
+
|
87
|
+
<BodyM>BodyM</BodyM>
|
88
|
+
<BodyM bold>BodyM полужирный</BodyM>
|
89
|
+
|
90
|
+
<BodyS>BodyS</BodyS>
|
91
|
+
<BodyS bold>BodyS полужирный</BodyS>
|
92
|
+
|
93
|
+
<BodyXS>BodyXS</BodyXS>
|
94
|
+
<BodyXS bold>BodyXS полужирный</BodyXS>
|
95
|
+
|
96
|
+
<BodyXXS>BodyXXS</BodyXXS>
|
97
|
+
<BodyXXS bold>BodyXXS полужирный</BodyXXS>
|
98
|
+
</div>
|
99
|
+
);
|
100
|
+
}
|
101
|
+
```
|
102
|
+
|
103
|
+
### Текст
|
104
|
+
Типографические элементы для описаний к статьям, дополнительной информации и т.д.
|
105
|
+
|
106
|
+
```tsx live
|
107
|
+
import React from 'react';
|
108
|
+
import { TextL, TextM, TextS, TextXS } from '@salutejs/{{ package }}';
|
109
|
+
|
110
|
+
export function App() {
|
111
|
+
return (
|
112
|
+
<div style=\{{ display: 'block' }}>
|
113
|
+
<TextL>TextL</TextL>
|
114
|
+
<TextL bold>TextL полужирный</TextL>
|
115
|
+
|
116
|
+
<TextM>TextM</TextM>
|
117
|
+
<TextM bold>TextM полужирный</TextM>
|
118
|
+
|
119
|
+
<TextS>TextS</TextS>
|
120
|
+
<TextS bold>TextS полужирный</TextS>
|
121
|
+
|
122
|
+
<TextXS>TextXS</TextXS>
|
123
|
+
<TextXS bold>TextXS полужирный</TextXS>
|
124
|
+
</div>
|
125
|
+
);
|
126
|
+
}
|
127
|
+
```
|
@@ -8,7 +8,7 @@ var _styledComponents = /*#__PURE__*/require("styled-components");
|
|
8
8
|
var _Cell = /*#__PURE__*/require("../../../../components/Cell");
|
9
9
|
var config = exports.config = {
|
10
10
|
defaults: {
|
11
|
-
view: '
|
11
|
+
view: 'default',
|
12
12
|
size: 'm',
|
13
13
|
stretching: 'filled'
|
14
14
|
},
|
@@ -17,10 +17,10 @@ var config = exports.config = {
|
|
17
17
|
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--text-primary);", ":var(--text-secondary);", ":transparent;"], _Cell.cellTokens.cellColor, _Cell.cellTokens.cellLabelColor, _Cell.cellTokens.cellTitleColor, _Cell.cellTokens.cellSubtitleColor, _Cell.cellTokens.cellBackgroundColor)
|
18
18
|
},
|
19
19
|
size: {
|
20
|
-
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":0.375rem;", ":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-
|
21
|
-
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":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-
|
22
|
-
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":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-
|
23
|
-
xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":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-
|
20
|
+
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":0.375rem;", ":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);", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);"], _Cell.cellTokens.cellWidth, _Cell.cellTokens.cellPadding, _Cell.cellTokens.cellPaddingLeftContent, _Cell.cellTokens.cellPaddingContent, _Cell.cellTokens.cellPaddingRightContent, _Cell.cellTokens.cellTextboxGap, _Cell.cellTokens.cellGap, _Cell.cellTokens.cellLabelFontFamily, _Cell.cellTokens.cellLabelFontSize, _Cell.cellTokens.cellLabelFontStyle, _Cell.cellTokens.cellLabelFontWeight, _Cell.cellTokens.cellLabelLetterSpacing, _Cell.cellTokens.cellLabelLineHeight, _Cell.cellTokens.cellTitleFontFamily, _Cell.cellTokens.cellTitleFontSize, _Cell.cellTokens.cellTitleFontStyle, _Cell.cellTokens.cellTitleFontWeight, _Cell.cellTokens.cellTitleLetterSpacing, _Cell.cellTokens.cellTitleLineHeight, _Cell.cellTokens.cellSubtitleFontFamily, _Cell.cellTokens.cellSubtitleFontSize, _Cell.cellTokens.cellSubtitleFontStyle, _Cell.cellTokens.cellSubtitleFontWeight, _Cell.cellTokens.cellSubtitleLetterSpacing, _Cell.cellTokens.cellSubtitleLineHeight),
|
21
|
+
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":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);", ":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);", ":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);"], _Cell.cellTokens.cellWidth, _Cell.cellTokens.cellPadding, _Cell.cellTokens.cellPaddingLeftContent, _Cell.cellTokens.cellPaddingContent, _Cell.cellTokens.cellPaddingRightContent, _Cell.cellTokens.cellTextboxGap, _Cell.cellTokens.cellGap, _Cell.cellTokens.cellLabelFontFamily, _Cell.cellTokens.cellLabelFontSize, _Cell.cellTokens.cellLabelFontStyle, _Cell.cellTokens.cellLabelFontWeight, _Cell.cellTokens.cellLabelLetterSpacing, _Cell.cellTokens.cellLabelLineHeight, _Cell.cellTokens.cellTitleFontFamily, _Cell.cellTokens.cellTitleFontSize, _Cell.cellTokens.cellTitleFontStyle, _Cell.cellTokens.cellTitleFontWeight, _Cell.cellTokens.cellTitleLetterSpacing, _Cell.cellTokens.cellTitleLineHeight, _Cell.cellTokens.cellSubtitleFontFamily, _Cell.cellTokens.cellSubtitleFontSize, _Cell.cellTokens.cellSubtitleFontStyle, _Cell.cellTokens.cellSubtitleFontWeight, _Cell.cellTokens.cellSubtitleLetterSpacing, _Cell.cellTokens.cellSubtitleLineHeight),
|
22
|
+
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":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);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-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);"], _Cell.cellTokens.cellWidth, _Cell.cellTokens.cellPadding, _Cell.cellTokens.cellPaddingLeftContent, _Cell.cellTokens.cellPaddingContent, _Cell.cellTokens.cellPaddingRightContent, _Cell.cellTokens.cellTextboxGap, _Cell.cellTokens.cellGap, _Cell.cellTokens.cellLabelFontFamily, _Cell.cellTokens.cellLabelFontSize, _Cell.cellTokens.cellLabelFontStyle, _Cell.cellTokens.cellLabelFontWeight, _Cell.cellTokens.cellLabelLetterSpacing, _Cell.cellTokens.cellLabelLineHeight, _Cell.cellTokens.cellTitleFontFamily, _Cell.cellTokens.cellTitleFontSize, _Cell.cellTokens.cellTitleFontStyle, _Cell.cellTokens.cellTitleFontWeight, _Cell.cellTokens.cellTitleLetterSpacing, _Cell.cellTokens.cellTitleLineHeight, _Cell.cellTokens.cellSubtitleFontFamily, _Cell.cellTokens.cellSubtitleFontSize, _Cell.cellTokens.cellSubtitleFontStyle, _Cell.cellTokens.cellSubtitleFontWeight, _Cell.cellTokens.cellSubtitleLetterSpacing, _Cell.cellTokens.cellSubtitleLineHeight),
|
23
|
+
xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":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);", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":var(--plasma-typo-body-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);"], _Cell.cellTokens.cellWidth, _Cell.cellTokens.cellPadding, _Cell.cellTokens.cellPaddingLeftContent, _Cell.cellTokens.cellPaddingContent, _Cell.cellTokens.cellPaddingRightContent, _Cell.cellTokens.cellTextboxGap, _Cell.cellTokens.cellGap, _Cell.cellTokens.cellLabelFontFamily, _Cell.cellTokens.cellLabelFontSize, _Cell.cellTokens.cellLabelFontStyle, _Cell.cellTokens.cellLabelFontWeight, _Cell.cellTokens.cellLabelLetterSpacing, _Cell.cellTokens.cellLabelLineHeight, _Cell.cellTokens.cellTitleFontFamily, _Cell.cellTokens.cellTitleFontSize, _Cell.cellTokens.cellTitleFontStyle, _Cell.cellTokens.cellTitleFontWeight, _Cell.cellTokens.cellTitleLetterSpacing, _Cell.cellTokens.cellTitleLineHeight, _Cell.cellTokens.cellSubtitleFontFamily, _Cell.cellTokens.cellSubtitleFontSize, _Cell.cellTokens.cellSubtitleFontStyle, _Cell.cellTokens.cellSubtitleFontWeight, _Cell.cellTokens.cellSubtitleLetterSpacing, _Cell.cellTokens.cellSubtitleLineHeight)
|
24
24
|
},
|
25
25
|
stretching: {
|
26
26
|
auto: /*#__PURE__*/(0, _styledComponents.css)([""]),
|
@@ -9,18 +9,21 @@ import { IconChevronLeft } from '../../../../components/_Icon';
|
|
9
9
|
|
10
10
|
import { Cell, Textbox, TextLabel, TextTitle, TextSubtitle } from './Cell';
|
11
11
|
|
12
|
-
type StoryProps = ComponentProps<typeof Cell> & {
|
12
|
+
type StoryProps = ComponentProps<typeof Cell> & {
|
13
|
+
itemsCount?: number;
|
14
|
+
enableLeftContent?: boolean;
|
15
|
+
enableRightContent?: boolean;
|
16
|
+
};
|
13
17
|
type Story = StoryObj<StoryProps>;
|
14
18
|
|
15
|
-
const views = ['default'];
|
16
19
|
const sizes = ['l', 'm', 's', 'xs'];
|
17
|
-
const stretchingValues = ['fixed', 'filled'];
|
20
|
+
const stretchingValues = ['fixed', 'filled', 'auto'];
|
18
21
|
|
19
|
-
type
|
20
|
-
type
|
22
|
+
type SizesCell = 'xs' | 'l' | 'm' | 's' | undefined;
|
23
|
+
type SizesAvatar = 'l' | 'm' | 's';
|
21
24
|
|
22
|
-
const getSize = (size:
|
23
|
-
if (size === 'xs') {
|
25
|
+
const getSize = (size: SizesCell): SizesAvatar => {
|
26
|
+
if (size === 'xs' || !size) {
|
24
27
|
return 's';
|
25
28
|
}
|
26
29
|
|
@@ -37,12 +40,6 @@ const meta: Meta<typeof Cell> = {
|
|
37
40
|
type: 'select',
|
38
41
|
},
|
39
42
|
},
|
40
|
-
view: {
|
41
|
-
options: views,
|
42
|
-
control: {
|
43
|
-
type: 'select',
|
44
|
-
},
|
45
|
-
},
|
46
43
|
stretching: {
|
47
44
|
options: stretchingValues,
|
48
45
|
control: {
|
@@ -61,17 +58,20 @@ const ChevronRight = styled(IconChevronLeft)`
|
|
61
58
|
|
62
59
|
export const Default: Story = {
|
63
60
|
args: {
|
64
|
-
view: 'default',
|
65
61
|
size: 'm',
|
66
62
|
stretching: 'filled',
|
63
|
+
enableLeftContent: false,
|
64
|
+
enableRightContent: false,
|
67
65
|
},
|
68
66
|
render: ({ ...args }: StoryProps) => {
|
69
67
|
return (
|
70
68
|
<Cell
|
71
69
|
contentLeft={
|
72
|
-
|
70
|
+
!args.enableLeftContent && (
|
71
|
+
<Avatar size={getSize(args.size)} url="https://avatars.githubusercontent.com/u/1813468?v=4" />
|
72
|
+
)
|
73
73
|
}
|
74
|
-
contentRight={<ChevronRight color="inherit" size="xs" />}
|
74
|
+
contentRight={!args.enableRightContent && <ChevronRight color="inherit" size="xs" />}
|
75
75
|
title="Title"
|
76
76
|
subtitle="Subtitle"
|
77
77
|
label="Label"
|
@@ -83,7 +83,6 @@ export const Default: Story = {
|
|
83
83
|
|
84
84
|
export const WithContentTextbox: Story = {
|
85
85
|
args: {
|
86
|
-
view: 'default',
|
87
86
|
size: 'm',
|
88
87
|
stretching: 'filled',
|
89
88
|
},
|
@@ -104,7 +103,6 @@ export const WithContentTextbox: Story = {
|
|
104
103
|
|
105
104
|
export const WithContentTextboxWithTags: Story = {
|
106
105
|
args: {
|
107
|
-
view: 'default',
|
108
106
|
size: 'm',
|
109
107
|
stretching: 'filled',
|
110
108
|
},
|
@@ -129,7 +127,6 @@ export const WithContentTextboxWithTags: Story = {
|
|
129
127
|
|
130
128
|
export const WithContentTextboxCustom: Story = {
|
131
129
|
args: {
|
132
|
-
view: 'default',
|
133
130
|
size: 'm',
|
134
131
|
stretching: 'filled',
|
135
132
|
},
|
@@ -8,7 +8,7 @@ var _styledComponents = /*#__PURE__*/require("styled-components");
|
|
8
8
|
var _Cell = /*#__PURE__*/require("../../../../components/Cell");
|
9
9
|
var config = exports.config = {
|
10
10
|
defaults: {
|
11
|
-
view: '
|
11
|
+
view: 'default',
|
12
12
|
size: 'm',
|
13
13
|
stretching: 'filled'
|
14
14
|
},
|
@@ -17,10 +17,10 @@ var config = exports.config = {
|
|
17
17
|
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--text-primary);", ":var(--text-secondary);", ":transparent;"], _Cell.cellTokens.cellColor, _Cell.cellTokens.cellLabelColor, _Cell.cellTokens.cellTitleColor, _Cell.cellTokens.cellSubtitleColor, _Cell.cellTokens.cellBackgroundColor)
|
18
18
|
},
|
19
19
|
size: {
|
20
|
-
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":0.375rem;", ":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-
|
21
|
-
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":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-
|
22
|
-
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":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-
|
23
|
-
xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":0.25rem;", ":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-
|
20
|
+
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":0.375rem;", ":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);", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);"], _Cell.cellTokens.cellWidth, _Cell.cellTokens.cellPadding, _Cell.cellTokens.cellPaddingLeftContent, _Cell.cellTokens.cellPaddingContent, _Cell.cellTokens.cellPaddingRightContent, _Cell.cellTokens.cellTextboxGap, _Cell.cellTokens.cellGap, _Cell.cellTokens.cellLabelFontFamily, _Cell.cellTokens.cellLabelFontSize, _Cell.cellTokens.cellLabelFontStyle, _Cell.cellTokens.cellLabelFontWeight, _Cell.cellTokens.cellLabelLetterSpacing, _Cell.cellTokens.cellLabelLineHeight, _Cell.cellTokens.cellTitleFontFamily, _Cell.cellTokens.cellTitleFontSize, _Cell.cellTokens.cellTitleFontStyle, _Cell.cellTokens.cellTitleFontWeight, _Cell.cellTokens.cellTitleLetterSpacing, _Cell.cellTokens.cellTitleLineHeight, _Cell.cellTokens.cellSubtitleFontFamily, _Cell.cellTokens.cellSubtitleFontSize, _Cell.cellTokens.cellSubtitleFontStyle, _Cell.cellTokens.cellSubtitleFontWeight, _Cell.cellTokens.cellSubtitleLetterSpacing, _Cell.cellTokens.cellSubtitleLineHeight),
|
21
|
+
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":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);", ":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);", ":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);"], _Cell.cellTokens.cellWidth, _Cell.cellTokens.cellPadding, _Cell.cellTokens.cellPaddingLeftContent, _Cell.cellTokens.cellPaddingContent, _Cell.cellTokens.cellPaddingRightContent, _Cell.cellTokens.cellTextboxGap, _Cell.cellTokens.cellGap, _Cell.cellTokens.cellLabelFontFamily, _Cell.cellTokens.cellLabelFontSize, _Cell.cellTokens.cellLabelFontStyle, _Cell.cellTokens.cellLabelFontWeight, _Cell.cellTokens.cellLabelLetterSpacing, _Cell.cellTokens.cellLabelLineHeight, _Cell.cellTokens.cellTitleFontFamily, _Cell.cellTokens.cellTitleFontSize, _Cell.cellTokens.cellTitleFontStyle, _Cell.cellTokens.cellTitleFontWeight, _Cell.cellTokens.cellTitleLetterSpacing, _Cell.cellTokens.cellTitleLineHeight, _Cell.cellTokens.cellSubtitleFontFamily, _Cell.cellTokens.cellSubtitleFontSize, _Cell.cellTokens.cellSubtitleFontStyle, _Cell.cellTokens.cellSubtitleFontWeight, _Cell.cellTokens.cellSubtitleLetterSpacing, _Cell.cellTokens.cellSubtitleLineHeight),
|
22
|
+
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":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);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-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);"], _Cell.cellTokens.cellWidth, _Cell.cellTokens.cellPadding, _Cell.cellTokens.cellPaddingLeftContent, _Cell.cellTokens.cellPaddingContent, _Cell.cellTokens.cellPaddingRightContent, _Cell.cellTokens.cellTextboxGap, _Cell.cellTokens.cellGap, _Cell.cellTokens.cellLabelFontFamily, _Cell.cellTokens.cellLabelFontSize, _Cell.cellTokens.cellLabelFontStyle, _Cell.cellTokens.cellLabelFontWeight, _Cell.cellTokens.cellLabelLetterSpacing, _Cell.cellTokens.cellLabelLineHeight, _Cell.cellTokens.cellTitleFontFamily, _Cell.cellTokens.cellTitleFontSize, _Cell.cellTokens.cellTitleFontStyle, _Cell.cellTokens.cellTitleFontWeight, _Cell.cellTokens.cellTitleLetterSpacing, _Cell.cellTokens.cellTitleLineHeight, _Cell.cellTokens.cellSubtitleFontFamily, _Cell.cellTokens.cellSubtitleFontSize, _Cell.cellTokens.cellSubtitleFontStyle, _Cell.cellTokens.cellSubtitleFontWeight, _Cell.cellTokens.cellSubtitleLetterSpacing, _Cell.cellTokens.cellSubtitleLineHeight),
|
23
|
+
xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":15rem;", ":0rem;", ":0rem;", ":0rem;", ":0rem;", ":0.125rem;", ":0.25rem;", ":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);", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":var(--plasma-typo-body-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);"], _Cell.cellTokens.cellWidth, _Cell.cellTokens.cellPadding, _Cell.cellTokens.cellPaddingLeftContent, _Cell.cellTokens.cellPaddingContent, _Cell.cellTokens.cellPaddingRightContent, _Cell.cellTokens.cellTextboxGap, _Cell.cellTokens.cellGap, _Cell.cellTokens.cellGap, _Cell.cellTokens.cellLabelFontFamily, _Cell.cellTokens.cellLabelFontSize, _Cell.cellTokens.cellLabelFontStyle, _Cell.cellTokens.cellLabelFontWeight, _Cell.cellTokens.cellLabelLetterSpacing, _Cell.cellTokens.cellLabelLineHeight, _Cell.cellTokens.cellTitleFontFamily, _Cell.cellTokens.cellTitleFontSize, _Cell.cellTokens.cellTitleFontStyle, _Cell.cellTokens.cellTitleFontWeight, _Cell.cellTokens.cellTitleLetterSpacing, _Cell.cellTokens.cellTitleLineHeight, _Cell.cellTokens.cellSubtitleFontFamily, _Cell.cellTokens.cellSubtitleFontSize, _Cell.cellTokens.cellSubtitleFontStyle, _Cell.cellTokens.cellSubtitleFontWeight, _Cell.cellTokens.cellSubtitleLetterSpacing, _Cell.cellTokens.cellSubtitleLineHeight)
|
24
24
|
},
|
25
25
|
stretching: {
|
26
26
|
auto: /*#__PURE__*/(0, _styledComponents.css)([""]),
|
@@ -9,18 +9,21 @@ import { IconChevronLeft } from '../../../../components/_Icon';
|
|
9
9
|
|
10
10
|
import { Cell, Textbox, TextLabel, TextTitle, TextSubtitle } from './Cell';
|
11
11
|
|
12
|
-
type StoryProps = ComponentProps<typeof Cell> & {
|
12
|
+
type StoryProps = ComponentProps<typeof Cell> & {
|
13
|
+
itemsCount?: number;
|
14
|
+
enableLeftContent?: boolean;
|
15
|
+
enableRightContent?: boolean;
|
16
|
+
};
|
13
17
|
type Story = StoryObj<StoryProps>;
|
14
18
|
|
15
|
-
const views = ['default'];
|
16
19
|
const sizes = ['l', 'm', 's', 'xs'];
|
17
|
-
const stretchingValues = ['fixed', 'filled'];
|
20
|
+
const stretchingValues = ['fixed', 'filled', 'auto'];
|
18
21
|
|
19
|
-
type
|
20
|
-
type
|
22
|
+
type SizesCell = 'xs' | 'l' | 'm' | 's' | undefined | undefined;
|
23
|
+
type SizesAvatar = 'l' | 'm' | 's';
|
21
24
|
|
22
|
-
const getSize = (size:
|
23
|
-
if (size === 'xs') {
|
25
|
+
const getSize = (size: SizesCell): SizesAvatar => {
|
26
|
+
if (size === 'xs' || !size) {
|
24
27
|
return 's';
|
25
28
|
}
|
26
29
|
|
@@ -37,12 +40,6 @@ const meta: Meta<typeof Cell> = {
|
|
37
40
|
type: 'select',
|
38
41
|
},
|
39
42
|
},
|
40
|
-
view: {
|
41
|
-
options: views,
|
42
|
-
control: {
|
43
|
-
type: 'select',
|
44
|
-
},
|
45
|
-
},
|
46
43
|
stretching: {
|
47
44
|
options: stretchingValues,
|
48
45
|
control: {
|
@@ -61,17 +58,20 @@ const ChevronRight = styled(IconChevronLeft)`
|
|
61
58
|
|
62
59
|
export const Default: Story = {
|
63
60
|
args: {
|
64
|
-
view: 'default',
|
65
61
|
size: 'm',
|
66
62
|
stretching: 'filled',
|
63
|
+
enableLeftContent: false,
|
64
|
+
enableRightContent: false,
|
67
65
|
},
|
68
66
|
render: ({ ...args }: StoryProps) => {
|
69
67
|
return (
|
70
68
|
<Cell
|
71
69
|
contentLeft={
|
72
|
-
|
70
|
+
!args.enableLeftContent && (
|
71
|
+
<Avatar size={getSize(args.size)} url="https://avatars.githubusercontent.com/u/1813468?v=4" />
|
72
|
+
)
|
73
73
|
}
|
74
|
-
contentRight={<ChevronRight color="inherit" size="xs" />}
|
74
|
+
contentRight={!args.enableRightContent && <ChevronRight color="inherit" size="xs" />}
|
75
75
|
title="Title"
|
76
76
|
subtitle="Subtitle"
|
77
77
|
label="Label"
|
@@ -83,7 +83,6 @@ export const Default: Story = {
|
|
83
83
|
|
84
84
|
export const WithContentTextbox: Story = {
|
85
85
|
args: {
|
86
|
-
view: 'default',
|
87
86
|
size: 'm',
|
88
87
|
stretching: 'filled',
|
89
88
|
},
|
@@ -104,7 +103,6 @@ export const WithContentTextbox: Story = {
|
|
104
103
|
|
105
104
|
export const WithContentTextboxWithTags: Story = {
|
106
105
|
args: {
|
107
|
-
view: 'default',
|
108
106
|
size: 'm',
|
109
107
|
stretching: 'filled',
|
110
108
|
},
|
@@ -129,7 +127,6 @@ export const WithContentTextboxWithTags: Story = {
|
|
129
127
|
|
130
128
|
export const WithContentTextboxCustom: Story = {
|
131
129
|
args: {
|
132
|
-
view: 'default',
|
133
130
|
size: 'm',
|
134
131
|
stretching: 'filled',
|
135
132
|
},
|