@salutejs/plasma-new-hope 0.262.0-canary.1767.13257914746.0 → 0.262.0-canary.1770.13273833712.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Autocomplete/Autocomplete.css +5 -5
- package/cjs/components/Combobox/ComboboxNew/Combobox.css +5 -5
- package/cjs/components/Combobox/ComboboxOld/Combobox.css +4 -4
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +4 -4
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +4 -4
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +4 -4
- package/cjs/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +4 -4
- package/cjs/components/DatePicker/RangeDate/RangeDate.css +6 -6
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +6 -6
- package/cjs/components/DatePicker/SingleDate/SingleDate.css +5 -5
- package/cjs/components/Dropdown/Dropdown.css +4 -4
- package/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.css +4 -4
- package/cjs/components/Pagination/Pagination.css +5 -5
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +5 -5
- package/cjs/components/Popover/Popover.css +4 -4
- package/cjs/components/Popover/Popover.styles.js +1 -1
- package/cjs/components/Popover/Popover.styles.js.map +1 -1
- package/cjs/components/Popover/Popover.styles_15l7isk.css +4 -0
- package/cjs/components/Popover/Popover.tokens.js +0 -1
- package/cjs/components/Popover/Popover.tokens.js.map +1 -1
- package/cjs/components/Range/Range.css +6 -6
- package/cjs/components/Range/Range.styles.js.map +1 -1
- package/cjs/components/Range/Range.tokens.js +2 -0
- package/cjs/components/Range/Range.tokens.js.map +1 -1
- package/cjs/components/Range/variations/_readonly/base.js +1 -1
- package/cjs/components/Range/variations/_readonly/base.js.map +1 -1
- package/{es/components/Range/variations/_readonly/base_8q1gx8.css → cjs/components/Range/variations/_readonly/base_1jlqwtc.css} +1 -1
- package/cjs/components/Select/Select.css +5 -5
- package/cjs/components/Select/ui/Target/Target.css +5 -5
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.css +5 -5
- package/cjs/components/Slider/Slider.css +5 -5
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +5 -5
- package/cjs/components/TextArea/TextArea.js +9 -7
- package/cjs/components/TextArea/TextArea.js.map +1 -1
- package/cjs/components/TextArea/TextArea.tokens.js +1 -0
- package/cjs/components/TextArea/TextArea.tokens.js.map +1 -1
- package/cjs/components/TextArea/ui/Hint/Hint.css +4 -4
- package/cjs/components/TextArea/variations/_read-only/base.js +9 -0
- package/cjs/components/TextArea/variations/_read-only/base.js.map +1 -0
- package/cjs/components/TextArea/variations/_read-only/base_vx1mwu.css +1 -0
- package/cjs/components/TextField/ui/Hint/Hint.css +4 -4
- package/cjs/components/TextField/variations/_read-only/base.js +1 -1
- package/cjs/components/TextField/variations/_read-only/base.js.map +1 -1
- package/{es/components/TextField/variations/_read-only/base_oizdmx.css → cjs/components/TextField/variations/_read-only/base_bvfe3o.css} +1 -1
- package/cjs/index.css +8 -6
- package/emotion/cjs/components/Popover/Popover.styles.js +4 -4
- package/emotion/cjs/components/Popover/Popover.tokens.js +0 -1
- package/emotion/cjs/components/Range/Range.styles.js +10 -10
- package/emotion/cjs/components/Range/Range.tokens.js +2 -0
- package/emotion/cjs/components/Range/variations/_readonly/base.js +1 -1
- package/emotion/cjs/components/TextArea/TextArea.js +10 -8
- package/emotion/cjs/components/TextArea/TextArea.tokens.js +1 -0
- package/emotion/cjs/components/TextArea/variations/_read-only/base.js +10 -0
- package/emotion/cjs/components/TextArea/variations/_read-only/tokens.json +1 -0
- package/emotion/cjs/components/TextField/variations/_read-only/base.js +1 -1
- package/emotion/cjs/components/_Icon/Icon.assets/Lock.js +26 -0
- package/emotion/cjs/components/_Icon/Icons/IconLock.js +24 -0
- package/emotion/cjs/components/_Icon/index.js +7 -0
- package/emotion/cjs/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +1 -1
- package/emotion/cjs/examples/plasma_b2c/components/Popover/Popover.config.js +1 -1
- package/emotion/cjs/examples/plasma_b2c/components/Popover/Popover.stories.tsx +1 -3
- package/emotion/cjs/examples/plasma_b2c/components/Range/Range.config.js +7 -7
- package/emotion/cjs/examples/plasma_b2c/components/Range/Range.stories.tsx +1 -1
- package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.config.js +16 -13
- package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -20
- package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.config.js +22 -22
- package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +92 -26
- package/emotion/cjs/examples/plasma_web/components/Popover/Popover.config.js +1 -1
- package/emotion/cjs/examples/plasma_web/components/Popover/Popover.stories.tsx +1 -3
- package/emotion/cjs/examples/plasma_web/components/Range/Range.config.js +7 -7
- package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +72 -20
- package/emotion/cjs/examples/plasma_web/components/TextField/TextField.config.js +22 -22
- package/emotion/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +85 -25
- package/emotion/es/components/Popover/Popover.styles.js +4 -4
- package/emotion/es/components/Popover/Popover.tokens.js +0 -1
- package/emotion/es/components/Range/Range.styles.js +10 -10
- package/emotion/es/components/Range/Range.tokens.js +2 -0
- package/emotion/es/components/Range/variations/_readonly/base.js +1 -1
- package/emotion/es/components/TextArea/TextArea.js +6 -4
- package/emotion/es/components/TextArea/TextArea.tokens.js +1 -0
- package/emotion/es/components/TextArea/variations/_read-only/base.js +4 -0
- package/emotion/es/components/TextArea/variations/_read-only/tokens.json +1 -0
- package/emotion/es/components/TextField/variations/_read-only/base.js +2 -2
- package/emotion/es/components/_Icon/Icon.assets/Lock.js +19 -0
- package/emotion/es/components/_Icon/Icons/IconLock.js +17 -0
- package/emotion/es/components/_Icon/index.js +1 -0
- package/emotion/es/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +1 -1
- package/emotion/es/examples/plasma_b2c/components/Popover/Popover.config.js +1 -1
- package/emotion/es/examples/plasma_b2c/components/Popover/Popover.stories.tsx +1 -3
- package/emotion/es/examples/plasma_b2c/components/Range/Range.config.js +7 -7
- package/emotion/es/examples/plasma_b2c/components/Range/Range.stories.tsx +1 -1
- package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.config.js +16 -13
- package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -20
- package/emotion/es/examples/plasma_b2c/components/TextField/TextField.config.js +22 -22
- package/emotion/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +92 -26
- package/emotion/es/examples/plasma_web/components/Popover/Popover.config.js +1 -1
- package/emotion/es/examples/plasma_web/components/Popover/Popover.stories.tsx +1 -3
- package/emotion/es/examples/plasma_web/components/Range/Range.config.js +7 -7
- package/emotion/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +72 -20
- package/emotion/es/examples/plasma_web/components/TextField/TextField.config.js +22 -22
- package/emotion/es/examples/plasma_web/components/TextField/TextField.stories.tsx +85 -25
- package/es/components/Autocomplete/Autocomplete.css +5 -5
- package/es/components/Combobox/ComboboxNew/Combobox.css +5 -5
- package/es/components/Combobox/ComboboxOld/Combobox.css +4 -4
- package/es/components/Combobox/ComboboxOld/ui/ComboboxDivider/ComboboxDivider.css +4 -4
- package/es/components/Combobox/ComboboxOld/ui/ComboboxFooter/ComboboxFooter.css +4 -4
- package/es/components/Combobox/ComboboxOld/ui/ComboboxGroup/ComboboxGroup.css +4 -4
- package/es/components/Combobox/ComboboxOld/ui/ComboboxHeader/ComboboxHeader.css +4 -4
- package/es/components/DatePicker/RangeDate/RangeDate.css +6 -6
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +6 -6
- package/es/components/DatePicker/SingleDate/SingleDate.css +5 -5
- package/es/components/Dropdown/Dropdown.css +4 -4
- package/es/components/Dropdown/ui/DropdownOld/DropdownOld.css +4 -4
- package/es/components/Pagination/Pagination.css +5 -5
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +5 -5
- package/es/components/Popover/Popover.css +4 -4
- package/es/components/Popover/Popover.styles.js +1 -1
- package/es/components/Popover/Popover.styles.js.map +1 -1
- package/es/components/Popover/Popover.styles_15l7isk.css +4 -0
- package/es/components/Popover/Popover.tokens.js +0 -1
- package/es/components/Popover/Popover.tokens.js.map +1 -1
- package/es/components/Range/Range.css +6 -6
- package/es/components/Range/Range.styles.js.map +1 -1
- package/es/components/Range/Range.tokens.js +2 -0
- package/es/components/Range/Range.tokens.js.map +1 -1
- package/es/components/Range/variations/_readonly/base.js +1 -1
- package/es/components/Range/variations/_readonly/base.js.map +1 -1
- package/{cjs/components/Range/variations/_readonly/base_8q1gx8.css → es/components/Range/variations/_readonly/base_1jlqwtc.css} +1 -1
- package/es/components/Select/Select.css +5 -5
- package/es/components/Select/ui/Target/Target.css +5 -5
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.css +5 -5
- package/es/components/Slider/Slider.css +5 -5
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +5 -5
- package/es/components/TextArea/TextArea.js +9 -7
- package/es/components/TextArea/TextArea.js.map +1 -1
- package/es/components/TextArea/TextArea.tokens.js +1 -0
- package/es/components/TextArea/TextArea.tokens.js.map +1 -1
- package/es/components/TextArea/ui/Hint/Hint.css +4 -4
- package/es/components/TextArea/variations/_read-only/base.js +5 -0
- package/es/components/TextArea/variations/_read-only/base.js.map +1 -0
- package/es/components/TextArea/variations/_read-only/base_vx1mwu.css +1 -0
- package/es/components/TextField/ui/Hint/Hint.css +4 -4
- package/es/components/TextField/variations/_read-only/base.js +1 -1
- package/es/components/TextField/variations/_read-only/base.js.map +1 -1
- package/{cjs/components/TextField/variations/_read-only/base_oizdmx.css → es/components/TextField/variations/_read-only/base_bvfe3o.css} +1 -1
- package/es/index.css +8 -6
- package/package.json +2 -2
- package/styled-components/cjs/components/Popover/Popover.styles.js +3 -3
- package/styled-components/cjs/components/Popover/Popover.tokens.js +0 -1
- package/styled-components/cjs/components/Range/Range.tokens.js +2 -0
- package/styled-components/cjs/components/Range/variations/_readonly/base.js +1 -1
- package/styled-components/cjs/components/TextArea/TextArea.js +9 -7
- package/styled-components/cjs/components/TextArea/TextArea.tokens.js +1 -0
- package/styled-components/cjs/components/TextArea/variations/_read-only/base.js +10 -0
- package/styled-components/cjs/components/TextArea/variations/_read-only/tokens.json +1 -0
- package/styled-components/cjs/components/TextField/variations/_read-only/base.js +1 -1
- package/styled-components/cjs/components/_Icon/Icon.assets/Lock.js +26 -0
- package/styled-components/cjs/components/_Icon/Icons/IconLock.js +24 -0
- package/styled-components/cjs/components/_Icon/index.js +7 -0
- package/styled-components/cjs/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Popover/Popover.config.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Popover/Popover.stories.tsx +1 -3
- package/styled-components/cjs/examples/plasma_b2c/components/Range/Range.config.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Range/Range.stories.tsx +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.config.js +3 -0
- package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -20
- package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.config.js +7 -7
- package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +92 -26
- package/styled-components/cjs/examples/plasma_web/components/Popover/Popover.config.js +1 -1
- package/styled-components/cjs/examples/plasma_web/components/Popover/Popover.stories.tsx +1 -3
- package/styled-components/cjs/examples/plasma_web/components/Range/Range.config.js +1 -1
- package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +72 -20
- package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.config.js +7 -7
- package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +85 -25
- package/styled-components/es/components/Popover/Popover.styles.js +3 -3
- package/styled-components/es/components/Popover/Popover.tokens.js +0 -1
- package/styled-components/es/components/Range/Range.tokens.js +2 -0
- package/styled-components/es/components/Range/variations/_readonly/base.js +1 -1
- package/styled-components/es/components/TextArea/TextArea.js +5 -3
- package/styled-components/es/components/TextArea/TextArea.tokens.js +1 -0
- package/styled-components/es/components/TextArea/variations/_read-only/base.js +4 -0
- package/styled-components/es/components/TextArea/variations/_read-only/tokens.json +1 -0
- package/styled-components/es/components/TextField/variations/_read-only/base.js +2 -2
- package/styled-components/es/components/_Icon/Icon.assets/Lock.js +19 -0
- package/styled-components/es/components/_Icon/Icons/IconLock.js +17 -0
- package/styled-components/es/components/_Icon/index.js +1 -0
- package/styled-components/es/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Popover/Popover.config.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Popover/Popover.stories.tsx +1 -3
- package/styled-components/es/examples/plasma_b2c/components/Range/Range.config.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Range/Range.stories.tsx +1 -1
- package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.config.js +3 -0
- package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -20
- package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.config.js +7 -7
- package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +92 -26
- package/styled-components/es/examples/plasma_web/components/Popover/Popover.config.js +1 -1
- package/styled-components/es/examples/plasma_web/components/Popover/Popover.stories.tsx +1 -3
- package/styled-components/es/examples/plasma_web/components/Range/Range.config.js +1 -1
- package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +72 -20
- package/styled-components/es/examples/plasma_web/components/TextField/TextField.config.js +7 -7
- package/styled-components/es/examples/plasma_web/components/TextField/TextField.stories.tsx +85 -25
- package/types/components/Popover/Popover.styles.d.ts.map +1 -1
- package/types/components/Popover/Popover.tokens.d.ts +0 -1
- package/types/components/Popover/Popover.tokens.d.ts.map +1 -1
- package/types/components/Range/Range.tokens.d.ts +2 -0
- package/types/components/Range/Range.tokens.d.ts.map +1 -1
- package/types/components/Range/variations/_readonly/base.d.ts.map +1 -1
- package/types/components/TextArea/TextArea.d.ts +3 -2
- package/types/components/TextArea/TextArea.d.ts.map +1 -1
- package/types/components/TextArea/TextArea.tokens.d.ts +1 -0
- package/types/components/TextArea/TextArea.tokens.d.ts.map +1 -1
- package/types/components/TextArea/variations/_read-only/base.d.ts +2 -0
- package/types/components/TextArea/variations/_read-only/base.d.ts.map +1 -0
- package/types/components/TextField/variations/_read-only/base.d.ts.map +1 -1
- package/types/components/_Icon/Icon.assets/Lock.d.ts +4 -0
- package/types/components/_Icon/Icon.assets/Lock.d.ts.map +1 -0
- package/types/components/_Icon/Icons/IconLock.d.ts +4 -0
- package/types/components/_Icon/Icons/IconLock.d.ts.map +1 -0
- package/types/components/_Icon/index.d.ts +1 -0
- package/types/components/_Icon/index.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Popover/Popover.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Range/Range.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/TextArea/TextArea.config.d.ts +3 -0
- package/types/examples/plasma_b2c/components/TextArea/TextArea.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/TextArea/TextArea.d.ts +3 -0
- package/types/examples/plasma_b2c/components/TextArea/TextArea.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Popover/Popover.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Range/Range.config.d.ts.map +1 -1
- package/cjs/components/Popover/Popover.styles_ji8em4.css +0 -4
- package/emotion/cjs/examples/plasma_b2c/components/Popover/style.css +0 -4
- package/emotion/cjs/examples/plasma_web/components/Popover/style.css +0 -4
- package/emotion/es/examples/plasma_b2c/components/Popover/style.css +0 -4
- package/emotion/es/examples/plasma_web/components/Popover/style.css +0 -4
- package/es/components/Popover/Popover.styles_ji8em4.css +0 -4
- package/styled-components/cjs/examples/plasma_b2c/components/Popover/style.css +0 -4
- package/styled-components/cjs/examples/plasma_web/components/Popover/style.css +0 -4
- package/styled-components/es/examples/plasma_b2c/components/Popover/style.css +0 -4
- package/styled-components/es/examples/plasma_web/components/Popover/style.css +0 -4
@@ -0,0 +1,19 @@
|
|
1
|
+
var _path, _path2;
|
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
|
+
import React from 'react';
|
4
|
+
export var Lock = function Lock(props) {
|
5
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
6
|
+
width: "24",
|
7
|
+
height: "24",
|
8
|
+
viewBox: "0 0 24 24",
|
9
|
+
fill: "none"
|
10
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
11
|
+
d: "M12.0001 18C13.1046 18 14.0001 17.1046 14.0001 16C14.0001 14.8954 13.1046 14 12.0001 14C10.8955 14 10.0001 14.8954 10.0001 16C10.0001 17.1046 10.8955 18 12.0001 18Z",
|
12
|
+
fill: "currentColor"
|
13
|
+
})), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
|
14
|
+
fillRule: "evenodd",
|
15
|
+
clipRule: "evenodd",
|
16
|
+
d: "M16.7501 7V10.0056C17.0393 10.0142 17.2842 10.0359 17.5087 10.0898C18.6971 10.3751 19.625 11.3029 19.9103 12.4913C20.0005 12.8672 20.0003 13.3001 20.0001 13.9028L20.0001 17.2814C20.0001 17.9548 20.0001 18.5055 19.9635 18.9531C19.9257 19.4163 19.8449 19.8347 19.6458 20.2255C19.3342 20.837 18.837 21.3342 18.2255 21.6458C17.8348 21.8449 17.4164 21.9256 16.9531 21.9634C16.5056 22 15.9549 22 15.2815 22H8.71861C8.04524 22 7.49454 22 7.04698 21.9634C6.58372 21.9256 6.16532 21.8449 5.77458 21.6458C5.16306 21.3342 4.66587 20.837 4.35428 20.2255C4.15519 19.8347 4.07445 19.4163 4.0366 18.9531C4.00004 18.5055 4.00004 17.9548 4.00005 17.2814L4.00003 13.9029C3.99978 13.3001 3.9996 12.8672 4.08985 12.4913C4.37515 11.3029 5.30299 10.3751 6.49135 10.0898C6.7159 10.0359 6.96077 10.0142 7.25005 10.0056V7C7.25005 4.37665 9.3767 2.25 12.0001 2.25C14.6234 2.25 16.7501 4.37665 16.7501 7ZM8.75005 7C8.75005 5.20507 10.2051 3.75 12.0001 3.75C13.795 3.75 15.2501 5.20507 15.2501 7V10H8.75005V7ZM6.84152 11.5484C7.02117 11.5052 7.25947 11.5 8.00005 11.5H16.0001C16.7406 11.5 16.9789 11.5052 17.1586 11.5484C17.7985 11.702 18.2981 12.2016 18.4517 12.8415C18.4948 13.0211 18.5001 13.2594 18.5001 14V17.25C18.5001 17.9624 18.4995 18.4517 18.4685 18.8309C18.4382 19.2014 18.3827 19.4004 18.3093 19.5445C18.1415 19.8738 17.8738 20.1415 17.5445 20.3093C17.4005 20.3827 17.2015 20.4382 16.831 20.4684C16.4517 20.4994 15.9625 20.5 15.2501 20.5H8.75005C8.03761 20.5 7.54839 20.4994 7.16913 20.4684C6.79863 20.4382 6.59961 20.3827 6.45557 20.3093C6.12628 20.1415 5.85857 19.8738 5.69079 19.5445C5.6174 19.4004 5.56189 19.2014 5.53162 18.8309C5.50063 18.4517 5.50005 17.9624 5.50005 17.25V14C5.50005 13.2594 5.50527 13.0211 5.5484 12.8415C5.70203 12.2016 6.20164 11.702 6.84152 11.5484Z",
|
17
|
+
fill: "currentColor"
|
18
|
+
})));
|
19
|
+
};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Lock } from '../Icon.assets/Lock';
|
3
|
+
import { IconRoot } from '../IconRoot';
|
4
|
+
export var IconLock = function IconLock(_ref) {
|
5
|
+
var _ref$size = _ref.size,
|
6
|
+
size = _ref$size === void 0 ? 's' : _ref$size,
|
7
|
+
color = _ref.color,
|
8
|
+
className = _ref.className,
|
9
|
+
sizeCustomValue = _ref.sizeCustomValue;
|
10
|
+
return /*#__PURE__*/React.createElement(IconRoot, {
|
11
|
+
className: className,
|
12
|
+
sizeCustomValue: sizeCustomValue,
|
13
|
+
size: size,
|
14
|
+
color: color,
|
15
|
+
icon: Lock
|
16
|
+
});
|
17
|
+
};
|
@@ -5,6 +5,7 @@ export { IconDisclosureRightWithOffset } from './Icons/IconDisclosureRightWithOf
|
|
5
5
|
export { IconDisclosureDownFill } from './Icons/IconDisclosureDownFill';
|
6
6
|
export { IconDisclosureDownWithOffset } from './Icons/IconDisclosureDownWithOffset';
|
7
7
|
export { IconDisclosureUpWithOffset } from './Icons/IconDisclosureUpWithOffset';
|
8
|
+
export { IconLock } from './Icons/IconLock';
|
8
9
|
export { IconMic } from './Icons/IconMic';
|
9
10
|
export { IconChevronLeft } from './Icons/IconChevronLeft';
|
10
11
|
export { IconChevronDoubleLeft } from './Icons/IconChevronDoubleLeft';
|
package/styled-components/es/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { ComponentProps, useEffect, useRef, useState } from 'react';
|
2
2
|
import type { StoryObj, Meta } from '@storybook/react';
|
3
3
|
import { action } from '@storybook/addon-actions';
|
4
|
-
import { IconPlaceholder } from '@salutejs/plasma-sb-utils';
|
4
|
+
import { disableProps, IconPlaceholder } from '@salutejs/plasma-sb-utils';
|
5
5
|
|
6
6
|
import { WithTheme } from '../../../_helpers';
|
7
7
|
import { IconButton } from '../IconButton/IconButton';
|
@@ -6,7 +6,7 @@ export var config = {
|
|
6
6
|
},
|
7
7
|
variations: {
|
8
8
|
view: {
|
9
|
-
"default": /*#__PURE__*/css(["", ":
|
9
|
+
"default": /*#__PURE__*/css(["", ":1rem;", ":1rem;", ":url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggY2xpcC1ydWxlPSJldmVub2RkIiBkPSJtMCw5Ljg1bDE2LDBjLTQuNDEsMCAtOCwyLjY5IC04LDZjMCwtMy4zMSAtMy41OSwtNiAtOCwtNnoiIGZpbGw9IiMxNzE3MTciIGZpbGwtcnVsZT0iZXZlbm9kZCIgaWQ9IlRhaWwiLz4KPC9zdmc+\");", ":0.375rem;", ":0.5625rem;", ":var(--surface-solid-tertiary);"], popoverTokens.arrowMaskWidth, popoverTokens.arrowMaskHeight, popoverTokens.arrowMaskImage, popoverTokens.arrowHeight, popoverTokens.arrowEdgeMargin, popoverTokens.arrowBackground)
|
10
10
|
}
|
11
11
|
}
|
12
12
|
};
|
@@ -8,8 +8,6 @@ import { WithTheme } from '../../../_helpers';
|
|
8
8
|
|
9
9
|
import { Popover } from './Popover';
|
10
10
|
|
11
|
-
import './style.css';
|
12
|
-
|
13
11
|
const meta: Meta<typeof Popover> = {
|
14
12
|
title: 'b2c/Overlay/Popover',
|
15
13
|
decorators: [WithTheme],
|
@@ -83,7 +81,7 @@ type StoryPopoverProps = ComponentProps<typeof Popover> & {
|
|
83
81
|
const StyledContent = styled.div`
|
84
82
|
background: var(--surface-solid-tertiary);
|
85
83
|
padding: 1rem;
|
86
|
-
border-radius:
|
84
|
+
border-radius: 0.5rem;
|
87
85
|
|
88
86
|
display: flex;
|
89
87
|
flex-direction: column;
|
@@ -19,7 +19,7 @@ export var config = {
|
|
19
19
|
"true": /*#__PURE__*/css(["", ":0.4;"], tokens.disabledOpacity)
|
20
20
|
},
|
21
21
|
readOnly: {
|
22
|
-
"true": /*#__PURE__*/css(["", ":var(--surface-transparent-primary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-
|
22
|
+
"true": /*#__PURE__*/css(["", ":var(--surface-transparent-primary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary);", ":0.4;", ":0.4;", ":var(--text-primary);", ":transparent;", ":var(--text-secondary);"], tokens.backgroundReadOnly, tokens.labelColorReadOnly, tokens.leftHelperColorReadOnly, tokens.dividerColorReadOnly, tokens.dividerOpacityReadOnly, tokens.rightContentOpacityReadOnly, tokens.textFieldColorReadOnly, tokens.textFieldBackgroundColorReadOnly, tokens.textFieldPlaceholderColorReadOnly)
|
23
23
|
}
|
24
24
|
}
|
25
25
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { ChangeEvent, ComponentProps, Dispatch, SetStateAction, useState } from 'react';
|
2
2
|
import type { StoryObj, Meta } from '@storybook/react';
|
3
3
|
import { action } from '@storybook/addon-actions';
|
4
|
-
import { IconPlaceholder } from '@salutejs/plasma-sb-utils';
|
4
|
+
import { disableProps, IconPlaceholder } from '@salutejs/plasma-sb-utils';
|
5
5
|
|
6
6
|
import { WithTheme } from '../../../_helpers';
|
7
7
|
import { IconChevronLeft } from '../../../../components/_Icon';
|
@@ -28,6 +28,9 @@ export var config = {
|
|
28
28
|
clear: {
|
29
29
|
"true": /*#__PURE__*/css([""])
|
30
30
|
},
|
31
|
+
readOnly: {
|
32
|
+
"true": /*#__PURE__*/css(["", ":var(--text-primary);"], textAreaTokens.inputColorReadOnly)
|
33
|
+
},
|
31
34
|
disabled: {
|
32
35
|
"true": /*#__PURE__*/css(["", ":0.4;", ":var(--text-secondary);", ":var(--surface-transparent-primary);", ":var(--text-secondary);"], textAreaTokens.disabledOpacity, textAreaTokens.inputColorDisabled, textAreaTokens.dividerColorReadOnly, textAreaTokens.titleCaptionColorReadOnly)
|
33
36
|
}
|
@@ -8,6 +8,7 @@ import { textAreaConfig } from '../../../../components/TextArea';
|
|
8
8
|
import { mergeConfig } from '../../../../engines';
|
9
9
|
import { WithTheme, argTypesFromConfig } from '../../../_helpers';
|
10
10
|
import type { PopoverPlacement } from '../Popover/Popover';
|
11
|
+
import { IconLock } from '../../../../components/_Icon';
|
11
12
|
|
12
13
|
import { config } from './TextArea.config';
|
13
14
|
import { TextArea } from './TextArea';
|
@@ -38,6 +39,16 @@ const placements: Array<PopoverPlacement> = [
|
|
38
39
|
'auto',
|
39
40
|
];
|
40
41
|
|
42
|
+
const getIcon = (IconComponent: React.ReactElement, size: string, readOnly = false) => {
|
43
|
+
const iconSize = size === 'xs' ? 'xs' : 's';
|
44
|
+
|
45
|
+
if (readOnly) {
|
46
|
+
return <IconLock size={iconSize} color="var(--text-secondary)" style={{ opacity: 0.4 }} />;
|
47
|
+
}
|
48
|
+
|
49
|
+
return <IconComponent size={iconSize} color="inherit" />;
|
50
|
+
};
|
51
|
+
|
41
52
|
type StoryTextAreaPropsCustom = {
|
42
53
|
hasHint?: boolean;
|
43
54
|
enableContentRight?: boolean;
|
@@ -61,19 +72,25 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
61
72
|
control: {
|
62
73
|
type: 'boolean',
|
63
74
|
},
|
64
|
-
if: {
|
75
|
+
if: {
|
76
|
+
arg: 'optional',
|
77
|
+
truthy: false,
|
78
|
+
},
|
65
79
|
},
|
66
80
|
optional: {
|
67
81
|
control: {
|
68
82
|
type: 'boolean',
|
69
83
|
},
|
70
|
-
if: {
|
84
|
+
if: {
|
85
|
+
arg: 'required',
|
86
|
+
truthy: false,
|
87
|
+
},
|
71
88
|
},
|
72
89
|
size: {
|
73
90
|
options: sizes,
|
74
91
|
defaultValue: 'm',
|
75
92
|
control: {
|
76
|
-
type: '
|
93
|
+
type: 'inline-radio',
|
77
94
|
},
|
78
95
|
},
|
79
96
|
view: {
|
@@ -92,19 +109,28 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
92
109
|
control: {
|
93
110
|
type: 'boolean',
|
94
111
|
},
|
95
|
-
if: {
|
112
|
+
if: {
|
113
|
+
arg: 'clear',
|
114
|
+
truthy: true,
|
115
|
+
},
|
96
116
|
},
|
97
117
|
cols: {
|
98
118
|
control: {
|
99
119
|
type: 'number',
|
100
120
|
},
|
101
|
-
if: {
|
121
|
+
if: {
|
122
|
+
arg: 'clear',
|
123
|
+
truthy: false,
|
124
|
+
},
|
102
125
|
},
|
103
126
|
rows: {
|
104
127
|
control: {
|
105
128
|
type: 'number',
|
106
129
|
},
|
107
|
-
if: {
|
130
|
+
if: {
|
131
|
+
arg: 'clear',
|
132
|
+
truthy: false,
|
133
|
+
},
|
108
134
|
},
|
109
135
|
hasHint: {
|
110
136
|
control: {
|
@@ -113,47 +139,65 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
113
139
|
},
|
114
140
|
hintText: {
|
115
141
|
control: { type: 'text' },
|
116
|
-
if: {
|
142
|
+
if: {
|
143
|
+
arg: 'hasHint',
|
144
|
+
truthy: true,
|
145
|
+
},
|
117
146
|
},
|
118
147
|
hintView: {
|
119
148
|
options: hintViews,
|
120
149
|
control: {
|
121
150
|
type: 'select',
|
122
151
|
},
|
123
|
-
if: {
|
152
|
+
if: {
|
153
|
+
arg: 'hasHint',
|
154
|
+
truthy: true,
|
155
|
+
},
|
124
156
|
},
|
125
157
|
hintSize: {
|
126
158
|
options: hintSizes,
|
127
159
|
control: {
|
128
160
|
type: 'select',
|
129
161
|
},
|
130
|
-
if: {
|
162
|
+
if: {
|
163
|
+
arg: 'hasHint',
|
164
|
+
truthy: true,
|
165
|
+
},
|
131
166
|
},
|
132
167
|
hintTrigger: {
|
133
168
|
options: hintTriggers,
|
134
169
|
control: {
|
135
170
|
type: 'inline-radio',
|
136
171
|
},
|
137
|
-
if: {
|
172
|
+
if: {
|
173
|
+
arg: 'hasHint',
|
174
|
+
truthy: true,
|
175
|
+
},
|
138
176
|
},
|
139
177
|
hintPlacement: {
|
140
178
|
options: placements,
|
141
179
|
control: {
|
142
180
|
type: 'select',
|
143
181
|
},
|
144
|
-
if: {
|
182
|
+
if: {
|
183
|
+
arg: 'hasHint',
|
184
|
+
truthy: true,
|
185
|
+
},
|
145
186
|
mappers: placements,
|
146
187
|
},
|
147
188
|
hintHasArrow: {
|
148
189
|
control: { type: 'boolean' },
|
149
|
-
if: {
|
190
|
+
if: {
|
191
|
+
arg: 'hasHint',
|
192
|
+
truthy: true,
|
193
|
+
},
|
150
194
|
},
|
151
195
|
hintWidth: {
|
152
196
|
control: { type: 'text' },
|
153
|
-
if: {
|
154
|
-
|
155
|
-
|
156
|
-
|
197
|
+
if: {
|
198
|
+
arg: 'hasHint',
|
199
|
+
truthy: true,
|
200
|
+
},
|
157
201
|
},
|
158
202
|
width: {
|
159
203
|
control: { type: 'text' },
|
@@ -172,6 +216,7 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
172
216
|
},
|
173
217
|
...disableProps([
|
174
218
|
'helperBlock',
|
219
|
+
'helperText',
|
175
220
|
'$isFocused',
|
176
221
|
'contentRight',
|
177
222
|
'autoComplete',
|
@@ -195,6 +240,7 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
195
240
|
'hintOffset',
|
196
241
|
'hintContentLeft',
|
197
242
|
'hintView',
|
243
|
+
'hintOpened',
|
198
244
|
]),
|
199
245
|
},
|
200
246
|
args: {
|
@@ -238,19 +284,24 @@ const onBlur = action('onBlur');
|
|
238
284
|
const StoryDefault = (props: StoryTextAreaProps) => {
|
239
285
|
const [value, setValue] = useState('Значение поля');
|
240
286
|
|
241
|
-
const iconSize = props.size === 'xs' ? 'xs' : 's';
|
242
|
-
|
243
287
|
return (
|
244
288
|
<TextArea
|
245
289
|
value={value}
|
246
|
-
contentRight={
|
290
|
+
contentRight={
|
291
|
+
props.enableContentRight || props.readOnly
|
292
|
+
? getIcon(IconPlaceholder, props.size, props.readOnly)
|
293
|
+
: undefined
|
294
|
+
}
|
247
295
|
onChange={(e) => {
|
248
296
|
setValue(e.target.value);
|
249
297
|
onChange(e);
|
250
298
|
}}
|
251
299
|
onFocus={onFocus}
|
252
300
|
onBlur={onBlur}
|
253
|
-
style={{
|
301
|
+
style={{
|
302
|
+
width: '70%',
|
303
|
+
margin: '0 auto',
|
304
|
+
}}
|
254
305
|
{...props}
|
255
306
|
/>
|
256
307
|
);
|
@@ -27,12 +27,12 @@ export var config = {
|
|
27
27
|
"true": /*#__PURE__*/css([""])
|
28
28
|
},
|
29
29
|
chipView: {
|
30
|
-
"default": /*#__PURE__*/css(["", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-hover);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-active);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--inverse-text-secondary);", ":
|
31
|
-
secondary: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-primary);", ":var(--surface-transparent-secondary-active);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--text-secondary);", ":
|
32
|
-
accent: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent-hover);", ":var(--on-dark-text-primary);", ":var(--surface-accent-active);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":
|
33
|
-
positive: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--surface-positive-hover);", ":var(--on-dark-text-primary);", ":var(--surface-positive-active);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":
|
34
|
-
warning: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":var(--surface-warning-hover);", ":var(--on-dark-text-primary);", ":var(--surface-warning-active);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":
|
35
|
-
negative: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--surface-negative-hover);", ":var(--on-dark-text-primary);", ":var(--surface-negative-active);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":
|
30
|
+
"default": /*#__PURE__*/css(["", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-hover);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-active);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--inverse-text-secondary);", ":1;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly),
|
31
|
+
secondary: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-primary);", ":var(--surface-transparent-secondary-active);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--text-secondary);", ":1;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly),
|
32
|
+
accent: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent-hover);", ":var(--on-dark-text-primary);", ":var(--surface-accent-active);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":1;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly),
|
33
|
+
positive: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--surface-positive-hover);", ":var(--on-dark-text-primary);", ":var(--surface-positive-active);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":1;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly),
|
34
|
+
warning: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":var(--surface-warning-hover);", ":var(--on-dark-text-primary);", ":var(--surface-warning-active);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":1;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly),
|
35
|
+
negative: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--surface-negative-hover);", ":var(--on-dark-text-primary);", ":var(--surface-negative-active);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":1;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly)
|
36
36
|
},
|
37
37
|
hintView: {
|
38
38
|
"default": /*#__PURE__*/css(["", ":var(--surface-solid-card-brightness);", ":var(--shadow-down-hard-m,0px 4px 12px 0px rgba(0,0,0,0.16),0px 1px 4px 0px rgba(0,0,0,0.08));", ":var(--text-primary);", ":var(--surface-solid-card);"], tokens.tooltipBackgroundColor, tokens.tooltipBoxShadow, tokens.tooltipColor, tokens.tooltipArrowBackground)
|
@@ -45,7 +45,7 @@ export var config = {
|
|
45
45
|
"true": /*#__PURE__*/css(["", ":0.4;"], tokens.disabledOpacity)
|
46
46
|
},
|
47
47
|
readOnly: {
|
48
|
-
"true": /*#__PURE__*/css(["", ":var(--text-
|
48
|
+
"true": /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--surface-transparent-primary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--surface-transparent-primary);"], tokens.colorReadOnly, tokens.backgroundColorReadOnly, tokens.placeholderColorReadOnly, tokens.leftHelperColorReadOnly, tokens.titleCaptionColorReadOnly, tokens.labelColorReadOnly, tokens.dividerColorReadOnly)
|
49
49
|
}
|
50
50
|
}
|
51
51
|
};
|
@@ -4,7 +4,7 @@ import { action } from '@storybook/addon-actions';
|
|
4
4
|
import { IconPlaceholder } from '@salutejs/plasma-sb-utils';
|
5
5
|
|
6
6
|
import { WithTheme } from '../../../_helpers';
|
7
|
-
import { IconCross } from '../../../../components/_Icon';
|
7
|
+
import { IconCross, IconLock } from '../../../../components/_Icon';
|
8
8
|
import type { PopoverPlacement } from '../Popover/Popover';
|
9
9
|
|
10
10
|
import { TextField } from './TextField';
|
@@ -21,8 +21,8 @@ const chipViews = ['default', 'secondary', 'accent', 'positive', 'warning', 'neg
|
|
21
21
|
const hintViews = ['default'];
|
22
22
|
const hintSizes = ['m', 's'];
|
23
23
|
const hintTriggers = ['hover', 'click'];
|
24
|
-
const labelPlacements = ['outer', 'inner'];
|
25
24
|
const hintTargetPlacements = ['outer', 'inner'];
|
25
|
+
const labelPlacements = ['outer', 'inner'];
|
26
26
|
const placements: Array<PopoverPlacement> = [
|
27
27
|
'top',
|
28
28
|
'top-start',
|
@@ -43,6 +43,16 @@ const placements: Array<PopoverPlacement> = [
|
|
43
43
|
'auto',
|
44
44
|
];
|
45
45
|
|
46
|
+
const getIcon = (IconComponent: React.ReactElement, size: string, readOnly = false) => {
|
47
|
+
const iconSize = size === 'xs' ? 'xs' : 's';
|
48
|
+
|
49
|
+
if (readOnly) {
|
50
|
+
return <IconLock size={iconSize} color="var(--text-secondary)" style={{ opacity: 0.4 }} />;
|
51
|
+
}
|
52
|
+
|
53
|
+
return <IconComponent size={iconSize} color="inherit" />;
|
54
|
+
};
|
55
|
+
|
46
56
|
const meta: Meta<typeof TextField> = {
|
47
57
|
title: 'b2c/Data Entry/TextField',
|
48
58
|
component: TextField,
|
@@ -58,19 +68,28 @@ const meta: Meta<typeof TextField> = {
|
|
58
68
|
control: {
|
59
69
|
type: 'boolean',
|
60
70
|
},
|
61
|
-
if: {
|
71
|
+
if: {
|
72
|
+
arg: 'optional',
|
73
|
+
truthy: false,
|
74
|
+
},
|
62
75
|
},
|
63
76
|
optional: {
|
64
77
|
control: {
|
65
78
|
type: 'boolean',
|
66
79
|
},
|
67
|
-
if: {
|
80
|
+
if: {
|
81
|
+
arg: 'required',
|
82
|
+
truthy: false,
|
83
|
+
},
|
68
84
|
},
|
69
85
|
hasDivider: {
|
70
86
|
control: {
|
71
87
|
type: 'boolean',
|
72
88
|
},
|
73
|
-
if: {
|
89
|
+
if: {
|
90
|
+
arg: 'clear',
|
91
|
+
truthy: true,
|
92
|
+
},
|
74
93
|
},
|
75
94
|
view: {
|
76
95
|
options: views,
|
@@ -93,7 +112,10 @@ const meta: Meta<typeof TextField> = {
|
|
93
112
|
control: {
|
94
113
|
type: 'boolean',
|
95
114
|
},
|
96
|
-
if: {
|
115
|
+
if: {
|
116
|
+
arg: 'labelPlacement',
|
117
|
+
eq: 'inner',
|
118
|
+
},
|
97
119
|
},
|
98
120
|
size: {
|
99
121
|
options: sizes,
|
@@ -101,53 +123,83 @@ const meta: Meta<typeof TextField> = {
|
|
101
123
|
type: 'inline-radio',
|
102
124
|
},
|
103
125
|
},
|
126
|
+
titleCaption: {
|
127
|
+
control: { type: 'text' },
|
128
|
+
},
|
129
|
+
leftHelper: {
|
130
|
+
control: { type: 'text' },
|
131
|
+
},
|
104
132
|
hintText: {
|
105
133
|
control: { type: 'text' },
|
106
|
-
if: {
|
134
|
+
if: {
|
135
|
+
arg: 'hasHint',
|
136
|
+
truthy: true,
|
137
|
+
},
|
107
138
|
},
|
108
139
|
hintView: {
|
109
140
|
options: hintViews,
|
110
141
|
control: {
|
111
142
|
type: 'select',
|
112
143
|
},
|
113
|
-
if: {
|
144
|
+
if: {
|
145
|
+
arg: 'hasHint',
|
146
|
+
truthy: true,
|
147
|
+
},
|
114
148
|
},
|
115
149
|
hintSize: {
|
116
150
|
options: hintSizes,
|
117
151
|
control: {
|
118
152
|
type: 'select',
|
119
153
|
},
|
120
|
-
if: {
|
154
|
+
if: {
|
155
|
+
arg: 'hasHint',
|
156
|
+
truthy: true,
|
157
|
+
},
|
121
158
|
},
|
122
159
|
hintTargetPlacement: {
|
123
160
|
options: hintTargetPlacements,
|
124
161
|
control: {
|
125
162
|
type: 'inline-radio',
|
126
163
|
},
|
127
|
-
if: {
|
164
|
+
if: {
|
165
|
+
arg: 'hasHint',
|
166
|
+
truthy: true,
|
167
|
+
},
|
128
168
|
},
|
129
169
|
hintTrigger: {
|
130
170
|
options: hintTriggers,
|
131
171
|
control: {
|
132
172
|
type: 'inline-radio',
|
133
173
|
},
|
134
|
-
if: {
|
174
|
+
if: {
|
175
|
+
arg: 'hasHint',
|
176
|
+
truthy: true,
|
177
|
+
},
|
135
178
|
},
|
136
179
|
hintPlacement: {
|
137
180
|
options: placements,
|
138
181
|
control: {
|
139
182
|
type: 'select',
|
140
183
|
},
|
141
|
-
if: {
|
184
|
+
if: {
|
185
|
+
arg: 'hasHint',
|
186
|
+
truthy: true,
|
187
|
+
},
|
142
188
|
mappers: placements,
|
143
189
|
},
|
144
190
|
hintHasArrow: {
|
145
191
|
control: { type: 'boolean' },
|
146
|
-
if: {
|
192
|
+
if: {
|
193
|
+
arg: 'hasHint',
|
194
|
+
truthy: true,
|
195
|
+
},
|
147
196
|
},
|
148
197
|
hintWidth: {
|
149
198
|
control: { type: 'text' },
|
150
|
-
if: {
|
199
|
+
if: {
|
200
|
+
arg: 'hasHint',
|
201
|
+
truthy: true,
|
202
|
+
},
|
151
203
|
},
|
152
204
|
chipType: {
|
153
205
|
control: 'select',
|
@@ -183,19 +235,28 @@ type StoryPropsDefault = Omit<
|
|
183
235
|
enableContentRight: boolean;
|
184
236
|
};
|
185
237
|
|
186
|
-
const StoryDemo = ({ enableContentLeft, enableContentRight, view, ...rest }: StoryPropsDefault) => {
|
238
|
+
const StoryDemo = ({ enableContentLeft, enableContentRight, view, readOnly, ...rest }: StoryPropsDefault) => {
|
187
239
|
const [text, setText] = useState('Значение поля');
|
188
240
|
|
189
|
-
const
|
241
|
+
const contentRight = enableContentRight || readOnly ? getIcon(IconCross, rest.size, readOnly) : undefined;
|
190
242
|
|
191
243
|
return (
|
192
|
-
<div
|
244
|
+
<div
|
245
|
+
style={{
|
246
|
+
display: 'flex',
|
247
|
+
flexDirection: 'column',
|
248
|
+
gap: '2rem',
|
249
|
+
width: '70%',
|
250
|
+
margin: '0 auto',
|
251
|
+
}}
|
252
|
+
>
|
193
253
|
<TextField
|
194
254
|
{...rest}
|
195
255
|
enumerationType="plain"
|
196
256
|
value={text}
|
197
|
-
|
198
|
-
|
257
|
+
readOnly={readOnly}
|
258
|
+
contentLeft={enableContentLeft ? getIcon(IconPlaceholder, rest.size) : undefined}
|
259
|
+
contentRight={contentRight}
|
199
260
|
view={view}
|
200
261
|
onChange={(e) => {
|
201
262
|
setText(e.target.value);
|
@@ -211,9 +272,10 @@ const StoryDemo = ({ enableContentLeft, enableContentRight, view, ...rest }: Sto
|
|
211
272
|
label="Uncontrolled TextField"
|
212
273
|
defaultValue="Дефолтное значение"
|
213
274
|
enumerationType="plain"
|
214
|
-
contentLeft={enableContentLeft ?
|
215
|
-
contentRight={
|
275
|
+
contentLeft={enableContentLeft ? getIcon(IconPlaceholder, rest.size) : undefined}
|
276
|
+
contentRight={contentRight}
|
216
277
|
view={view}
|
278
|
+
readOnly={readOnly}
|
217
279
|
onFocus={onFocus}
|
218
280
|
onBlur={onBlur}
|
219
281
|
onSearch={onSearch}
|
@@ -285,10 +347,10 @@ type StoryPropsChips = Omit<
|
|
285
347
|
enableContentRight: boolean;
|
286
348
|
};
|
287
349
|
|
288
|
-
const StoryChips = ({ enableContentLeft, enableContentRight, view, ...rest }: StoryPropsChips) => {
|
350
|
+
const StoryChips = ({ enableContentLeft, enableContentRight, view, readOnly, ...rest }: StoryPropsChips) => {
|
289
351
|
const [text, setText] = useState('Значение поля');
|
290
352
|
|
291
|
-
const
|
353
|
+
const contentRight = enableContentRight || readOnly ? getIcon(IconCross, rest.size, readOnly) : undefined;
|
292
354
|
|
293
355
|
const validateChip = (value) => (value === '1 value' ? { view: 'negative' } : {});
|
294
356
|
|
@@ -297,9 +359,10 @@ const StoryChips = ({ enableContentLeft, enableContentRight, view, ...rest }: St
|
|
297
359
|
{...rest}
|
298
360
|
enumerationType="chip"
|
299
361
|
value={text}
|
300
|
-
contentLeft={enableContentLeft ?
|
301
|
-
contentRight={
|
362
|
+
contentLeft={enableContentLeft ? getIcon(IconPlaceholder, rest.size) : undefined}
|
363
|
+
contentRight={contentRight}
|
302
364
|
view={view}
|
365
|
+
readOnly={readOnly}
|
303
366
|
onChange={(e) => {
|
304
367
|
setText(e.target.value);
|
305
368
|
onChange(e.target.value);
|
@@ -308,7 +371,10 @@ const StoryChips = ({ enableContentLeft, enableContentRight, view, ...rest }: St
|
|
308
371
|
onBlur={onBlur}
|
309
372
|
onChangeChips={onChipsChange}
|
310
373
|
chipValidator={validateChip}
|
311
|
-
style={{
|
374
|
+
style={{
|
375
|
+
width: '70%',
|
376
|
+
margin: '0 auto',
|
377
|
+
}}
|
312
378
|
/>
|
313
379
|
);
|
314
380
|
};
|
@@ -6,7 +6,7 @@ export var config = {
|
|
6
6
|
},
|
7
7
|
variations: {
|
8
8
|
view: {
|
9
|
-
"default": /*#__PURE__*/css(["", ":
|
9
|
+
"default": /*#__PURE__*/css(["", ":1rem;", ":1rem;", ":url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggY2xpcC1ydWxlPSJldmVub2RkIiBkPSJtMCw5Ljg1bDE2LDBjLTQuNDEsMCAtOCwyLjY5IC04LDZjMCwtMy4zMSAtMy41OSwtNiAtOCwtNnoiIGZpbGw9IiMxNzE3MTciIGZpbGwtcnVsZT0iZXZlbm9kZCIgaWQ9IlRhaWwiLz4KPC9zdmc+\");", ":0.375rem;", ":0.5625rem;", ":var(--surface-solid-tertiary);"], popoverTokens.arrowMaskWidth, popoverTokens.arrowMaskHeight, popoverTokens.arrowMaskImage, popoverTokens.arrowHeight, popoverTokens.arrowEdgeMargin, popoverTokens.arrowBackground)
|
10
10
|
}
|
11
11
|
}
|
12
12
|
};
|