@salutejs/plasma-web 1.404.1-dev.0 → 1.405.0-canary.1447.11031873624.0
Sign up to get free protection for your applications and to get access to all the features.
- package/api/plasma-web.api.md +0 -4
- package/components/Switch/Switch.config.d.ts +0 -4
- package/components/Switch/Switch.config.js +3 -8
- package/components/Switch/Switch.d.ts +0 -8
- package/css/cjs/components/Switch/Switch.config.js +30 -0
- package/css/cjs/components/Switch/Switch.config.js.map +1 -0
- package/css/cjs/components/Switch/Switch.config_ngx5fc.css +4 -0
- package/css/cjs/components/Switch/Switch.css +4 -0
- package/css/cjs/components/Switch/Switch.js +13 -0
- package/css/cjs/components/Switch/Switch.js.map +1 -0
- package/css/cjs/index.css +5 -0
- package/css/cjs/index.js +2 -0
- package/css/cjs/index.js.map +1 -1
- package/css/es/components/Switch/Switch.config.js +26 -0
- package/css/es/components/Switch/Switch.config.js.map +1 -0
- package/css/es/components/Switch/Switch.config_ngx5fc.css +4 -0
- package/css/es/components/Switch/Switch.css +4 -0
- package/css/es/components/Switch/Switch.js +9 -0
- package/css/es/components/Switch/Switch.js.map +1 -0
- package/css/es/index.css +5 -0
- package/css/es/index.js +1 -0
- package/css/es/index.js.map +1 -1
- package/css/index.d.ts +2 -0
- package/es/components/Switch/Switch.config.js +4 -9
- package/package.json +3 -3
- package/scripts/copy-linaria-components.sh +3 -5
- package/temp/plasma-web.api.md +3309 -0
package/api/plasma-web.api.md
CHANGED
@@ -12,10 +12,6 @@ export declare const config: {
|
|
12
12
|
view: {
|
13
13
|
default: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
|
14
14
|
};
|
15
|
-
labelPosition: {
|
16
|
-
before: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
|
17
|
-
after: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
|
18
|
-
};
|
19
15
|
disabled: {
|
20
16
|
true: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
|
21
17
|
};
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.config = void 0;
|
7
7
|
var _styledComponents = /*#__PURE__*/require("@salutejs/plasma-new-hope/styled-components");
|
8
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4
|
8
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
9
9
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
10
10
|
var config = exports.config = {
|
11
11
|
defaults: {
|
@@ -21,16 +21,11 @@ var config = exports.config = {
|
|
21
21
|
view: {
|
22
22
|
"default": /*#__PURE__*/(0, _styledComponents.css)(_templateObject2 || (_templateObject2 = /*#__PURE__*/_taggedTemplateLiteral(["\n ", ": var(--surface-accent);\n ", ": var(--surface-accent-hover);\n ", ": var(--surface-transparent-tertiary);\n ", ": var(--surface-transparent-tertiary-hover);\n ", ": var(--on-dark-surface-solid-default);\n ", ": 0 1px 1px rgba(0, 0, 0, 0.11);\n "])), _styledComponents.switchTokens.trackBackgroundColorOn, _styledComponents.switchTokens.trackBackgroundColorOnHover, _styledComponents.switchTokens.trackBackgroundColorOff, _styledComponents.switchTokens.trackBackgroundColorOffHover, _styledComponents.switchTokens.thumbBackgroundColor, _styledComponents.switchTokens.thumbBoxShadow)
|
23
23
|
},
|
24
|
-
// TODO: could we not css into css ???
|
25
|
-
labelPosition: {
|
26
|
-
before: /*#__PURE__*/(0, _styledComponents.css)(_templateObject3 || (_templateObject3 = /*#__PURE__*/_taggedTemplateLiteral(["\n ", "\n "])), _styledComponents.Switch_LabelPosition_Before),
|
27
|
-
after: /*#__PURE__*/(0, _styledComponents.css)(_templateObject4 || (_templateObject4 = /*#__PURE__*/_taggedTemplateLiteral(["\n ", "\n "])), _styledComponents.Switch_LabelPosition_After)
|
28
|
-
},
|
29
24
|
disabled: {
|
30
|
-
"true": /*#__PURE__*/(0, _styledComponents.css)(
|
25
|
+
"true": /*#__PURE__*/(0, _styledComponents.css)(_templateObject3 || (_templateObject3 = /*#__PURE__*/_taggedTemplateLiteral(["\n ", ": 0.4;\n "])), _styledComponents.switchTokens.disabledOpacity)
|
31
26
|
},
|
32
27
|
focused: {
|
33
|
-
"true": /*#__PURE__*/(0, _styledComponents.css)(
|
28
|
+
"true": /*#__PURE__*/(0, _styledComponents.css)(_templateObject4 || (_templateObject4 = /*#__PURE__*/_taggedTemplateLiteral(["\n ", ": var(--surface-accent);\n "])), _styledComponents.switchTokens.trackFocusColor)
|
34
29
|
}
|
35
30
|
}
|
36
31
|
};
|
@@ -6,10 +6,6 @@ declare const SwitchComponent: import("react").FunctionComponent<import("@salute
|
|
6
6
|
view: {
|
7
7
|
default: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
|
8
8
|
};
|
9
|
-
labelPosition: {
|
10
|
-
before: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
|
11
|
-
after: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
|
12
|
-
};
|
13
9
|
disabled: {
|
14
10
|
true: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
|
15
11
|
};
|
@@ -24,10 +20,6 @@ export declare const Switch: import("react").FunctionComponent<import("@salutejs
|
|
24
20
|
view: {
|
25
21
|
default: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
|
26
22
|
};
|
27
|
-
labelPosition: {
|
28
|
-
before: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
|
29
|
-
after: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
|
30
|
-
};
|
31
23
|
disabled: {
|
32
24
|
true: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
|
33
25
|
};
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import './Switch.config_ngx5fc.css';
|
2
|
+
'use strict';
|
3
|
+
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
5
|
+
|
6
|
+
var config = {
|
7
|
+
defaults: {
|
8
|
+
view: 'default',
|
9
|
+
size: 'm',
|
10
|
+
labelPosition: 'before',
|
11
|
+
focused: 'true'
|
12
|
+
},
|
13
|
+
variations: {
|
14
|
+
size: {
|
15
|
+
m: "mx2gvdq"
|
16
|
+
},
|
17
|
+
view: {
|
18
|
+
"default": "d14e2x67"
|
19
|
+
},
|
20
|
+
disabled: {
|
21
|
+
"true": "t6qjy60"
|
22
|
+
},
|
23
|
+
focused: {
|
24
|
+
"true": "t1h60cj3"
|
25
|
+
}
|
26
|
+
}
|
27
|
+
};
|
28
|
+
|
29
|
+
exports.config = config;
|
30
|
+
//# sourceMappingURL=Switch.config.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Switch.config.js","sources":["../../../../src-css/components/Switch/Switch.config.ts"],"sourcesContent":["import { css, switchTokens } from '@salutejs/plasma-new-hope';\n\nexport const config = {\n defaults: {\n view: 'default',\n size: 'm',\n labelPosition: 'before',\n focused: 'true',\n },\n variations: {\n size: {\n m: css`\n ${switchTokens.fontFamily}: var(--plasma-typo-body1-font-family);\n ${switchTokens.fontStyle}: var(--plasma-typo-body1-font-style);\n ${switchTokens.fontWeight}: var(--plasma-typo-body1-font-weight);\n ${switchTokens.fontWeight}: var(--plasma-typo-body1-font-weight);\n ${switchTokens.lineHeight}: var(--plasma-typo-body1-line-height);\n ${switchTokens.fontSize}: var(--plasma-typo-body1-font-size);\n ${switchTokens.letterSpacing}: var(--plasma-typo-body1-letter-spacing);\n ${switchTokens.trackWidth}: 2.75rem;\n ${switchTokens.trackHeight}: 1.75rem;\n ${switchTokens.trackBorderRadius}: calc(var(${switchTokens.trackHeight}) / 2);\n ${switchTokens.thumbSize}: 1.5rem;\n ${switchTokens.thumbBorderRadius}: calc(var(${switchTokens.thumbSize}) / 2);\n ${switchTokens.thumbOffset}: 0.125rem;\n ${switchTokens.thumbPressScale}: 1.25;\n ${switchTokens.labelOffset}: 0.75rem;\n `,\n },\n view: {\n default: css`\n ${switchTokens.trackBackgroundColorOn}: var(--surface-accent);\n ${switchTokens.trackBackgroundColorOnHover}: var(--surface-accent-hover);\n ${switchTokens.trackBackgroundColorOff}: var(--surface-transparent-tertiary);\n ${switchTokens.trackBackgroundColorOffHover}: var(--surface-transparent-tertiary-hover);\n ${switchTokens.thumbBackgroundColor}: var(--on-dark-surface-solid-default);\n ${switchTokens.thumbBoxShadow}: 0 1px 1px rgba(0, 0, 0, 0.11);\n `,\n },\n disabled: {\n true: css`\n ${switchTokens.disabledOpacity}: 0.4;\n `,\n },\n focused: {\n true: css`\n ${switchTokens.trackFocusColor}: var(--surface-accent);\n `,\n },\n },\n};\n"],"names":["config","defaults","view","size","labelPosition","focused","variations","m","default","disabled","true"],"mappings":";;;;AAEO,IAAMA,MAAM,GAAG;AAClBC,EAAAA,QAAQ,EAAE;AACNC,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAG;AACTC,IAAAA,aAAa,EAAE,QAAQ;AACvBC,IAAAA,OAAO,EAAE,MAAA;GACZ;AACDC,EAAAA,UAAU,EAAE;AACRH,IAAAA,IAAI,EAAE;AACFI,MAAAA,CAAC,EAAA,SAAA;KAiBJ;AACDL,IAAAA,IAAI,EAAE;MACFM,SAAO,EAAA,UAAA;KAQV;AACDC,IAAAA,QAAQ,EAAE;MACNC,MAAI,EAAA,SAAA;KAGP;AACDL,IAAAA,OAAO,EAAE;MACLK,MAAI,EAAA,UAAA;AAGR,KAAA;AACJ,GAAA;AACJ;;;;"}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
.mx2gvdq{--plasma-switch-font-family:var(--plasma-typo-body1-font-family);--plasma-switch-font-style:var(--plasma-typo-body1-font-style);--plasma-switch-font-weight:var(--plasma-typo-body1-font-weight);--plasma-switch-font-weight:var(--plasma-typo-body1-font-weight);--plasma-switch-line-height:var(--plasma-typo-body1-line-height);--plasma-switch-font-size:var(--plasma-typo-body1-font-size);--plasma-switch-letter-spacing:var(--plasma-typo-body1-letter-spacing);--plasma-switch__track-width:2.75rem;--plasma-switch__track-height:1.75rem;--plasma-switch__track-border-radius:calc(var(--plasma-switch__track-height) / 2);--plasma-switch__thumb-size:1.5rem;--plasma-switch__thumb-border-radius:calc(var(--plasma-switch__thumb-size) / 2);--plasma-switch__thumb-offset:0.125rem;--plasma-switch__thumb-scale:1.25;--plasma-switch__label-offset:0.75rem;}
|
2
|
+
.d14e2x67{--plasma-switch__track_checked_true-bg-color:var(--surface-accent);--plasma-switch__track_checked_true_hovered_true-bg-color:var(--surface-accent-hover);--plasma-switch__track_checked_false-bg-color:var(--surface-transparent-tertiary);--plasma-switch__track_checked_false_hovered_true-bg-color:var(--surface-transparent-tertiary-hover);--plasma-switch__thumb-bg-color:var(--on-dark-surface-solid-default);--plasma-switch__thumb-box-shadow:0 1px 1px rgba(0,0,0,0.11);}
|
3
|
+
.t6qjy60{--plasma-switch-disabled-opacity:0.4;}
|
4
|
+
.t1h60cj3{--plasma-switch__track-focus-color:var(--surface-accent);}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
.Switch_config_ngx5fc_mx2gvdq__c71f94a5{--plasma-switch-font-family:var(--plasma-typo-body1-font-family);--plasma-switch-font-style:var(--plasma-typo-body1-font-style);--plasma-switch-font-weight:var(--plasma-typo-body1-font-weight);--plasma-switch-font-weight:var(--plasma-typo-body1-font-weight);--plasma-switch-line-height:var(--plasma-typo-body1-line-height);--plasma-switch-font-size:var(--plasma-typo-body1-font-size);--plasma-switch-letter-spacing:var(--plasma-typo-body1-letter-spacing);--plasma-switch__track-width:2.75rem;--plasma-switch__track-height:1.75rem;--plasma-switch__track-border-radius:calc(var(--plasma-switch__track-height) / 2);--plasma-switch__thumb-size:1.5rem;--plasma-switch__thumb-border-radius:calc(var(--plasma-switch__thumb-size) / 2);--plasma-switch__thumb-offset:0.125rem;--plasma-switch__thumb-scale:1.25;--plasma-switch__label-offset:0.75rem;}
|
2
|
+
.Switch_config_ngx5fc_d14e2x67__c71f94a5{--plasma-switch__track_checked_true-bg-color:var(--surface-accent);--plasma-switch__track_checked_true_hovered_true-bg-color:var(--surface-accent-hover);--plasma-switch__track_checked_false-bg-color:var(--surface-transparent-tertiary);--plasma-switch__track_checked_false_hovered_true-bg-color:var(--surface-transparent-tertiary-hover);--plasma-switch__thumb-bg-color:var(--on-dark-surface-solid-default);--plasma-switch__thumb-box-shadow:0 1px 1px rgba(0,0,0,0.11);}
|
3
|
+
.Switch_config_ngx5fc_t6qjy60__c71f94a5{--plasma-switch-disabled-opacity:0.4;}
|
4
|
+
.Switch_config_ngx5fc_t1h60cj3__c71f94a5{--plasma-switch__track-focus-color:var(--surface-accent);}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var plasmaNewHope = require('@salutejs/plasma-new-hope');
|
6
|
+
var Switch_config = require('./Switch.config.js');
|
7
|
+
|
8
|
+
var mergedConfig = /*#__PURE__*/plasmaNewHope.mergeConfig(plasmaNewHope.switchConfig, Switch_config.config);
|
9
|
+
var SwitchComponent = /*#__PURE__*/plasmaNewHope.component(mergedConfig);
|
10
|
+
var Switch = SwitchComponent;
|
11
|
+
|
12
|
+
exports.Switch = Switch;
|
13
|
+
//# sourceMappingURL=Switch.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Switch.js","sources":["../../../../src-css/components/Switch/Switch.tsx"],"sourcesContent":["import { switchConfig, component, mergeConfig } from '@salutejs/plasma-new-hope';\nimport { ComponentProps } from 'react';\n\nimport { config } from './Switch.config';\n\nconst mergedConfig = mergeConfig(switchConfig, config);\nconst SwitchComponent = component(mergedConfig);\n\nexport const Switch = SwitchComponent;\nexport type SwitchProps = ComponentProps<typeof SwitchComponent>;\n"],"names":["mergedConfig","mergeConfig","switchConfig","config","SwitchComponent","component","Switch"],"mappings":";;;;;;;AAKA,IAAMA,YAAY,gBAAGC,yBAAW,CAACC,0BAAY,EAAEC,oBAAM,CAAC,CAAA;AACtD,IAAMC,eAAe,gBAAGC,uBAAS,CAACL,YAAY,CAAC,CAAA;AAExC,IAAMM,MAAM,GAAGF;;;;"}
|
package/css/cjs/index.css
CHANGED
@@ -451,6 +451,11 @@
|
|
451
451
|
.Spinner_config_kv9h01_wewxek2__ac938a23{--plasma-spinner-color:var(--text-warning);}
|
452
452
|
.Spinner_config_kv9h01_n1qiprti__ac938a23{--plasma-spinner-color:var(--text-negative);}
|
453
453
|
|
454
|
+
.Switch_config_ngx5fc_mx2gvdq__c71f94a5{--plasma-switch-font-family:var(--plasma-typo-body1-font-family);--plasma-switch-font-style:var(--plasma-typo-body1-font-style);--plasma-switch-font-weight:var(--plasma-typo-body1-font-weight);--plasma-switch-font-weight:var(--plasma-typo-body1-font-weight);--plasma-switch-line-height:var(--plasma-typo-body1-line-height);--plasma-switch-font-size:var(--plasma-typo-body1-font-size);--plasma-switch-letter-spacing:var(--plasma-typo-body1-letter-spacing);--plasma-switch__track-width:2.75rem;--plasma-switch__track-height:1.75rem;--plasma-switch__track-border-radius:calc(var(--plasma-switch__track-height) / 2);--plasma-switch__thumb-size:1.5rem;--plasma-switch__thumb-border-radius:calc(var(--plasma-switch__thumb-size) / 2);--plasma-switch__thumb-offset:0.125rem;--plasma-switch__thumb-scale:1.25;--plasma-switch__label-offset:0.75rem;}
|
455
|
+
.Switch_config_ngx5fc_d14e2x67__c71f94a5{--plasma-switch__track_checked_true-bg-color:var(--surface-accent);--plasma-switch__track_checked_true_hovered_true-bg-color:var(--surface-accent-hover);--plasma-switch__track_checked_false-bg-color:var(--surface-transparent-tertiary);--plasma-switch__track_checked_false_hovered_true-bg-color:var(--surface-transparent-tertiary-hover);--plasma-switch__thumb-bg-color:var(--on-dark-surface-solid-default);--plasma-switch__thumb-box-shadow:0 1px 1px rgba(0,0,0,0.11);}
|
456
|
+
.Switch_config_ngx5fc_t6qjy60__c71f94a5{--plasma-switch-disabled-opacity:0.4;}
|
457
|
+
.Switch_config_ngx5fc_t1h60cj3__c71f94a5{--plasma-switch__track-focus-color:var(--surface-accent);}
|
458
|
+
|
454
459
|
.Tabs_config_1g344dn_c14650k1__49162f90{--plasma-tabs-arrow-color:var(--text-secondary);--plasma-tabs-background-color:transparent;--plasma-tabs-outline-focus-color:var(--surface-accent);--plasma-tabs-divider-height:0rem;--plasma-tabs-divider-color:transparent;--plasma-tabs-divider-border-radius:0rem;}
|
455
460
|
.Tabs_config_1g344dn_f3v4o3a__49162f90{--plasma-tabs-arrow-color:var(--text-secondary);--plasma-tabs-background-color:var(--surface-transparent-primary);--plasma-tabs-outline-focus-color:var(--surface-accent);--plasma-tabs-divider-height:0rem;--plasma-tabs-divider-color:transparent;--plasma-tabs-divider-border-radius:0rem;}
|
456
461
|
.Tabs_config_1g344dn_dd9smg7__49162f90{--plasma-tabs-arrow-color:var(--text-secondary);--plasma-tabs-background-color:transparent;--plasma-tabs-outline-focus-color:var(--surface-accent);--plasma-tabs-divider-height:0.0625rem;--plasma-tabs-divider-color:var(--surface-transparent-tertiary);--plasma-tabs-divider-border-radius:0.0625rem;}
|
package/css/cjs/index.js
CHANGED
@@ -51,6 +51,7 @@ var Sheet = require('./components/Sheet/Sheet.js');
|
|
51
51
|
var Skeleton = require('./components/Skeleton/Skeleton.js');
|
52
52
|
var Slider = require('./components/Slider/Slider.js');
|
53
53
|
var Spinner = require('./components/Spinner/Spinner.js');
|
54
|
+
var Switch = require('./components/Switch/Switch.js');
|
54
55
|
var TabsController = require('./components/Tabs/TabsController.js');
|
55
56
|
var Tabs = require('./components/Tabs/Tabs.js');
|
56
57
|
var TabItem = require('./components/Tabs/TabItem.js');
|
@@ -267,6 +268,7 @@ exports.LineSkeleton = Skeleton.LineSkeleton;
|
|
267
268
|
exports.TextSkeleton = Skeleton.TextSkeleton;
|
268
269
|
exports.Slider = Slider.Slider;
|
269
270
|
exports.Spinner = Spinner.Spinner;
|
271
|
+
exports.Switch = Switch.Switch;
|
270
272
|
exports.TabsController = TabsController.TabsController;
|
271
273
|
exports.Tabs = Tabs.Tabs;
|
272
274
|
exports.TabItem = TabItem.TabItem;
|
package/css/cjs/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import './Switch.config_ngx5fc.css';
|
2
|
+
var config = {
|
3
|
+
defaults: {
|
4
|
+
view: 'default',
|
5
|
+
size: 'm',
|
6
|
+
labelPosition: 'before',
|
7
|
+
focused: 'true'
|
8
|
+
},
|
9
|
+
variations: {
|
10
|
+
size: {
|
11
|
+
m: "mx2gvdq"
|
12
|
+
},
|
13
|
+
view: {
|
14
|
+
"default": "d14e2x67"
|
15
|
+
},
|
16
|
+
disabled: {
|
17
|
+
"true": "t6qjy60"
|
18
|
+
},
|
19
|
+
focused: {
|
20
|
+
"true": "t1h60cj3"
|
21
|
+
}
|
22
|
+
}
|
23
|
+
};
|
24
|
+
|
25
|
+
export { config };
|
26
|
+
//# sourceMappingURL=Switch.config.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Switch.config.js","sources":["../../../../src-css/components/Switch/Switch.config.ts"],"sourcesContent":["import { css, switchTokens } from '@salutejs/plasma-new-hope';\n\nexport const config = {\n defaults: {\n view: 'default',\n size: 'm',\n labelPosition: 'before',\n focused: 'true',\n },\n variations: {\n size: {\n m: css`\n ${switchTokens.fontFamily}: var(--plasma-typo-body1-font-family);\n ${switchTokens.fontStyle}: var(--plasma-typo-body1-font-style);\n ${switchTokens.fontWeight}: var(--plasma-typo-body1-font-weight);\n ${switchTokens.fontWeight}: var(--plasma-typo-body1-font-weight);\n ${switchTokens.lineHeight}: var(--plasma-typo-body1-line-height);\n ${switchTokens.fontSize}: var(--plasma-typo-body1-font-size);\n ${switchTokens.letterSpacing}: var(--plasma-typo-body1-letter-spacing);\n ${switchTokens.trackWidth}: 2.75rem;\n ${switchTokens.trackHeight}: 1.75rem;\n ${switchTokens.trackBorderRadius}: calc(var(${switchTokens.trackHeight}) / 2);\n ${switchTokens.thumbSize}: 1.5rem;\n ${switchTokens.thumbBorderRadius}: calc(var(${switchTokens.thumbSize}) / 2);\n ${switchTokens.thumbOffset}: 0.125rem;\n ${switchTokens.thumbPressScale}: 1.25;\n ${switchTokens.labelOffset}: 0.75rem;\n `,\n },\n view: {\n default: css`\n ${switchTokens.trackBackgroundColorOn}: var(--surface-accent);\n ${switchTokens.trackBackgroundColorOnHover}: var(--surface-accent-hover);\n ${switchTokens.trackBackgroundColorOff}: var(--surface-transparent-tertiary);\n ${switchTokens.trackBackgroundColorOffHover}: var(--surface-transparent-tertiary-hover);\n ${switchTokens.thumbBackgroundColor}: var(--on-dark-surface-solid-default);\n ${switchTokens.thumbBoxShadow}: 0 1px 1px rgba(0, 0, 0, 0.11);\n `,\n },\n disabled: {\n true: css`\n ${switchTokens.disabledOpacity}: 0.4;\n `,\n },\n focused: {\n true: css`\n ${switchTokens.trackFocusColor}: var(--surface-accent);\n `,\n },\n },\n};\n"],"names":["config","defaults","view","size","labelPosition","focused","variations","m","default","disabled","true"],"mappings":"AAEO,IAAMA,MAAM,GAAG;AAClBC,EAAAA,QAAQ,EAAE;AACNC,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAG;AACTC,IAAAA,aAAa,EAAE,QAAQ;AACvBC,IAAAA,OAAO,EAAE,MAAA;GACZ;AACDC,EAAAA,UAAU,EAAE;AACRH,IAAAA,IAAI,EAAE;AACFI,MAAAA,CAAC,EAAA,SAAA;KAiBJ;AACDL,IAAAA,IAAI,EAAE;MACFM,SAAO,EAAA,UAAA;KAQV;AACDC,IAAAA,QAAQ,EAAE;MACNC,MAAI,EAAA,SAAA;KAGP;AACDL,IAAAA,OAAO,EAAE;MACLK,MAAI,EAAA,UAAA;AAGR,KAAA;AACJ,GAAA;AACJ;;;;"}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
.mx2gvdq{--plasma-switch-font-family:var(--plasma-typo-body1-font-family);--plasma-switch-font-style:var(--plasma-typo-body1-font-style);--plasma-switch-font-weight:var(--plasma-typo-body1-font-weight);--plasma-switch-font-weight:var(--plasma-typo-body1-font-weight);--plasma-switch-line-height:var(--plasma-typo-body1-line-height);--plasma-switch-font-size:var(--plasma-typo-body1-font-size);--plasma-switch-letter-spacing:var(--plasma-typo-body1-letter-spacing);--plasma-switch__track-width:2.75rem;--plasma-switch__track-height:1.75rem;--plasma-switch__track-border-radius:calc(var(--plasma-switch__track-height) / 2);--plasma-switch__thumb-size:1.5rem;--plasma-switch__thumb-border-radius:calc(var(--plasma-switch__thumb-size) / 2);--plasma-switch__thumb-offset:0.125rem;--plasma-switch__thumb-scale:1.25;--plasma-switch__label-offset:0.75rem;}
|
2
|
+
.d14e2x67{--plasma-switch__track_checked_true-bg-color:var(--surface-accent);--plasma-switch__track_checked_true_hovered_true-bg-color:var(--surface-accent-hover);--plasma-switch__track_checked_false-bg-color:var(--surface-transparent-tertiary);--plasma-switch__track_checked_false_hovered_true-bg-color:var(--surface-transparent-tertiary-hover);--plasma-switch__thumb-bg-color:var(--on-dark-surface-solid-default);--plasma-switch__thumb-box-shadow:0 1px 1px rgba(0,0,0,0.11);}
|
3
|
+
.t6qjy60{--plasma-switch-disabled-opacity:0.4;}
|
4
|
+
.t1h60cj3{--plasma-switch__track-focus-color:var(--surface-accent);}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
.Switch_config_ngx5fc_mx2gvdq__c71f94a5{--plasma-switch-font-family:var(--plasma-typo-body1-font-family);--plasma-switch-font-style:var(--plasma-typo-body1-font-style);--plasma-switch-font-weight:var(--plasma-typo-body1-font-weight);--plasma-switch-font-weight:var(--plasma-typo-body1-font-weight);--plasma-switch-line-height:var(--plasma-typo-body1-line-height);--plasma-switch-font-size:var(--plasma-typo-body1-font-size);--plasma-switch-letter-spacing:var(--plasma-typo-body1-letter-spacing);--plasma-switch__track-width:2.75rem;--plasma-switch__track-height:1.75rem;--plasma-switch__track-border-radius:calc(var(--plasma-switch__track-height) / 2);--plasma-switch__thumb-size:1.5rem;--plasma-switch__thumb-border-radius:calc(var(--plasma-switch__thumb-size) / 2);--plasma-switch__thumb-offset:0.125rem;--plasma-switch__thumb-scale:1.25;--plasma-switch__label-offset:0.75rem;}
|
2
|
+
.Switch_config_ngx5fc_d14e2x67__c71f94a5{--plasma-switch__track_checked_true-bg-color:var(--surface-accent);--plasma-switch__track_checked_true_hovered_true-bg-color:var(--surface-accent-hover);--plasma-switch__track_checked_false-bg-color:var(--surface-transparent-tertiary);--plasma-switch__track_checked_false_hovered_true-bg-color:var(--surface-transparent-tertiary-hover);--plasma-switch__thumb-bg-color:var(--on-dark-surface-solid-default);--plasma-switch__thumb-box-shadow:0 1px 1px rgba(0,0,0,0.11);}
|
3
|
+
.Switch_config_ngx5fc_t6qjy60__c71f94a5{--plasma-switch-disabled-opacity:0.4;}
|
4
|
+
.Switch_config_ngx5fc_t1h60cj3__c71f94a5{--plasma-switch__track-focus-color:var(--surface-accent);}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { component, mergeConfig, switchConfig } from '@salutejs/plasma-new-hope';
|
2
|
+
import { config } from './Switch.config.js';
|
3
|
+
|
4
|
+
var mergedConfig = /*#__PURE__*/mergeConfig(switchConfig, config);
|
5
|
+
var SwitchComponent = /*#__PURE__*/component(mergedConfig);
|
6
|
+
var Switch = SwitchComponent;
|
7
|
+
|
8
|
+
export { Switch };
|
9
|
+
//# sourceMappingURL=Switch.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Switch.js","sources":["../../../../src-css/components/Switch/Switch.tsx"],"sourcesContent":["import { switchConfig, component, mergeConfig } from '@salutejs/plasma-new-hope';\nimport { ComponentProps } from 'react';\n\nimport { config } from './Switch.config';\n\nconst mergedConfig = mergeConfig(switchConfig, config);\nconst SwitchComponent = component(mergedConfig);\n\nexport const Switch = SwitchComponent;\nexport type SwitchProps = ComponentProps<typeof SwitchComponent>;\n"],"names":["mergedConfig","mergeConfig","switchConfig","config","SwitchComponent","component","Switch"],"mappings":";;;AAKA,IAAMA,YAAY,gBAAGC,WAAW,CAACC,YAAY,EAAEC,MAAM,CAAC,CAAA;AACtD,IAAMC,eAAe,gBAAGC,SAAS,CAACL,YAAY,CAAC,CAAA;AAExC,IAAMM,MAAM,GAAGF;;;;"}
|
package/css/es/index.css
CHANGED
@@ -451,6 +451,11 @@
|
|
451
451
|
.Spinner_config_kv9h01_wewxek2__ac938a23{--plasma-spinner-color:var(--text-warning);}
|
452
452
|
.Spinner_config_kv9h01_n1qiprti__ac938a23{--plasma-spinner-color:var(--text-negative);}
|
453
453
|
|
454
|
+
.Switch_config_ngx5fc_mx2gvdq__c71f94a5{--plasma-switch-font-family:var(--plasma-typo-body1-font-family);--plasma-switch-font-style:var(--plasma-typo-body1-font-style);--plasma-switch-font-weight:var(--plasma-typo-body1-font-weight);--plasma-switch-font-weight:var(--plasma-typo-body1-font-weight);--plasma-switch-line-height:var(--plasma-typo-body1-line-height);--plasma-switch-font-size:var(--plasma-typo-body1-font-size);--plasma-switch-letter-spacing:var(--plasma-typo-body1-letter-spacing);--plasma-switch__track-width:2.75rem;--plasma-switch__track-height:1.75rem;--plasma-switch__track-border-radius:calc(var(--plasma-switch__track-height) / 2);--plasma-switch__thumb-size:1.5rem;--plasma-switch__thumb-border-radius:calc(var(--plasma-switch__thumb-size) / 2);--plasma-switch__thumb-offset:0.125rem;--plasma-switch__thumb-scale:1.25;--plasma-switch__label-offset:0.75rem;}
|
455
|
+
.Switch_config_ngx5fc_d14e2x67__c71f94a5{--plasma-switch__track_checked_true-bg-color:var(--surface-accent);--plasma-switch__track_checked_true_hovered_true-bg-color:var(--surface-accent-hover);--plasma-switch__track_checked_false-bg-color:var(--surface-transparent-tertiary);--plasma-switch__track_checked_false_hovered_true-bg-color:var(--surface-transparent-tertiary-hover);--plasma-switch__thumb-bg-color:var(--on-dark-surface-solid-default);--plasma-switch__thumb-box-shadow:0 1px 1px rgba(0,0,0,0.11);}
|
456
|
+
.Switch_config_ngx5fc_t6qjy60__c71f94a5{--plasma-switch-disabled-opacity:0.4;}
|
457
|
+
.Switch_config_ngx5fc_t1h60cj3__c71f94a5{--plasma-switch__track-focus-color:var(--surface-accent);}
|
458
|
+
|
454
459
|
.Tabs_config_1g344dn_c14650k1__49162f90{--plasma-tabs-arrow-color:var(--text-secondary);--plasma-tabs-background-color:transparent;--plasma-tabs-outline-focus-color:var(--surface-accent);--plasma-tabs-divider-height:0rem;--plasma-tabs-divider-color:transparent;--plasma-tabs-divider-border-radius:0rem;}
|
455
460
|
.Tabs_config_1g344dn_f3v4o3a__49162f90{--plasma-tabs-arrow-color:var(--text-secondary);--plasma-tabs-background-color:var(--surface-transparent-primary);--plasma-tabs-outline-focus-color:var(--surface-accent);--plasma-tabs-divider-height:0rem;--plasma-tabs-divider-color:transparent;--plasma-tabs-divider-border-radius:0rem;}
|
456
461
|
.Tabs_config_1g344dn_dd9smg7__49162f90{--plasma-tabs-arrow-color:var(--text-secondary);--plasma-tabs-background-color:transparent;--plasma-tabs-outline-focus-color:var(--surface-accent);--plasma-tabs-divider-height:0.0625rem;--plasma-tabs-divider-color:var(--surface-transparent-tertiary);--plasma-tabs-divider-border-radius:0.0625rem;}
|
package/css/es/index.js
CHANGED
@@ -47,6 +47,7 @@ export { Sheet } from './components/Sheet/Sheet.js';
|
|
47
47
|
export { LineSkeleton, TextSkeleton } from './components/Skeleton/Skeleton.js';
|
48
48
|
export { Slider } from './components/Slider/Slider.js';
|
49
49
|
export { Spinner } from './components/Spinner/Spinner.js';
|
50
|
+
export { Switch } from './components/Switch/Switch.js';
|
50
51
|
export { TabsController } from './components/Tabs/TabsController.js';
|
51
52
|
export { Tabs } from './components/Tabs/Tabs.js';
|
52
53
|
export { TabItem } from './components/Tabs/TabItem.js';
|
package/css/es/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/css/index.d.ts
CHANGED
@@ -45,6 +45,7 @@ export * from '../components/Sheet';
|
|
45
45
|
export * from '../components/Skeleton';
|
46
46
|
export * from '../components/Slider';
|
47
47
|
export * from '../components/Spinner';
|
48
|
+
export * from '../components/Switch';
|
48
49
|
export * from '../components/Tabs';
|
49
50
|
export * from '../components/TextArea';
|
50
51
|
export * from '../components/TextField';
|
@@ -100,6 +101,7 @@ export * from '../components/Sheet';
|
|
100
101
|
export * from '../components/Skeleton';
|
101
102
|
export * from '../components/Slider';
|
102
103
|
export * from '../components/Spinner';
|
104
|
+
export * from '../components/Switch';
|
103
105
|
export * from '../components/Tabs';
|
104
106
|
export * from '../components/TextArea';
|
105
107
|
export * from '../components/TextField';
|
@@ -1,6 +1,6 @@
|
|
1
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4
|
1
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
2
2
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
3
|
-
import {
|
3
|
+
import { css, switchTokens } from '@salutejs/plasma-new-hope/styled-components';
|
4
4
|
export var config = {
|
5
5
|
defaults: {
|
6
6
|
view: 'default',
|
@@ -15,16 +15,11 @@ export var config = {
|
|
15
15
|
view: {
|
16
16
|
"default": /*#__PURE__*/css(_templateObject2 || (_templateObject2 = /*#__PURE__*/_taggedTemplateLiteral(["\n ", ": var(--surface-accent);\n ", ": var(--surface-accent-hover);\n ", ": var(--surface-transparent-tertiary);\n ", ": var(--surface-transparent-tertiary-hover);\n ", ": var(--on-dark-surface-solid-default);\n ", ": 0 1px 1px rgba(0, 0, 0, 0.11);\n "])), switchTokens.trackBackgroundColorOn, switchTokens.trackBackgroundColorOnHover, switchTokens.trackBackgroundColorOff, switchTokens.trackBackgroundColorOffHover, switchTokens.thumbBackgroundColor, switchTokens.thumbBoxShadow)
|
17
17
|
},
|
18
|
-
// TODO: could we not css into css ???
|
19
|
-
labelPosition: {
|
20
|
-
before: /*#__PURE__*/css(_templateObject3 || (_templateObject3 = /*#__PURE__*/_taggedTemplateLiteral(["\n ", "\n "])), Switch_LabelPosition_Before),
|
21
|
-
after: /*#__PURE__*/css(_templateObject4 || (_templateObject4 = /*#__PURE__*/_taggedTemplateLiteral(["\n ", "\n "])), Switch_LabelPosition_After)
|
22
|
-
},
|
23
18
|
disabled: {
|
24
|
-
"true": /*#__PURE__*/css(
|
19
|
+
"true": /*#__PURE__*/css(_templateObject3 || (_templateObject3 = /*#__PURE__*/_taggedTemplateLiteral(["\n ", ": 0.4;\n "])), switchTokens.disabledOpacity)
|
25
20
|
},
|
26
21
|
focused: {
|
27
|
-
"true": /*#__PURE__*/css(
|
22
|
+
"true": /*#__PURE__*/css(_templateObject4 || (_templateObject4 = /*#__PURE__*/_taggedTemplateLiteral(["\n ", ": var(--surface-accent);\n "])), switchTokens.trackFocusColor)
|
28
23
|
}
|
29
24
|
}
|
30
25
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/plasma-web",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.405.0-canary.1447.11031873624.0",
|
4
4
|
"description": "Salute Design System / React UI kit for web applications",
|
5
5
|
"author": "Salute Frontend Team <salute.developers@gmail.com>",
|
6
6
|
"license": "MIT",
|
@@ -21,7 +21,7 @@
|
|
21
21
|
"dependencies": {
|
22
22
|
"@salutejs/plasma-core": "1.180.0",
|
23
23
|
"@salutejs/plasma-hope": "1.312.0",
|
24
|
-
"@salutejs/plasma-new-hope": "0.
|
24
|
+
"@salutejs/plasma-new-hope": "0.153.0-canary.1447.11031873624.0",
|
25
25
|
"@salutejs/plasma-themes": "0.18.0",
|
26
26
|
"@salutejs/plasma-tokens-b2b": "1.42.0",
|
27
27
|
"@salutejs/plasma-tokens-b2c": "0.52.0",
|
@@ -112,5 +112,5 @@
|
|
112
112
|
"Fanil Zubairov"
|
113
113
|
],
|
114
114
|
"sideEffects": false,
|
115
|
-
"gitHead": "
|
115
|
+
"gitHead": "3a3508c38cbfbccd72db5e3793baeca70bd3a6d7"
|
116
116
|
}
|
@@ -7,12 +7,10 @@ mkdir -p src-css/components/
|
|
7
7
|
touch src-css/index.ts
|
8
8
|
touch src-css/index.d.ts
|
9
9
|
for component in $components; do
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
echo "export * from '../components/$component';" >> css/index.d.ts;
|
10
|
+
cp -R src/components/$component src-css/components/;
|
11
|
+
grep -E "\<$component\>" src/index.ts >> src-css/index.ts
|
12
|
+
echo "export * from '../components/$component';" >> css/index.d.ts;
|
14
13
|
|
15
|
-
fi
|
16
14
|
done;
|
17
15
|
|
18
16
|
# remove unused tests
|