@hh.ru/magritte-ui-chips 7.0.24 → 7.0.26

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 CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from '@hh.ru/magritte-ui-chips/CheckableChip';
2
2
  export * from '@hh.ru/magritte-ui-chips/CustomChip';
3
3
  export * from '@hh.ru/magritte-ui-chips/ChipsContainer';
4
+ export { ChipDefaultPropsContext } from '@hh.ru/magritte-ui-chips/defaultProps';
4
5
  export { type ChipStyle, type CustomChipProps, type CheckableChipProps } from '@hh.ru/magritte-ui-chips/types';
package/index.js CHANGED
@@ -2,12 +2,14 @@ import './index.css';
2
2
  export { CheckableChip } from './CheckableChip.js';
3
3
  export { CustomChip } from './CustomChip.js';
4
4
  export { ChipsContainer } from './ChipsContainer.js';
5
+ export { ChipDefaultPropsContext } from './defaultProps.js';
5
6
  import 'react/jsx-runtime';
6
7
  import 'react';
7
8
  import 'classnames';
8
9
  import '@hh.ru/magritte-common-use-disabled';
9
- import './ChipContent-CqeSdYoC.js';
10
+ import './ChipContent-Cjpr1LGC.js';
10
11
  import '@hh.ru/magritte-ui-typography';
11
12
  import '@hh.ru/magritte-ui-icon/variants/icon';
12
13
  import '@hh.ru/magritte-ui-scrollable-container';
14
+ import '@hh.ru/magritte-internal-default-props-context';
13
15
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
package/index.mock.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ForwardRefExoticComponent } from 'react';
2
+ export { ChipDefaultPropsContext } from '@hh.ru/magritte-ui-chips/defaultProps';
2
3
  export { type ChipStyle, type CheckableChipProps, type CustomChipProps } from '@hh.ru/magritte-ui-chips/types';
3
4
  export declare const CheckableChip: ForwardRefExoticComponent<Record<string, unknown>>;
4
5
  export declare const CustomChip: ForwardRefExoticComponent<Record<string, unknown>>;
package/index.mock.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import './index.css';
2
2
  import { mockComponent } from '@hh.ru/magritte-ui-mock-component';
3
+ export { ChipDefaultPropsContext } from './defaultProps.js';
4
+ import '@hh.ru/magritte-internal-default-props-context';
3
5
 
4
6
  const CheckableChip = mockComponent('CheckableChip', undefined, { withChildren: true });
