@hh.ru/magritte-ui-chips 7.1.9 → 7.1.10
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 +1 -1
- package/ChipContent-3DE5LNaL.js +45 -0
- package/{ChipContent-CAcK3dU7.js.map → ChipContent-3DE5LNaL.js.map} +1 -1
- package/ChipContent.js +1 -1
- package/ChipsContainer.js +2 -2
- package/CustomChip.js +1 -1
- package/index.css +743 -743
- package/index.js +1 -1
- package/package.json +3 -3
- package/ChipContent-CAcK3dU7.js +0 -45
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_default } from './ChipContent-
|
|
6
|
+
import { c as chipsStyles, C as ChipContent_default } from './ChipContent-3DE5LNaL.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,45 @@
|
|
|
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-1-10","chip":"magritte-chip___uulZ9_7-1-10","chip-wrapper":"magritte-chip-wrapper___os8tP_7-1-10","chipWrapper":"magritte-chip-wrapper___os8tP_7-1-10","chip-wrapper__disabled":"magritte-chip-wrapper__disabled___mHM6-_7-1-10","chipWrapperDisabled":"magritte-chip-wrapper__disabled___mHM6-_7-1-10","content":"magritte-content___17f1s_7-1-10","size-extra-small":"magritte-size-extra-small___rVVLp_7-1-10","sizeExtraSmall":"magritte-size-extra-small___rVVLp_7-1-10","content__deletable":"magritte-content__deletable___iqF4W_7-1-10","contentDeletable":"magritte-content__deletable___iqF4W_7-1-10","addon":"magritte-addon___mlwVD_7-1-10","label-container":"magritte-label-container___VVRg1_7-1-10","labelContainer":"magritte-label-container___VVRg1_7-1-10","label":"magritte-label___NSEUN_7-1-10","postfix-wrapper":"magritte-postfix-wrapper___Qmxwy_7-1-10","postfixWrapper":"magritte-postfix-wrapper___Qmxwy_7-1-10","close":"magritte-close___5I1Fe_7-1-10","chip_style-neutral":"magritte-chip_style-neutral___gELi3_7-1-10","chipStyleNeutral":"magritte-chip_style-neutral___gELi3_7-1-10","postfix":"magritte-postfix___hgYUe_7-1-10","chip__checked":"magritte-chip__checked___3GRxf_7-1-10","chipChecked":"magritte-chip__checked___3GRxf_7-1-10","chip__custom":"magritte-chip__custom___mE-pN_7-1-10","chipCustom":"magritte-chip__custom___mE-pN_7-1-10","disabled":"magritte-disabled___CLRlf_7-1-10","chip_style-accent":"magritte-chip_style-accent___rD0pt_7-1-10","chipStyleAccent":"magritte-chip_style-accent___rD0pt_7-1-10","delete-only":"magritte-delete-only___dn3c7_7-1-10","deleteOnly":"magritte-delete-only___dn3c7_7-1-10","chip_secondary":"magritte-chip_secondary___druWa_7-1-10","chipSecondary":"magritte-chip_secondary___druWa_7-1-10","close_secondary":"magritte-close_secondary___7bJpC_7-1-10","closeSecondary":"magritte-close_secondary___7bJpC_7-1-10","container-gap":"magritte-container-gap___K6Isn_7-1-10","containerGap":"magritte-container-gap___K6Isn_7-1-10"};
|
|
8
|
+
|
|
9
|
+
const ChipContent = ({
|
|
10
|
+
addon,
|
|
11
|
+
"aria-label": ariaLabel,
|
|
12
|
+
hideLabel,
|
|
13
|
+
onDelete,
|
|
14
|
+
postfix,
|
|
15
|
+
children,
|
|
16
|
+
size = "small",
|
|
17
|
+
mode = "primary"
|
|
18
|
+
}) => {
|
|
19
|
+
const showLabel = !hideLabel && !!children;
|
|
20
|
+
const typographyForPrimary = size === "extra-small" ? "subtitle-2-semibold" : "subtitle-1-semibold";
|
|
21
|
+
const typography = mode === "secondary" ? "label-3-regular" : typographyForPrimary;
|
|
22
|
+
return /* @__PURE__ */ jsxs(
|
|
23
|
+
"span",
|
|
24
|
+
{
|
|
25
|
+
className: classnames(chipsStyles.content, {
|
|
26
|
+
[chipsStyles.contentDeletable]: !!onDelete
|
|
27
|
+
}),
|
|
28
|
+
children: [
|
|
29
|
+
addon && /* @__PURE__ */ jsx("span", { className: chipsStyles.addon, children: cloneElement(addon, {
|
|
30
|
+
"data-qa": "chip-addon",
|
|
31
|
+
"aria-label": ariaLabel,
|
|
32
|
+
"aria-hidden": showLabel
|
|
33
|
+
}) }),
|
|
34
|
+
showLabel && /* @__PURE__ */ jsxs("span", { className: chipsStyles.labelContainer, children: [
|
|
35
|
+
/* @__PURE__ */ jsx("span", { className: chipsStyles.label, children: /* @__PURE__ */ jsx(Text, { Element: "span", typography, children }) }),
|
|
36
|
+
postfix && /* @__PURE__ */ jsx("span", { className: chipsStyles.postfixWrapper, children: /* @__PURE__ */ jsx(Text, { Element: "span", typography, children: /* @__PURE__ */ jsx("span", { className: chipsStyles.postfix, children: postfix }) }) })
|
|
37
|
+
] })
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
var ChipContent_default = ChipContent;
|
|
43
|
+
|
|
44
|
+
export { ChipContent_default as C, chipsStyles as c };
|
|
45
|
+
//# sourceMappingURL=ChipContent-3DE5LNaL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChipContent-
|
|
1
|
+
{"version":3,"file":"ChipContent-3DE5LNaL.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":["styles"],"mappings":";;;;;;;AAaA,MAAM,cAAoC,CAAC;AAAA,EACvC,KAAA;AAAA,EACA,YAAc,EAAA,SAAA;AAAA,EACd,SAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAO,GAAA,OAAA;AAAA,EACP,IAAO,GAAA,SAAA;AACX,CAAM,KAAA;AACF,EAAA,MAAM,SAAY,GAAA,CAAC,SAAa,IAAA,CAAC,CAAC,QAAA,CAAA;AAClC,EAAM,MAAA,oBAAA,GAAuB,IAAS,KAAA,aAAA,GAAgB,qBAAwB,GAAA,qBAAA,CAAA;AAC9E,EAAM,MAAA,UAAA,GAAa,IAAS,KAAA,WAAA,GAAc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-ui-typography';
|
|
6
|
-
export { C as default } from './ChipContent-
|
|
6
|
+
export { C as default } from './ChipContent-3DE5LNaL.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-
|
|
8
|
+
import { c as chipsStyles } from './ChipContent-3DE5LNaL.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-1-
|
|
15
|
+
var styles = {"container":"magritte-container___o9zaa_7-1-10","scrollable":"magritte-scrollable___GhecO_7-1-10","item":"magritte-item___LBqGp_7-1-10","nowrap":"magritte-nowrap___ioKUP_7-1-10"};
|
|
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_default } from './ChipContent-
|
|
6
|
+
import { c as chipsStyles, C as ChipContent_default } from './ChipContent-3DE5LNaL.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';
|