@salutejs/plasma-new-hope 0.185.1-canary.32.11735924898.0 → 0.186.0-canary.1500.11737623495.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Badge/Badge.css +3 -3
- package/cjs/components/Badge/Badge.js +10 -3
- package/cjs/components/Badge/Badge.js.map +1 -1
- package/cjs/components/Badge/Badge.styles.js +5 -5
- package/cjs/components/Badge/Badge.styles.js.map +1 -1
- package/cjs/components/Badge/Badge.styles_hhbwyi.css +4 -0
- package/cjs/components/Badge/Badge.tokens.js +2 -1
- package/cjs/components/Badge/Badge.tokens.js.map +1 -1
- package/cjs/components/Tabs/tokens.js +2 -1
- package/cjs/components/Tabs/tokens.js.map +1 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.css +6 -6
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +10 -3
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js.map +1 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js +6 -6
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js.map +1 -1
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles_1yi1gll.css +5 -0
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_view/base.js +1 -1
- package/{es/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_view/base_4zingj.css → cjs/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_view/base_j8lg9u.css} +1 -1
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.css +6 -6
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js +10 -3
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js.map +1 -1
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js +6 -6
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js.map +1 -1
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles_17vv6lq.css +5 -0
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/variations/_view/base.js +1 -1
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/variations/_view/{base_fueiq8.css → base_12fk3xi.css} +1 -1
- package/cjs/index.css +15 -15
- package/emotion/cjs/components/Badge/Badge.js +15 -3
- package/emotion/cjs/components/Badge/Badge.styles.js +4 -13
- package/emotion/cjs/components/Badge/Badge.tokens.js +2 -1
- package/emotion/cjs/components/Tabs/tokens.js +2 -1
- package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +15 -3
- package/emotion/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js +12 -12
- package/emotion/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js +15 -3
- package/emotion/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js +12 -12
- package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +17 -14
- package/emotion/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +5 -1
- package/emotion/cjs/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +51 -19
- package/emotion/cjs/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +18 -15
- package/emotion/cjs/examples/plasma_b2c/components/Tabs/vertical/VerticalTabItem.config.js +9 -6
- package/emotion/cjs/examples/plasma_web/components/Tabs/Tabs.stories.tsx +51 -19
- package/emotion/cjs/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +18 -15
- package/emotion/cjs/examples/plasma_web/components/Tabs/vertical/VerticalTabItem.config.js +9 -6
- package/emotion/es/components/Badge/Badge.js +16 -3
- package/emotion/es/components/Badge/Badge.styles.js +5 -14
- package/emotion/es/components/Badge/Badge.tokens.js +2 -1
- package/emotion/es/components/Tabs/tokens.js +2 -1
- package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +16 -3
- package/emotion/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js +13 -13
- package/emotion/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js +16 -3
- package/emotion/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js +13 -13
- package/emotion/es/examples/plasma_b2c/components/Badge/Badge.config.js +17 -14
- package/emotion/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +5 -1
- package/emotion/es/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +51 -19
- package/emotion/es/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +18 -15
- package/emotion/es/examples/plasma_b2c/components/Tabs/vertical/VerticalTabItem.config.js +9 -6
- package/emotion/es/examples/plasma_web/components/Tabs/Tabs.stories.tsx +51 -19
- package/emotion/es/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +18 -15
- package/emotion/es/examples/plasma_web/components/Tabs/vertical/VerticalTabItem.config.js +9 -6
- package/es/components/Badge/Badge.css +3 -3
- package/es/components/Badge/Badge.js +11 -4
- package/es/components/Badge/Badge.js.map +1 -1
- package/es/components/Badge/Badge.styles.js +5 -5
- package/es/components/Badge/Badge.styles.js.map +1 -1
- package/es/components/Badge/Badge.styles_hhbwyi.css +4 -0
- package/es/components/Badge/Badge.tokens.js +2 -1
- package/es/components/Badge/Badge.tokens.js.map +1 -1
- package/es/components/Tabs/tokens.js +2 -1
- package/es/components/Tabs/tokens.js.map +1 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.css +6 -6
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +11 -4
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js.map +1 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js +6 -6
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js.map +1 -1
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles_1yi1gll.css +5 -0
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_view/base.js +1 -1
- package/{cjs/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_view/base_4zingj.css → es/components/Tabs/ui/horizontal/HorizontalTabItem/variations/_view/base_j8lg9u.css} +1 -1
- package/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.css +6 -6
- package/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js +11 -4
- package/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js.map +1 -1
- package/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js +6 -6
- package/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js.map +1 -1
- package/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles_17vv6lq.css +5 -0
- package/es/components/Tabs/ui/vertical/VerticalTabItem/variations/_view/base.js +1 -1
- package/es/components/Tabs/ui/vertical/VerticalTabItem/variations/_view/{base_fueiq8.css → base_12fk3xi.css} +1 -1
- package/es/index.css +15 -15
- package/package.json +6 -6
- package/styled-components/cjs/components/Badge/Badge.js +15 -3
- package/styled-components/cjs/components/Badge/Badge.styles.js +2 -2
- package/styled-components/cjs/components/Badge/Badge.tokens.js +2 -1
- package/styled-components/cjs/components/Tabs/tokens.js +2 -1
- package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +15 -3
- package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js +8 -8
- package/styled-components/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js +15 -3
- package/styled-components/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js +9 -9
- package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.config.js +3 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Badge/Badge.stories.tsx +5 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +51 -19
- package/styled-components/cjs/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +3 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Tabs/vertical/VerticalTabItem.config.js +3 -0
- package/styled-components/cjs/examples/plasma_web/components/Tabs/Tabs.stories.tsx +51 -19
- package/styled-components/cjs/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +3 -0
- package/styled-components/cjs/examples/plasma_web/components/Tabs/vertical/VerticalTabItem.config.js +3 -0
- package/styled-components/es/components/Badge/Badge.js +16 -3
- package/styled-components/es/components/Badge/Badge.styles.js +3 -3
- package/styled-components/es/components/Badge/Badge.tokens.js +2 -1
- package/styled-components/es/components/Tabs/tokens.js +2 -1
- package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js +16 -3
- package/styled-components/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.js +9 -9
- package/styled-components/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js +16 -3
- package/styled-components/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js +10 -10
- package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.config.js +3 -0
- package/styled-components/es/examples/plasma_b2c/components/Badge/Badge.stories.tsx +5 -1
- package/styled-components/es/examples/plasma_b2c/components/Tabs/Tabs.stories.tsx +51 -19
- package/styled-components/es/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.js +3 -0
- package/styled-components/es/examples/plasma_b2c/components/Tabs/vertical/VerticalTabItem.config.js +3 -0
- package/styled-components/es/examples/plasma_web/components/Tabs/Tabs.stories.tsx +51 -19
- package/styled-components/es/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.js +3 -0
- package/styled-components/es/examples/plasma_web/components/Tabs/vertical/VerticalTabItem.config.js +3 -0
- package/types/components/Badge/Badge.d.ts.map +1 -1
- package/types/components/Badge/Badge.styles.d.ts +1 -1
- package/types/components/Badge/Badge.styles.d.ts.map +1 -1
- package/types/components/Badge/Badge.tokens.d.ts +1 -0
- package/types/components/Badge/Badge.tokens.d.ts.map +1 -1
- package/types/components/Badge/Badge.types.d.ts +6 -1
- package/types/components/Badge/Badge.types.d.ts.map +1 -1
- package/types/components/Tabs/TabItem.types.d.ts +6 -1
- package/types/components/Tabs/TabItem.types.d.ts.map +1 -1
- package/types/components/Tabs/tokens.d.ts +1 -0
- package/types/components/Tabs/tokens.d.ts.map +1 -1
- package/types/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.d.ts.map +1 -1
- package/types/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.d.ts +1 -1
- package/types/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles.d.ts.map +1 -1
- package/types/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.d.ts.map +1 -1
- package/types/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.d.ts +1 -1
- package/types/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Badge/Badge.config.d.ts +3 -0
- package/types/examples/plasma_b2c/components/Badge/Badge.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Badge/Badge.d.ts +6 -0
- package/types/examples/plasma_b2c/components/Badge/Badge.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Tabs/TabItem.d.ts +6 -0
- package/types/examples/plasma_b2c/components/Tabs/TabItem.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.d.ts +3 -0
- package/types/examples/plasma_b2c/components/Tabs/horizontal/HorizontalTabItem.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Tabs/vertical/VerticalTabItem.config.d.ts +3 -0
- package/types/examples/plasma_b2c/components/Tabs/vertical/VerticalTabItem.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Badge/Badge.d.ts +3 -0
- package/types/examples/plasma_web/components/Badge/Badge.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Tabs/TabItem.d.ts +6 -0
- package/types/examples/plasma_web/components/Tabs/TabItem.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.d.ts +3 -0
- package/types/examples/plasma_web/components/Tabs/horizontal/HorizontalTabItem.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Tabs/vertical/VerticalTabItem.config.d.ts +3 -0
- package/types/examples/plasma_web/components/Tabs/vertical/VerticalTabItem.config.d.ts.map +1 -1
- package/cjs/components/Badge/Badge.styles_8pi3br.css +0 -4
- package/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles_uaaqqg.css +0 -5
- package/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles_1g7zipg.css +0 -5
- package/es/components/Badge/Badge.styles_8pi3br.css +0 -4
- package/es/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.styles_uaaqqg.css +0 -5
- package/es/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles_1g7zipg.css +0 -5
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/plasma-new-hope",
|
3
|
-
"version": "0.
|
4
|
-
"description": "Salute Design System
|
3
|
+
"version": "0.186.0-canary.1500.11737623495.0",
|
4
|
+
"description": "Salute Design System blueprint",
|
5
5
|
"main": "cjs/index.js",
|
6
6
|
"module": "es/index.js",
|
7
7
|
"types": "types/index.d.ts",
|
@@ -80,8 +80,8 @@
|
|
80
80
|
"@rollup/plugin-babel": "^6.0.4",
|
81
81
|
"@rollup/plugin-commonjs": "^25.0.4",
|
82
82
|
"@rollup/plugin-node-resolve": "^15.1.0",
|
83
|
-
"@salutejs/plasma-sb-utils": "0.183.
|
84
|
-
"@salutejs/plasma-themes": "0.22.
|
83
|
+
"@salutejs/plasma-sb-utils": "0.183.0-dev.0",
|
84
|
+
"@salutejs/plasma-themes": "0.22.0",
|
85
85
|
"@storybook/addon-docs": "^7.6.17",
|
86
86
|
"@storybook/addon-essentials": "^7.6.17",
|
87
87
|
"@storybook/addons": "^7.6.17",
|
@@ -115,7 +115,7 @@
|
|
115
115
|
"@linaria/react": "5.0.3",
|
116
116
|
"@popperjs/core": "2.11.8",
|
117
117
|
"@salutejs/input-core": "2.1.2",
|
118
|
-
"@salutejs/plasma-core": "1.185.
|
118
|
+
"@salutejs/plasma-core": "1.185.0-dev.0",
|
119
119
|
"@salutejs/react-maskinput": "3.2.6",
|
120
120
|
"classnames": "2.5.1",
|
121
121
|
"dayjs": "1.11.11",
|
@@ -128,5 +128,5 @@
|
|
128
128
|
"sideEffects": [
|
129
129
|
"*.css"
|
130
130
|
],
|
131
|
-
"gitHead": "
|
131
|
+
"gitHead": "a5648157bd13c25fc7371b273155cad10d77fdd3"
|
132
132
|
}
|
@@ -14,10 +14,15 @@ var _base4 = /*#__PURE__*/require("./variations/_transparent/base");
|
|
14
14
|
var _base5 = /*#__PURE__*/require("./variations/_clear/base");
|
15
15
|
var _Badge = /*#__PURE__*/require("./Badge.styles");
|
16
16
|
var _Badge2 = /*#__PURE__*/require("./Badge.tokens");
|
17
|
-
var _excluded = ["children", "className", "text", "contentLeft", "contentRight", "size", "view", "pilled", "transparent", "clear"];
|
17
|
+
var _excluded = ["children", "className", "text", "contentLeft", "contentRight", "size", "view", "pilled", "transparent", "clear", "maxWidth"];
|
18
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
19
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
20
20
|
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); }
|
21
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
22
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
23
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
24
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
25
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
21
26
|
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; }
|
22
27
|
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; }
|
23
28
|
var badgeRoot = exports.badgeRoot = function badgeRoot(Root) {
|
@@ -35,20 +40,27 @@ var badgeRoot = exports.badgeRoot = function badgeRoot(Root) {
|
|
35
40
|
transparent = _props$transparent === void 0 ? false : _props$transparent,
|
36
41
|
_props$clear = props.clear,
|
37
42
|
clear = _props$clear === void 0 ? false : _props$clear,
|
43
|
+
_props$maxWidth = props.maxWidth,
|
44
|
+
maxWidth = _props$maxWidth === void 0 ? 'auto' : _props$maxWidth,
|
38
45
|
rest = _objectWithoutProperties(props, _excluded);
|
39
46
|
var pilledClass = pilled ? _Badge2.classes.badgePilled : undefined;
|
40
47
|
var transparentClass = transparent ? _Badge2.classes.badgeTransparent : undefined;
|
41
48
|
var clearClass = clear ? _Badge2.classes.badgeClear : undefined;
|
49
|
+
var truncateClass = maxWidth !== 'auto' ? _Badge2.classes.badgeTruncate : undefined;
|
42
50
|
var txt = !text && typeof children === 'string' ? children : text;
|
43
51
|
return /*#__PURE__*/_react["default"].createElement(Root, _extends({
|
44
52
|
ref: ref,
|
45
|
-
className: (0, _utils.cx)(pilledClass, transparentClass, clearClass, className),
|
53
|
+
className: (0, _utils.cx)(pilledClass, transparentClass, clearClass, truncateClass, className),
|
46
54
|
view: view,
|
47
55
|
size: size,
|
48
56
|
pilled: pilled,
|
49
57
|
transparent: transparent,
|
50
58
|
clear: clear
|
51
|
-
}, rest
|
59
|
+
}, rest, {
|
60
|
+
style: _objectSpread(_objectSpread({}, rest.style), {}, {
|
61
|
+
maxWidth: maxWidth
|
62
|
+
})
|
63
|
+
}), contentLeft && /*#__PURE__*/_react["default"].createElement(_Badge.StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/_react["default"].createElement(_Badge.StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/_react["default"].createElement(_Badge.StyledContentRight, null, contentRight));
|
52
64
|
});
|
53
65
|
};
|
54
66
|
var badgeConfig = exports.badgeConfig = {
|
@@ -9,7 +9,6 @@ var _styledComponents = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/requi
|
|
9
9
|
var _Badge = /*#__PURE__*/require("./Badge.tokens");
|
10
10
|
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); }
|
11
11
|
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; }
|
12
|
-
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["display:inline-flex;align-items:center;box-sizing:border-box;justify-content:center;width:max-content;"]);
|
13
12
|
var StyledContentLeft = exports.StyledContentLeft = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
14
13
|
componentId: "plasma-new-hope__sc-naxmb2-0"
|
15
14
|
})(["display:flex;margin-left:var(", ");margin-right:var(", ");"], _Badge.tokens.leftContentMarginLeft, _Badge.tokens.leftContentMarginRight);
|
@@ -18,4 +17,5 @@ var StyledContentMain = exports.StyledContentMain = /*#__PURE__*/_styledComponen
|
|
18
17
|
})([""]);
|
19
18
|
var StyledContentRight = exports.StyledContentRight = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
20
19
|
componentId: "plasma-new-hope__sc-naxmb2-2"
|
21
|
-
})(["display:flex;margin-left:var(", ");margin-right:var(", ");"], _Badge.tokens.rightContentMarginLeft, _Badge.tokens.rightContentMarginRight);
|
20
|
+
})(["display:flex;margin-left:var(", ");margin-right:var(", ");"], _Badge.tokens.rightContentMarginLeft, _Badge.tokens.rightContentMarginRight);
|
21
|
+
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["display:inline-flex;align-items:center;box-sizing:border-box;justify-content:center;width:max-content;&.", "{max-width:100%;", "{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}}"], _Badge.classes.badgeTruncate, StyledContentMain);
|
@@ -7,7 +7,8 @@ exports.tokens = exports.classes = void 0;
|
|
7
7
|
var classes = exports.classes = {
|
8
8
|
badgePilled: 'badge-pilled',
|
9
9
|
badgeTransparent: 'badge-transparent',
|
10
|
-
badgeClear: 'badge-clear'
|
10
|
+
badgeClear: 'badge-clear',
|
11
|
+
badgeTruncate: 'badge-truncate'
|
11
12
|
};
|
12
13
|
var tokens = exports.tokens = {
|
13
14
|
background: '--plasma-badge-background',
|
@@ -20,7 +20,8 @@ var classes = exports.classes = {
|
|
20
20
|
tabsHasTopArrow: 'tabs-has-top-arrow',
|
21
21
|
tabsHasBottomArrow: 'tabs-has-bottom-arrow',
|
22
22
|
tabsClipScroll: 'tabs-clip-scroll',
|
23
|
-
tabsClipShowAll: 'tabs-clip-show-all'
|
23
|
+
tabsClipShowAll: 'tabs-clip-show-all',
|
24
|
+
tabsTruncate: 'tabs-truncate'
|
24
25
|
};
|
25
26
|
var tokens = exports.tokens = {
|
26
27
|
disabledOpacity: '--plasma-tabs-disabled-opacity',
|
package/styled-components/cjs/components/Tabs/ui/horizontal/HorizontalTabItem/HorizontalTabItem.js
CHANGED
@@ -15,10 +15,15 @@ var _base2 = /*#__PURE__*/require("./variations/_size/base");
|
|
15
15
|
var _base3 = /*#__PURE__*/require("./variations/_pilled/base");
|
16
16
|
var _base4 = /*#__PURE__*/require("./variations/_disabled/base");
|
17
17
|
var _HorizontalTabItem = /*#__PURE__*/require("./HorizontalTabItem.styles");
|
18
|
-
var _excluded = ["size", "view", "isActive", "selected", "disabled", "pilled", "children", "value", "contentLeft", "contentRight", "animated", "onIndexChange", "itemIndex", "tabIndex", "className", "onClick"];
|
18
|
+
var _excluded = ["size", "view", "isActive", "selected", "disabled", "pilled", "children", "value", "contentLeft", "contentRight", "animated", "onIndexChange", "itemIndex", "tabIndex", "className", "onClick", "maxItemWidth"];
|
19
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
20
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
21
21
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
22
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
23
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
24
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
25
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
26
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
22
27
|
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; }
|
23
28
|
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; }
|
24
29
|
var horizontalTabItemRoot = exports.horizontalTabItemRoot = function horizontalTabItemRoot(Root) {
|
@@ -42,6 +47,8 @@ var horizontalTabItemRoot = exports.horizontalTabItemRoot = function horizontalT
|
|
42
47
|
tabIndex = props.tabIndex,
|
43
48
|
className = props.className,
|
44
49
|
onClick = props.onClick,
|
50
|
+
_props$maxItemWidth = props.maxItemWidth,
|
51
|
+
maxWidth = _props$maxItemWidth === void 0 ? 'auto' : _props$maxItemWidth,
|
45
52
|
rest = _objectWithoutProperties(props, _excluded);
|
46
53
|
var innerRef = (0, _react.useRef)(null);
|
47
54
|
var ref = (0, _plasmaCore.useForkRef)(outerRef, innerRef);
|
@@ -51,6 +58,7 @@ var horizontalTabItemRoot = exports.horizontalTabItemRoot = function horizontalT
|
|
51
58
|
var animatedClass = animated ? _tokens.classes.tabItemAnimated : undefined;
|
52
59
|
var pilledClass = pilledAttr ? _tokens.classes.tabsPilled : undefined;
|
53
60
|
var selectedClass = isActive || selected ? _tokens.classes.selectedTabsItem : undefined;
|
61
|
+
var truncateClass = maxWidth !== 'auto' ? _tokens.classes.tabsTruncate : undefined;
|
54
62
|
var hasKeyNavigation = itemIndex !== undefined && onIndexChange !== undefined;
|
55
63
|
var navigationTabIndex = !disabled && (refs === null || refs === void 0 ? void 0 : refs.current) === itemIndex ? 0 : -1;
|
56
64
|
(0, _react.useEffect)(function () {
|
@@ -107,9 +115,13 @@ var horizontalTabItemRoot = exports.horizontalTabItemRoot = function horizontalT
|
|
107
115
|
size: size,
|
108
116
|
onFocus: onItemFocus,
|
109
117
|
tabIndex: hasKeyNavigation ? navigationTabIndex : tabIndex,
|
110
|
-
className: (0, _utils.cx)(pilledClass, selectedClass, animatedClass, className),
|
118
|
+
className: (0, _utils.cx)(pilledClass, selectedClass, animatedClass, truncateClass, className),
|
111
119
|
onClick: handleClick
|
112
|
-
}, rest
|
120
|
+
}, rest, {
|
121
|
+
style: _objectSpread(_objectSpread({}, rest.style), {}, {
|
122
|
+
maxWidth: maxWidth
|
123
|
+
})
|
124
|
+
}), /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, contentLeft && /*#__PURE__*/_react["default"].createElement(_HorizontalTabItem.LeftContent, {
|
113
125
|
className: _tokens.classes.tabLeftContent
|
114
126
|
}, contentLeft), /*#__PURE__*/_react["default"].createElement(_HorizontalTabItem.StyledContent, {
|
115
127
|
className: _tokens.classes.tabContent
|
@@ -10,13 +10,6 @@ var _mixins = /*#__PURE__*/require("../../../../../mixins");
|
|
10
10
|
var _tokens = /*#__PURE__*/require("../../../tokens");
|
11
11
|
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); }
|
12
12
|
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; }
|
13
|
-
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;align-items:center;gap:var(", ");padding:var(", ",var(", "));appearance:none;border:none;outline:none;cursor:pointer;-webkit-tap-highlight-color:transparent;&:first-child{margin-left:0;}", ";"], _tokens.tokens.itemContentGap, _tokens.tokens.itemPaddingClear, _tokens.tokens.itemPadding, /*#__PURE__*/(0, _mixins.addFocus)({
|
14
|
-
outlineSize: '0.063rem',
|
15
|
-
outlineOffset: '-0.125rem',
|
16
|
-
outlineColor: /*#__PURE__*/"var(".concat(_tokens.tokens.outlineFocusColor, ")"),
|
17
|
-
outlineRadius: 'calc(var(--plasma_private-outline-radius) + 0.063rem)',
|
18
|
-
customFocusRules: /*#__PURE__*/"\n &.focus-visible:focus,\n &[data-focus-visible-added] {\n &::before {\n z-index: 1;\n outline: none;\n box-shadow: 0 0 0 0.063rem var(".concat(_tokens.tokens.outlineFocusColor, ");\n }\n }\n ")
|
19
|
-
}));
|
20
13
|
var StyledContent = exports.StyledContent = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
21
14
|
componentId: "plasma-new-hope__sc-lremls-0"
|
22
15
|
})(["display:inline-block;width:fit-content;padding:0 var(", ",var(", "));"], _tokens.tokens.itemContentPaddingClear, _tokens.tokens.itemContentPadding);
|
@@ -28,4 +21,11 @@ var RightContent = exports.RightContent = /*#__PURE__*/_styledComponents["defaul
|
|
28
21
|
})(["display:flex;color:inherit;&:hover{color:inherit;}"]);
|
29
22
|
var LeftContent = exports.LeftContent = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
30
23
|
componentId: "plasma-new-hope__sc-lremls-3"
|
31
|
-
})(["display:flex;color:inherit;&:hover{color:inherit;}"]);
|
24
|
+
})(["display:flex;color:inherit;&:hover{color:inherit;}"]);
|
25
|
+
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;align-items:center;white-space:nowrap;gap:var(", ");padding:var(", ",var(", "));appearance:none;border:none;outline:none;cursor:pointer;-webkit-tap-highlight-color:transparent;&:first-child{margin-left:0;}", ";&.", "{", "{overflow:hidden;text-overflow:ellipsis;}", "{overflow:hidden;text-overflow:ellipsis;}}"], _tokens.tokens.itemContentGap, _tokens.tokens.itemPaddingClear, _tokens.tokens.itemPadding, /*#__PURE__*/(0, _mixins.addFocus)({
|
26
|
+
outlineSize: '0.063rem',
|
27
|
+
outlineOffset: '-0.125rem',
|
28
|
+
outlineColor: /*#__PURE__*/"var(".concat(_tokens.tokens.outlineFocusColor, ")"),
|
29
|
+
outlineRadius: 'calc(var(--plasma_private-outline-radius) + 0.063rem)',
|
30
|
+
customFocusRules: /*#__PURE__*/"\n &.focus-visible:focus,\n &[data-focus-visible-added] {\n &::before {\n z-index: 1;\n outline: none;\n box-shadow: 0 0 0 0.063rem var(".concat(_tokens.tokens.outlineFocusColor, ");\n }\n }\n ")
|
31
|
+
}), _tokens.classes.tabsTruncate, StyledContent, TabItemValue);
|
package/styled-components/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.js
CHANGED
@@ -14,10 +14,15 @@ var _VerticalTabItem = /*#__PURE__*/require("./VerticalTabItem.styles");
|
|
14
14
|
var _base = /*#__PURE__*/require("./variations/_view/base");
|
15
15
|
var _base2 = /*#__PURE__*/require("./variations/_size/base");
|
16
16
|
var _base3 = /*#__PURE__*/require("./variations/_disabled/base");
|
17
|
-
var _excluded = ["size", "view", "selected", "disabled", "children", "value", "contentLeft", "contentRight", "onIndexChange", "itemIndex", "tabIndex", "className", "onClick"];
|
17
|
+
var _excluded = ["size", "view", "selected", "disabled", "children", "value", "contentLeft", "contentRight", "onIndexChange", "itemIndex", "tabIndex", "className", "onClick", "maxItemWidth"];
|
18
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
19
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
20
20
|
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); }
|
21
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
22
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
23
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
24
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
25
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
21
26
|
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; }
|
22
27
|
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; }
|
23
28
|
var verticalTabItemRoot = exports.verticalTabItemRoot = function verticalTabItemRoot(Root) {
|
@@ -36,12 +41,15 @@ var verticalTabItemRoot = exports.verticalTabItemRoot = function verticalTabItem
|
|
36
41
|
tabIndex = props.tabIndex,
|
37
42
|
className = props.className,
|
38
43
|
onClick = props.onClick,
|
44
|
+
_props$maxItemWidth = props.maxItemWidth,
|
45
|
+
maxWidth = _props$maxItemWidth === void 0 ? 'auto' : _props$maxItemWidth,
|
39
46
|
rest = _objectWithoutProperties(props, _excluded);
|
40
47
|
var innerRef = (0, _react.useRef)(null);
|
41
48
|
var ref = (0, _plasmaCore.useForkRef)(outerRef, innerRef);
|
42
49
|
var refs = (0, _react.useContext)(_TabsContext.TabsContext);
|
43
50
|
var role = 'tab';
|
44
51
|
var selectedClass = selected ? _tokens.classes.selectedTabsItem : undefined;
|
52
|
+
var truncateClass = maxWidth !== 'auto' ? _tokens.classes.tabsTruncate : undefined;
|
45
53
|
var hasKeyNavigation = itemIndex !== undefined && onIndexChange !== undefined;
|
46
54
|
var navigationTabIndex = !disabled && (refs === null || refs === void 0 ? void 0 : refs.current) === itemIndex ? 0 : -1;
|
47
55
|
(0, _react.useEffect)(function () {
|
@@ -94,9 +102,13 @@ var verticalTabItemRoot = exports.verticalTabItemRoot = function verticalTabItem
|
|
94
102
|
size: size,
|
95
103
|
onFocus: onItemFocus,
|
96
104
|
tabIndex: hasKeyNavigation ? navigationTabIndex : tabIndex,
|
97
|
-
className: (0, _utils.cx)(selectedClass, className),
|
105
|
+
className: (0, _utils.cx)(selectedClass, truncateClass, className),
|
98
106
|
onClick: handleClick
|
99
|
-
}, rest
|
107
|
+
}, rest, {
|
108
|
+
style: _objectSpread(_objectSpread({}, rest.style), {}, {
|
109
|
+
maxWidth: maxWidth
|
110
|
+
})
|
111
|
+
}), /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, contentLeft && /*#__PURE__*/_react["default"].createElement(_VerticalTabItem.LeftContent, {
|
100
112
|
className: _tokens.classes.tabLeftContent
|
101
113
|
}, contentLeft), /*#__PURE__*/_react["default"].createElement(_VerticalTabItem.StyledContent, {
|
102
114
|
className: _tokens.classes.tabContent
|
package/styled-components/cjs/components/Tabs/ui/vertical/VerticalTabItem/VerticalTabItem.styles.js
CHANGED
@@ -12,22 +12,22 @@ var _templateObject;
|
|
12
12
|
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); }
|
13
13
|
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; }
|
14
14
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
15
|
-
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteral(["\n position: relative;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n box-sizing: border-box;\n align-items: center;\n\n gap: var(", ");\n padding: var(", ");\n\n appearance: none;\n border: none;\n outline: none;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n\n ", ";\n"])), _tokens.tokens.itemContentGap, _tokens.tokens.itemPaddingOrientationVertical, /*#__PURE__*/(0, _mixins.addFocus)({
|
16
|
-
outlineSize: '0.063rem',
|
17
|
-
outlineOffset: '-0.125rem',
|
18
|
-
outlineColor: /*#__PURE__*/"var(".concat(_tokens.tokens.outlineFocusColor, ")"),
|
19
|
-
outlineRadius: 'calc(var(--plasma_private-outline-radius) + 0.063rem)',
|
20
|
-
customFocusRules: /*#__PURE__*/"\n &.focus-visible:focus,\n &[data-focus-visible-added] {\n &::before {\n z-index: 1;\n outline: none;\n box-shadow: 0 0 0 0.063rem var(".concat(_tokens.tokens.outlineFocusColor, ");\n }\n }\n ")
|
21
|
-
}));
|
22
15
|
var StyledContent = exports.StyledContent = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
23
16
|
componentId: "plasma-new-hope__sc-1pflgj8-0"
|
24
17
|
})(["display:inline-block;width:fit-content;padding:0 var(", ",var(", "));"], _tokens.tokens.itemContentPaddingClear, _tokens.tokens.itemContentPadding);
|
25
18
|
var TabItemValue = exports.TabItemValue = /*#__PURE__*/_styledComponents["default"].span.withConfig({
|
26
19
|
componentId: "plasma-new-hope__sc-1pflgj8-1"
|
27
|
-
})(["color:var(", ");font-family:var(", ",var(", "));font-size:var(", ",var(", "));font-style:var(", ",var(", "));font-weight:var(", ",var(", "));letter-spacing:var(", ",var(", "));line-height:var(", ",var(", "));"], _tokens.tokens.itemValueColor, _tokens.tokens.valueFontFamily, _tokens.tokens.fontFamily, _tokens.tokens.valueFontSize, _tokens.tokens.fontSize, _tokens.tokens.valueFontStyle, _tokens.tokens.fontStyle, _tokens.tokens.valueFontWeight, _tokens.tokens.fontWeight, _tokens.tokens.valueLetterSpacing, _tokens.tokens.letterSpacing, _tokens.tokens.valueLineHeight, _tokens.tokens.lineHeight);
|
20
|
+
})(["white-space:nowrap;color:var(", ");font-family:var(", ",var(", "));font-size:var(", ",var(", "));font-style:var(", ",var(", "));font-weight:var(", ",var(", "));letter-spacing:var(", ",var(", "));line-height:var(", ",var(", "));"], _tokens.tokens.itemValueColor, _tokens.tokens.valueFontFamily, _tokens.tokens.fontFamily, _tokens.tokens.valueFontSize, _tokens.tokens.fontSize, _tokens.tokens.valueFontStyle, _tokens.tokens.fontStyle, _tokens.tokens.valueFontWeight, _tokens.tokens.fontWeight, _tokens.tokens.valueLetterSpacing, _tokens.tokens.letterSpacing, _tokens.tokens.valueLineHeight, _tokens.tokens.lineHeight);
|
28
21
|
var RightContent = exports.RightContent = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
29
22
|
componentId: "plasma-new-hope__sc-1pflgj8-2"
|
30
23
|
})(["display:flex;color:inherit;&:hover{color:inherit;}"]);
|
31
24
|
var LeftContent = exports.LeftContent = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
32
25
|
componentId: "plasma-new-hope__sc-1pflgj8-3"
|
33
|
-
})(["display:flex;color:inherit;&:hover{color:inherit;}"]);
|
26
|
+
})(["display:flex;color:inherit;&:hover{color:inherit;}"]);
|
27
|
+
var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteral(["\n position: relative;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n box-sizing: border-box;\n white-space: nowrap;\n\n gap: var(", ");\n padding: var(", ");\n\n appearance: none;\n border: none;\n outline: none;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n\n ", ";\n\n &.", " {\n ", " {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n ", " {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n }\n"])), _tokens.tokens.itemContentGap, _tokens.tokens.itemPaddingOrientationVertical, /*#__PURE__*/(0, _mixins.addFocus)({
|
28
|
+
outlineSize: '0.063rem',
|
29
|
+
outlineOffset: '-0.125rem',
|
30
|
+
outlineColor: /*#__PURE__*/"var(".concat(_tokens.tokens.outlineFocusColor, ")"),
|
31
|
+
outlineRadius: 'calc(var(--plasma_private-outline-radius) + 0.063rem)',
|
32
|
+
customFocusRules: /*#__PURE__*/"\n &.focus-visible:focus,\n &[data-focus-visible-added] {\n &::before {\n z-index: 1;\n outline: none;\n box-shadow: 0 0 0 0.063rem var(".concat(_tokens.tokens.outlineFocusColor, ");\n }\n }\n ")
|
33
|
+
}), _tokens.classes.tabsTruncate, StyledContent, TabItemValue);
|
@@ -31,6 +31,9 @@ const meta: Meta<typeof Badge> = {
|
|
31
31
|
control: { type: 'boolean' },
|
32
32
|
if: { arg: 'clear', truthy: false },
|
33
33
|
},
|
34
|
+
maxWidth: {
|
35
|
+
control: { type: 'text' },
|
36
|
+
},
|
34
37
|
...disableProps(['contentLeft', 'contentRight']),
|
35
38
|
},
|
36
39
|
};
|
@@ -64,7 +67,7 @@ export const Default: Story = {
|
|
64
67
|
},
|
65
68
|
},
|
66
69
|
args: {
|
67
|
-
text: 'Hello',
|
70
|
+
text: 'Hello Kitty',
|
68
71
|
view: 'default',
|
69
72
|
size: 'm',
|
70
73
|
enableContentLeft: false,
|
@@ -72,6 +75,7 @@ export const Default: Story = {
|
|
72
75
|
clear: false,
|
73
76
|
pilled: false,
|
74
77
|
transparent: false,
|
78
|
+
maxWidth: '',
|
75
79
|
},
|
76
80
|
render: ({ enableContentLeft, enableContentRight, size, ...rest }: StoryProps) => {
|
77
81
|
const iconSize = size === 'l' ? '1rem' : '0.75rem';
|
@@ -29,6 +29,7 @@ type CustomStoryTabsProps = {
|
|
29
29
|
|
30
30
|
const contentLeftOptions = ['none', 'icon'];
|
31
31
|
const contentRightOptions = ['none', 'counter', 'icon'];
|
32
|
+
const labels = ['Label', 'Middle label', 'Very long label'];
|
32
33
|
|
33
34
|
const getContentLeft = (contentLeftOption: string, size: string) => {
|
34
35
|
const iconSize = size === 'xs' ? 'xs' : 's';
|
@@ -76,6 +77,12 @@ const meta: Meta<StoryTabsProps> = {
|
|
76
77
|
},
|
77
78
|
if: { arg: 'helperText', eq: '' },
|
78
79
|
},
|
80
|
+
maxItemWidth: {
|
81
|
+
control: {
|
82
|
+
type: 'text',
|
83
|
+
},
|
84
|
+
if: { arg: 'stretch', truthy: false },
|
85
|
+
},
|
79
86
|
},
|
80
87
|
};
|
81
88
|
|
@@ -90,13 +97,14 @@ const StoryHorizontalDefault = (props: HorizontalStoryTabsProps) => {
|
|
90
97
|
contentRight: contentRightOption,
|
91
98
|
hasDivider,
|
92
99
|
stretch,
|
100
|
+
maxItemWidth,
|
93
101
|
helperText,
|
94
102
|
} = props;
|
95
103
|
const items = Array(itemQuantity).fill(0);
|
96
104
|
const [index, setIndex] = useState(0);
|
97
105
|
|
98
106
|
return (
|
99
|
-
<Tabs view="divider" hasDivider={hasDivider} stretch={stretch} disabled={disabled} size={size}>
|
107
|
+
<Tabs clip="none" view="divider" hasDivider={hasDivider} stretch={stretch} disabled={disabled} size={size}>
|
100
108
|
{items.map((_, i) => {
|
101
109
|
if (helperText !== '') {
|
102
110
|
return (
|
@@ -110,8 +118,9 @@ const StoryHorizontalDefault = (props: HorizontalStoryTabsProps) => {
|
|
110
118
|
value={helperText}
|
111
119
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
112
120
|
size={size as Size}
|
121
|
+
maxItemWidth={maxItemWidth}
|
113
122
|
>
|
114
|
-
{
|
123
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
115
124
|
</TabItem>
|
116
125
|
);
|
117
126
|
}
|
@@ -127,8 +136,9 @@ const StoryHorizontalDefault = (props: HorizontalStoryTabsProps) => {
|
|
127
136
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
128
137
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
129
138
|
size={size as Size}
|
139
|
+
maxItemWidth={maxItemWidth}
|
130
140
|
>
|
131
|
-
{
|
141
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
132
142
|
</TabItem>
|
133
143
|
);
|
134
144
|
})}
|
@@ -147,6 +157,7 @@ const StoryHorizontalScroll = (props: HorizontalStoryTabsProps) => {
|
|
147
157
|
hasDivider,
|
148
158
|
helperText,
|
149
159
|
width,
|
160
|
+
maxItemWidth,
|
150
161
|
} = props;
|
151
162
|
const items = Array(itemQuantity).fill(0);
|
152
163
|
const [index, setIndex] = useState(0);
|
@@ -166,8 +177,9 @@ const StoryHorizontalScroll = (props: HorizontalStoryTabsProps) => {
|
|
166
177
|
value={helperText}
|
167
178
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
168
179
|
size={size as Size}
|
180
|
+
maxItemWidth={maxItemWidth}
|
169
181
|
>
|
170
|
-
{
|
182
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
171
183
|
</TabItem>
|
172
184
|
);
|
173
185
|
}
|
@@ -183,8 +195,9 @@ const StoryHorizontalScroll = (props: HorizontalStoryTabsProps) => {
|
|
183
195
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
184
196
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
185
197
|
size={size as Size}
|
198
|
+
maxItemWidth={maxItemWidth}
|
186
199
|
>
|
187
|
-
{
|
200
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
188
201
|
</TabItem>
|
189
202
|
);
|
190
203
|
})}
|
@@ -202,6 +215,7 @@ const StoryHorizontalShowAll = (props: HorizontalStoryTabsProps) => {
|
|
202
215
|
contentRight: contentRightOption,
|
203
216
|
hasDivider,
|
204
217
|
helperText,
|
218
|
+
maxItemWidth,
|
205
219
|
} = props;
|
206
220
|
const maxItemQuantity = 3;
|
207
221
|
const items = Array(itemQuantity).fill(0);
|
@@ -234,8 +248,9 @@ const StoryHorizontalShowAll = (props: HorizontalStoryTabsProps) => {
|
|
234
248
|
value={helperText}
|
235
249
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
236
250
|
size={size as Size}
|
251
|
+
maxItemWidth={maxItemWidth}
|
237
252
|
>
|
238
|
-
{
|
253
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
239
254
|
</TabItem>
|
240
255
|
);
|
241
256
|
}
|
@@ -251,8 +266,9 @@ const StoryHorizontalShowAll = (props: HorizontalStoryTabsProps) => {
|
|
251
266
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
252
267
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
253
268
|
size={size as Size}
|
269
|
+
maxItemWidth={maxItemWidth}
|
254
270
|
>
|
255
|
-
{
|
271
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
256
272
|
</TabItem>
|
257
273
|
);
|
258
274
|
})}
|
@@ -269,6 +285,7 @@ const StoryHorizontalShowAll = (props: HorizontalStoryTabsProps) => {
|
|
269
285
|
tabIndex={!disabled ? 0 : -1}
|
270
286
|
disabled={disabled}
|
271
287
|
size={size as Size}
|
288
|
+
maxItemWidth="auto"
|
272
289
|
>
|
273
290
|
ShowAll
|
274
291
|
</TabItem>
|
@@ -285,9 +302,10 @@ export const HorizontalTabs: StoryObj<HorizontalStoryTabsProps> = {
|
|
285
302
|
disabled: false,
|
286
303
|
hasDivider: true,
|
287
304
|
helperText: '',
|
288
|
-
itemQuantity:
|
305
|
+
itemQuantity: 6,
|
289
306
|
stretch: false,
|
290
307
|
width: '15rem',
|
308
|
+
maxItemWidth: '',
|
291
309
|
},
|
292
310
|
argTypes: {
|
293
311
|
contentLeft: {
|
@@ -343,6 +361,7 @@ const StoryVerticalDefault = (props: VerticalStoryTabsProps) => {
|
|
343
361
|
contentRight: contentRightOption,
|
344
362
|
hasDivider,
|
345
363
|
helperText,
|
364
|
+
maxItemWidth,
|
346
365
|
} = props;
|
347
366
|
const items = Array(itemQuantity).fill(0);
|
348
367
|
const [index, setIndex] = useState(0);
|
@@ -363,8 +382,9 @@ const StoryVerticalDefault = (props: VerticalStoryTabsProps) => {
|
|
363
382
|
value={helperText}
|
364
383
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
365
384
|
size={size as Size}
|
385
|
+
maxItemWidth={maxItemWidth}
|
366
386
|
>
|
367
|
-
{
|
387
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
368
388
|
</TabItem>
|
369
389
|
);
|
370
390
|
}
|
@@ -381,8 +401,9 @@ const StoryVerticalDefault = (props: VerticalStoryTabsProps) => {
|
|
381
401
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
382
402
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
383
403
|
size={size as Size}
|
404
|
+
maxItemWidth={maxItemWidth}
|
384
405
|
>
|
385
|
-
{
|
406
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
386
407
|
</TabItem>
|
387
408
|
);
|
388
409
|
})}
|
@@ -401,6 +422,7 @@ const StoryVerticalScroll = (props: VerticalStoryTabsProps) => {
|
|
401
422
|
hasDivider,
|
402
423
|
helperText,
|
403
424
|
height,
|
425
|
+
maxItemWidth,
|
404
426
|
} = props;
|
405
427
|
const items = Array(itemQuantity).fill(0);
|
406
428
|
const [index, setIndex] = useState(0);
|
@@ -428,8 +450,9 @@ const StoryVerticalScroll = (props: VerticalStoryTabsProps) => {
|
|
428
450
|
value={helperText}
|
429
451
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
430
452
|
size={size as Size}
|
453
|
+
maxItemWidth={maxItemWidth}
|
431
454
|
>
|
432
|
-
{
|
455
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
433
456
|
</TabItem>
|
434
457
|
);
|
435
458
|
}
|
@@ -446,8 +469,9 @@ const StoryVerticalScroll = (props: VerticalStoryTabsProps) => {
|
|
446
469
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
447
470
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
448
471
|
size={size as Size}
|
472
|
+
maxItemWidth={maxItemWidth}
|
449
473
|
>
|
450
|
-
{
|
474
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
451
475
|
</TabItem>
|
452
476
|
);
|
453
477
|
})}
|
@@ -465,6 +489,7 @@ const StoryVerticalShowAll = (props: VerticalStoryTabsProps) => {
|
|
465
489
|
contentRight: contentRightOption,
|
466
490
|
hasDivider,
|
467
491
|
helperText,
|
492
|
+
maxItemWidth,
|
468
493
|
} = props;
|
469
494
|
const maxItemQuantity = 3;
|
470
495
|
const items = Array(itemQuantity).fill(0);
|
@@ -498,8 +523,9 @@ const StoryVerticalShowAll = (props: VerticalStoryTabsProps) => {
|
|
498
523
|
value={helperText}
|
499
524
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
500
525
|
size={size as Size}
|
526
|
+
maxItemWidth={maxItemWidth}
|
501
527
|
>
|
502
|
-
{
|
528
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
503
529
|
</TabItem>
|
504
530
|
);
|
505
531
|
}
|
@@ -516,8 +542,9 @@ const StoryVerticalShowAll = (props: VerticalStoryTabsProps) => {
|
|
516
542
|
contentLeft={getContentLeft(contentLeftOption, size as Size)}
|
517
543
|
contentRight={getContentRight(contentRightOption, size as Size)}
|
518
544
|
size={size as Size}
|
545
|
+
maxItemWidth={maxItemWidth}
|
519
546
|
>
|
520
|
-
{
|
547
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
521
548
|
</TabItem>
|
522
549
|
);
|
523
550
|
})}
|
@@ -534,6 +561,7 @@ const StoryVerticalShowAll = (props: VerticalStoryTabsProps) => {
|
|
534
561
|
tabIndex={!disabled ? 0 : -1}
|
535
562
|
disabled={disabled}
|
536
563
|
size={size as Size}
|
564
|
+
maxItemWidth="auto"
|
537
565
|
>
|
538
566
|
ShowAll
|
539
567
|
</TabItem>
|
@@ -548,10 +576,11 @@ export const VerticalTabs: StoryObj<VerticalStoryTabsProps> = {
|
|
548
576
|
size: 'xs',
|
549
577
|
disabled: false,
|
550
578
|
hasDivider: true,
|
551
|
-
itemQuantity:
|
579
|
+
itemQuantity: 6,
|
552
580
|
orientation: 'vertical',
|
553
581
|
helperText: '',
|
554
582
|
height: '10rem',
|
583
|
+
maxItemWidth: '',
|
555
584
|
},
|
556
585
|
argTypes: {
|
557
586
|
contentLeft: {
|
@@ -604,7 +633,7 @@ export const VerticalTabs: StoryObj<VerticalStoryTabsProps> = {
|
|
604
633
|
};
|
605
634
|
|
606
635
|
const StoryHeaderDefault = (props: HorizontalStoryTabsProps) => {
|
607
|
-
const { disabled, itemQuantity, size, helperText } = props;
|
636
|
+
const { disabled, itemQuantity, size, helperText, maxItemWidth } = props;
|
608
637
|
const items = Array(itemQuantity).fill(0);
|
609
638
|
const [index, setIndex] = useState(0);
|
610
639
|
|
@@ -620,6 +649,7 @@ const StoryHeaderDefault = (props: HorizontalStoryTabsProps) => {
|
|
620
649
|
disabled={disabled}
|
621
650
|
value={helperText}
|
622
651
|
size={size as HeaderSize}
|
652
|
+
maxItemWidth={maxItemWidth}
|
623
653
|
>
|
624
654
|
{`Label${i + 1}`}
|
625
655
|
</TabItem>
|
@@ -629,7 +659,7 @@ const StoryHeaderDefault = (props: HorizontalStoryTabsProps) => {
|
|
629
659
|
};
|
630
660
|
|
631
661
|
const StoryHeaderScroll = (props: HorizontalStoryTabsProps) => {
|
632
|
-
const { disabled, itemQuantity, size, helperText, width } = props;
|
662
|
+
const { disabled, itemQuantity, size, helperText, width, maxItemWidth } = props;
|
633
663
|
const items = Array(itemQuantity).fill(0);
|
634
664
|
const [index, setIndex] = useState(0);
|
635
665
|
|
@@ -645,8 +675,9 @@ const StoryHeaderScroll = (props: HorizontalStoryTabsProps) => {
|
|
645
675
|
disabled={disabled}
|
646
676
|
value={helperText}
|
647
677
|
size={size as HeaderSize}
|
678
|
+
maxItemWidth={maxItemWidth}
|
648
679
|
>
|
649
|
-
{
|
680
|
+
{`${labels[i % labels.length]} ${i + 1}`}
|
650
681
|
</TabItem>
|
651
682
|
))}
|
652
683
|
</Tabs>
|
@@ -658,8 +689,9 @@ export const HeaderTabs: StoryObj<HorizontalStoryTabsProps> = {
|
|
658
689
|
size: 'h5',
|
659
690
|
disabled: false,
|
660
691
|
helperText: '',
|
661
|
-
itemQuantity:
|
692
|
+
itemQuantity: 4,
|
662
693
|
width: '12rem',
|
694
|
+
maxItemWidth: '',
|
663
695
|
},
|
664
696
|
argTypes: {
|
665
697
|
clip: {
|