5
7
  const CustomChip = mockComponent('CustomChip', undefined, {
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 { 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":";;AAMa,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;;;;"}
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":";;;;AAOa,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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hh.ru/magritte-ui-chips",
3
- "version": "7.0.24",
3
+ "version": "7.0.26",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -21,13 +21,14 @@
21
21
  "dependencies": {
22
22
  "@hh.ru/magritte-common-keyboard": "4.3.4",
23
23
  "@hh.ru/magritte-common-use-disabled": "1.0.15",
24
- "@hh.ru/magritte-design-tokens": "24.7.3",
24
+ "@hh.ru/magritte-design-tokens": "24.8.0",
25
+ "@hh.ru/magritte-internal-default-props-context": "1.0.2",
25
26
  "@hh.ru/magritte-types": "5.0.7",
26
27
  "@hh.ru/magritte-ui-breakpoint": "6.1.1",
27
- "@hh.ru/magritte-ui-icon": "14.2.14",
28
+ "@hh.ru/magritte-ui-icon": "14.2.16",
28
29
  "@hh.ru/magritte-ui-mock-component": "1.1.7",
29
- "@hh.ru/magritte-ui-scrollable-container": "6.2.25",
30
- "@hh.ru/magritte-ui-typography": "5.3.7"
30
+ "@hh.ru/magritte-ui-scrollable-container": "6.3.1",
31
+ "@hh.ru/magritte-ui-typography": "5.3.8"
31
32
  },
32
33
  "peerDependencies": {
33
34
  "classnames": ">=2.3.2",
@@ -36,5 +37,5 @@
36
37
  "publishConfig": {
37
38
  "access": "public"
38
39
  },
39
- "gitHead": "70ac6d4c2faa2fe631fae008bb817f6cb21f6520"
40
+ "gitHead": "a8286ff3e0ad8b30c9e9b8b05fd8b9fee20094ff"
40
41
  }
package/types.d.ts CHANGED
@@ -29,18 +29,30 @@ type ChildIconProps = {
29
29
  postfix?: never;
30
30
  hideLabel?: never;
31
31
  };
32
- type ChipCommonProps = {
33
- /** Стиль чипса */
32
+ export type ChipCommonProps = {
33
+ /**
34
+ * Стиль чипса
35
+ * @default neutral
36
+ */
34
37
  style?: ChipStyle;
35
38
  /** data-qa атрибут для самой верхней обертки */
36
39
  dataQaWrapper?: string;
37
- /** Размер чипса */
40
+ /**
41
+ * Размер чипса
42
+ * @default small
43
+ */
38
44
  size?: 'small' | 'extra-small';
39
- /** Режим отображения чипса */
45
+ /**
46
+ * Режим отображения чипса
47
+ * @default primary
48
+ */
40
49
  mode?: 'primary' | 'secondary';
41
50
  } & (ChipChildrenProps | ChildIconProps);
42
51
  type CheckableChipBaseProps = {
43
- /** Тип чипса */
52
+ /**
53
+ * Тип чипса
54
+ * @default checkbox
55
+ */
44
56
  type: 'radio' | 'checkbox';
45
57
  /** data-qa атрибут для инпута */
46
58
  'data-qa'?: string;
@@ -67,7 +79,10 @@ export type CustomChipProps = {
67
79
  checked?: boolean;
68
80
  /** Флаг включен ли чипс */
69
81
  disabled?: boolean;
70
- /** Кастомный компонент */
82
+ /**
83
+ * Кастомный компонент
84
+ * @default button
85
+ */
71
86
  Element?: 'button' | 'a';
72
87
  /** data-qa атрибут для Element */
73
88
  'data-qa'?: string;
@@ -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 styles = {"input":"magritte-input___ctH9G_7-0-24","chip":"magritte-chip___uulZ9_7-0-24","chip-wrapper":"magritte-chip-wrapper___os8tP_7-0-24","chipWrapper":"magritte-chip-wrapper___os8tP_7-0-24","chip-wrapper__disabled":"magritte-chip-wrapper__disabled___mHM6-_7-0-24","chipWrapperDisabled":"magritte-chip-wrapper__disabled___mHM6-_7-0-24","content":"magritte-content___17f1s_7-0-24","size-extra-small":"magritte-size-extra-small___rVVLp_7-0-24","sizeExtraSmall":"magritte-size-extra-small___rVVLp_7-0-24","content__deletable":"magritte-content__deletable___iqF4W_7-0-24","contentDeletable":"magritte-content__deletable___iqF4W_7-0-24","addon":"magritte-addon___mlwVD_7-0-24","label-container":"magritte-label-container___VVRg1_7-0-24","labelContainer":"magritte-label-container___VVRg1_7-0-24","label":"magritte-label___NSEUN_7-0-24","postfix-wrapper":"magritte-postfix-wrapper___Qmxwy_7-0-24","postfixWrapper":"magritte-postfix-wrapper___Qmxwy_7-0-24","close":"magritte-close___5I1Fe_7-0-24","chip_style-neutral":"magritte-chip_style-neutral___gELi3_7-0-24","chipStyleNeutral":"magritte-chip_style-neutral___gELi3_7-0-24","postfix":"magritte-postfix___hgYUe_7-0-24","chip__checked":"magritte-chip__checked___3GRxf_7-0-24","chipChecked":"magritte-chip__checked___3GRxf_7-0-24","chip__custom":"magritte-chip__custom___mE-pN_7-0-24","chipCustom":"magritte-chip__custom___mE-pN_7-0-24","disabled":"magritte-disabled___CLRlf_7-0-24","chip_style-accent":"magritte-chip_style-accent___rD0pt_7-0-24","chipStyleAccent":"magritte-chip_style-accent___rD0pt_7-0-24","delete-only":"magritte-delete-only___dn3c7_7-0-24","deleteOnly":"magritte-delete-only___dn3c7_7-0-24","chip_secondary":"magritte-chip_secondary___druWa_7-0-24","chipSecondary":"magritte-chip_secondary___druWa_7-0-24","close_secondary":"magritte-close_secondary___7bJpC_7-0-24","closeSecondary":"magritte-close_secondary___7bJpC_7-0-24"};
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(styles.content, {
14
- [styles.contentDeletable]: !!onDelete,
15
- }), children: [addon && (jsx("span", { className: styles.addon, children: cloneElement(addon, {
16
- 'data-qa': 'chip-addon',
17
- 'aria-label': ariaLabel,
18
- 'aria-hidden': showLabel,
19
- }) })), showLabel && (jsxs("span", { className: styles.labelContainer, children: [jsx("span", { className: styles.label, children: jsx(Text, { Element: "span", typography: typography, children: children }) }), postfix && (jsx("span", { className: styles.postfixWrapper, children: jsx(Text, { Element: "span", typography: typography, children: jsx("span", { className: styles.postfix, children: postfix }) }) }))] }))] }));
20
- };
21
-
22
- export { ChipContent as C, styles as s };
23
- //# sourceMappingURL=ChipContent-CqeSdYoC.js.map