@hh.ru/magritte-ui-chips 7.0.43 → 7.0.45

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 CHANGED
@@ -3,7 +3,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { forwardRef } from 'react';
4
4
  import classnames from 'classnames';
5
5
  import { useDisabled } from '@hh.ru/magritte-common-use-disabled';
6
- import { c as chipsStyles, C as ChipContent } from './ChipContent-Dmxzcq2C.js';
6
+ import { c as chipsStyles, C as ChipContent } from './ChipContent-DKGY0_mZ.js';
7
7
  import { useChipDefaultProps } from './defaultProps.js';
8
8
  import '@hh.ru/magritte-ui-typography';
9
9
  import '@hh.ru/magritte-internal-default-props-context';
@@ -0,0 +1,23 @@
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
@@ -1 +1 @@
1
- {"version":3,"file":"ChipContent-Dmxzcq2C.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 { Text } from '@hh.ru/magritte-ui-typography';\n\nimport styles from './chips.less';\n\ntype ChipContentProps = Pick<\n CustomChipProps,\n 'addon' | 'hideLabel' | 'aria-label' | 'postfix' | 'onDelete' | 'children' | 'size' | 'mode'\n>;\n\nconst ChipContent: FC<ChipContentProps> = ({\n addon,\n 'aria-label': ariaLabel,\n hideLabel,\n onDelete,\n postfix,\n children,\n size = 'small',\n mode = 'primary',\n}) => {\n const showLabel = !hideLabel && !!children;\n const typographyForPrimary = size === 'extra-small' ? 'subtitle-2-semibold' : 'subtitle-1-semibold';\n const typography = mode === 'secondary' ? 'label-3-regular' : typographyForPrimary;\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 <span className={styles.labelContainer}>\n <span className={styles.label}>\n <Text Element=\"span\" typography={typography}>\n {children}\n </Text>\n </span>\n {postfix && (\n <span className={styles.postfixWrapper}>\n <Text Element=\"span\" typography={typography}>\n <span className={styles.postfix}>{postfix}</span>\n </Text>\n </span>\n )}\n </span>\n )}\n </span>\n );\n};\n\nexport default ChipContent;\n"],"names":["_jsxs","styles","_jsx"],"mappings":";;;;;;;AAaM,MAAA,WAAW,GAAyB,CAAC,EACvC,KAAK,EACL,YAAY,EAAE,SAAS,EACvB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,SAAS,EAAED,WAAM,CAAC,OAAO,EAAG,QAAA,EAAA,OAAO,EAAQ,CAAA,EAAA,CAC9C,GACJ,CACV,CAAA,EAAA,CACE,CACV,CAAA,EAAA,CACE,EACT;AACN;;;;"}
1
+ {"version":3,"file":"ChipContent-DKGY0_mZ.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 { Text } from '@hh.ru/magritte-ui-typography';\n\nimport styles from './chips.less';\n\ntype ChipContentProps = Pick<\n CustomChipProps,\n 'addon' | 'hideLabel' | 'aria-label' | 'postfix' | 'onDelete' | 'children' | 'size' | 'mode'\n>;\n\nconst ChipContent: FC<ChipContentProps> = ({\n addon,\n 'aria-label': ariaLabel,\n hideLabel,\n onDelete,\n postfix,\n children,\n size = 'small',\n mode = 'primary',\n}) => {\n const showLabel = !hideLabel && !!children;\n const typographyForPrimary = size === 'extra-small' ? 'subtitle-2-semibold' : 'subtitle-1-semibold';\n const typography = mode === 'secondary' ? 'label-3-regular' : typographyForPrimary;\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 <span className={styles.labelContainer}>\n <span className={styles.label}>\n <Text Element=\"span\" typography={typography}>\n {children}\n </Text>\n </span>\n {postfix && (\n <span className={styles.postfixWrapper}>\n <Text Element=\"span\" typography={typography}>\n <span className={styles.postfix}>{postfix}</span>\n </Text>\n </span>\n )}\n </span>\n )}\n </span>\n );\n};\n\nexport default ChipContent;\n"],"names":["_jsxs","styles","_jsx"],"mappings":";;;;;;;AAaM,MAAA,WAAW,GAAyB,CAAC,EACvC,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,SAAS,EACT,QAAQ,EACR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C,OAAO,EAAG,QAAA,EAAA,OAAO,EAAQ,CAAA,EAAA,CAC9C,GACJ,CACV,CAAA,EAAA,CACE,CACV,CAAA,EAAA,CACE,EACT;AACN;;;;"}
package/ChipContent.js CHANGED
@@ -3,5 +3,5 @@ import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import 'classnames';
5
5
  import '@hh.ru/magritte-ui-typography';
6
- export { C as default } from './ChipContent-Dmxzcq2C.js';
6
+ export { C as default } from './ChipContent-DKGY0_mZ.js';
7
7
  //# sourceMappingURL=ChipContent.js.map
package/ChipsContainer.js CHANGED
@@ -5,14 +5,14 @@ import classnames from 'classnames';
5
5
  import { CheckableChip } from './CheckableChip.js';
6
6
  import { CustomChip } from './CustomChip.js';
7
7
  import { ScrollableContainer, useGalleryContext, useScrollableControls } from '@hh.ru/magritte-ui-scrollable-container';
8
- import { c as chipsStyles } from './ChipContent-Dmxzcq2C.js';
8
+ import { c as chipsStyles } from './ChipContent-DKGY0_mZ.js';
9
9
  import '@hh.ru/magritte-common-use-disabled';
10
10
  import './defaultProps.js';
11
11
  import '@hh.ru/magritte-internal-default-props-context';
12
12
  import '@hh.ru/magritte-ui-typography';
13
13
  import '@hh.ru/magritte-ui-icon/variants/icon';
14
14
 
15
- var styles = {"container":"magritte-container___o9zaa_7-0-43","scrollable":"magritte-scrollable___GhecO_7-0-43","item":"magritte-item___LBqGp_7-0-43","nowrap":"magritte-nowrap___ioKUP_7-0-43"};
15
+ var styles = {"container":"magritte-container___o9zaa_7-0-45","scrollable":"magritte-scrollable___GhecO_7-0-45","item":"magritte-item___LBqGp_7-0-45","nowrap":"magritte-nowrap___ioKUP_7-0-45"};
16
16
 
17
17
  const isValidCheckableChipElement = (child) => isValidElement(child) && child.type === CheckableChip;
18
18
  const isValidCustomChipElement = (child) => isValidElement(child) && child.type === CustomChip;
package/CustomChip.js CHANGED
@@ -3,7 +3,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { forwardRef } from 'react';
4
4
  import classnames from 'classnames';
5
5
  import { useDisabled } from '@hh.ru/magritte-common-use-disabled';
6
- import { c as chipsStyles, C as ChipContent } from './ChipContent-Dmxzcq2C.js';
6
+ import { c as chipsStyles, C as ChipContent } from './ChipContent-DKGY0_mZ.js';
7
7
  import { useChipDefaultProps } from './defaultProps.js';
8
8
  import { CrossOutlinedSize16, CrossOutlinedSize24 } from '@hh.ru/magritte-ui-icon/variants/icon';
9
9
  import '@hh.ru/magritte-ui-typography';