@salutejs/plasma-new-hope 0.184.0-canary.1536.11682091417.0 → 0.184.0-canary.1536.11684075369.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Chip/Chip.js +3 -3
- package/cjs/components/Chip/Chip.js.map +1 -1
- package/emotion/cjs/components/Chip/Chip.js +3 -3
- package/emotion/es/components/Chip/Chip.js +3 -3
- package/es/components/Chip/Chip.js +3 -3
- package/es/components/Chip/Chip.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Chip/Chip.js +3 -3
- package/styled-components/es/components/Chip/Chip.js +3 -3
- package/types/components/Chip/Chip.d.ts.map +1 -1
@@ -63,12 +63,12 @@ var chipRoot = function chipRoot(Root) {
|
|
63
63
|
pilled: pilled,
|
64
64
|
readOnly: !disabled && readOnly,
|
65
65
|
size: size
|
66
|
-
}, rest), contentLeft && /*#__PURE__*/React.createElement(Chip_styles.StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/React.createElement(Chip_styles.StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/React.createElement(Chip_styles.StyledContentRight, null, contentRight), hasClear && /*#__PURE__*/React.createElement(Chip_styles.StyledContentClear, {
|
66
|
+
}, rest), contentLeft && /*#__PURE__*/React.createElement(Chip_styles.StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/React.createElement(Chip_styles.StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/React.createElement(Chip_styles.StyledContentRight, null, contentRight), hasClear && (contentClearButton || /*#__PURE__*/React.createElement(Chip_styles.StyledContentClear, {
|
67
67
|
onClick: handleClickClose
|
68
|
-
},
|
68
|
+
}, /*#__PURE__*/React.createElement(IconClose.IconClose, {
|
69
69
|
sizeCustomProperty: Chip_tokens.tokens.closeIconSize,
|
70
70
|
color: "inherit"
|
71
|
-
})));
|
71
|
+
}))));
|
72
72
|
});
|
73
73
|
};
|
74
74
|
var chipConfig = {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Chip.js","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import React, { forwardRef, MouseEvent } from 'react';\n\nimport type { RootProps } from '../../engines';\nimport { IconClose } from '../_Icon/Icons/IconClose';\nimport { cx } from '../../utils';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readonlyCSS } from './variations/_readonly/base';\nimport { base as focusedCSS } from './variations/_focused/base';\nimport { base as pilledCSS } from './variations/_pilled/base';\nimport type { ChipProps } from './Chip.types';\nimport { StyledContentClear, StyledContentLeft, StyledContentMain, StyledContentRight, base } from './Chip.styles';\nimport { classes, tokens } from './Chip.tokens';\n\nexport const chipRoot = (Root: RootProps<HTMLButtonElement, ChipProps>) =>\n forwardRef<HTMLButtonElement, ChipProps>((props, ref) => {\n const {\n children,\n text,\n contentLeft,\n contentRight,\n contentClearButton,\n hasClear = true,\n size,\n className,\n onClear,\n onClick,\n onClickClose,\n pilled = false,\n readOnly = false,\n disabled = false,\n ...rest\n } = props;\n\n const txt = !text && typeof children === 'string' ? children : text;\n const pilledClass = pilled ? classes.pilled : undefined;\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n if (disabled || readOnly) {\n return;\n }\n\n onClick?.(event);\n onClear?.();\n };\n\n const handleClickClose = (event: MouseEvent<HTMLDivElement>) => {\n if (disabled || readOnly || !onClickClose) {\n return;\n }\n\n event.stopPropagation();\n onClickClose(event);\n };\n\n return (\n <Root\n type=\"button\"\n ref={ref}\n className={cx(pilledClass, classes.chipItem, className)}\n tabIndex={readOnly ? -1 : 0}\n onClick={handleClick}\n disabled={disabled}\n pilled={pilled}\n readOnly={!disabled && readOnly}\n size={size}\n {...rest}\n >\n {contentLeft && <StyledContentLeft>{contentLeft}</StyledContentLeft>}\n {txt ? <StyledContentMain>{txt}</StyledContentMain> : children}\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n {hasClear
|
1
|
+
{"version":3,"file":"Chip.js","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import React, { forwardRef, MouseEvent } from 'react';\n\nimport type { RootProps } from '../../engines';\nimport { IconClose } from '../_Icon/Icons/IconClose';\nimport { cx } from '../../utils';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readonlyCSS } from './variations/_readonly/base';\nimport { base as focusedCSS } from './variations/_focused/base';\nimport { base as pilledCSS } from './variations/_pilled/base';\nimport type { ChipProps } from './Chip.types';\nimport { StyledContentClear, StyledContentLeft, StyledContentMain, StyledContentRight, base } from './Chip.styles';\nimport { classes, tokens } from './Chip.tokens';\n\nexport const chipRoot = (Root: RootProps<HTMLButtonElement, ChipProps>) =>\n forwardRef<HTMLButtonElement, ChipProps>((props, ref) => {\n const {\n children,\n text,\n contentLeft,\n contentRight,\n contentClearButton,\n hasClear = true,\n size,\n className,\n onClear,\n onClick,\n onClickClose,\n pilled = false,\n readOnly = false,\n disabled = false,\n ...rest\n } = props;\n\n const txt = !text && typeof children === 'string' ? children : text;\n const pilledClass = pilled ? classes.pilled : undefined;\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n if (disabled || readOnly) {\n return;\n }\n\n onClick?.(event);\n onClear?.();\n };\n\n const handleClickClose = (event: MouseEvent<HTMLDivElement>) => {\n if (disabled || readOnly || !onClickClose) {\n return;\n }\n\n event.stopPropagation();\n onClickClose(event);\n };\n\n return (\n <Root\n type=\"button\"\n ref={ref}\n className={cx(pilledClass, classes.chipItem, className)}\n tabIndex={readOnly ? -1 : 0}\n onClick={handleClick}\n disabled={disabled}\n pilled={pilled}\n readOnly={!disabled && readOnly}\n size={size}\n {...rest}\n >\n {contentLeft && <StyledContentLeft>{contentLeft}</StyledContentLeft>}\n {txt ? <StyledContentMain>{txt}</StyledContentMain> : children}\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n {hasClear &&\n (contentClearButton || (\n <StyledContentClear onClick={handleClickClose}>\n <IconClose sizeCustomProperty={tokens.closeIconSize} color=\"inherit\" />\n </StyledContentClear>\n ))}\n </Root>\n );\n });\n\nexport const chipConfig = {\n name: 'Chip',\n tag: 'button',\n layout: chipRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n readOnly: {\n css: readonlyCSS,\n attrs: true,\n },\n focused: {\n css: focusedCSS,\n },\n pilled: {\n css: pilledCSS,\n attrs: true,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["chipRoot","Root","forwardRef","props","ref","children","text","contentLeft","contentRight","contentClearButton","_props$hasClear","hasClear","size","className","onClear","onClick","onClickClose","_props$pilled","pilled","_props$readOnly","readOnly","_props$disabled","disabled","rest","_objectWithoutProperties","_excluded","txt","pilledClass","classes","undefined","handleClick","event","handleClickClose","stopPropagation","React","createElement","_extends","type","cx","chipItem","tabIndex","StyledContentLeft","StyledContentMain","StyledContentRight","StyledContentClear","IconClose","sizeCustomProperty","tokens","closeIconSize","color","chipConfig","name","tag","layout","base","variations","view","css","viewCSS","sizeCSS","disabledCSS","attrs","readonlyCSS","focused","focusedCSS","pilledCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;IAgBaA,QAAQ,GAAG,SAAXA,QAAQA,CAAIC,IAA6C,EAAA;AAAA,EAAA,oBAClEC,gBAAU,CAA+B,UAACC,KAAK,EAAEC,GAAG,EAAK;AACrD,IAAA,IACIC,QAAQ,GAeRF,KAAK,CAfLE,QAAQ;MACRC,IAAI,GAcJH,KAAK,CAdLG,IAAI;MACJC,WAAW,GAaXJ,KAAK,CAbLI,WAAW;MACXC,YAAY,GAYZL,KAAK,CAZLK,YAAY;MACZC,kBAAkB,GAWlBN,KAAK,CAXLM,kBAAkB;MAAAC,eAAA,GAWlBP,KAAK,CAVLQ,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,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AC,SAAA;KAAW,CACtD,CACvB,CACH,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAMC,UAAU,GAAG;AACtBC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,GAAG,EAAE,QAAQ;AACbC,EAAAA,MAAM,EAAErD,QAAQ;AAChBsD,EAAAA,IAAI,EAAJA,gBAAI;AACJC,EAAAA,UAAU,EAAE;AACRC,IAAAA,IAAI,EAAE;AACFC,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACD9C,IAAAA,IAAI,EAAE;AACF6C,MAAAA,GAAG,EAAEE,WAAAA;KACR;AACDrC,IAAAA,QAAQ,EAAE;AACNmC,MAAAA,GAAG,EAAEG,WAAW;AAChBC,MAAAA,KAAK,EAAE,IAAA;KACV;AACDzC,IAAAA,QAAQ,EAAE;AACNqC,MAAAA,GAAG,EAAEK,WAAW;AAChBD,MAAAA,KAAK,EAAE,IAAA;KACV;AACDE,IAAAA,OAAO,EAAE;AACLN,MAAAA,GAAG,EAAEO,WAAAA;KACR;AACD9C,IAAAA,MAAM,EAAE;AACJuC,MAAAA,GAAG,EAAEQ,WAAS;AACdJ,MAAAA,KAAK,EAAE,IAAA;AACX,KAAA;GACH;AACDK,EAAAA,QAAQ,EAAE;AACNV,IAAAA,IAAI,EAAE,SAAS;AACf5C,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
|
@@ -69,12 +69,12 @@ var chipRoot = exports.chipRoot = function chipRoot(Root) {
|
|
69
69
|
pilled: pilled,
|
70
70
|
readOnly: !disabled && readOnly,
|
71
71
|
size: size
|
72
|
-
}, rest), contentLeft && /*#__PURE__*/_react["default"].createElement(_Chip.StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/_react["default"].createElement(_Chip.StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/_react["default"].createElement(_Chip.StyledContentRight, null, contentRight), hasClear && /*#__PURE__*/_react["default"].createElement(_Chip.StyledContentClear, {
|
72
|
+
}, rest), contentLeft && /*#__PURE__*/_react["default"].createElement(_Chip.StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/_react["default"].createElement(_Chip.StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/_react["default"].createElement(_Chip.StyledContentRight, null, contentRight), hasClear && (contentClearButton || /*#__PURE__*/_react["default"].createElement(_Chip.StyledContentClear, {
|
73
73
|
onClick: handleClickClose
|
74
|
-
},
|
74
|
+
}, /*#__PURE__*/_react["default"].createElement(_IconClose.IconClose, {
|
75
75
|
sizeCustomProperty: _Chip2.tokens.closeIconSize,
|
76
76
|
color: "inherit"
|
77
|
-
})));
|
77
|
+
}))));
|
78
78
|
});
|
79
79
|
};
|
80
80
|
var chipConfig = exports.chipConfig = {
|
@@ -60,12 +60,12 @@ export var chipRoot = function chipRoot(Root) {
|
|
60
60
|
pilled: pilled,
|
61
61
|
readOnly: !disabled && readOnly,
|
62
62
|
size: size
|
63
|
-
}, rest), contentLeft && /*#__PURE__*/React.createElement(StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/React.createElement(StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/React.createElement(StyledContentRight, null, contentRight), hasClear && /*#__PURE__*/React.createElement(StyledContentClear, {
|
63
|
+
}, rest), contentLeft && /*#__PURE__*/React.createElement(StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/React.createElement(StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/React.createElement(StyledContentRight, null, contentRight), hasClear && (contentClearButton || /*#__PURE__*/React.createElement(StyledContentClear, {
|
64
64
|
onClick: handleClickClose
|
65
|
-
},
|
65
|
+
}, /*#__PURE__*/React.createElement(IconClose, {
|
66
66
|
sizeCustomProperty: tokens.closeIconSize,
|
67
67
|
color: "inherit"
|
68
|
-
})));
|
68
|
+
}))));
|
69
69
|
});
|
70
70
|
};
|
71
71
|
export var chipConfig = {
|
@@ -59,12 +59,12 @@ var chipRoot = function chipRoot(Root) {
|
|
59
59
|
pilled: pilled,
|
60
60
|
readOnly: !disabled && readOnly,
|
61
61
|
size: size
|
62
|
-
}, rest), contentLeft && /*#__PURE__*/React.createElement(StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/React.createElement(StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/React.createElement(StyledContentRight, null, contentRight), hasClear && /*#__PURE__*/React.createElement(StyledContentClear, {
|
62
|
+
}, rest), contentLeft && /*#__PURE__*/React.createElement(StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/React.createElement(StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/React.createElement(StyledContentRight, null, contentRight), hasClear && (contentClearButton || /*#__PURE__*/React.createElement(StyledContentClear, {
|
63
63
|
onClick: handleClickClose
|
64
|
-
},
|
64
|
+
}, /*#__PURE__*/React.createElement(IconClose, {
|
65
65
|
sizeCustomProperty: tokens.closeIconSize,
|
66
66
|
color: "inherit"
|
67
|
-
})));
|
67
|
+
}))));
|
68
68
|
});
|
69
69
|
};
|
70
70
|
var chipConfig = {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Chip.js","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import React, { forwardRef, MouseEvent } from 'react';\n\nimport type { RootProps } from '../../engines';\nimport { IconClose } from '../_Icon/Icons/IconClose';\nimport { cx } from '../../utils';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readonlyCSS } from './variations/_readonly/base';\nimport { base as focusedCSS } from './variations/_focused/base';\nimport { base as pilledCSS } from './variations/_pilled/base';\nimport type { ChipProps } from './Chip.types';\nimport { StyledContentClear, StyledContentLeft, StyledContentMain, StyledContentRight, base } from './Chip.styles';\nimport { classes, tokens } from './Chip.tokens';\n\nexport const chipRoot = (Root: RootProps<HTMLButtonElement, ChipProps>) =>\n forwardRef<HTMLButtonElement, ChipProps>((props, ref) => {\n const {\n children,\n text,\n contentLeft,\n contentRight,\n contentClearButton,\n hasClear = true,\n size,\n className,\n onClear,\n onClick,\n onClickClose,\n pilled = false,\n readOnly = false,\n disabled = false,\n ...rest\n } = props;\n\n const txt = !text && typeof children === 'string' ? children : text;\n const pilledClass = pilled ? classes.pilled : undefined;\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n if (disabled || readOnly) {\n return;\n }\n\n onClick?.(event);\n onClear?.();\n };\n\n const handleClickClose = (event: MouseEvent<HTMLDivElement>) => {\n if (disabled || readOnly || !onClickClose) {\n return;\n }\n\n event.stopPropagation();\n onClickClose(event);\n };\n\n return (\n <Root\n type=\"button\"\n ref={ref}\n className={cx(pilledClass, classes.chipItem, className)}\n tabIndex={readOnly ? -1 : 0}\n onClick={handleClick}\n disabled={disabled}\n pilled={pilled}\n readOnly={!disabled && readOnly}\n size={size}\n {...rest}\n >\n {contentLeft && <StyledContentLeft>{contentLeft}</StyledContentLeft>}\n {txt ? <StyledContentMain>{txt}</StyledContentMain> : children}\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n {hasClear
|
1
|
+
{"version":3,"file":"Chip.js","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import React, { forwardRef, MouseEvent } from 'react';\n\nimport type { RootProps } from '../../engines';\nimport { IconClose } from '../_Icon/Icons/IconClose';\nimport { cx } from '../../utils';\n\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readonlyCSS } from './variations/_readonly/base';\nimport { base as focusedCSS } from './variations/_focused/base';\nimport { base as pilledCSS } from './variations/_pilled/base';\nimport type { ChipProps } from './Chip.types';\nimport { StyledContentClear, StyledContentLeft, StyledContentMain, StyledContentRight, base } from './Chip.styles';\nimport { classes, tokens } from './Chip.tokens';\n\nexport const chipRoot = (Root: RootProps<HTMLButtonElement, ChipProps>) =>\n forwardRef<HTMLButtonElement, ChipProps>((props, ref) => {\n const {\n children,\n text,\n contentLeft,\n contentRight,\n contentClearButton,\n hasClear = true,\n size,\n className,\n onClear,\n onClick,\n onClickClose,\n pilled = false,\n readOnly = false,\n disabled = false,\n ...rest\n } = props;\n\n const txt = !text && typeof children === 'string' ? children : text;\n const pilledClass = pilled ? classes.pilled : undefined;\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n if (disabled || readOnly) {\n return;\n }\n\n onClick?.(event);\n onClear?.();\n };\n\n const handleClickClose = (event: MouseEvent<HTMLDivElement>) => {\n if (disabled || readOnly || !onClickClose) {\n return;\n }\n\n event.stopPropagation();\n onClickClose(event);\n };\n\n return (\n <Root\n type=\"button\"\n ref={ref}\n className={cx(pilledClass, classes.chipItem, className)}\n tabIndex={readOnly ? -1 : 0}\n onClick={handleClick}\n disabled={disabled}\n pilled={pilled}\n readOnly={!disabled && readOnly}\n size={size}\n {...rest}\n >\n {contentLeft && <StyledContentLeft>{contentLeft}</StyledContentLeft>}\n {txt ? <StyledContentMain>{txt}</StyledContentMain> : children}\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n {hasClear &&\n (contentClearButton || (\n <StyledContentClear onClick={handleClickClose}>\n <IconClose sizeCustomProperty={tokens.closeIconSize} color=\"inherit\" />\n </StyledContentClear>\n ))}\n </Root>\n );\n });\n\nexport const chipConfig = {\n name: 'Chip',\n tag: 'button',\n layout: chipRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n readOnly: {\n css: readonlyCSS,\n attrs: true,\n },\n focused: {\n css: focusedCSS,\n },\n pilled: {\n css: pilledCSS,\n attrs: true,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["chipRoot","Root","forwardRef","props","ref","children","text","contentLeft","contentRight","contentClearButton","_props$hasClear","hasClear","size","className","onClear","onClick","onClickClose","_props$pilled","pilled","_props$readOnly","readOnly","_props$disabled","disabled","rest","_objectWithoutProperties","_excluded","txt","pilledClass","classes","undefined","handleClick","event","handleClickClose","stopPropagation","React","createElement","_extends","type","cx","chipItem","tabIndex","StyledContentLeft","StyledContentMain","StyledContentRight","StyledContentClear","IconClose","sizeCustomProperty","tokens","closeIconSize","color","chipConfig","name","tag","layout","base","variations","view","css","viewCSS","sizeCSS","disabledCSS","attrs","readonlyCSS","focused","focusedCSS","pilledCSS","defaults"],"mappings":";;;;;;;;;;;;;;IAgBaA,QAAQ,GAAG,SAAXA,QAAQA,CAAIC,IAA6C,EAAA;AAAA,EAAA,oBAClEC,UAAU,CAA+B,UAACC,KAAK,EAAEC,GAAG,EAAK;AACrD,IAAA,IACIC,QAAQ,GAeRF,KAAK,CAfLE,QAAQ;MACRC,IAAI,GAcJH,KAAK,CAdLG,IAAI;MACJC,WAAW,GAaXJ,KAAK,CAbLI,WAAW;MACXC,YAAY,GAYZL,KAAK,CAZLK,YAAY;MACZC,kBAAkB,GAWlBN,KAAK,CAXLM,kBAAkB;MAAAC,eAAA,GAWlBP,KAAK,CAVLQ,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,eAAA;MACfE,IAAI,GASJT,KAAK,CATLS,IAAI;MACJC,SAAS,GAQTV,KAAK,CARLU,SAAS;MACTC,OAAO,GAOPX,KAAK,CAPLW,OAAO;MACPC,OAAO,GAMPZ,KAAK,CANLY,OAAO;MACPC,YAAY,GAKZb,KAAK,CALLa,YAAY;MAAAC,aAAA,GAKZd,KAAK,CAJLe,MAAM;AAANA,MAAAA,MAAM,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,aAAA;MAAAE,eAAA,GAIdhB,KAAK,CAHLiB,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,eAAA;MAAAE,eAAA,GAGhBlB,KAAK,CAFLmB,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAA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AAEK,MAAW;AAChBD,MAAAA,KAAK,EAAE,IAAA;KACV;AACDE,IAAAA,OAAO,EAAE;AACLN,MAAAA,GAAG,EAAEO,MAAAA;KACR;AACD9C,IAAAA,MAAM,EAAE;AACJuC,MAAAA,GAAG,EAAEQ,MAAS;AACdJ,MAAAA,KAAK,EAAE,IAAA;AACX,KAAA;GACH;AACDK,EAAAA,QAAQ,EAAE;AACNV,IAAAA,IAAI,EAAE,SAAS;AACf5C,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/plasma-new-hope",
|
3
|
-
"version": "0.184.0-canary.1536.
|
3
|
+
"version": "0.184.0-canary.1536.11684075369.0",
|
4
4
|
"description": "Salute Design System blueprint",
|
5
5
|
"main": "cjs/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -128,5 +128,5 @@
|
|
128
128
|
"sideEffects": [
|
129
129
|
"*.css"
|
130
130
|
],
|
131
|
-
"gitHead": "
|
131
|
+
"gitHead": "92f283c085bb4b443da8d865ab3b8e40834f77ff"
|
132
132
|
}
|
@@ -69,12 +69,12 @@ var chipRoot = exports.chipRoot = function chipRoot(Root) {
|
|
69
69
|
pilled: pilled,
|
70
70
|
readOnly: !disabled && readOnly,
|
71
71
|
size: size
|
72
|
-
}, rest), contentLeft && /*#__PURE__*/_react["default"].createElement(_Chip.StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/_react["default"].createElement(_Chip.StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/_react["default"].createElement(_Chip.StyledContentRight, null, contentRight), hasClear && /*#__PURE__*/_react["default"].createElement(_Chip.StyledContentClear, {
|
72
|
+
}, rest), contentLeft && /*#__PURE__*/_react["default"].createElement(_Chip.StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/_react["default"].createElement(_Chip.StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/_react["default"].createElement(_Chip.StyledContentRight, null, contentRight), hasClear && (contentClearButton || /*#__PURE__*/_react["default"].createElement(_Chip.StyledContentClear, {
|
73
73
|
onClick: handleClickClose
|
74
|
-
},
|
74
|
+
}, /*#__PURE__*/_react["default"].createElement(_IconClose.IconClose, {
|
75
75
|
sizeCustomProperty: _Chip2.tokens.closeIconSize,
|
76
76
|
color: "inherit"
|
77
|
-
})));
|
77
|
+
}))));
|
78
78
|
});
|
79
79
|
};
|
80
80
|
var chipConfig = exports.chipConfig = {
|
@@ -60,12 +60,12 @@ export var chipRoot = function chipRoot(Root) {
|
|
60
60
|
pilled: pilled,
|
61
61
|
readOnly: !disabled && readOnly,
|
62
62
|
size: size
|
63
|
-
}, rest), contentLeft && /*#__PURE__*/React.createElement(StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/React.createElement(StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/React.createElement(StyledContentRight, null, contentRight), hasClear && /*#__PURE__*/React.createElement(StyledContentClear, {
|
63
|
+
}, rest), contentLeft && /*#__PURE__*/React.createElement(StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/React.createElement(StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/React.createElement(StyledContentRight, null, contentRight), hasClear && (contentClearButton || /*#__PURE__*/React.createElement(StyledContentClear, {
|
64
64
|
onClick: handleClickClose
|
65
|
-
},
|
65
|
+
}, /*#__PURE__*/React.createElement(IconClose, {
|
66
66
|
sizeCustomProperty: tokens.closeIconSize,
|
67
67
|
color: "inherit"
|
68
|
-
})));
|
68
|
+
}))));
|
69
69
|
});
|
70
70
|
};
|
71
71
|
export var chipConfig = {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiC,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAU/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,eAAO,MAAM,QAAQ,SAAU,UAAU,iBAAiB,EAAE,SAAS,CAAC,
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiC,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAU/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,eAAO,MAAM,QAAQ,SAAU,UAAU,iBAAiB,EAAE,SAAS,CAAC,wFAiEhE,CAAC;AAEP,eAAO,MAAM,UAAU;;;mBAnEQ,UAAU,iBAAiB,EAAE,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmGrE,CAAC"}
|