@hh.ru/magritte-ui-chips 3.0.23

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/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export * from '@hh.ru/magritte-ui-theme-provider';
2
+ export * from './CheckableChip';
3
+ export * from './CustomChip';
4
+ export * from './ChipsContainer';
5
+ export { type ChipStyle, type CustomChipProps, type CheckableChipProps } from './types';
package/index.js ADDED
@@ -0,0 +1,16 @@
1
+ import './index.css';
2
+ export * from '@hh.ru/magritte-ui-theme-provider';
3
+ export { CheckableChip } from './CheckableChip.js';
4
+ export { CustomChip } from './CustomChip.js';
5
+ export { ChipsContainer } from './ChipsContainer.js';
6
+ import 'react/jsx-runtime';
7
+ import 'react';
8
+ import '@hh.ru/magritte-common-use-disabled';
9
+ import './ChipContent-061590dc.js';
10
+ import 'classnames';
11
+ import '@hh.ru/magritte-ui-counter';
12
+ import '@hh.ru/magritte-ui-typography';
13
+ import '@hh.ru/magritte-ui-action';
14
+ import '@hh.ru/magritte-ui-icon/variants/icon';
15
+ import '@hh.ru/magritte-ui-scrollable-container';
16
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
@@ -0,0 +1,7 @@
1
+ import { ForwardRefExoticComponent } from 'react';
2
+ export { type ChipStyle, type CheckableChipProps, type CustomChipProps } from './types';
3
+ declare const ThemeProvider: any;
4
+ export { ThemeProvider };
5
+ export declare const CheckableChip: ForwardRefExoticComponent<Record<string, unknown>>;
6
+ export declare const CustomChip: ForwardRefExoticComponent<Record<string, unknown>>;
7
+ export declare const ChipsContainer: ForwardRefExoticComponent<Record<string, unknown>>;
package/index.mock.js ADDED
@@ -0,0 +1,15 @@
1
+ import './index.css';
2
+ import { mockComponent } from '@hh.ru/magritte-ui-mock-component';
3
+
4
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
5
+ const { ThemeProvider } = jest.requireActual('@hh.ru/magritte-ui-theme-provider/index');
6
+ const CheckableChip = mockComponent('CheckableChip', undefined, { withChildren: true });
7
+ const CustomChip = mockComponent('CustomChip', undefined, {
8
+ withChildren: true,
9
+ });
10
+ const ChipsContainer = mockComponent('ChipsContainer', undefined, {
11
+ withChildren: true,
12
+ });
13
+
14
+ export { CheckableChip, ChipsContainer, CustomChip, ThemeProvider };
15
+ //# sourceMappingURL=index.mock.js.map
@@ -0,0 +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 { type ChipStyle, type CheckableChipProps, type CustomChipProps } from '@hh.ru/magritte-ui-chips/types';\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\nconst { ThemeProvider } = jest.requireActual('@hh.ru/magritte-ui-theme-provider/index');\n\nexport { ThemeProvider };\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":";;AAMA;AACM,MAAA,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,yCAAyC,EAAE;AAI3E,MAAA,aAAa,GAAuD,aAAa,CAC1F,eAAe,EACf,SAAS,EACT,EAAE,YAAY,EAAE,IAAI,EAAE,EACxB;MAEW,UAAU,GAAuD,aAAa,CAAC,YAAY,EAAE,SAAS,EAAE;AACjH,IAAA,YAAY,EAAE,IAAI;AACrB,CAAA,EAAE;MAEU,cAAc,GAAuD,aAAa,CAC3F,gBAAgB,EAChB,SAAS,EACT;AACI,IAAA,YAAY,EAAE,IAAI;AACrB,CAAA;;;;"}
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@hh.ru/magritte-ui-chips",
3
+ "version": "3.0.23",
4
+ "main": "index.js",
5
+ "types": "index.d.ts",
6
+ "sideEffects": [
7
+ "index.css"
8
+ ],
9
+ "scripts": {
10
+ "build": "yarn root:build $(pwd)",
11
+ "build-test-branch": "yarn root:build-test-branch $(pwd)",
12
+ "changelog": "yarn root:changelog $(pwd)",
13
+ "prepack": "yarn root:prepack $(pwd)",
14
+ "postpublish": "yarn root:postpublish $(pwd)",
15
+ "stylelint-test": "yarn root:stylelint-test $(pwd)",
16
+ "eslint-test": "yarn root:eslint-test $(pwd)",
17
+ "ts-config": "yarn root:ts-config $(pwd)",
18
+ "ts-check": "yarn root:ts-check $(pwd)",
19
+ "test": "yarn root:test $(pwd)"
20
+ },
21
+ "dependencies": {
22
+ "@hh.ru/magritte-common-keyboard": "3.0.2",
23
+ "@hh.ru/magritte-common-use-disabled": "1.0.8",
24
+ "@hh.ru/magritte-design-tokens": "18.1.1",
25
+ "@hh.ru/magritte-types": "4.0.1",
26
+ "@hh.ru/magritte-ui-action": "4.3.3",
27
+ "@hh.ru/magritte-ui-breakpoint": "4.0.1",
28
+ "@hh.ru/magritte-ui-counter": "4.0.8",
29
+ "@hh.ru/magritte-ui-icon": "7.1.3",
30
+ "@hh.ru/magritte-ui-mock-component": "1.0.10",
31
+ "@hh.ru/magritte-ui-scrollable-container": "4.3.8",
32
+ "@hh.ru/magritte-ui-theme-provider": "1.1.21",
33
+ "@hh.ru/magritte-ui-typography": "3.0.8"
34
+ },
35
+ "peerDependencies": {
36
+ "classnames": ">=2.3.2",
37
+ "react": ">=18.2.0"
38
+ },
39
+ "publishConfig": {
40
+ "access": "public"
41
+ },
42
+ "gitHead": "b660dd64fca3eaad5ec44ea9a73f92bb0d9694aa"
43
+ }
package/types.d.ts ADDED
@@ -0,0 +1,70 @@
1
+ import { InputHTMLAttributes, ReactElement, ReactFragment } from 'react';
2
+ import { PropsWithCustomElement } from '@hh.ru/magritte-types';
3
+ import { SpacingCorrectionProps } from '@hh.ru/magritte-ui-scrollable-container';
4
+ export type ChipStyle = 'neutral' | 'accent';
5
+ type ChipChildren = ReactElement | string | number | ReactFragment;
6
+ type ChipHideLabelWithIcon = {
7
+ /** Флаг отключения отображения текста и счетчика */
8
+ hideLabel: true;
9
+ /** Текст для озвучивания скринридером, если нет текста для отображения */
10
+ ariaLabel: string;
11
+ /** Контент размером 24x24, чаще всего иконка */
12
+ addon: ReactElement;
13
+ };
14
+ type ChipHideLabelWithoutIcon = {
15
+ hideLabel?: false;
16
+ ariaLabel?: string;
17
+ addon?: ReactElement;
18
+ };
19
+ type ChipChildrenProps = {
20
+ /** Содержимое лейбла чипса */
21
+ children: ChipChildren;
22
+ style?: ChipStyle;
23
+ /** Значение в счетчике */
24
+ counter?: string;
25
+ } & (ChipHideLabelWithIcon | ChipHideLabelWithoutIcon);
26
+ type ChildIconProps = {
27
+ children?: never;
28
+ addon: ReactElement;
29
+ ariaLabel: string;
30
+ counter?: never;
31
+ hideLabel?: never;
32
+ };
33
+ type ChipCommonProps = {
34
+ /** Стиль чипса */
35
+ style?: ChipStyle;
36
+ /** data-qa атрибут для самой верхней обертки */
37
+ dataQaWrapper?: string;
38
+ } & (ChipChildrenProps | ChildIconProps);
39
+ type CheckableChipBaseProps = {
40
+ /** Тип чипса */
41
+ type: 'radio' | 'checkbox';
42
+ /** data-qa атрибут для инпута */
43
+ 'data-qa'?: string;
44
+ } & ChipCommonProps;
45
+ export type CheckableChipProps = Omit<InputHTMLAttributes<HTMLInputElement>, keyof CheckableChipBaseProps> & CheckableChipBaseProps;
46
+ export type CustomChipProps = {
47
+ /** Флаг выбран ли чипс */
48
+ checked?: boolean;
49
+ /** Флаг включен ли чипс */
50
+ disabled?: boolean;
51
+ /** Обработчик клика по крестику. Крестик рисуется, если этот проп задан */
52
+ onDelete?: () => void;
53
+ /** Кастомный компонент */
54
+ Element?: 'button' | 'a';
55
+ /** data-qa атрибут для Element */
56
+ 'data-qa'?: string;
57
+ } & ChipCommonProps;
58
+ export type CustomChipWithElementProps = PropsWithCustomElement<CustomChipProps, 'button'>;
59
+ export type ChipsContainerProps = {
60
+ 'data-qa'?: string;
61
+ noWrap?: never;
62
+ /** Включает возможность скролла в конейнере */
63
+ scrollable?: false;
64
+ } | ({
65
+ 'data-qa'?: string;
66
+ /** Отключает перенос чипс внутри контейнера со скроллом */
67
+ noWrap?: boolean;
68
+ scrollable: true;
69
+ } & SpacingCorrectionProps);
70
+ export {};
package/types.js ADDED
@@ -0,0 +1,3 @@
1
+ import './index.css';
2
+
3
+ //# sourceMappingURL=types.js.map
package/types.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}