@hh.ru/magritte-ui-chips 5.0.0 → 5.0.2

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.
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { CheckableChipProps } from './types';
2
+ import { CheckableChipProps } from '@hh.ru/magritte-ui-chips/types';
3
3
  declare const CheckableChip: import("react").ForwardRefExoticComponent<CheckableChipProps & import("react").RefAttributes<HTMLLabelElement>>;
4
4
  export { CheckableChip };
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-f4ad02d5.js';
5
+ import { s as styles, C as ChipContent } from './ChipContent-AqQdudHe.js';
6
6
  import 'classnames';
7
7
  import '@hh.ru/magritte-ui-typography';
8
8
 
@@ -0,0 +1,21 @@
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 { Text } from '@hh.ru/magritte-ui-typography';
6
+
7
+ var styles = {"input":"magritte-input___ctH9G_5-0-2","chip":"magritte-chip___uulZ9_5-0-2","chip-wrapper":"magritte-chip-wrapper___os8tP_5-0-2","chipWrapper":"magritte-chip-wrapper___os8tP_5-0-2","chip-wrapper__disabled":"magritte-chip-wrapper__disabled___mHM6-_5-0-2","chipWrapperDisabled":"magritte-chip-wrapper__disabled___mHM6-_5-0-2","content":"magritte-content___17f1s_5-0-2","content__deletable":"magritte-content__deletable___iqF4W_5-0-2","contentDeletable":"magritte-content__deletable___iqF4W_5-0-2","addon":"magritte-addon___mlwVD_5-0-2","label":"magritte-label___NSEUN_5-0-2","postfix-wrapper":"magritte-postfix-wrapper___Qmxwy_5-0-2","postfixWrapper":"magritte-postfix-wrapper___Qmxwy_5-0-2","close":"magritte-close___5I1Fe_5-0-2","chip_style-neutral":"magritte-chip_style-neutral___gELi3_5-0-2","chipStyleNeutral":"magritte-chip_style-neutral___gELi3_5-0-2","postfix":"magritte-postfix___hgYUe_5-0-2","chip__checked":"magritte-chip__checked___3GRxf_5-0-2","chipChecked":"magritte-chip__checked___3GRxf_5-0-2","chip__custom":"magritte-chip__custom___mE-pN_5-0-2","chipCustom":"magritte-chip__custom___mE-pN_5-0-2","chip_style-accent":"magritte-chip_style-accent___rD0pt_5-0-2","chipStyleAccent":"magritte-chip_style-accent___rD0pt_5-0-2"};
8
+
9
+ const ChipContent = ({ addon, 'aria-label': ariaLabel, hideLabel, onDelete, postfix, children, }) => {
10
+ const showLabel = !hideLabel && !!children;
11
+ return (jsxs("span", { className: classnames(styles.content, {
12
+ [styles.contentDeletable]: !!onDelete,
13
+ }), children: [addon && (jsx("span", { className: styles.addon, children: cloneElement(addon, {
14
+ 'data-qa': 'chip-addon',
15
+ 'aria-label': ariaLabel,
16
+ 'aria-hidden': showLabel,
17
+ }) })), showLabel && (jsxs(Fragment, { children: [jsx("span", { className: styles.label, children: jsx(Text, { Element: "span", typography: "subtitle-1-semibold", children: children }) }), postfix && (jsx("span", { className: styles.postfixWrapper, children: jsx(Text, { Element: "span", typography: "subtitle-1-semibold", children: jsx("span", { className: styles.postfix, children: postfix }) }) }))] }))] }));
18
+ };
19
+
20
+ export { ChipContent as C, styles as s };
21
+ //# sourceMappingURL=ChipContent-AqQdudHe.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChipContent-f4ad02d5.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'\n>;\n\nconst ChipContent: FC<ChipContentProps> = ({\n addon,\n 'aria-label': ariaLabel,\n hideLabel,\n onDelete,\n postfix,\n children,\n}) => {\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 {postfix && (\n <span className={styles.postfixWrapper}>\n <Text Element=\"span\" typography=\"subtitle-1-semibold\">\n <span className={styles.postfix}>{postfix}</span>\n </Text>\n </span>\n )}\n </>\n )}\n </span>\n );\n};\n\nexport default ChipContent;\n"],"names":["_jsxs","_jsx","_Fragment"],"mappings":";;;;;;;AAaA,MAAM,WAAW,GAAyB,CAAC,EACvC,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,SAAS,EACT,QAAQ,EACR,OAAO,EACP,QAAQ,GACX,KAAI;IACD,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,EACzB,QAAA,EAAAA,GAAA,CAAC,IAAI,EAAA,EAAC,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,qBAAqB,EAChD,QAAA,EAAA,QAAQ,EACN,CAAA,EAAA,CACJ,EACN,OAAO,KACJA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,MAAM,CAAC,cAAc,EAAA,QAAA,EAClCA,GAAC,CAAA,IAAI,EAAC,EAAA,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,qBAAqB,EAAA,QAAA,EACjDA,GAAM,CAAA,MAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,OAAO,YAAG,OAAO,EAAA,CAAQ,EAC9C,CAAA,EAAA,CACJ,CACV,CAAA,EAAA,CACF,CACN,CAAA,EAAA,CACE,EACT;AACN;;;;"}
1
+ {"version":3,"file":"ChipContent-AqQdudHe.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'\n>;\n\nconst ChipContent: FC<ChipContentProps> = ({\n addon,\n 'aria-label': ariaLabel,\n hideLabel,\n onDelete,\n postfix,\n children,\n}) => {\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 {postfix && (\n <span className={styles.postfixWrapper}>\n <Text Element=\"span\" typography=\"subtitle-1-semibold\">\n <span className={styles.postfix}>{postfix}</span>\n </Text>\n </span>\n )}\n </>\n )}\n </span>\n );\n};\n\nexport default ChipContent;\n"],"names":["_jsxs","_jsx","_Fragment"],"mappings":";;;;;;;AAaA,MAAM,WAAW,GAAyB,CAAC,EACvC,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,SAAS,EACT,QAAQ,EACR,OAAO,EACP,QAAQ,GACX,KAAI;IACD,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,EACzB,QAAA,EAAAA,GAAA,CAAC,IAAI,EAAA,EAAC,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,qBAAqB,EAChD,QAAA,EAAA,QAAQ,EACN,CAAA,EAAA,CACJ,EACN,OAAO,KACJA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,MAAM,CAAC,cAAc,EAAA,QAAA,EAClCA,GAAC,CAAA,IAAI,EAAC,EAAA,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,qBAAqB,EAAA,QAAA,EACjDA,GAAM,CAAA,MAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,OAAO,YAAG,OAAO,EAAA,CAAQ,EAC9C,CAAA,EAAA,CACJ,CACV,CAAA,EAAA,CACF,CACN,CAAA,EAAA,CACE,EACT;AACN;;;;"}
package/ChipContent.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { FC } from 'react';
2
- import { CustomChipProps } from './types';
2
+ import { CustomChipProps } from '@hh.ru/magritte-ui-chips/types';
3
3
  type ChipContentProps = Pick<CustomChipProps, 'addon' | 'hideLabel' | 'aria-label' | 'postfix' | 'onDelete' | 'children'>;
