@hh.ru/magritte-ui-chips 3.0.24 → 3.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/CheckableChip.js CHANGED
@@ -2,7 +2,7 @@ import './index.css';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { forwardRef } from 'react';
4
4
  import { useDisabled } from '@hh.ru/magritte-common-use-disabled';
5
- import { s as styles, C as ChipContent } from './ChipContent-33de1cf1.js';
5
+ import { s as styles, C as ChipContent } from './ChipContent-1c1db76e.js';
6
6
  import 'classnames';
7
7
  import '@hh.ru/magritte-ui-counter';
8
8
  import '@hh.ru/magritte-ui-typography';
@@ -0,0 +1,22 @@
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 +1 @@
1
- {"version":3,"file":"ChipContent-33de1cf1.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":";;;;;;;;AAcA,MAAM,WAAW,GAAyB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAI;IACvG,MAAM,SAAS,GAAG,CAAC,SAAS,IAAI,CAAC,CAAC,QAAQ,CAAC;IAC3C,QACIA,eACI,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE;AAClC,YAAA,CAAC,MAAM,CAAC,gBAAgB,GAAG,CAAC,CAAC,QAAQ;AACxC,SAAA,CAAC,EAED,QAAA,EAAA,CAAA,KAAK,KACFC,cAAM,SAAS,EAAE,MAAM,CAAC,KAAK,EAAA,QAAA,EACxB,YAAY,CAAC,KAAK,EAAE;AACjB,oBAAA,SAAS,EAAE,YAAY;AACvB,oBAAA,YAAY,EAAE,SAAS;AACvB,oBAAA,aAAa,EAAE,SAAS;AAC3B,iBAAA,CAAC,EACC,CAAA,CACV,EACA,SAAS,KACND,IACI,CAAAE,QAAA,EAAA,EAAA,QAAA,EAAA,CAAAD,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,MAAM,CAAC,KAAK,EAAA,QAAA,EACzBA,GAAC,CAAA,IAAI,EAAC,EAAA,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,qBAAqB,EAChD,QAAA,EAAA,QAAQ,EACN,CAAA,EAAA,CACJ,EACN,OAAO,KACJA,GAAM,CAAA,MAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,OAAO,EAC3B,QAAA,EAAAA,GAAA,CAAC,OAAO,EAAA,EAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAC,WAAW,EAAC,IAAI,EAAC,WAAW,EAAA,CAAG,EAC3D,CAAA,CACV,CACF,EAAA,CAAA,CACN,CACE,EAAA,CAAA,EACT;AACN;;;;"}
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":";;;;;;;;AAcA,MAAM,WAAW,GAAyB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAI;IACvG,MAAM,SAAS,GAAG,CAAC,SAAS,IAAI,CAAC,CAAC,QAAQ,CAAC;IAC3C,QACIA,eACI,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE;AAClC,YAAA,CAAC,MAAM,CAAC,gBAAgB,GAAG,CAAC,CAAC,QAAQ;AACxC,SAAA,CAAC,EAED,QAAA,EAAA,CAAA,KAAK,KACFC,cAAM,SAAS,EAAE,MAAM,CAAC,KAAK,EAAA,QAAA,EACxB,YAAY,CAAC,KAAK,EAAE;AACjB,oBAAA,SAAS,EAAE,YAAY;AACvB,oBAAA,YAAY,EAAE,SAAS;AACvB,oBAAA,aAAa,EAAE,SAAS;AAC3B,iBAAA,CAAC,EACC,CAAA,CACV,EACA,SAAS,KACND,IACI,CAAAE,QAAA,EAAA,EAAA,QAAA,EAAA,CAAAD,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,MAAM,CAAC,KAAK,EAAA,QAAA,EACzBA,GAAC,CAAA,IAAI,EAAC,EAAA,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,qBAAqB,EAChD,QAAA,EAAA,QAAQ,EACN,CAAA,EAAA,CACJ,EACN,OAAO,KACJA,GAAM,CAAA,MAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,OAAO,EAC3B,QAAA,EAAAA,GAAA,CAAC,OAAO,EAAA,EAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAC,WAAW,EAAC,IAAI,EAAC,WAAW,EAAA,CAAG,EAC3D,CAAA,CACV,CACF,EAAA,CAAA,CACN,CACE,EAAA,CAAA,EACT;AACN;;;;"}
package/ChipContent.js CHANGED
@@ -4,5 +4,5 @@ import 'react';
4
4
  import 'classnames';
5
5
  import '@hh.ru/magritte-ui-counter';
6
6
  import '@hh.ru/magritte-ui-typography';
7
- export { C as default } from './ChipContent-33de1cf1.js';
7
+ export { C as default } from './ChipContent-1c1db76e.js';
8
8
  //# sourceMappingURL=ChipContent.js.map
package/ChipsContainer.js CHANGED
@@ -6,13 +6,13 @@ import { CheckableChip } from './CheckableChip.js';
6
6
  import { CustomChip } from './CustomChip.js';
7
7
  import { ScrollableContainer, useScrollContext } from '@hh.ru/magritte-ui-scrollable-container';
8
8
  import '@hh.ru/magritte-common-use-disabled';
9
- import './ChipContent-33de1cf1.js';
9
+ import './ChipContent-1c1db76e.js';
10
10
  import '@hh.ru/magritte-ui-counter';
11
11
  import '@hh.ru/magritte-ui-typography';
12
12
  import '@hh.ru/magritte-ui-action';
13
13
  import '@hh.ru/magritte-ui-icon/variants/icon';
14
14
 
15
- var styles = {"container":"magritte-container___o9zaa_3-0-24","scrollable":"magritte-scrollable___GhecO_3-0-24","item":"magritte-item___LBqGp_3-0-24","nowrap":"magritte-nowrap___ioKUP_3-0-24"};
15
+ var styles = {"container":"magritte-container___o9zaa_3-0-26","scrollable":"magritte-scrollable___GhecO_3-0-26","item":"magritte-item___LBqGp_3-0-26","nowrap":"magritte-nowrap___ioKUP_3-0-26"};
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
@@ -4,7 +4,7 @@ import { forwardRef } from 'react';
4
4
  import classnames from 'classnames';
5
5
  import { useDisabled } from '@hh.ru/magritte-common-use-disabled';
6
6
  import { Action } from '@hh.ru/magritte-ui-action';
7
- import { s as styles, C as ChipContent } from './ChipContent-33de1cf1.js';
7
+ import { s as styles, C as ChipContent } from './ChipContent-1c1db76e.js';
8
8
  import { CrossOutlinedSize24 } from '@hh.ru/magritte-ui-icon/variants/icon';
9
9
  import '@hh.ru/magritte-ui-counter';
10
10
  import '@hh.ru/magritte-ui-typography';