@salutejs/plasma-new-hope 0.241.0-dev.0 → 0.241.1-canary.1668.12830115017.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/Attach/Attach.css +8 -8
- package/cjs/components/Attach/components/AttachButton/AttachButton.css +8 -8
- package/cjs/components/Button/Button.css +8 -8
- package/cjs/components/Button/Button.js +8 -2
- package/cjs/components/Button/Button.js.map +1 -1
- package/cjs/components/Button/Button.styles.js +22 -3
- package/cjs/components/Button/Button.styles.js.map +1 -1
- package/cjs/components/Button/{Button.styles_1sopr3d.css → Button.styles_8cvmld.css} +2 -2
- package/cjs/components/Calendar/CalendarBase/CalendarBase.css +8 -8
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.css +8 -8
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.css +8 -8
- package/cjs/components/Combobox/ComboboxNew/Combobox.css +8 -8
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.css +8 -8
- package/cjs/components/DatePicker/RangeDate/RangeDate.css +8 -8
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +8 -8
- package/cjs/components/DatePicker/SingleDate/SingleDate.css +8 -8
- package/cjs/components/Drawer/Drawer.css +8 -8
- package/cjs/components/Drawer/ui/DrawerContent/DrawerContent.css +8 -8
- package/cjs/components/EmptyState/EmptyState.css +8 -8
- package/cjs/components/IconButton/IconButton.css +8 -8
- package/cjs/components/Notification/Notification.css +8 -8
- package/cjs/components/Notification/NotificationsProvider.css +8 -8
- package/cjs/components/NumberInput/NumberInput.css +8 -8
- package/cjs/components/Pagination/Pagination.css +8 -8
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +8 -8
- package/cjs/components/Panel/ui/PanelHeader/PanelHeader.css +8 -8
- package/cjs/components/Select/Select.css +8 -8
- package/cjs/components/Select/ui/Target/Target.css +8 -8
- package/cjs/components/Select/ui/Target/ui/Button/Button.css +8 -8
- package/cjs/components/Toast/Toast.css +8 -8
- package/cjs/components/Toast/ToastController.css +8 -8
- package/cjs/index.css +8 -8
- package/emotion/cjs/components/Button/Button.js +8 -2
- package/emotion/cjs/components/Button/Button.styles.js +14 -8
- package/emotion/cjs/components/Button/Button.template-doc.mdx +21 -36
- package/emotion/cjs/components/IconButton/IconButton.template-doc.mdx +16 -6
- package/emotion/cjs/examples/plasma_b2c/components/Button/Button.stories.tsx +5 -4
- package/emotion/cjs/examples/plasma_web/components/Button/Button.stories.tsx +1 -1
- package/emotion/es/components/Button/Button.js +8 -2
- package/emotion/es/components/Button/Button.styles.js +14 -8
- package/emotion/es/components/Button/Button.template-doc.mdx +21 -36
- package/emotion/es/components/IconButton/IconButton.template-doc.mdx +16 -6
- package/emotion/es/examples/plasma_b2c/components/Button/Button.stories.tsx +5 -4
- package/emotion/es/examples/plasma_web/components/Button/Button.stories.tsx +1 -1
- package/es/components/Attach/Attach.css +8 -8
- package/es/components/Attach/components/AttachButton/AttachButton.css +8 -8
- package/es/components/Button/Button.css +8 -8
- package/es/components/Button/Button.js +8 -2
- package/es/components/Button/Button.js.map +1 -1
- package/es/components/Button/Button.styles.js +22 -3
- package/es/components/Button/Button.styles.js.map +1 -1
- package/es/components/Button/{Button.styles_1sopr3d.css → Button.styles_8cvmld.css} +2 -2
- package/es/components/Calendar/CalendarBase/CalendarBase.css +8 -8
- package/es/components/Calendar/CalendarDouble/CalendarDouble.css +8 -8
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.css +8 -8
- package/es/components/Combobox/ComboboxNew/Combobox.css +8 -8
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.css +8 -8
- package/es/components/DatePicker/RangeDate/RangeDate.css +8 -8
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +8 -8
- package/es/components/DatePicker/SingleDate/SingleDate.css +8 -8
- package/es/components/Drawer/Drawer.css +8 -8
- package/es/components/Drawer/ui/DrawerContent/DrawerContent.css +8 -8
- package/es/components/EmptyState/EmptyState.css +8 -8
- package/es/components/IconButton/IconButton.css +8 -8
- package/es/components/Notification/Notification.css +8 -8
- package/es/components/Notification/NotificationsProvider.css +8 -8
- package/es/components/NumberInput/NumberInput.css +8 -8
- package/es/components/Pagination/Pagination.css +8 -8
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +8 -8
- package/es/components/Panel/ui/PanelHeader/PanelHeader.css +8 -8
- package/es/components/Select/Select.css +8 -8
- package/es/components/Select/ui/Target/Target.css +8 -8
- package/es/components/Select/ui/Target/ui/Button/Button.css +8 -8
- package/es/components/Toast/Toast.css +8 -8
- package/es/components/Toast/ToastController.css +8 -8
- package/es/index.css +8 -8
- package/package.json +3 -3
- package/styled-components/cjs/components/Button/Button.js +8 -2
- package/styled-components/cjs/components/Button/Button.styles.js +8 -2
- package/styled-components/cjs/components/Button/Button.template-doc.mdx +21 -36
- package/styled-components/cjs/components/IconButton/IconButton.template-doc.mdx +16 -6
- package/styled-components/cjs/examples/plasma_b2c/components/Button/Button.stories.tsx +5 -4
- package/styled-components/cjs/examples/plasma_web/components/Button/Button.stories.tsx +1 -1
- package/styled-components/es/components/Button/Button.js +8 -2
- package/styled-components/es/components/Button/Button.styles.js +8 -2
- package/styled-components/es/components/Button/Button.template-doc.mdx +21 -36
- package/styled-components/es/components/IconButton/IconButton.template-doc.mdx +16 -6
- package/styled-components/es/examples/plasma_b2c/components/Button/Button.stories.tsx +5 -4
- package/styled-components/es/examples/plasma_web/components/Button/Button.stories.tsx +1 -1
- package/types/components/Button/Button.d.ts.map +1 -1
- package/types/components/Button/Button.styles.d.ts +6 -2
- package/types/components/Button/Button.styles.d.ts.map +1 -1
- package/types/components/Button/Button.types.d.ts +5 -9
- package/types/components/Button/Button.types.d.ts.map +1 -1
package/es/index.css
CHANGED
@@ -8,14 +8,14 @@
|
|
8
8
|
|
9
9
|
.base_hy8dc_bdz31nb__bd4ad37e.base_hy8dc_buttonStretchingFixed__bd4ad37e{width:var(--plasma-button-width);}.base_hy8dc_bdz31nb__bd4ad37e.base_hy8dc_buttonStretchingFilled__bd4ad37e{width:100%;}.base_hy8dc_bdz31nb__bd4ad37e.base_hy8dc_buttonStretchingAuto__bd4ad37e{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;}
|
10
10
|
|
11
|
-
.
|
12
|
-
.
|
13
|
-
.
|
14
|
-
.
|
15
|
-
.
|
16
|
-
.
|
17
|
-
.
|
18
|
-
.
|
11
|
+
.Button_styles_8cvmld_bzw1898__4694a0fa{min-width:4ch;-webkit-flex-shrink:2;-ms-flex-negative:2;flex-shrink:2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.Button_styles_8cvmld_bzw1898__4694a0fa.Button_styles_8cvmld_buttonContentRelaxed__4694a0fa{text-align:start;-webkit-box-flex:2;-webkit-flex-grow:2;-ms-flex-positive:2;flex-grow:2;}
|
12
|
+
.Button_styles_8cvmld_bdfuqwe__4694a0fa{color:var(--plasma-button-value-color);margin:var(--plasma-button-value-margin);min-width:4ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
13
|
+
.Button_styles_8cvmld_l9ypozh__4694a0fa{opacity:var(--l9ypozh-0);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:inherit;-webkit-box-align:inherit;-ms-flex-align:inherit;align-items:inherit;-webkit-box-pack:var(--l9ypozh-1);-webkit-justify-content:var(--l9ypozh-1);-ms-flex-pack:var(--l9ypozh-1);justify-content:var(--l9ypozh-1);height:100%;width:100%;}
|
14
|
+
.Button_styles_8cvmld_l4dfhbg__4694a0fa{position:absolute;}
|
15
|
+
.Button_styles_8cvmld_srdlazt__4694a0fa{--plasma-spinner-size:var(--plasma-button-spinner-size);--plasma-spinner-color:var(--plasma-button-spinner-color);}
|
16
|
+
.Button_styles_8cvmld_s7rggv0__4694a0fa{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-self:var(--plasma-button-left-content-align-self);-ms-flex-item-align:var(--plasma-button-left-content-align);align-self:var(--plasma-button-left-content-align-self);margin:var(--s7rggv0-0);}
|
17
|
+
.Button_styles_8cvmld_s1rjh7ra__4694a0fa{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-self:var(--plasma-button-right-content-align-self);-ms-flex-item-align:var(--plasma-button-right-content-align);align-self:var(--plasma-button-right-content-align-self);margin:var(--s1rjh7ra-0);}
|
18
|
+
.Button_styles_8cvmld_b9ga1dj__4694a0fa{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);--plasma_private-btn-br:var(--plasma_computed-btn-br);border-radius:var(--plasma_private-btn-br);}a.Button_styles_8cvmld_b9ga1dj__4694a0fa{-webkit-text-decoration:none;text-decoration:none;}.Button_styles_8cvmld_b9ga1dj__4694a0fa.Button_styles_8cvmld_b9ga1dj__4694a0fa.Button_styles_8cvmld_buttonSquare__4694a0fa{width:var(--plasma-button-height);padding:0;}
|
19
19
|
|
20
20
|
.IconButton_styles_403on7_b1ua728l__d34a8ea7{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);--plasma_private-btn-br:var(--plasma_computed-btn-br);border-radius:var(--plasma_private-btn-br);color:var(--plasma-button-color);background:var(--plasma-button-background-color);height:var(--plasma-button-height);width:var(--plasma-button-width);padding:0 var(--plasma-button-padding,calc(var(--plasma-button-height) * 1.618 / 4));font-family:var(--plasma-button-font-family);font-size:var(--plasma-button-font-size);font-style:var(--plasma-button-font-style);font-weight:var(--plasma-button-font-weight);-webkit-letter-spacing:var(--plasma-button-letter-spacing);-moz-letter-spacing:var(--plasma-button-letter-spacing);-ms-letter-spacing:var(--plasma-button-letter-spacing);letter-spacing:var(--plasma-button-letter-spacing);line-height:var(--plasma-button-line-height);--plasma_private-btn-outline-size:var(--plasma-button-outline-size,0.0625rem);position:relative;--plasma-button-padding:0;--plasma-button-color:var(--plasma-icon-button-color);--plasma-button-background-color:var(--plasma-icon-button-background-color);--plasma-button-color-hover:var(--plasma-icon-button-color-hover);--plasma-button-background-color-hover:var(--plasma-icon-button-background-color-hover);--plasma-button-color-active:var(--plasma-icon-button-color-active);--plasma-button-background-color-active:var(--plasma-icon-button-background-color-active);--plasma-button-loading-background-color:var(--plasma-icon-button-loading-background-color);--plasma-button-font-family:var(--plasma-icon-button-font-family);--plasma-button-font-size:var(--plasma-icon-button-font-size);--plasma-button-font-style:var(--plasma-icon-button-font-style);--plasma-button-font-weight:var(--plasma-icon-button-font-weight);--plasma-button-letter-spacing:var(--plasma-icon-button-letter-spacing);--plasma-button-line-height:var(--plasma-icon-button-line-height);--plasma-button-width:var(--plasma-icon-button-width);--plasma-button-height:var(--plasma-icon-button-height);--plasma-button-radius:var(--plasma-icon-button-radius);--plasma-button-disabled-opacity:var(--plasma-icon-button-disabled-opacity);--plasma-button-focus-color:var(--plasma-icon-button-focus-color);--plasma-button-spinner-size:var(--plasma-icon-button-spinner-size);--plasma-button-spinner-color:var(--plasma-icon-button-spinner-color);}a.IconButton_styles_403on7_b1ua728l__d34a8ea7{-webkit-text-decoration:none;text-decoration:none;}.IconButton_styles_403on7_b1ua728l__d34a8ea7.IconButton_styles_403on7_b1ua728l__d34a8ea7.IconButton_styles_403on7_buttonSquare__d34a8ea7{width:var(--plasma-button-height);padding:0;}.IconButton_styles_403on7_b1ua728l__d34a8ea7:hover{color:var(--plasma-button-color-hover,var(--plasma-button-color));background:var(--plasma-button-background-color-hover,var(--plasma-button-background-color));scale:var(--plasma-button-scale-hover);}.IconButton_styles_403on7_b1ua728l__d34a8ea7:active{color:var(--plasma-button-color-active,var(--plasma-button-color));background:var(--plasma-button-background-color-active,var(--plasma-button-background-color));scale:var(---plasma-button-scale-active);}.IconButton_styles_403on7_b1ua728l__d34a8ea7:focus{outline:none;}.IconButton_styles_403on7_b1ua728l__d34a8ea7::before{content:'';position:absolute;top:-0.125rem;left:-0.125rem;right:-0.125rem;bottom:-0.125rem;z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-btn-outline-size) solid transparent;border-radius:calc(0.125rem + var(--plasma_private-btn-br));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.IconButton_styles_403on7_b1ua728l__d34a8ea7.IconButton_styles_403on7_focusVisible__d34a8ea7:focus::before,.IconButton_styles_403on7_b1ua728l__d34a8ea7[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-btn-outline-size) var(--plasma-button-focus-color);}.IconButton_styles_403on7_b1ua728l__d34a8ea7[disabled]{opacity:var(--plasma-button-disabled-opacity);cursor:not-allowed;}.IconButton_styles_403on7_b1ua728l__d34a8ea7[disabled]:hover,.IconButton_styles_403on7_b1ua728l__d34a8ea7[disabled]:active{scale:none;color:var(--plasma-button-color);background:var(--plasma-button-background-color);}.IconButton_styles_403on7_b1ua728l__d34a8ea7.IconButton_styles_403on7_buttonStretchingFixed__d34a8ea7{width:var(--plasma-button-width);}.IconButton_styles_403on7_b1ua728l__d34a8ea7.IconButton_styles_403on7_buttonStretchingFilled__d34a8ea7{width:100%;}.IconButton_styles_403on7_b1ua728l__d34a8ea7.IconButton_styles_403on7_buttonStretchingAuto__d34a8ea7{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;}
|
21
21
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/plasma-new-hope",
|
3
|
-
"version": "0.241.
|
3
|
+
"version": "0.241.1-canary.1668.12830115017.0",
|
4
4
|
"description": "Salute Design System blueprint",
|
5
5
|
"main": "cjs/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -80,7 +80,7 @@
|
|
80
80
|
"@rollup/plugin-babel": "^6.0.4",
|
81
81
|
"@rollup/plugin-commonjs": "^25.0.4",
|
82
82
|
"@rollup/plugin-node-resolve": "^15.1.0",
|
83
|
-
"@salutejs/plasma-sb-utils": "0.190.
|
83
|
+
"@salutejs/plasma-sb-utils": "0.190.1-canary.1668.12830115017.0",
|
84
84
|
"@salutejs/plasma-themes": "0.28.0",
|
85
85
|
"@storybook/addon-docs": "^7.6.17",
|
86
86
|
"@storybook/addon-essentials": "^7.6.17",
|
@@ -131,5 +131,5 @@
|
|
131
131
|
"sideEffects": [
|
132
132
|
"*.css"
|
133
133
|
],
|
134
|
-
"gitHead": "
|
134
|
+
"gitHead": "bd160178f442bffe1e197cfb7a35d4e6884c8655"
|
135
135
|
}
|
@@ -54,6 +54,8 @@ var buttonRoot = exports.buttonRoot = function buttonRoot(Root) {
|
|
54
54
|
stretching = _props$stretching === void 0 ? 'auto' : _props$stretching,
|
55
55
|
rest = _objectWithoutProperties(props, _excluded);
|
56
56
|
var txt = typeof children === 'string' ? children : text;
|
57
|
+
var hasRightContentMargin = Boolean(txt || value || contentRight);
|
58
|
+
var hasLeftContentMargin = Boolean(contentLeft ? contentLeft && (txt || value) : txt || value);
|
57
59
|
var stretchingClass = stretch ? _Button2.classes.filledStretching : _Button2.classes["".concat(stretching, "Stretching")];
|
58
60
|
var contentRelaxedClass = contentPlacing === 'relaxed' ? _Button2.classes.contentRelaxed : undefined;
|
59
61
|
var squareClass = square ? _Button2.classes.buttonSquare : undefined;
|
@@ -81,9 +83,13 @@ var buttonRoot = exports.buttonRoot = function buttonRoot(Root) {
|
|
81
83
|
}, rest), /*#__PURE__*/_react["default"].createElement(_Button.LoadWrap, {
|
82
84
|
contentPlacing: contentPlacementValue,
|
83
85
|
isLoading: isLoading
|
84
|
-
}, contentLeft && /*#__PURE__*/_react["default"].createElement(_Button.StyledContentLeft,
|
86
|
+
}, contentLeft && /*#__PURE__*/_react["default"].createElement(_Button.StyledContentLeft, {
|
87
|
+
hasContentMargin: hasRightContentMargin
|
88
|
+
}, contentLeft), txt ? /*#__PURE__*/_react["default"].createElement(_Button.ButtonText, {
|
85
89
|
className: contentRelaxedClass
|
86
|
-
}, txt) : children, value && /*#__PURE__*/_react["default"].createElement(_Button.ButtonValue, null, value), contentRight && /*#__PURE__*/_react["default"].createElement(_Button.StyledContentRight,
|
90
|
+
}, txt) : children, value && /*#__PURE__*/_react["default"].createElement(_Button.ButtonValue, null, value), contentRight && /*#__PURE__*/_react["default"].createElement(_Button.StyledContentRight, {
|
91
|
+
hasContentMargin: hasLeftContentMargin
|
92
|
+
}, contentRight)), isLoading && /*#__PURE__*/_react["default"].createElement(_Button.Loader, null, loader || _StyledSpinner || (_StyledSpinner = /*#__PURE__*/_react["default"].createElement(_Button.StyledSpinner, null))));
|
87
93
|
});
|
88
94
|
};
|
89
95
|
var buttonConfig = exports.buttonConfig = {
|
@@ -42,10 +42,16 @@ var StyledSpinner = exports.StyledSpinner = /*#__PURE__*/(0, _styledComponents["
|
|
42
42
|
})(["", ":var(", ");", ":var(", ");"], _Spinner.spinnerTokens.size, _Button.tokens.buttonSpinnerSize, _Spinner.spinnerTokens.color, _Button.tokens.buttonSpinnerColor);
|
43
43
|
var StyledContentLeft = exports.StyledContentLeft = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
44
44
|
componentId: "plasma-new-hope__sc-9d9bqj-5"
|
45
|
-
})(["display:flex;
|
45
|
+
})(["display:flex;align-self:var(", ");margin:", ";"], _Button.tokens.buttonLeftContentAlignSelf, function (_ref3) {
|
46
|
+
var hasContentMargin = _ref3.hasContentMargin;
|
47
|
+
return hasContentMargin ? "var(".concat(_Button.tokens.buttonLeftContentMargin, ")") : 0;
|
48
|
+
});
|
46
49
|
var StyledContentRight = exports.StyledContentRight = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
47
50
|
componentId: "plasma-new-hope__sc-9d9bqj-6"
|
48
|
-
})(["display:flex;
|
51
|
+
})(["display:flex;align-self:var(", ");margin:", ";"], _Button.tokens.buttonRightContentAlignSelf, function (_ref4) {
|
52
|
+
var hasContentMargin = _ref4.hasContentMargin;
|
53
|
+
return hasContentMargin ? "var(".concat(_Button.tokens.buttonRightContentMargin, ")") : 0;
|
54
|
+
});
|
49
55
|
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteral(["\n position: relative;\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n justify-content: center;\n\n appearance: none;\n border: none;\n cursor: pointer;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n\n a& {\n text-decoration: none;\n }\n\n /* NOTE:\n --plasma_computed-btn-br-radius is defined in Button.tsx\n */\n --plasma_private-btn-br: var(--plasma_computed-btn-br);\n border-radius: var(--plasma_private-btn-br);\n\n &&.", " {\n width: var(", ");\n padding: 0;\n }\n"])), /*#__PURE__*/String(_Button.classes.buttonSquare), _Button.tokens.buttonHeight);
|
50
56
|
|
51
57
|
// INFO: Для возможности переиспользования стилей в других компонентах
|
@@ -8,7 +8,6 @@ import { PropsTable, Description } from '@site/src/components';
|
|
8
8
|
# Button
|
9
9
|
Кнопки могут отображаться в нескольких размерах и цветах, могут содержать текст и/или иконку.
|
10
10
|
|
11
|
-
## Button
|
12
11
|
<Description name="Button" />
|
13
12
|
<PropsTable name="Button" />
|
14
13
|
|
@@ -34,18 +33,18 @@ export function App() {
|
|
34
33
|
<div>
|
35
34
|
<Button text="Текст" />
|
36
35
|
|
37
|
-
<Button text="Текст" contentLeft={<IconDownload />} />
|
36
|
+
<Button text="Текст" contentLeft={<IconDownload color="inherit" />} />
|
38
37
|
|
39
|
-
<Button text="Текст" contentRight={<IconDownload />} />
|
38
|
+
<Button text="Текст" contentRight={<IconDownload color="inherit" />} />
|
40
39
|
|
41
|
-
<Button contentLeft={<IconDownload />} />
|
40
|
+
<Button contentLeft={<IconDownload color="inherit" />} />
|
42
41
|
|
43
42
|
<Button text="Текст" isLoading />
|
44
43
|
|
45
44
|
<Button text="Текст" isLoading loader={<div>Loader...</div>} />
|
46
45
|
|
47
46
|
<Button>
|
48
|
-
<IconDownload />
|
47
|
+
<IconDownload color="inherit" />
|
49
48
|
<span>Текст</span>
|
50
49
|
</Button>
|
51
50
|
</div>
|
@@ -56,7 +55,7 @@ export function App() {
|
|
56
55
|
## Примеры
|
57
56
|
|
58
57
|
### Размер кнопки
|
59
|
-
Размер кнопки задается с помощью свойства `size
|
58
|
+
Размер кнопки задается с помощью свойства `size`:
|
60
59
|
|
61
60
|
```tsx live
|
62
61
|
import React from 'react';
|
@@ -64,11 +63,13 @@ import { Button } from '@salutejs/{{ package }}';
|
|
64
63
|
|
65
64
|
export function App() {
|
66
65
|
return (
|
67
|
-
|
66
|
+
<div>
|
68
67
|
<Button text="Button" size="xl" />
|
69
68
|
<Button text="Button" size="l" />
|
70
69
|
<Button text="Button" size="m" />
|
71
70
|
<Button text="Button" size="s" />
|
71
|
+
<Button text="Button" size="xs" />
|
72
|
+
<Button text="Button" size="xxs" />
|
72
73
|
</div>
|
73
74
|
);
|
74
75
|
}
|
@@ -118,13 +119,17 @@ export function App() {
|
|
118
119
|
|
119
120
|
### Вид кнопки
|
120
121
|
Вид кнопки задается с помощью свойства `view`. Возможные значения свойства `view`:
|
122
|
+
+ `"default"` – по умолчанию;
|
123
|
+
+ `"accent"` – акцентная;
|
121
124
|
+ `"primary"` – основная;
|
122
125
|
+ `"secondary"` – вторичная;
|
126
|
+
+ `"clear"` – без цветового сопровождения.
|
123
127
|
+ `"success"` – успешное завершение;
|
124
128
|
+ `"warning"` – предупреждение;
|
125
129
|
+ `"critical"` – ошибка;
|
126
|
-
+ `"
|
127
|
-
+ `"
|
130
|
+
+ `"dark"` – темная;
|
131
|
+
+ `"black"` – черная;
|
132
|
+
+ `"white"` – белая.
|
128
133
|
|
129
134
|
```tsx live
|
130
135
|
import React from 'react';
|
@@ -132,15 +137,18 @@ import { Button } from '@salutejs/{{ package }}';
|
|
132
137
|
|
133
138
|
export function App() {
|
134
139
|
return (
|
135
|
-
<div>
|
140
|
+
<div style=\{{ display: 'flex', flexWrap: 'wrap' }}>
|
141
|
+
<Button text="Кнопка" size="s" view="default" />
|
136
142
|
<Button text="Кнопка" size="s" view="primary" />
|
143
|
+
<Button text="Кнопка" size="s" view="accent" />
|
137
144
|
<Button text="Кнопка" size="s" view="secondary" />
|
145
|
+
<Button text="Кнопка" size="s" view="clear" />
|
138
146
|
<Button text="Кнопка" size="s" view="success" />
|
139
147
|
<Button text="Кнопка" size="s" view="warning" />
|
140
148
|
<Button text="Кнопка" size="s" view="critical" />
|
141
|
-
<Button text="Кнопка" size="s" view="
|
142
|
-
<Button text="Кнопка" size="s" view="
|
143
|
-
<Button text="Кнопка" size="s" view="
|
149
|
+
<Button text="Кнопка" size="s" view="dark" />
|
150
|
+
<Button text="Кнопка" size="s" view="black" />
|
151
|
+
<Button text="Кнопка" size="s" view="white" />
|
144
152
|
</div>
|
145
153
|
);
|
146
154
|
}
|
@@ -171,29 +179,6 @@ export function App() {
|
|
171
179
|
}
|
172
180
|
```
|
173
181
|
|
174
|
-
### Квадратные и круглые кнопки
|
175
|
-
Для отображения иконок и/или текста в квадратных или круглых кнопках с **равными сторонами**,
|
176
|
-
используйте компонент `Button` и свойство `contentLeft`, в которое требуется передать нужное значение.
|
177
|
-
|
178
|
-
По умолчанию границы кнопки **квадратные** (со скругленными углами) — `pin="square-square"`.
|
179
|
-
**Круглые** границы кнопки можно сделать с помощью свойства `pin` со значением `"circle-circle"`.
|
180
|
-
|
181
|
-
```tsx live
|
182
|
-
import React from 'react';
|
183
|
-
import { Button } from '@salutejs/{{ package }}';
|
184
|
-
import { IconDownload } from '@salutejs/plasma-icons';
|
185
|
-
|
186
|
-
export function App() {
|
187
|
-
return (
|
188
|
-
<div>
|
189
|
-
<Button contentLeft={<IconDownload color="inherit" />} />
|
190
|
-
|
191
|
-
<Button contentLeft={<IconDownload color="inherit" />} pin="circle-circle" />
|
192
|
-
</div>
|
193
|
-
);
|
194
|
-
}
|
195
|
-
```
|
196
|
-
|
197
182
|
### Гиперссылка
|
198
183
|
Компонент поддерживает вывод в виде тега `<a>`, для этого необходимо указать свойство `as`:
|
199
184
|
|
@@ -44,6 +44,9 @@ import { IconClose } from '@salutejs/plasma-icons';
|
|
44
44
|
export function App() {
|
45
45
|
return (
|
46
46
|
<div>
|
47
|
+
<IconButton size="xl">
|
48
|
+
<IconClose color="inherit" />
|
49
|
+
</IconButton>
|
47
50
|
<IconButton size="l">
|
48
51
|
<IconClose color="inherit" />
|
49
52
|
</IconButton>
|
@@ -56,6 +59,9 @@ export function App() {
|
|
56
59
|
<IconButton size="xs">
|
57
60
|
<IconClose color="inherit" size="xs" />
|
58
61
|
</IconButton>
|
62
|
+
<IconButton size="xxs">
|
63
|
+
<IconClose color="inherit" size="xs" />
|
64
|
+
</IconButton>
|
59
65
|
</div>
|
60
66
|
);
|
61
67
|
}
|
@@ -66,11 +72,12 @@ export function App() {
|
|
66
72
|
|
67
73
|
Возможные значения свойства `view`:
|
68
74
|
+ `"default"` – по умолчанию;
|
75
|
+
+ `"accent"` – акцентная;
|
69
76
|
+ `"secondary"` – вторичная;
|
77
|
+
+ `"clear"` – без цветового сопровождения.
|
70
78
|
+ `"success"` – успешное завершение;
|
71
79
|
+ `"warning"` – предупреждение;
|
72
80
|
+ `"critical"` – ошибка;
|
73
|
-
+ `"clear"` – без цветового сопровождения;
|
74
81
|
+ `"dark"` – темная;
|
75
82
|
+ `"black"` – черная;
|
76
83
|
+ `"white"` – белая.
|
@@ -82,13 +89,19 @@ import { IconClose } from '@salutejs/plasma-icons';
|
|
82
89
|
|
83
90
|
export function App() {
|
84
91
|
return (
|
85
|
-
<div>
|
92
|
+
<div style=\{{ display: 'flex', flexWrap: 'wrap' }}>
|
86
93
|
<IconButton size="s" view="default">
|
87
94
|
<IconClose color="inherit" />
|
88
95
|
</IconButton>
|
96
|
+
<IconButton size="s" view="accent">
|
97
|
+
<IconClose color="inherit" />
|
98
|
+
</IconButton>
|
89
99
|
<IconButton size="s" view="secondary">
|
90
100
|
<IconClose color="inherit" />
|
91
101
|
</IconButton>
|
102
|
+
<IconButton size="s" view="clear">
|
103
|
+
<IconClose color="inherit" />
|
104
|
+
</IconButton>
|
92
105
|
<IconButton size="s" view="success">
|
93
106
|
<IconClose color="inherit" />
|
94
107
|
</IconButton>
|
@@ -98,9 +111,6 @@ export function App() {
|
|
98
111
|
<IconButton size="s" view="critical">
|
99
112
|
<IconClose color="inherit" />
|
100
113
|
</IconButton>
|
101
|
-
<IconButton size="s" view="clear">
|
102
|
-
<IconClose color="inherit" />
|
103
|
-
</IconButton>
|
104
114
|
<IconButton size="s" view="dark">
|
105
115
|
<IconClose color="inherit" />
|
106
116
|
</IconButton>
|
@@ -128,7 +138,7 @@ import { IconClose } from '@salutejs/plasma-icons';
|
|
128
138
|
|
129
139
|
export function App() {
|
130
140
|
return (
|
131
|
-
<div>
|
141
|
+
<div style=\{{ display: 'flex', flexWrap: 'wrap' }}>
|
132
142
|
<IconButton pin="square-square">
|
133
143
|
<IconClose color="inherit" />
|
134
144
|
</IconButton>
|
@@ -1,15 +1,16 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import type { ComponentProps } from 'react';
|
3
3
|
import type { StoryObj, Meta } from '@storybook/react';
|
4
|
-
import { disableProps } from '@salutejs/plasma-sb-utils';
|
4
|
+
import { disableProps, getConfigVariations } from '@salutejs/plasma-sb-utils';
|
5
5
|
|
6
6
|
import { IconMic } from '../../../../components/_Icon';
|
7
7
|
import { WithTheme } from '../../../_helpers';
|
8
8
|
|
9
9
|
import { Button } from './Button';
|
10
|
+
import { config } from './Button.config';
|
11
|
+
|
12
|
+
const { views, sizes } = getConfigVariations(config);
|
10
13
|
|
11
|
-
const views = ['default', 'accent', 'positive', 'warning', 'negative', 'dark', 'light'];
|
12
|
-
const sizes = ['xl', 'l', 'm', 's', 'xs', 'xxs'];
|
13
14
|
const stretchingValues = ['auto', 'filled', 'fixed'];
|
14
15
|
const pinValues = [
|
15
16
|
'',
|
@@ -79,7 +80,7 @@ const meta: Meta<typeof Button> = {
|
|
79
80
|
},
|
80
81
|
table: { defaultValue: { summary: 'bottom' } },
|
81
82
|
},
|
82
|
-
...disableProps(['value']),
|
83
|
+
...disableProps(['value', 'focused', 'pin']),
|
83
84
|
},
|
84
85
|
};
|
85
86
|
|
@@ -46,6 +46,8 @@ export var buttonRoot = function buttonRoot(Root) {
|
|
46
46
|
stretching = _props$stretching === void 0 ? 'auto' : _props$stretching,
|
47
47
|
rest = _objectWithoutProperties(props, _excluded);
|
48
48
|
var txt = typeof children === 'string' ? children : text;
|
49
|
+
var hasRightContentMargin = Boolean(txt || value || contentRight);
|
50
|
+
var hasLeftContentMargin = Boolean(contentLeft ? contentLeft && (txt || value) : txt || value);
|
49
51
|
var stretchingClass = stretch ? classes.filledStretching : classes["".concat(stretching, "Stretching")];
|
50
52
|
var contentRelaxedClass = contentPlacing === 'relaxed' ? classes.contentRelaxed : undefined;
|
51
53
|
var squareClass = square ? classes.buttonSquare : undefined;
|
@@ -73,9 +75,13 @@ export var buttonRoot = function buttonRoot(Root) {
|
|
73
75
|
}, rest), /*#__PURE__*/React.createElement(LoadWrap, {
|
74
76
|
contentPlacing: contentPlacementValue,
|
75
77
|
isLoading: isLoading
|
76
|
-
}, contentLeft && /*#__PURE__*/React.createElement(StyledContentLeft,
|
78
|
+
}, contentLeft && /*#__PURE__*/React.createElement(StyledContentLeft, {
|
79
|
+
hasContentMargin: hasRightContentMargin
|
80
|
+
}, contentLeft), txt ? /*#__PURE__*/React.createElement(ButtonText, {
|
77
81
|
className: contentRelaxedClass
|
78
|
-
}, txt) : children, value && /*#__PURE__*/React.createElement(ButtonValue, null, value), contentRight && /*#__PURE__*/React.createElement(StyledContentRight,
|
82
|
+
}, txt) : children, value && /*#__PURE__*/React.createElement(ButtonValue, null, value), contentRight && /*#__PURE__*/React.createElement(StyledContentRight, {
|
83
|
+
hasContentMargin: hasLeftContentMargin
|
84
|
+
}, contentRight)), isLoading && /*#__PURE__*/React.createElement(Loader, null, loader || _StyledSpinner || (_StyledSpinner = /*#__PURE__*/React.createElement(StyledSpinner, null))));
|
79
85
|
});
|
80
86
|
};
|
81
87
|
export var buttonConfig = {
|
@@ -35,10 +35,16 @@ export var StyledSpinner = /*#__PURE__*/styled(Spinner).withConfig({
|
|
35
35
|
})(["", ":var(", ");", ":var(", ");"], spinnerTokens.size, tokens.buttonSpinnerSize, spinnerTokens.color, tokens.buttonSpinnerColor);
|
36
36
|
export var StyledContentLeft = /*#__PURE__*/styled.div.withConfig({
|
37
37
|
componentId: "plasma-new-hope__sc-9d9bqj-5"
|
38
|
-
})(["display:flex;
|
38
|
+
})(["display:flex;align-self:var(", ");margin:", ";"], tokens.buttonLeftContentAlignSelf, function (_ref3) {
|
39
|
+
var hasContentMargin = _ref3.hasContentMargin;
|
40
|
+
return hasContentMargin ? "var(".concat(tokens.buttonLeftContentMargin, ")") : 0;
|
41
|
+
});
|
39
42
|
export var StyledContentRight = /*#__PURE__*/styled.div.withConfig({
|
40
43
|
componentId: "plasma-new-hope__sc-9d9bqj-6"
|
41
|
-
})(["display:flex;
|
44
|
+
})(["display:flex;align-self:var(", ");margin:", ";"], tokens.buttonRightContentAlignSelf, function (_ref4) {
|
45
|
+
var hasContentMargin = _ref4.hasContentMargin;
|
46
|
+
return hasContentMargin ? "var(".concat(tokens.buttonRightContentMargin, ")") : 0;
|
47
|
+
});
|
42
48
|
export var base = /*#__PURE__*/css(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteral(["\n position: relative;\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n justify-content: center;\n\n appearance: none;\n border: none;\n cursor: pointer;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n\n a& {\n text-decoration: none;\n }\n\n /* NOTE:\n --plasma_computed-btn-br-radius is defined in Button.tsx\n */\n --plasma_private-btn-br: var(--plasma_computed-btn-br);\n border-radius: var(--plasma_private-btn-br);\n\n &&.", " {\n width: var(", ");\n padding: 0;\n }\n"])), /*#__PURE__*/String(classes.buttonSquare), tokens.buttonHeight);
|
43
49
|
|
44
50
|
// INFO: Для возможности переиспользования стилей в других компонентах
|
@@ -8,7 +8,6 @@ import { PropsTable, Description } from '@site/src/components';
|
|
8
8
|
# Button
|
9
9
|
Кнопки могут отображаться в нескольких размерах и цветах, могут содержать текст и/или иконку.
|
10
10
|
|
11
|
-
## Button
|
12
11
|
<Description name="Button" />
|
13
12
|
<PropsTable name="Button" />
|
14
13
|
|
@@ -34,18 +33,18 @@ export function App() {
|
|
34
33
|
<div>
|
35
34
|
<Button text="Текст" />
|
36
35
|
|
37
|
-
<Button text="Текст" contentLeft={<IconDownload />} />
|
36
|
+
<Button text="Текст" contentLeft={<IconDownload color="inherit" />} />
|
38
37
|
|
39
|
-
<Button text="Текст" contentRight={<IconDownload />} />
|
38
|
+
<Button text="Текст" contentRight={<IconDownload color="inherit" />} />
|
40
39
|
|
41
|
-
<Button contentLeft={<IconDownload />} />
|
40
|
+
<Button contentLeft={<IconDownload color="inherit" />} />
|
42
41
|
|
43
42
|
<Button text="Текст" isLoading />
|
44
43
|
|
45
44
|
<Button text="Текст" isLoading loader={<div>Loader...</div>} />
|
46
45
|
|
47
46
|
<Button>
|
48
|
-
<IconDownload />
|
47
|
+
<IconDownload color="inherit" />
|
49
48
|
<span>Текст</span>
|
50
49
|
</Button>
|
51
50
|
</div>
|
@@ -56,7 +55,7 @@ export function App() {
|
|
56
55
|
## Примеры
|
57
56
|
|
58
57
|
### Размер кнопки
|
59
|
-
Размер кнопки задается с помощью свойства `size
|
58
|
+
Размер кнопки задается с помощью свойства `size`:
|
60
59
|
|
61
60
|
```tsx live
|
62
61
|
import React from 'react';
|
@@ -64,11 +63,13 @@ import { Button } from '@salutejs/{{ package }}';
|
|
64
63
|
|
65
64
|
export function App() {
|
66
65
|
return (
|
67
|
-
|
66
|
+
<div>
|
68
67
|
<Button text="Button" size="xl" />
|
69
68
|
<Button text="Button" size="l" />
|
70
69
|
<Button text="Button" size="m" />
|
71
70
|
<Button text="Button" size="s" />
|
71
|
+
<Button text="Button" size="xs" />
|
72
|
+
<Button text="Button" size="xxs" />
|
72
73
|
</div>
|
73
74
|
);
|
74
75
|
}
|
@@ -118,13 +119,17 @@ export function App() {
|
|
118
119
|
|
119
120
|
### Вид кнопки
|
120
121
|
Вид кнопки задается с помощью свойства `view`. Возможные значения свойства `view`:
|
122
|
+
+ `"default"` – по умолчанию;
|
123
|
+
+ `"accent"` – акцентная;
|
121
124
|
+ `"primary"` – основная;
|
122
125
|
+ `"secondary"` – вторичная;
|
126
|
+
+ `"clear"` – без цветового сопровождения.
|
123
127
|
+ `"success"` – успешное завершение;
|
124
128
|
+ `"warning"` – предупреждение;
|
125
129
|
+ `"critical"` – ошибка;
|
126
|
-
+ `"
|
127
|
-
+ `"
|
130
|
+
+ `"dark"` – темная;
|
131
|
+
+ `"black"` – черная;
|
132
|
+
+ `"white"` – белая.
|
128
133
|
|
129
134
|
```tsx live
|
130
135
|
import React from 'react';
|
@@ -132,15 +137,18 @@ import { Button } from '@salutejs/{{ package }}';
|
|
132
137
|
|
133
138
|
export function App() {
|
134
139
|
return (
|
135
|
-
<div>
|
140
|
+
<div style=\{{ display: 'flex', flexWrap: 'wrap' }}>
|
141
|
+
<Button text="Кнопка" size="s" view="default" />
|
136
142
|
<Button text="Кнопка" size="s" view="primary" />
|
143
|
+
<Button text="Кнопка" size="s" view="accent" />
|
137
144
|
<Button text="Кнопка" size="s" view="secondary" />
|
145
|
+
<Button text="Кнопка" size="s" view="clear" />
|
138
146
|
<Button text="Кнопка" size="s" view="success" />
|
139
147
|
<Button text="Кнопка" size="s" view="warning" />
|
140
148
|
<Button text="Кнопка" size="s" view="critical" />
|
141
|
-
<Button text="Кнопка" size="s" view="
|
142
|
-
<Button text="Кнопка" size="s" view="
|
143
|
-
<Button text="Кнопка" size="s" view="
|
149
|
+
<Button text="Кнопка" size="s" view="dark" />
|
150
|
+
<Button text="Кнопка" size="s" view="black" />
|
151
|
+
<Button text="Кнопка" size="s" view="white" />
|
144
152
|
</div>
|
145
153
|
);
|
146
154
|
}
|
@@ -171,29 +179,6 @@ export function App() {
|
|
171
179
|
}
|
172
180
|
```
|
173
181
|
|
174
|
-
### Квадратные и круглые кнопки
|
175
|
-
Для отображения иконок и/или текста в квадратных или круглых кнопках с **равными сторонами**,
|
176
|
-
используйте компонент `Button` и свойство `contentLeft`, в которое требуется передать нужное значение.
|
177
|
-
|
178
|
-
По умолчанию границы кнопки **квадратные** (со скругленными углами) — `pin="square-square"`.
|
179
|
-
**Круглые** границы кнопки можно сделать с помощью свойства `pin` со значением `"circle-circle"`.
|
180
|
-
|
181
|
-
```tsx live
|
182
|
-
import React from 'react';
|
183
|
-
import { Button } from '@salutejs/{{ package }}';
|
184
|
-
import { IconDownload } from '@salutejs/plasma-icons';
|
185
|
-
|
186
|
-
export function App() {
|
187
|
-
return (
|
188
|
-
<div>
|
189
|
-
<Button contentLeft={<IconDownload color="inherit" />} />
|
190
|
-
|
191
|
-
<Button contentLeft={<IconDownload color="inherit" />} pin="circle-circle" />
|
192
|
-
</div>
|
193
|
-
);
|
194
|
-
}
|
195
|
-
```
|
196
|
-
|
197
182
|
### Гиперссылка
|
198
183
|
Компонент поддерживает вывод в виде тега `<a>`, для этого необходимо указать свойство `as`:
|
199
184
|
|
@@ -44,6 +44,9 @@ import { IconClose } from '@salutejs/plasma-icons';
|
|
44
44
|
export function App() {
|
45
45
|
return (
|
46
46
|
<div>
|
47
|
+
<IconButton size="xl">
|
48
|
+
<IconClose color="inherit" />
|
49
|
+
</IconButton>
|
47
50
|
<IconButton size="l">
|
48
51
|
<IconClose color="inherit" />
|
49
52
|
</IconButton>
|
@@ -56,6 +59,9 @@ export function App() {
|
|
56
59
|
<IconButton size="xs">
|
57
60
|
<IconClose color="inherit" size="xs" />
|
58
61
|
</IconButton>
|
62
|
+
<IconButton size="xxs">
|
63
|
+
<IconClose color="inherit" size="xs" />
|
64
|
+
</IconButton>
|
59
65
|
</div>
|
60
66
|
);
|
61
67
|
}
|
@@ -66,11 +72,12 @@ export function App() {
|
|
66
72
|
|
67
73
|
Возможные значения свойства `view`:
|
68
74
|
+ `"default"` – по умолчанию;
|
75
|
+
+ `"accent"` – акцентная;
|
69
76
|
+ `"secondary"` – вторичная;
|
77
|
+
+ `"clear"` – без цветового сопровождения.
|
70
78
|
+ `"success"` – успешное завершение;
|
71
79
|
+ `"warning"` – предупреждение;
|
72
80
|
+ `"critical"` – ошибка;
|
73
|
-
+ `"clear"` – без цветового сопровождения;
|
74
81
|
+ `"dark"` – темная;
|
75
82
|
+ `"black"` – черная;
|
76
83
|
+ `"white"` – белая.
|
@@ -82,13 +89,19 @@ import { IconClose } from '@salutejs/plasma-icons';
|
|
82
89
|
|
83
90
|
export function App() {
|
84
91
|
return (
|
85
|
-
<div>
|
92
|
+
<div style=\{{ display: 'flex', flexWrap: 'wrap' }}>
|
86
93
|
<IconButton size="s" view="default">
|
87
94
|
<IconClose color="inherit" />
|
88
95
|
</IconButton>
|
96
|
+
<IconButton size="s" view="accent">
|
97
|
+
<IconClose color="inherit" />
|
98
|
+
</IconButton>
|
89
99
|
<IconButton size="s" view="secondary">
|
90
100
|
<IconClose color="inherit" />
|
91
101
|
</IconButton>
|
102
|
+
<IconButton size="s" view="clear">
|
103
|
+
<IconClose color="inherit" />
|
104
|
+
</IconButton>
|
92
105
|
<IconButton size="s" view="success">
|
93
106
|
<IconClose color="inherit" />
|
94
107
|
</IconButton>
|
@@ -98,9 +111,6 @@ export function App() {
|
|
98
111
|
<IconButton size="s" view="critical">
|
99
112
|
<IconClose color="inherit" />
|
100
113
|
</IconButton>
|
101
|
-
<IconButton size="s" view="clear">
|
102
|
-
<IconClose color="inherit" />
|
103
|
-
</IconButton>
|
104
114
|
<IconButton size="s" view="dark">
|
105
115
|
<IconClose color="inherit" />
|
106
116
|
</IconButton>
|
@@ -128,7 +138,7 @@ import { IconClose } from '@salutejs/plasma-icons';
|
|
128
138
|
|
129
139
|
export function App() {
|
130
140
|
return (
|
131
|
-
<div>
|
141
|
+
<div style=\{{ display: 'flex', flexWrap: 'wrap' }}>
|
132
142
|
<IconButton pin="square-square">
|
133
143
|
<IconClose color="inherit" />
|
134
144
|
</IconButton>
|
@@ -1,15 +1,16 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import type { ComponentProps } from 'react';
|
3
3
|
import type { StoryObj, Meta } from '@storybook/react';
|
4
|
-
import { disableProps } from '@salutejs/plasma-sb-utils';
|
4
|
+
import { disableProps, getConfigVariations } from '@salutejs/plasma-sb-utils';
|
5
5
|
|
6
6
|
import { IconMic } from '../../../../components/_Icon';
|
7
7
|
import { WithTheme } from '../../../_helpers';
|
8
8
|
|
9
9
|
import { Button } from './Button';
|
10
|
+
import { config } from './Button.config';
|
11
|
+
|
12
|
+
const { views, sizes } = getConfigVariations(config);
|
10
13
|
|
11
|
-
const views = ['default', 'accent', 'positive', 'warning', 'negative', 'dark', 'light'];
|
12
|
-
const sizes = ['xl', 'l', 'm', 's', 'xs', 'xxs'];
|
13
14
|
const stretchingValues = ['auto', 'filled', 'fixed'];
|
14
15
|
const pinValues = [
|
15
16
|
'',
|
@@ -79,7 +80,7 @@ const meta: Meta<typeof Button> = {
|
|
79
80
|
},
|
80
81
|
table: { defaultValue: { summary: 'bottom' } },
|
81
82
|
},
|
82
|
-
...disableProps(['value']),
|
83
|
+
...disableProps(['value', 'focused', 'pin']),
|
83
84
|
},
|
84
85
|
};
|
85
86
|
|