4
4
  declare const ChipContent: FC<ChipContentProps>;
5
5
  export default ChipContent;
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-f4ad02d5.js';
6
+ export { C as default } from './ChipContent-AqQdudHe.js';
7
7
  //# sourceMappingURL=ChipContent.js.map
@@ -1,3 +1,3 @@
1
1
  import { PropsWithChildren, FC } from 'react';
2
- import { ChipsContainerProps } from './src/types';
2
+ import { ChipsContainerProps } from '@hh.ru/magritte-ui-chips/src/types';
3
3
  export declare const ChipsContainer: FC<PropsWithChildren<ChipsContainerProps>>;
package/ChipsContainer.js CHANGED
@@ -6,12 +6,12 @@ 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-f4ad02d5.js';
9
+ import './ChipContent-AqQdudHe.js';
10
10
  import '@hh.ru/magritte-ui-typography';
11
11
  import '@hh.ru/magritte-ui-action';
12
12
  import '@hh.ru/magritte-ui-icon/variants/icon';
13
13
 
14
- var styles = {"container":"magritte-container___o9zaa_5-0-0","scrollable":"magritte-scrollable___GhecO_5-0-0","item":"magritte-item___LBqGp_5-0-0","nowrap":"magritte-nowrap___ioKUP_5-0-0"};
14
+ var styles = {"container":"magritte-container___o9zaa_5-0-2","scrollable":"magritte-scrollable___GhecO_5-0-2","item":"magritte-item___LBqGp_5-0-2","nowrap":"magritte-nowrap___ioKUP_5-0-2"};
15
15
 
16
16
  const isValidCheckableChipElement = (child) => isValidElement(child) && child.type === CheckableChip;
17
17
  const isValidCustomChipElement = (child) => isValidElement(child) && child.type === CustomChip;
package/CustomChip.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { ComponentWithCustomElement } from '@hh.ru/magritte-types';
2
- import { CustomChipProps } from './types';
2
+ import { CustomChipProps } from '@hh.ru/magritte-ui-chips/types';
3
3
  export declare const CustomChip: ComponentWithCustomElement<CustomChipProps, "button">;
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-f4ad02d5.js';
7
+ import { s as styles, C as ChipContent } from './ChipContent-AqQdudHe.js';
8
8
  import { CrossOutlinedSize24 } from '@hh.ru/magritte-ui-icon/variants/icon';
9
9
  import '@hh.ru/magritte-ui-typography';
10
10