@salutejs/plasma-new-hope 0.191.1-dev.0 → 0.191.2-canary.1557.11803291365.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Switch/Switch.css +11 -7
- package/cjs/components/Switch/Switch.js +16 -7
- package/cjs/components/Switch/Switch.js.map +1 -1
- package/cjs/components/Switch/Switch.styles.js +16 -4
- package/cjs/components/Switch/Switch.styles.js.map +1 -1
- package/cjs/components/Switch/Switch.styles_bei7bh.css +6 -0
- package/cjs/components/Switch/Switch.tokens.js +11 -0
- package/cjs/components/Switch/Switch.tokens.js.map +1 -1
- package/cjs/components/Switch/_focused/base.js +1 -1
- package/{es/components/Switch/_focused/base_j4murk.css → cjs/components/Switch/_focused/base_sz3n0x.css} +1 -1
- package/cjs/components/Switch/_size/base.js +1 -1
- package/cjs/components/Switch/_size/base.js.map +1 -1
- package/cjs/components/Switch/_size/base_1tcl212.css +1 -0
- package/cjs/components/Switch/_toggleSize/base.js +9 -0
- package/cjs/components/Switch/_toggleSize/base.js.map +1 -0
- package/cjs/components/Switch/_toggleSize/base_6i0904.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_yxkf3s.css +1 -0
- package/cjs/index.css +11 -7
- package/emotion/cjs/components/Switch/Switch.js +17 -8
- package/emotion/cjs/components/Switch/Switch.styles.js +21 -5
- package/emotion/cjs/components/Switch/Switch.template-doc.mdx +37 -1
- package/emotion/cjs/components/Switch/Switch.tokens.js +11 -0
- package/emotion/cjs/components/Switch/_size/base.js +1 -1
- package/emotion/cjs/components/Switch/_toggleSize/base.js +10 -0
- package/emotion/cjs/components/Switch/_view/base.js +1 -1
- package/emotion/cjs/examples/plasma_b2c/components/Switch/Switch.config.js +11 -4
- package/emotion/cjs/examples/plasma_b2c/components/Switch/Switch.stories.tsx +7 -1
- package/emotion/cjs/examples/plasma_web/components/Switch/Switch.config.js +11 -4
- package/emotion/cjs/examples/plasma_web/components/Switch/Switch.stories.tsx +14 -1
- package/emotion/es/components/Switch/Switch.js +13 -4
- package/emotion/es/components/Switch/Switch.styles.js +20 -4
- package/emotion/es/components/Switch/Switch.template-doc.mdx +37 -1
- package/emotion/es/components/Switch/Switch.tokens.js +11 -0
- package/emotion/es/components/Switch/_size/base.js +2 -2
- package/emotion/es/components/Switch/_toggleSize/base.js +4 -0
- package/emotion/es/components/Switch/_view/base.js +2 -2
- package/emotion/es/examples/plasma_b2c/components/Switch/Switch.config.js +11 -4
- package/emotion/es/examples/plasma_b2c/components/Switch/Switch.stories.tsx +7 -1
- package/emotion/es/examples/plasma_web/components/Switch/Switch.config.js +11 -4
- package/emotion/es/examples/plasma_web/components/Switch/Switch.stories.tsx +14 -1
- package/es/components/Switch/Switch.css +11 -7
- package/es/components/Switch/Switch.js +17 -8
- package/es/components/Switch/Switch.js.map +1 -1
- package/es/components/Switch/Switch.styles.js +15 -5
- package/es/components/Switch/Switch.styles.js.map +1 -1
- package/es/components/Switch/Switch.styles_bei7bh.css +6 -0
- package/es/components/Switch/Switch.tokens.js +11 -0
- package/es/components/Switch/Switch.tokens.js.map +1 -1
- package/es/components/Switch/_focused/base.js +1 -1
- package/{cjs/components/Switch/_focused/base_j4murk.css → es/components/Switch/_focused/base_sz3n0x.css} +1 -1
- package/es/components/Switch/_size/base.js +1 -1
- package/es/components/Switch/_size/base.js.map +1 -1
- package/es/components/Switch/_size/base_1tcl212.css +1 -0
- package/es/components/Switch/_toggleSize/base.js +5 -0
- package/es/components/Switch/_toggleSize/base.js.map +1 -0
- package/es/components/Switch/_toggleSize/base_6i0904.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_yxkf3s.css +1 -0
- package/es/index.css +11 -7
- package/package.json +2 -2
- package/styled-components/cjs/components/Switch/Switch.js +17 -8
- package/styled-components/cjs/components/Switch/Switch.styles.js +11 -5
- package/styled-components/cjs/components/Switch/Switch.template-doc.mdx +37 -1
- package/styled-components/cjs/components/Switch/Switch.tokens.js +11 -0
- package/styled-components/cjs/components/Switch/_size/base.js +1 -1
- package/styled-components/cjs/components/Switch/_toggleSize/base.js +10 -0
- package/styled-components/cjs/components/Switch/_view/base.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Switch/Switch.config.js +9 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Switch/Switch.stories.tsx +7 -1
- package/styled-components/cjs/examples/plasma_web/components/Switch/Switch.config.js +9 -2
- package/styled-components/cjs/examples/plasma_web/components/Switch/Switch.stories.tsx +14 -1
- package/styled-components/es/components/Switch/Switch.js +13 -4
- package/styled-components/es/components/Switch/Switch.styles.js +10 -4
- package/styled-components/es/components/Switch/Switch.template-doc.mdx +37 -1
- package/styled-components/es/components/Switch/Switch.tokens.js +11 -0
- package/styled-components/es/components/Switch/_size/base.js +2 -2
- package/styled-components/es/components/Switch/_toggleSize/base.js +4 -0
- package/styled-components/es/components/Switch/_view/base.js +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Switch/Switch.config.js +9 -2
- package/styled-components/es/examples/plasma_b2c/components/Switch/Switch.stories.tsx +7 -1
- package/styled-components/es/examples/plasma_web/components/Switch/Switch.config.js +9 -2
- package/styled-components/es/examples/plasma_web/components/Switch/Switch.stories.tsx +14 -1
- package/types/components/Switch/Switch.d.ts +3 -0
- package/types/components/Switch/Switch.d.ts.map +1 -1
- package/types/components/Switch/Switch.styles.d.ts +2 -0
- package/types/components/Switch/Switch.styles.d.ts.map +1 -1
- package/types/components/Switch/Switch.tokens.d.ts +9 -0
- package/types/components/Switch/Switch.tokens.d.ts.map +1 -1
- package/types/components/Switch/Switch.types.d.ts +10 -2
- package/types/components/Switch/Switch.types.d.ts.map +1 -1
- package/types/components/Switch/_size/base.d.ts.map +1 -1
- package/types/components/Switch/_toggleSize/base.d.ts +2 -0
- package/types/components/Switch/_toggleSize/base.d.ts.map +1 -0
- package/types/components/Switch/_view/base.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Switch/Switch.config.d.ts +7 -0
- package/types/examples/plasma_b2c/components/Switch/Switch.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Switch/Switch.d.ts +6 -0
- package/types/examples/plasma_b2c/components/Switch/Switch.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Switch/Switch.config.d.ts +7 -0
- package/types/examples/plasma_web/components/Switch/Switch.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Switch/Switch.d.ts +6 -0
- package/types/examples/plasma_web/components/Switch/Switch.d.ts.map +1 -1
- package/cjs/components/Switch/Switch.styles_1kk0qzz.css +0 -4
- package/cjs/components/Switch/_size/base_1rjzpi4.css +0 -1
- package/cjs/components/Switch/_view/base_1mtyz12.css +0 -1
- package/es/components/Switch/Switch.styles_1kk0qzz.css +0 -4
- package/es/components/Switch/_size/base_1rjzpi4.css +0 -1
- package/es/components/Switch/_view/base_1mtyz12.css +0 -1
@@ -1,12 +1,16 @@
|
|
1
|
-
.
|
1
|
+
.base_1tcl212_bm1v11h__e2c572a3 .base_1tcl212_s10fscgc__e2c572a3{font-family:var(--plasma-switch-font-family);font-style:var(--plasma-switch-font-style);font-weight:var(--plasma-switch-font-weight);-webkit-letter-spacing:var(--plasma-switch-letter-spacing);-moz-letter-spacing:var(--plasma-switch-letter-spacing);-ms-letter-spacing:var(--plasma-switch-letter-spacing);letter-spacing:var(--plasma-switch-letter-spacing);line-height:var(--plasma-switch-line-height);font-size:var(--plasma-switch-font-size);}.base_1tcl212_bm1v11h__e2c572a3 .base_1tcl212_sdjnckq__e2c572a3{font-family:var(--plasma-switch-description-font-family);font-style:var(--plasma-switch-description-font-style);font-weight:var(--plasma-switch-description-font-weight);-webkit-letter-spacing:var(--plasma-switch-description-letter-spacing);-moz-letter-spacing:var(--plasma-switch-description-letter-spacing);-ms-letter-spacing:var(--plasma-switch-description-letter-spacing);letter-spacing:var(--plasma-switch-description-letter-spacing);line-height:var(--plasma-switch-description-line-height);font-size:var(--plasma-switch-description-font-size);}.base_1tcl212_bm1v11h__e2c572a3 .base_1tcl212_s1ilr5eq__e2c572a3{margin:var(--plasma_private-switch__label-offset,0);}
|
2
2
|
|
3
|
-
.
|
3
|
+
.base_6i0904_b1wld3h3__fa866566 .base_6i0904_s2cs3kf__fa866566{-webkit-flex:0 0 var(--plasma-switch__track-width);-ms-flex:0 0 var(--plasma-switch__track-width);flex:0 0 var(--plasma-switch__track-width);width:var(--plasma-switch__track-width);height:var(--plasma-switch__track-height);border-radius:var(--plasma-switch__track-border-radius);}.base_6i0904_b1wld3h3__fa866566 .base_6i0904_s2cs3kf__fa866566::after{width:var(--plasma-switch__thumb-size);height:var(--plasma-switch__thumb-size);border-radius:var(--plasma-switch__thumb-border-radius);margin:auto var(--plasma-switch__thumb-offset);}.base_6i0904_b1wld3h3__fa866566:active:not([disabled]) .base_6i0904_s2cs3kf__fa866566::after{width:calc(var(--plasma-switch__thumb-size) * var(--plasma-switch__thumb-scale,1));}
|
4
4
|
|
5
|
-
.
|
5
|
+
.base_yxkf3s_b1g0jmh3__d59e59a0 .base_yxkf3s_s2cs3kf__d59e59a0{background-color:var(--plasma-switch__track_checked_false-bg-color);}.base_yxkf3s_b1g0jmh3__d59e59a0 .base_yxkf3s_ssthlx1__d59e59a0:not([disabled]) ~ .base_yxkf3s_s2cs3kf__d59e59a0:hover{background-color:var(--plasma-switch__track_checked_false_hovered_true-bg-color,var(--plasma-switch__track_checked_false-bg-color));}.base_yxkf3s_b1g0jmh3__d59e59a0 .base_yxkf3s_ssthlx1__d59e59a0:checked ~ .base_yxkf3s_s2cs3kf__d59e59a0{background-color:var(--plasma-switch__track_checked_true-bg-color);}.base_yxkf3s_b1g0jmh3__d59e59a0 .base_yxkf3s_ssthlx1__d59e59a0:checked:not([disabled]) ~ .base_yxkf3s_s2cs3kf__d59e59a0:hover{background-color:var(--plasma-switch__track_checked_true_hovered_true-bg-color,var(--plasma-switch__track_checked_true-bg-color));}.base_yxkf3s_b1g0jmh3__d59e59a0 .base_yxkf3s_s2cs3kf__d59e59a0::after{background-color:var(--plasma-switch__thumb-bg-color);box-shadow:var(--plasma-switch__thumb-box-shadow);}.base_yxkf3s_b1g0jmh3__d59e59a0 .base_yxkf3s_ssthlx1__d59e59a0:checked ~ .base_yxkf3s_s2cs3kf__d59e59a0::after{box-shadow:var(--plasma-switch__thumb-box-shadow_checked_true,var(--plasma-switch__thumb-box-shadow));}.base_yxkf3s_b1g0jmh3__d59e59a0 .base_yxkf3s_s1ilr5eq__d59e59a0{color:var(--plasma-switch__label-color);}.base_yxkf3s_b1g0jmh3__d59e59a0 .base_yxkf3s_sdjnckq__d59e59a0{color:var(--plasma-switch__description-color);}
|
6
|
+
|
7
|
+
.base_sz3n0x_bvwxj2r__a36bed54 .base_sz3n0x_s2cs3kf__a36bed54::before{content:'';position:absolute;inset:-0.125rem;display:block;box-sizing:content-box;border-radius:calc(0.125rem + var(--plasma-switch__track-border-radius));border:0.125rem solid transparent;pointer-events:none;-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;}.base_sz3n0x_bvwxj2r__a36bed54 .base_sz3n0x_ssthlx1__a36bed54.base_sz3n0x_focusVisible__a36bed54 ~ .base_sz3n0x_s2cs3kf__a36bed54::before{box-shadow:0 0 0 0.125rem var(--plasma-switch__track-focus-color);}
|
6
8
|
|
7
9
|
.base_15j754u_bnochw__b189000a{opacity:var(--plasma-switch-disabled-opacity);}.base_15j754u_bnochw__b189000a[disabled]{cursor:not-allowed;}
|
8
10
|
|
9
|
-
.
|
10
|
-
.
|
11
|
-
.
|
12
|
-
.
|
11
|
+
.Switch_styles_bei7bh_b1fcyfkl__af9471a3{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:var(--plasma-switch-vertical-gap);cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}.Switch_styles_bei7bh_b1fcyfkl__af9471a3:focus{outline:0 none;}
|
12
|
+
.Switch_styles_bei7bh_s10fscgc__af9471a3{width:100%;position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.Switch_styles_bei7bh_s10fscgc__af9471a3.Switch_styles_bei7bh_switchLabelPositionBefore__af9471a3{-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;--plasma_private-switch__label-offset:0 var(--plasma-switch__label-offset) 0 0;}.Switch_styles_bei7bh_s10fscgc__af9471a3.Switch_styles_bei7bh_switchLabelPositionAfter__af9471a3{-webkit-box-pack:start;-webkit-justify-content:start;-ms-flex-pack:start;justify-content:start;-webkit-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse;--plasma_private-switch__label-offset:0 0 0 var(--plasma-switch__label-offset);}
|
13
|
+
.Switch_styles_bei7bh_sdjnckq__af9471a3{position:relative;}
|
14
|
+
.Switch_styles_bei7bh_ssthlx1__af9471a3{position:absolute;right:0;margin:0;opacity:0;}.Switch_styles_bei7bh_ssthlx1__af9471a3:focus{outline:0 none;}
|
15
|
+
.Switch_styles_bei7bh_s1ilr5eq__af9471a3{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
16
|
+
.Switch_styles_bei7bh_s2cs3kf__af9471a3{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-transition:background-color 0.15s ease-in-out 0.1s;transition:background-color 0.15s ease-in-out 0.1s;}.Switch_styles_bei7bh_s2cs3kf__af9471a3::after{content:'';position:absolute;right:auto;left:0;-webkit-transition:width 0.15s ease-in-out 0s,left 0.3s ease-in-out 0s,right 0.3s ease-in-out 0s;transition:width 0.15s ease-in-out 0s,left 0.3s ease-in-out 0s,right 0.3s ease-in-out 0s;}.Switch_styles_bei7bh_ssthlx1__af9471a3:checked ~ .Switch_styles_bei7bh_s2cs3kf__af9471a3::after{right:0;left:auto;}
|
@@ -5,24 +5,27 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
6
6
|
var React = require('react');
|
7
7
|
var base = require('./_size/base.js');
|
8
|
+
var base$2 = require('./_toggleSize/base.js');
|
8
9
|
var base$1 = require('./_view/base.js');
|
9
|
-
var base$
|
10
|
-
var base$
|
10
|
+
var base$4 = require('./_focused/base.js');
|
11
|
+
var base$3 = require('./_disabled/base.js');
|
11
12
|
var index = require('../../utils/index.js');
|
12
13
|
var Switch_styles = require('./Switch.styles.js');
|
13
14
|
var Switch_tokens = require('./Switch.tokens.js');
|
14
15
|
|
15
16
|
var _StyledTrigger;
|
16
|
-
var _excluded = ["size", "view", "focused", "outlined", "disabled", "labelPosition", "label", "id", "style", "className", "checked", "pressed", "defaultChecked"];
|
17
|
+
var _excluded = ["size", "toggleSize", "view", "focused", "outlined", "disabled", "labelPosition", "label", "description", "id", "style", "className", "checked", "pressed", "defaultChecked"];
|
17
18
|
var switchRoot = function switchRoot(Root) {
|
18
19
|
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
19
20
|
var size = props.size,
|
21
|
+
toggleSize = props.toggleSize,
|
20
22
|
view = props.view,
|
21
23
|
focused = props.focused,
|
22
24
|
outlined = props.outlined,
|
23
25
|
disabled = props.disabled,
|
24
26
|
labelPosition = props.labelPosition,
|
25
27
|
label = props.label,
|
28
|
+
description = props.description,
|
26
29
|
id = props.id,
|
27
30
|
style = props.style,
|
28
31
|
className = props.className,
|
@@ -34,12 +37,15 @@ var switchRoot = function switchRoot(Root) {
|
|
34
37
|
return /*#__PURE__*/React.createElement(Root, {
|
35
38
|
view: view,
|
36
39
|
size: size,
|
40
|
+
toggleSize: toggleSize,
|
37
41
|
disabled: disabled,
|
38
42
|
focused: focused !== null && focused !== void 0 ? focused : outlined,
|
39
43
|
labelPosition: labelPosition,
|
40
44
|
id: id,
|
41
45
|
style: style,
|
42
|
-
className: index.cx(className
|
46
|
+
className: index.cx(className)
|
47
|
+
}, /*#__PURE__*/React.createElement(Switch_styles.StyledContent, {
|
48
|
+
className: index.cx(Switch_tokens.classes["".concat(labelPosition, "SwitchLabelPosition")])
|
43
49
|
}, /*#__PURE__*/React.createElement(Switch_styles.StyledInput, _rollupPluginBabelHelpers.extends({}, rest, {
|
44
50
|
ref: ref,
|
45
51
|
role: "switch",
|
@@ -52,7 +58,7 @@ var switchRoot = function switchRoot(Root) {
|
|
52
58
|
tabIndex: -1
|
53
59
|
}, label), _StyledTrigger || (_StyledTrigger = /*#__PURE__*/React.createElement(Switch_styles.StyledTrigger, {
|
54
60
|
"aria-hidden": true
|
55
|
-
})));
|
61
|
+
}))), description && /*#__PURE__*/React.createElement(Switch_styles.StyledDescription, null, description));
|
56
62
|
});
|
57
63
|
};
|
58
64
|
var switchConfig = {
|
@@ -67,12 +73,15 @@ var switchConfig = {
|
|
67
73
|
view: {
|
68
74
|
css: base$1.base
|
69
75
|
},
|
76
|
+
toggleSize: {
|
77
|
+
css: base$2.base
|
78
|
+
},
|
70
79
|
disabled: {
|
71
|
-
css: base$
|
80
|
+
css: base$3.base,
|
72
81
|
attrs: true
|
73
82
|
},
|
74
83
|
focused: {
|
75
|
-
css: base$
|
84
|
+
css: base$4.base
|
76
85
|
}
|
77
86
|
},
|
78
87
|
defaults: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Switch.js","sources":["../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { RootProps } from '../../engines';\nimport { base as sizeCSS } from '../Switch/_size/base';\nimport { base as viewCSS } from '../Switch/_view/base';\nimport { base as focusedCSS } from '../Switch/_focused/base';\nimport { base as disabledCSS } from '../Switch/_disabled/base';\nimport { cx } from '../../utils';\n\nimport { StyledInput, StyledLabel, StyledTrigger, base } from './Switch.styles';\nimport { SwitchProps } from './Switch.types';\nimport { classes } from './Switch.tokens';\n\nexport const switchRoot = (Root: RootProps<HTMLInputElement, SwitchProps>) =>\n forwardRef<HTMLInputElement, SwitchProps>((props, ref) => {\n const {\n size,\n view,\n focused,\n outlined,\n disabled,\n labelPosition,\n\n label,\n\n id,\n style,\n className,\n\n // singleLine,\n\n checked,\n pressed,\n defaultChecked,\n\n ...rest\n } = props;\n\n const exactChecked = Boolean((checked ?? pressed) !== undefined ? checked ?? pressed : defaultChecked);\n\n return (\n <Root\n view={view}\n size={size}\n disabled={disabled}\n focused={focused ?? outlined}\n labelPosition={labelPosition}\n id={id}\n style={style}\n className={cx(className
|
1
|
+
{"version":3,"file":"Switch.js","sources":["../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { RootProps } from '../../engines';\nimport { base as sizeCSS } from '../Switch/_size/base';\nimport { base as toggleSizeCSS } from '../Switch/_toggleSize/base';\nimport { base as viewCSS } from '../Switch/_view/base';\nimport { base as focusedCSS } from '../Switch/_focused/base';\nimport { base as disabledCSS } from '../Switch/_disabled/base';\nimport { cx } from '../../utils';\n\nimport { StyledContent, StyledDescription, StyledInput, StyledLabel, StyledTrigger, base } from './Switch.styles';\nimport { SwitchProps } from './Switch.types';\nimport { classes } from './Switch.tokens';\n\nexport const switchRoot = (Root: RootProps<HTMLInputElement, SwitchProps>) =>\n forwardRef<HTMLInputElement, SwitchProps>((props, ref) => {\n const {\n size,\n toggleSize,\n view,\n focused,\n outlined,\n disabled,\n labelPosition,\n\n label,\n description,\n\n id,\n style,\n className,\n\n // singleLine,\n\n checked,\n pressed,\n defaultChecked,\n\n ...rest\n } = props;\n\n const exactChecked = Boolean((checked ?? pressed) !== undefined ? checked ?? pressed : defaultChecked);\n\n return (\n <Root\n view={view}\n size={size}\n toggleSize={toggleSize}\n disabled={disabled}\n focused={focused ?? outlined}\n labelPosition={labelPosition}\n id={id}\n style={style}\n className={cx(className)}\n >\n <StyledContent className={cx(classes[`${labelPosition}SwitchLabelPosition` as keyof typeof classes])}>\n <StyledInput\n {...rest}\n ref={ref}\n role=\"switch\"\n aria-checked={exactChecked}\n type=\"checkbox\"\n checked={checked ?? pressed}\n defaultChecked={defaultChecked}\n disabled={disabled}\n />\n <StyledLabel tabIndex={-1}>{label}</StyledLabel>\n <StyledTrigger aria-hidden />\n </StyledContent>\n {description && <StyledDescription>{description}</StyledDescription>}\n </Root>\n );\n });\n\nexport const switchConfig = {\n name: 'Switch',\n tag: 'label',\n base,\n layout: switchRoot,\n variations: {\n size: {\n css: sizeCSS,\n },\n view: {\n css: viewCSS,\n },\n toggleSize: {\n css: toggleSizeCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n focused: {\n css: focusedCSS,\n },\n },\n defaults: {\n size: 's',\n view: 'default',\n },\n};\n"],"names":["switchRoot","Root","forwardRef","props","ref","size","toggleSize","view","focused","outlined","disabled","labelPosition","label","description","id","style","className","checked","pressed","defaultChecked","rest","_objectWithoutProperties","_excluded","exactChecked","Boolean","undefined","React","createElement","cx","StyledContent","classes","concat","StyledInput","_extends","role","type","StyledLabel","tabIndex","_StyledTrigger","StyledTrigger","StyledDescription","switchConfig","name","tag","base","layout","variations","css","sizeCSS","viewCSS","toggleSizeCSS","disabledCSS","attrs","focusedCSS","defaults"],"mappings":"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"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import './Switch.
|
1
|
+
import './Switch.styles_bei7bh.css';
|
2
2
|
'use strict';
|
3
3
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
@@ -6,22 +6,34 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
6
6
|
var react = require('@linaria/react');
|
7
7
|
|
8
8
|
var base = "b1fcyfkl";
|
9
|
+
var StyledContent = /*#__PURE__*/react.styled('div')({
|
10
|
+
name: "StyledContent",
|
11
|
+
"class": "s10fscgc",
|
12
|
+
propsAsIs: false
|
13
|
+
});
|
14
|
+
var StyledDescription = /*#__PURE__*/react.styled('div')({
|
15
|
+
name: "StyledDescription",
|
16
|
+
"class": "sdjnckq",
|
17
|
+
propsAsIs: false
|
18
|
+
});
|
9
19
|
var StyledInput = /*#__PURE__*/react.styled('input')({
|
10
20
|
name: "StyledInput",
|
11
|
-
"class": "
|
21
|
+
"class": "ssthlx1",
|
12
22
|
propsAsIs: false
|
13
23
|
});
|
14
24
|
var StyledLabel = /*#__PURE__*/react.styled('span')({
|
15
25
|
name: "StyledLabel",
|
16
|
-
"class": "
|
26
|
+
"class": "s1ilr5eq",
|
17
27
|
propsAsIs: false
|
18
28
|
});
|
19
29
|
var StyledTrigger = /*#__PURE__*/react.styled('div')({
|
20
30
|
name: "StyledTrigger",
|
21
|
-
"class": "
|
31
|
+
"class": "s2cs3kf",
|
22
32
|
propsAsIs: false
|
23
33
|
});
|
24
34
|
|
35
|
+
exports.StyledContent = StyledContent;
|
36
|
+
exports.StyledDescription = StyledDescription;
|
25
37
|
exports.StyledInput = StyledInput;
|
26
38
|
exports.StyledLabel = StyledLabel;
|
27
39
|
exports.StyledTrigger = StyledTrigger;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Switch.styles.js","sources":["../../../src/components/Switch/Switch.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\nimport { css } from '@linaria/core';\n\nimport { applyEllipsis } from '../../mixins';\n\nimport { classes, tokens } from './Switch.tokens';\n\nexport const base = css`\n position: relative;\n display: flex;\n
|
1
|
+
{"version":3,"file":"Switch.styles.js","sources":["../../../src/components/Switch/Switch.styles.ts"],"sourcesContent":["import { styled } from '@linaria/react';\nimport { css } from '@linaria/core';\n\nimport { applyEllipsis } from '../../mixins';\n\nimport { classes, tokens } from './Switch.tokens';\n\nexport const base = css`\n position: relative;\n display: flex;\n flex-direction: column;\n gap: var(${tokens.verticalGap});\n\n cursor: pointer;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n\n &:focus {\n outline: 0 none;\n }\n`;\n\nexport const StyledContent = styled.div`\n width: 100%;\n position: relative;\n display: flex;\n align-items: center;\n\n &.${classes.beforeSwitchLabelPosition} {\n justify-content: space-between;\n\n ${tokens.labelOffsetPrivate}: 0 var(${tokens.labelOffset}) 0 0;\n }\n\n &.${classes.afterSwitchLabelPosition} {\n justify-content: start;\n flex-direction: row-reverse;\n\n ${tokens.labelOffsetPrivate}: 0 0 0 var(${tokens.labelOffset});\n }\n`;\n\nexport const StyledDescription = styled.div`\n position: relative;\n`;\n\nexport const StyledInput = styled.input`\n position: absolute;\n right: 0;\n margin: 0;\n opacity: 0;\n\n &:focus {\n outline: 0 none;\n }\n`;\n\nexport const StyledLabel = styled.span`\n user-select: none;\n\n // TODO: multiline switch\n ${applyEllipsis()}\n`;\n\nexport const StyledTrigger = styled.div`\n position: relative;\n display: flex;\n align-items: center;\n transition: background-color 0.15s ease-in-out 0.1s;\n\n ::after {\n content: '';\n position: absolute;\n right: auto;\n left: 0;\n\n transition: width 0.15s ease-in-out 0s, left 0.3s ease-in-out 0s, right 0.3s ease-in-out 0s;\n }\n\n ${StyledInput}:checked ~ &::after {\n right: 0;\n left: auto;\n }\n`;\n"],"names":["base","StyledContent","styled","name","class","propsAsIs","StyledDescription","StyledInput","StyledLabel","StyledTrigger"],"mappings":";;;;;;AAOO,IAAMA,IAAI,GAYhB,WAAA;AAEM,IAAMC,aAAa,gBAAGC,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,eAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAkBlC,EAAA;AAEM,IAAMC,iBAAiB,gBAAGJ,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,mBAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAEtC,EAAA;AAEM,IAAME,WAAW,gBAAGL,YAAM,CAAA,OAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,aAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAShC,EAAA;AAEM,IAAMG,WAAW,gBAAGN,YAAM,CAAA,MAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,aAAA;AAAAC,EAAAA,OAAAA,EAAA,UAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAKhC,EAAA;AAEM,IAAMI,aAAa,gBAAGP,YAAM,CAAA,KAAA,CAAA,CAAA;AAAAC,EAAAA,IAAA,EAAA,eAAA;AAAAC,EAAAA,OAAAA,EAAA,SAAA;AAAAC,EAAAA,SAAA,EAAA,KAAA;AAAA,CAmBlC;;;;;;;;;"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
.b1fcyfkl{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:var(--plasma-switch-vertical-gap);cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}.b1fcyfkl:focus{outline:0 none;}
|
2
|
+
.s10fscgc{width:100%;position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.s10fscgc.switch-label-position-before{-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;--plasma_private-switch__label-offset:0 var(--plasma-switch__label-offset) 0 0;}.s10fscgc.switch-label-position-after{-webkit-box-pack:start;-webkit-justify-content:start;-ms-flex-pack:start;justify-content:start;-webkit-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse;--plasma_private-switch__label-offset:0 0 0 var(--plasma-switch__label-offset);}
|
3
|
+
.sdjnckq{position:relative;}
|
4
|
+
.ssthlx1{position:absolute;right:0;margin:0;opacity:0;}.ssthlx1:focus{outline:0 none;}
|
5
|
+
.s1ilr5eq{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
6
|
+
.s2cs3kf{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-transition:background-color 0.15s ease-in-out 0.1s;transition:background-color 0.15s ease-in-out 0.1s;}.s2cs3kf::after{content:'';position:absolute;right:auto;left:0;-webkit-transition:width 0.15s ease-in-out 0s,left 0.3s ease-in-out 0s,right 0.3s ease-in-out 0s;transition:width 0.15s ease-in-out 0s,left 0.3s ease-in-out 0s,right 0.3s ease-in-out 0s;}.ssthlx1:checked ~ .s2cs3kf::after{right:0;left:auto;}
|
@@ -9,11 +9,22 @@ var tokens = {
|
|
9
9
|
fontWeight: '--plasma-switch-font-weight',
|
10
10
|
letterSpacing: '--plasma-switch-letter-spacing',
|
11
11
|
lineHeight: '--plasma-switch-line-height',
|
12
|
+
/* Токены description */
|
13
|
+
descriptionFontFamily: '--plasma-switch-description-font-family',
|
14
|
+
descriptionFontStyle: '--plasma-switch-description-font-style',
|
15
|
+
descriptionFontSize: '--plasma-switch-description-font-size',
|
16
|
+
descriptionFontWeight: '--plasma-switch-description-font-weight',
|
17
|
+
descriptionLetterSpacing: '--plasma-switch-description-letter-spacing',
|
18
|
+
descriptionLineHeight: '--plasma-switch-description-line-height',
|
12
19
|
/* Цвет подписи */
|
13
20
|
labelColor: '--plasma-switch__label-color',
|
14
21
|
labelOffset: '--plasma-switch__label-offset',
|
22
|
+
/* Цвет описания */
|
23
|
+
descriptionColor: '--plasma-switch__description-color',
|
24
|
+
descriptionOffset: '--plasma-switch__description-offset',
|
15
25
|
/** Прозрачность для всего компонента в состоянии disabled */
|
16
26
|
disabledOpacity: '--plasma-switch-disabled-opacity',
|
27
|
+
verticalGap: '--plasma-switch-vertical-gap',
|
17
28
|
trackWidth: '--plasma-switch__track-width',
|
18
29
|
trackHeight: '--plasma-switch__track-height',
|
19
30
|
trackBorderRadius: '--plasma-switch__track-border-radius',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Switch.tokens.js","sources":["../../../src/components/Switch/Switch.tokens.ts"],"sourcesContent":["export const tokens = {\n fontFamily: '--plasma-switch-font-family',\n fontStyle: '--plasma-switch-font-style',\n fontSize: '--plasma-switch-font-size',\n fontWeight: '--plasma-switch-font-weight',\n letterSpacing: '--plasma-switch-letter-spacing',\n lineHeight: '--plasma-switch-line-height',\n\n /* Цвет подписи */\n labelColor: '--plasma-switch__label-color',\n labelOffset: '--plasma-switch__label-offset',\n\n /** Прозрачность для всего компонента в состоянии disabled */\n disabledOpacity: '--plasma-switch-disabled-opacity',\n\n trackWidth: '--plasma-switch__track-width',\n trackHeight: '--plasma-switch__track-height',\n trackBorderRadius: '--plasma-switch__track-border-radius',\n // NOTE: could be intersection with checked\n trackBackgroundColorOn: '--plasma-switch__track_checked_true-bg-color',\n trackBackgroundColorOnHover: '--plasma-switch__track_checked_true_hovered_true-bg-color',\n trackBackgroundColorOff: '--plasma-switch__track_checked_false-bg-color',\n trackBackgroundColorOffHover: '--plasma-switch__track_checked_false_hovered_true-bg-color',\n\n trackFocusColor: '--plasma-switch__track-focus-color',\n\n thumbSize: '--plasma-switch__thumb-size',\n thumbOffset: '--plasma-switch__thumb-offset',\n thumbBorderRadius: '--plasma-switch__thumb-border-radius',\n\n thumbPressScale: '--plasma-switch__thumb-scale',\n\n thumbBackgroundColor: '--plasma-switch__thumb-bg-color',\n thumbBoxShadow: '--plasma-switch__thumb-box-shadow',\n thumbBoxShadowOn: '--plasma-switch__thumb-box-shadow_checked_true',\n\n labelOffsetPrivate: '--plasma_private-switch__label-offset',\n};\n\nexport const classes = {\n beforeSwitchLabelPosition: 'switch-label-position-before',\n afterSwitchLabelPosition: 'switch-label-position-after',\n};\n"],"names":["tokens","fontFamily","fontStyle","fontSize","fontWeight","letterSpacing","lineHeight","labelColor","labelOffset","disabledOpacity","trackWidth","trackHeight","trackBorderRadius","trackBackgroundColorOn","trackBackgroundColorOnHover","trackBackgroundColorOff","trackBackgroundColorOffHover","trackFocusColor","thumbSize","thumbOffset","thumbBorderRadius","thumbPressScale","thumbBackgroundColor","thumbBoxShadow","thumbBoxShadowOn","labelOffsetPrivate","classes","beforeSwitchLabelPosition","afterSwitchLabelPosition"],"mappings":";;;;AAAO,IAAMA,MAAM,GAAG;AAClBC,EAAAA,UAAU,EAAE,6BAA6B;AACzCC,EAAAA,SAAS,EAAE,4BAA4B;AACvCC,EAAAA,QAAQ,EAAE,2BAA2B;AACrCC,EAAAA,UAAU,EAAE,6BAA6B;AACzCC,EAAAA,aAAa,EAAE,gCAAgC;AAC/CC,EAAAA,UAAU,EAAE,6BAA6B;AAEzC;AACAC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,WAAW,EAAE,+BAA+B;AAE5C;AACAC,EAAAA,eAAe,EAAE,kCAAkC;AAEnDC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,WAAW,EAAE,+BAA+B;AAC5CC,EAAAA,iBAAiB,EAAE,sCAAsC;AACzD;AACAC,EAAAA,sBAAsB,EAAE,8CAA8C;AACtEC,EAAAA,2BAA2B,EAAE,2DAA2D;AACxFC,EAAAA,uBAAuB,EAAE,+CAA+C;AACxEC,EAAAA,4BAA4B,EAAE,4DAA4D;AAE1FC,EAAAA,eAAe,EAAE,oCAAoC;AAErDC,EAAAA,SAAS,EAAE,6BAA6B;AACxCC,EAAAA,WAAW,EAAE,+BAA+B;AAC5CC,EAAAA,iBAAiB,EAAE,sCAAsC;AAEzDC,EAAAA,eAAe,EAAE,8BAA8B;AAE/CC,EAAAA,oBAAoB,EAAE,iCAAiC;AACvDC,EAAAA,cAAc,EAAE,mCAAmC;AACnDC,EAAAA,gBAAgB,EAAE,gDAAgD;AAElEC,EAAAA,kBAAkB,EAAE,uCAAA;AACxB,EAAC;AAEM,IAAMC,OAAO,GAAG;AACnBC,EAAAA,yBAAyB,EAAE,8BAA8B;AACzDC,EAAAA,wBAAwB,EAAE,6BAAA;AAC9B;;;;;"}
|
1
|
+
{"version":3,"file":"Switch.tokens.js","sources":["../../../src/components/Switch/Switch.tokens.ts"],"sourcesContent":["export const tokens = {\n fontFamily: '--plasma-switch-font-family',\n fontStyle: '--plasma-switch-font-style',\n fontSize: '--plasma-switch-font-size',\n fontWeight: '--plasma-switch-font-weight',\n letterSpacing: '--plasma-switch-letter-spacing',\n lineHeight: '--plasma-switch-line-height',\n\n /* Токены description */\n descriptionFontFamily: '--plasma-switch-description-font-family',\n descriptionFontStyle: '--plasma-switch-description-font-style',\n descriptionFontSize: '--plasma-switch-description-font-size',\n descriptionFontWeight: '--plasma-switch-description-font-weight',\n descriptionLetterSpacing: '--plasma-switch-description-letter-spacing',\n descriptionLineHeight: '--plasma-switch-description-line-height',\n\n /* Цвет подписи */\n labelColor: '--plasma-switch__label-color',\n labelOffset: '--plasma-switch__label-offset',\n\n /* Цвет описания */\n descriptionColor: '--plasma-switch__description-color',\n descriptionOffset: '--plasma-switch__description-offset',\n\n /** Прозрачность для всего компонента в состоянии disabled */\n disabledOpacity: '--plasma-switch-disabled-opacity',\n\n verticalGap: '--plasma-switch-vertical-gap',\n trackWidth: '--plasma-switch__track-width',\n trackHeight: '--plasma-switch__track-height',\n trackBorderRadius: '--plasma-switch__track-border-radius',\n // NOTE: could be intersection with checked\n trackBackgroundColorOn: '--plasma-switch__track_checked_true-bg-color',\n trackBackgroundColorOnHover: '--plasma-switch__track_checked_true_hovered_true-bg-color',\n trackBackgroundColorOff: '--plasma-switch__track_checked_false-bg-color',\n trackBackgroundColorOffHover: '--plasma-switch__track_checked_false_hovered_true-bg-color',\n\n trackFocusColor: '--plasma-switch__track-focus-color',\n\n thumbSize: '--plasma-switch__thumb-size',\n thumbOffset: '--plasma-switch__thumb-offset',\n thumbBorderRadius: '--plasma-switch__thumb-border-radius',\n\n thumbPressScale: '--plasma-switch__thumb-scale',\n\n thumbBackgroundColor: '--plasma-switch__thumb-bg-color',\n thumbBoxShadow: '--plasma-switch__thumb-box-shadow',\n thumbBoxShadowOn: '--plasma-switch__thumb-box-shadow_checked_true',\n\n labelOffsetPrivate: '--plasma_private-switch__label-offset',\n};\n\nexport const classes = {\n beforeSwitchLabelPosition: 'switch-label-position-before',\n afterSwitchLabelPosition: 'switch-label-position-after',\n};\n"],"names":["tokens","fontFamily","fontStyle","fontSize","fontWeight","letterSpacing","lineHeight","descriptionFontFamily","descriptionFontStyle","descriptionFontSize","descriptionFontWeight","descriptionLetterSpacing","descriptionLineHeight","labelColor","labelOffset","descriptionColor","descriptionOffset","disabledOpacity","verticalGap","trackWidth","trackHeight","trackBorderRadius","trackBackgroundColorOn","trackBackgroundColorOnHover","trackBackgroundColorOff","trackBackgroundColorOffHover","trackFocusColor","thumbSize","thumbOffset","thumbBorderRadius","thumbPressScale","thumbBackgroundColor","thumbBoxShadow","thumbBoxShadowOn","labelOffsetPrivate","classes","beforeSwitchLabelPosition","afterSwitchLabelPosition"],"mappings":";;;;AAAO,IAAMA,MAAM,GAAG;AAClBC,EAAAA,UAAU,EAAE,6BAA6B;AACzCC,EAAAA,SAAS,EAAE,4BAA4B;AACvCC,EAAAA,QAAQ,EAAE,2BAA2B;AACrCC,EAAAA,UAAU,EAAE,6BAA6B;AACzCC,EAAAA,aAAa,EAAE,gCAAgC;AAC/CC,EAAAA,UAAU,EAAE,6BAA6B;AAEzC;AACAC,EAAAA,qBAAqB,EAAE,yCAAyC;AAChEC,EAAAA,oBAAoB,EAAE,wCAAwC;AAC9DC,EAAAA,mBAAmB,EAAE,uCAAuC;AAC5DC,EAAAA,qBAAqB,EAAE,yCAAyC;AAChEC,EAAAA,wBAAwB,EAAE,4CAA4C;AACtEC,EAAAA,qBAAqB,EAAE,yCAAyC;AAEhE;AACAC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,WAAW,EAAE,+BAA+B;AAE5C;AACAC,EAAAA,gBAAgB,EAAE,oCAAoC;AACtDC,EAAAA,iBAAiB,EAAE,qCAAqC;AAExD;AACAC,EAAAA,eAAe,EAAE,kCAAkC;AAEnDC,EAAAA,WAAW,EAAE,8BAA8B;AAC3CC,EAAAA,UAAU,EAAE,8BAA8B;AAC1CC,EAAAA,WAAW,EAAE,+BAA+B;AAC5CC,EAAAA,iBAAiB,EAAE,sCAAsC;AACzD;AACAC,EAAAA,sBAAsB,EAAE,8CAA8C;AACtEC,EAAAA,2BAA2B,EAAE,2DAA2D;AACxFC,EAAAA,uBAAuB,EAAE,+CAA+C;AACxEC,EAAAA,4BAA4B,EAAE,4DAA4D;AAE1FC,EAAAA,eAAe,EAAE,oCAAoC;AAErDC,EAAAA,SAAS,EAAE,6BAA6B;AACxCC,EAAAA,WAAW,EAAE,+BAA+B;AAC5CC,EAAAA,iBAAiB,EAAE,sCAAsC;AAEzDC,EAAAA,eAAe,EAAE,8BAA8B;AAE/CC,EAAAA,oBAAoB,EAAE,iCAAiC;AACvDC,EAAAA,cAAc,EAAE,mCAAmC;AACnDC,EAAAA,gBAAgB,EAAE,gDAAgD;AAElEC,EAAAA,kBAAkB,EAAE,uCAAA;AACxB,EAAC;AAEM,IAAMC,OAAO,GAAG;AACnBC,EAAAA,yBAAyB,EAAE,8BAA8B;AACzDC,EAAAA,wBAAwB,EAAE,6BAAA;AAC9B;;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
.bvwxj2r .
|
1
|
+
.bvwxj2r .s2cs3kf::before{content:'';position:absolute;inset:-0.125rem;display:block;box-sizing:content-box;border-radius:calc(0.125rem + var(--plasma-switch__track-border-radius));border:0.125rem solid transparent;pointer-events:none;-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;}.bvwxj2r .ssthlx1.focus-visible ~ .s2cs3kf::before{box-shadow:0 0 0 0.125rem var(--plasma-switch__track-focus-color);}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../src/components/Switch/_size/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { tokens } from '../Switch.tokens';\nimport {
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../src/components/Switch/_size/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { tokens } from '../Switch.tokens';\nimport { StyledContent, StyledDescription, StyledLabel } from '../Switch.styles';\n\nexport const base = css`\n ${StyledContent} {\n font-family: var(${tokens.fontFamily});\n font-style: var(${tokens.fontStyle});\n font-weight: var(${tokens.fontWeight});\n letter-spacing: var(${tokens.letterSpacing});\n line-height: var(${tokens.lineHeight});\n font-size: var(${tokens.fontSize});\n }\n\n ${StyledDescription} {\n font-family: var(${tokens.descriptionFontFamily});\n font-style: var(${tokens.descriptionFontStyle});\n font-weight: var(${tokens.descriptionFontWeight});\n letter-spacing: var(${tokens.descriptionLetterSpacing});\n line-height: var(${tokens.descriptionLineHeight});\n font-size: var(${tokens.descriptionFontSize});\n }\n\n ${StyledLabel} {\n /* check _label_position */\n margin: var(${tokens.labelOffsetPrivate}, 0);\n }\n`;\n"],"names":["base"],"mappings":";;;;AAKO,IAAMA,IAAI,GAuBhB;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
.bm1v11h .s10fscgc{font-family:var(--plasma-switch-font-family);font-style:var(--plasma-switch-font-style);font-weight:var(--plasma-switch-font-weight);-webkit-letter-spacing:var(--plasma-switch-letter-spacing);-moz-letter-spacing:var(--plasma-switch-letter-spacing);-ms-letter-spacing:var(--plasma-switch-letter-spacing);letter-spacing:var(--plasma-switch-letter-spacing);line-height:var(--plasma-switch-line-height);font-size:var(--plasma-switch-font-size);}.bm1v11h .sdjnckq{font-family:var(--plasma-switch-description-font-family);font-style:var(--plasma-switch-description-font-style);font-weight:var(--plasma-switch-description-font-weight);-webkit-letter-spacing:var(--plasma-switch-description-letter-spacing);-moz-letter-spacing:var(--plasma-switch-description-letter-spacing);-ms-letter-spacing:var(--plasma-switch-description-letter-spacing);letter-spacing:var(--plasma-switch-description-letter-spacing);line-height:var(--plasma-switch-description-line-height);font-size:var(--plasma-switch-description-font-size);}.bm1v11h .s1ilr5eq{margin:var(--plasma_private-switch__label-offset,0);}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../src/components/Switch/_toggleSize/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { tokens } from '../Switch.tokens';\nimport { StyledTrigger } from '../Switch.styles';\n\nexport const base = css`\n ${StyledTrigger} {\n flex: 0 0 var(${tokens.trackWidth});\n width: var(${tokens.trackWidth});\n height: var(${tokens.trackHeight});\n border-radius: var(${tokens.trackBorderRadius});\n\n &::after {\n width: var(${tokens.thumbSize});\n height: var(${tokens.thumbSize});\n border-radius: var(${tokens.thumbBorderRadius});\n margin: auto var(${tokens.thumbOffset});\n }\n }\n\n :active:not([disabled]) ${StyledTrigger}::after {\n width: calc(var(${tokens.thumbSize}) * var(${tokens.thumbPressScale}, 1));\n }\n`;\n"],"names":["base"],"mappings":";;;;AAKO,IAAMA,IAAI,GAkBhB;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
.b1wld3h3 .s2cs3kf{-webkit-flex:0 0 var(--plasma-switch__track-width);-ms-flex:0 0 var(--plasma-switch__track-width);flex:0 0 var(--plasma-switch__track-width);width:var(--plasma-switch__track-width);height:var(--plasma-switch__track-height);border-radius:var(--plasma-switch__track-border-radius);}.b1wld3h3 .s2cs3kf::after{width:var(--plasma-switch__thumb-size);height:var(--plasma-switch__thumb-size);border-radius:var(--plasma-switch__thumb-border-radius);margin:auto var(--plasma-switch__thumb-offset);}.b1wld3h3:active:not([disabled]) .s2cs3kf::after{width:calc(var(--plasma-switch__thumb-size) * var(--plasma-switch__thumb-scale,1));}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../src/components/Switch/_view/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { tokens } from '../Switch.tokens';\nimport { StyledTrigger, StyledInput } from '../Switch.styles';\n\nexport const base = css`\n ${StyledTrigger} {\n background-color: var(${tokens.trackBackgroundColorOff});\n }\n\n ${StyledInput}:not([disabled]) ~ ${StyledTrigger}:hover {\n background-color: var(${tokens.trackBackgroundColorOffHover}, var(${tokens.trackBackgroundColorOff}));\n }\n\n ${StyledInput}:checked ~ ${StyledTrigger} {\n background-color: var(${tokens.trackBackgroundColorOn});\n }\n\n ${StyledInput}:checked:not([disabled]) ~ ${StyledTrigger}:hover {\n background-color: var(${tokens.trackBackgroundColorOnHover}, var(${tokens.trackBackgroundColorOn}));\n }\n\n ${StyledTrigger}::after {\n background-color: var(${tokens.thumbBackgroundColor});\n box-shadow: var(${tokens.thumbBoxShadow});\n }\n\n ${StyledInput}:checked ~ ${StyledTrigger}::after {\n box-shadow: var(${tokens.thumbBoxShadowOn}, var(${tokens.thumbBoxShadow}));\n }\n`;\n"],"names":["base"],"mappings":";;;;AAKO,IAAMA,IAAI,
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../src/components/Switch/_view/base.ts"],"sourcesContent":["import { css } from '@linaria/core';\n\nimport { tokens } from '../Switch.tokens';\nimport { StyledTrigger, StyledInput, StyledLabel, StyledDescription } from '../Switch.styles';\n\nexport const base = css`\n ${StyledTrigger} {\n background-color: var(${tokens.trackBackgroundColorOff});\n }\n\n ${StyledInput}:not([disabled]) ~ ${StyledTrigger}:hover {\n background-color: var(${tokens.trackBackgroundColorOffHover}, var(${tokens.trackBackgroundColorOff}));\n }\n\n ${StyledInput}:checked ~ ${StyledTrigger} {\n background-color: var(${tokens.trackBackgroundColorOn});\n }\n\n ${StyledInput}:checked:not([disabled]) ~ ${StyledTrigger}:hover {\n background-color: var(${tokens.trackBackgroundColorOnHover}, var(${tokens.trackBackgroundColorOn}));\n }\n\n ${StyledTrigger}::after {\n background-color: var(${tokens.thumbBackgroundColor});\n box-shadow: var(${tokens.thumbBoxShadow});\n }\n\n ${StyledInput}:checked ~ ${StyledTrigger}::after {\n box-shadow: var(${tokens.thumbBoxShadowOn}, var(${tokens.thumbBoxShadow}));\n }\n\n ${StyledLabel} {\n color: var(${tokens.labelColor});\n }\n\n ${StyledDescription} {\n color: var(${tokens.descriptionColor});\n }\n`;\n"],"names":["base"],"mappings":";;;;AAKO,IAAMA,IAAI,GAiChB;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
.b1g0jmh3 .s2cs3kf{background-color:var(--plasma-switch__track_checked_false-bg-color);}.b1g0jmh3 .ssthlx1:not([disabled]) ~ .s2cs3kf:hover{background-color:var(--plasma-switch__track_checked_false_hovered_true-bg-color,var(--plasma-switch__track_checked_false-bg-color));}.b1g0jmh3 .ssthlx1:checked ~ .s2cs3kf{background-color:var(--plasma-switch__track_checked_true-bg-color);}.b1g0jmh3 .ssthlx1:checked:not([disabled]) ~ .s2cs3kf:hover{background-color:var(--plasma-switch__track_checked_true_hovered_true-bg-color,var(--plasma-switch__track_checked_true-bg-color));}.b1g0jmh3 .s2cs3kf::after{background-color:var(--plasma-switch__thumb-bg-color);box-shadow:var(--plasma-switch__thumb-box-shadow);}.b1g0jmh3 .ssthlx1:checked ~ .s2cs3kf::after{box-shadow:var(--plasma-switch__thumb-box-shadow_checked_true,var(--plasma-switch__thumb-box-shadow));}.b1g0jmh3 .s1ilr5eq{color:var(--plasma-switch__label-color);}.b1g0jmh3 .sdjnckq{color:var(--plasma-switch__description-color);}
|
package/cjs/index.css
CHANGED
@@ -214,18 +214,22 @@
|
|
214
214
|
|
215
215
|
.TextFieldGroup_styles_soj2wl_buxwmzu__0f513e82{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}
|
216
216
|
|
217
|
-
.
|
217
|
+
.base_1tcl212_bm1v11h__e2c572a3 .base_1tcl212_s10fscgc__e2c572a3{font-family:var(--plasma-switch-font-family);font-style:var(--plasma-switch-font-style);font-weight:var(--plasma-switch-font-weight);-webkit-letter-spacing:var(--plasma-switch-letter-spacing);-moz-letter-spacing:var(--plasma-switch-letter-spacing);-ms-letter-spacing:var(--plasma-switch-letter-spacing);letter-spacing:var(--plasma-switch-letter-spacing);line-height:var(--plasma-switch-line-height);font-size:var(--plasma-switch-font-size);}.base_1tcl212_bm1v11h__e2c572a3 .base_1tcl212_sdjnckq__e2c572a3{font-family:var(--plasma-switch-description-font-family);font-style:var(--plasma-switch-description-font-style);font-weight:var(--plasma-switch-description-font-weight);-webkit-letter-spacing:var(--plasma-switch-description-letter-spacing);-moz-letter-spacing:var(--plasma-switch-description-letter-spacing);-ms-letter-spacing:var(--plasma-switch-description-letter-spacing);letter-spacing:var(--plasma-switch-description-letter-spacing);line-height:var(--plasma-switch-description-line-height);font-size:var(--plasma-switch-description-font-size);}.base_1tcl212_bm1v11h__e2c572a3 .base_1tcl212_s1ilr5eq__e2c572a3{margin:var(--plasma_private-switch__label-offset,0);}
|
218
218
|
|
219
|
-
.
|
219
|
+
.base_6i0904_b1wld3h3__fa866566 .base_6i0904_s2cs3kf__fa866566{-webkit-flex:0 0 var(--plasma-switch__track-width);-ms-flex:0 0 var(--plasma-switch__track-width);flex:0 0 var(--plasma-switch__track-width);width:var(--plasma-switch__track-width);height:var(--plasma-switch__track-height);border-radius:var(--plasma-switch__track-border-radius);}.base_6i0904_b1wld3h3__fa866566 .base_6i0904_s2cs3kf__fa866566::after{width:var(--plasma-switch__thumb-size);height:var(--plasma-switch__thumb-size);border-radius:var(--plasma-switch__thumb-border-radius);margin:auto var(--plasma-switch__thumb-offset);}.base_6i0904_b1wld3h3__fa866566:active:not([disabled]) .base_6i0904_s2cs3kf__fa866566::after{width:calc(var(--plasma-switch__thumb-size) * var(--plasma-switch__thumb-scale,1));}
|
220
220
|
|
221
|
-
.
|
221
|
+
.base_yxkf3s_b1g0jmh3__d59e59a0 .base_yxkf3s_s2cs3kf__d59e59a0{background-color:var(--plasma-switch__track_checked_false-bg-color);}.base_yxkf3s_b1g0jmh3__d59e59a0 .base_yxkf3s_ssthlx1__d59e59a0:not([disabled]) ~ .base_yxkf3s_s2cs3kf__d59e59a0:hover{background-color:var(--plasma-switch__track_checked_false_hovered_true-bg-color,var(--plasma-switch__track_checked_false-bg-color));}.base_yxkf3s_b1g0jmh3__d59e59a0 .base_yxkf3s_ssthlx1__d59e59a0:checked ~ .base_yxkf3s_s2cs3kf__d59e59a0{background-color:var(--plasma-switch__track_checked_true-bg-color);}.base_yxkf3s_b1g0jmh3__d59e59a0 .base_yxkf3s_ssthlx1__d59e59a0:checked:not([disabled]) ~ .base_yxkf3s_s2cs3kf__d59e59a0:hover{background-color:var(--plasma-switch__track_checked_true_hovered_true-bg-color,var(--plasma-switch__track_checked_true-bg-color));}.base_yxkf3s_b1g0jmh3__d59e59a0 .base_yxkf3s_s2cs3kf__d59e59a0::after{background-color:var(--plasma-switch__thumb-bg-color);box-shadow:var(--plasma-switch__thumb-box-shadow);}.base_yxkf3s_b1g0jmh3__d59e59a0 .base_yxkf3s_ssthlx1__d59e59a0:checked ~ .base_yxkf3s_s2cs3kf__d59e59a0::after{box-shadow:var(--plasma-switch__thumb-box-shadow_checked_true,var(--plasma-switch__thumb-box-shadow));}.base_yxkf3s_b1g0jmh3__d59e59a0 .base_yxkf3s_s1ilr5eq__d59e59a0{color:var(--plasma-switch__label-color);}.base_yxkf3s_b1g0jmh3__d59e59a0 .base_yxkf3s_sdjnckq__d59e59a0{color:var(--plasma-switch__description-color);}
|
222
|
+
|
223
|
+
.base_sz3n0x_bvwxj2r__a36bed54 .base_sz3n0x_s2cs3kf__a36bed54::before{content:'';position:absolute;inset:-0.125rem;display:block;box-sizing:content-box;border-radius:calc(0.125rem + var(--plasma-switch__track-border-radius));border:0.125rem solid transparent;pointer-events:none;-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;}.base_sz3n0x_bvwxj2r__a36bed54 .base_sz3n0x_ssthlx1__a36bed54.base_sz3n0x_focusVisible__a36bed54 ~ .base_sz3n0x_s2cs3kf__a36bed54::before{box-shadow:0 0 0 0.125rem var(--plasma-switch__track-focus-color);}
|
222
224
|
|
223
225
|
.base_15j754u_bnochw__b189000a{opacity:var(--plasma-switch-disabled-opacity);}.base_15j754u_bnochw__b189000a[disabled]{cursor:not-allowed;}
|
224
226
|
|
225
|
-
.
|
226
|
-
.
|
227
|
-
.
|
228
|
-
.
|
227
|
+
.Switch_styles_bei7bh_b1fcyfkl__af9471a3{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:var(--plasma-switch-vertical-gap);cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}.Switch_styles_bei7bh_b1fcyfkl__af9471a3:focus{outline:0 none;}
|
228
|
+
.Switch_styles_bei7bh_s10fscgc__af9471a3{width:100%;position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.Switch_styles_bei7bh_s10fscgc__af9471a3.Switch_styles_bei7bh_switchLabelPositionBefore__af9471a3{-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;--plasma_private-switch__label-offset:0 var(--plasma-switch__label-offset) 0 0;}.Switch_styles_bei7bh_s10fscgc__af9471a3.Switch_styles_bei7bh_switchLabelPositionAfter__af9471a3{-webkit-box-pack:start;-webkit-justify-content:start;-ms-flex-pack:start;justify-content:start;-webkit-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse;--plasma_private-switch__label-offset:0 0 0 var(--plasma-switch__label-offset);}
|
229
|
+
.Switch_styles_bei7bh_sdjnckq__af9471a3{position:relative;}
|
230
|
+
.Switch_styles_bei7bh_ssthlx1__af9471a3{position:absolute;right:0;margin:0;opacity:0;}.Switch_styles_bei7bh_ssthlx1__af9471a3:focus{outline:0 none;}
|
231
|
+
.Switch_styles_bei7bh_s1ilr5eq__af9471a3{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
232
|
+
.Switch_styles_bei7bh_s2cs3kf__af9471a3{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-transition:background-color 0.15s ease-in-out 0.1s;transition:background-color 0.15s ease-in-out 0.1s;}.Switch_styles_bei7bh_s2cs3kf__af9471a3::after{content:'';position:absolute;right:auto;left:0;-webkit-transition:width 0.15s ease-in-out 0s,left 0.3s ease-in-out 0s,right 0.3s ease-in-out 0s;transition:width 0.15s ease-in-out 0s,left 0.3s ease-in-out 0s,right 0.3s ease-in-out 0s;}.Switch_styles_bei7bh_ssthlx1__af9471a3:checked ~ .Switch_styles_bei7bh_s2cs3kf__af9471a3::after{right:0;left:auto;}
|
229
233
|
|
230
234
|
.base_1sq08yf_bxoicu2__bb7a4868{width:var(--plasma-tabs-width);height:var(--plasma-tabs-height);--plasma_private-outline-radius:var(--plasma-tabs-border-radius);border-radius:var(--plasma-tabs-border-radius);}
|
231
235
|
|
@@ -7,14 +7,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
exports.switchRoot = exports.switchConfig = void 0;
|
8
8
|
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
9
|
var _base = /*#__PURE__*/require("../Switch/_size/base");
|
10
|
-
var _base2 = /*#__PURE__*/require("../Switch/
|
11
|
-
var _base3 = /*#__PURE__*/require("../Switch/
|
12
|
-
var _base4 = /*#__PURE__*/require("../Switch/
|
10
|
+
var _base2 = /*#__PURE__*/require("../Switch/_toggleSize/base");
|
11
|
+
var _base3 = /*#__PURE__*/require("../Switch/_view/base");
|
12
|
+
var _base4 = /*#__PURE__*/require("../Switch/_focused/base");
|
13
|
+
var _base5 = /*#__PURE__*/require("../Switch/_disabled/base");
|
13
14
|
var _utils = /*#__PURE__*/require("../../utils");
|
14
15
|
var _Switch = /*#__PURE__*/require("./Switch.styles");
|
15
16
|
var _Switch2 = /*#__PURE__*/require("./Switch.tokens");
|
16
17
|
var _StyledTrigger;
|
17
|
-
var _excluded = ["size", "view", "focused", "outlined", "disabled", "labelPosition", "label", "id", "style", "className", "checked", "pressed", "defaultChecked"];
|
18
|
+
var _excluded = ["size", "toggleSize", "view", "focused", "outlined", "disabled", "labelPosition", "label", "description", "id", "style", "className", "checked", "pressed", "defaultChecked"];
|
18
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
19
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
20
21
|
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); }
|
@@ -23,12 +24,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
23
24
|
var switchRoot = exports.switchRoot = function switchRoot(Root) {
|
24
25
|
return /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
25
26
|
var size = props.size,
|
27
|
+
toggleSize = props.toggleSize,
|
26
28
|
view = props.view,
|
27
29
|
focused = props.focused,
|
28
30
|
outlined = props.outlined,
|
29
31
|
disabled = props.disabled,
|
30
32
|
labelPosition = props.labelPosition,
|
31
33
|
label = props.label,
|
34
|
+
description = props.description,
|
32
35
|
id = props.id,
|
33
36
|
style = props.style,
|
34
37
|
className = props.className,
|
@@ -40,12 +43,15 @@ var switchRoot = exports.switchRoot = function switchRoot(Root) {
|
|
40
43
|
return /*#__PURE__*/_react["default"].createElement(Root, {
|
41
44
|
view: view,
|
42
45
|
size: size,
|
46
|
+
toggleSize: toggleSize,
|
43
47
|
disabled: disabled,
|
44
48
|
focused: focused !== null && focused !== void 0 ? focused : outlined,
|
45
49
|
labelPosition: labelPosition,
|
46
50
|
id: id,
|
47
51
|
style: style,
|
48
|
-
className: (0, _utils.cx)(className
|
52
|
+
className: (0, _utils.cx)(className)
|
53
|
+
}, /*#__PURE__*/_react["default"].createElement(_Switch.StyledContent, {
|
54
|
+
className: (0, _utils.cx)(_Switch2.classes["".concat(labelPosition, "SwitchLabelPosition")])
|
49
55
|
}, /*#__PURE__*/_react["default"].createElement(_Switch.StyledInput, _extends({}, rest, {
|
50
56
|
ref: ref,
|
51
57
|
role: "switch",
|
@@ -58,7 +64,7 @@ var switchRoot = exports.switchRoot = function switchRoot(Root) {
|
|
58
64
|
tabIndex: -1
|
59
65
|
}, label), _StyledTrigger || (_StyledTrigger = /*#__PURE__*/_react["default"].createElement(_Switch.StyledTrigger, {
|
60
66
|
"aria-hidden": true
|
61
|
-
})));
|
67
|
+
}))), description && /*#__PURE__*/_react["default"].createElement(_Switch.StyledDescription, null, description));
|
62
68
|
});
|
63
69
|
};
|
64
70
|
var switchConfig = exports.switchConfig = {
|
@@ -71,14 +77,17 @@ var switchConfig = exports.switchConfig = {
|
|
71
77
|
css: _base.base
|
72
78
|
},
|
73
79
|
view: {
|
80
|
+
css: _base3.base
|
81
|
+
},
|
82
|
+
toggleSize: {
|
74
83
|
css: _base2.base
|
75
84
|
},
|
76
85
|
disabled: {
|
77
|
-
css:
|
86
|
+
css: _base5.base,
|
78
87
|
attrs: true
|
79
88
|
},
|
80
89
|
focused: {
|
81
|
-
css:
|
90
|
+
css: _base4.base
|
82
91
|
}
|
83
92
|
},
|
84
93
|
defaults: {
|