@hh.ru/magritte-ui-chips 3.0.26 → 4.0.0
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.js +3 -3
- package/CheckableChip.js.map +1 -1
- package/ChipContent-1e99e6cd.js +22 -0
- package/ChipContent-1e99e6cd.js.map +1 -0
- package/ChipContent.d.ts +1 -1
- package/ChipContent.js +1 -1
- package/ChipsContainer.js +2 -2
- package/CustomChip.js +3 -3
- package/CustomChip.js.map +1 -1
- package/index.css +249 -249
- package/index.js +1 -1
- package/package.json +5 -5
- package/types.d.ts +3 -3
- package/ChipContent-1c1db76e.js +0 -22
- package/ChipContent-1c1db76e.js.map +0 -1
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@ export { ChipsContainer } from './ChipsContainer.js';
|
|
|
6
6
|
import 'react/jsx-runtime';
|
|
7
7
|
import 'react';
|
|
8
8
|
import '@hh.ru/magritte-common-use-disabled';
|
|
9
|
-
import './ChipContent-
|
|
9
|
+
import './ChipContent-1e99e6cd.js';
|
|
10
10
|
import 'classnames';
|
|
11
11
|
import '@hh.ru/magritte-ui-counter';
|
|
12
12
|
import '@hh.ru/magritte-ui-typography';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-chips",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"@hh.ru/magritte-common-use-disabled": "1.0.8",
|
|
24
24
|
"@hh.ru/magritte-design-tokens": "18.1.2",
|
|
25
25
|
"@hh.ru/magritte-types": "4.0.1",
|
|
26
|
-
"@hh.ru/magritte-ui-action": "4.3.
|
|
26
|
+
"@hh.ru/magritte-ui-action": "4.3.6",
|
|
27
27
|
"@hh.ru/magritte-ui-breakpoint": "4.0.1",
|
|
28
28
|
"@hh.ru/magritte-ui-counter": "4.0.9",
|
|
29
|
-
"@hh.ru/magritte-ui-icon": "7.1.
|
|
29
|
+
"@hh.ru/magritte-ui-icon": "7.1.6",
|
|
30
30
|
"@hh.ru/magritte-ui-mock-component": "1.0.10",
|
|
31
|
-
"@hh.ru/magritte-ui-scrollable-container": "4.3.
|
|
31
|
+
"@hh.ru/magritte-ui-scrollable-container": "4.3.12",
|
|
32
32
|
"@hh.ru/magritte-ui-theme-provider": "1.1.22",
|
|
33
33
|
"@hh.ru/magritte-ui-typography": "3.0.9"
|
|
34
34
|
},
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "77a359961872f43d688f9507b225fa72ba99a3e8"
|
|
43
43
|
}
|
package/types.d.ts
CHANGED
|
@@ -7,13 +7,13 @@ type ChipHideLabelWithIcon = {
|
|
|
7
7
|
/** Флаг отключения отображения текста и счетчика */
|
|
8
8
|
hideLabel: true;
|
|
9
9
|
/** Текст для озвучивания скринридером, если нет текста для отображения */
|
|
10
|
-
|
|
10
|
+
'aria-label': string;
|
|
11
11
|
/** Контент размером 24x24, чаще всего иконка */
|
|
12
12
|
addon: ReactElement;
|
|
13
13
|
};
|
|
14
14
|
type ChipHideLabelWithoutIcon = {
|
|
15
15
|
hideLabel?: false;
|
|
16
|
-
|
|
16
|
+
'aria-label'?: string;
|
|
17
17
|
addon?: ReactElement;
|
|
18
18
|
};
|
|
19
19
|
type ChipChildrenProps = {
|
|
@@ -26,7 +26,7 @@ type ChipChildrenProps = {
|
|
|
26
26
|
type ChildIconProps = {
|
|
27
27
|
children?: never;
|
|
28
28
|
addon: ReactElement;
|
|
29
|
-
|
|
29
|
+
'aria-label': string;
|
|
30
30
|
counter?: never;
|
|
31
31
|
hideLabel?: never;
|
|
32
32
|
};
|
package/ChipContent-1c1db76e.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import './index.css';
|
|
2
|
-
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import { cloneElement } from 'react';
|
|
4
|
-
import classnames from 'classnames';
|
|
5
|
-
import { Counter } from '@hh.ru/magritte-ui-counter';
|
|
6
|
-
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
7
|
-
|
|
8
|
-
var styles = {"input":"magritte-input___ctH9G_3-0-26","chip":"magritte-chip___uulZ9_3-0-26","chip-wrapper":"magritte-chip-wrapper___os8tP_3-0-26","chipWrapper":"magritte-chip-wrapper___os8tP_3-0-26","chip-wrapper__disabled":"magritte-chip-wrapper__disabled___mHM6-_3-0-26","chipWrapperDisabled":"magritte-chip-wrapper__disabled___mHM6-_3-0-26","content":"magritte-content___17f1s_3-0-26","content__deletable":"magritte-content__deletable___iqF4W_3-0-26","contentDeletable":"magritte-content__deletable___iqF4W_3-0-26","addon":"magritte-addon___mlwVD_3-0-26","label":"magritte-label___NSEUN_3-0-26","counter":"magritte-counter___X35B-_3-0-26","close":"magritte-close___5I1Fe_3-0-26","chip_style-neutral":"magritte-chip_style-neutral___gELi3_3-0-26","chipStyleNeutral":"magritte-chip_style-neutral___gELi3_3-0-26","chip__checked":"magritte-chip__checked___3GRxf_3-0-26","chipChecked":"magritte-chip__checked___3GRxf_3-0-26","chip__custom":"magritte-chip__custom___mE-pN_3-0-26","chipCustom":"magritte-chip__custom___mE-pN_3-0-26","chip_style-accent":"magritte-chip_style-accent___rD0pt_3-0-26","chipStyleAccent":"magritte-chip_style-accent___rD0pt_3-0-26"};
|
|
9
|
-
|
|
10
|
-
const ChipContent = ({ addon, ariaLabel, hideLabel, onDelete, counter, children }) => {
|
|
11
|
-
const showLabel = !hideLabel && !!children;
|
|
12
|
-
return (jsxs("span", { className: classnames(styles.content, {
|
|
13
|
-
[styles.contentDeletable]: !!onDelete,
|
|
14
|
-
}), children: [addon && (jsx("span", { className: styles.addon, children: cloneElement(addon, {
|
|
15
|
-
'data-qa': 'chip-addon',
|
|
16
|
-
'aria-label': ariaLabel,
|
|
17
|
-
'aria-hidden': showLabel,
|
|
18
|
-
}) })), showLabel && (jsxs(Fragment, { children: [jsx("span", { className: styles.label, children: jsx(Text, { Element: "span", typography: "subtitle-1-semibold", children: children }) }), counter && (jsx("span", { className: styles.counter, children: jsx(Counter, { label: counter, style: "attention", mode: "secondary" }) }))] }))] }));
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export { ChipContent as C, styles as s };
|
|
22
|
-
//# sourceMappingURL=ChipContent-1c1db76e.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChipContent-1c1db76e.js","sources":["../src/ChipContent.tsx"],"sourcesContent":["import { cloneElement, FC } from 'react';\nimport classnames from 'classnames';\n\nimport { CustomChipProps } from '@hh.ru/magritte-ui-chips/types';\nimport { Counter } from '@hh.ru/magritte-ui-counter';\nimport { Text } from '@hh.ru/magritte-ui-typography';\n\nimport styles from './chips.less';\n\ntype ChipContentProps = Pick<\n CustomChipProps,\n 'addon' | 'hideLabel' | 'ariaLabel' | 'counter' | 'onDelete' | 'children'\n>;\n\nconst ChipContent: FC<ChipContentProps> = ({ addon, ariaLabel, hideLabel, onDelete, counter, children }) => {\n const showLabel = !hideLabel && !!children;\n return (\n <span\n className={classnames(styles.content, {\n [styles.contentDeletable]: !!onDelete,\n })}\n >\n {addon && (\n <span className={styles.addon}>\n {cloneElement(addon, {\n 'data-qa': 'chip-addon',\n 'aria-label': ariaLabel,\n 'aria-hidden': showLabel,\n })}\n </span>\n )}\n {showLabel && (\n <>\n <span className={styles.label}>\n <Text Element=\"span\" typography=\"subtitle-1-semibold\">\n {children}\n </Text>\n </span>\n {counter && (\n <span className={styles.counter}>\n <Counter label={counter} style=\"attention\" mode=\"secondary\" />\n </span>\n )}\n </>\n )}\n </span>\n );\n};\n\nexport default ChipContent;\n"],"names":["_jsxs","_jsx","_Fragment"],"mappings":";;;;;;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