@salutejs/plasma-new-hope 0.194.0-canary.1562.11857238836.0 → 0.194.0-canary.1568.11891833298.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Combobox/ComboboxNew/Combobox.js +1 -0
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/Combobox/ComboboxOld/Combobox.css +4 -5
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +4 -5
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +4 -5
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +4 -5
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +4 -5
- package/cjs/components/Dropdown/Dropdown.css +4 -5
- package/cjs/components/Dropdown/Dropdown.js +2 -4
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +4 -5
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -3
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +1 -7
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/{DropdownItem.styles_14yih1y.css → DropdownItem.styles_1b439rx.css} +0 -1
- package/cjs/components/Select/Select.js +1 -0
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/Select/ui/Inner/ui/Item/Item.js +2 -1
- package/cjs/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +3 -18
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
- package/cjs/components/Switch/Switch.css +2 -2
- package/cjs/components/Switch/Switch.tokens.js +7 -1
- package/cjs/components/Switch/Switch.tokens.js.map +1 -1
- package/cjs/components/Switch/_toggleSize/base.js +1 -1
- package/cjs/components/Switch/_toggleSize/base.js.map +1 -1
- package/cjs/components/Switch/_toggleSize/base_1d0b3t4.css +1 -0
- package/cjs/components/Switch/_view/base.js +1 -1
- package/cjs/components/Switch/_view/base.js.map +1 -1
- package/cjs/components/Switch/_view/base_15atbyp.css +1 -0
- package/cjs/index.css +6 -7
- package/emotion/cjs/components/Card/Card.api.mdx +184 -0
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +1 -0
- package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/emotion/cjs/components/Dropdown/Dropdown.js +2 -4
- package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -3
- package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +11 -15
- package/emotion/cjs/components/Select/Select.js +1 -0
- package/emotion/cjs/components/Select/ui/Inner/ui/Item/Item.js +2 -1
- package/emotion/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +3 -24
- package/emotion/cjs/components/Switch/Switch.tokens.js +7 -1
- package/emotion/cjs/components/Switch/_toggleSize/base.js +1 -1
- package/emotion/cjs/components/Switch/_view/base.js +1 -1
- package/emotion/cjs/examples/plasma_b2c/components/Switch/Switch.config.js +8 -8
- package/emotion/cjs/examples/plasma_b2c/components/Switch/Switch.js +5 -2
- package/emotion/cjs/examples/plasma_b2c/components/Switch/Switch.outline.config.js +37 -0
- package/emotion/cjs/examples/plasma_b2c/components/Switch/Switch.stories.tsx +33 -1
- package/emotion/cjs/examples/plasma_web/components/Switch/Switch.config.js +8 -8
- package/emotion/cjs/examples/plasma_web/components/Switch/Switch.js +5 -2
- package/emotion/cjs/examples/plasma_web/components/Switch/Switch.outline.config.js +37 -0
- package/emotion/cjs/examples/plasma_web/components/Switch/Switch.stories.tsx +33 -1
- package/emotion/es/components/Card/Card.api.mdx +184 -0
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +1 -0
- package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/emotion/es/components/Dropdown/Dropdown.js +2 -4
- package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +3 -4
- package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +11 -15
- package/emotion/es/components/Select/Select.js +1 -0
- package/emotion/es/components/Select/ui/Inner/ui/Item/Item.js +2 -1
- package/emotion/es/components/Select/ui/Target/ui/Textfield/Textfield.js +3 -24
- package/emotion/es/components/Switch/Switch.tokens.js +7 -1
- package/emotion/es/components/Switch/_toggleSize/base.js +1 -1
- package/emotion/es/components/Switch/_view/base.js +1 -1
- package/emotion/es/examples/plasma_b2c/components/Switch/Switch.config.js +8 -8
- package/emotion/es/examples/plasma_b2c/components/Switch/Switch.js +4 -1
- package/emotion/es/examples/plasma_b2c/components/Switch/Switch.outline.config.js +31 -0
- package/emotion/es/examples/plasma_b2c/components/Switch/Switch.stories.tsx +33 -1
- package/emotion/es/examples/plasma_web/components/Switch/Switch.config.js +8 -8
- package/emotion/es/examples/plasma_web/components/Switch/Switch.js +4 -1
- package/emotion/es/examples/plasma_web/components/Switch/Switch.outline.config.js +31 -0
- package/emotion/es/examples/plasma_web/components/Switch/Switch.stories.tsx +33 -1
- package/es/components/Combobox/ComboboxNew/Combobox.js +1 -0
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/Combobox/ComboboxOld/Combobox.css +4 -5
- package/es/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +4 -5
- package/es/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +4 -5
- package/es/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +4 -5
- package/es/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +4 -5
- package/es/components/Dropdown/Dropdown.css +4 -5
- package/es/components/Dropdown/Dropdown.js +2 -4
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +4 -5
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +3 -4
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +2 -7
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/{DropdownItem.styles_14yih1y.css → DropdownItem.styles_1b439rx.css} +0 -1
- package/es/components/Select/Select.js +1 -0
- package/es/components/Select/Select.js.map +1 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.js +2 -1
- package/es/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.js +4 -19
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
- package/es/components/Switch/Switch.css +2 -2
- package/es/components/Switch/Switch.tokens.js +7 -1
- package/es/components/Switch/Switch.tokens.js.map +1 -1
- package/es/components/Switch/_toggleSize/base.js +1 -1
- package/es/components/Switch/_toggleSize/base.js.map +1 -1
- package/es/components/Switch/_toggleSize/base_1d0b3t4.css +1 -0
- package/es/components/Switch/_view/base.js +1 -1
- package/es/components/Switch/_view/base.js.map +1 -1
- package/es/components/Switch/_view/base_15atbyp.css +1 -0
- package/es/index.css +6 -7
- package/package.json +2 -3
- package/styled-components/cjs/components/Card/Card.api.mdx +184 -0
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +1 -0
- package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/styled-components/cjs/components/Dropdown/Dropdown.js +2 -4
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -3
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +2 -5
- package/styled-components/cjs/components/Select/Select.js +1 -0
- package/styled-components/cjs/components/Select/ui/Inner/ui/Item/Item.js +2 -1
- package/styled-components/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +3 -24
- package/styled-components/cjs/components/Switch/Switch.tokens.js +7 -1
- package/styled-components/cjs/components/Switch/_toggleSize/base.js +1 -1
- package/styled-components/cjs/components/Switch/_view/base.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Switch/Switch.config.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Switch/Switch.js +5 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Switch/Switch.outline.config.js +37 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Switch/Switch.stories.tsx +33 -1
- package/styled-components/cjs/examples/plasma_web/components/Switch/Switch.config.js +1 -1
- package/styled-components/cjs/examples/plasma_web/components/Switch/Switch.js +5 -2
- package/styled-components/cjs/examples/plasma_web/components/Switch/Switch.outline.config.js +37 -0
- package/styled-components/cjs/examples/plasma_web/components/Switch/Switch.stories.tsx +33 -1
- package/styled-components/es/components/Card/Card.api.mdx +184 -0
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +1 -0
- package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -1
- package/styled-components/es/components/Dropdown/Dropdown.js +2 -4
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +3 -4
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.styles.js +2 -5
- package/styled-components/es/components/Select/Select.js +1 -0
- package/styled-components/es/components/Select/ui/Inner/ui/Item/Item.js +2 -1
- package/styled-components/es/components/Select/ui/Target/ui/Textfield/Textfield.js +3 -24
- package/styled-components/es/components/Switch/Switch.tokens.js +7 -1
- package/styled-components/es/components/Switch/_toggleSize/base.js +1 -1
- package/styled-components/es/components/Switch/_view/base.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Switch/Switch.config.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Switch/Switch.js +4 -1
- package/styled-components/es/examples/plasma_b2c/components/Switch/Switch.outline.config.js +31 -0
- package/styled-components/es/examples/plasma_b2c/components/Switch/Switch.stories.tsx +33 -1
- package/styled-components/es/examples/plasma_web/components/Switch/Switch.config.js +1 -1
- package/styled-components/es/examples/plasma_web/components/Switch/Switch.js +4 -1
- package/styled-components/es/examples/plasma_web/components/Switch/Switch.outline.config.js +31 -0
- package/styled-components/es/examples/plasma_web/components/Switch/Switch.stories.tsx +33 -1
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts +2 -1
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.d.ts +2 -50
- package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/components/Dropdown/Dropdown.types.d.ts +6 -11
- package/types/components/Dropdown/Dropdown.types.d.ts.map +1 -1
- package/types/components/Dropdown/index.d.ts +0 -1
- package/types/components/Dropdown/index.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts +0 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.styles.d.ts.map +1 -1
- package/types/components/Select/Select.d.ts.map +1 -1
- package/types/components/Select/Select.types.d.ts +2 -1
- package/types/components/Select/Select.types.d.ts.map +1 -1
- package/types/components/Select/ui/Inner/ui/Item/Item.d.ts.map +1 -1
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.d.ts.map +1 -1
- package/types/components/Switch/Switch.tokens.d.ts +7 -1
- package/types/components/Switch/Switch.tokens.d.ts.map +1 -1
- package/types/components/Switch/_toggleSize/base.d.ts.map +1 -1
- package/types/components/Switch/_view/base.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts +1 -25
- package/types/examples/plasma_b2c/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Switch/Switch.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Switch/Switch.d.ts +20 -0
- package/types/examples/plasma_b2c/components/Switch/Switch.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Switch/Switch.outline.config.d.ts +30 -0
- package/types/examples/plasma_b2c/components/Switch/Switch.outline.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Dropdown/Dropdown.d.ts +1 -25
- package/types/examples/plasma_web/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Switch/Switch.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Switch/Switch.d.ts +20 -0
- package/types/examples/plasma_web/components/Switch/Switch.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Switch/Switch.outline.config.d.ts +30 -0
- package/types/examples/plasma_web/components/Switch/Switch.outline.config.d.ts.map +1 -0
- package/cjs/components/Switch/_toggleSize/base_6i0904.css +0 -1
- package/cjs/components/Switch/_view/base_yxkf3s.css +0 -1
- package/es/components/Switch/_toggleSize/base_6i0904.css +0 -1
- package/es/components/Switch/_view/base_yxkf3s.css +0 -1
@@ -3,9 +3,12 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.Switch = void 0;
|
6
|
+
exports.SwitchOutline = exports.Switch = void 0;
|
7
7
|
var _Switch = /*#__PURE__*/require("../../../../components/Switch");
|
8
8
|
var _engines = /*#__PURE__*/require("../../../../engines");
|
9
9
|
var _Switch2 = /*#__PURE__*/require("./Switch.config");
|
10
|
+
var _SwitchOutline = /*#__PURE__*/require("./Switch.outline.config");
|
10
11
|
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Switch.switchConfig, _Switch2.config);
|
11
|
-
var Switch = exports.Switch = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
12
|
+
var Switch = exports.Switch = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
13
|
+
var mergedOutlineConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Switch.switchConfig, _SwitchOutline.config);
|
14
|
+
var SwitchOutline = exports.SwitchOutline = /*#__PURE__*/(0, _engines.component)(mergedOutlineConfig);
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.config = void 0;
|
7
|
+
var _styledComponents = /*#__PURE__*/require("styled-components");
|
8
|
+
var _Switch = /*#__PURE__*/require("../../../../components/Switch");
|
9
|
+
var config = exports.config = {
|
10
|
+
defaults: {
|
11
|
+
view: 'default',
|
12
|
+
size: 'm',
|
13
|
+
toggleSize: 'l',
|
14
|
+
labelPosition: 'before',
|
15
|
+
focused: 'true'
|
16
|
+
},
|
17
|
+
variations: {
|
18
|
+
size: {
|
19
|
+
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-line-height);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-letter-spacing);", ":0.25rem;", ":0.75rem;"], _Switch.switchTokens.fontFamily, _Switch.switchTokens.fontStyle, _Switch.switchTokens.fontWeight, _Switch.switchTokens.lineHeight, _Switch.switchTokens.fontSize, _Switch.switchTokens.letterSpacing, _Switch.switchTokens.descriptionFontFamily, _Switch.switchTokens.descriptionFontStyle, _Switch.switchTokens.descriptionFontWeight, _Switch.switchTokens.descriptionLineHeight, _Switch.switchTokens.descriptionFontSize, _Switch.switchTokens.descriptionLetterSpacing, _Switch.switchTokens.verticalGap, _Switch.switchTokens.labelOffset),
|
20
|
+
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-line-height);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-xs-letter-spacing);", ":0.25rem;", ":0.75rem;"], _Switch.switchTokens.fontFamily, _Switch.switchTokens.fontStyle, _Switch.switchTokens.fontWeight, _Switch.switchTokens.lineHeight, _Switch.switchTokens.fontSize, _Switch.switchTokens.letterSpacing, _Switch.switchTokens.descriptionFontFamily, _Switch.switchTokens.descriptionFontStyle, _Switch.switchTokens.descriptionFontWeight, _Switch.switchTokens.descriptionLineHeight, _Switch.switchTokens.descriptionFontSize, _Switch.switchTokens.descriptionLetterSpacing, _Switch.switchTokens.verticalGap, _Switch.switchTokens.labelOffset),
|
21
|
+
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-line-height);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-line-height);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-xs-letter-spacing);", ":0.25rem;", ":0.75rem;"], _Switch.switchTokens.fontFamily, _Switch.switchTokens.fontStyle, _Switch.switchTokens.fontWeight, _Switch.switchTokens.lineHeight, _Switch.switchTokens.fontSize, _Switch.switchTokens.letterSpacing, _Switch.switchTokens.descriptionFontFamily, _Switch.switchTokens.descriptionFontStyle, _Switch.switchTokens.descriptionFontWeight, _Switch.switchTokens.descriptionLineHeight, _Switch.switchTokens.descriptionFontSize, _Switch.switchTokens.descriptionLetterSpacing, _Switch.switchTokens.verticalGap, _Switch.switchTokens.labelOffset)
|
22
|
+
},
|
23
|
+
toggleSize: {
|
24
|
+
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":2.75rem;", ":1.75rem;", ":calc(var(", ") / 2);", ":1.375rem;", ":calc(var(", ") / 2);", ":0.125rem;", ":1.25;"], _Switch.switchTokens.trackWidth, _Switch.switchTokens.trackHeight, _Switch.switchTokens.trackBorderRadius, _Switch.switchTokens.trackHeight, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbBorderRadius, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbOffset, _Switch.switchTokens.thumbPressScale),
|
25
|
+
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":2rem;", ":1.25rem;", ":calc(var(", ") / 2);", ":0.875rem;", ":calc(var(", ") / 2);", ":0.125rem;", ":1.25;"], _Switch.switchTokens.trackWidth, _Switch.switchTokens.trackHeight, _Switch.switchTokens.trackBorderRadius, _Switch.switchTokens.trackHeight, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbBorderRadius, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbOffset, _Switch.switchTokens.thumbPressScale)
|
26
|
+
},
|
27
|
+
view: {
|
28
|
+
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--text-secondary);", ":0.0625rem;", ":var(--outline-secondary);", ":var(--outline-secondary-hover);", ":var(--outline-accent);", ":var(--outline-accent-hover);", ":var(--text-tertiary);", ":var(--text-accent);", ":0 1px 1px rgba(0,0,0,0.11);"], _Switch.switchTokens.labelColor, _Switch.switchTokens.descriptionColor, _Switch.switchTokens.trackBorderWidth, _Switch.switchTokens.trackBorderColorOff, _Switch.switchTokens.trackBorderColorOffHover, _Switch.switchTokens.trackBorderColorOn, _Switch.switchTokens.trackBorderColorOnHover, _Switch.switchTokens.thumbBackgroundColorOff, _Switch.switchTokens.thumbBackgroundColorOn, _Switch.switchTokens.thumbBoxShadow)
|
29
|
+
},
|
30
|
+
disabled: {
|
31
|
+
"true": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;"], _Switch.switchTokens.disabledOpacity)
|
32
|
+
},
|
33
|
+
focused: {
|
34
|
+
"true": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--surface-accent);"], _Switch.switchTokens.trackFocusColor)
|
35
|
+
}
|
36
|
+
}
|
37
|
+
};
|
@@ -9,7 +9,7 @@ import { mergeConfig } from '../../../../engines';
|
|
9
9
|
import { WithTheme, argTypesFromConfig } from '../../../_helpers';
|
10
10
|
|
11
11
|
import { config } from './Switch.config';
|
12
|
-
import { Switch } from './Switch';
|
12
|
+
import { Switch, SwitchOutline } from './Switch';
|
13
13
|
|
14
14
|
type SwitchProps = ComponentProps<typeof Switch>;
|
15
15
|
|
@@ -72,3 +72,35 @@ export const Default: StoryObj<SwitchProps> = {
|
|
72
72
|
},
|
73
73
|
render: (args) => <StoryDefault {...args} />,
|
74
74
|
};
|
75
|
+
|
76
|
+
const StoryOutline = (args: SwitchProps) => {
|
77
|
+
const value = 'yes';
|
78
|
+
const name = 'agree';
|
79
|
+
const [checked, setChecked] = useState(true);
|
80
|
+
|
81
|
+
return (
|
82
|
+
<StyledWrapper>
|
83
|
+
<SwitchOutline
|
84
|
+
value={value}
|
85
|
+
name={name}
|
86
|
+
checked={checked}
|
87
|
+
onChange={(event) => {
|
88
|
+
setChecked(event.target.checked);
|
89
|
+
onChange(event);
|
90
|
+
}}
|
91
|
+
onFocus={onFocus}
|
92
|
+
onBlur={onBlur}
|
93
|
+
{...args}
|
94
|
+
/>
|
95
|
+
</StyledWrapper>
|
96
|
+
);
|
97
|
+
};
|
98
|
+
|
99
|
+
export const Outline: StoryObj<SwitchProps> = {
|
100
|
+
args: {
|
101
|
+
size: 'm',
|
102
|
+
toggleSize: 'l',
|
103
|
+
disabled: false,
|
104
|
+
},
|
105
|
+
render: (args) => <StoryOutline {...args} />,
|
106
|
+
};
|
@@ -25,7 +25,7 @@ var config = exports.config = {
|
|
25
25
|
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":2rem;", ":1.25rem;", ":calc(var(", ") / 2);", ":1rem;", ":calc(var(", ") / 2);", ":0.125rem;", ":1.25;"], _Switch.switchTokens.trackWidth, _Switch.switchTokens.trackHeight, _Switch.switchTokens.trackBorderRadius, _Switch.switchTokens.trackHeight, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbBorderRadius, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbOffset, _Switch.switchTokens.thumbPressScale)
|
26
26
|
},
|
27
27
|
view: {
|
28
|
-
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--surface-accent);", ":var(--surface-accent-hover);", ":var(--surface-transparent-tertiary);", ":var(--surface-transparent-tertiary-hover);", ":var(--on-dark-surface-solid-default);", ":0 1px 1px rgba(0,0,0,0.11);"], _Switch.switchTokens.labelColor, _Switch.switchTokens.descriptionColor, _Switch.switchTokens.trackBackgroundColorOn, _Switch.switchTokens.trackBackgroundColorOnHover, _Switch.switchTokens.trackBackgroundColorOff, _Switch.switchTokens.trackBackgroundColorOffHover, _Switch.switchTokens.
|
28
|
+
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--surface-accent);", ":var(--surface-accent-hover);", ":var(--surface-transparent-tertiary);", ":var(--surface-transparent-tertiary-hover);", ":0rem;", ":var(--on-dark-surface-solid-default);", ":var(--on-dark-surface-solid-default);", ":0 1px 1px rgba(0,0,0,0.11);"], _Switch.switchTokens.labelColor, _Switch.switchTokens.descriptionColor, _Switch.switchTokens.trackBackgroundColorOn, _Switch.switchTokens.trackBackgroundColorOnHover, _Switch.switchTokens.trackBackgroundColorOff, _Switch.switchTokens.trackBackgroundColorOffHover, _Switch.switchTokens.trackBorderWidth, _Switch.switchTokens.thumbBackgroundColorOff, _Switch.switchTokens.thumbBackgroundColorOn, _Switch.switchTokens.thumbBoxShadow)
|
29
29
|
},
|
30
30
|
disabled: {
|
31
31
|
"true": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;"], _Switch.switchTokens.disabledOpacity)
|
@@ -3,9 +3,12 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.Switch = void 0;
|
6
|
+
exports.SwitchOutline = exports.Switch = void 0;
|
7
7
|
var _Switch = /*#__PURE__*/require("../../../../components/Switch");
|
8
8
|
var _engines = /*#__PURE__*/require("../../../../engines");
|
9
9
|
var _Switch2 = /*#__PURE__*/require("./Switch.config");
|
10
|
+
var _SwitchOutline = /*#__PURE__*/require("./Switch.outline.config");
|
10
11
|
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Switch.switchConfig, _Switch2.config);
|
11
|
-
var Switch = exports.Switch = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
12
|
+
var Switch = exports.Switch = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
13
|
+
var mergedOutlineConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Switch.switchConfig, _SwitchOutline.config);
|
14
|
+
var SwitchOutline = exports.SwitchOutline = /*#__PURE__*/(0, _engines.component)(mergedOutlineConfig);
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.config = void 0;
|
7
|
+
var _styledComponents = /*#__PURE__*/require("styled-components");
|
8
|
+
var _Switch = /*#__PURE__*/require("../../../../components/Switch");
|
9
|
+
var config = exports.config = {
|
10
|
+
defaults: {
|
11
|
+
view: 'default',
|
12
|
+
size: 'm',
|
13
|
+
toggleSize: 'l',
|
14
|
+
labelPosition: 'before',
|
15
|
+
focused: 'true'
|
16
|
+
},
|
17
|
+
variations: {
|
18
|
+
size: {
|
19
|
+
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-line-height);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-letter-spacing);", ":0.25rem;", ":0.75rem;"], _Switch.switchTokens.fontFamily, _Switch.switchTokens.fontStyle, _Switch.switchTokens.fontWeight, _Switch.switchTokens.lineHeight, _Switch.switchTokens.fontSize, _Switch.switchTokens.letterSpacing, _Switch.switchTokens.descriptionFontFamily, _Switch.switchTokens.descriptionFontStyle, _Switch.switchTokens.descriptionFontWeight, _Switch.switchTokens.descriptionLineHeight, _Switch.switchTokens.descriptionFontSize, _Switch.switchTokens.descriptionLetterSpacing, _Switch.switchTokens.verticalGap, _Switch.switchTokens.labelOffset),
|
20
|
+
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-line-height);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-xs-letter-spacing);", ":0.25rem;", ":0.75rem;"], _Switch.switchTokens.fontFamily, _Switch.switchTokens.fontStyle, _Switch.switchTokens.fontWeight, _Switch.switchTokens.lineHeight, _Switch.switchTokens.fontSize, _Switch.switchTokens.letterSpacing, _Switch.switchTokens.descriptionFontFamily, _Switch.switchTokens.descriptionFontStyle, _Switch.switchTokens.descriptionFontWeight, _Switch.switchTokens.descriptionLineHeight, _Switch.switchTokens.descriptionFontSize, _Switch.switchTokens.descriptionLetterSpacing, _Switch.switchTokens.verticalGap, _Switch.switchTokens.labelOffset),
|
21
|
+
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-line-height);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-line-height);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-xs-letter-spacing);", ":0.25rem;", ":0.75rem;"], _Switch.switchTokens.fontFamily, _Switch.switchTokens.fontStyle, _Switch.switchTokens.fontWeight, _Switch.switchTokens.lineHeight, _Switch.switchTokens.fontSize, _Switch.switchTokens.letterSpacing, _Switch.switchTokens.descriptionFontFamily, _Switch.switchTokens.descriptionFontStyle, _Switch.switchTokens.descriptionFontWeight, _Switch.switchTokens.descriptionLineHeight, _Switch.switchTokens.descriptionFontSize, _Switch.switchTokens.descriptionLetterSpacing, _Switch.switchTokens.verticalGap, _Switch.switchTokens.labelOffset)
|
22
|
+
},
|
23
|
+
toggleSize: {
|
24
|
+
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":2.75rem;", ":1.75rem;", ":calc(var(", ") / 2);", ":1.375rem;", ":calc(var(", ") / 2);", ":0.125rem;", ":1.25;"], _Switch.switchTokens.trackWidth, _Switch.switchTokens.trackHeight, _Switch.switchTokens.trackBorderRadius, _Switch.switchTokens.trackHeight, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbBorderRadius, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbOffset, _Switch.switchTokens.thumbPressScale),
|
25
|
+
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":2rem;", ":1.25rem;", ":calc(var(", ") / 2);", ":0.875rem;", ":calc(var(", ") / 2);", ":0.125rem;", ":1.25;"], _Switch.switchTokens.trackWidth, _Switch.switchTokens.trackHeight, _Switch.switchTokens.trackBorderRadius, _Switch.switchTokens.trackHeight, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbBorderRadius, _Switch.switchTokens.thumbSize, _Switch.switchTokens.thumbOffset, _Switch.switchTokens.thumbPressScale)
|
26
|
+
},
|
27
|
+
view: {
|
28
|
+
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--text-secondary);", ":0.0625rem;", ":var(--outline-secondary);", ":var(--outline-secondary-hover);", ":var(--outline-accent);", ":var(--outline-accent-hover);", ":var(--text-tertiary);", ":var(--text-accent);", ":0 1px 1px rgba(0,0,0,0.11);"], _Switch.switchTokens.labelColor, _Switch.switchTokens.descriptionColor, _Switch.switchTokens.trackBorderWidth, _Switch.switchTokens.trackBorderColorOff, _Switch.switchTokens.trackBorderColorOffHover, _Switch.switchTokens.trackBorderColorOn, _Switch.switchTokens.trackBorderColorOnHover, _Switch.switchTokens.thumbBackgroundColorOff, _Switch.switchTokens.thumbBackgroundColorOn, _Switch.switchTokens.thumbBoxShadow)
|
29
|
+
},
|
30
|
+
disabled: {
|
31
|
+
"true": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;"], _Switch.switchTokens.disabledOpacity)
|
32
|
+
},
|
33
|
+
focused: {
|
34
|
+
"true": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--surface-accent);"], _Switch.switchTokens.trackFocusColor)
|
35
|
+
}
|
36
|
+
}
|
37
|
+
};
|
@@ -9,7 +9,7 @@ import { mergeConfig } from '../../../../engines';
|
|
9
9
|
import { WithTheme, argTypesFromConfig } from '../../../_helpers';
|
10
10
|
|
11
11
|
import { config } from './Switch.config';
|
12
|
-
import { Switch } from './Switch';
|
12
|
+
import { Switch, SwitchOutline } from './Switch';
|
13
13
|
|
14
14
|
type SwitchProps = ComponentProps<typeof Switch>;
|
15
15
|
|
@@ -72,3 +72,35 @@ export const Default: StoryObj<SwitchProps> = {
|
|
72
72
|
},
|
73
73
|
render: (args) => <StoryDefault {...args} />,
|
74
74
|
};
|
75
|
+
|
76
|
+
const StoryOutline = (args: SwitchProps) => {
|
77
|
+
const value = 'yes';
|
78
|
+
const name = 'agree';
|
79
|
+
const [checked, setChecked] = useState(true);
|
80
|
+
|
81
|
+
return (
|
82
|
+
<StyledWrapper>
|
83
|
+
<SwitchOutline
|
84
|
+
value={value}
|
85
|
+
name={name}
|
86
|
+
checked={checked}
|
87
|
+
onChange={(event) => {
|
88
|
+
setChecked(event.target.checked);
|
89
|
+
onChange(event);
|
90
|
+
}}
|
91
|
+
onFocus={onFocus}
|
92
|
+
onBlur={onBlur}
|
93
|
+
{...args}
|
94
|
+
/>
|
95
|
+
</StyledWrapper>
|
96
|
+
);
|
97
|
+
};
|
98
|
+
|
99
|
+
export const Outline: StoryObj<SwitchProps> = {
|
100
|
+
args: {
|
101
|
+
size: 'm',
|
102
|
+
toggleSize: 'l',
|
103
|
+
disabled: false,
|
104
|
+
},
|
105
|
+
render: (args) => <StoryOutline {...args} />,
|
106
|
+
};
|
@@ -0,0 +1,184 @@
|
|
1
|
+
---
|
2
|
+
id: card
|
3
|
+
title: Card
|
4
|
+
---
|
5
|
+
|
6
|
+
отличия от https://plasma.sberdevices.ru/b2c/components/card/:
|
7
|
+
* избавляемся от CardBody
|
8
|
+
* убираем дублирование disabled
|
9
|
+
|
10
|
+
примеры дизайна https://www.figma.com/design/MXl0ZkXEqEhIFDS2H6b3yk/StarDS-Cards?node-id=2-690&node-type=instance&t=TJN8Nqyiky3Dfw2T-0
|
11
|
+
|
12
|
+
другие либы:
|
13
|
+
https://ant.design/components/card#
|
14
|
+
https://mui.com/material-ui/react-card/
|
15
|
+
|
16
|
+
```tsx live
|
17
|
+
import React, { ReactNode } from "react";
|
18
|
+
|
19
|
+
/**
|
20
|
+
* Набор часто встречающихся скруглений.
|
21
|
+
*/
|
22
|
+
|
23
|
+
export const radiuses = {
|
24
|
+
250: 15.625,
|
25
|
+
32: 2,
|
26
|
+
28: 1.75,
|
27
|
+
24: 1.5,
|
28
|
+
20: 1.25,
|
29
|
+
18: 1.125,
|
30
|
+
16: 1,
|
31
|
+
14: 0.875,
|
32
|
+
12: 0.75,
|
33
|
+
8: 0.5,
|
34
|
+
0: 0,
|
35
|
+
};
|
36
|
+
|
37
|
+
export type Roundness = keyof typeof radiuses;
|
38
|
+
|
39
|
+
export interface RoundnessProps {
|
40
|
+
/** Скругленность */
|
41
|
+
roundness: Roundness;
|
42
|
+
}
|
43
|
+
|
44
|
+
interface Card {
|
45
|
+
/** Компонент в фокусе */
|
46
|
+
focused?: boolean;
|
47
|
+
/** Увеличение по фокусу */
|
48
|
+
scaleOnFocus?: boolean;
|
49
|
+
/** Компонент неактивен */
|
50
|
+
disabled?: boolean;
|
51
|
+
/** Добавить рамку при фокусе */
|
52
|
+
outlined?: boolean;
|
53
|
+
/** Цвет подложки */
|
54
|
+
background?: string;
|
55
|
+
/** Делает карточку квадратной */
|
56
|
+
square?: boolean;
|
57
|
+
/** Заголовок */
|
58
|
+
title?: string | ReactNode;
|
59
|
+
/** Подзаголовок */
|
60
|
+
subtitle?: string | ReactNode;
|
61
|
+
/** Расположение заголовка и подзаголовка, пока нет в дизайне */
|
62
|
+
titlePlacement?: "inner" | "outer";
|
63
|
+
/** Выравнивание заголовка и подзаголовка */
|
64
|
+
titleAlign?: "left" | "center";
|
65
|
+
/** Подвал, или вынести в
|
66
|
+
* <CardContent footer={<CardTimeline />} /> или <CardFooter><CardTimeline /></CardFooter>
|
67
|
+
* */
|
68
|
+
footer?: ReactNode;
|
69
|
+
}
|
70
|
+
|
71
|
+
const ratios = {
|
72
|
+
"1 / 1": "100",
|
73
|
+
"1/1": "100",
|
74
|
+
"3 / 4": "133.3333",
|
75
|
+
"3/4": "133.3333",
|
76
|
+
"4 / 3": "75",
|
77
|
+
"4/3": "75",
|
78
|
+
"9 / 16": "177.7778",
|
79
|
+
"9/16": "177.7778",
|
80
|
+
"16 / 9": "56.25",
|
81
|
+
"16/9": "56.25",
|
82
|
+
"1 / 2": "200",
|
83
|
+
"1/2": "200",
|
84
|
+
"2 / 1": "50",
|
85
|
+
"2/1": "50",
|
86
|
+
};
|
87
|
+
|
88
|
+
export type Ratio = keyof typeof ratios;
|
89
|
+
|
90
|
+
/**
|
91
|
+
* CardMedia из текущей реализации
|
92
|
+
* Стоит ли заменить пропсом `cover?: ReactNode;` в Card как в Ant?
|
93
|
+
* а width и height передавать в style...
|
94
|
+
*
|
95
|
+
* имхо, нет. у Card может быть title и subtitle под карточкой
|
96
|
+
* скорее всего, на них свойство height не должно распространяться
|
97
|
+
* стоит подождать финальный дизайн
|
98
|
+
*/
|
99
|
+
interface CardMedia {
|
100
|
+
base?: "img" | "div";
|
101
|
+
height?: string | number;
|
102
|
+
ratio?: Ratio;
|
103
|
+
customRatio?: string;
|
104
|
+
}
|
105
|
+
|
106
|
+
interface CardContent {
|
107
|
+
topLeft?: string | ReactNode;
|
108
|
+
topRight?: string | ReactNode;
|
109
|
+
bottomLeft?: string | ReactNode;
|
110
|
+
bottomRight?: string | ReactNode;
|
111
|
+
children?: ReactNode;
|
112
|
+
}
|
113
|
+
|
114
|
+
/** или */
|
115
|
+
interface CardContent {
|
116
|
+
placement?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
117
|
+
children?: ReactNode;
|
118
|
+
}
|
119
|
+
|
120
|
+
interface CardTimeline {
|
121
|
+
/**
|
122
|
+
* Описание, например время до конца фильма. Возможно,
|
123
|
+
* не нужно и стоит указывать bottomRight контент
|
124
|
+
*/
|
125
|
+
text?: string;
|
126
|
+
progress?: string | number;
|
127
|
+
/**
|
128
|
+
* Не увеличивать высоту карточки
|
129
|
+
* @default true
|
130
|
+
*/
|
131
|
+
inline?: boolean;
|
132
|
+
}
|
133
|
+
```
|
134
|
+
|
135
|
+
```tsx live
|
136
|
+
<Card title="Title" subtitle="Subtitle">
|
137
|
+
<CardContent placement="top-left">
|
138
|
+
<SomeIcon />
|
139
|
+
</CardContent>
|
140
|
+
<CardContent placement="top-right">
|
141
|
+
<SaveButton saved={isSaved} />
|
142
|
+
</CardContent>
|
143
|
+
<CardContent placement="bottom-right">18+</CardContent>
|
144
|
+
</Card>;
|
145
|
+
|
146
|
+
<Card title="Title" subtitle="Subtitle">
|
147
|
+
<CardContent
|
148
|
+
topLeft={<SomeIcon />}
|
149
|
+
topRight={<SaveButton saved={isSaved} />}
|
150
|
+
bottomRight="18+"
|
151
|
+
/>
|
152
|
+
</Card>;
|
153
|
+
|
154
|
+
<Card title="Title" subtitle="Subtitle">
|
155
|
+
<CardMedia src={someSrc} alt="trailer" />
|
156
|
+
<CardContent
|
157
|
+
topLeft={<SomeIcon />}
|
158
|
+
topRight={<SaveButton saved={isSaved} />}
|
159
|
+
bottomRight="18+"
|
160
|
+
/>
|
161
|
+
<CardTimeline text="еще 1ч 23мин" progress={56} />
|
162
|
+
</Card>;
|
163
|
+
|
164
|
+
<Card title="Title" subtitle="Subtitle">
|
165
|
+
<CardContent topLeft={<SomeIcon />} topRight={<SaveButton saved={isSaved} />}>
|
166
|
+
<CardMedia src={someSrc} alt="trailer" />
|
167
|
+
</CardContent>
|
168
|
+
<CardTimeline text="еще 1ч 23мин" progress={56} />
|
169
|
+
</Card>;
|
170
|
+
|
171
|
+
<Card
|
172
|
+
title="Title"
|
173
|
+
subtitle="Subtitle"
|
174
|
+
// как в ant, но кажется, что так менее гибко
|
175
|
+
cover={<CardMedia src={someSrc} alt="trailer" />}
|
176
|
+
square
|
177
|
+
>
|
178
|
+
<CardContent
|
179
|
+
topLeft={<SomeIcon />}
|
180
|
+
topRight={<SaveButton saved={isSaved} />}
|
181
|
+
/>
|
182
|
+
<CardTimeline text="еще 1ч 23мин" progress={56} />
|
183
|
+
</Card>;
|
184
|
+
```
|
@@ -348,6 +348,7 @@ export var comboboxRoot = function comboboxRoot(Root) {
|
|
348
348
|
handleItemClick: handleItemClick,
|
349
349
|
variant: variant,
|
350
350
|
renderItem: renderItem,
|
351
|
+
valueToItemMap: valueToItemMap,
|
351
352
|
treeId: treeId
|
352
353
|
}
|
353
354
|
}, /*#__PURE__*/React.createElement(FloatingPopover, {
|
@@ -31,6 +31,7 @@ export var Item = function Item(_ref) {
|
|
31
31
|
handleItemClick = _useContext.handleItemClick,
|
32
32
|
variant = _useContext.variant,
|
33
33
|
renderItem = _useContext.renderItem,
|
34
|
+
valueToItemMap = _useContext.valueToItemMap,
|
34
35
|
treeId = _useContext.treeId;
|
35
36
|
var disabledClassName = disabled ? classes.dropdownItemIsDisabled : undefined;
|
36
37
|
var focusedClass = currentLevel === focusedPath.length - 1 && index === (focusedPath === null || focusedPath === void 0 ? void 0 : focusedPath[currentLevel]) ? classes.dropdownItemIsFocused : undefined;
|
@@ -84,7 +85,7 @@ export var Item = function Item(_ref) {
|
|
84
85
|
}))), !multiple && checked.get(item.value) === 'done' && /*#__PURE__*/React.createElement(IconDone, {
|
85
86
|
size: sizeToIconSize(size, variant),
|
86
87
|
color: "inherit"
|
87
|
-
})), renderItem ? /*#__PURE__*/React.createElement(StyledText, null, renderItem(
|
88
|
+
})), renderItem ? /*#__PURE__*/React.createElement(StyledText, null, renderItem(valueToItemMap.get(value))) : /*#__PURE__*/React.createElement(StyledWrapper, null, /*#__PURE__*/React.createElement(StyledCell, {
|
88
89
|
view: "default",
|
89
90
|
size: "l",
|
90
91
|
contentLeft: contentLeft,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["items", "children", "placement", "offset", "closeOnOverlayClick", "onToggle", "size", "view", "itemRole", "className", "listWidth", "listHeight", "listOverflow", "closeOnSelect", "onHover", "onItemSelect", "onItemClick", "trigger", "variant", "hasArrow", "alwaysOpened", "portal"
|
1
|
+
var _excluded = ["items", "children", "placement", "offset", "closeOnOverlayClick", "onToggle", "size", "view", "itemRole", "className", "listWidth", "listHeight", "listOverflow", "closeOnSelect", "onHover", "onItemSelect", "onItemClick", "trigger", "variant", "hasArrow", "alwaysOpened", "portal"];
|
2
2
|
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); }
|
3
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
4
4
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
@@ -60,7 +60,6 @@ export var dropdownRoot = function dropdownRoot(Root) {
|
|
60
60
|
_ref$alwaysOpened = _ref.alwaysOpened,
|
61
61
|
alwaysOpened = _ref$alwaysOpened === void 0 ? false : _ref$alwaysOpened,
|
62
62
|
portal = _ref.portal,
|
63
|
-
renderItem = _ref.renderItem,
|
64
63
|
rest = _objectWithoutProperties(_ref, _excluded);
|
65
64
|
var _useReducer = useReducer(pathReducer, []),
|
66
65
|
_useReducer2 = _slicedToArray(_useReducer, 2),
|
@@ -136,8 +135,7 @@ export var dropdownRoot = function dropdownRoot(Root) {
|
|
136
135
|
onItemClick: onItemClick,
|
137
136
|
onItemSelect: onItemSelect,
|
138
137
|
hasArrow: hasArrow,
|
139
|
-
treeId: treeId
|
140
|
-
renderItem: renderItem
|
138
|
+
treeId: treeId
|
141
139
|
}
|
142
140
|
}, /*#__PURE__*/React.createElement(FloatingPopover, {
|
143
141
|
ref: floatingPopoverRef,
|
@@ -4,7 +4,7 @@ import { cx } from '../../../../utils';
|
|
4
4
|
import { IconDisclosureRight } from '../../../_Icon';
|
5
5
|
import { Context } from '../../Dropdown';
|
6
6
|
import { getItemId } from '../../utils';
|
7
|
-
import { Wrapper, DisclosureIconWrapper, Divider, CellWrapper, StyledCell
|
7
|
+
import { Wrapper, DisclosureIconWrapper, Divider, CellWrapper, StyledCell } from './DropdownItem.styles';
|
8
8
|
export var DropdownItem = function DropdownItem(_ref) {
|
9
9
|
var item = _ref.item,
|
10
10
|
path = _ref.path,
|
@@ -34,8 +34,7 @@ export var DropdownItem = function DropdownItem(_ref) {
|
|
34
34
|
onItemSelect = _useContext.onItemSelect,
|
35
35
|
onItemClick = _useContext.onItemClick,
|
36
36
|
hasArrow = _useContext.hasArrow,
|
37
|
-
treeId = _useContext.treeId
|
38
|
-
renderItem = _useContext.renderItem;
|
37
|
+
treeId = _useContext.treeId;
|
39
38
|
var hasDescendants = Boolean(item.items);
|
40
39
|
var disclosureIconSize = size === 'xs' ? 'xs' : 's';
|
41
40
|
var isDisabledClassName = disabled || isDisabled ? classes.dropdownItemIsDisabled : undefined;
|
@@ -86,7 +85,7 @@ export var DropdownItem = function DropdownItem(_ref) {
|
|
86
85
|
"aria-expanded": ariaExpanded,
|
87
86
|
"aria-level": ariaLevel,
|
88
87
|
"aria-label": ariaLabel
|
89
|
-
},
|
88
|
+
}, /*#__PURE__*/React.createElement(CellWrapper, null, /*#__PURE__*/React.createElement(StyledCell, {
|
90
89
|
contentLeft: contentLeft,
|
91
90
|
contentRight: contentRight,
|
92
91
|
alignContentLeft: "center",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import styled from 'styled-components';
|
2
2
|
import { classes, tokens, constants } from '../../Dropdown.tokens';
|
3
|
-
import { addFocus
|
3
|
+
import { addFocus } from '../../../../mixins';
|
4
4
|
import { cellConfig, cellTokens } from '../../../Cell';
|
5
5
|
import { component, mergeConfig } from '../../../../engines';
|
6
6
|
var mergedCellConfig = /*#__PURE__*/mergeConfig(cellConfig);
|
@@ -35,7 +35,4 @@ export var Wrapper = /*#__PURE__*/styled.li.withConfig({
|
|
35
35
|
outlineRadius: /*#__PURE__*/"var(".concat(tokens.itemBorderRadius, ")"),
|
36
36
|
hasTransition: false,
|
37
37
|
customFocusRules: /*#__PURE__*/"\n &.".concat(classes.dropdownItemIsFocused, ":before {\n outline: none;\n box-shadow: 0 0 0 0.0625rem var(").concat(constants.focusColor, ");\n }\n ")
|
38
|
-
}));
|
39
|
-
export var RenderItemWrapper = /*#__PURE__*/styled.div.withConfig({
|
40
|
-
componentId: "plasma-new-hope__sc-hs0ek1-5"
|
41
|
-
})(["", ";flex:1;"], /*#__PURE__*/applyEllipsis());
|
38
|
+
}));
|
@@ -272,6 +272,7 @@ export var selectRoot = function selectRoot(Root) {
|
|
272
272
|
handleItemClick: handleItemClick,
|
273
273
|
variant: variant,
|
274
274
|
renderItem: renderItem,
|
275
|
+
valueToItemMap: valueToItemMap,
|
275
276
|
treeId: treeId
|
276
277
|
}
|
277
278
|
}, /*#__PURE__*/React.createElement(FloatingPopover, {
|
@@ -32,6 +32,7 @@ export var Item = function Item(_ref) {
|
|
32
32
|
handleItemClick = _useContext.handleItemClick,
|
33
33
|
variant = _useContext.variant,
|
34
34
|
renderItem = _useContext.renderItem,
|
35
|
+
valueToItemMap = _useContext.valueToItemMap,
|
35
36
|
treeId = _useContext.treeId;
|
36
37
|
var itemDisabled = Boolean(disabled || isDisabled);
|
37
38
|
var disabledClassName = itemDisabled ? classes.dropdownItemIsDisabled : undefined;
|
@@ -86,7 +87,7 @@ export var Item = function Item(_ref) {
|
|
86
87
|
}))), !multiselect && checked.get(item.value) === 'done' && /*#__PURE__*/React.createElement(IconDone, {
|
87
88
|
size: sizeToIconSize(size, variant),
|
88
89
|
color: "inherit"
|
89
|
-
})), renderItem ? /*#__PURE__*/React.createElement(StyledText, null, renderItem(
|
90
|
+
})), renderItem ? /*#__PURE__*/React.createElement(StyledText, null, renderItem(valueToItemMap.get(value))) : /*#__PURE__*/React.createElement(StyledWrapper, null, /*#__PURE__*/React.createElement(StyledCell, {
|
90
91
|
contentLeft: contentLeft,
|
91
92
|
contentRight: contentRight
|
92
93
|
// TODO: #1548
|
@@ -1,10 +1,4 @@
|
|
1
1
|
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); }
|
2
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
3
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
4
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
5
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
6
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
7
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
8
2
|
import React, { forwardRef } from 'react';
|
9
3
|
import { sizeToIconSize, getItemId } from '../../../../utils';
|
10
4
|
import { classes } from '../../../../Select.tokens';
|
@@ -53,24 +47,9 @@ export var Textfield = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
53
47
|
|
54
48
|
// Обработчик чипов
|
55
49
|
var handleChipsChange = function handleChipsChange(chipLabels) {
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
// Из лейблов чипов получаем value у item и далее прокидываем его в onChange.
|
60
|
-
if (renderValue && !isTargetAmount) {
|
61
|
-
var resultValues = _toConsumableArray(value);
|
62
|
-
value.forEach(function (_, index) {
|
63
|
-
var labelAfterRenderValue = renderValue(labelToItemMap.get(valueToItemMap.get(value[index]).label));
|
64
|
-
if (!chipLabels.includes(labelAfterRenderValue)) {
|
65
|
-
resultValues.splice(index, 1);
|
66
|
-
}
|
67
|
-
});
|
68
|
-
onChange(resultValues);
|
69
|
-
} else {
|
70
|
-
onChange(chipLabels.map(function (chipLabel) {
|
71
|
-
return labelToItemMap.get(chipLabel).value;
|
72
|
-
}));
|
73
|
-
}
|
50
|
+
onChange(chipLabels.map(function (chipLabel) {
|
51
|
+
return labelToItemMap.get(chipLabel).value;
|
52
|
+
}));
|
74
53
|
};
|
75
54
|
return /*#__PURE__*/React.createElement(StyledTextField, _extends({
|
76
55
|
ref: ref,
|
@@ -23,6 +23,11 @@ export var tokens = {
|
|
23
23
|
verticalGap: '--plasma-switch-vertical-gap',
|
24
24
|
trackWidth: '--plasma-switch__track-width',
|
25
25
|
trackHeight: '--plasma-switch__track-height',
|
26
|
+
trackBorderWidth: '--plasma-switch__track-border',
|
27
|
+
trackBorderColorOn: '--plasma-switch__track-checked_true-border-color',
|
28
|
+
trackBorderColorOnHover: '--plasma-switch__track-checked_true_hovered_true-border-color',
|
29
|
+
trackBorderColorOff: '--plasma-switch__track-checked_false-border-color',
|
30
|
+
trackBorderColorOffHover: '--plasma-switch__track-checked_false_hovered_true-border-color',
|
26
31
|
trackBorderRadius: '--plasma-switch__track-border-radius',
|
27
32
|
// NOTE: could be intersection with checked
|
28
33
|
trackBackgroundColorOn: '--plasma-switch__track_checked_true-bg-color',
|
@@ -34,7 +39,8 @@ export var tokens = {
|
|
34
39
|
thumbOffset: '--plasma-switch__thumb-offset',
|
35
40
|
thumbBorderRadius: '--plasma-switch__thumb-border-radius',
|
36
41
|
thumbPressScale: '--plasma-switch__thumb-scale',
|
37
|
-
|
42
|
+
thumbBackgroundColorOn: '--plasma-switch__thumb_checked_true-bg-color',
|
43
|
+
thumbBackgroundColorOff: '--plasma-switch__thumb-checked_false-bg-color',
|
38
44
|
thumbBoxShadow: '--plasma-switch__thumb-box-shadow',
|
39
45
|
thumbBoxShadowOn: '--plasma-switch__thumb-box-shadow_checked_true',
|
40
46
|
labelOffsetPrivate: '--plasma_private-switch__label-offset'
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { css } from 'styled-components';
|
2
2
|
import { tokens } from '../Switch.tokens';
|
3
3
|
import { StyledTrigger } from '../Switch.styles';
|
4
|
-
export var base = /*#__PURE__*/css(["", "{flex:0 0 var(", ");width:var(", ");
|
4
|
+
export var base = /*#__PURE__*/css(["", "{box-sizing:border-box;flex:0 0 var(", ");border-style:solid;border-width:var(", ");border-radius:var(", ");width:var(", ");height:var(", ");&::after{width:var(", ");height:var(", ");border-radius:var(", ");margin:auto var(", ");}}:active:not([disabled]) ", "::after{width:calc(var(", ") * var(", ",1));}"], StyledTrigger, tokens.trackWidth, tokens.trackBorderWidth, tokens.trackBorderRadius, tokens.trackWidth, tokens.trackHeight, tokens.thumbSize, tokens.thumbSize, tokens.thumbBorderRadius, tokens.thumbOffset, StyledTrigger, tokens.thumbSize, tokens.thumbPressScale);
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { css } from 'styled-components';
|
2
2
|
import { tokens } from '../Switch.tokens';
|
3
3
|
import { StyledTrigger, StyledInput, StyledLabel, StyledDescription } from '../Switch.styles';
|
4
|
-
export var base = /*#__PURE__*/css(["", "{background-color:var(", ");}", ":not([disabled]) ~ ", ":hover{background-color:var(", ",var(", "));}", ":checked ~ ", "{background-color:var(", ");}", ":checked:not([disabled]) ~ ", ":hover{background-color:var(", ",var(", "));}", "::after{background-color:var(", ");box-shadow:var(", ");}", ":checked ~ ", "::after{box-shadow:var(", ",var(", "));}", "{color:var(", ");}", "{color:var(", ");}"], StyledTrigger, tokens.trackBackgroundColorOff, StyledInput, StyledTrigger, tokens.trackBackgroundColorOffHover, tokens.trackBackgroundColorOff, StyledInput, StyledTrigger, tokens.trackBackgroundColorOn, StyledInput, StyledTrigger, tokens.trackBackgroundColorOnHover, tokens.trackBackgroundColorOn, StyledTrigger, tokens.
|
4
|
+
export var base = /*#__PURE__*/css(["", "{background-color:var(", ");border-color:var(", ");}", ":not([disabled]) ~ ", ":hover{background-color:var(", ",var(", "));border-color:var(", ",var(", "));}", ":checked ~ ", "{background-color:var(", ");border-color:var(", ");}", ":checked:not([disabled]) ~ ", ":hover{background-color:var(", ",var(", "));border-color:var(", ",var(", "));}", "::after{background-color:var(", ");box-shadow:var(", ");}", ":checked ~ ", "::after{background-color:var(", ");box-shadow:var(", ",var(", "));}", "{color:var(", ");}", "{color:var(", ");}"], StyledTrigger, tokens.trackBackgroundColorOff, tokens.trackBorderColorOff, StyledInput, StyledTrigger, tokens.trackBackgroundColorOffHover, tokens.trackBackgroundColorOff, tokens.trackBorderColorOffHover, tokens.trackBorderColorOff, StyledInput, StyledTrigger, tokens.trackBackgroundColorOn, tokens.trackBorderColorOn, StyledInput, StyledTrigger, tokens.trackBackgroundColorOnHover, tokens.trackBackgroundColorOn, tokens.trackBorderColorOnHover, tokens.trackBorderColorOn, StyledTrigger, tokens.thumbBackgroundColorOff, tokens.thumbBoxShadow, StyledInput, StyledTrigger, tokens.thumbBackgroundColorOn, tokens.thumbBoxShadowOn, tokens.thumbBoxShadow, StyledLabel, tokens.labelColor, StyledDescription, tokens.descriptionColor);
|
@@ -19,7 +19,7 @@ export var config = {
|
|
19
19
|
s: /*#__PURE__*/css(["", ":2rem;", ":1.25rem;", ":calc(var(", ") / 2);", ":1rem;", ":calc(var(", ") / 2);", ":0.125rem;", ":1.25;"], switchTokens.trackWidth, switchTokens.trackHeight, switchTokens.trackBorderRadius, switchTokens.trackHeight, switchTokens.thumbSize, switchTokens.thumbBorderRadius, switchTokens.thumbSize, switchTokens.thumbOffset, switchTokens.thumbPressScale)
|
20
20
|
},
|
21
21
|
view: {
|
22
|
-
"default": /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--surface-accent);", ":var(--surface-accent-hover);", ":var(--surface-transparent-tertiary);", ":var(--surface-transparent-tertiary-hover);", ":var(--on-dark-surface-solid-default);", ":0 1px 1px rgba(0,0,0,0.11);"], switchTokens.labelColor, switchTokens.descriptionColor, switchTokens.trackBackgroundColorOn, switchTokens.trackBackgroundColorOnHover, switchTokens.trackBackgroundColorOff, switchTokens.trackBackgroundColorOffHover, switchTokens.
|
22
|
+
"default": /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--surface-accent);", ":var(--surface-accent-hover);", ":var(--surface-transparent-tertiary);", ":var(--surface-transparent-tertiary-hover);", ":0rem;", ":var(--on-dark-surface-solid-default);", ":var(--on-dark-surface-solid-default);", ":0 1px 1px rgba(0,0,0,0.11);"], switchTokens.labelColor, switchTokens.descriptionColor, switchTokens.trackBackgroundColorOn, switchTokens.trackBackgroundColorOnHover, switchTokens.trackBackgroundColorOff, switchTokens.trackBackgroundColorOffHover, switchTokens.trackBorderWidth, switchTokens.thumbBackgroundColorOff, switchTokens.thumbBackgroundColorOn, switchTokens.thumbBoxShadow)
|
23
23
|
},
|
24
24
|
disabled: {
|
25
25
|
"true": /*#__PURE__*/css(["", ":0.4;"], switchTokens.disabledOpacity)
|