@hh.ru/magritte-ui-chips 7.0.45 → 7.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CheckableChip.d.ts +1 -1
- package/CheckableChip.js +47 -11
- package/CheckableChip.js.map +1 -1
- package/ChipContent-CME3IyV3.js +45 -0
- package/{ChipContent-DKGY0_mZ.js.map → ChipContent-CME3IyV3.js.map} +1 -1
- package/ChipContent.d.ts +1 -1
- package/ChipContent.js +1 -1
- package/ChipsContainer.d.ts +1 -1
- package/ChipsContainer.js +66 -39
- package/ChipsContainer.js.map +1 -1
- package/CustomChip.d.ts +2 -2
- package/CustomChip.js +96 -29
- package/CustomChip.js.map +1 -1
- package/defaultProps.d.ts +1 -1
- package/defaultProps.js +1 -6
- package/defaultProps.js.map +1 -1
- package/index.css +1371 -1371
- package/index.d.ts +5 -5
- package/index.js +1 -1
- package/index.mock.d.ts +2 -2
- package/index.mock.js +14 -6
- package/index.mock.js.map +1 -1
- package/package.json +6 -6
- package/ChipContent-DKGY0_mZ.js +0 -23
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export { ChipDefaultPropsContext } from '
|
|
5
|
-
export { type ChipStyle, type CustomChipProps, type CheckableChipProps } from '
|
|
1
|
+
export * from './CheckableChip';
|
|
2
|
+
export * from './CustomChip';
|
|
3
|
+
export * from './ChipsContainer';
|
|
4
|
+
export { ChipDefaultPropsContext } from './defaultProps';
|
|
5
|
+
export { type ChipStyle, type CustomChipProps, type CheckableChipProps } from './types';
|
package/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import 'react/jsx-runtime';
|
|
|
7
7
|
import 'react';
|
|
8
8
|
import 'classnames';
|
|
9
9
|
import '@hh.ru/magritte-common-use-disabled';
|
|
10
|
-
import './ChipContent-
|
|
10
|
+
import './ChipContent-CME3IyV3.js';
|
|
11
11
|
import '@hh.ru/magritte-ui-typography';
|
|
12
12
|
import '@hh.ru/magritte-ui-icon/variants/icon';
|
|
13
13
|
import '@hh.ru/magritte-ui-scrollable-container';
|
package/index.mock.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ForwardRefExoticComponent } from 'react';
|
|
2
|
-
export { ChipDefaultPropsContext } from '
|
|
3
|
-
export { type ChipStyle, type CheckableChipProps, type CustomChipProps } from '
|
|
2
|
+
export { ChipDefaultPropsContext } from './defaultProps';
|
|
3
|
+
export { type ChipStyle, type CheckableChipProps, type CustomChipProps } from './types';
|
|
4
4
|
export declare const CheckableChip: ForwardRefExoticComponent<Record<string, unknown>>;
|
|
5
5
|
export declare const CustomChip: ForwardRefExoticComponent<Record<string, unknown>>;
|
|
6
6
|
export declare const ChipsContainer: ForwardRefExoticComponent<Record<string, unknown>>;
|
package/index.mock.js
CHANGED
|
@@ -3,13 +3,21 @@ import { mockComponent } from '@hh.ru/magritte-ui-mock-component';
|
|
|
3
3
|
export { ChipDefaultPropsContext } from './defaultProps.js';
|
|
4
4
|
import '@hh.ru/magritte-internal-default-props-context';
|
|
5
5
|
|
|
6
|
-
const CheckableChip = mockComponent(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
const CheckableChip = mockComponent(
|
|
7
|
+
"CheckableChip",
|
|
8
|
+
void 0,
|
|
9
|
+
{ withChildren: true }
|
|
10
|
+
);
|
|
11
|
+
const CustomChip = mockComponent("CustomChip", void 0, {
|
|
12
|
+
withChildren: true
|
|
12
13
|
});
|
|
14
|
+
const ChipsContainer = mockComponent(
|
|
15
|
+
"ChipsContainer",
|
|
16
|
+
void 0,
|
|
17
|
+
{
|
|
18
|
+
withChildren: true
|
|
19
|
+
}
|
|
20
|
+
);
|
|
13
21
|
|
|
14
22
|
export { CheckableChip, ChipsContainer, CustomChip };
|
|
15
23
|
//# sourceMappingURL=index.mock.js.map
|
package/index.mock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mock.js","sources":["src/index.mock.ts"],"sourcesContent":["import { ForwardRefExoticComponent } from 'react';\n\nimport { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport { ChipDefaultPropsContext } from '@hh.ru/magritte-ui-chips/defaultProps';\nexport { type ChipStyle, type CheckableChipProps, type CustomChipProps } from '@hh.ru/magritte-ui-chips/types';\n\nexport const CheckableChip: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'CheckableChip',\n undefined,\n { withChildren: true }\n);\n\nexport const CustomChip: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent('CustomChip', undefined, {\n withChildren: true,\n});\n\nexport const ChipsContainer: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'ChipsContainer',\n undefined,\n {\n withChildren: true,\n }\n);\n"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"index.mock.js","sources":["src/index.mock.ts"],"sourcesContent":["import { ForwardRefExoticComponent } from 'react';\n\nimport { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport { ChipDefaultPropsContext } from '@hh.ru/magritte-ui-chips/defaultProps';\nexport { type ChipStyle, type CheckableChipProps, type CustomChipProps } from '@hh.ru/magritte-ui-chips/types';\n\nexport const CheckableChip: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'CheckableChip',\n undefined,\n { withChildren: true }\n);\n\nexport const CustomChip: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent('CustomChip', undefined, {\n withChildren: true,\n});\n\nexport const ChipsContainer: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent(\n 'ChipsContainer',\n undefined,\n {\n withChildren: true,\n }\n);\n"],"names":[],"mappings":";;;;AAOO,MAAM,aAAoE,GAAA,aAAA;AAAA,EAC7E,eAAA;AAAA,EACA,KAAA,CAAA;AAAA,EACA,EAAE,cAAc,IAAK,EAAA;AACzB,EAAA;AAEa,MAAA,UAAA,GAAiE,aAAc,CAAA,YAAA,EAAc,KAAW,CAAA,EAAA;AAAA,EACjH,YAAc,EAAA,IAAA;AAClB,CAAC,EAAA;AAEM,MAAM,cAAqE,GAAA,aAAA;AAAA,EAC9E,gBAAA;AAAA,EACA,KAAA,CAAA;AAAA,EACA;AAAA,IACI,YAAc,EAAA,IAAA;AAAA,GAClB;AACJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-chips",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.47",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@hh.ru/magritte-common-keyboard": "4.3.6",
|
|
27
27
|
"@hh.ru/magritte-common-use-disabled": "1.0.16",
|
|
28
|
-
"@hh.ru/magritte-design-tokens": "
|
|
28
|
+
"@hh.ru/magritte-design-tokens": "26.0.1",
|
|
29
29
|
"@hh.ru/magritte-internal-default-props-context": "1.0.3",
|
|
30
30
|
"@hh.ru/magritte-types": "5.0.8",
|
|
31
31
|
"@hh.ru/magritte-ui-breakpoint": "6.1.2",
|
|
32
|
-
"@hh.ru/magritte-ui-icon": "15.1.
|
|
32
|
+
"@hh.ru/magritte-ui-icon": "15.1.5",
|
|
33
33
|
"@hh.ru/magritte-ui-mock-component": "1.1.8",
|
|
34
|
-
"@hh.ru/magritte-ui-scrollable-container": "6.5.
|
|
35
|
-
"@hh.ru/magritte-ui-typography": "5.3.
|
|
34
|
+
"@hh.ru/magritte-ui-scrollable-container": "6.5.3",
|
|
35
|
+
"@hh.ru/magritte-ui-typography": "5.3.16"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"classnames": ">=2.3.2",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "f6539d7a0e7cd42dd851458db1de04a748bbee03"
|
|
45
45
|
}
|
package/ChipContent-DKGY0_mZ.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import './index.css';
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { cloneElement } from 'react';
|
|
4
|
-
import classnames from 'classnames';
|
|
5
|
-
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
6
|
-
|
|
7
|
-
var chipsStyles = {"input":"magritte-input___ctH9G_7-0-45","chip":"magritte-chip___uulZ9_7-0-45","chip-wrapper":"magritte-chip-wrapper___os8tP_7-0-45","chipWrapper":"magritte-chip-wrapper___os8tP_7-0-45","chip-wrapper__disabled":"magritte-chip-wrapper__disabled___mHM6-_7-0-45","chipWrapperDisabled":"magritte-chip-wrapper__disabled___mHM6-_7-0-45","content":"magritte-content___17f1s_7-0-45","size-extra-small":"magritte-size-extra-small___rVVLp_7-0-45","sizeExtraSmall":"magritte-size-extra-small___rVVLp_7-0-45","content__deletable":"magritte-content__deletable___iqF4W_7-0-45","contentDeletable":"magritte-content__deletable___iqF4W_7-0-45","addon":"magritte-addon___mlwVD_7-0-45","label-container":"magritte-label-container___VVRg1_7-0-45","labelContainer":"magritte-label-container___VVRg1_7-0-45","label":"magritte-label___NSEUN_7-0-45","postfix-wrapper":"magritte-postfix-wrapper___Qmxwy_7-0-45","postfixWrapper":"magritte-postfix-wrapper___Qmxwy_7-0-45","close":"magritte-close___5I1Fe_7-0-45","chip_style-neutral":"magritte-chip_style-neutral___gELi3_7-0-45","chipStyleNeutral":"magritte-chip_style-neutral___gELi3_7-0-45","postfix":"magritte-postfix___hgYUe_7-0-45","chip__checked":"magritte-chip__checked___3GRxf_7-0-45","chipChecked":"magritte-chip__checked___3GRxf_7-0-45","chip__custom":"magritte-chip__custom___mE-pN_7-0-45","chipCustom":"magritte-chip__custom___mE-pN_7-0-45","disabled":"magritte-disabled___CLRlf_7-0-45","chip_style-accent":"magritte-chip_style-accent___rD0pt_7-0-45","chipStyleAccent":"magritte-chip_style-accent___rD0pt_7-0-45","delete-only":"magritte-delete-only___dn3c7_7-0-45","deleteOnly":"magritte-delete-only___dn3c7_7-0-45","chip_secondary":"magritte-chip_secondary___druWa_7-0-45","chipSecondary":"magritte-chip_secondary___druWa_7-0-45","close_secondary":"magritte-close_secondary___7bJpC_7-0-45","closeSecondary":"magritte-close_secondary___7bJpC_7-0-45","container-gap":"magritte-container-gap___K6Isn_7-0-45","containerGap":"magritte-container-gap___K6Isn_7-0-45"};
|
|
8
|
-
|
|
9
|
-
const ChipContent = ({ addon, 'aria-label': ariaLabel, hideLabel, onDelete, postfix, children, size = 'small', mode = 'primary', }) => {
|
|
10
|
-
const showLabel = !hideLabel && !!children;
|
|
11
|
-
const typographyForPrimary = size === 'extra-small' ? 'subtitle-2-semibold' : 'subtitle-1-semibold';
|
|
12
|
-
const typography = mode === 'secondary' ? 'label-3-regular' : typographyForPrimary;
|
|
13
|
-
return (jsxs("span", { className: classnames(chipsStyles.content, {
|
|
14
|
-
[chipsStyles.contentDeletable]: !!onDelete,
|
|
15
|
-
}), children: [addon && (jsx("span", { className: chipsStyles.addon, children: cloneElement(addon, {
|
|
16
|
-
'data-qa': 'chip-addon',
|
|
17
|
-
'aria-label': ariaLabel,
|
|
18
|
-
'aria-hidden': showLabel,
|
|
19
|
-
}) })), showLabel && (jsxs("span", { className: chipsStyles.labelContainer, children: [jsx("span", { className: chipsStyles.label, children: jsx(Text, { Element: "span", typography: typography, children: children }) }), postfix && (jsx("span", { className: chipsStyles.postfixWrapper, children: jsx(Text, { Element: "span", typography: typography, children: jsx("span", { className: chipsStyles.postfix, children: postfix }) }) }))] }))] }));
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export { ChipContent as C, chipsStyles as c };
|
|
23
|
-
//# sourceMappingURL=ChipContent-DKGY0_mZ.js.map
|