@salutejs/plasma-new-hope 0.178.0-canary.1514.11575933383.0 → 0.178.0-dev.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Counter/Counter.css +1 -1
- package/cjs/components/Counter/Counter.js +3 -13
- package/cjs/components/Counter/Counter.js.map +1 -1
- package/cjs/components/Counter/Counter.tokens.js +0 -4
- package/cjs/components/Counter/Counter.tokens.js.map +1 -1
- package/cjs/components/Counter/variations/_size/base.js +1 -1
- package/cjs/components/Counter/variations/_size/base.js.map +1 -1
- package/cjs/components/Counter/variations/_size/{base_4mz17d.css → base_1z0ohiy.css} +1 -1
- package/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
- package/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
- package/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
- package/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
- package/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +4 -2
- package/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js.map +1 -1
- package/cjs/components/Popover/Popover.js +2 -1
- package/cjs/components/Popover/Popover.js.map +1 -1
- package/cjs/index.css +1 -1
- package/emotion/cjs/components/Counter/Counter.js +3 -13
- package/emotion/cjs/components/Counter/Counter.template-doc.mdx +2 -2
- package/emotion/cjs/components/Counter/Counter.tokens.js +1 -4
- package/emotion/cjs/components/Counter/variations/_size/base.js +1 -1
- package/emotion/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
- package/emotion/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
- package/emotion/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
- package/emotion/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
- package/emotion/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +6 -4
- package/emotion/cjs/components/Popover/Popover.js +2 -1
- package/emotion/cjs/examples/plasma_b2c/components/Counter/Counter.config.js +9 -12
- package/emotion/cjs/examples/plasma_b2c/components/Counter/Counter.stories.tsx +5 -7
- package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +9 -6
- package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -6
- package/emotion/cjs/examples/plasma_web/components/Counter/Counter.config.js +9 -12
- package/emotion/cjs/examples/plasma_web/components/Counter/Counter.stories.tsx +5 -7
- package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +9 -6
- package/emotion/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -6
- package/emotion/es/components/Counter/Counter.js +3 -13
- package/emotion/es/components/Counter/Counter.template-doc.mdx +2 -2
- package/emotion/es/components/Counter/Counter.tokens.js +0 -3
- package/emotion/es/components/Counter/variations/_size/base.js +2 -2
- package/emotion/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
- package/emotion/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
- package/emotion/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
- package/emotion/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
- package/emotion/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +4 -2
- package/emotion/es/components/Popover/Popover.js +2 -1
- package/emotion/es/examples/plasma_b2c/components/Counter/Counter.config.js +9 -12
- package/emotion/es/examples/plasma_b2c/components/Counter/Counter.stories.tsx +5 -7
- package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +9 -6
- package/emotion/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -6
- package/emotion/es/examples/plasma_web/components/Counter/Counter.config.js +9 -12
- package/emotion/es/examples/plasma_web/components/Counter/Counter.stories.tsx +5 -7
- package/emotion/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +9 -6
- package/emotion/es/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -6
- package/es/components/Counter/Counter.css +1 -1
- package/es/components/Counter/Counter.js +3 -13
- package/es/components/Counter/Counter.js.map +1 -1
- package/es/components/Counter/Counter.tokens.js +1 -4
- package/es/components/Counter/Counter.tokens.js.map +1 -1
- package/es/components/Counter/variations/_size/base.js +1 -1
- package/es/components/Counter/variations/_size/base.js.map +1 -1
- package/es/components/Counter/variations/_size/{base_4mz17d.css → base_1z0ohiy.css} +1 -1
- package/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
- package/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
- package/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
- package/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
- package/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +4 -2
- package/es/components/Dropdown/ui/DropdownOld/DropdownOld.js.map +1 -1
- package/es/components/Popover/Popover.js +2 -1
- package/es/components/Popover/Popover.js.map +1 -1
- package/es/index.css +1 -1
- package/package.json +4 -4
- package/styled-components/cjs/components/Counter/Counter.js +3 -13
- package/styled-components/cjs/components/Counter/Counter.template-doc.mdx +2 -2
- package/styled-components/cjs/components/Counter/Counter.tokens.js +1 -4
- package/styled-components/cjs/components/Counter/variations/_size/base.js +1 -1
- package/styled-components/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
- package/styled-components/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
- package/styled-components/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
- package/styled-components/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
- package/styled-components/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +6 -4
- package/styled-components/cjs/components/Popover/Popover.js +2 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Counter/Counter.config.js +2 -5
- package/styled-components/cjs/examples/plasma_b2c/components/Counter/Counter.stories.tsx +5 -7
- package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +9 -6
- package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -6
- package/styled-components/cjs/examples/plasma_web/components/Counter/Counter.config.js +2 -5
- package/styled-components/cjs/examples/plasma_web/components/Counter/Counter.stories.tsx +5 -7
- package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +9 -6
- package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -6
- package/styled-components/es/components/Counter/Counter.js +3 -13
- package/styled-components/es/components/Counter/Counter.template-doc.mdx +2 -2
- package/styled-components/es/components/Counter/Counter.tokens.js +0 -3
- package/styled-components/es/components/Counter/variations/_size/base.js +2 -2
- package/styled-components/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
- package/styled-components/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
- package/styled-components/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
- package/styled-components/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
- package/styled-components/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +4 -2
- package/styled-components/es/components/Popover/Popover.js +2 -1
- package/styled-components/es/examples/plasma_b2c/components/Counter/Counter.config.js +2 -5
- package/styled-components/es/examples/plasma_b2c/components/Counter/Counter.stories.tsx +5 -7
- package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +9 -6
- package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -6
- package/styled-components/es/examples/plasma_web/components/Counter/Counter.config.js +2 -5
- package/styled-components/es/examples/plasma_web/components/Counter/Counter.stories.tsx +5 -7
- package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +9 -6
- package/styled-components/es/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -6
- package/types/components/Counter/Counter.d.ts.map +1 -1
- package/types/components/Counter/Counter.tokens.d.ts +0 -3
- package/types/components/Counter/Counter.tokens.d.ts.map +1 -1
- package/types/components/Counter/Counter.types.d.ts +2 -2
- package/types/components/Counter/variations/_size/base.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownDivider/DropdownDivider.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownFooter/DropdownFooter.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownGroup/DropdownGroup.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownHeader/DropdownHeader.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownOld/DropdownOld.d.ts.map +1 -1
- package/types/components/Popover/Popover.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Counter/Counter.config.d.ts +0 -3
- package/types/examples/plasma_b2c/components/Counter/Counter.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Counter/Counter.d.ts +0 -3
- package/types/examples/plasma_b2c/components/Counter/Counter.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Counter/Counter.config.d.ts +0 -3
- package/types/examples/plasma_web/components/Counter/Counter.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Counter/Counter.d.ts +0 -3
- package/types/examples/plasma_web/components/Counter/Counter.d.ts.map +1 -1
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
});
|
7
7
|
exports.dropdownGroupRoot = exports.dropdownGroupConfig = void 0;
|
8
8
|
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
|
-
var
|
9
|
+
var _utils = /*#__PURE__*/require("../../../../utils");
|
10
10
|
var _base = /*#__PURE__*/require("./variations/_view/base");
|
11
11
|
var _base2 = /*#__PURE__*/require("./variations/_size/base");
|
12
12
|
var _DropdownGroup = /*#__PURE__*/require("./DropdownGroup.styles");
|
@@ -30,7 +30,7 @@ var dropdownGroupRoot = exports.dropdownGroupRoot = function dropdownGroupRoot(R
|
|
30
30
|
view = _ref.view,
|
31
31
|
size = _ref.size,
|
32
32
|
rest = _objectWithoutProperties(_ref, _excluded);
|
33
|
-
var uniqId = (0,
|
33
|
+
var uniqId = (0, _utils.safeUseId)();
|
34
34
|
var innerId = id || uniqId;
|
35
35
|
return /*#__PURE__*/_react["default"].createElement(Root, {
|
36
36
|
id: innerId,
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
});
|
7
7
|
exports.dropdownHeaderRoot = exports.dropdownHeaderConfig = void 0;
|
8
8
|
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
|
-
var
|
9
|
+
var _utils = /*#__PURE__*/require("../../../../utils");
|
10
10
|
var _base = /*#__PURE__*/require("./variations/_view/base");
|
11
11
|
var _base2 = /*#__PURE__*/require("./variations/_size/base");
|
12
12
|
var _DropdownHeader = /*#__PURE__*/require("./DropdownHeader.styles");
|
@@ -27,7 +27,7 @@ var dropdownHeaderRoot = exports.dropdownHeaderRoot = function dropdownHeaderRoo
|
|
27
27
|
size = _ref.size,
|
28
28
|
children = _ref.children,
|
29
29
|
rest = _objectWithoutProperties(_ref, _excluded);
|
30
|
-
var uniqId = (0,
|
30
|
+
var uniqId = (0, _utils.safeUseId)();
|
31
31
|
var innerId = id || uniqId;
|
32
32
|
return /*#__PURE__*/_react["default"].createElement(Root, {
|
33
33
|
id: innerId,
|
@@ -7,10 +7,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
exports.dropdownOldRoot = exports.dropdownOldConfig = void 0;
|
8
8
|
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
9
|
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
10
|
+
var _hooks = /*#__PURE__*/require("../../../../hooks");
|
11
|
+
var _utils = /*#__PURE__*/require("../../../../utils");
|
10
12
|
var _base = /*#__PURE__*/require("./variations/_view/base");
|
11
13
|
var _base2 = /*#__PURE__*/require("./variations/_size/base");
|
12
14
|
var _Dropdown = /*#__PURE__*/require("./Dropdown.styles");
|
13
|
-
var
|
15
|
+
var _utils2 = /*#__PURE__*/require("./utils");
|
14
16
|
var _excluded = ["id", "target", "children", "hasArrow", "role", "view", "size", "frame", "onToggle", "isFocusTrapped", "isOpen", "opened", "placement", "trigger", "offset", "preventOverflow", "closeOnOverlayClick", "closeOnEsc"];
|
15
17
|
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); }
|
16
18
|
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; }
|
@@ -51,12 +53,12 @@ var dropdownOldRoot = exports.dropdownOldRoot = function dropdownOldRoot(Root) {
|
|
51
53
|
closeOnEsc = _ref$closeOnEsc === void 0 ? false : _ref$closeOnEsc,
|
52
54
|
rest = _objectWithoutProperties(_ref, _excluded);
|
53
55
|
var innerIsOpen = Boolean(isOpen || opened);
|
54
|
-
var uniqId = (0,
|
56
|
+
var uniqId = (0, _utils.safeUseId)();
|
55
57
|
var innerId = id || uniqId;
|
56
58
|
var rootRef = (0, _react.useRef)(null);
|
57
59
|
var dropdownRef = (0, _react.useRef)(null);
|
58
60
|
var handleRef = (0, _plasmaCore.useForkRef)(rootRef, outerRootRef);
|
59
|
-
var trapRef = (0,
|
61
|
+
var trapRef = (0, _hooks.useFocusTrap)(innerIsOpen && isFocusTrapped);
|
60
62
|
var dropdownForkRef = (0, _plasmaCore.useForkRef)(dropdownRef, trapRef);
|
61
63
|
return /*#__PURE__*/_react["default"].createElement(_Dropdown.StyledPopover, {
|
62
64
|
role: role,
|
@@ -71,7 +73,7 @@ var dropdownOldRoot = exports.dropdownOldRoot = function dropdownOldRoot(Root) {
|
|
71
73
|
offset: offset,
|
72
74
|
preventOverflow: preventOverflow,
|
73
75
|
hasArrow: hasArrow,
|
74
|
-
placement: (0,
|
76
|
+
placement: (0, _utils2.getPlacements)(placement),
|
75
77
|
trigger: trigger,
|
76
78
|
closeOnOverlayClick: closeOnOverlayClick,
|
77
79
|
closeOnEsc: closeOnEsc,
|
@@ -8,6 +8,7 @@ exports.popoverRoot = exports.popoverConfig = exports.POPOVER_PORTAL_ID = export
|
|
8
8
|
var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
|
9
9
|
var _reactPopper = /*#__PURE__*/require("react-popper");
|
10
10
|
var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
|
11
|
+
var _hooks = /*#__PURE__*/require("../../hooks");
|
11
12
|
var _utils = /*#__PURE__*/require("../../utils");
|
12
13
|
var _Portal = /*#__PURE__*/require("../Portal");
|
13
14
|
var _base = /*#__PURE__*/require("./variations/_view/base");
|
@@ -72,7 +73,7 @@ var popoverRoot = exports.popoverRoot = function popoverRoot(Root) {
|
|
72
73
|
var popoverRef = (0, _react.useRef)(null);
|
73
74
|
var handleRef = (0, _plasmaCore.useForkRef)(rootRef, outerRootRef);
|
74
75
|
var portalRef = (0, _react.useRef)(null);
|
75
|
-
var trapRef = (0,
|
76
|
+
var trapRef = (0, _hooks.useFocusTrap)(innerIsOpen && isFocusTrapped);
|
76
77
|
var popoverForkRef = (0, _plasmaCore.useForkRef)(popoverRef, trapRef);
|
77
78
|
var _useState = (0, _react.useState)(null),
|
78
79
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -22,11 +22,8 @@ var config = exports.config = {
|
|
22
22
|
light: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default);"], _Counter.counterTokens.color, _Counter.counterTokens.background)
|
23
23
|
},
|
24
24
|
size: {
|
25
|
-
|
26
|
-
|
27
|
-
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":1.25rem;", ":0.375rem;", ":0.375rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
|
28
|
-
xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":1rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
|
29
|
-
xxs: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":0.75rem;", ":0.125rem;", ":0.125rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight)
|
25
|
+
xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":1rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
|
26
|
+
xxs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":0.75rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight)
|
30
27
|
}
|
31
28
|
}
|
32
29
|
};
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import React from 'react';
|
1
2
|
import { disableProps } from '@salutejs/plasma-sb-utils';
|
2
3
|
import type { StoryObj, Meta } from '@storybook/react';
|
3
4
|
|
@@ -5,22 +6,19 @@ import { WithTheme } from '../../../_helpers';
|
|
5
6
|
|
6
7
|
import { Counter } from './Counter';
|
7
8
|
|
8
|
-
const sizes = ['l', 'm', 's', 'xs', 'xxs'];
|
9
|
-
const views = ['default', 'accent', 'positive', 'warning', 'negative', 'dark', 'light'];
|
10
|
-
|
11
9
|
const meta: Meta<typeof Counter> = {
|
12
10
|
title: 'plasma_b2c/Counter',
|
13
11
|
component: Counter,
|
14
12
|
decorators: [WithTheme],
|
15
13
|
argTypes: {
|
16
14
|
size: {
|
17
|
-
options:
|
15
|
+
options: ['xs', 'xxs'],
|
18
16
|
control: {
|
19
17
|
type: 'select',
|
20
18
|
},
|
21
19
|
},
|
22
20
|
view: {
|
23
|
-
options:
|
21
|
+
options: ['default', 'accent', 'positive', 'warning', 'negative', 'dark', 'light'],
|
24
22
|
control: {
|
25
23
|
type: 'select',
|
26
24
|
},
|
@@ -35,8 +33,8 @@ type Story = StoryObj<typeof Counter>;
|
|
35
33
|
|
36
34
|
export const Default: Story = {
|
37
35
|
args: {
|
38
|
-
count:
|
39
|
-
maxCount:
|
36
|
+
count: 25,
|
37
|
+
maxCount: 100,
|
40
38
|
view: 'default',
|
41
39
|
size: 'xs',
|
42
40
|
},
|
@@ -37,6 +37,7 @@ const placements: Array<PopoverPlacement> = [
|
|
37
37
|
];
|
38
38
|
|
39
39
|
type StoryTextAreaPropsCustom = {
|
40
|
+
hasHint?: boolean;
|
40
41
|
enableContentRight?: boolean;
|
41
42
|
};
|
42
43
|
|
@@ -92,43 +93,44 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
92
93
|
},
|
93
94
|
hintText: {
|
94
95
|
control: { type: 'text' },
|
96
|
+
if: { arg: 'hasHint', truthy: true },
|
95
97
|
},
|
96
98
|
hintView: {
|
97
99
|
options: hintViews,
|
98
100
|
control: {
|
99
101
|
type: 'select',
|
100
102
|
},
|
101
|
-
if: { arg: '
|
103
|
+
if: { arg: 'hasHint', truthy: true },
|
102
104
|
},
|
103
105
|
hintSize: {
|
104
106
|
options: hintSizes,
|
105
107
|
control: {
|
106
108
|
type: 'select',
|
107
109
|
},
|
108
|
-
if: { arg: '
|
110
|
+
if: { arg: 'hasHint', truthy: true },
|
109
111
|
},
|
110
112
|
hintTrigger: {
|
111
113
|
options: hintTriggers,
|
112
114
|
control: {
|
113
115
|
type: 'inline-radio',
|
114
116
|
},
|
115
|
-
if: { arg: '
|
117
|
+
if: { arg: 'hasHint', truthy: true },
|
116
118
|
},
|
117
119
|
hintPlacement: {
|
118
120
|
options: placements,
|
119
121
|
control: {
|
120
122
|
type: 'select',
|
121
123
|
},
|
122
|
-
if: { arg: '
|
124
|
+
if: { arg: 'hasHint', truthy: true },
|
123
125
|
mappers: placements,
|
124
126
|
},
|
125
127
|
hintHasArrow: {
|
126
128
|
control: { type: 'boolean' },
|
127
|
-
if: { arg: '
|
129
|
+
if: { arg: 'hasHint', truthy: true },
|
128
130
|
},
|
129
131
|
hintWidth: {
|
130
132
|
control: { type: 'text' },
|
131
|
-
if: { arg: '
|
133
|
+
if: { arg: 'hasHint', truthy: true },
|
132
134
|
},
|
133
135
|
},
|
134
136
|
args: {
|
@@ -152,6 +154,7 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
152
154
|
requiredPlacement: 'right',
|
153
155
|
clear: false,
|
154
156
|
hasDivider: false,
|
157
|
+
hasHint: true,
|
155
158
|
hintText: 'Текст подсказки',
|
156
159
|
hintTrigger: 'hover',
|
157
160
|
hintView: 'default',
|
package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx
CHANGED
@@ -95,43 +95,44 @@ const meta: Meta<typeof TextField> = {
|
|
95
95
|
},
|
96
96
|
hintText: {
|
97
97
|
control: { type: 'text' },
|
98
|
+
if: { arg: 'hasHint', truthy: true },
|
98
99
|
},
|
99
100
|
hintView: {
|
100
101
|
options: hintViews,
|
101
102
|
control: {
|
102
103
|
type: 'select',
|
103
104
|
},
|
104
|
-
if: { arg: '
|
105
|
+
if: { arg: 'hasHint', truthy: true },
|
105
106
|
},
|
106
107
|
hintSize: {
|
107
108
|
options: hintSizes,
|
108
109
|
control: {
|
109
110
|
type: 'select',
|
110
111
|
},
|
111
|
-
if: { arg: '
|
112
|
+
if: { arg: 'hasHint', truthy: true },
|
112
113
|
},
|
113
114
|
hintTrigger: {
|
114
115
|
options: hintTriggers,
|
115
116
|
control: {
|
116
117
|
type: 'inline-radio',
|
117
118
|
},
|
118
|
-
if: { arg: '
|
119
|
+
if: { arg: 'hasHint', truthy: true },
|
119
120
|
},
|
120
121
|
hintPlacement: {
|
121
122
|
options: placements,
|
122
123
|
control: {
|
123
124
|
type: 'select',
|
124
125
|
},
|
125
|
-
if: { arg: '
|
126
|
+
if: { arg: 'hasHint', truthy: true },
|
126
127
|
mappers: placements,
|
127
128
|
},
|
128
129
|
hintHasArrow: {
|
129
130
|
control: { type: 'boolean' },
|
130
|
-
if: { arg: '
|
131
|
+
if: { arg: 'hasHint', truthy: true },
|
131
132
|
},
|
132
133
|
hintWidth: {
|
133
134
|
control: { type: 'text' },
|
134
|
-
if: { arg: '
|
135
|
+
if: { arg: 'hasHint', truthy: true },
|
135
136
|
},
|
136
137
|
},
|
137
138
|
};
|
@@ -158,6 +159,7 @@ type StoryPropsDefault = Omit<
|
|
158
159
|
| 'chips'
|
159
160
|
| 'onChangeChips'
|
160
161
|
> & {
|
162
|
+
hasHint: boolean;
|
161
163
|
enableContentLeft: boolean;
|
162
164
|
enableContentRight: boolean;
|
163
165
|
};
|
@@ -222,6 +224,7 @@ export const Default: StoryObj<StoryPropsDefault> = {
|
|
222
224
|
requiredPlacement: 'right',
|
223
225
|
clear: false,
|
224
226
|
hasDivider: false,
|
227
|
+
hasHint: true,
|
225
228
|
hintText: 'Текст подсказки',
|
226
229
|
hintTrigger: 'hover',
|
227
230
|
hintView: 'default',
|
@@ -251,6 +254,7 @@ type StoryPropsChips = Omit<
|
|
251
254
|
| 'minLength'
|
252
255
|
| 'enumerationType'
|
253
256
|
> & {
|
257
|
+
hasHint: boolean;
|
254
258
|
enableContentLeft: boolean;
|
255
259
|
enableContentRight: boolean;
|
256
260
|
};
|
@@ -22,11 +22,8 @@ var config = exports.config = {
|
|
22
22
|
light: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default);"], _Counter.counterTokens.color, _Counter.counterTokens.background)
|
23
23
|
},
|
24
24
|
size: {
|
25
|
-
|
26
|
-
|
27
|
-
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":1.25rem;", ":0.375rem;", ":0.375rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
|
28
|
-
xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":1rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
|
29
|
-
xxs: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":0.75rem;", ":0.125rem;", ":0.125rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight)
|
25
|
+
xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":1rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
|
26
|
+
xxs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":0.75rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight)
|
30
27
|
}
|
31
28
|
}
|
32
29
|
};
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import React from 'react';
|
1
2
|
import { disableProps } from '@salutejs/plasma-sb-utils';
|
2
3
|
import type { StoryObj, Meta } from '@storybook/react';
|
3
4
|
|
@@ -5,22 +6,19 @@ import { WithTheme } from '../../../_helpers';
|
|
5
6
|
|
6
7
|
import { Counter } from './Counter';
|
7
8
|
|
8
|
-
const sizes = ['l', 'm', 's', 'xs', 'xxs'];
|
9
|
-
const views = ['default', 'accent', 'positive', 'warning', 'negative', 'dark', 'light'];
|
10
|
-
|
11
9
|
const meta: Meta<typeof Counter> = {
|
12
10
|
title: 'plasma_web/Counter',
|
13
11
|
component: Counter,
|
14
12
|
decorators: [WithTheme],
|
15
13
|
argTypes: {
|
16
14
|
size: {
|
17
|
-
options:
|
15
|
+
options: ['xs', 'xxs'],
|
18
16
|
control: {
|
19
17
|
type: 'select',
|
20
18
|
},
|
21
19
|
},
|
22
20
|
view: {
|
23
|
-
options:
|
21
|
+
options: ['default', 'accent', 'positive', 'warning', 'negative', 'dark', 'light'],
|
24
22
|
control: {
|
25
23
|
type: 'select',
|
26
24
|
},
|
@@ -35,8 +33,8 @@ type Story = StoryObj<typeof Counter>;
|
|
35
33
|
|
36
34
|
export const Default: Story = {
|
37
35
|
args: {
|
38
|
-
count:
|
39
|
-
maxCount:
|
36
|
+
count: 25,
|
37
|
+
maxCount: 100,
|
40
38
|
view: 'default',
|
41
39
|
size: 'xs',
|
42
40
|
},
|
@@ -37,6 +37,7 @@ const placements: Array<PopoverPlacement> = [
|
|
37
37
|
];
|
38
38
|
|
39
39
|
type StoryTextAreaPropsCustom = {
|
40
|
+
hasHint?: boolean;
|
40
41
|
enableContentRight?: boolean;
|
41
42
|
};
|
42
43
|
|
@@ -92,43 +93,44 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
92
93
|
},
|
93
94
|
hintText: {
|
94
95
|
control: { type: 'text' },
|
96
|
+
if: { arg: 'hasHint', truthy: true },
|
95
97
|
},
|
96
98
|
hintView: {
|
97
99
|
options: hintViews,
|
98
100
|
control: {
|
99
101
|
type: 'select',
|
100
102
|
},
|
101
|
-
if: { arg: '
|
103
|
+
if: { arg: 'hasHint', truthy: true },
|
102
104
|
},
|
103
105
|
hintSize: {
|
104
106
|
options: hintSizes,
|
105
107
|
control: {
|
106
108
|
type: 'select',
|
107
109
|
},
|
108
|
-
if: { arg: '
|
110
|
+
if: { arg: 'hasHint', truthy: true },
|
109
111
|
},
|
110
112
|
hintTrigger: {
|
111
113
|
options: hintTriggers,
|
112
114
|
control: {
|
113
115
|
type: 'inline-radio',
|
114
116
|
},
|
115
|
-
if: { arg: '
|
117
|
+
if: { arg: 'hasHint', truthy: true },
|
116
118
|
},
|
117
119
|
hintPlacement: {
|
118
120
|
options: placements,
|
119
121
|
control: {
|
120
122
|
type: 'select',
|
121
123
|
},
|
122
|
-
if: { arg: '
|
124
|
+
if: { arg: 'hasHint', truthy: true },
|
123
125
|
mappers: placements,
|
124
126
|
},
|
125
127
|
hintHasArrow: {
|
126
128
|
control: { type: 'boolean' },
|
127
|
-
if: { arg: '
|
129
|
+
if: { arg: 'hasHint', truthy: true },
|
128
130
|
},
|
129
131
|
hintWidth: {
|
130
132
|
control: { type: 'text' },
|
131
|
-
if: { arg: '
|
133
|
+
if: { arg: 'hasHint', truthy: true },
|
132
134
|
},
|
133
135
|
},
|
134
136
|
args: {
|
@@ -152,6 +154,7 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
152
154
|
requiredPlacement: 'right',
|
153
155
|
clear: false,
|
154
156
|
hasDivider: false,
|
157
|
+
hasHint: true,
|
155
158
|
hintText: 'Текст подсказки',
|
156
159
|
hintTrigger: 'hover',
|
157
160
|
hintView: 'default',
|
package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx
CHANGED
@@ -95,43 +95,44 @@ const meta: Meta<typeof TextField> = {
|
|
95
95
|
},
|
96
96
|
hintText: {
|
97
97
|
control: { type: 'text' },
|
98
|
+
if: { arg: 'hasHint', truthy: true },
|
98
99
|
},
|
99
100
|
hintView: {
|
100
101
|
options: hintViews,
|
101
102
|
control: {
|
102
103
|
type: 'select',
|
103
104
|
},
|
104
|
-
if: { arg: '
|
105
|
+
if: { arg: 'hasHint', truthy: true },
|
105
106
|
},
|
106
107
|
hintSize: {
|
107
108
|
options: hintSizes,
|
108
109
|
control: {
|
109
110
|
type: 'select',
|
110
111
|
},
|
111
|
-
if: { arg: '
|
112
|
+
if: { arg: 'hasHint', truthy: true },
|
112
113
|
},
|
113
114
|
hintTrigger: {
|
114
115
|
options: hintTriggers,
|
115
116
|
control: {
|
116
117
|
type: 'inline-radio',
|
117
118
|
},
|
118
|
-
if: { arg: '
|
119
|
+
if: { arg: 'hasHint', truthy: true },
|
119
120
|
},
|
120
121
|
hintPlacement: {
|
121
122
|
options: placements,
|
122
123
|
control: {
|
123
124
|
type: 'select',
|
124
125
|
},
|
125
|
-
if: { arg: '
|
126
|
+
if: { arg: 'hasHint', truthy: true },
|
126
127
|
mappers: placements,
|
127
128
|
},
|
128
129
|
hintHasArrow: {
|
129
130
|
control: { type: 'boolean' },
|
130
|
-
if: { arg: '
|
131
|
+
if: { arg: 'hasHint', truthy: true },
|
131
132
|
},
|
132
133
|
hintWidth: {
|
133
134
|
control: { type: 'text' },
|
134
|
-
if: { arg: '
|
135
|
+
if: { arg: 'hasHint', truthy: true },
|
135
136
|
},
|
136
137
|
},
|
137
138
|
};
|
@@ -158,6 +159,7 @@ type StoryPropsDefault = Omit<
|
|
158
159
|
| 'chips'
|
159
160
|
| 'onChangeChips'
|
160
161
|
> & {
|
162
|
+
hasHint: boolean;
|
161
163
|
enableContentLeft: boolean;
|
162
164
|
enableContentRight: boolean;
|
163
165
|
};
|
@@ -222,6 +224,7 @@ export const Default: StoryObj<StoryPropsDefault> = {
|
|
222
224
|
optional: false,
|
223
225
|
required: false,
|
224
226
|
requiredPlacement: 'right',
|
227
|
+
hasHint: true,
|
225
228
|
hintText: 'Текст подсказки',
|
226
229
|
hintTrigger: 'hover',
|
227
230
|
hintView: 'default',
|
@@ -251,6 +254,7 @@ type StoryPropsChips = Omit<
|
|
251
254
|
| 'minLength'
|
252
255
|
| 'enumerationType'
|
253
256
|
> & {
|
257
|
+
hasHint: boolean;
|
254
258
|
enableContentLeft: boolean;
|
255
259
|
enableContentRight: boolean;
|
256
260
|
};
|
@@ -1,34 +1,24 @@
|
|
1
|
-
var _excluded = ["count", "maxCount", "size", "view"
|
1
|
+
var _excluded = ["count", "maxCount", "size", "view"];
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
5
5
|
import React, { forwardRef } from 'react';
|
6
|
-
import { cx } from '../../utils';
|
7
6
|
import { base as viewCSS } from './variations/_view/base';
|
8
7
|
import { base as sizeCSS } from './variations/_size/base';
|
9
8
|
import { base } from './Counter.styles';
|
10
|
-
import { classes } from './Counter.tokens';
|
11
|
-
var MIN_COUNT = 1;
|
12
9
|
export var counterRoot = function counterRoot(Root) {
|
13
10
|
return /*#__PURE__*/forwardRef(function (props, ref) {
|
14
11
|
var count = props.count,
|
15
12
|
maxCount = props.maxCount,
|
16
13
|
size = props.size,
|
17
14
|
view = props.view,
|
18
|
-
className = props.className,
|
19
15
|
rest = _objectWithoutProperties(props, _excluded);
|
20
|
-
var
|
21
|
-
var currentMaxCount = maxCount && maxCount < MIN_COUNT ? MIN_COUNT : maxCount;
|
22
|
-
var isCurrentCountOneDigit = currentCount >= 0 && currentCount < 10;
|
23
|
-
var isCurrentMaxCountExceeded = currentMaxCount && currentCount > currentMaxCount;
|
24
|
-
var content = isCurrentMaxCountExceeded ? "".concat(currentMaxCount, "+") : currentCount;
|
25
|
-
var roundClass = !isCurrentMaxCountExceeded && isCurrentCountOneDigit ? classes.round : undefined;
|
16
|
+
var content = maxCount && count > maxCount ? "".concat(maxCount, "+") : count;
|
26
17
|
return /*#__PURE__*/React.createElement(Root, _extends({
|
27
18
|
ref: ref,
|
28
19
|
view: view,
|
29
20
|
size: size,
|
30
|
-
count: count
|
31
|
-
className: cx(roundClass, className)
|
21
|
+
count: count
|
32
22
|
}, rest), content);
|
33
23
|
});
|
34
24
|
};
|
@@ -12,7 +12,7 @@ import { PropsTable, Description } from '@site/src/components';
|
|
12
12
|
## Примеры
|
13
13
|
|
14
14
|
### Максимальное значение числового badge
|
15
|
-
Задается с помощью свойства `maxCount`.
|
15
|
+
Задается с помощью свойства `maxCount`.
|
16
16
|
|
17
17
|
```tsx live
|
18
18
|
import React from 'react';
|
@@ -29,7 +29,7 @@ export function App() {
|
|
29
29
|
```
|
30
30
|
|
31
31
|
### Размер числового badge
|
32
|
-
Размер задается с помощью свойства `size`. Возможные значения свойства: `
|
32
|
+
Размер задается с помощью свойства `size`. Возможные значения свойства: `"xs"` или `"xxs"`.
|
33
33
|
|
34
34
|
```tsx live
|
35
35
|
import React from 'react';
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { css } from 'styled-components';
|
2
|
-
import {
|
3
|
-
export var base = /*#__PURE__*/css(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");border-radius:var(", ");height:var(", ");padding-top:var(", ");padding-right:var(", ");padding-bottom:var(", ");padding-left:var(", ")
|
2
|
+
import { tokens } from '../../Counter.tokens';
|
3
|
+
export var base = /*#__PURE__*/css(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");border-radius:var(", ");height:var(", ");padding-top:var(", ");padding-right:var(", ");padding-bottom:var(", ");padding-left:var(", ");"], tokens.fontFamily, tokens.fontSize, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, tokens.lineHeight, tokens.borderRadius, tokens.height, tokens.paddingTop, tokens.paddingRight, tokens.paddingBottom, tokens.paddingLeft);
|
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
5
5
|
import React, { forwardRef } from 'react';
|
6
|
-
import {
|
6
|
+
import { safeUseId } from '../../../../utils';
|
7
7
|
import { base as viewCSS } from './variations/_view/base';
|
8
8
|
import { base as sizeCSS } from './variations/_size/base';
|
9
9
|
import { StyledDropdownDivider } from './DropdownDivider.styles';
|
@@ -17,7 +17,7 @@ export var dropdownDividerRoot = function dropdownDividerRoot(Root) {
|
|
17
17
|
view = _ref.view,
|
18
18
|
size = _ref.size,
|
19
19
|
rest = _objectWithoutProperties(_ref, _excluded);
|
20
|
-
var uniqId =
|
20
|
+
var uniqId = safeUseId();
|
21
21
|
var innerId = id || uniqId;
|
22
22
|
return /*#__PURE__*/React.createElement(Root, {
|
23
23
|
id: innerId,
|
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
5
5
|
import React, { forwardRef } from 'react';
|
6
|
-
import {
|
6
|
+
import { safeUseId } from '../../../../utils';
|
7
7
|
import { base as viewCSS } from './variations/_view/base';
|
8
8
|
import { base as sizeCSS } from './variations/_size/base';
|
9
9
|
import { StyledDropdownFooter } from './DropdownFooter.styles';
|
@@ -18,7 +18,7 @@ export var dropdownFooterRoot = function dropdownFooterRoot(Root) {
|
|
18
18
|
view = _ref.view,
|
19
19
|
size = _ref.size,
|
20
20
|
rest = _objectWithoutProperties(_ref, _excluded);
|
21
|
-
var uniqId =
|
21
|
+
var uniqId = safeUseId();
|
22
22
|
var innerId = id || uniqId;
|
23
23
|
return /*#__PURE__*/React.createElement(Root, {
|
24
24
|
id: innerId,
|