@salutejs/plasma-new-hope 0.68.0-canary.1104.8452846373.0 → 0.68.0-canary.1148.8452547227.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Cell/Cell.css +3 -0
- package/cjs/components/Cell/Cell.js +71 -0
- package/cjs/components/Cell/Cell.js.map +1 -0
- package/cjs/components/Cell/Cell.styles.js +36 -0
- package/cjs/components/Cell/Cell.styles.js.map +1 -0
- package/cjs/components/Cell/Cell.tokens.js +50 -0
- package/cjs/components/Cell/Cell.tokens.js.map +1 -0
- package/cjs/components/Cell/Textbox/Textbox.js +20 -0
- package/cjs/components/Cell/Textbox/Textbox.js.map +1 -0
- package/cjs/components/Cell/Textbox/Textbox.styles.js +13 -0
- package/cjs/components/Cell/Textbox/Textbox.styles.js.map +1 -0
- package/cjs/components/Cell/Textbox/ui/TextLabel.js +17 -0
- package/cjs/components/Cell/Textbox/ui/TextLabel.js.map +1 -0
- package/cjs/components/Cell/Textbox/ui/TextSubtitle.js +17 -0
- package/cjs/components/Cell/Textbox/ui/TextSubtitle.js.map +1 -0
- package/cjs/components/Cell/Textbox/ui/TextTitle.js +17 -0
- package/cjs/components/Cell/Textbox/ui/TextTitle.js.map +1 -0
- package/cjs/components/Cell/variations/_size/base.js +9 -0
- package/cjs/components/Cell/variations/_size/base.js.map +1 -0
- package/cjs/components/Cell/variations/_size/base_x642ct.css +1 -0
- package/cjs/components/Cell/variations/_stretching/base.js +9 -0
- package/cjs/components/Cell/variations/_stretching/base.js.map +1 -0
- package/cjs/components/Cell/variations/_stretching/base_1ryz4br.css +1 -0
- package/cjs/components/Cell/variations/_view/base.js +9 -0
- package/cjs/components/Cell/variations/_view/base.js.map +1 -0
- package/cjs/components/Cell/variations/_view/base_13f5j4a.css +1 -0
- package/cjs/components/Dropdown/Dropdown.js +1 -2
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Popover/Popover.js +31 -46
- package/cjs/components/Popover/Popover.js.map +1 -1
- package/cjs/index.css +4 -0
- package/cjs/index.js +14 -0
- package/cjs/index.js.map +1 -1
- package/es/components/Cell/Cell.css +3 -0
- package/es/components/Cell/Cell.js +66 -0
- package/es/components/Cell/Cell.js.map +1 -0
- package/es/components/Cell/Cell.styles.js +29 -0
- package/es/components/Cell/Cell.styles.js.map +1 -0
- package/es/components/Cell/Cell.tokens.js +45 -0
- package/es/components/Cell/Cell.tokens.js.map +1 -0
- package/es/components/Cell/Textbox/Textbox.js +16 -0
- package/es/components/Cell/Textbox/Textbox.js.map +1 -0
- package/es/components/Cell/Textbox/Textbox.styles.js +9 -0
- package/es/components/Cell/Textbox/Textbox.styles.js.map +1 -0
- package/es/components/Cell/Textbox/ui/TextLabel.js +13 -0
- package/es/components/Cell/Textbox/ui/TextLabel.js.map +1 -0
- package/es/components/Cell/Textbox/ui/TextSubtitle.js +13 -0
- package/es/components/Cell/Textbox/ui/TextSubtitle.js.map +1 -0
- package/es/components/Cell/Textbox/ui/TextTitle.js +13 -0
- package/es/components/Cell/Textbox/ui/TextTitle.js.map +1 -0
- package/es/components/Cell/variations/_size/base.js +5 -0
- package/es/components/Cell/variations/_size/base.js.map +1 -0
- package/es/components/Cell/variations/_size/base_x642ct.css +1 -0
- package/es/components/Cell/variations/_stretching/base.js +5 -0
- package/es/components/Cell/variations/_stretching/base.js.map +1 -0
- package/es/components/Cell/variations/_stretching/base_1ryz4br.css +1 -0
- package/es/components/Cell/variations/_view/base.js +5 -0
- package/es/components/Cell/variations/_view/base.js.map +1 -0
- package/es/components/Cell/variations/_view/base_13f5j4a.css +1 -0
- package/es/components/Dropdown/Dropdown.js +1 -2
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Popover/Popover.js +31 -46
- package/es/components/Popover/Popover.js.map +1 -1
- package/es/index.css +4 -0
- package/es/index.js +6 -0
- package/es/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Cell/Cell.js +71 -0
- package/styled-components/cjs/components/Cell/Cell.styles.js +32 -0
- package/styled-components/cjs/components/Cell/Cell.tokens.js +48 -0
- package/styled-components/cjs/components/Cell/Cell.types.js +5 -0
- package/styled-components/cjs/components/Cell/Textbox/Textbox.js +19 -0
- package/styled-components/cjs/components/Cell/Textbox/Textbox.styles.js +12 -0
- package/styled-components/cjs/components/Cell/Textbox/Textbox.types.js +5 -0
- package/styled-components/cjs/components/Cell/Textbox/ui/TextLabel.js +16 -0
- package/styled-components/cjs/components/Cell/Textbox/ui/TextSubtitle.js +16 -0
- package/styled-components/cjs/components/Cell/Textbox/ui/TextTitle.js +16 -0
- package/styled-components/cjs/components/Cell/index.js +59 -0
- package/styled-components/cjs/components/Cell/variations/_size/base.js +8 -0
- package/styled-components/cjs/components/Cell/variations/_size/tokens.json +1 -0
- package/styled-components/cjs/components/Cell/variations/_stretching/base.js +9 -0
- package/styled-components/cjs/components/Cell/variations/_stretching/tokens.json +1 -0
- package/styled-components/cjs/components/Cell/variations/_view/base.js +9 -0
- package/styled-components/cjs/components/Cell/variations/_view/tokens.json +1 -0
- package/styled-components/cjs/components/Dropdown/Dropdown.js +1 -2
- package/styled-components/cjs/components/Popover/Popover.js +31 -46
- package/styled-components/cjs/examples/plasma_b2c/components/Cell/Cell.config.js +31 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Cell/Cell.js +35 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Cell/Cell.stories.tsx +131 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Popover/Popover.stories.tsx +0 -7
- package/styled-components/cjs/examples/plasma_web/components/Cell/Cell.config.js +31 -0
- package/styled-components/cjs/examples/plasma_web/components/Cell/Cell.js +35 -0
- package/styled-components/cjs/examples/plasma_web/components/Cell/Cell.stories.tsx +131 -0
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +1 -1
- package/styled-components/cjs/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +1 -1
- package/styled-components/cjs/index.js +11 -0
- package/styled-components/es/components/Cell/Cell.js +62 -0
- package/styled-components/es/components/Cell/Cell.styles.js +25 -0
- package/styled-components/es/components/Cell/Cell.tokens.js +42 -0
- package/styled-components/es/components/Cell/Cell.types.js +1 -0
- package/styled-components/es/components/Cell/Textbox/Textbox.js +12 -0
- package/styled-components/es/components/Cell/Textbox/Textbox.styles.js +5 -0
- package/styled-components/es/components/Cell/Textbox/Textbox.types.js +1 -0
- package/styled-components/es/components/Cell/Textbox/ui/TextLabel.js +9 -0
- package/styled-components/es/components/Cell/Textbox/ui/TextSubtitle.js +9 -0
- package/styled-components/es/components/Cell/Textbox/ui/TextTitle.js +9 -0
- package/styled-components/es/components/Cell/index.js +6 -0
- package/styled-components/es/components/Cell/variations/_size/base.js +2 -0
- package/styled-components/es/components/Cell/variations/_size/tokens.json +1 -0
- package/styled-components/es/components/Cell/variations/_stretching/base.js +3 -0
- package/styled-components/es/components/Cell/variations/_stretching/tokens.json +1 -0
- package/styled-components/es/components/Cell/variations/_view/base.js +3 -0
- package/styled-components/es/components/Cell/variations/_view/tokens.json +1 -0
- package/styled-components/es/components/Dropdown/Dropdown.js +1 -2
- package/styled-components/es/components/Popover/Popover.js +31 -46
- package/styled-components/es/examples/plasma_b2c/components/Cell/Cell.config.js +25 -0
- package/styled-components/es/examples/plasma_b2c/components/Cell/Cell.js +6 -0
- package/styled-components/es/examples/plasma_b2c/components/Cell/Cell.stories.tsx +131 -0
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Normal/Dropdown.stories.tsx +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Dropdown/Tight/Dropdown.stories.tsx +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Popover/Popover.stories.tsx +0 -7
- package/styled-components/es/examples/plasma_web/components/Cell/Cell.config.js +25 -0
- package/styled-components/es/examples/plasma_web/components/Cell/Cell.js +6 -0
- package/styled-components/es/examples/plasma_web/components/Cell/Cell.stories.tsx +131 -0
- package/styled-components/es/examples/plasma_web/components/Dropdown/Normal/Dropdown.stories.tsx +1 -1
- package/styled-components/es/examples/plasma_web/components/Dropdown/Tight/Dropdown.stories.tsx +1 -1
- package/styled-components/es/index.js +1 -0
- package/types/components/Cell/Cell.d.ts +27 -0
- package/types/components/Cell/Cell.d.ts.map +1 -0
- package/types/components/Cell/Cell.styles.d.ts +10 -0
- package/types/components/Cell/Cell.styles.d.ts.map +1 -0
- package/types/components/Cell/Cell.tokens.d.ts +43 -0
- package/types/components/Cell/Cell.tokens.d.ts.map +1 -0
- package/types/components/Cell/Cell.types.d.ts +45 -0
- package/types/components/Cell/Cell.types.d.ts.map +1 -0
- package/types/components/Cell/Textbox/Textbox.d.ts +4 -0
- package/types/components/Cell/Textbox/Textbox.d.ts.map +1 -0
- package/types/components/Cell/Textbox/Textbox.styles.d.ts +2 -0
- package/types/components/Cell/Textbox/Textbox.styles.d.ts.map +1 -0
- package/types/components/Cell/Textbox/Textbox.types.d.ts +35 -0
- package/types/components/Cell/Textbox/Textbox.types.d.ts.map +1 -0
- package/types/components/Cell/Textbox/ui/TextLabel.d.ts +5 -0
- package/types/components/Cell/Textbox/ui/TextLabel.d.ts.map +1 -0
- package/types/components/Cell/Textbox/ui/TextSubtitle.d.ts +5 -0
- package/types/components/Cell/Textbox/ui/TextSubtitle.d.ts.map +1 -0
- package/types/components/Cell/Textbox/ui/TextTitle.d.ts +5 -0
- package/types/components/Cell/Textbox/ui/TextTitle.d.ts.map +1 -0
- package/types/components/Cell/index.d.ts +9 -0
- package/types/components/Cell/index.d.ts.map +1 -0
- package/types/components/Cell/variations/_size/base.d.ts +2 -0
- package/types/components/Cell/variations/_size/base.d.ts.map +1 -0
- package/types/components/Cell/variations/_stretching/base.d.ts +2 -0
- package/types/components/Cell/variations/_stretching/base.d.ts.map +1 -0
- package/types/components/Cell/variations/_view/base.d.ts +2 -0
- package/types/components/Cell/variations/_view/base.d.ts.map +1 -0
- package/types/components/Combobox/Combobox.styles.d.ts +2 -8
- package/types/components/Combobox/Combobox.styles.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.styles.d.ts +1 -7
- package/types/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
- package/types/components/Popover/Popover.d.ts +2 -2
- package/types/components/Popover/Popover.d.ts.map +1 -1
- package/types/components/Popover/Popover.types.d.ts +14 -19
- package/types/components/Popover/Popover.types.d.ts.map +1 -1
- package/types/components/Select/Select.styles.d.ts +2 -8
- package/types/components/Select/Select.styles.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Cell/Cell.config.d.ts +24 -0
- package/types/examples/plasma_b2c/components/Cell/Cell.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Cell/Cell.d.ts +48 -0
- package/types/examples/plasma_b2c/components/Cell/Cell.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts +2 -2
- package/types/examples/plasma_b2c/components/Popover/Popover.d.ts +1 -7
- package/types/examples/plasma_b2c/components/Popover/Popover.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Cell/Cell.config.d.ts +24 -0
- package/types/examples/plasma_web/components/Cell/Cell.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Cell/Cell.d.ts +48 -0
- package/types/examples/plasma_web/components/Cell/Cell.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Combobox/Combobox.d.ts +2 -2
- package/types/examples/plasma_web/components/Popover/Popover.d.ts +1 -7
- package/types/examples/plasma_web/components/Popover/Popover.d.ts.map +1 -1
- package/types/examples/sds_engineer/components/Popover/Popover.d.ts +1 -7
- package/types/examples/sds_engineer/components/Popover/Popover.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
@@ -0,0 +1,62 @@
|
|
1
|
+
import React, { forwardRef } from 'react';
|
2
|
+
import { cx } from '../../utils';
|
3
|
+
import { CellLeft, CellRight, CellContentWrapper, CellContent } from './Cell.styles';
|
4
|
+
import { classes } from './Cell.tokens';
|
5
|
+
import { base as viewCSS } from './variations/_view/base';
|
6
|
+
import { base as sizeCSS } from './variations/_size/base';
|
7
|
+
import { base as stretchingCSS } from './variations/_stretching/base';
|
8
|
+
import { Textbox } from './Textbox/Textbox';
|
9
|
+
export var cellRoot = function cellRoot(Root) {
|
10
|
+
return /*#__PURE__*/forwardRef(function (_ref, outerRootRef) {
|
11
|
+
var size = _ref.size,
|
12
|
+
view = _ref.view,
|
13
|
+
contentLeft = _ref.contentLeft,
|
14
|
+
contentRight = _ref.contentRight,
|
15
|
+
_ref$alignLeft = _ref.alignLeft,
|
16
|
+
alignLeft = _ref$alignLeft === void 0 ? 'center' : _ref$alignLeft,
|
17
|
+
_ref$alignRight = _ref.alignRight,
|
18
|
+
alignRight = _ref$alignRight === void 0 ? 'center' : _ref$alignRight,
|
19
|
+
children = _ref.children,
|
20
|
+
title = _ref.title,
|
21
|
+
subtitle = _ref.subtitle,
|
22
|
+
label = _ref.label,
|
23
|
+
stretching = _ref.stretching;
|
24
|
+
var stretchingClass = classes["".concat(stretching, "Stretching")];
|
25
|
+
return /*#__PURE__*/React.createElement(Root, {
|
26
|
+
ref: outerRootRef,
|
27
|
+
size: size,
|
28
|
+
view: view,
|
29
|
+
className: cx(stretchingClass, classes.cellRoot)
|
30
|
+
}, contentLeft && /*#__PURE__*/React.createElement(CellLeft, {
|
31
|
+
align: alignLeft
|
32
|
+
}, contentLeft), /*#__PURE__*/React.createElement(CellContentWrapper, null, /*#__PURE__*/React.createElement(CellContent, null, title || subtitle || label ? /*#__PURE__*/React.createElement(Textbox, {
|
33
|
+
label: label,
|
34
|
+
title: title,
|
35
|
+
subtitle: subtitle
|
36
|
+
}) : children && children), contentRight && /*#__PURE__*/React.createElement(CellRight, {
|
37
|
+
align: alignRight
|
38
|
+
}, contentRight)));
|
39
|
+
});
|
40
|
+
};
|
41
|
+
export var cellConfig = {
|
42
|
+
name: 'Cell',
|
43
|
+
tag: 'div',
|
44
|
+
layout: cellRoot,
|
45
|
+
base: '',
|
46
|
+
variations: {
|
47
|
+
view: {
|
48
|
+
css: viewCSS
|
49
|
+
},
|
50
|
+
size: {
|
51
|
+
css: sizeCSS
|
52
|
+
},
|
53
|
+
stretching: {
|
54
|
+
css: stretchingCSS
|
55
|
+
}
|
56
|
+
},
|
57
|
+
defaults: {
|
58
|
+
view: 'default',
|
59
|
+
size: 'm',
|
60
|
+
stretching: 'filled'
|
61
|
+
}
|
62
|
+
};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import styled from 'styled-components';
|
2
|
+
import { tokens } from './Cell.tokens';
|
3
|
+
var alignToFlex = {
|
4
|
+
center: 'center',
|
5
|
+
top: 'flex-start',
|
6
|
+
bottom: 'flex-end'
|
7
|
+
};
|
8
|
+
export var CellContentWrapper = /*#__PURE__*/styled.div.withConfig({
|
9
|
+
componentId: "plasma-new-hope__sc-16emz3n-0"
|
10
|
+
})(["display:flex;flex:auto;justify-content:space-between;gap:var(", ");height:auto;"], tokens.cellGap);
|
11
|
+
export var CellContent = /*#__PURE__*/styled.div.withConfig({
|
12
|
+
componentId: "plasma-new-hope__sc-16emz3n-1"
|
13
|
+
})(["display:flex;align-items:center;height:auto;"]);
|
14
|
+
export var CellLeft = /*#__PURE__*/styled.div.withConfig({
|
15
|
+
componentId: "plasma-new-hope__sc-16emz3n-2"
|
16
|
+
})(["display:flex;align-items:", ";"], function (_ref) {
|
17
|
+
var align = _ref.align;
|
18
|
+
return alignToFlex[align];
|
19
|
+
});
|
20
|
+
export var CellRight = /*#__PURE__*/styled.div.withConfig({
|
21
|
+
componentId: "plasma-new-hope__sc-16emz3n-3"
|
22
|
+
})(["display:flex;align-items:", ";text-align:right;"], function (_ref2) {
|
23
|
+
var align = _ref2.align;
|
24
|
+
return alignToFlex[align];
|
25
|
+
});
|
@@ -0,0 +1,42 @@
|
|
1
|
+
export var tokens = {
|
2
|
+
cellColor: '--plasma-cell-color',
|
3
|
+
cellBackgroundColor: '--plasma-cell-background-color',
|
4
|
+
cellPadding: '--plasma-cell-padding',
|
5
|
+
cellPaddingLeftContent: '--plasma-cell-padding-left-content',
|
6
|
+
cellPaddingContent: '--plasma-cell-padding-content',
|
7
|
+
cellPaddingRightContent: '--plasma-cell-padding-right-content',
|
8
|
+
cellTextboxGap: '--plasma-cell-textbox-gap',
|
9
|
+
cellGap: '--plasma-cell-gap',
|
10
|
+
cellWidth: '--plasma-cell-width',
|
11
|
+
cellLabelColor: '--plasma-cell-label-color',
|
12
|
+
cellLabelFontFamily: '--plasma-cell-label-font-family',
|
13
|
+
cellLabelFontSize: '--plasma-cell-label-font-size',
|
14
|
+
cellLabelFontStyle: '--plasma-cell-label-font-style',
|
15
|
+
cellLabelFontWeight: '--plasma-cell-label-font-weight',
|
16
|
+
cellLabelLetterSpacing: '--plasma-cell-label-letter-spacing',
|
17
|
+
cellLabelLineHeight: '--plasma-cell-label-line-height',
|
18
|
+
cellTitleColor: '--plasma-cell-title-color',
|
19
|
+
cellTitleFontFamily: '--plasma-cell-title-font-family',
|
20
|
+
cellTitleFontSize: '--plasma-cell-title-font-size',
|
21
|
+
cellTitleFontStyle: '--plasma-cell-title-font-style',
|
22
|
+
cellTitleFontWeight: '--plasma-cell-title-font-weight',
|
23
|
+
cellTitleLetterSpacing: '--plasma-cell-title-letter-spacing',
|
24
|
+
cellTitleLineHeight: '--plasma-cell-title-line-height',
|
25
|
+
cellSubtitleColor: '--plasma-cell-subtitle-color',
|
26
|
+
cellSubtitleFontFamily: '--plasma-cell-subtitle-font-family',
|
27
|
+
cellSubtitleFontSize: '--plasma-cell-subtitle-font-size',
|
28
|
+
cellSubtitleFontStyle: '--plasma-cell-subtitle-font-style',
|
29
|
+
cellSubtitleFontWeight: '--plasma-cell-subtitle-font-weight',
|
30
|
+
cellSubtitleLetterSpacing: '--plasma-cell-subtitle-letter-spacing',
|
31
|
+
cellSubtitleLineHeight: '--plasma-cell-subtitle-line-height'
|
32
|
+
};
|
33
|
+
export var classes = {
|
34
|
+
autoStretching: 'cell-stretching-auto',
|
35
|
+
filledStretching: 'cell-stretching-filled',
|
36
|
+
fixedStretching: 'cell-stretching-fixed',
|
37
|
+
cellWrapper: 'cell-wrapper',
|
38
|
+
cellRoot: 'cell-root',
|
39
|
+
cellContent: 'cell-content',
|
40
|
+
cellLeftContent: 'cell-left-content',
|
41
|
+
cellRightContent: 'cell-right-content'
|
42
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { TextboxStyled } from './Textbox.styles';
|
3
|
+
import { TextLabel } from './ui/TextLabel';
|
4
|
+
import { TextTitle } from './ui/TextTitle';
|
5
|
+
import { TextSubtitle } from './ui/TextSubtitle';
|
6
|
+
export var Textbox = function Textbox(_ref) {
|
7
|
+
var label = _ref.label,
|
8
|
+
title = _ref.title,
|
9
|
+
subtitle = _ref.subtitle,
|
10
|
+
children = _ref.children;
|
11
|
+
return /*#__PURE__*/React.createElement(TextboxStyled, null, label || title || subtitle ? /*#__PURE__*/React.createElement(React.Fragment, null, label && /*#__PURE__*/React.createElement(TextLabel, null, label), title && /*#__PURE__*/React.createElement(TextTitle, null, title), subtitle && /*#__PURE__*/React.createElement(TextSubtitle, null, subtitle)) : children);
|
12
|
+
};
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import styled from 'styled-components';
|
2
|
+
import { tokens } from '../Cell.tokens';
|
3
|
+
export var TextboxStyled = /*#__PURE__*/styled.div.withConfig({
|
4
|
+
componentId: "plasma-new-hope__sc-t2ald4-0"
|
5
|
+
})(["display:flex;flex-direction:column;gap:var(", ");"], tokens.cellTextboxGap);
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import styled from 'styled-components';
|
3
|
+
import { tokens } from '../../Cell.tokens';
|
4
|
+
var StyledTextLabel = /*#__PURE__*/styled.div.withConfig({
|
5
|
+
componentId: "plasma-new-hope__sc-6e2num-0"
|
6
|
+
})(["color:var(", ");font-size:var(", ");font-weight:var(", ");font-family:var(", ");font-style:var(", ");line-height:var(", ");letter-spacing:var(", ");"], tokens.cellLabelColor, tokens.cellLabelFontSize, tokens.cellLabelFontWeight, tokens.cellLabelFontFamily, tokens.cellLabelFontStyle, tokens.cellLabelLineHeight, tokens.cellLabelLetterSpacing);
|
7
|
+
export var TextLabel = function TextLabel(props) {
|
8
|
+
return /*#__PURE__*/React.createElement(StyledTextLabel, null, props.children);
|
9
|
+
};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import styled from 'styled-components';
|
3
|
+
import { tokens } from '../../Cell.tokens';
|
4
|
+
var StyledTextSubtitle = /*#__PURE__*/styled.div.withConfig({
|
5
|
+
componentId: "plasma-new-hope__sc-jj01ut-0"
|
6
|
+
})(["color:var(", ");font-size:var(", ");font-weight:var(", ");font-family:var(", ");font-style:var(", ");line-height:var(", ");letter-spacing:var(", ");"], tokens.cellSubtitleColor, tokens.cellSubtitleFontSize, tokens.cellSubtitleFontWeight, tokens.cellSubtitleFontFamily, tokens.cellSubtitleFontStyle, tokens.cellSubtitleLineHeight, tokens.cellSubtitleLetterSpacing);
|
7
|
+
export var TextSubtitle = function TextSubtitle(props) {
|
8
|
+
return /*#__PURE__*/React.createElement(StyledTextSubtitle, null, props.children);
|
9
|
+
};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import styled from 'styled-components';
|
3
|
+
import { tokens } from '../../Cell.tokens';
|
4
|
+
var StyledTextTitle = /*#__PURE__*/styled.div.withConfig({
|
5
|
+
componentId: "plasma-new-hope__sc-1mxjeba-0"
|
6
|
+
})(["color:var(", ");font-size:var(", ");font-weight:var(", ");font-family:var(", ");font-style:var(", ");line-height:var(", ");letter-spacing:var(", ");"], tokens.cellTitleColor, tokens.cellTitleFontSize, tokens.cellTitleFontWeight, tokens.cellTitleFontFamily, tokens.cellTitleFontStyle, tokens.cellTitleLineHeight, tokens.cellTitleLetterSpacing);
|
7
|
+
export var TextTitle = function TextTitle(props) {
|
8
|
+
return /*#__PURE__*/React.createElement(StyledTextTitle, null, props.children);
|
9
|
+
};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
export { TextLabel } from './Textbox/ui/TextLabel';
|
2
|
+
export { TextTitle } from './Textbox/ui/TextTitle';
|
3
|
+
export { TextSubtitle } from './Textbox/ui/TextSubtitle';
|
4
|
+
export { cellRoot, cellConfig } from './Cell';
|
5
|
+
export { tokens as cellTokens, classes as cellClasses } from './Cell.tokens';
|
6
|
+
export { Textbox } from './Textbox/Textbox';
|
@@ -0,0 +1 @@
|
|
1
|
+
["--plasma-cell-left-height", "--plasma-cell-right-height", "--plasma-cell-height"]
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { css } from 'styled-components';
|
2
|
+
import { classes, tokens } from '../../Cell.tokens';
|
3
|
+
export var base = /*#__PURE__*/css(["&.", "{width:var(", ");}&.", "{width:100%;}&.", "{width:auto;}"], classes.fixedStretching, tokens.cellWidth, classes.filledStretching, classes.autoStretching);
|
@@ -0,0 +1 @@
|
|
1
|
+
["--plasma-button-width"]
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { css } from 'styled-components';
|
2
|
+
import { tokens } from '../../Cell.tokens';
|
3
|
+
export var base = /*#__PURE__*/css(["color:var(", ");background-color:var(", ");width:100%;display:flex;align-items:center;gap:var(", ");&:focus{outline:0 none;}"], tokens.cellColor, tokens.cellBackgroundColor, tokens.cellGap);
|
@@ -0,0 +1 @@
|
|
1
|
+
["--plasma-cell-color", "--plasma-cell-background-color"]
|
@@ -62,7 +62,6 @@ export var dropdownRoot = function dropdownRoot(Root) {
|
|
62
62
|
placement: getPlacements(placement),
|
63
63
|
trigger: trigger,
|
64
64
|
closeOnOverlayClick: closeOnOverlayClick,
|
65
|
-
closeOnBeyondTargetHover: false,
|
66
65
|
closeOnEsc: closeOnEsc,
|
67
66
|
isFocusTrapped: isFocusTrapped,
|
68
67
|
frame: frame
|
@@ -87,7 +86,7 @@ export var dropdownConfig = {
|
|
87
86
|
}
|
88
87
|
},
|
89
88
|
defaults: {
|
90
|
-
view: '
|
89
|
+
view: 'primary',
|
91
90
|
size: 'm'
|
92
91
|
}
|
93
92
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
-
var _excluded = ["target", "children", "isOpen", "trigger", "hasArrow", "frame", "className", "placement", "offset", "zIndex", "isFocusTrapped", "closeOnEsc", "preventOverflow", "usePortal", "view", "onToggle"];
|
2
|
+
var _excluded = ["target", "children", "isOpen", "trigger", "hasArrow", "frame", "className", "placement", "offset", "zIndex", "isFocusTrapped", "closeOnOverlayClick", "closeOnEsc", "preventOverflow", "usePortal", "view", "onToggle"];
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
@@ -30,41 +30,33 @@ export var POPOVER_PORTAL_ID = 'plasma-popover-root';
|
|
30
30
|
* и вызова по клику либо ховеру.
|
31
31
|
*/
|
32
32
|
export var popoverRoot = function popoverRoot(Root) {
|
33
|
-
return /*#__PURE__*/forwardRef(function (
|
34
|
-
var
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
closeOnEsc =
|
53
|
-
|
54
|
-
preventOverflow =
|
55
|
-
|
56
|
-
usePortal =
|
57
|
-
view =
|
58
|
-
onToggle =
|
59
|
-
rest = _objectWithoutProperties(
|
60
|
-
var closeOnOverlayClick = true;
|
61
|
-
var closeOnBeyondTargetHover = true;
|
62
|
-
if (props.trigger === 'click' && props.closeOnOverlayClick === false) {
|
63
|
-
closeOnOverlayClick = false;
|
64
|
-
}
|
65
|
-
if (props.trigger === 'hover' && props.closeOnBeyondTargetHover === false) {
|
66
|
-
closeOnBeyondTargetHover = false;
|
67
|
-
}
|
33
|
+
return /*#__PURE__*/forwardRef(function (_ref, outerRootRef) {
|
34
|
+
var target = _ref.target,
|
35
|
+
children = _ref.children,
|
36
|
+
isOpen = _ref.isOpen,
|
37
|
+
trigger = _ref.trigger,
|
38
|
+
hasArrow = _ref.hasArrow,
|
39
|
+
_ref$frame = _ref.frame,
|
40
|
+
frame = _ref$frame === void 0 ? 'document' : _ref$frame,
|
41
|
+
className = _ref.className,
|
42
|
+
_ref$placement = _ref.placement,
|
43
|
+
placement = _ref$placement === void 0 ? 'auto' : _ref$placement,
|
44
|
+
_ref$offset = _ref.offset,
|
45
|
+
offset = _ref$offset === void 0 ? [0, 0] : _ref$offset,
|
46
|
+
zIndex = _ref.zIndex,
|
47
|
+
_ref$isFocusTrapped = _ref.isFocusTrapped,
|
48
|
+
isFocusTrapped = _ref$isFocusTrapped === void 0 ? true : _ref$isFocusTrapped,
|
49
|
+
_ref$closeOnOverlayCl = _ref.closeOnOverlayClick,
|
50
|
+
closeOnOverlayClick = _ref$closeOnOverlayCl === void 0 ? true : _ref$closeOnOverlayCl,
|
51
|
+
_ref$closeOnEsc = _ref.closeOnEsc,
|
52
|
+
closeOnEsc = _ref$closeOnEsc === void 0 ? true : _ref$closeOnEsc,
|
53
|
+
_ref$preventOverflow = _ref.preventOverflow,
|
54
|
+
preventOverflow = _ref$preventOverflow === void 0 ? true : _ref$preventOverflow,
|
55
|
+
_ref$usePortal = _ref.usePortal,
|
56
|
+
usePortal = _ref$usePortal === void 0 ? false : _ref$usePortal,
|
57
|
+
view = _ref.view,
|
58
|
+
onToggle = _ref.onToggle,
|
59
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
68
60
|
var rootRef = useRef(null);
|
69
61
|
var popoverRef = useRef(null);
|
70
62
|
var handleRef = useForkRef(rootRef, outerRootRef);
|
@@ -85,9 +77,7 @@ export var popoverRoot = function popoverRoot(Root) {
|
|
85
77
|
opacity: isOpen ? 1 : 0
|
86
78
|
};
|
87
79
|
var _usePopper = usePopper(rootRef.current, popoverRef.current, {
|
88
|
-
|
89
|
-
// eslint-disable-next-line no-nested-ternary
|
90
|
-
placement: isAutoArray ? (_placement$ = placement[0]) !== null && _placement$ !== void 0 && _placement$.endsWith('start') ? 'auto-start' : 'auto' : placement,
|
80
|
+
placement: isAutoArray ? 'auto' : placement,
|
91
81
|
modifiers: [{
|
92
82
|
name: 'preventOverflow',
|
93
83
|
options: {
|
@@ -223,15 +213,10 @@ export var popoverRoot = function popoverRoot(Root) {
|
|
223
213
|
}, target), children && portalRef.current && /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(Root, _extends({
|
224
214
|
view: view,
|
225
215
|
className: className
|
226
|
-
}, rest, {
|
227
|
-
onMouseEnter: closeOnBeyondTargetHover ? undefined : onMouseEnter,
|
228
|
-
onMouseLeave: closeOnBeyondTargetHover ? undefined : onMouseEnter
|
229
|
-
}), /*#__PURE__*/React.createElement(StyledPopover, _extends({}, attributes.popper, {
|
216
|
+
}, rest), /*#__PURE__*/React.createElement(StyledPopover, _extends({}, attributes.popper, {
|
230
217
|
className: classes.root,
|
231
218
|
ref: popoverForkRef,
|
232
|
-
style: _objectSpread(_objectSpread(
|
233
|
-
display: isOpen ? 'block' : 'none'
|
234
|
-
}), initialStyles),
|
219
|
+
style: _objectSpread(_objectSpread({}, styles.popper), initialStyles),
|
235
220
|
zIndex: zIndex
|
236
221
|
}), hasArrow && /*#__PURE__*/React.createElement(StyledArrow, _extends({
|
237
222
|
className: classes.arrow,
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { css } from 'styled-components';
|
2
|
+
import { cellTokens } from '../../../../components/Cell';
|
3
|
+
export var config = {
|
4
|
+
defaults: {
|
5
|
+
view: 'default',
|
6
|
+
size: 'm',
|
7
|
+
stretching: 'filled'
|
8
|
+
},
|
9
|
+
variations: {
|
10
|
+
view: {
|
11
|
+
"default": /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--text-primary);", ":var(--text-secondary);", ":transparent;"], cellTokens.cellColor, cellTokens.cellLabelColor, cellTokens.cellTitleColor, cellTokens.cellSubtitleColor, cellTokens.cellBackgroundColor)
|
12
|
+
},
|
13
|
+
size: {
|
14
|
+
l: /*#__PURE__*/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);"], cellTokens.cellWidth, cellTokens.cellPadding, cellTokens.cellPaddingLeftContent, cellTokens.cellPaddingContent, cellTokens.cellPaddingRightContent, cellTokens.cellTextboxGap, cellTokens.cellGap, cellTokens.cellLabelFontFamily, cellTokens.cellLabelFontSize, cellTokens.cellLabelFontStyle, cellTokens.cellLabelFontWeight, cellTokens.cellLabelLetterSpacing, cellTokens.cellLabelLineHeight, cellTokens.cellTitleFontFamily, cellTokens.cellTitleFontSize, cellTokens.cellTitleFontStyle, cellTokens.cellTitleFontWeight, cellTokens.cellTitleLetterSpacing, cellTokens.cellTitleLineHeight, cellTokens.cellSubtitleFontFamily, cellTokens.cellSubtitleFontSize, cellTokens.cellSubtitleFontStyle, cellTokens.cellSubtitleFontWeight, cellTokens.cellSubtitleLetterSpacing, cellTokens.cellSubtitleLineHeight),
|
15
|
+
m: /*#__PURE__*/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);"], cellTokens.cellWidth, cellTokens.cellPadding, cellTokens.cellPaddingLeftContent, cellTokens.cellPaddingContent, cellTokens.cellPaddingRightContent, cellTokens.cellTextboxGap, cellTokens.cellGap, cellTokens.cellLabelFontFamily, cellTokens.cellLabelFontSize, cellTokens.cellLabelFontStyle, cellTokens.cellLabelFontWeight, cellTokens.cellLabelLetterSpacing, cellTokens.cellLabelLineHeight, cellTokens.cellTitleFontFamily, cellTokens.cellTitleFontSize, cellTokens.cellTitleFontStyle, cellTokens.cellTitleFontWeight, cellTokens.cellTitleLetterSpacing, cellTokens.cellTitleLineHeight, cellTokens.cellSubtitleFontFamily, cellTokens.cellSubtitleFontSize, cellTokens.cellSubtitleFontStyle, cellTokens.cellSubtitleFontWeight, cellTokens.cellSubtitleLetterSpacing, cellTokens.cellSubtitleLineHeight),
|
16
|
+
s: /*#__PURE__*/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);"], cellTokens.cellWidth, cellTokens.cellPadding, cellTokens.cellPaddingLeftContent, cellTokens.cellPaddingContent, cellTokens.cellPaddingRightContent, cellTokens.cellTextboxGap, cellTokens.cellGap, cellTokens.cellLabelFontFamily, cellTokens.cellLabelFontSize, cellTokens.cellLabelFontStyle, cellTokens.cellLabelFontWeight, cellTokens.cellLabelLetterSpacing, cellTokens.cellLabelLineHeight, cellTokens.cellTitleFontFamily, cellTokens.cellTitleFontSize, cellTokens.cellTitleFontStyle, cellTokens.cellTitleFontWeight, cellTokens.cellTitleLetterSpacing, cellTokens.cellTitleLineHeight, cellTokens.cellSubtitleFontFamily, cellTokens.cellSubtitleFontSize, cellTokens.cellSubtitleFontStyle, cellTokens.cellSubtitleFontWeight, cellTokens.cellSubtitleLetterSpacing, cellTokens.cellSubtitleLineHeight),
|
17
|
+
xs: /*#__PURE__*/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);"], cellTokens.cellWidth, cellTokens.cellPadding, cellTokens.cellPaddingLeftContent, cellTokens.cellPaddingContent, cellTokens.cellPaddingRightContent, cellTokens.cellTextboxGap, cellTokens.cellGap, cellTokens.cellLabelFontFamily, cellTokens.cellLabelFontSize, cellTokens.cellLabelFontStyle, cellTokens.cellLabelFontWeight, cellTokens.cellLabelLetterSpacing, cellTokens.cellLabelLineHeight, cellTokens.cellTitleFontFamily, cellTokens.cellTitleFontSize, cellTokens.cellTitleFontStyle, cellTokens.cellTitleFontWeight, cellTokens.cellTitleLetterSpacing, cellTokens.cellTitleLineHeight, cellTokens.cellSubtitleFontFamily, cellTokens.cellSubtitleFontSize, cellTokens.cellSubtitleFontStyle, cellTokens.cellSubtitleFontWeight, cellTokens.cellSubtitleLetterSpacing, cellTokens.cellSubtitleLineHeight)
|
18
|
+
},
|
19
|
+
stretching: {
|
20
|
+
auto: /*#__PURE__*/css([""]),
|
21
|
+
filled: /*#__PURE__*/css([""]),
|
22
|
+
fixed: /*#__PURE__*/css([""])
|
23
|
+
}
|
24
|
+
}
|
25
|
+
};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { cellConfig, Textbox, TextLabel, TextSubtitle, TextTitle } from '../../../../components/Cell';
|
2
|
+
import { component, mergeConfig } from '../../../../engines';
|
3
|
+
import { config } from './Cell.config';
|
4
|
+
var mergedConfig = /*#__PURE__*/mergeConfig(cellConfig, config);
|
5
|
+
export var Cell = /*#__PURE__*/component(mergedConfig);
|
6
|
+
export { Textbox, TextLabel, TextSubtitle, TextTitle };
|
@@ -0,0 +1,131 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import type { ComponentProps } from 'react';
|
3
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
4
|
+
import styled from 'styled-components';
|
5
|
+
|
6
|
+
import { WithTheme } from '../../../_helpers';
|
7
|
+
import { Avatar } from '../Avatar/Avatar';
|
8
|
+
import { IconChevronLeft } from '../../../../components/_Icon';
|
9
|
+
|
10
|
+
import { Cell, Textbox, TextTitle } from './Cell';
|
11
|
+
|
12
|
+
type StoryProps = ComponentProps<typeof Cell> & {
|
13
|
+
itemsCount?: number;
|
14
|
+
enableLeftContent?: boolean;
|
15
|
+
enableRightContent?: boolean;
|
16
|
+
};
|
17
|
+
type Story = StoryObj<StoryProps>;
|
18
|
+
|
19
|
+
const sizes = ['l', 'm', 's', 'xs'];
|
20
|
+
const stretchingValues = ['fixed', 'filled', 'auto'];
|
21
|
+
const alignLeft = ['top', 'center', 'bottom'];
|
22
|
+
const alignRight = ['top', 'center', 'bottom'];
|
23
|
+
|
24
|
+
type SizesCell = 'xs' | 'l' | 'm' | 's' | undefined;
|
25
|
+
type SizesAvatar = 'l' | 'm' | 's';
|
26
|
+
|
27
|
+
const getSize = (size: SizesCell): SizesAvatar => {
|
28
|
+
if (size === 'xs' || !size) {
|
29
|
+
return 's';
|
30
|
+
}
|
31
|
+
|
32
|
+
return size;
|
33
|
+
};
|
34
|
+
|
35
|
+
const meta: Meta<typeof Cell> = {
|
36
|
+
title: 'plasma_b2c/Cell',
|
37
|
+
decorators: [WithTheme],
|
38
|
+
argTypes: {
|
39
|
+
size: {
|
40
|
+
options: sizes,
|
41
|
+
control: {
|
42
|
+
type: 'select',
|
43
|
+
},
|
44
|
+
},
|
45
|
+
stretching: {
|
46
|
+
options: stretchingValues,
|
47
|
+
control: {
|
48
|
+
type: 'select',
|
49
|
+
},
|
50
|
+
},
|
51
|
+
alignLeft: {
|
52
|
+
options: alignLeft,
|
53
|
+
control: {
|
54
|
+
type: 'select',
|
55
|
+
},
|
56
|
+
},
|
57
|
+
alignRight: {
|
58
|
+
options: alignRight,
|
59
|
+
control: {
|
60
|
+
type: 'select',
|
61
|
+
},
|
62
|
+
},
|
63
|
+
},
|
64
|
+
};
|
65
|
+
|
66
|
+
export default meta;
|
67
|
+
|
68
|
+
const ChevronRight = styled(IconChevronLeft)`
|
69
|
+
transform: rotate(180deg);
|
70
|
+
color: var(--text-secondary);
|
71
|
+
`;
|
72
|
+
|
73
|
+
export const Default: Story = {
|
74
|
+
args: {
|
75
|
+
size: 'm',
|
76
|
+
stretching: 'filled',
|
77
|
+
enableLeftContent: false,
|
78
|
+
enableRightContent: false,
|
79
|
+
alignLeft: 'center',
|
80
|
+
alignRight: 'center',
|
81
|
+
title: 'Title',
|
82
|
+
subtitle: 'Subtitle',
|
83
|
+
label: 'Label',
|
84
|
+
},
|
85
|
+
render: ({ ...args }: StoryProps) => {
|
86
|
+
return (
|
87
|
+
<Cell
|
88
|
+
contentLeft={
|
89
|
+
!args.enableLeftContent && (
|
90
|
+
<Avatar size={getSize(args.size)} url="https://avatars.githubusercontent.com/u/1813468?v=4" />
|
91
|
+
)
|
92
|
+
}
|
93
|
+
alignLeft={args.alignLeft}
|
94
|
+
contentRight={!args.enableRightContent && <ChevronRight color="inherit" size="xs" />}
|
95
|
+
alignRight={args.alignRight}
|
96
|
+
title={args.title}
|
97
|
+
subtitle={args.subtitle}
|
98
|
+
label={args.label}
|
99
|
+
{...args}
|
100
|
+
/>
|
101
|
+
);
|
102
|
+
},
|
103
|
+
};
|
104
|
+
|
105
|
+
export const WithContentTextboxCustom: Story = {
|
106
|
+
args: {
|
107
|
+
size: 'm',
|
108
|
+
stretching: 'filled',
|
109
|
+
},
|
110
|
+
render: ({ ...args }: StoryProps) => {
|
111
|
+
const MyStyledText = styled.div`
|
112
|
+
font-size: 12px;
|
113
|
+
font-weight: 600;
|
114
|
+
opacity: 0.5;
|
115
|
+
`;
|
116
|
+
return (
|
117
|
+
<Cell
|
118
|
+
contentLeft={
|
119
|
+
<Avatar size={getSize(args.size)} url="https://avatars.githubusercontent.com/u/1813468?v=4" />
|
120
|
+
}
|
121
|
+
contentRight={<ChevronRight color="inherit" size="xs" />}
|
122
|
+
{...args}
|
123
|
+
>
|
124
|
+
<Textbox>
|
125
|
+
<TextTitle>Title</TextTitle>
|
126
|
+
<MyStyledText>My styled Text</MyStyledText>
|
127
|
+
</Textbox>
|
128
|
+
</Cell>
|
129
|
+
);
|
130
|
+
},
|
131
|
+
};
|
@@ -33,12 +33,6 @@ const meta: Meta<typeof Popover> = {
|
|
33
33
|
},
|
34
34
|
table: { defaultValue: { summary: true } },
|
35
35
|
},
|
36
|
-
closeOnBeyondTargetHover: {
|
37
|
-
control: {
|
38
|
-
type: 'boolean',
|
39
|
-
},
|
40
|
-
table: { defaultValue: { summary: true } },
|
41
|
-
},
|
42
36
|
closeOnEsc: {
|
43
37
|
control: {
|
44
38
|
type: 'boolean',
|
@@ -68,7 +62,6 @@ const meta: Meta<typeof Popover> = {
|
|
68
62
|
placement: 'bottom',
|
69
63
|
trigger: 'click',
|
70
64
|
closeOnOverlayClick: true,
|
71
|
-
closeOnBeyondTargetHover: true,
|
72
65
|
closeOnEsc: true,
|
73
66
|
isFocusTrapped: true,
|
74
67
|
skidding: 0,
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { css } from 'styled-components';
|
2
|
+
import { cellTokens } from '../../../../components/Cell';
|
3
|
+
export var config = {
|
4
|
+
defaults: {
|
5
|
+
view: 'default',
|
6
|
+
size: 'm',
|
7
|
+
stretching: 'filled'
|
8
|
+
},
|
9
|
+
variations: {
|
10
|
+
view: {
|
11
|
+
"default": /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--text-primary);", ":var(--text-secondary);", ":transparent;"], cellTokens.cellColor, cellTokens.cellLabelColor, cellTokens.cellTitleColor, cellTokens.cellSubtitleColor, cellTokens.cellBackgroundColor)
|
12
|
+
},
|
13
|
+
size: {
|
14
|
+
l: /*#__PURE__*/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);"], cellTokens.cellWidth, cellTokens.cellPadding, cellTokens.cellPaddingLeftContent, cellTokens.cellPaddingContent, cellTokens.cellPaddingRightContent, cellTokens.cellTextboxGap, cellTokens.cellGap, cellTokens.cellLabelFontFamily, cellTokens.cellLabelFontSize, cellTokens.cellLabelFontStyle, cellTokens.cellLabelFontWeight, cellTokens.cellLabelLetterSpacing, cellTokens.cellLabelLineHeight, cellTokens.cellTitleFontFamily, cellTokens.cellTitleFontSize, cellTokens.cellTitleFontStyle, cellTokens.cellTitleFontWeight, cellTokens.cellTitleLetterSpacing, cellTokens.cellTitleLineHeight, cellTokens.cellSubtitleFontFamily, cellTokens.cellSubtitleFontSize, cellTokens.cellSubtitleFontStyle, cellTokens.cellSubtitleFontWeight, cellTokens.cellSubtitleLetterSpacing, cellTokens.cellSubtitleLineHeight),
|
15
|
+
m: /*#__PURE__*/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);"], cellTokens.cellWidth, cellTokens.cellPadding, cellTokens.cellPaddingLeftContent, cellTokens.cellPaddingContent, cellTokens.cellPaddingRightContent, cellTokens.cellTextboxGap, cellTokens.cellGap, cellTokens.cellLabelFontFamily, cellTokens.cellLabelFontSize, cellTokens.cellLabelFontStyle, cellTokens.cellLabelFontWeight, cellTokens.cellLabelLetterSpacing, cellTokens.cellLabelLineHeight, cellTokens.cellTitleFontFamily, cellTokens.cellTitleFontSize, cellTokens.cellTitleFontStyle, cellTokens.cellTitleFontWeight, cellTokens.cellTitleLetterSpacing, cellTokens.cellTitleLineHeight, cellTokens.cellSubtitleFontFamily, cellTokens.cellSubtitleFontSize, cellTokens.cellSubtitleFontStyle, cellTokens.cellSubtitleFontWeight, cellTokens.cellSubtitleLetterSpacing, cellTokens.cellSubtitleLineHeight),
|
16
|
+
s: /*#__PURE__*/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);"], cellTokens.cellWidth, cellTokens.cellPadding, cellTokens.cellPaddingLeftContent, cellTokens.cellPaddingContent, cellTokens.cellPaddingRightContent, cellTokens.cellTextboxGap, cellTokens.cellGap, cellTokens.cellLabelFontFamily, cellTokens.cellLabelFontSize, cellTokens.cellLabelFontStyle, cellTokens.cellLabelFontWeight, cellTokens.cellLabelLetterSpacing, cellTokens.cellLabelLineHeight, cellTokens.cellTitleFontFamily, cellTokens.cellTitleFontSize, cellTokens.cellTitleFontStyle, cellTokens.cellTitleFontWeight, cellTokens.cellTitleLetterSpacing, cellTokens.cellTitleLineHeight, cellTokens.cellSubtitleFontFamily, cellTokens.cellSubtitleFontSize, cellTokens.cellSubtitleFontStyle, cellTokens.cellSubtitleFontWeight, cellTokens.cellSubtitleLetterSpacing, cellTokens.cellSubtitleLineHeight),
|
17
|
+
xs: /*#__PURE__*/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);"], cellTokens.cellWidth, cellTokens.cellPadding, cellTokens.cellPaddingLeftContent, cellTokens.cellPaddingContent, cellTokens.cellPaddingRightContent, cellTokens.cellTextboxGap, cellTokens.cellGap, cellTokens.cellGap, cellTokens.cellLabelFontFamily, cellTokens.cellLabelFontSize, cellTokens.cellLabelFontStyle, cellTokens.cellLabelFontWeight, cellTokens.cellLabelLetterSpacing, cellTokens.cellLabelLineHeight, cellTokens.cellTitleFontFamily, cellTokens.cellTitleFontSize, cellTokens.cellTitleFontStyle, cellTokens.cellTitleFontWeight, cellTokens.cellTitleLetterSpacing, cellTokens.cellTitleLineHeight, cellTokens.cellSubtitleFontFamily, cellTokens.cellSubtitleFontSize, cellTokens.cellSubtitleFontStyle, cellTokens.cellSubtitleFontWeight, cellTokens.cellSubtitleLetterSpacing, cellTokens.cellSubtitleLineHeight)
|
18
|
+
},
|
19
|
+
stretching: {
|
20
|
+
auto: /*#__PURE__*/css([""]),
|
21
|
+
filled: /*#__PURE__*/css([""]),
|
22
|
+
fixed: /*#__PURE__*/css([""])
|
23
|
+
}
|
24
|
+
}
|
25
|
+
};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { cellConfig, Textbox, TextLabel, TextSubtitle, TextTitle } from '../../../../components/Cell';
|
2
|
+
import { component, mergeConfig } from '../../../../engines';
|
3
|
+
import { config } from './Cell.config';
|
4
|
+
var mergedConfig = /*#__PURE__*/mergeConfig(cellConfig, config);
|
5
|
+
export var Cell = /*#__PURE__*/component(mergedConfig);
|
6
|
+
export { Textbox, TextLabel, TextSubtitle, TextTitle };
|