@consta/uikit 4.17.2 → 4.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__internal__/src/components/Avatar/Avatar.css +1 -1
- package/__internal__/src/components/Badge/Badge.css +1 -1
- package/__internal__/src/components/Badge/Badge.d.ts +5 -0
- package/__internal__/src/components/Badge/Badge.js +1 -1
- package/__internal__/src/components/Badge/Badge.js.map +1 -1
- package/__internal__/src/components/Breadcrumbs/BreadcrumbsMore/BreadcrumbsMore.js +1 -1
- package/__internal__/src/components/Breadcrumbs/BreadcrumbsMore/BreadcrumbsMore.js.map +1 -1
- package/__internal__/src/components/Breadcrumbs/helpers.d.ts +2 -2
- package/__internal__/src/components/Breadcrumbs/helpers.js +1 -1
- package/__internal__/src/components/Breadcrumbs/helpers.js.map +1 -1
- package/__internal__/src/components/Checkbox/Checkbox.css +2 -2
- package/__internal__/src/components/CheckboxGroup/CheckboxGroup.js +1 -1
- package/__internal__/src/components/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/__internal__/src/components/CheckboxGroup/helper.d.ts +2 -1
- package/__internal__/src/components/CheckboxGroup/helper.js +1 -1
- package/__internal__/src/components/CheckboxGroup/helper.js.map +1 -1
- package/__internal__/src/components/CheckboxGroup/types.d.ts +3 -0
- package/__internal__/src/components/CheckboxGroup/types.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeDate/DateTimeTypeDate.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeDate/DateTimeTypeDate.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeMonth/DateTimeTypeMonth.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeMonth/DateTimeTypeMonth.js.map +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeYear/DateTimeTypeYear.js +1 -1
- package/__internal__/src/components/DateTime/DateTimeTypeYear/DateTimeTypeYear.js.map +1 -1
- package/__internal__/src/components/DragNDropField/DragNDropFieldTooltip/DragNDropFieldTooltip.css +1 -1
- package/__internal__/src/components/DragNDropField/DragNDropFieldTooltip/DragNDropFieldTooltip.js +1 -1
- package/__internal__/src/components/DragNDropField/DragNDropFieldTooltip/DragNDropFieldTooltip.js.map +1 -1
- package/__internal__/src/components/File/File.css +1 -1
- package/__internal__/src/components/Informer/Informer.d.ts +1 -1
- package/__internal__/src/components/Informer/Informer.js +1 -1
- package/__internal__/src/components/Informer/Informer.js.map +1 -1
- package/__internal__/src/components/ListCanary/ListDivider/ListDivider.js +1 -1
- package/__internal__/src/components/ListCanary/ListDivider/ListDivider.js.map +1 -1
- package/__internal__/src/components/ListCanary/maps.d.ts +1 -0
- package/__internal__/src/components/ListCanary/maps.js +1 -1
- package/__internal__/src/components/ListCanary/maps.js.map +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBarItem/ProgressStepBarItem.css +9 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBarItem/ProgressStepBarItem.js +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBarItem/ProgressStepBarItem.js.map +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBarLine/ProgressStepBarLine.js +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBarLine/ProgressStepBarLine.js.map +1 -1
- package/__internal__/src/components/RadioGroup/RadioGroup.css +1 -1
- package/__internal__/src/components/RadioGroup/RadioGroup.js +1 -1
- package/__internal__/src/components/RadioGroup/RadioGroup.js.map +1 -1
- package/__internal__/src/components/RadioGroup/helper.d.ts +2 -1
- package/__internal__/src/components/RadioGroup/helper.js +1 -1
- package/__internal__/src/components/RadioGroup/helper.js.map +1 -1
- package/__internal__/src/components/RadioGroup/types.d.ts +3 -0
- package/__internal__/src/components/RadioGroup/types.js.map +1 -1
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js +1 -1
- package/__internal__/src/components/SelectComponents/SelectDropdown/SelectDropdown.js.map +1 -1
- package/__internal__/src/components/TabsDeprecated/Tab/TabsTab.css +1 -1
- package/__internal__/src/components/TabsDeprecated/Tab/TabsTab.js +1 -1
- package/__internal__/src/components/TabsDeprecated/Tab/TabsTab.js.map +1 -1
- package/__internal__/src/components/User/User.css +1 -1
- package/__internal__/src/components/User/User.js +1 -1
- package/__internal__/src/components/User/User.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.TabsTab{--tab-indent:var(--space-m);align-items:center;background-color:transparent;border:none;color:var(--color-typo-secondary);cursor:pointer;display:inline-flex;font-family:var(--font);font-size:var(--tab-font-size);line-height:var(--size-text-2xl);padding:var(--tab-padding) 0;position:relative;text-align:left;transition:color .2s}.TabsTab_size_xs{--only-icon-size:var(--space-m);--tab-padding:calc(var(--space-xs)/2 - var(--space-3xs)/2);--tab-font-size:var(--size-text-xs)}.TabsTab_size_s{--only-icon-size:var(--space-l);--tab-padding:calc(var(--space-xs) - var(--space-3xs));--tab-font-size:var(--size-text-s)}.TabsTab_size_m{--only-icon-size:var(--space-xl);--tab-padding:calc(var(--space-m)/2 - var(--space-3xs)/2);--tab-font-size:var(--size-text-m)}.TabsTab:hover,.TabsTab_checked{color:var(--color-typo-primary)}.TabsTab:before{border-radius:var(--control-radius);bottom:0;content:"";display:block;left:calc(var(--space-2xs)*-1);position:absolute;right:calc(var(--space-2xs)*-1);top:0}.TabsTab:focus{outline:none}.TabsTab-Icon{flex-shrink:0}.TabsTab:not(.TabsTab_onlyIcon) .TabsTab-Icon{margin-right:calc(var(--tab-indent)*.5)}.TabsTab_onlyIcon{justify-content:center;width:var(--only-icon-size)}
|
|
1
|
+
.deprecated--TabsTab{--tab-indent:var(--space-m);align-items:center;background-color:transparent;border:none;color:var(--color-typo-secondary);cursor:pointer;display:inline-flex;font-family:var(--font);font-size:var(--tab-font-size);line-height:var(--size-text-2xl);padding:var(--tab-padding) 0;position:relative;text-align:left;transition:color .2s}.deprecated--TabsTab_size_xs{--only-icon-size:var(--space-m);--tab-padding:calc(var(--space-xs)/2 - var(--space-3xs)/2);--tab-font-size:var(--size-text-xs)}.deprecated--TabsTab_size_s{--only-icon-size:var(--space-l);--tab-padding:calc(var(--space-xs) - var(--space-3xs));--tab-font-size:var(--size-text-s)}.deprecated--TabsTab_size_m{--only-icon-size:var(--space-xl);--tab-padding:calc(var(--space-m)/2 - var(--space-3xs)/2);--tab-font-size:var(--size-text-m)}.deprecated--TabsTab:hover,.deprecated--TabsTab_checked{color:var(--color-typo-primary)}.deprecated--TabsTab:before{border-radius:var(--control-radius);bottom:0;content:"";display:block;left:calc(var(--space-2xs)*-1);position:absolute;right:calc(var(--space-2xs)*-1);top:0}.deprecated--TabsTab:focus{outline:none}.deprecated--TabsTab-Icon{flex-shrink:0}.deprecated--TabsTab:not(.deprecated--TabsTab_onlyIcon) .deprecated--TabsTab-Icon{margin-right:calc(var(--tab-indent)*.5)}.deprecated--TabsTab_onlyIcon{justify-content:center;width:var(--only-icon-size)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./TabsTab.css";import React,{forwardRef}from"react";import{cnMixFocus}from"../../../mixs/MixFocus/MixFocus";import{
|
|
1
|
+
import"./TabsTab.css";import React,{forwardRef}from"react";import{cnMixFocus}from"../../../mixs/MixFocus/MixFocus";import{cnDeprecated}from"../../../utils/bem";import{getByMap}from"../../../utils/getByMap";export var cnTabsTab=cnDeprecated("TabsTab");var sizeMap={s:"xs",m:"s",xs:"xs"};export var TabsTab=forwardRef(function(a,b){var c=a.label,d=a.onChange,e=a.checked,f=a.size,g=a.onlyIcon,h=a.icon,i=a.iconSize,j=a.className,k=getByMap(sizeMap,f,i);return React.createElement("button",{className:cnTabsTab({size:f,checked:e,onlyIcon:g},[cnMixFocus({before:!0}),j]),onClick:e?void 0:d,ref:b,role:"tab",type:"button",title:g?c:void 0},h&&React.createElement(h,{className:cnTabsTab("Icon"),size:k}),!g&&c)});
|
|
2
2
|
//# sourceMappingURL=TabsTab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabsTab.js","names":["React","forwardRef","cnMixFocus","
|
|
1
|
+
{"version":3,"file":"TabsTab.js","names":["React","forwardRef","cnMixFocus","cnDeprecated","getByMap","cnTabsTab","sizeMap","s","m","xs","TabsTab","props","ref","label","onChange","checked","size","onlyIcon","Icon","icon","iconSizeProp","iconSize","className","before"],"sources":["../../../../../../src/components/TabsDeprecated/Tab/TabsTab.tsx"],"sourcesContent":["import './TabsTab.css';\n\nimport { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport React, { forwardRef } from 'react';\n\nimport { cnMixFocus } from '../../../mixs/MixFocus/MixFocus';\nimport { cnDeprecated } from '../../../utils/bem';\nimport { getByMap } from '../../../utils/getByMap';\nimport { TabsPropSize } from '../TabsDeprecated';\n\nexport const cnTabsTab = cnDeprecated('TabsTab');\n\ntype Props = {\n size: TabsPropSize;\n onlyIcon?: boolean;\n icon?: IconComponent;\n iconSize?: IconPropSize;\n label: string;\n checked: boolean;\n onChange: React.MouseEventHandler<HTMLButtonElement>;\n className?: string;\n};\n\nconst sizeMap: Record<TabsPropSize, IconPropSize> = {\n s: 'xs',\n m: 's',\n xs: 'xs',\n};\n\nexport const TabsTab = forwardRef<HTMLButtonElement, Props>((props, ref) => {\n const {\n label,\n onChange,\n checked,\n size,\n onlyIcon,\n icon: Icon,\n iconSize: iconSizeProp,\n className,\n } = props;\n const iconSize = getByMap(sizeMap, size, iconSizeProp);\n\n return (\n <button\n className={cnTabsTab({ size, checked, onlyIcon }, [\n cnMixFocus({ before: true }),\n className,\n ])}\n onClick={checked ? undefined : onChange}\n ref={ref}\n role=\"tab\"\n type=\"button\"\n title={onlyIcon ? label : undefined}\n >\n {Icon && <Icon className={cnTabsTab('Icon')} size={iconSize} />}\n {!onlyIcon && label}\n </button>\n );\n});\n"],"mappings":"AAAA,sBAGA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,UAAT,uCACA,OAASC,YAAT,0BACA,OAASC,QAAT,+BAGA,MAAO,IAAMC,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@@
|
|
|
1
|
-
.User{align-items:center;border:0;border-radius:99em;display:inline-flex;text-align:left;text-decoration:none;transition:background-color .25s ease}.User-Block{flex:1}.User-Icon{flex:none}.User-IconRightButton{--indent-r:var(--space-xs);margin-left:var(--space-2xs)}.User-AvatarWrapper{border-radius:50%;box-sizing:content-box;flex:none;margin-right:var(--indent);padding:var(--avatar-space)}.User-AvatarWrapper_status_available{box-shadow:inset 0 0 0 var(--space-3xs) var(--color-bg-success)}.User-AvatarWrapper_status_remote{box-shadow:inset 0 0 0 var(--space-3xs) var(--color-bg-warning)}.User-AvatarWrapper_status_out{box-shadow:inset 0 0 0 var(--space-3xs) var(--color-bg-alert)}.User-AvatarWrapper:last-child{margin-right:0}.User_view_clear{background-color:var(--color-control-bg-clear)}.User_view_clear:hover{background-color:var(--color-control-bg-clear-hover)}.User_view_ghost{background-color:var(--color-control-bg-ghost)}.User_view_ghost:hover{background-color:var(--color-control-bg-ghost-hover)}.User-Info,.User-Name{word-wrap:break-word;-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.User-Name{max-width:20ch}.User-Info{max-width:28ch}.User_size_s{--avatar-space:var(--space-3xs);--indent-r:var(--space-xs);--indent:var(--space-xs);--icon-indent:var(--space-s)}.User_size_m{--avatar-space:var(--space-2xs);--indent-r:var(--space-s);--indent:var(--space-xs);--icon-indent:var(--space-m)}.User_size_l{--avatar-space:var(--space-2xs);--indent-r:var(--space-m);--indent:var(--space-s);--icon-indent:var(--space-l)}.User:not(.user_minified).User_width_full{width:100%}.User:not(.user_minified).User_width_full .User-Info,.User:not(.user_minified).User_width_full .User-Name{max-width:none}.User:not(.User_minified) .User-Icon{margin-left:var(--icon-indent)}.User>:last-child:not(:first-child){margin-right:var(--indent-r)}
|
|
1
|
+
.User{align-items:center;border:0;border-radius:99em;display:inline-flex;text-align:left;text-decoration:none;transition:background-color .25s ease}.User-Block{flex:1}.User-Icon{color:var(--color-control-typo-clear);flex:none}.User-IconRightButton{--indent-r:var(--space-xs);margin-left:var(--space-2xs)}.User-AvatarWrapper{border-radius:50%;box-sizing:content-box;flex:none;margin-right:var(--indent);padding:var(--avatar-space)}.User-AvatarWrapper_status_available{box-shadow:inset 0 0 0 var(--space-3xs) var(--color-bg-success)}.User-AvatarWrapper_status_remote{box-shadow:inset 0 0 0 var(--space-3xs) var(--color-bg-warning)}.User-AvatarWrapper_status_out{box-shadow:inset 0 0 0 var(--space-3xs) var(--color-bg-alert)}.User-AvatarWrapper:last-child{margin-right:0}.User_view_clear{background-color:var(--color-control-bg-clear)}.User_view_clear:hover{background-color:var(--color-control-bg-clear-hover)}.User_view_ghost{background-color:var(--color-control-bg-ghost)}.User_view_ghost:hover{background-color:var(--color-control-bg-ghost-hover)}.User-Info,.User-Name{word-wrap:break-word;-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.User-Name{max-width:20ch}.User-Info{max-width:28ch}.User_size_s{--avatar-space:var(--space-3xs);--indent-r:var(--space-xs);--indent:var(--space-xs);--icon-indent:var(--space-s)}.User_size_m{--avatar-space:var(--space-2xs);--indent-r:var(--space-s);--indent:var(--space-xs);--icon-indent:var(--space-m)}.User_size_l{--avatar-space:var(--space-2xs);--indent-r:var(--space-m);--indent:var(--space-s);--icon-indent:var(--space-l)}.User:not(.user_minified).User_width_full{width:100%}.User:not(.user_minified).User_width_full .User-Info,.User:not(.user_minified).User_width_full .User-Name{max-width:none}.User:not(.User_minified) .User-Icon{margin-left:var(--icon-indent)}.User>:last-child:not(:first-child){margin-right:var(--indent-r)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["as","className","size","avatarUrl","name","view","width","onlyAvatar","withArrow","iconRight","onIconRightClick","info","status"];import"./User.css";import{IconSelect}from"@consta/icons/IconSelect";import React from"react";import{cn}from"../../utils/bem";import{getByMap}from"../../utils/getByMap";import{forwardRefWithAs}from"../../utils/types/PropsWithAsAttributes";import{Avatar}from"../Avatar/Avatar";import{Button}from"../Button/Button";import{Text}from"../Text/Text";export var userPropSize=["m","s","l"];export var userPropSizeDefault=userPropSize[0];export var userPropView=["clear","ghost"];export var userPropViewDefault=userPropView[0];export var userPropWidth=["default","full"];export var userPropWidthDefault=userPropWidth[0];export var userPropStatus=["available","remote","out"];export var cnUser=cn("User");var infoSizeMap={s:"2xs",m:"2xs",l:"xs"},iconSizeMap={s:"xs",m:"xs",l:"s"},avatarSizeMap={s:"xs",m:"s",l:"m"},buttonSizeMap={s:"xs",m:"xs",l:"s"},nameSizeMap={s:"xs",m:"s",l:"m"};export var User=forwardRefWithAs(function(a,b){var c=a.as,d=void 0===c?"div":c,e=a.className,f=a.size,g=void 0===f?userPropSizeDefault:f,h=a.avatarUrl,i=a.name,j=a.view,k=void 0===j?userPropViewDefault:j,l=a.width,m=void 0===l?userPropWidthDefault:l,n=a.onlyAvatar,o=a.withArrow,p=a.iconRight,q=a.onIconRightClick,r=a.info,s=a.status,t=_objectWithoutProperties(a,_excluded),u=n||!i&&!r,v=p;return React.createElement(d,Object.assign({},t,{className:cnUser({size:g,view:k,width:m,withArrow:o,minified:u},[e]),ref:b}),React.createElement("div",{className:cnUser("AvatarWrapper",{status:s})},React.createElement(Avatar,{size:getByMap(avatarSizeMap,g),url:h,name:i})),!u&&(i||r)&&React.createElement("div",{className:cnUser("Block")},i&&React.createElement(Text,{className:cnUser("Name"),size:nameSizeMap[g],view:"primary",lineHeight:"2xs"},i),r&&"s"!==g&&React.createElement(Text,{className:cnUser("Info"),size:getByMap(infoSizeMap,g),view:"secondary",lineHeight:"2xs"},r)),o&&React.createElement(IconSelect,{className:cnUser("Icon"),size:getByMap(iconSizeMap,g),view:"secondary"}),v&&!q&&React.createElement(v,{className:cnUser("Icon"),size:getByMap(iconSizeMap,g),view:"secondary"}),v&&q&&React.createElement(Button,{className:cnUser("IconRightButton"),onClick:q,iconRight:v,onlyIcon:!0,type:"button",view:"clear",size:getByMap(buttonSizeMap,g),form:"round"}))});
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["as","className","size","avatarUrl","name","view","width","onlyAvatar","withArrow","iconRight","onIconRightClick","info","status"];import"./User.css";import{IconSelect}from"@consta/icons/IconSelect";import React from"react";import{cnMixSpace}from"../../mixs/MixSpace";import{cn}from"../../utils/bem";import{getByMap}from"../../utils/getByMap";import{forwardRefWithAs}from"../../utils/types/PropsWithAsAttributes";import{Avatar}from"../Avatar/Avatar";import{Button}from"../Button/Button";import{Text}from"../Text/Text";export var userPropSize=["m","s","l"];export var userPropSizeDefault=userPropSize[0];export var userPropView=["clear","ghost"];export var userPropViewDefault=userPropView[0];export var userPropWidth=["default","full"];export var userPropWidthDefault=userPropWidth[0];export var userPropStatus=["available","remote","out"];export var cnUser=cn("User");var infoSizeMap={s:"2xs",m:"2xs",l:"xs"},iconSizeMap={s:"xs",m:"xs",l:"s"},avatarSizeMap={s:"xs",m:"s",l:"m"},buttonSizeMap={s:"xs",m:"xs",l:"s"},nameSizeMap={s:"xs",m:"s",l:"m"},nameOffsetMap={s:0,m:"3xs",l:"2xs"};export var User=forwardRefWithAs(function(a,b){var c=a.as,d=void 0===c?"div":c,e=a.className,f=a.size,g=void 0===f?userPropSizeDefault:f,h=a.avatarUrl,i=a.name,j=a.view,k=void 0===j?userPropViewDefault:j,l=a.width,m=void 0===l?userPropWidthDefault:l,n=a.onlyAvatar,o=a.withArrow,p=a.iconRight,q=a.onIconRightClick,r=a.info,s=a.status,t=_objectWithoutProperties(a,_excluded),u=n||!i&&!r,v=p;return React.createElement(d,Object.assign({},t,{className:cnUser({size:g,view:k,width:m,withArrow:o,minified:u},[e]),ref:b}),React.createElement("div",{className:cnUser("AvatarWrapper",{status:s})},React.createElement(Avatar,{size:getByMap(avatarSizeMap,g),url:h,name:i})),!u&&(i||r)&&React.createElement("div",{className:cnUser("Block")},i&&React.createElement(Text,{className:cnUser("Name",[cnMixSpace({mB:nameOffsetMap[g]})]),size:nameSizeMap[g],view:"primary",lineHeight:"2xs"},i),r&&"s"!==g&&React.createElement(Text,{className:cnUser("Info"),size:getByMap(infoSizeMap,g),view:"secondary",lineHeight:"2xs"},r)),o&&React.createElement(IconSelect,{className:cnUser("Icon"),size:getByMap(iconSizeMap,g),view:"secondary"}),v&&!q&&React.createElement(v,{className:cnUser("Icon"),size:getByMap(iconSizeMap,g),view:"secondary"}),v&&q&&React.createElement(Button,{className:cnUser("IconRightButton"),onClick:q,iconRight:v,onlyIcon:!0,type:"button",view:"clear",size:getByMap(buttonSizeMap,g),form:"round"}))});
|
|
2
2
|
//# sourceMappingURL=User.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"User.js","names":["IconSelect","React","cn","getByMap","forwardRefWithAs","Avatar","Button","Text","userPropSize","userPropSizeDefault","userPropView","userPropViewDefault","userPropWidth","userPropWidthDefault","userPropStatus","cnUser","infoSizeMap","s","m","l","iconSizeMap","avatarSizeMap","buttonSizeMap","nameSizeMap","User","props","ref","as","className","size","avatarUrl","name","view","width","propOnlyAvatar","onlyAvatar","withArrow","iconRight","onIconRightClick","info","status","otherProps","IconRight","minified"],"sources":["../../../../../src/components/User/User.tsx"],"sourcesContent":["import './User.css';\n\nimport { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport { IconSelect } from '@consta/icons/IconSelect';\nimport React from 'react';\n\nimport { cn } from '../../utils/bem';\nimport { getByMap } from '../../utils/getByMap';\nimport { forwardRefWithAs } from '../../utils/types/PropsWithAsAttributes';\nimport { Avatar } from '../Avatar/Avatar';\nimport { Button, ButtonPropSize } from '../Button/Button';\nimport { Text, TextPropSize } from '../Text/Text';\n\nexport const userPropSize = ['m', 's', 'l'] as const;\nexport type UserPropSize = typeof userPropSize[number];\nexport const userPropSizeDefault: UserPropSize = userPropSize[0];\n\nexport const userPropView = ['clear', 'ghost'] as const;\nexport type UserPropView = typeof userPropView[number];\nexport const userPropViewDefault: UserPropView = userPropView[0];\n\nexport const userPropWidth = ['default', 'full'] as const;\nexport type UserPropWidth = typeof userPropWidth[number];\nexport const userPropWidthDefault: UserPropWidth = userPropWidth[0];\n\nexport const userPropStatus = ['available', 'remote', 'out'] as const;\nexport type UserPropStatus = typeof userPropStatus[number];\n\ntype Props = {\n avatarUrl?: string;\n name?: string;\n size?: UserPropSize;\n view?: UserPropView;\n width?: UserPropWidth;\n status?: UserPropStatus;\n onlyAvatar?: boolean;\n info?: string;\n children?: never;\n} & (\n | {\n withArrow?: boolean;\n iconRight?: never;\n onIconRightClick?: never;\n }\n | {\n withArrow?: never;\n iconRight?: IconComponent;\n onIconRightClick?: (e: React.SyntheticEvent) => void;\n }\n);\n\nexport const cnUser = cn('User');\n\nconst infoSizeMap: Record<UserPropSize, TextPropSize> = {\n s: '2xs',\n m: '2xs',\n l: 'xs',\n};\n\nconst iconSizeMap: Record<UserPropSize, IconPropSize> = {\n s: 'xs',\n m: 'xs',\n l: 's',\n};\n\nconst avatarSizeMap: Record<UserPropSize, IconPropSize> = {\n s: 'xs',\n m: 's',\n l: 'm',\n};\n\nconst buttonSizeMap: Record<UserPropSize, ButtonPropSize> = {\n s: 'xs',\n m: 'xs',\n l: 's',\n};\n\nconst nameSizeMap: Record<UserPropSize, TextPropSize> = {\n s: 'xs',\n m: 's',\n l: 'm',\n};\n\nexport const User = forwardRefWithAs<Props>((props, ref) => {\n const {\n as = 'div',\n className,\n size = userPropSizeDefault,\n avatarUrl,\n name,\n view = userPropViewDefault,\n width = userPropWidthDefault,\n onlyAvatar: propOnlyAvatar,\n withArrow,\n iconRight,\n onIconRightClick,\n info,\n status,\n ...otherProps\n } = props;\n const Tag = as as string;\n const onlyAvatar = propOnlyAvatar || (!name && !info);\n const IconRight = iconRight;\n\n return (\n <Tag\n {...otherProps}\n className={cnUser(\n { size, view, width, withArrow, minified: onlyAvatar },\n [className],\n )}\n ref={ref}\n >\n <div className={cnUser('AvatarWrapper', { status })}>\n <Avatar\n size={getByMap(avatarSizeMap, size)}\n url={avatarUrl}\n name={name}\n />\n </div>\n {!onlyAvatar && (name || info) && (\n <div className={cnUser('Block')}>\n {name && (\n <Text\n className={cnUser('Name')}\n size={nameSizeMap[size]}\n view=\"primary\"\n lineHeight=\"2xs\"\n >\n {name}\n </Text>\n )}\n {info && size !== 's' && (\n <Text\n className={cnUser('Info')}\n size={getByMap(infoSizeMap, size)}\n view=\"secondary\"\n lineHeight=\"2xs\"\n >\n {info}\n </Text>\n )}\n </div>\n )}\n {withArrow && (\n <IconSelect\n className={cnUser('Icon')}\n size={getByMap(iconSizeMap, size)}\n view=\"secondary\"\n />\n )}\n {IconRight && !onIconRightClick && (\n <IconRight\n className={cnUser('Icon')}\n size={getByMap(iconSizeMap, size)}\n view=\"secondary\"\n />\n )}\n {IconRight && onIconRightClick && (\n <Button\n className={cnUser('IconRightButton')}\n onClick={onIconRightClick}\n iconRight={IconRight}\n onlyIcon\n type=\"button\"\n view=\"clear\"\n size={getByMap(buttonSizeMap, size)}\n form=\"round\"\n />\n )}\n </Tag>\n );\n});\n"],"mappings":"uOAAA,mBAGA,OAASA,UAAT,KAA2B,0BAA3B,CACA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,uBACA,OAASC,QAAT,4BACA,OAASC,gBAAT,+CACA,OAASC,MAAT,wBACA,OAASC,MAAT,wBACA,OAASC,IAAT,oBAEA,MAAO,IAAMC,aAAY,CAAG,CAAC,GAAD,CAAM,GAAN,CAAW,GAAX,CAArB,CAEP,MAAO,IAAMC,oBAAiC,CAAGD,YAAY,CAAC,CAAD,CAAtD,CAEP,MAAO,IAAME,aAAY,CAAG,CAAC,OAAD,CAAU,OAAV,CAArB,CAEP,MAAO,IAAMC,oBAAiC,CAAGD,YAAY,CAAC,CAAD,CAAtD,CAEP,MAAO,IAAME,cAAa,CAAG,CAAC,SAAD,CAAY,MAAZ,CAAtB,CAEP,MAAO,IAAMC,qBAAmC,CAAGD,aAAa,CAAC,CAAD,CAAzD,CAEP,MAAO,IAAME,eAAc,CAAG,CAAC,WAAD,CAAc,QAAd,CAAwB,KAAxB,CAAvB,CA0BP,MAAO,IAAMC,OAAM,CAAGb,EAAE,CAAC,MAAD,CAAjB,C,GAEDc,YAA+C,CAAG,CACtDC,CAAC,CAAE,KADmD,CAEtDC,CAAC,CAAE,KAFmD,CAGtDC,CAAC,CAAE,IAHmD,C,CAMlDC,WAA+C,CAAG,CACtDH,CAAC,CAAE,IADmD,CAEtDC,CAAC,CAAE,IAFmD,CAGtDC,CAAC,CAAE,GAHmD,C,CAMlDE,aAAiD,CAAG,CACxDJ,CAAC,CAAE,IADqD,CAExDC,CAAC,CAAE,GAFqD,CAGxDC,CAAC,CAAE,GAHqD,C,CAMpDG,aAAmD,CAAG,CAC1DL,CAAC,CAAE,IADuD,CAE1DC,CAAC,CAAE,IAFuD,CAG1DC,CAAC,CAAE,GAHuD,C,CAMtDI,WAA+C,CAAG,CACtDN,CAAC,CAAE,IADmD,CAEtDC,CAAC,CAAE,GAFmD,CAGtDC,CAAC,CAAE,GAHmD,C,
|
|
1
|
+
{"version":3,"file":"User.js","names":["IconSelect","React","cnMixSpace","cn","getByMap","forwardRefWithAs","Avatar","Button","Text","userPropSize","userPropSizeDefault","userPropView","userPropViewDefault","userPropWidth","userPropWidthDefault","userPropStatus","cnUser","infoSizeMap","s","m","l","iconSizeMap","avatarSizeMap","buttonSizeMap","nameSizeMap","nameOffsetMap","User","props","ref","as","className","size","avatarUrl","name","view","width","propOnlyAvatar","onlyAvatar","withArrow","iconRight","onIconRightClick","info","status","otherProps","IconRight","minified","mB"],"sources":["../../../../../src/components/User/User.tsx"],"sourcesContent":["import './User.css';\n\nimport { IconComponent, IconPropSize } from '@consta/icons/Icon';\nimport { IconSelect } from '@consta/icons/IconSelect';\nimport React from 'react';\n\nimport { cnMixSpace, Space } from '##/mixs/MixSpace';\n\nimport { cn } from '../../utils/bem';\nimport { getByMap } from '../../utils/getByMap';\nimport { forwardRefWithAs } from '../../utils/types/PropsWithAsAttributes';\nimport { Avatar } from '../Avatar/Avatar';\nimport { Button, ButtonPropSize } from '../Button/Button';\nimport { Text, TextPropSize } from '../Text/Text';\n\nexport const userPropSize = ['m', 's', 'l'] as const;\nexport type UserPropSize = typeof userPropSize[number];\nexport const userPropSizeDefault: UserPropSize = userPropSize[0];\n\nexport const userPropView = ['clear', 'ghost'] as const;\nexport type UserPropView = typeof userPropView[number];\nexport const userPropViewDefault: UserPropView = userPropView[0];\n\nexport const userPropWidth = ['default', 'full'] as const;\nexport type UserPropWidth = typeof userPropWidth[number];\nexport const userPropWidthDefault: UserPropWidth = userPropWidth[0];\n\nexport const userPropStatus = ['available', 'remote', 'out'] as const;\nexport type UserPropStatus = typeof userPropStatus[number];\n\ntype Props = {\n avatarUrl?: string;\n name?: string;\n size?: UserPropSize;\n view?: UserPropView;\n width?: UserPropWidth;\n status?: UserPropStatus;\n onlyAvatar?: boolean;\n info?: string;\n children?: never;\n} & (\n | {\n withArrow?: boolean;\n iconRight?: never;\n onIconRightClick?: never;\n }\n | {\n withArrow?: never;\n iconRight?: IconComponent;\n onIconRightClick?: (e: React.SyntheticEvent) => void;\n }\n);\n\nexport const cnUser = cn('User');\n\nconst infoSizeMap: Record<UserPropSize, TextPropSize> = {\n s: '2xs',\n m: '2xs',\n l: 'xs',\n};\n\nconst iconSizeMap: Record<UserPropSize, IconPropSize> = {\n s: 'xs',\n m: 'xs',\n l: 's',\n};\n\nconst avatarSizeMap: Record<UserPropSize, IconPropSize> = {\n s: 'xs',\n m: 's',\n l: 'm',\n};\n\nconst buttonSizeMap: Record<UserPropSize, ButtonPropSize> = {\n s: 'xs',\n m: 'xs',\n l: 's',\n};\n\nconst nameSizeMap: Record<UserPropSize, TextPropSize> = {\n s: 'xs',\n m: 's',\n l: 'm',\n};\n\nconst nameOffsetMap: Record<UserPropSize, Space> = {\n s: 0,\n m: '3xs',\n l: '2xs',\n};\n\nexport const User = forwardRefWithAs<Props>((props, ref) => {\n const {\n as = 'div',\n className,\n size = userPropSizeDefault,\n avatarUrl,\n name,\n view = userPropViewDefault,\n width = userPropWidthDefault,\n onlyAvatar: propOnlyAvatar,\n withArrow,\n iconRight,\n onIconRightClick,\n info,\n status,\n ...otherProps\n } = props;\n const Tag = as as string;\n const onlyAvatar = propOnlyAvatar || (!name && !info);\n const IconRight = iconRight;\n\n return (\n <Tag\n {...otherProps}\n className={cnUser(\n { size, view, width, withArrow, minified: onlyAvatar },\n [className],\n )}\n ref={ref}\n >\n <div className={cnUser('AvatarWrapper', { status })}>\n <Avatar\n size={getByMap(avatarSizeMap, size)}\n url={avatarUrl}\n name={name}\n />\n </div>\n {!onlyAvatar && (name || info) && (\n <div className={cnUser('Block')}>\n {name && (\n <Text\n className={cnUser('Name', [\n cnMixSpace({ mB: nameOffsetMap[size] }),\n ])}\n size={nameSizeMap[size]}\n view=\"primary\"\n lineHeight=\"2xs\"\n >\n {name}\n </Text>\n )}\n {info && size !== 's' && (\n <Text\n className={cnUser('Info')}\n size={getByMap(infoSizeMap, size)}\n view=\"secondary\"\n lineHeight=\"2xs\"\n >\n {info}\n </Text>\n )}\n </div>\n )}\n {withArrow && (\n <IconSelect\n className={cnUser('Icon')}\n size={getByMap(iconSizeMap, size)}\n view=\"secondary\"\n />\n )}\n {IconRight && !onIconRightClick && (\n <IconRight\n className={cnUser('Icon')}\n size={getByMap(iconSizeMap, size)}\n view=\"secondary\"\n />\n )}\n {IconRight && onIconRightClick && (\n <Button\n className={cnUser('IconRightButton')}\n onClick={onIconRightClick}\n iconRight={IconRight}\n onlyIcon\n type=\"button\"\n view=\"clear\"\n size={getByMap(buttonSizeMap, size)}\n form=\"round\"\n />\n )}\n </Tag>\n );\n});\n"],"mappings":"uOAAA,mBAGA,OAASA,UAAT,KAA2B,0BAA3B,CACA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,UAAT,2BAEA,OAASC,EAAT,uBACA,OAASC,QAAT,4BACA,OAASC,gBAAT,+CACA,OAASC,MAAT,wBACA,OAASC,MAAT,wBACA,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