@salutejs/plasma-new-hope 0.76.2-canary.1179.8707316396.0 → 0.76.2-canary.1180.8704132147.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Avatar/Avatar.js +15 -1
- package/cjs/components/Avatar/Avatar.js.map +1 -1
- package/cjs/components/Chip/Chip.css +0 -2
- package/cjs/components/Chip/Chip.js +2 -14
- package/cjs/components/Chip/Chip.js.map +1 -1
- package/cjs/components/Chip/Chip.tokens.js +0 -5
- package/cjs/components/Chip/Chip.tokens.js.map +1 -1
- package/cjs/components/Combobox/Combobox.css +0 -2
- package/cjs/components/Combobox/ui/ComboboxChip/ComboboxChip.css +0 -2
- package/cjs/components/Combobox/ui/ComboboxTarget/ComboboxTarget.css +0 -2
- package/cjs/components/Pagination/Pagination.css +0 -2
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +0 -2
- package/cjs/components/Select/Select.css +0 -2
- package/cjs/components/Select/ui/SelectChip/SelectChip.css +0 -2
- package/cjs/components/Select/ui/SelectTarget/SelectTarget.css +0 -2
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.css +0 -2
- package/cjs/index.css +0 -2
- package/es/components/Avatar/Avatar.js +15 -1
- package/es/components/Avatar/Avatar.js.map +1 -1
- package/es/components/Chip/Chip.css +0 -2
- package/es/components/Chip/Chip.js +3 -15
- package/es/components/Chip/Chip.js.map +1 -1
- package/es/components/Chip/Chip.tokens.js +1 -5
- package/es/components/Chip/Chip.tokens.js.map +1 -1
- package/es/components/Combobox/Combobox.css +0 -2
- package/es/components/Combobox/ui/ComboboxChip/ComboboxChip.css +0 -2
- package/es/components/Combobox/ui/ComboboxTarget/ComboboxTarget.css +0 -2
- package/es/components/Pagination/Pagination.css +0 -2
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +0 -2
- package/es/components/Select/Select.css +0 -2
- package/es/components/Select/ui/SelectChip/SelectChip.css +0 -2
- package/es/components/Select/ui/SelectTarget/SelectTarget.css +0 -2
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.css +0 -2
- package/es/index.css +0 -2
- package/package.json +2 -2
- package/styled-components/cjs/components/Avatar/Avatar.js +15 -1
- package/styled-components/cjs/components/Chip/Chip.js +2 -14
- package/styled-components/cjs/components/Chip/Chip.template-doc.mdx +2 -2
- package/styled-components/cjs/components/Chip/Chip.tokens.js +1 -5
- package/styled-components/cjs/examples/plasma_b2c/components/Avatar/Avatar.stories.tsx +1 -0
- package/styled-components/cjs/examples/plasma_b2c/components/AvatarGroup/AvatarGroup.stories.tsx +36 -18
- package/styled-components/cjs/examples/plasma_b2c/components/Chip/Chip.config.js +7 -10
- package/styled-components/cjs/examples/plasma_b2c/components/Chip/Chip.stories.tsx +2 -18
- package/styled-components/cjs/examples/plasma_web/components/Chip/Chip.config.js +7 -10
- package/styled-components/cjs/examples/plasma_web/components/Chip/Chip.stories.tsx +2 -18
- package/styled-components/es/components/Avatar/Avatar.js +15 -1
- package/styled-components/es/components/Chip/Chip.js +3 -15
- package/styled-components/es/components/Chip/Chip.template-doc.mdx +2 -2
- package/styled-components/es/components/Chip/Chip.tokens.js +0 -4
- package/styled-components/es/examples/plasma_b2c/components/Avatar/Avatar.stories.tsx +1 -0
- package/styled-components/es/examples/plasma_b2c/components/AvatarGroup/AvatarGroup.stories.tsx +36 -18
- package/styled-components/es/examples/plasma_b2c/components/Chip/Chip.config.js +7 -10
- package/styled-components/es/examples/plasma_b2c/components/Chip/Chip.stories.tsx +2 -18
- package/styled-components/es/examples/plasma_web/components/Chip/Chip.config.js +7 -10
- package/styled-components/es/examples/plasma_web/components/Chip/Chip.stories.tsx +2 -18
- package/types/components/Avatar/Avatar.d.ts.map +1 -1
- package/types/components/Chip/Chip.d.ts +0 -4
- package/types/components/Chip/Chip.d.ts.map +1 -1
- package/types/components/Chip/Chip.tokens.d.ts +0 -4
- package/types/components/Chip/Chip.tokens.d.ts.map +1 -1
- package/types/components/Chip/Chip.types.d.ts +0 -6
- package/types/components/Chip/Chip.types.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Chip/Chip.config.d.ts +1 -4
- package/types/examples/plasma_b2c/components/Chip/Chip.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Chip/Chip.d.ts +1 -4
- package/types/examples/plasma_b2c/components/Chip/Chip.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Chip/Chip.config.d.ts +1 -4
- package/types/examples/plasma_web/components/Chip/Chip.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Chip/Chip.d.ts +1 -4
- package/types/examples/plasma_web/components/Chip/Chip.d.ts.map +1 -1
- package/cjs/components/Chip/variations/_pilled/base.js +0 -9
- package/cjs/components/Chip/variations/_pilled/base.js.map +0 -1
- package/cjs/components/Chip/variations/_pilled/base_3kce4h.css +0 -1
- package/es/components/Chip/variations/_pilled/base.js +0 -5
- package/es/components/Chip/variations/_pilled/base.js.map +0 -1
- package/es/components/Chip/variations/_pilled/base_3kce4h.css +0 -1
- package/styled-components/cjs/components/Chip/variations/_pilled/base.js +0 -9
- package/styled-components/cjs/components/Chip/variations/_pilled/tokens.json +0 -4
- package/styled-components/es/components/Chip/variations/_pilled/base.js +0 -3
- package/styled-components/es/components/Chip/variations/_pilled/tokens.json +0 -4
- package/types/components/Chip/variations/_pilled/base.d.ts +0 -2
- package/types/components/Chip/variations/_pilled/base.d.ts.map +0 -1
@@ -16,7 +16,7 @@ var base = require('./variations/_size/base.js');
|
|
16
16
|
var base$1 = require('./variations/_focused/base.js');
|
17
17
|
var getInitialsForName = require('./utils/getInitialsForName.js');
|
18
18
|
|
19
|
-
var _excluded = ["size", "name", "url", "customText", "status", "className", "focused", "isScalable"];
|
19
|
+
var _excluded = ["size", "name", "url", "customText", "status", "className", "focused", "isScalable", "aria-label"];
|
20
20
|
var getAvatarContent = function getAvatarContent(_ref) {
|
21
21
|
var customText = _ref.customText,
|
22
22
|
url = _ref.url,
|
@@ -52,6 +52,10 @@ var StyledIndicator = /*#__PURE__*/react.styled(_exp())({
|
|
52
52
|
"sgw0czr-0": [/*#__PURE__*/_exp5()]
|
53
53
|
}
|
54
54
|
});
|
55
|
+
var StatusDict = {
|
56
|
+
active: 'Активен',
|
57
|
+
inactive: 'Неактивен'
|
58
|
+
};
|
55
59
|
var avatarRoot = function avatarRoot(Root) {
|
56
60
|
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
57
61
|
var avatarSize = props.size,
|
@@ -63,14 +67,23 @@ var avatarRoot = function avatarRoot(Root) {
|
|
63
67
|
_props$focused = props.focused,
|
64
68
|
focused = _props$focused === void 0 ? true : _props$focused,
|
65
69
|
isScalable = props.isScalable,
|
70
|
+
ariaLabelProp = props['aria-label'],
|
66
71
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(props, _excluded);
|
67
72
|
var initials = React.useMemo(function () {
|
68
73
|
return getInitialsForName.getInitialsForName(name);
|
69
74
|
}, [name]);
|
75
|
+
var ariaLabel;
|
76
|
+
|
77
|
+
// INFO: есть a11y и есть изображение, поэтому нужно озвучить что на нем: включаем aria-label
|
78
|
+
if ((rest === null || rest === void 0 ? void 0 : rest.role) === 'button' && url) {
|
79
|
+
ariaLabel = !ariaLabelProp || ariaLabelProp.trim() === '' ? name : ariaLabelProp;
|
80
|
+
ariaLabel = status ? "".concat(ariaLabel, ". ").concat(StatusDict[status]) : ariaLabel;
|
81
|
+
}
|
70
82
|
return /*#__PURE__*/React.createElement(Root, _rollupPluginBabelHelpers.extends({
|
71
83
|
ref: ref,
|
72
84
|
size: avatarSize,
|
73
85
|
className: index.cx(Avatar_tokens.classes.avatarItem, className),
|
86
|
+
"aria-label": ariaLabel,
|
74
87
|
focused: focused
|
75
88
|
}, rest), /*#__PURE__*/React.createElement(Avatar_styles.Wrapper, {
|
76
89
|
isScalable: isScalable
|
@@ -80,6 +93,7 @@ var avatarRoot = function avatarRoot(Root) {
|
|
80
93
|
initials: initials,
|
81
94
|
name: name
|
82
95
|
})), status && /*#__PURE__*/React.createElement(Avatar_styles.StatusIcon, null, /*#__PURE__*/React.createElement(StyledIndicator, {
|
96
|
+
"aria-label": StatusDict[status],
|
83
97
|
status: status
|
84
98
|
})));
|
85
99
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Avatar.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import React, { forwardRef, useMemo, ReactElement } from 'react';\nimport { styled } from '@linaria/react';\n\nimport { RootProps, component, mergeConfig } from '../../engines';\nimport { cx } from '../../utils';\nimport { indicatorConfig, indicatorTokens } from '../Indicator';\n\nimport { classes, tokens } from './Avatar.tokens';\nimport { base, Wrapper, Image, StatusIcon, Text } from './Avatar.styles';\nimport { AvatarProps } from './Avatar.types';\nimport { base as viewCSS } from './variations/_size/base';\nimport { base as focusedCSS } from './variations/_focused/base';\nimport { getInitialsForName } from './utils';\n\nconst getAvatarContent = ({\n customText,\n url,\n initials,\n name,\n}: Omit<AvatarProps, 'size'> & { initials?: string }): ReactElement => {\n if (customText) {\n return <Text>{customText}</Text>;\n }\n\n if (url) {\n return <Image src={url} alt={name} />;\n }\n\n return <Text>{initials}</Text>;\n};\n\nconst mergedConfig = mergeConfig(indicatorConfig);\nconst Indicator: React.FunctionComponent<\n React.HTMLAttributes<HTMLDivElement> & { status: AvatarProps['status'] }\n> = component(mergedConfig) as never;\n\nconst StyledIndicator = styled(Indicator)`\n ${indicatorTokens.size}: var(${tokens.statusIconSize});\n ${indicatorTokens.color}: ${({ status }) =>\n status === 'active' ? `var(${tokens.statusOnlineColor})` : `var(${tokens.statusOfflineColor})`}\n`;\n\nexport const avatarRoot = (Root: RootProps<HTMLDivElement, AvatarProps>) => {\n return forwardRef<HTMLDivElement, AvatarProps>((props, ref) => {\n const {\n size: avatarSize,\n name,\n url,\n customText,\n status,\n className,\n focused = true,\n isScalable,\n ...rest\n } = props;\n\n const initials = useMemo(() => getInitialsForName(name), [name]);\n\n return (\n <Root
|
1
|
+
{"version":3,"file":"Avatar.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import React, { forwardRef, useMemo, ReactElement } from 'react';\nimport { styled } from '@linaria/react';\n\nimport { RootProps, component, mergeConfig } from '../../engines';\nimport { cx } from '../../utils';\nimport { indicatorConfig, indicatorTokens } from '../Indicator';\n\nimport { classes, tokens } from './Avatar.tokens';\nimport { base, Wrapper, Image, StatusIcon, Text } from './Avatar.styles';\nimport { AvatarProps } from './Avatar.types';\nimport { base as viewCSS } from './variations/_size/base';\nimport { base as focusedCSS } from './variations/_focused/base';\nimport { getInitialsForName } from './utils';\n\nconst getAvatarContent = ({\n customText,\n url,\n initials,\n name,\n}: Omit<AvatarProps, 'size'> & { initials?: string }): ReactElement => {\n if (customText) {\n return <Text>{customText}</Text>;\n }\n\n if (url) {\n return <Image src={url} alt={name} />;\n }\n\n return <Text>{initials}</Text>;\n};\n\nconst mergedConfig = mergeConfig(indicatorConfig);\n\nconst Indicator: React.FunctionComponent<\n React.HTMLAttributes<HTMLDivElement> & { status: AvatarProps['status'] }\n> = component(mergedConfig) as never;\n\nconst StyledIndicator = styled(Indicator)`\n ${indicatorTokens.size}: var(${tokens.statusIconSize});\n ${indicatorTokens.color}: ${({ status }) =>\n status === 'active' ? `var(${tokens.statusOnlineColor})` : `var(${tokens.statusOfflineColor})`}\n`;\n\nconst StatusDict = {\n active: 'Активен',\n inactive: 'Неактивен',\n};\n\nexport const avatarRoot = (Root: RootProps<HTMLDivElement, AvatarProps>) => {\n return forwardRef<HTMLDivElement, AvatarProps>((props, ref) => {\n const {\n size: avatarSize,\n name,\n url,\n customText,\n status,\n className,\n focused = true,\n isScalable,\n 'aria-label': ariaLabelProp,\n ...rest\n } = props;\n\n const initials = useMemo(() => getInitialsForName(name), [name]);\n let ariaLabel;\n\n // INFO: есть a11y и есть изображение, поэтому нужно озвучить что на нем: включаем aria-label\n if (rest?.role === 'button' && url) {\n ariaLabel = !ariaLabelProp || ariaLabelProp.trim() === '' ? name : ariaLabelProp;\n ariaLabel = status ? `${ariaLabel}. ${StatusDict[status]}` : ariaLabel;\n }\n\n return (\n <Root\n ref={ref}\n size={avatarSize}\n className={cx(classes.avatarItem, className)}\n aria-label={ariaLabel}\n focused={focused}\n {...rest}\n >\n <Wrapper isScalable={isScalable}>{getAvatarContent({ customText, url, initials, name })}</Wrapper>\n\n {status && (\n <StatusIcon>\n <StyledIndicator aria-label={StatusDict[status]} status={status} />\n </StatusIcon>\n )}\n </Root>\n );\n });\n};\n\nexport const avatarConfig = {\n name: 'Avatar',\n tag: 'div',\n layout: avatarRoot,\n base,\n variations: {\n size: {\n css: viewCSS,\n },\n focused: {\n css: focusedCSS,\n },\n },\n defaults: {\n size: 'm',\n },\n};\n"],"names":["getAvatarContent","_ref","customText","url","initials","name","React","createElement","Text","Image","src","alt","mergedConfig","mergeConfig","indicatorConfig","Indicator","component","_exp","_exp5","_ref2","status","concat","tokens","statusOnlineColor","statusOfflineColor","StyledIndicator","styled","class","propsAsIs","vars","StatusDict","active","inactive","avatarRoot","Root","forwardRef","props","ref","avatarSize","size","className","_props$focused","focused","isScalable","ariaLabelProp","rest","_excluded","useMemo","getInitialsForName","ariaLabel","role","trim","_extends","cx","classes","avatarItem","Wrapper","StatusIcon","avatarConfig","tag","layout","base","variations","css","viewCSS","focusedCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;AAcA,IAAMA,gBAAgB,GAAGA,SAAnBA,gBAAgBA,CAAAC,IAAA,EAKiD;AAAA,EAAA,IAJnEC,UAAU,GAAAD,IAAA,CAAVC,UAAU;IACVC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IACHC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,IAAAA,GAAAA,IAAAA,CAAAA,IAAAA,CAAAA;AAEA,EAAA,IAAIH,UAAU,EAAE;AACZ,IAAA,oBAAOI,KAAA,CAAAC,aAAA,CAACC,kBAAI,EAAA,IAAA,EAAEN,UAAiB,CAAC,CAAA;AACpC,GAAA;AAEA,EAAA,IAAIC,GAAG,EAAE;AACL,IAAA,oBAAOG,KA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N3B,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
|
@@ -10,8 +10,6 @@
|
|
10
10
|
|
11
11
|
.base_kgtz8x_b16hf96__46a206b1{--plasma_private-chip-outline-size:var(--plasma-chip-outline-size,0.125rem);position:relative;}.base_kgtz8x_b16hf96__46a206b1:focus{outline:none;}.base_kgtz8x_b16hf96__46a206b1::before{content:'';position:absolute;top:calc(-1 * var(--plasma_private-chip-outline-size));left:calc(-1 * var(--plasma_private-chip-outline-size));right:calc(-1 * var(--plasma_private-chip-outline-size));bottom:calc(-1 * var(--plasma_private-chip-outline-size));z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-chip-outline-size) solid transparent;border-radius:calc(var(--plasma-chip-border-radius) + var(--plasma_private-chip-outline-size));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.base_kgtz8x_b16hf96__46a206b1.base_kgtz8x_focusVisible__46a206b1:focus::before,.base_kgtz8x_b16hf96__46a206b1[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-chip-outline-size) var(--plasma-chip-focus-color);}
|
12
12
|
|
13
|
-
.base_3kce4h_bvcavwi__c6ad5ca5.base_3kce4h_chipPilled__c6ad5ca5{border-radius:var(--plasma-chip-pilled-border-radius);}
|
14
|
-
|
15
13
|
.Chip_styles_1mwwhiw_bol5daj__07da4d18{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}
|
16
14
|
.Chip_styles_1mwwhiw_sj20on5__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-left-content-margin-left);margin-right:var(--plasma-chip-left-content-margin-right);}
|
17
15
|
.Chip_styles_1mwwhiw_s1ror4o9__07da4d18{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
@@ -5,17 +5,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
6
6
|
var React = require('react');
|
7
7
|
var IconClose = require('../_Icon/Icons/IconClose.js');
|
8
|
-
var index = require('../../utils/index.js');
|
9
8
|
var base = require('./variations/_view/base.js');
|
10
9
|
var base$1 = require('./variations/_size/base.js');
|
11
10
|
var base$2 = require('./variations/_disabled/base.js');
|
12
11
|
var base$3 = require('./variations/_readonly/base.js');
|
13
12
|
var base$4 = require('./variations/_focused/base.js');
|
14
|
-
var base$5 = require('./variations/_pilled/base.js');
|
15
13
|
var Chip_styles = require('./Chip.styles.js');
|
16
14
|
var Chip_tokens = require('./Chip.tokens.js');
|
17
15
|
|
18
|
-
var _excluded = ["children", "text", "contentLeft", "contentRight", "contentClearButton", "size", "
|
16
|
+
var _excluded = ["children", "text", "contentLeft", "contentRight", "contentClearButton", "size", "onClear", "onClick", "readOnly", "disabled"];
|
19
17
|
var chipRoot = function chipRoot(Root) {
|
20
18
|
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
21
19
|
var children = props.children,
|
@@ -24,18 +22,14 @@ var chipRoot = function chipRoot(Root) {
|
|
24
22
|
contentRight = props.contentRight,
|
25
23
|
contentClearButton = props.contentClearButton,
|
26
24
|
size = props.size,
|
27
|
-
className = props.className,
|
28
25
|
onClear = props.onClear,
|
29
26
|
onClick = props.onClick,
|
30
|
-
_props$pilled = props.pilled,
|
31
|
-
pilled = _props$pilled === void 0 ? false : _props$pilled,
|
32
27
|
_props$readOnly = props.readOnly,
|
33
28
|
readOnly = _props$readOnly === void 0 ? false : _props$readOnly,
|
34
29
|
_props$disabled = props.disabled,
|
35
30
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
36
31
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(props, _excluded);
|
37
32
|
var txt = !text && typeof children === 'string' ? children : text;
|
38
|
-
var pilledClass = pilled ? Chip_tokens.classes.pilled : undefined;
|
39
33
|
var handleClick = function handleClick(event) {
|
40
34
|
if (disabled || readOnly) {
|
41
35
|
return;
|
@@ -52,11 +46,9 @@ var chipRoot = function chipRoot(Root) {
|
|
52
46
|
return /*#__PURE__*/React.createElement(Root, _rollupPluginBabelHelpers.extends({
|
53
47
|
type: "button",
|
54
48
|
ref: ref,
|
55
|
-
className: index.cx(pilledClass, className),
|
56
49
|
tabIndex: readOnly ? -1 : 0,
|
57
50
|
onClick: handleClick,
|
58
51
|
disabled: disabled,
|
59
|
-
pilled: pilled,
|
60
52
|
readOnly: !disabled && readOnly,
|
61
53
|
size: size
|
62
54
|
}, 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), ClearContent);
|
@@ -84,14 +76,10 @@ var chipConfig = {
|
|
84
76
|
},
|
85
77
|
focused: {
|
86
78
|
css: base$4.base
|
87
|
-
},
|
88
|
-
pilled: {
|
89
|
-
css: base$5.base,
|
90
|
-
attrs: true
|
91
79
|
}
|
92
80
|
},
|
93
81
|
defaults: {
|
94
|
-
view: '
|
82
|
+
view: 'primary',
|
95
83
|
size: 'm'
|
96
84
|
}
|
97
85
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Chip.js","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import React, { forwardRef, useMemo } from 'react';\n\nimport type { RootProps } from '../../engines';\nimport { IconClose } from '../_Icon/Icons/IconClose';\
|
1
|
+
{"version":3,"file":"Chip.js","sources":["../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import React, { forwardRef, useMemo } from 'react';\n\nimport type { RootProps } from '../../engines';\nimport { IconClose } from '../_Icon/Icons/IconClose';\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 type { ChipProps } from './Chip.types';\nimport { StyledContentClear, StyledContentLeft, StyledContentMain, StyledContentRight, base } from './Chip.styles';\nimport { 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 size,\n onClear,\n onClick,\n readOnly = false,\n disabled = false,\n ...rest\n } = props;\n\n const txt = !text && typeof children === 'string' ? children : text;\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled || readOnly) {\n return;\n }\n\n onClick?.(event);\n onClear?.();\n };\n\n const ClearContent = useMemo(() => {\n return (\n contentClearButton || (\n <StyledContentClear>\n <IconClose sizeCustomProperty={tokens.closeIconSize} color=\"inherit\" />\n </StyledContentClear>\n )\n );\n }, [contentClearButton, tokens.closeIconSize]);\n\n return (\n <Root\n type=\"button\"\n ref={ref}\n tabIndex={readOnly ? -1 : 0}\n onClick={handleClick}\n disabled={disabled}\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 {ClearContent}\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 },\n defaults: {\n view: 'primary',\n size: 'm',\n },\n};\n"],"names":["chipRoot","Root","forwardRef","props","ref","children","text","contentLeft","contentRight","contentClearButton","size","onClear","onClick","_props$readOnly","readOnly","_props$disabled","disabled","rest","_objectWithoutProperties","_excluded","txt","handleClick","event","ClearContent","useMemo","React","createElement","StyledContentClear","IconClose","sizeCustomProperty","tokens","closeIconSize","color","_extends","type","tabIndex","StyledContentLeft","StyledContentMain","StyledContentRight","chipConfig","name","tag","layout","base","variations","view","css","viewCSS","sizeCSS","disabledCSS","attrs","readonlyCSS","focused","focusedCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;IAcaA,QAAQ,GAAG,SAAXA,QAAQA,CAAIC,IAA6C,EAAA;AAAA,EAAA,oBAClEC,gBAAU,CAA+B,UAACC,KAAK,EAAEC,GAAG,EAAK;AACrD,IAAA,IACIC,QAAQ,GAWRF,KAAK,CAXLE,QAAQ;MACRC,IAAI,GAUJH,KAAK,CAVLG,IAAI;MACJC,WAAW,GASXJ,KAAK,CATLI,WAAW;MACXC,YAAY,GAQZL,KAAK,CARLK,YAAY;MACZC,kBAAkB,GAOlBN,KAAK,CAPLM,kBAAkB;MAClBC,IAAI,GAMJP,KAAK,CANLO,IAAI;MACJC,OAAO,GAKPR,KAAK,CALLQ,OAAO;MACPC,OAAO,GAIPT,KAAK,CAJLS,OAAO;MAAAC,eAAA,GAIPV,KAAK,CAHLW,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,eAAA;MAAAE,eAAA,GAGhBZ,KAAK,CAFLa,QAAQ;AAARA,MAAAA,QAAQ,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,eAAA;AACbE,MAAAA,IAAI,GAAAC,iDAAA,CACPf,KAAK,EAAAgB,SAAA,CAAA,CAAA;AAET,IAAA,IAAMC,GAAG,GAAG,CAACd,IAAI,IAAI,OAAOD,QAAQ,KAAK,QAAQ,GAAGA,QAAQ,GAAGC,IAAI,CAAA;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,KAAA,CAAAC,aAAA,CAACW,6BAAiB,EAAA,IAAA,EAAEjB,GAAuB,CAAC,GAAGf,QAAQ,EAC7DG,YAAY,iBAAIiB,KAAA,CAAAC,aAAA,CAACY,8BAAkB,EAAA,IAAA,EAAE9B,YAAiC,CAAC,EACvEe,YACC,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAMgB,UAAU,GAAG;AACtBC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,GAAG,EAAE,QAAQ;AACbC,EAAAA,MAAM,EAAE1C,QAAQ;AAChB2C,EAAAA,IAAI,EAAJA,gBAAI;AACJC,EAAAA,UAAU,EAAE;AACRC,IAAAA,IAAI,EAAE;AACFC,MAAAA,GAAG,EAAEC,SAAAA;KACR;AACDrC,IAAAA,IAAI,EAAE;AACFoC,MAAAA,GAAG,EAAEE,WAAAA;KACR;AACDhC,IAAAA,QAAQ,EAAE;AACN8B,MAAAA,GAAG,EAAEG,WAAW;AAChBC,MAAAA,KAAK,EAAE,IAAA;KACV;AACDpC,IAAAA,QAAQ,EAAE;AACNgC,MAAAA,GAAG,EAAEK,WAAW;AAChBD,MAAAA,KAAK,EAAE,IAAA;KACV;AACDE,IAAAA,OAAO,EAAE;AACLN,MAAAA,GAAG,EAAEO,WAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNT,IAAAA,IAAI,EAAE,SAAS;AACfnC,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;;"}
|
@@ -2,9 +2,6 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
var classes = {
|
6
|
-
pilled: 'chip-pilled'
|
7
|
-
};
|
8
5
|
var tokens = {
|
9
6
|
background: '--plasma-chip-background',
|
10
7
|
color: '--plasma-chip-color',
|
@@ -22,7 +19,6 @@ var tokens = {
|
|
22
19
|
outlineSize: '--plasma-chip-outline-size',
|
23
20
|
closeIconColor: '--plasma-chip-close-icon-color',
|
24
21
|
borderRadius: '--plasma-chip-border-radius',
|
25
|
-
pilledBorderRadius: '--plasma-chip-pilled-border-radius',
|
26
22
|
width: '--plasma-chip-width',
|
27
23
|
height: '--plasma-chip-height',
|
28
24
|
paddingTop: '--plasma-chip-padding-top',
|
@@ -45,6 +41,5 @@ var tokens = {
|
|
45
41
|
clearContentMarginRight: '--plasma-chip-clear-content-margin-right'
|
46
42
|
};
|
47
43
|
|
48
|
-
exports.classes = classes;
|
49
44
|
exports.tokens = tokens;
|
50
45
|
//# sourceMappingURL=Chip.tokens.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Chip.tokens.js","sources":["../../../src/components/Chip/Chip.tokens.ts"],"sourcesContent":["export const
|
1
|
+
{"version":3,"file":"Chip.tokens.js","sources":["../../../src/components/Chip/Chip.tokens.ts"],"sourcesContent":["export const tokens = {\n background: '--plasma-chip-background',\n color: '--plasma-chip-color',\n backgroundHover: '--plasma-chip-background-hover',\n colorHover: '--plasma-chip-color-hover',\n scaleHover: '--plasma-chip-scale-hover',\n backgroundReadOnly: '--plasma-chip-background-readonly',\n colorReadOnly: '--plasma-chip-color-readonly',\n backgroundReadOnlyHover: '--plasma-chip-background-readonly-hover',\n colorReadOnlyHover: '--plasma-chip-color-readonly-hover',\n backgroundActive: '--plasma-chip-background-active',\n colorActive: '--plasma-chip-color-active',\n scaleActive: '--plasma-chip-scale-active',\n focusColor: '--plasma-chip-focus-color',\n outlineSize: '--plasma-chip-outline-size',\n closeIconColor: '--plasma-chip-close-icon-color',\n\n borderRadius: '--plasma-chip-border-radius',\n width: '--plasma-chip-width',\n height: '--plasma-chip-height',\n paddingTop: '--plasma-chip-padding-top',\n paddingRight: '--plasma-chip-padding-right',\n paddingBottom: '--plasma-chip-padding-bottom',\n paddingLeft: '--plasma-chip-padding-left',\n closeIconSize: '--plasma-chip-close-icon-size',\n\n disabledOpacity: '--plasma-chip-disabled-opacity',\n\n fontFamily: '--plasma-chip-font-family',\n fontSize: '--plasma-chip-font-size',\n fontStyle: '--plasma-chip-font-style',\n fontWeight: '--plasma-chip-font-weight',\n letterSpacing: '--plasma-chip-letter-spacing',\n lineHeight: '--plasma-chip-lineheight',\n\n leftContentMarginLeft: '--plasma-chip-left-content-margin-left',\n leftContentMarginRight: '--plasma-chip-left-content-margin-right',\n rightContentMarginLeft: '--plasma-chip-right-content-margin-left',\n rightContentMarginRight: '--plasma-chip-right-content-margin-right',\n clearContentMarginLeft: '--plasma-chip-clear-content-margin-left',\n clearContentMarginRight: '--plasma-chip-clear-content-margin-right',\n};\n"],"names":["tokens","background","color","backgroundHover","colorHover","scaleHover","backgroundReadOnly","colorReadOnly","backgroundReadOnlyHover","colorReadOnlyHover","backgroundActive","colorActive","scaleActive","focusColor","outlineSize","closeIconColor","borderRadius","width","height","paddingTop","paddingRight","paddingBottom","paddingLeft","closeIconSize","disabledOpacity","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","leftContentMarginLeft","leftContentMarginRight","rightContentMarginLeft","rightContentMarginRight","clearContentMarginLeft","clearContentMarginRight"],"mappings":";;;;AAAO,IAAMA,MAAM,GAAG;AAClBC,EAAAA,UAAU,EAAE,0BAA0B;AACtCC,EAAAA,KAAK,EAAE,qBAAqB;AAC5BC,EAAAA,eAAe,EAAE,gCAAgC;AACjDC,EAAAA,UAAU,EAAE,2BAA2B;AACvCC,EAAAA,UAAU,EAAE,2BAA2B;AACvCC,EAAAA,kBAAkB,EAAE,mCAAmC;AACvDC,EAAAA,aAAa,EAAE,8BAA8B;AAC7CC,EAAAA,uBAAuB,EAAE,yCAAyC;AAClEC,EAAAA,kBAAkB,EAAE,oCAAoC;AACxDC,EAAAA,gBAAgB,EAAE,iCAAiC;AACnDC,EAAAA,WAAW,EAAE,4BAA4B;AACzCC,EAAAA,WAAW,EAAE,4BAA4B;AACzCC,EAAAA,UAAU,EAAE,2BAA2B;AACvCC,EAAAA,WAAW,EAAE,4BAA4B;AACzCC,EAAAA,cAAc,EAAE,gCAAgC;AAEhDC,EAAAA,YAAY,EAAE,6BAA6B;AAC3CC,EAAAA,KAAK,EAAE,qBAAqB;AAC5BC,EAAAA,MAAM,EAAE,sBAAsB;AAC9BC,EAAAA,UAAU,EAAE,2BAA2B;AACvCC,EAAAA,YAAY,EAAE,6BAA6B;AAC3CC,EAAAA,aAAa,EAAE,8BAA8B;AAC7CC,EAAAA,WAAW,EAAE,4BAA4B;AACzCC,EAAAA,aAAa,EAAE,+BAA+B;AAE9CC,EAAAA,eAAe,EAAE,gCAAgC;AAEjDC,EAAAA,UAAU,EAAE,2BAA2B;AACvCC,EAAAA,QAAQ,EAAE,yBAAyB;AACnCC,EAAAA,SAAS,EAAE,0BAA0B;AACrCC,EAAAA,UAAU,EAAE,2BAA2B;AACvCC,EAAAA,aAAa,EAAE,8BAA8B;AAC7CC,EAAAA,UAAU,EAAE,0BAA0B;AAEtCC,EAAAA,qBAAqB,EAAE,wCAAwC;AAC/DC,EAAAA,sBAAsB,EAAE,yCAAyC;AACjEC,EAAAA,sBAAsB,EAAE,yCAAyC;AACjEC,EAAAA,uBAAuB,EAAE,0CAA0C;AACnEC,EAAAA,sBAAsB,EAAE,yCAAyC;AACjEC,EAAAA,uBAAuB,EAAE,0CAAA;AAC7B;;;;"}
|
@@ -35,8 +35,6 @@
|
|
35
35
|
|
36
36
|
.base_kgtz8x_b16hf96__46a206b1{--plasma_private-chip-outline-size:var(--plasma-chip-outline-size,0.125rem);position:relative;}.base_kgtz8x_b16hf96__46a206b1:focus{outline:none;}.base_kgtz8x_b16hf96__46a206b1::before{content:'';position:absolute;top:calc(-1 * var(--plasma_private-chip-outline-size));left:calc(-1 * var(--plasma_private-chip-outline-size));right:calc(-1 * var(--plasma_private-chip-outline-size));bottom:calc(-1 * var(--plasma_private-chip-outline-size));z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-chip-outline-size) solid transparent;border-radius:calc(var(--plasma-chip-border-radius) + var(--plasma_private-chip-outline-size));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.base_kgtz8x_b16hf96__46a206b1.base_kgtz8x_focusVisible__46a206b1:focus::before,.base_kgtz8x_b16hf96__46a206b1[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-chip-outline-size) var(--plasma-chip-focus-color);}
|
37
37
|
|
38
|
-
.base_3kce4h_bvcavwi__c6ad5ca5.base_3kce4h_chipPilled__c6ad5ca5{border-radius:var(--plasma-chip-pilled-border-radius);}
|
39
|
-
|
40
38
|
.Chip_styles_1mwwhiw_bol5daj__07da4d18{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}
|
41
39
|
.Chip_styles_1mwwhiw_sj20on5__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-left-content-margin-left);margin-right:var(--plasma-chip-left-content-margin-right);}
|
42
40
|
.Chip_styles_1mwwhiw_s1ror4o9__07da4d18{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
@@ -10,8 +10,6 @@
|
|
10
10
|
|
11
11
|
.base_kgtz8x_b16hf96__46a206b1{--plasma_private-chip-outline-size:var(--plasma-chip-outline-size,0.125rem);position:relative;}.base_kgtz8x_b16hf96__46a206b1:focus{outline:none;}.base_kgtz8x_b16hf96__46a206b1::before{content:'';position:absolute;top:calc(-1 * var(--plasma_private-chip-outline-size));left:calc(-1 * var(--plasma_private-chip-outline-size));right:calc(-1 * var(--plasma_private-chip-outline-size));bottom:calc(-1 * var(--plasma_private-chip-outline-size));z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-chip-outline-size) solid transparent;border-radius:calc(var(--plasma-chip-border-radius) + var(--plasma_private-chip-outline-size));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.base_kgtz8x_b16hf96__46a206b1.base_kgtz8x_focusVisible__46a206b1:focus::before,.base_kgtz8x_b16hf96__46a206b1[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-chip-outline-size) var(--plasma-chip-focus-color);}
|
12
12
|
|
13
|
-
.base_3kce4h_bvcavwi__c6ad5ca5.base_3kce4h_chipPilled__c6ad5ca5{border-radius:var(--plasma-chip-pilled-border-radius);}
|
14
|
-
|
15
13
|
.Chip_styles_1mwwhiw_bol5daj__07da4d18{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}
|
16
14
|
.Chip_styles_1mwwhiw_sj20on5__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-left-content-margin-left);margin-right:var(--plasma-chip-left-content-margin-right);}
|
17
15
|
.Chip_styles_1mwwhiw_s1ror4o9__07da4d18{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
@@ -8,8 +8,6 @@
|
|
8
8
|
|
9
9
|
.base_kgtz8x_b16hf96__46a206b1{--plasma_private-chip-outline-size:var(--plasma-chip-outline-size,0.125rem);position:relative;}.base_kgtz8x_b16hf96__46a206b1:focus{outline:none;}.base_kgtz8x_b16hf96__46a206b1::before{content:'';position:absolute;top:calc(-1 * var(--plasma_private-chip-outline-size));left:calc(-1 * var(--plasma_private-chip-outline-size));right:calc(-1 * var(--plasma_private-chip-outline-size));bottom:calc(-1 * var(--plasma_private-chip-outline-size));z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-chip-outline-size) solid transparent;border-radius:calc(var(--plasma-chip-border-radius) + var(--plasma_private-chip-outline-size));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.base_kgtz8x_b16hf96__46a206b1.base_kgtz8x_focusVisible__46a206b1:focus::before,.base_kgtz8x_b16hf96__46a206b1[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-chip-outline-size) var(--plasma-chip-focus-color);}
|
10
10
|
|
11
|
-
.base_3kce4h_bvcavwi__c6ad5ca5.base_3kce4h_chipPilled__c6ad5ca5{border-radius:var(--plasma-chip-pilled-border-radius);}
|
12
|
-
|
13
11
|
.Chip_styles_1mwwhiw_bol5daj__07da4d18{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}
|
14
12
|
.Chip_styles_1mwwhiw_sj20on5__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-left-content-margin-left);margin-right:var(--plasma-chip-left-content-margin-right);}
|
15
13
|
.Chip_styles_1mwwhiw_s1ror4o9__07da4d18{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
@@ -102,8 +102,6 @@
|
|
102
102
|
|
103
103
|
.base_kgtz8x_b16hf96__46a206b1{--plasma_private-chip-outline-size:var(--plasma-chip-outline-size,0.125rem);position:relative;}.base_kgtz8x_b16hf96__46a206b1:focus{outline:none;}.base_kgtz8x_b16hf96__46a206b1::before{content:'';position:absolute;top:calc(-1 * var(--plasma_private-chip-outline-size));left:calc(-1 * var(--plasma_private-chip-outline-size));right:calc(-1 * var(--plasma_private-chip-outline-size));bottom:calc(-1 * var(--plasma_private-chip-outline-size));z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-chip-outline-size) solid transparent;border-radius:calc(var(--plasma-chip-border-radius) + var(--plasma_private-chip-outline-size));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.base_kgtz8x_b16hf96__46a206b1.base_kgtz8x_focusVisible__46a206b1:focus::before,.base_kgtz8x_b16hf96__46a206b1[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-chip-outline-size) var(--plasma-chip-focus-color);}
|
104
104
|
|
105
|
-
.base_3kce4h_bvcavwi__c6ad5ca5.base_3kce4h_chipPilled__c6ad5ca5{border-radius:var(--plasma-chip-pilled-border-radius);}
|
106
|
-
|
107
105
|
.Chip_styles_1mwwhiw_bol5daj__07da4d18{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}
|
108
106
|
.Chip_styles_1mwwhiw_sj20on5__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-left-content-margin-left);margin-right:var(--plasma-chip-left-content-margin-right);}
|
109
107
|
.Chip_styles_1mwwhiw_s1ror4o9__07da4d18{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
@@ -47,8 +47,6 @@
|
|
47
47
|
|
48
48
|
.base_kgtz8x_b16hf96__46a206b1{--plasma_private-chip-outline-size:var(--plasma-chip-outline-size,0.125rem);position:relative;}.base_kgtz8x_b16hf96__46a206b1:focus{outline:none;}.base_kgtz8x_b16hf96__46a206b1::before{content:'';position:absolute;top:calc(-1 * var(--plasma_private-chip-outline-size));left:calc(-1 * var(--plasma_private-chip-outline-size));right:calc(-1 * var(--plasma_private-chip-outline-size));bottom:calc(-1 * var(--plasma_private-chip-outline-size));z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-chip-outline-size) solid transparent;border-radius:calc(var(--plasma-chip-border-radius) + var(--plasma_private-chip-outline-size));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.base_kgtz8x_b16hf96__46a206b1.base_kgtz8x_focusVisible__46a206b1:focus::before,.base_kgtz8x_b16hf96__46a206b1[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-chip-outline-size) var(--plasma-chip-focus-color);}
|
49
49
|
|
50
|
-
.base_3kce4h_bvcavwi__c6ad5ca5.base_3kce4h_chipPilled__c6ad5ca5{border-radius:var(--plasma-chip-pilled-border-radius);}
|
51
|
-
|
52
50
|
.Chip_styles_1mwwhiw_bol5daj__07da4d18{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}
|
53
51
|
.Chip_styles_1mwwhiw_sj20on5__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-left-content-margin-left);margin-right:var(--plasma-chip-left-content-margin-right);}
|
54
52
|
.Chip_styles_1mwwhiw_s1ror4o9__07da4d18{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
@@ -35,8 +35,6 @@
|
|
35
35
|
|
36
36
|
.base_kgtz8x_b16hf96__46a206b1{--plasma_private-chip-outline-size:var(--plasma-chip-outline-size,0.125rem);position:relative;}.base_kgtz8x_b16hf96__46a206b1:focus{outline:none;}.base_kgtz8x_b16hf96__46a206b1::before{content:'';position:absolute;top:calc(-1 * var(--plasma_private-chip-outline-size));left:calc(-1 * var(--plasma_private-chip-outline-size));right:calc(-1 * var(--plasma_private-chip-outline-size));bottom:calc(-1 * var(--plasma_private-chip-outline-size));z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-chip-outline-size) solid transparent;border-radius:calc(var(--plasma-chip-border-radius) + var(--plasma_private-chip-outline-size));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.base_kgtz8x_b16hf96__46a206b1.base_kgtz8x_focusVisible__46a206b1:focus::before,.base_kgtz8x_b16hf96__46a206b1[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-chip-outline-size) var(--plasma-chip-focus-color);}
|
37
37
|
|
38
|
-
.base_3kce4h_bvcavwi__c6ad5ca5.base_3kce4h_chipPilled__c6ad5ca5{border-radius:var(--plasma-chip-pilled-border-radius);}
|
39
|
-
|
40
38
|
.Chip_styles_1mwwhiw_bol5daj__07da4d18{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}
|
41
39
|
.Chip_styles_1mwwhiw_sj20on5__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-left-content-margin-left);margin-right:var(--plasma-chip-left-content-margin-right);}
|
42
40
|
.Chip_styles_1mwwhiw_s1ror4o9__07da4d18{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
@@ -10,8 +10,6 @@
|
|
10
10
|
|
11
11
|
.base_kgtz8x_b16hf96__46a206b1{--plasma_private-chip-outline-size:var(--plasma-chip-outline-size,0.125rem);position:relative;}.base_kgtz8x_b16hf96__46a206b1:focus{outline:none;}.base_kgtz8x_b16hf96__46a206b1::before{content:'';position:absolute;top:calc(-1 * var(--plasma_private-chip-outline-size));left:calc(-1 * var(--plasma_private-chip-outline-size));right:calc(-1 * var(--plasma_private-chip-outline-size));bottom:calc(-1 * var(--plasma_private-chip-outline-size));z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-chip-outline-size) solid transparent;border-radius:calc(var(--plasma-chip-border-radius) + var(--plasma_private-chip-outline-size));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.base_kgtz8x_b16hf96__46a206b1.base_kgtz8x_focusVisible__46a206b1:focus::before,.base_kgtz8x_b16hf96__46a206b1[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-chip-outline-size) var(--plasma-chip-focus-color);}
|
12
12
|
|
13
|
-
.base_3kce4h_bvcavwi__c6ad5ca5.base_3kce4h_chipPilled__c6ad5ca5{border-radius:var(--plasma-chip-pilled-border-radius);}
|
14
|
-
|
15
13
|
.Chip_styles_1mwwhiw_bol5daj__07da4d18{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}
|
16
14
|
.Chip_styles_1mwwhiw_sj20on5__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-left-content-margin-left);margin-right:var(--plasma-chip-left-content-margin-right);}
|
17
15
|
.Chip_styles_1mwwhiw_s1ror4o9__07da4d18{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
@@ -8,8 +8,6 @@
|
|
8
8
|
|
9
9
|
.base_kgtz8x_b16hf96__46a206b1{--plasma_private-chip-outline-size:var(--plasma-chip-outline-size,0.125rem);position:relative;}.base_kgtz8x_b16hf96__46a206b1:focus{outline:none;}.base_kgtz8x_b16hf96__46a206b1::before{content:'';position:absolute;top:calc(-1 * var(--plasma_private-chip-outline-size));left:calc(-1 * var(--plasma_private-chip-outline-size));right:calc(-1 * var(--plasma_private-chip-outline-size));bottom:calc(-1 * var(--plasma_private-chip-outline-size));z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-chip-outline-size) solid transparent;border-radius:calc(var(--plasma-chip-border-radius) + var(--plasma_private-chip-outline-size));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.base_kgtz8x_b16hf96__46a206b1.base_kgtz8x_focusVisible__46a206b1:focus::before,.base_kgtz8x_b16hf96__46a206b1[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-chip-outline-size) var(--plasma-chip-focus-color);}
|
10
10
|
|
11
|
-
.base_3kce4h_bvcavwi__c6ad5ca5.base_3kce4h_chipPilled__c6ad5ca5{border-radius:var(--plasma-chip-pilled-border-radius);}
|
12
|
-
|
13
11
|
.Chip_styles_1mwwhiw_bol5daj__07da4d18{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}
|
14
12
|
.Chip_styles_1mwwhiw_sj20on5__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-left-content-margin-left);margin-right:var(--plasma-chip-left-content-margin-right);}
|
15
13
|
.Chip_styles_1mwwhiw_s1ror4o9__07da4d18{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
@@ -10,8 +10,6 @@
|
|
10
10
|
|
11
11
|
.base_kgtz8x_b16hf96__46a206b1{--plasma_private-chip-outline-size:var(--plasma-chip-outline-size,0.125rem);position:relative;}.base_kgtz8x_b16hf96__46a206b1:focus{outline:none;}.base_kgtz8x_b16hf96__46a206b1::before{content:'';position:absolute;top:calc(-1 * var(--plasma_private-chip-outline-size));left:calc(-1 * var(--plasma_private-chip-outline-size));right:calc(-1 * var(--plasma_private-chip-outline-size));bottom:calc(-1 * var(--plasma_private-chip-outline-size));z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-chip-outline-size) solid transparent;border-radius:calc(var(--plasma-chip-border-radius) + var(--plasma_private-chip-outline-size));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.base_kgtz8x_b16hf96__46a206b1.base_kgtz8x_focusVisible__46a206b1:focus::before,.base_kgtz8x_b16hf96__46a206b1[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-chip-outline-size) var(--plasma-chip-focus-color);}
|
12
12
|
|
13
|
-
.base_3kce4h_bvcavwi__c6ad5ca5.base_3kce4h_chipPilled__c6ad5ca5{border-radius:var(--plasma-chip-pilled-border-radius);}
|
14
|
-
|
15
13
|
.Chip_styles_1mwwhiw_bol5daj__07da4d18{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}
|
16
14
|
.Chip_styles_1mwwhiw_sj20on5__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-left-content-margin-left);margin-right:var(--plasma-chip-left-content-margin-right);}
|
17
15
|
.Chip_styles_1mwwhiw_s1ror4o9__07da4d18{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
package/cjs/index.css
CHANGED
@@ -40,8 +40,6 @@
|
|
40
40
|
|
41
41
|
.base_kgtz8x_b16hf96__46a206b1{--plasma_private-chip-outline-size:var(--plasma-chip-outline-size,0.125rem);position:relative;}.base_kgtz8x_b16hf96__46a206b1:focus{outline:none;}.base_kgtz8x_b16hf96__46a206b1::before{content:'';position:absolute;top:calc(-1 * var(--plasma_private-chip-outline-size));left:calc(-1 * var(--plasma_private-chip-outline-size));right:calc(-1 * var(--plasma_private-chip-outline-size));bottom:calc(-1 * var(--plasma_private-chip-outline-size));z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-chip-outline-size) solid transparent;border-radius:calc(var(--plasma-chip-border-radius) + var(--plasma_private-chip-outline-size));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.base_kgtz8x_b16hf96__46a206b1.base_kgtz8x_focusVisible__46a206b1:focus::before,.base_kgtz8x_b16hf96__46a206b1[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-chip-outline-size) var(--plasma-chip-focus-color);}
|
42
42
|
|
43
|
-
.base_3kce4h_bvcavwi__c6ad5ca5.base_3kce4h_chipPilled__c6ad5ca5{border-radius:var(--plasma-chip-pilled-border-radius);}
|
44
|
-
|
45
43
|
.Chip_styles_1mwwhiw_bol5daj__07da4d18{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}
|
46
44
|
.Chip_styles_1mwwhiw_sj20on5__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-left-content-margin-left);margin-right:var(--plasma-chip-left-content-margin-right);}
|
47
45
|
.Chip_styles_1mwwhiw_s1ror4o9__07da4d18{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
@@ -12,7 +12,7 @@ import { base as base$1 } from './variations/_size/base.js';
|
|
12
12
|
import { base as base$2 } from './variations/_focused/base.js';
|
13
13
|
import { getInitialsForName } from './utils/getInitialsForName.js';
|
14
14
|
|
15
|
-
var _excluded = ["size", "name", "url", "customText", "status", "className", "focused", "isScalable"];
|
15
|
+
var _excluded = ["size", "name", "url", "customText", "status", "className", "focused", "isScalable", "aria-label"];
|
16
16
|
var getAvatarContent = function getAvatarContent(_ref) {
|
17
17
|
var customText = _ref.customText,
|
18
18
|
url = _ref.url,
|
@@ -48,6 +48,10 @@ var StyledIndicator = /*#__PURE__*/styled(_exp())({
|
|
48
48
|
"sgw0czr-0": [/*#__PURE__*/_exp5()]
|
49
49
|
}
|
50
50
|
});
|
51
|
+
var StatusDict = {
|
52
|
+
active: 'Активен',
|
53
|
+
inactive: 'Неактивен'
|
54
|
+
};
|
51
55
|
var avatarRoot = function avatarRoot(Root) {
|
52
56
|
return /*#__PURE__*/forwardRef(function (props, ref) {
|
53
57
|
var avatarSize = props.size,
|
@@ -59,14 +63,23 @@ var avatarRoot = function avatarRoot(Root) {
|
|
59
63
|
_props$focused = props.focused,
|
60
64
|
focused = _props$focused === void 0 ? true : _props$focused,
|
61
65
|
isScalable = props.isScalable,
|
66
|
+
ariaLabelProp = props['aria-label'],
|
62
67
|
rest = _objectWithoutProperties(props, _excluded);
|
63
68
|
var initials = useMemo(function () {
|
64
69
|
return getInitialsForName(name);
|
65
70
|
}, [name]);
|
71
|
+
var ariaLabel;
|
72
|
+
|
73
|
+
// INFO: есть a11y и есть изображение, поэтому нужно озвучить что на нем: включаем aria-label
|
74
|
+
if ((rest === null || rest === void 0 ? void 0 : rest.role) === 'button' && url) {
|
75
|
+
ariaLabel = !ariaLabelProp || ariaLabelProp.trim() === '' ? name : ariaLabelProp;
|
76
|
+
ariaLabel = status ? "".concat(ariaLabel, ". ").concat(StatusDict[status]) : ariaLabel;
|
77
|
+
}
|
66
78
|
return /*#__PURE__*/React.createElement(Root, _extends({
|
67
79
|
ref: ref,
|
68
80
|
size: avatarSize,
|
69
81
|
className: cx(classes.avatarItem, className),
|
82
|
+
"aria-label": ariaLabel,
|
70
83
|
focused: focused
|
71
84
|
}, rest), /*#__PURE__*/React.createElement(Wrapper, {
|
72
85
|
isScalable: isScalable
|
@@ -76,6 +89,7 @@ var avatarRoot = function avatarRoot(Root) {
|
|
76
89
|
initials: initials,
|
77
90
|
name: name
|
78
91
|
})), status && /*#__PURE__*/React.createElement(StatusIcon, null, /*#__PURE__*/React.createElement(StyledIndicator, {
|
92
|
+
"aria-label": StatusDict[status],
|
79
93
|
status: status
|
80
94
|
})));
|
81
95
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Avatar.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import React, { forwardRef, useMemo, ReactElement } from 'react';\nimport { styled } from '@linaria/react';\n\nimport { RootProps, component, mergeConfig } from '../../engines';\nimport { cx } from '../../utils';\nimport { indicatorConfig, indicatorTokens } from '../Indicator';\n\nimport { classes, tokens } from './Avatar.tokens';\nimport { base, Wrapper, Image, StatusIcon, Text } from './Avatar.styles';\nimport { AvatarProps } from './Avatar.types';\nimport { base as viewCSS } from './variations/_size/base';\nimport { base as focusedCSS } from './variations/_focused/base';\nimport { getInitialsForName } from './utils';\n\nconst getAvatarContent = ({\n customText,\n url,\n initials,\n name,\n}: Omit<AvatarProps, 'size'> & { initials?: string }): ReactElement => {\n if (customText) {\n return <Text>{customText}</Text>;\n }\n\n if (url) {\n return <Image src={url} alt={name} />;\n }\n\n return <Text>{initials}</Text>;\n};\n\nconst mergedConfig = mergeConfig(indicatorConfig);\nconst Indicator: React.FunctionComponent<\n React.HTMLAttributes<HTMLDivElement> & { status: AvatarProps['status'] }\n> = component(mergedConfig) as never;\n\nconst StyledIndicator = styled(Indicator)`\n ${indicatorTokens.size}: var(${tokens.statusIconSize});\n ${indicatorTokens.color}: ${({ status }) =>\n status === 'active' ? `var(${tokens.statusOnlineColor})` : `var(${tokens.statusOfflineColor})`}\n`;\n\nexport const avatarRoot = (Root: RootProps<HTMLDivElement, AvatarProps>) => {\n return forwardRef<HTMLDivElement, AvatarProps>((props, ref) => {\n const {\n size: avatarSize,\n name,\n url,\n customText,\n status,\n className,\n focused = true,\n isScalable,\n ...rest\n } = props;\n\n const initials = useMemo(() => getInitialsForName(name), [name]);\n\n return (\n <Root
|
1
|
+
{"version":3,"file":"Avatar.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import React, { forwardRef, useMemo, ReactElement } from 'react';\nimport { styled } from '@linaria/react';\n\nimport { RootProps, component, mergeConfig } from '../../engines';\nimport { cx } from '../../utils';\nimport { indicatorConfig, indicatorTokens } from '../Indicator';\n\nimport { classes, tokens } from './Avatar.tokens';\nimport { base, Wrapper, Image, StatusIcon, Text } from './Avatar.styles';\nimport { AvatarProps } from './Avatar.types';\nimport { base as viewCSS } from './variations/_size/base';\nimport { base as focusedCSS } from './variations/_focused/base';\nimport { getInitialsForName } from './utils';\n\nconst getAvatarContent = ({\n customText,\n url,\n initials,\n name,\n}: Omit<AvatarProps, 'size'> & { initials?: string }): ReactElement => {\n if (customText) {\n return <Text>{customText}</Text>;\n }\n\n if (url) {\n return <Image src={url} alt={name} />;\n }\n\n return <Text>{initials}</Text>;\n};\n\nconst mergedConfig = mergeConfig(indicatorConfig);\n\nconst Indicator: React.FunctionComponent<\n React.HTMLAttributes<HTMLDivElement> & { status: AvatarProps['status'] }\n> = component(mergedConfig) as never;\n\nconst StyledIndicator = styled(Indicator)`\n ${indicatorTokens.size}: var(${tokens.statusIconSize});\n ${indicatorTokens.color}: ${({ status }) =>\n status === 'active' ? `var(${tokens.statusOnlineColor})` : `var(${tokens.statusOfflineColor})`}\n`;\n\nconst StatusDict = {\n active: 'Активен',\n inactive: 'Неактивен',\n};\n\nexport const avatarRoot = (Root: RootProps<HTMLDivElement, AvatarProps>) => {\n return forwardRef<HTMLDivElement, AvatarProps>((props, ref) => {\n const {\n size: avatarSize,\n name,\n url,\n customText,\n status,\n className,\n focused = true,\n isScalable,\n 'aria-label': ariaLabelProp,\n ...rest\n } = props;\n\n const initials = useMemo(() => getInitialsForName(name), [name]);\n let ariaLabel;\n\n // INFO: есть a11y и есть изображение, поэтому нужно озвучить что на нем: включаем aria-label\n if (rest?.role === 'button' && url) {\n ariaLabel = !ariaLabelProp || ariaLabelProp.trim() === '' ? name : ariaLabelProp;\n ariaLabel = status ? `${ariaLabel}. ${StatusDict[status]}` : ariaLabel;\n }\n\n return (\n <Root\n ref={ref}\n size={avatarSize}\n className={cx(classes.avatarItem, className)}\n aria-label={ariaLabel}\n focused={focused}\n {...rest}\n >\n <Wrapper isScalable={isScalable}>{getAvatarContent({ customText, url, initials, name })}</Wrapper>\n\n {status && (\n <StatusIcon>\n <StyledIndicator aria-label={StatusDict[status]} status={status} />\n </StatusIcon>\n )}\n </Root>\n );\n });\n};\n\nexport const avatarConfig = {\n name: 'Avatar',\n tag: 'div',\n layout: avatarRoot,\n base,\n variations: {\n size: {\n css: viewCSS,\n },\n focused: {\n css: focusedCSS,\n },\n },\n defaults: {\n size: 'm',\n },\n};\n"],"names":["getAvatarContent","_ref","customText","url","initials","name","React","createElement","Text","Image","src","alt","mergedConfig","mergeConfig","indicatorConfig","Indicator","component","_exp","_exp5","_ref2","status","concat","tokens","statusOnlineColor","statusOfflineColor","StyledIndicator","styled","class","propsAsIs","vars","StatusDict","active","inactive","avatarRoot","Root","forwardRef","props","ref","avatarSize","size","className","_props$focused","focused","isScalable","ariaLabelProp","rest","_excluded","useMemo","getInitialsForName","ariaLabel","role","trim","_extends","cx","classes","avatarItem","Wrapper","StatusIcon","avatarConfig","tag","layout","base","variations","css","viewCSS","focusedCSS","defaults"],"mappings":";;;;;;;;;;;;;;AAcA,IAAMA,gBAAgB,GAAGA,SAAnBA,gBAAgBA,CAAAC,IAAA,EAKiD;AAAA,EAAA,IAJnEC,UAAU,GAAAD,IAAA,CAAVC,UAAU;IACVC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IACHC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,IAAAA,GAAAA,IAAAA,CAAAA,IAAAA,CAAAA;AAEA,EAAA,IAAIH,UAAU,EAAE;AACZ,IAAA,oBAAOI,KAAA,CAAAC,aAAA,CAACC,IAAI,EAAA,IAAA,EAAEN,UAAiB,CAAC,CAAA;AACpC,GAAA;A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A;GACH;AACDC,EAAAA,QAAQ,EAAE;AACN3B,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;"}
|
@@ -10,8 +10,6 @@
|
|
10
10
|
|
11
11
|
.base_kgtz8x_b16hf96__46a206b1{--plasma_private-chip-outline-size:var(--plasma-chip-outline-size,0.125rem);position:relative;}.base_kgtz8x_b16hf96__46a206b1:focus{outline:none;}.base_kgtz8x_b16hf96__46a206b1::before{content:'';position:absolute;top:calc(-1 * var(--plasma_private-chip-outline-size));left:calc(-1 * var(--plasma_private-chip-outline-size));right:calc(-1 * var(--plasma_private-chip-outline-size));bottom:calc(-1 * var(--plasma_private-chip-outline-size));z-index:1;display:block;box-sizing:content-box;border:var(--plasma_private-chip-outline-size) solid transparent;border-radius:calc(var(--plasma-chip-border-radius) + var(--plasma_private-chip-outline-size));-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.base_kgtz8x_b16hf96__46a206b1.base_kgtz8x_focusVisible__46a206b1:focus::before,.base_kgtz8x_b16hf96__46a206b1[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 var(--plasma_private-chip-outline-size) var(--plasma-chip-focus-color);}
|
12
12
|
|
13
|
-
.base_3kce4h_bvcavwi__c6ad5ca5.base_3kce4h_chipPilled__c6ad5ca5{border-radius:var(--plasma-chip-pilled-border-radius);}
|
14
|
-
|
15
13
|
.Chip_styles_1mwwhiw_bol5daj__07da4d18{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);}
|
16
14
|
.Chip_styles_1mwwhiw_sj20on5__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-left-content-margin-left);margin-right:var(--plasma-chip-left-content-margin-right);}
|
17
15
|
.Chip_styles_1mwwhiw_s1ror4o9__07da4d18{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
@@ -1,17 +1,15 @@
|
|
1
1
|
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
2
2
|
import React, { forwardRef, useMemo } from 'react';
|
3
3
|
import { IconClose } from '../_Icon/Icons/IconClose.js';
|
4
|
-
import { cx } from '../../utils/index.js';
|
5
4
|
import { base as base$1 } from './variations/_view/base.js';
|
6
5
|
import { base as base$2 } from './variations/_size/base.js';
|
7
6
|
import { base as base$3 } from './variations/_disabled/base.js';
|
8
7
|
import { base as base$4 } from './variations/_readonly/base.js';
|
9
8
|
import { base as base$5 } from './variations/_focused/base.js';
|
10
|
-
import { base as base$6 } from './variations/_pilled/base.js';
|
11
9
|
import { StyledContentClear, StyledContentLeft, StyledContentMain, StyledContentRight, base } from './Chip.styles.js';
|
12
|
-
import { tokens
|
10
|
+
import { tokens } from './Chip.tokens.js';
|
13
11
|
|
14
|
-
var _excluded = ["children", "text", "contentLeft", "contentRight", "contentClearButton", "size", "
|
12
|
+
var _excluded = ["children", "text", "contentLeft", "contentRight", "contentClearButton", "size", "onClear", "onClick", "readOnly", "disabled"];
|
15
13
|
var chipRoot = function chipRoot(Root) {
|
16
14
|
return /*#__PURE__*/forwardRef(function (props, ref) {
|
17
15
|
var children = props.children,
|
@@ -20,18 +18,14 @@ var chipRoot = function chipRoot(Root) {
|
|
20
18
|
contentRight = props.contentRight,
|
21
19
|
contentClearButton = props.contentClearButton,
|
22
20
|
size = props.size,
|
23
|
-
className = props.className,
|
24
21
|
onClear = props.onClear,
|
25
22
|
onClick = props.onClick,
|
26
|
-
_props$pilled = props.pilled,
|
27
|
-
pilled = _props$pilled === void 0 ? false : _props$pilled,
|
28
23
|
_props$readOnly = props.readOnly,
|
29
24
|
readOnly = _props$readOnly === void 0 ? false : _props$readOnly,
|
30
25
|
_props$disabled = props.disabled,
|
31
26
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
32
27
|
rest = _objectWithoutProperties(props, _excluded);
|
33
28
|
var txt = !text && typeof children === 'string' ? children : text;
|
34
|
-
var pilledClass = pilled ? classes.pilled : undefined;
|
35
29
|
var handleClick = function handleClick(event) {
|
36
30
|
if (disabled || readOnly) {
|
37
31
|
return;
|
@@ -48,11 +42,9 @@ var chipRoot = function chipRoot(Root) {
|
|
48
42
|
return /*#__PURE__*/React.createElement(Root, _extends({
|
49
43
|
type: "button",
|
50
44
|
ref: ref,
|
51
|
-
className: cx(pilledClass, className),
|
52
45
|
tabIndex: readOnly ? -1 : 0,
|
53
46
|
onClick: handleClick,
|
54
47
|
disabled: disabled,
|
55
|
-
pilled: pilled,
|
56
48
|
readOnly: !disabled && readOnly,
|
57
49
|
size: size
|
58
50
|
}, rest), contentLeft && /*#__PURE__*/React.createElement(StyledContentLeft, null, contentLeft), txt ? /*#__PURE__*/React.createElement(StyledContentMain, null, txt) : children, contentRight && /*#__PURE__*/React.createElement(StyledContentRight, null, contentRight), ClearContent);
|
@@ -80,14 +72,10 @@ var chipConfig = {
|
|
80
72
|
},
|
81
73
|
focused: {
|
82
74
|
css: base$5
|
83
|
-
},
|
84
|
-
pilled: {
|
85
|
-
css: base$6,
|
86
|
-
attrs: true
|
87
75
|
}
|
88
76
|
},
|
89
77
|
defaults: {
|
90
|
-
view: '
|
78
|
+
view: 'primary',
|
91
79
|
size: 'm'
|
92
80
|
}
|
93
81
|
};
|