@salutejs/plasma-new-hope 0.134.0-canary.1406.10622689231.0 → 0.134.0-canary.1406.10628421547.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Combobox/ComboboxNew/Combobox.css +5 -3
- package/cjs/components/Combobox/ComboboxNew/Combobox.js +8 -2
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.styles.js +19 -2
- package/cjs/components/Combobox/ComboboxNew/Combobox.styles.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/{Combobox.styles_1bdcydw.css → Combobox.styles_1vz3bs3.css} +2 -0
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.css +4 -2
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +3 -1
- package/cjs/index.css +3 -1
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +22 -15
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.styles.js +13 -4
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +9 -2
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.styles.js +13 -4
- package/es/components/Combobox/ComboboxNew/Combobox.css +5 -3
- package/es/components/Combobox/ComboboxNew/Combobox.js +9 -3
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.styles.js +18 -3
- package/es/components/Combobox/ComboboxNew/Combobox.styles.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/{Combobox.styles_1bdcydw.css → Combobox.styles_1vz3bs3.css} +2 -0
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.css +4 -2
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +3 -1
- package/es/index.css +3 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +22 -15
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.styles.js +8 -1
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +9 -2
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.styles.js +8 -1
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.styles.d.ts +2 -0
- package/types/components/Combobox/ComboboxNew/Combobox.styles.d.ts.map +1 -1
@@ -12,13 +12,15 @@ import React, { forwardRef, useState, useReducer, useMemo, createContext, useLay
|
|
12
12
|
import { safeUseId, useForkRef } from '@salutejs/plasma-core';
|
13
13
|
import { isEmpty } from '../../../utils';
|
14
14
|
import { useOutsideClick } from '../../../hooks';
|
15
|
+
import { sizeToIconSize } from '../../Select/utils';
|
16
|
+
import { classes } from './Combobox.tokens';
|
15
17
|
import { FloatingPopover } from './FloatingPopover';
|
16
18
|
import { useKeyNavigation, getItemByFocused } from './hooks/useKeyboardNavigation';
|
17
19
|
import { initialItemsTransform, updateAncestors, updateDescendants, updateSingleAncestors, filterItems, getItemId } from './utils';
|
18
20
|
import { Inner, StyledTextField } from './ui';
|
19
21
|
import { pathReducer, focusedPathReducer } from './reducers';
|
20
22
|
import { getPathMap, getTreeMaps } from './hooks/getPathMaps';
|
21
|
-
import { Ul, base } from './Combobox.styles';
|
23
|
+
import { Ul, base, StyledArrow, IconArrowWrapper } from './Combobox.styles';
|
22
24
|
import { base as viewCSS } from './variations/_view/base';
|
23
25
|
import { base as sizeCSS } from './variations/_size/base';
|
24
26
|
export var Context = /*#__PURE__*/createContext({});
|
@@ -296,6 +298,7 @@ export var comboboxRoot = function comboboxRoot(Root) {
|
|
296
298
|
}, [value]);
|
297
299
|
var isCurrentListOpen = Boolean(path[0]);
|
298
300
|
var activeDescendantItemValue = ((_getItemByFocused = getItemByFocused(focusedPath, focusedToValueMap)) === null || _getItemByFocused === void 0 ? void 0 : _getItemByFocused.value) || '';
|
301
|
+
var withArrowInverse = isCurrentListOpen ? classes.arrowInverse : undefined;
|
299
302
|
return /*#__PURE__*/React.createElement(Root, {
|
300
303
|
size: size,
|
301
304
|
view: view,
|
@@ -337,7 +340,11 @@ export var comboboxRoot = function comboboxRoot(Root) {
|
|
337
340
|
label: label,
|
338
341
|
placeholder: placeholder,
|
339
342
|
contentLeft: contentLeft,
|
340
|
-
contentRight:
|
343
|
+
contentRight: /*#__PURE__*/React.createElement(IconArrowWrapper, null, /*#__PURE__*/React.createElement(StyledArrow, {
|
344
|
+
color: "inherit",
|
345
|
+
size: sizeToIconSize(size),
|
346
|
+
className: withArrowInverse
|
347
|
+
})),
|
341
348
|
textBefore: textBefore,
|
342
349
|
textAfter: textAfter,
|
343
350
|
onKeyDown: onKeyDown,
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import styled from 'styled-components';
|
2
2
|
import { css } from 'styled-components';
|
3
|
-
import {
|
3
|
+
import { IconDisclosureDownCentered } from '../../_Icon';
|
4
|
+
import { tokens, constants, classes } from './Combobox.tokens';
|
4
5
|
export var Ul = /*#__PURE__*/styled.ul.withConfig({
|
5
6
|
componentId: "plasma-new-hope__sc-2kddkg-0"
|
6
7
|
})(["box-sizing:border-box;background:var(", ");box-shadow:", ";border-radius:var(", ");width:", ";height:", ";overflow:", ";margin:", ";padding:var(", ") 0;"], constants.background, constants.boxShadow, tokens.borderRadius, function (_ref) {
|
@@ -16,4 +17,10 @@ export var Ul = /*#__PURE__*/styled.ul.withConfig({
|
|
16
17
|
var isInnerUl = _ref4.isInnerUl;
|
17
18
|
return isInnerUl ? "calc(var(".concat(tokens.padding, ") * -1) 0 0 0") : 0;
|
18
19
|
}, tokens.padding);
|
20
|
+
export var IconArrowWrapper = /*#__PURE__*/styled.div.withConfig({
|
21
|
+
componentId: "plasma-new-hope__sc-2kddkg-1"
|
22
|
+
})(["line-height:0;color:var(", ");.", "{transform:rotate(-180deg);}"], constants.disclosureIconColor, classes.arrowInverse);
|
23
|
+
export var StyledArrow = /*#__PURE__*/styled(IconDisclosureDownCentered).withConfig({
|
24
|
+
componentId: "plasma-new-hope__sc-2kddkg-2"
|
25
|
+
})([""]);
|
19
26
|
export var base = /*#__PURE__*/css([""]);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../../src/components/Combobox/ComboboxNew/Combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4F,MAAM,OAAO,CAAC;AAIjH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
1
|
+
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../../src/components/Combobox/ComboboxNew/Combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4F,MAAM,OAAO,CAAC;AAIjH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAoB7C,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKnE,eAAO,MAAM,OAAO,4BAAgD,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,YAAY,SAAU,UAAU,gBAAgB,EAAE,KAAK,aAAa,EAAE,OAAO,CAAC,CAAC,2FAmWtF,CAAC;AAEP,eAAO,MAAM,cAAc;;;mBArWQ,UAAU,gBAAgB,EAAE,KAAK,aAAa,EAAE,OAAO,CAAC,CAAC;;;;;;;;;;;;;;;;;;CA4X3F,CAAC"}
|
@@ -6,5 +6,7 @@ export declare const Ul: import("@linaria/react").StyledComponent<import("react"
|
|
6
6
|
listWidth?: ComboboxProps['listWidth'];
|
7
7
|
isInnerUl?: boolean | undefined;
|
8
8
|
}>;
|
9
|
+
export declare const IconArrowWrapper: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
|
10
|
+
export declare const StyledArrow: import("@linaria/react").StyledMeta & import("react").FC<import("../../_Icon/IconRoot").IconProps>;
|
9
11
|
export declare const base: import("@linaria/core").LinariaClassName;
|
10
12
|
//# sourceMappingURL=Combobox.styles.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Combobox.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Combobox/ComboboxNew/Combobox.styles.ts"],"names":[],"mappings":";
|
1
|
+
{"version":3,"file":"Combobox.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Combobox/ComboboxNew/Combobox.styles.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,eAAO,MAAM,EAAE;mBACI,aAAa,CAAC,cAAc,CAAC;iBAC/B,aAAa,CAAC,YAAY,CAAC;gBAC5B,aAAa,CAAC,WAAW,CAAC;;EAezC,CAAC;AAEF,eAAO,MAAM,gBAAgB,qKAO5B,CAAC;AAEF,eAAO,MAAM,WAAW,oGAAuC,CAAC;AAEhE,eAAO,MAAM,IAAI,0CAAQ,CAAC"}
|