@foxford/ui 2.0.0-beta-ea0e9a4-20220620 → 2.0.0-beta-88482a5-20220624

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"Amount.js","sources":["../../../../src/components/Amount/Amount.tsx"],"sourcesContent":["import { PureComponent } from 'react'\nimport cx from 'clsx'\nimport { Color } from '../../mixins/color'\nimport { ResponsiveProperty } from '../../mixins/responsive-property'\nimport { BaseProps } from '../../shared/interfaces'\nimport { Text } from '../Text/Text'\nimport { CurrencyCodes, CURRENCY_MAP } from './data'\nimport * as Styled from './style'\n\nexport interface AmountProps extends BaseProps, Color, ResponsiveProperty<'size'> {\n /**\n * Value for amount\n */\n value?: number\n /**\n * Digits after point\n */\n digitsAfterPoint?: number\n /**\n * Show zero minor part\n */\n showZeroMinorPart?: boolean\n /**\n * Separator of major and minor part of amount\n */\n separator?: string\n /**\n * International code of currency.\n */\n currency?: keyof typeof CurrencyCodes\n /**\n * Use Header component for display amount\n */\n isHeader?: boolean\n /**\n * Amount is not valid and will be crossed out with ```text-decoration: line-through```\n */\n crossedOut?: boolean\n /**\n * If need only currency symbol\n */\n onlyCurrency?: boolean\n}\n\nconst AMOUNT_MAJOR_PART_SIZE = 3\nconst ZERO_MINOR_PART_REGEXP = /^0+$/\nconst MINUS_SIGN_HTML_CODE = '\\u2212'\n\nfunction createSplitter(partSize: number): (_s: string) => string[] {\n const parts = (str: string): string[] => {\n const { length } = str\n\n if (length <= partSize) {\n return [str]\n }\n\n const from = length - partSize\n const to = length\n\n return [str.slice(from, to)].concat(parts(str.slice(0, from)))\n }\n\n return parts\n}\n\nfunction formatAmount(\n value: AmountProps['value'] = 0,\n digitsAfterPoint: AmountProps['digitsAfterPoint'],\n currencyCode: AmountProps['currency']\n) {\n const isNegative = value < 0\n\n const valueAbs = Math.abs(value)\n const valueAbsStr = valueAbs.toFixed(digitsAfterPoint)\n\n const numberParts = valueAbsStr.split('.')\n const majorPart = numberParts[0]\n const minorPart = numberParts[1]\n\n const amountSplitter = createSplitter(AMOUNT_MAJOR_PART_SIZE)\n\n const majorPartFormatted = amountSplitter(majorPart).reverse().join(' ')\n\n const formattedValueStr = majorPartFormatted + (minorPart ? `,${minorPart}` : '')\n\n return {\n majorPart: majorPartFormatted,\n minorPart,\n value: formattedValueStr,\n isNegative,\n currencySymbol: currencyCode ? Amount.getCurrencySymbol(currencyCode) : '',\n }\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`ResponsiveProperty<'size'>`](#/Миксины)\n */\nexport class Amount extends PureComponent<AmountProps> {\n static displayName = 'Amount'\n static defaultProps = {\n isHeader: false,\n showZeroMinorPart: false,\n crossedOut: false,\n digitsAfterPoint: 2,\n separator: ',',\n onlyCurrency: false,\n }\n\n static getCurrencySymbol(currencyCode: keyof typeof CurrencyCodes) {\n return CURRENCY_MAP[currencyCode] || currencyCode\n }\n\n renderMinorPart(minorPart: string) {\n const { showZeroMinorPart, separator } = this.props\n\n let needMinorPart = false\n\n if (minorPart) {\n needMinorPart = true\n\n if (!showZeroMinorPart && ZERO_MINOR_PART_REGEXP.test(minorPart)) {\n needMinorPart = false\n }\n }\n\n if (needMinorPart) {\n return (\n <span className='minor-container'>\n <span className='separator'>{separator}</span>\n <span className='minor'>{minorPart}</span>\n </span>\n )\n }\n\n return null\n }\n\n renderCurrencySymbol = (currencySymbol: string) => (\n <span style={{ position: 'relative' }}>\n {this.props.currency === 'RUR' ? (\n <span\n style={{\n position: 'absolute',\n width: 0,\n opacity: 0,\n visibility: 'hidden',\n }}\n >\n руб.\n </span>\n ) : null}\n <span>{` ${currencySymbol}`}</span>\n </span>\n )\n\n render() {\n const { value, digitsAfterPoint, currency, isHeader, className, style, crossedOut, onlyCurrency, ...rest } =\n this.props\n\n const { majorPart, minorPart, isNegative, currencySymbol } = formatAmount(value, digitsAfterPoint, currency)\n\n const classNames = cx('amount', className)\n\n const amountInner = (\n <Styled.Root className={classNames} style={style} crossedOut={crossedOut}>\n {!onlyCurrency ? (\n <>\n <span className='major'>\n {isNegative && MINUS_SIGN_HTML_CODE}\n {majorPart}\n </span>\n {this.renderMinorPart(minorPart)}\n </>\n ) : null}\n {currency && this.renderCurrencySymbol(currencySymbol)}\n </Styled.Root>\n )\n\n const Element = isHeader ? Text.Heading : Text\n\n return (\n <Element {...rest} as='span'>\n {amountInner}\n </Element>\n )\n }\n}\n"],"names":["ZERO_MINOR_PART_REGEXP","createSplitter","partSize","parts","str","length","from","slice","concat","Amount","PureComponent","constructor","super","arguments","this","renderCurrencySymbol","currencySymbol","_jsxs","style","position","children","props","currency","_jsx","width","opacity","visibility","static","currencyCode","CURRENCY_MAP","renderMinorPart","minorPart","showZeroMinorPart","separator","needMinorPart","test","className","render","_this$props","value","digitsAfterPoint","isHeader","crossedOut","onlyCurrency","rest","_objectWithoutProperties","_excluded","majorPart","isNegative","r","e","t","undefined","numberParts","Math","abs","toFixed","split","majorPartFormatted","reverse","join","formattedValueStr","getCurrencySymbol","classNames","cx","amountInner","Styled.Root","_Fragment","Text","Heading","_objectSpread","as","displayName","defaultProps"],"mappings":"qdA6CA,IAAMA,EAAyB,OAG/B,SAASC,EAAeC,GACtB,IAAMC,EAASC,IACb,IAAMC,OAAEA,GAAWD,EAEnB,GAAIC,GAAUH,EACZ,MAAO,CAACE,GAGV,IAAME,EAAOD,EAASH,EAGtB,MAAO,CAACE,EAAIG,MAAMD,EAFPD,IAEkBG,OAAOL,EAAMC,EAAIG,MAAM,EAAGD,MAGzD,OAAOH,EAsCF,MAAMM,UAAeC,EAA2BC,cAAAC,SAAAC,WAAAC,KAwCrDC,qBAAwBC,GACtBC,EAAA,OAAA,CAAMC,MAAO,CAAEC,SAAU,YAAzBC,SAAA,CAC2B,QAAxBN,KAAKO,MAAMC,SACVC,EAAA,OAAA,CACEL,MAAO,CACLC,SAAU,WACVK,MAAO,EACPC,QAAS,EACTC,WAAY,UAL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,eAAgBY,EAAenB,EAAOqD,kBAAkBlC,GAAgB,IAzB5E,CAiG8EW,EAAOC,EAAkBlB,GAEnG,IAAMyC,EAAaC,EAAG,SAAU5B,GAEhC,IAAM6B,EACJhD,EAACiD,EAAD,CAAa9B,UAAW2B,EAAY7C,MAAOA,EAAOwB,WAAYA,EAA9DtB,SACG,CAACuB,EAQE,KAPF1B,EAAAkD,EAAA,CAAA/C,SACE,CAAAH,EAAA,OAAA,CAAMmB,UAAU,QAAhBhB,SAAA,CACG4B,GA7Hc,IA8HdD,KAEFjC,KAAKgB,gBAAgBC,MAGzBT,GAAYR,KAAKC,qBAAqBC,MAM3C,OACEO,EAHckB,EAAW2B,EAAKC,QAAUD,EAGxCE,EAAAA,EAAA,GAAa1B,GAAb,GAAA,CAAmB2B,GAAG,OAAtBnD,SACG6C,MArFIxD,EACJ+D,YAAc,SADV/D,EAEJgE,aAAe,CACpBhC,UAAAA,EACAT,mBAAmB,EACnBU,cACAF,iBAAkB,EAClBP,UAAW,IACXU"}
1
+ {"version":3,"file":"Amount.js","sources":["../../../../src/components/Amount/Amount.tsx"],"sourcesContent":["import { PureComponent } from 'react'\nimport cx from 'clsx'\nimport { Color } from '../../mixins/color'\nimport { ResponsiveProperty } from '../../mixins/responsive-property'\nimport { BaseProps } from '../../shared/interfaces'\nimport { Text } from '../Text/Text'\nimport { Display } from '../../mixins/display'\nimport { CurrencyCodes, CURRENCY_MAP } from './data'\nimport * as Styled from './style'\n\nexport interface AmountProps extends BaseProps, Color, ResponsiveProperty<'size'>, Display {\n /**\n * Value for amount\n */\n value?: number\n /**\n * Digits after point\n */\n digitsAfterPoint?: number\n /**\n * Show zero minor part\n */\n showZeroMinorPart?: boolean\n /**\n * Separator of major and minor part of amount\n */\n separator?: string\n /**\n * International code of currency.\n */\n currency?: keyof typeof CurrencyCodes\n /**\n * Use Header component for display amount\n */\n isHeader?: boolean\n /**\n * Amount is not valid and will be crossed out with ```text-decoration: line-through```\n */\n crossedOut?: boolean\n /**\n * If need only currency symbol\n */\n onlyCurrency?: boolean\n}\n\nconst AMOUNT_MAJOR_PART_SIZE = 3\nconst ZERO_MINOR_PART_REGEXP = /^0+$/\nconst MINUS_SIGN_HTML_CODE = '\\u2212'\n\nfunction createSplitter(partSize: number): (_s: string) => string[] {\n const parts = (str: string): string[] => {\n const { length } = str\n\n if (length <= partSize) {\n return [str]\n }\n\n const from = length - partSize\n const to = length\n\n return [str.slice(from, to)].concat(parts(str.slice(0, from)))\n }\n\n return parts\n}\n\nfunction formatAmount(\n value: AmountProps['value'] = 0,\n digitsAfterPoint: AmountProps['digitsAfterPoint'],\n currencyCode: AmountProps['currency']\n) {\n const isNegative = value < 0\n\n const valueAbs = Math.abs(value)\n const valueAbsStr = valueAbs.toFixed(digitsAfterPoint)\n\n const numberParts = valueAbsStr.split('.')\n const majorPart = numberParts[0]\n const minorPart = numberParts[1]\n\n const amountSplitter = createSplitter(AMOUNT_MAJOR_PART_SIZE)\n\n const majorPartFormatted = amountSplitter(majorPart).reverse().join(' ')\n\n const formattedValueStr = majorPartFormatted + (minorPart ? `,${minorPart}` : '')\n\n return {\n majorPart: majorPartFormatted,\n minorPart,\n value: formattedValueStr,\n isNegative,\n currencySymbol: currencyCode ? Amount.getCurrencySymbol(currencyCode) : '',\n }\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`ResponsiveProperty<'size'>`](#/Миксины)\n */\nexport class Amount extends PureComponent<AmountProps> {\n static displayName = 'Amount'\n static defaultProps = {\n isHeader: false,\n showZeroMinorPart: false,\n crossedOut: false,\n digitsAfterPoint: 2,\n separator: ',',\n onlyCurrency: false,\n }\n\n static getCurrencySymbol(currencyCode: keyof typeof CurrencyCodes) {\n return CURRENCY_MAP[currencyCode] || currencyCode\n }\n\n renderMinorPart(minorPart: string) {\n const { showZeroMinorPart, separator } = this.props\n\n let needMinorPart = false\n\n if (minorPart) {\n needMinorPart = true\n\n if (!showZeroMinorPart && ZERO_MINOR_PART_REGEXP.test(minorPart)) {\n needMinorPart = false\n }\n }\n\n if (needMinorPart) {\n return (\n <span className='minor-container'>\n <span className='separator'>{separator}</span>\n <span className='minor'>{minorPart}</span>\n </span>\n )\n }\n\n return null\n }\n\n renderCurrencySymbol = (currencySymbol: string) => (\n <span style={{ position: 'relative' }}>\n {this.props.currency === 'RUR' ? (\n <span\n style={{\n position: 'absolute',\n width: 0,\n opacity: 0,\n visibility: 'hidden',\n }}\n >\n руб.\n </span>\n ) : null}\n <span>{` ${currencySymbol}`}</span>\n </span>\n )\n\n render() {\n const { value, digitsAfterPoint, currency, isHeader, className, style, crossedOut, onlyCurrency, ...rest } =\n this.props\n\n const { majorPart, minorPart, isNegative, currencySymbol } = formatAmount(value, digitsAfterPoint, currency)\n\n const classNames = cx('amount', className)\n\n const amountInner = (\n <Styled.Root className={classNames} style={style} crossedOut={crossedOut}>\n {!onlyCurrency ? (\n <>\n <span className='major'>\n {isNegative && MINUS_SIGN_HTML_CODE}\n {majorPart}\n </span>\n {this.renderMinorPart(minorPart)}\n </>\n ) : null}\n {currency && this.renderCurrencySymbol(currencySymbol)}\n </Styled.Root>\n )\n\n const Element = isHeader ? Text.Heading : Text\n\n return (\n <Element {...rest} as='span'>\n {amountInner}\n </Element>\n )\n }\n}\n"],"names":["ZERO_MINOR_PART_REGEXP","createSplitter","partSize","parts","str","length","from","slice","concat","Amount","PureComponent","constructor","super","arguments","this","renderCurrencySymbol","currencySymbol","_jsxs","style","position","children","props","currency","_jsx","width","opacity","visibility","static","currencyCode","CURRENCY_MAP","renderMinorPart","minorPart","showZeroMinorPart","separator","needMinorPart","test","className","render","_this$props","value","digitsAfterPoint","isHeader","crossedOut","onlyCurrency","rest","_objectWithoutProperties","_excluded","majorPart","isNegative","r","e","t","undefined","numberParts","Math","abs","toFixed","split","majorPartFormatted","reverse","join","formattedValueStr","getCurrencySymbol","classNames","cx","amountInner","Styled.Root","_Fragment","Text","Heading","_objectSpread","as","displayName","defaultProps"],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,EAAAC,EAAAC,GAIE,IAHAZ,+BADFU,EAAAA,EACgC,EAG9B,IAFAT,EAEA3B,UAAAR,OAAA,EAJF6C,SAIE,IADAtB,EACAf,UAAAR,OAAA,EAJF8C,OAIEC,EACA,IAAMJ,EAAaT,EAAQ,EAK3B,IAAMc,EAHWC,KAAKC,IAAIhB,GACGiB,QAAQhB,GAELiB,MAAM,KACtC,IAAMV,EAAYM,EAAY,GAC9B,IAAMtB,EAAYsB,EAAY,GAI9B,IAAMK,EAFiBzD,EAnCM,EAmCNA,CAEmB8C,GAAWY,UAAUC,KAAK,KAEpE,IAAMC,EAAoBH,GAAsB3B,EAAgBA,IAAAA,OAAAA,GAAc,IAE9E,MAAO,CACLgB,UAAWW,EACX3B,UAAAA,EACAQ,MAAOsB,EACPb,WAAAA,EACAhC,eAAgBY,EAAenB,EAAOqD,kBAAkBlC,GAAgB,IAzB5E,CAiG8EW,EAAOC,EAAkBlB,GAEnG,IAAMyC,EAAaC,EAAG,SAAU5B,GAEhC,IAAM6B,EACJhD,EAACiD,EAAD,CAAa9B,UAAW2B,EAAY7C,MAAOA,EAAOwB,WAAYA,EAA9DtB,SACG,CAACuB,EAQE,KAPF1B,EAAAkD,EAAA,CAAA/C,SACE,CAAAH,EAAA,OAAA,CAAMmB,UAAU,QAAhBhB,SAAA,CACG4B,GA7Hc,IA8HdD,KAEFjC,KAAKgB,gBAAgBC,MAGzBT,GAAYR,KAAKC,qBAAqBC,MAM3C,OACEO,EAHckB,EAAW2B,EAAKC,QAAUD,EAGxCE,EAAAA,EAAA,GAAa1B,GAAb,GAAA,CAAmB2B,GAAG,OAAtBnD,SACG6C,MArFIxD,EACJ+D,YAAc,SADV/D,EAEJgE,aAAe,CACpBhC,UAAAA,EACAT,mBAAmB,EACnBU,cACAF,iBAAkB,EAClBP,UAAW,IACXU"}
@@ -1,2 +1,2 @@
1
- import e from'@babel/runtime/helpers/esm/objectSpread2';import s from'@babel/runtime/helpers/esm/objectWithoutProperties';import{Link as i}from'react-router-dom';import{Root as r}from'./style.js';import{jsx as a}from'react/jsx-runtime';var o=["as","to","href","wrapper","className","style","children","content","pseudo","underline","color","display","size","sizeXS","sizeS","sizeM","sizeL","sizeXL"];function l(l){var{as:z,to:p,href:n,wrapper:t,className:d,style:c,children:m,content:u,pseudo:h,underline:L,color:S,display:y,size:X,sizeXS:f,sizeS:b,sizeM:M,sizeL:N,sizeXL:v}=l,w=s(l,o);var j;j='div'!==z||y?'inline':'block';var x={};return u&&(x={dangerouslySetInnerHTML:{__html:u}}),a(r,e(z?e(e({as:z,pseudo:h,wrapper:t,underline:L,href:n,className:d,style:c,color:S,size:X,display:j,sizeXS:f,sizeS:b,sizeM:M,sizeL:N,sizeXL:v},w),x):h?e(e({as:"div",pseudo:h,wrapper:t,underline:L,href:n,className:d,color:S,size:X,display:j,sizeXS:f,sizeS:b,sizeM:M,sizeL:N,sizeXL:v},w),x):p?e(e({as:i,to:p,pseudo:h,wrapper:t,underline:L,className:d,color:S,size:X,display:j,sizeXS:f,sizeS:b,sizeM:M,sizeL:N,sizeXL:v},w),x):e(e({as:"a",href:n,pseudo:h,wrapper:t,underline:L,className:d,color:S,size:X,display:j,sizeXS:f,sizeS:b,sizeM:M,sizeL:N,sizeXL:v},x),w),{},{children:m}))}l.displayName='Anchor';export{l as Anchor};
1
+ import e from'@babel/runtime/helpers/esm/objectSpread2';import s from'@babel/runtime/helpers/esm/objectWithoutProperties';import{Link as i}from'react-router-dom';import{Root as r}from'./style.js';import{jsx as a}from'react/jsx-runtime';var o=["as","to","href","wrapper","className","style","children","content","pseudo","underline","color","display","size","sizeXS","sizeS","sizeM","sizeL","sizeXL"];function l(l){var{as:p,to:z,href:t,wrapper:n,className:d,style:c,children:m,content:u,pseudo:h,underline:L,color:S,display:y,size:f,sizeXS:X,sizeS:b,sizeM:M,sizeL:N,sizeXL:v}=l,w=s(l,o);var j;j='div'!==p||y?y:'block';var k={};return u&&(k=e(e({},k),{},{dangerouslySetInnerHTML:{__html:u}})),a(r,e(p?e(e({as:p,pseudo:h,wrapper:n,underline:L,href:t,className:d,style:c,color:S,size:f,display:j,sizeXS:X,sizeS:b,sizeM:M,sizeL:N,sizeXL:v},w),k):h?e(e({as:"div",pseudo:h,wrapper:n,underline:L,href:t,className:d,color:S,size:f,display:j,sizeXS:X,sizeS:b,sizeM:M,sizeL:N,sizeXL:v},w),k):z?e(e({as:i,to:z,pseudo:h,wrapper:n,underline:L,className:d,color:S,size:f,display:j,sizeXS:X,sizeS:b,sizeM:M,sizeL:N,sizeXL:v},w),k):e(e({as:"a",href:t,pseudo:h,wrapper:n,underline:L,className:d,color:S,size:f,display:j,sizeXS:X,sizeS:b,sizeM:M,sizeL:N,sizeXL:v},k),w),{},{children:m}))}l.displayName='Anchor',l.defaultProps={display:'inline-block'};export{l as Anchor};
2
2
  //# sourceMappingURL=Anchor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Anchor.js","sources":["../../../../src/components/Anchor/Anchor.tsx"],"sourcesContent":["import { Link } from 'react-router-dom'\nimport { BaseProps } from '../../shared/interfaces'\nimport { ResponsiveProperty } from '../../mixins/responsive-property'\nimport { Color } from '../../mixins/color'\nimport { Display } from '../../mixins/display'\nimport * as Styled from './style'\n\nexport interface AnchorProps extends BaseProps, Color, ResponsiveProperty<'size'>, Display {\n /**\n * Custom CSS class name\n */\n as?: 'div' | 'span' | 'a' | typeof Link\n /**\n * React router link to\n */\n to?: string\n /**\n * Link href\n */\n href?: string\n /**\n * Is display inline\n * */\n wrapper?: boolean\n /**\n * Pseudo link has dashed bottom border\n * */\n pseudo?: boolean\n /**\n * If link should be underlined\n * */\n underline?: boolean\n /**\n * Primary content\n */\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Primary content\n */\n content?: string\n /**\n * Onclick handler\n */\n onClick?: () => void\n}\n\nAnchor.displayName = 'Anchor'\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`ResponsiveProperty<'size'>`](#/Миксины)\n * - [`Display`](#/Миксины)\n */\nexport function Anchor(props: AnchorProps) {\n const {\n as,\n to,\n href,\n wrapper,\n className,\n style,\n children,\n content,\n pseudo,\n underline,\n color,\n display,\n size,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n ...rest\n } = props\n\n let _display: Display['display']\n\n if (as === 'div' && !display) _display = 'block'\n else _display = 'inline'\n\n let contentProps = {}\n\n if (content) {\n contentProps = {\n dangerouslySetInnerHTML: { __html: content },\n }\n }\n\n if (as)\n return (\n <Styled.Root\n as={as}\n pseudo={pseudo}\n wrapper={wrapper}\n underline={underline}\n href={href}\n className={className}\n style={style}\n color={color}\n size={size}\n display={_display}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n {...rest}\n {...contentProps}\n >\n {children}\n </Styled.Root>\n )\n\n if (pseudo)\n return (\n <Styled.Root\n as='div'\n pseudo={pseudo}\n wrapper={wrapper}\n underline={underline}\n href={href}\n className={className}\n color={color}\n size={size}\n display={_display}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n {...rest}\n {...contentProps}\n >\n {children}\n </Styled.Root>\n )\n else if (to)\n return (\n <Styled.Root\n as={Link}\n to={to}\n pseudo={pseudo}\n wrapper={wrapper}\n underline={underline}\n className={className}\n color={color}\n size={size}\n display={_display}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n {...rest}\n {...contentProps}\n >\n {children}\n </Styled.Root>\n )\n else\n return (\n <Styled.Root\n as='a'\n href={href}\n pseudo={pseudo}\n wrapper={wrapper}\n underline={underline}\n className={className}\n color={color}\n size={size}\n display={_display}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n {...contentProps}\n {...rest}\n >\n {children}\n </Styled.Root>\n )\n}\n"],"names":["Anchor","props","as","to","href","wrapper","className","style","children","content","pseudo","underline","color","display","size","sizeXS","sizeS","sizeM","sizeL","sizeXL","rest","_excluded","_display","contentProps","dangerouslySetInnerHTML","__html","_jsx","Styled.Root","_objectSpread","Link","displayName"],"mappings":"gZA0DO,SAASA,EAAOC,GACrB,IAAMC,GACJA,EADIC,GAEJA,EAFIC,KAGJA,EAHIC,QAIJA,EAJIC,UAKJA,EALIC,MAMJA,EANIC,SAOJA,EAPIC,QAQJA,EARIC,OASJA,EATIC,UAUJA,EAVIC,MAWJA,EAXIC,QAYJA,EAZIC,KAaJA,EAbIC,OAcJA,EAdIC,MAeJA,EAfIC,MAgBJA,EAhBIC,MAiBJA,EAjBIC,OAkBJA,GAEElB,EADCmB,IACDnB,EApBJoB,GAsBA,IAAIC,EAGCA,EADM,QAAPpB,GAAiBW,EACL,SADyB,QAGzC,IAAIU,EAAe,GAQnB,OANId,IACFc,EAAe,CACbC,wBAAyB,CAAEC,OAAQhB,KAMnCiB,EAACC,EAADC,EAFA1B,EAEA0B,EAAAA,EAAA,CACE1B,GAAIA,EACJQ,OAAQA,EACRL,QAASA,EACTM,UAAWA,EACXP,KAAMA,EACNE,UAAWA,EACXC,MAAOA,EACPK,MAAOA,EACPE,KAAMA,EACND,QAASS,EACTP,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,GACJC,GACAG,GAMNb,EAEAkB,EAAAA,EAAA,CACE1B,GAAG,MACHQ,OAAQA,EACRL,QAASA,EACTM,UAAWA,EACXP,KAAMA,EACNE,UAAWA,EACXM,MAAOA,EACPE,KAAMA,EACND,QAASS,EACTP,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,GACJC,GACAG,GAKDpB,EAELyB,EAAAA,EAAA,CACE1B,GAAI2B,EACJ1B,GAAIA,EACJO,OAAQA,EACRL,QAASA,EACTM,UAAWA,EACXL,UAAWA,EACXM,MAAOA,EACPE,KAAMA,EACND,QAASS,EACTP,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,GACJC,GACAG,GAONK,EAAAA,EAAA,CACE1B,GAAG,IACHE,KAAMA,EACNM,OAAQA,EACRL,QAASA,EACTM,UAAWA,EACXL,UAAWA,EACXM,MAAOA,EACPE,KAAMA,EACND,QAASS,EACTP,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,GACJI,GACAH,GAvFN,GAAA,CAAAZ,SAmBGA,KAlETR,EAAO8B,YAAc"}
1
+ {"version":3,"file":"Anchor.js","sources":["../../../../src/components/Anchor/Anchor.tsx"],"sourcesContent":["import { Link } from 'react-router-dom'\nimport { BaseProps } from '../../shared/interfaces'\nimport { ResponsiveProperty } from '../../mixins/responsive-property'\nimport { Color } from '../../mixins/color'\nimport { Display } from '../../mixins/display'\nimport * as Styled from './style'\n\nexport interface AnchorProps extends BaseProps, Color, ResponsiveProperty<'size'>, Display {\n /**\n * Custom CSS class name\n */\n as?: 'div' | 'span' | 'a' | typeof Link\n /**\n * React router link to\n */\n to?: string\n /**\n * Link href\n */\n href?: string\n /**\n * Is display inline\n * */\n wrapper?: boolean\n /**\n * Pseudo link has dashed bottom border\n * */\n pseudo?: boolean\n /**\n * If link should be underlined\n * */\n underline?: boolean\n /**\n * Primary content\n */\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Primary content\n */\n content?: string\n /**\n * Onclick handler\n */\n onClick?: () => void\n target?: string\n rel?: string\n}\n\nAnchor.displayName = 'Anchor'\nAnchor.defaultProps = {\n display: 'inline-block',\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`ResponsiveProperty<'size'>`](#/Миксины)\n * - [`Display`](#/Миксины)\n */\nexport function Anchor(props: typeof Anchor.defaultProps & AnchorProps) {\n const {\n as,\n to,\n href,\n wrapper,\n className,\n style,\n children,\n content,\n pseudo,\n underline,\n color,\n display,\n size,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n ...rest\n } = props\n\n let _display: Display['display']\n\n if (as === 'div' && !display) _display = 'block'\n else _display = display\n\n let contentProps = {}\n\n if (content) {\n contentProps = {\n ...contentProps,\n dangerouslySetInnerHTML: { __html: content },\n }\n }\n\n if (as)\n return (\n <Styled.Root\n as={as}\n pseudo={pseudo}\n wrapper={wrapper}\n underline={underline}\n href={href}\n className={className}\n style={style}\n color={color}\n size={size}\n display={_display}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n {...rest}\n {...contentProps}\n >\n {children}\n </Styled.Root>\n )\n\n if (pseudo)\n return (\n <Styled.Root\n as='div'\n pseudo={pseudo}\n wrapper={wrapper}\n underline={underline}\n href={href}\n className={className}\n color={color}\n size={size}\n display={_display}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n {...rest}\n {...contentProps}\n >\n {children}\n </Styled.Root>\n )\n else if (to)\n return (\n <Styled.Root\n as={Link}\n to={to}\n pseudo={pseudo}\n wrapper={wrapper}\n underline={underline}\n className={className}\n color={color}\n size={size}\n display={_display}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n {...rest}\n {...contentProps}\n >\n {children}\n </Styled.Root>\n )\n else\n return (\n <Styled.Root\n as='a'\n href={href}\n pseudo={pseudo}\n wrapper={wrapper}\n underline={underline}\n className={className}\n color={color}\n size={size}\n display={_display}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n {...contentProps}\n {...rest}\n >\n {children}\n </Styled.Root>\n )\n}\n"],"names":["Anchor","props","as","to","href","wrapper","className","style","children","content","pseudo","underline","color","display","size","sizeXS","sizeS","sizeM","sizeL","sizeXL","rest","_excluded","_display","contentProps","dangerouslySetInnerHTML","__html","_jsx","Styled.Root","_objectSpread","Link","displayName","defaultProps"],"mappings":"gZA+DO,SAASA,EAAOC,GACrB,IAAMC,GACJA,EADIC,GAEJA,EAFIC,KAGJA,EAHIC,QAIJA,EAJIC,UAKJA,EALIC,MAMJA,EANIC,SAOJA,EAPIC,QAQJA,EARIC,OASJA,EATIC,UAUJA,EAVIC,MAWJA,EAXIC,QAYJA,EAZIC,KAaJA,EAbIC,OAcJA,EAdIC,MAeJA,EAfIC,MAgBJA,EAhBIC,MAiBJA,EAjBIC,OAkBJA,GAEElB,EADCmB,IACDnB,EApBJoB,GAsBA,IAAIC,EAGCA,EADM,QAAPpB,GAAiBW,EACLA,EADyB,QAGzC,IAAIU,EAAe,GASnB,OAPId,IACFc,SACKA,GADO,GAAA,CAEVC,wBAAyB,CAAEC,OAAQhB,MAMnCiB,EAACC,EAADC,EAFA1B,EAEA0B,EAAAA,EAAA,CACE1B,GAAIA,EACJQ,OAAQA,EACRL,QAASA,EACTM,UAAWA,EACXP,KAAMA,EACNE,UAAWA,EACXC,MAAOA,EACPK,MAAOA,EACPE,KAAMA,EACND,QAASS,EACTP,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,GACJC,GACAG,GAMNb,EAEAkB,EAAAA,EAAA,CACE1B,GAAG,MACHQ,OAAQA,EACRL,QAASA,EACTM,UAAWA,EACXP,KAAMA,EACNE,UAAWA,EACXM,MAAOA,EACPE,KAAMA,EACND,QAASS,EACTP,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,GACJC,GACAG,GAKDpB,EAELyB,EAAAA,EAAA,CACE1B,GAAI2B,EACJ1B,GAAIA,EACJO,OAAQA,EACRL,QAASA,EACTM,UAAWA,EACXL,UAAWA,EACXM,MAAOA,EACPE,KAAMA,EACND,QAASS,EACTP,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,GACJC,GACAG,GAONK,EAAAA,EAAA,CACE1B,GAAG,IACHE,KAAMA,EACNM,OAAQA,EACRL,QAASA,EACTM,UAAWA,EACXL,UAAWA,EACXM,MAAOA,EACPE,KAAMA,EACND,QAASS,EACTP,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,GACJI,GACAH,GAvFN,GAAA,CAAAZ,SAmBGA,KAtETR,EAAO8B,YAAc,SACrB9B,EAAO+B,aAAe,CACpBlB,QAAS"}
@@ -1,2 +1,2 @@
1
- import e from'@babel/runtime/helpers/esm/objectSpread2';import r from'@babel/runtime/helpers/esm/objectWithoutProperties';import{Link as t}from'react-router-dom';import{Root as o,Content as a}from'./style.js';import{PROPS_BY_SIZE as i,PRESETS as n}from'./default.js';import{jsxs as s,jsx as l}from'react/jsx-runtime';var d=["children","disabled","href","to","as","blank","onClick","ref","icon","type","innerRef"];function m(m){var{children:p,disabled:c,href:f,to:u,as:b,blank:y,onClick:h,ref:v,icon:k,type:j,innerRef:P}=m,R=r(m,d);var S=b||(c?'button':f?'a':u?t:'button');var x='a'!==S||c?{}:{href:f||u,target:y?'_blank':void 0};var C='string'==typeof S||c?{}:{to:u||f};var g=R.size&&!R.round&&i[R.size]||{};var z=(e=>e.primary?n.primary:e.secondary?n.secondary:n.default)(m);return s(o,e(e(e(e(e(e({as:S,type:'button'===S?j:void 0,onClick:c||R.loading?void 0:h},g),x),C),z),R),{},{disabled:c,ref:v||P,children:[k&&l("span",{className:"icon",children:k}),p&&l(a,{children:p})]}))}m.defaultProps={size:'m',rounded:!0,display:'inline-block',as:'button',type:'button'},m.displayName='Button';export{m as Button};
1
+ import e from'@babel/runtime/helpers/esm/objectSpread2';import r from'@babel/runtime/helpers/esm/objectWithoutProperties';import{Link as t}from'react-router-dom';import{Root as o,Content as a}from'./style.js';import{PROPS_BY_SIZE as i,PRESETS as n}from'./default.js';import{jsxs as s,jsx as d}from'react/jsx-runtime';var l=["children","disabled","href","to","as","target","onClick","ref","icon","type","innerRef"];function m(m){var{children:p,disabled:c,href:f,to:u,as:b,target:y,onClick:h,ref:v,icon:j,type:g,innerRef:k}=m,P=r(m,l);var R=b||(c?'button':f?'a':u?t:'button');var S='a'!==R||c?{}:{href:f||u,target:y};var x='string'==typeof R||c?{}:{to:u||f};var C=P.size&&!P.round&&i[P.size]||{};var z=(e=>e.primary?n.primary:e.secondary?n.secondary:n.default)(m);return s(o,e(e(e(e(e(e({as:R,type:'button'===R?g:void 0,onClick:c||P.loading?void 0:h},C),S),x),z),P),{},{disabled:c,ref:v||k,children:[j&&d("span",{className:"icon",children:j}),p&&d(a,{children:p})]}))}m.defaultProps={size:'m',rounded:!0,display:'inline-block',as:'button',type:'button'},m.displayName='Button';export{m as Button};
2
2
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import { Link } from 'react-router-dom'\nimport { Display } from '../../mixins/display'\nimport { ResponsiveProperty } from '../../mixins/responsive-property'\nimport { BaseProps, Tooltiped } from '../../shared/interfaces'\nimport { Color } from '../../mixins/color'\nimport * as Styled from './style'\nimport { PRESETS, PROPS_BY_SIZE } from './default'\n\nexport interface ButtonProps\n extends BaseProps,\n Tooltiped,\n Display,\n Color,\n Color<'fontColor'>,\n ResponsiveProperty<'padding'>,\n ResponsiveProperty<'paddingTop'>,\n ResponsiveProperty<'paddingRight'>,\n ResponsiveProperty<'paddingBottom'>,\n ResponsiveProperty<'paddingLeft'>,\n ResponsiveProperty<'margin'>,\n ResponsiveProperty<'marginTop'>,\n ResponsiveProperty<'marginRight'>,\n ResponsiveProperty<'marginBottom'>,\n ResponsiveProperty<'marginLeft'>,\n ResponsiveProperty<'fontSize'>,\n ResponsiveProperty<'fluid', boolean>,\n ResponsiveProperty<'width', 'auto' | 'l' | 'm' | 's' | 'xs' | number>,\n ResponsiveProperty<'height', 'l' | 'm' | 's' | 'xs' | number> {\n /**\n * Node type\n */\n as?: 'div' | 'span' | 'a' | 'button' | typeof Link\n /**\n * add attr tagret='_blank' for `a` tag\n */\n blank?: boolean\n /**\n * Link href\n */\n href?: string\n /**\n * React router link to\n */\n to?: string\n /**\n * Type for button element\n */\n type?: 'button' | 'submit'\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Basic button\n */\n basic?: boolean\n /**\n * Disabled\n */\n disabled?: boolean\n /**\n * Is primary\n */\n primary?: boolean\n /**\n * Is secondary\n */\n secondary?: boolean\n /**\n * Is inverted\n */\n inverted?: boolean\n /**\n * Is rounded\n */\n rounded?: boolean\n /**\n * Is round (in a shape of circle)\n */\n round?: boolean\n /**\n * Indicates if there should not be any margin\n * between this button and the previous one\n */\n noSpacing?: boolean\n /**\n * Is in loading state\n */\n loading?: boolean\n /**\n * Button icon\n */\n icon?: React.ReactNode\n /** On click callback */\n onClick?: () => void\n /** Function to make ref */\n ref?: React.LegacyRef<HTMLDivElement>\n /**\n * Size\n */\n size?: 'l' | 'm' | 's' | 'xs'\n}\n\nButton.defaultProps = {\n size: 'm',\n rounded: true,\n display: 'inline-block',\n as: 'button',\n type: 'button',\n}\n\nButton.displayName = 'Button'\n\nconst extractPresetByProps = (props: ButtonProps): Partial<ButtonProps> => {\n if (props.primary) return PRESETS.primary\n if (props.secondary) return PRESETS.secondary\n return PRESETS.default\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Display`](#/Миксины)\n * - [`Tooltiped`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`Color<'fontColor'>`](#/Миксины)\n * - [`ResponsiveProperty<'padding'>`](#/Миксины)\n * - [`ResponsiveProperty<'paddingTop'>`](#/Миксины)\n * - [`ResponsiveProperty<'paddingRight'>`](#/Миксины)\n * - [`ResponsiveProperty<'paddingBottom'>`](#/Миксины)\n * - [`ResponsiveProperty<'paddingLeft'>`](#/Миксины)\n * - [`ResponsiveProperty<'margin'>`](#/Миксины)\n * - [`ResponsiveProperty<'marginTop'>`](#/Миксины)\n * - [`ResponsiveProperty<'marginRight'>`](#/Миксины)\n * - [`ResponsiveProperty<'marginBottom'>`](#/Миксины)\n * - [`ResponsiveProperty<'marginLeft'>`](#/Миксины)\n * - [`ResponsiveProperty<'fontSize'>`](#/Миксины)\n * - [`ResponsiveProperty<'fluid', boolean>`](#/Миксины)\n * - [`ResponsiveProperty<'width', 'auto' | 'l' | 'm' | 's' | 'xs' | number>`](#/Миксины)\n * - [`ResponsiveProperty<'height', 'l' | 'm' | 's' | 'xs' | number>`](#/Миксины)\n */\nexport function Button(props: ButtonProps) {\n const { children, disabled, href, to, as, blank, onClick, ref, icon, type, innerRef, ...restProps } = props\n\n const _as = as || (disabled ? 'button' : href ? 'a' : to ? Link : 'button')\n const aProps = _as === 'a' && !disabled ? { href: href || to, target: blank ? '_blank' : undefined } : {}\n const linkProps = typeof _as !== 'string' && !disabled ? { to: to || href } : {}\n const propsBySize: Partial<ButtonProps> =\n restProps.size && !restProps.round ? PROPS_BY_SIZE[restProps.size] || {} : {}\n const presetProps: Partial<ButtonProps> = extractPresetByProps(props)\n\n return (\n <Styled.Root\n as={_as}\n type={_as === 'button' ? type : undefined}\n onClick={disabled || restProps.loading ? undefined : onClick}\n {...propsBySize}\n {...aProps}\n {...linkProps}\n {...presetProps}\n {...restProps}\n disabled={disabled}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={(ref || innerRef) as any}\n >\n {icon && <span className='icon'>{icon}</span>}\n {children && <Styled.Content>{children}</Styled.Content>}\n </Styled.Root>\n )\n}\n"],"names":["Button","props","children","disabled","href","to","as","blank","onClick","ref","icon","type","innerRef","restProps","_excluded","_as","Link","aProps","target","undefined","linkProps","propsBySize","size","round","PROPS_BY_SIZE","presetProps","primary","PRESETS","secondary","default","_jsxs","Styled.Root","_objectSpread","loading","_jsx","className","Styled.Content","defaultProps","rounded","display","displayName"],"mappings":"6ZA6IO,SAASA,EAAOC,GACrB,IAAMC,SAAEA,EAAFC,SAAYA,EAAZC,KAAsBA,EAAtBC,GAA4BA,EAA5BC,GAAgCA,EAAhCC,MAAoCA,EAApCC,QAA2CA,EAA3CC,IAAoDA,EAApDC,KAAyDA,EAAzDC,KAA+DA,EAA/DC,SAAqEA,GAA2BX,EAAdY,IAAcZ,EAAtGa,GAEA,IAAMC,EAAMT,IAAOH,EAAW,SAAWC,EAAO,IAAMC,EAAKW,EAAO,UAClE,IAAMC,EAAiB,MAARF,GAAgBZ,EAAwE,GAA7D,CAAEC,KAAMA,GAAQC,EAAIa,OAAQX,EAAQ,cAAWY,GACzF,IAAMC,EAA2B,iBAARL,GAAqBZ,EAAgC,GAArB,CAAEE,GAAIA,GAAMD,GACrE,IAAMiB,EACJR,EAAUS,OAAST,EAAUU,OAAQC,EAAcX,EAAUS,OAAc,GAC7E,IAAMG,EApCsBxB,CAAAA,GACxBA,EAAMyB,QAAgBC,EAAQD,QAC9BzB,EAAM2B,UAAkBD,EAAQC,UAC7BD,EAAQE,QAHa5B,CAoCmCA,GAE/D,OACE6B,EAACC,EAADC,EAAAA,EAAAA,EAAAA,EAAAA,EAAAA,EAAA,CACE1B,GAAIS,EACJJ,KAAc,WAARI,EAAmBJ,OAAOQ,EAChCX,QAASL,GAAYU,EAAUoB,eAAsBzB,GACjDa,GACAJ,GACAG,GACAK,GACAZ,GARN,GAAA,CASEV,SAAUA,EAEVM,IAAMA,GAAOG,EAXfV,SAAA,CAaGQ,GAAQwB,EAAA,OAAA,CAAMC,UAAU,OAAhBjC,SAAwBQ,IAChCR,GAAYgC,EAACE,EAAD,CAAAlC,SAAiBA,QA/DpCF,EAAOqC,aAAe,CACpBf,KAAM,IACNgB,WACAC,QAAS,eACTjC,GAAI,SACJK,KAAM,UAGRX,EAAOwC,YAAc"}
1
+ {"version":3,"file":"Button.js","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import { Link } from 'react-router-dom'\nimport { Display } from '../../mixins/display'\nimport { ResponsiveProperty } from '../../mixins/responsive-property'\nimport { BaseProps, Tooltiped } from '../../shared/interfaces'\nimport { Color } from '../../mixins/color'\nimport { Anchor } from '../../components/Anchor'\nimport * as Styled from './style'\nimport { PRESETS, PROPS_BY_SIZE } from './default'\n\nexport interface ButtonProps\n extends BaseProps,\n Tooltiped,\n Display,\n Color,\n Color<'fontColor'>,\n ResponsiveProperty<'padding'>,\n ResponsiveProperty<'paddingTop'>,\n ResponsiveProperty<'paddingRight'>,\n ResponsiveProperty<'paddingBottom'>,\n ResponsiveProperty<'paddingLeft'>,\n ResponsiveProperty<'margin'>,\n ResponsiveProperty<'marginTop'>,\n ResponsiveProperty<'marginRight'>,\n ResponsiveProperty<'marginBottom'>,\n ResponsiveProperty<'marginLeft'>,\n ResponsiveProperty<'fontSize'>,\n ResponsiveProperty<'fluid', boolean>,\n ResponsiveProperty<'width', 'auto' | 'l' | 'm' | 's' | 'xs' | number>,\n ResponsiveProperty<'height', 'l' | 'm' | 's' | 'xs' | number> {\n /**\n * Node type\n */\n as?: 'div' | 'span' | 'a' | 'button' | typeof Link | typeof Anchor\n target?: string\n rel?: string\n /**\n * Link href\n */\n href?: string\n /**\n * React router link to\n */\n to?: string\n /**\n * Type for button element\n */\n type?: 'button' | 'submit' | 'reset'\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Basic button\n */\n basic?: boolean\n /**\n * Disabled\n */\n disabled?: boolean\n /**\n * Is primary\n */\n primary?: boolean\n /**\n * Is secondary\n */\n secondary?: boolean\n /**\n * Is inverted\n */\n inverted?: boolean\n /**\n * Is rounded\n */\n rounded?: boolean\n /**\n * Is round (in a shape of circle)\n */\n round?: boolean\n /**\n * Indicates if there should not be any margin\n * between this button and the previous one\n */\n noSpacing?: boolean\n /**\n * Is in loading state\n */\n loading?: boolean\n /**\n * Button icon\n */\n icon?: React.ReactNode\n /** On click callback */\n onClick?: () => void\n /** Function to make ref */\n ref?: React.LegacyRef<HTMLDivElement>\n /**\n * Size\n */\n size?: 'l' | 'm' | 's' | 'xs'\n}\n\nButton.defaultProps = {\n size: 'm',\n rounded: true,\n display: 'inline-block',\n as: 'button',\n type: 'button',\n}\n\nButton.displayName = 'Button'\n\nconst extractPresetByProps = (props: ButtonProps): Partial<ButtonProps> => {\n if (props.primary) return PRESETS.primary\n if (props.secondary) return PRESETS.secondary\n return PRESETS.default\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Display`](#/Миксины)\n * - [`Tooltiped`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`Color<'fontColor'>`](#/Миксины)\n * - [`ResponsiveProperty<'padding'>`](#/Миксины)\n * - [`ResponsiveProperty<'paddingTop'>`](#/Миксины)\n * - [`ResponsiveProperty<'paddingRight'>`](#/Миксины)\n * - [`ResponsiveProperty<'paddingBottom'>`](#/Миксины)\n * - [`ResponsiveProperty<'paddingLeft'>`](#/Миксины)\n * - [`ResponsiveProperty<'margin'>`](#/Миксины)\n * - [`ResponsiveProperty<'marginTop'>`](#/Миксины)\n * - [`ResponsiveProperty<'marginRight'>`](#/Миксины)\n * - [`ResponsiveProperty<'marginBottom'>`](#/Миксины)\n * - [`ResponsiveProperty<'marginLeft'>`](#/Миксины)\n * - [`ResponsiveProperty<'fontSize'>`](#/Миксины)\n * - [`ResponsiveProperty<'fluid', boolean>`](#/Миксины)\n * - [`ResponsiveProperty<'width', 'auto' | 'l' | 'm' | 's' | 'xs' | number>`](#/Миксины)\n * - [`ResponsiveProperty<'height', 'l' | 'm' | 's' | 'xs' | number>`](#/Миксины)\n */\nexport function Button(props: ButtonProps) {\n const { children, disabled, href, to, as, target, onClick, ref, icon, type, innerRef, ...restProps } = props\n\n const _as = as || (disabled ? 'button' : href ? 'a' : to ? Link : 'button')\n const aProps = _as === 'a' && !disabled ? { href: href || to, target } : {}\n const linkProps = typeof _as !== 'string' && !disabled ? { to: to || href } : {}\n const propsBySize: Partial<ButtonProps> =\n restProps.size && !restProps.round ? PROPS_BY_SIZE[restProps.size] || {} : {}\n const presetProps: Partial<ButtonProps> = extractPresetByProps(props)\n\n return (\n <Styled.Root\n as={_as}\n type={_as === 'button' ? type : undefined}\n onClick={disabled || restProps.loading ? undefined : onClick}\n {...propsBySize}\n {...aProps}\n {...linkProps}\n {...presetProps}\n {...restProps}\n disabled={disabled}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={(ref || innerRef) as any}\n >\n {icon && <span className='icon'>{icon}</span>}\n {children && <Styled.Content>{children}</Styled.Content>}\n </Styled.Root>\n )\n}\n"],"names":["Button","props","children","disabled","href","to","as","target","onClick","ref","icon","type","innerRef","restProps","_excluded","_as","Link","aProps","linkProps","propsBySize","size","round","PROPS_BY_SIZE","presetProps","primary","PRESETS","secondary","default","_jsxs","Styled.Root","_objectSpread","loading","_jsx","className","Styled.Content","defaultProps","rounded","display","displayName"],"mappings":"8ZA4IO,SAASA,EAAOC,GACrB,IAAMC,SAAEA,EAAFC,SAAYA,EAAZC,KAAsBA,EAAtBC,GAA4BA,EAA5BC,GAAgCA,EAAhCC,OAAoCA,EAApCC,QAA4CA,EAA5CC,IAAqDA,EAArDC,KAA0DA,EAA1DC,KAAgEA,EAAhEC,SAAsEA,GAA2BX,EAAdY,IAAcZ,EAAvGa,GAEA,IAAMC,EAAMT,IAAOH,EAAW,SAAWC,EAAO,IAAMC,EAAKW,EAAO,UAClE,IAAMC,EAAiB,MAARF,GAAgBZ,EAA0C,GAA/B,CAAEC,KAAMA,GAAQC,EAAIE,OAAAA,GAC9D,IAAMW,EAA2B,iBAARH,GAAqBZ,EAAgC,GAArB,CAAEE,GAAIA,GAAMD,GACrE,IAAMe,EACJN,EAAUO,OAASP,EAAUQ,OAAQC,EAAcT,EAAUO,OAAc,GAC7E,IAAMG,EApCsBtB,CAAAA,GACxBA,EAAMuB,QAAgBC,EAAQD,QAC9BvB,EAAMyB,UAAkBD,EAAQC,UAC7BD,EAAQE,QAHa1B,CAoCmCA,GAE/D,OACE2B,EAACC,EAADC,EAAAA,EAAAA,EAAAA,EAAAA,EAAAA,EAAA,CACExB,GAAIS,EACJJ,KAAc,WAARI,EAAmBJ,SACzBH,QAASL,GAAYU,EAAUkB,aAAAA,EAAsBvB,GACjDW,GACAF,GACAC,GACAK,GACAV,GARN,GAAA,CASEV,SAAUA,EAEVM,IAAMA,GAAOG,EAXfV,SAAA,CAaGQ,GAAQsB,EAAA,OAAA,CAAMC,UAAU,OAAhB/B,SAAwBQ,IAChCR,GAAY8B,EAACE,EAAD,CAAAhC,SAAiBA,QA/DpCF,EAAOmC,aAAe,CACpBf,KAAM,IACNgB,WACAC,QAAS,eACT/B,GAAI,SACJK,KAAM,UAGRX,EAAOsC,YAAc"}
@@ -1,2 +1,2 @@
1
- import e from'@babel/runtime/helpers/esm/objectSpread2';import{InputPhone as o}from'../Input.Phone/Input.Phone.js';import{Root as t}from'./style.js';import{jsx as r}from'react/jsx-runtime';function n(o){return r(t,e({},o))}n.defaultProps={rounded:!0,type:'text',width:'l',color:'mineShaft',placeholderColor:'silver'},n.Phone=o,n.displayName='Input';export{n as Input};
1
+ import e from'@babel/runtime/helpers/esm/objectSpread2';import{InputPhone as o}from'../Input.Phone/Input.Phone.js';import{Root as t}from'./style.js';import{jsx as r}from'react/jsx-runtime';function n(o){return r(t,e({},o))}n.defaultProps={rounded:!0,type:'text',width:'l',color:'mineShaft',mask:'',placeholderColor:'silver'},n.Phone=o,n.displayName='Input';export{n as Input};
2
2
  //# sourceMappingURL=Input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","sources":["../../../../src/components/Input/Input.tsx"],"sourcesContent":["import { InputState, MaskOptions } from 'react-input-mask'\nimport { InputPhone } from '../../components/Input.Phone'\nimport { BaseProps, InputField } from '../../shared/interfaces'\nimport * as Styled from './style'\n\ntype InputHTMLAttributes = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'color' | 'width'>\n\nexport interface InputProps extends BaseProps, InputField, InputHTMLAttributes {\n /**\n * Mask string. Format characters are:\n * * `9`: `0-9`\n * * `a`: `A-Z, a-z`\n * * `\\*`: `A-Z, a-z, 0-9`\n *\n * Any character can be escaped with backslash, which usually will appear as double backslash in JS strings.\n * For example, German phone mask with unremoveable prefix +49 will look like `mask=\"+4\\\\9 99 999 99\"` or `mask={\"+4\\\\\\\\9 99 999 99\"}`\n */\n mask: string | Array<string | RegExp>\n /**\n * Character to cover unfilled editable parts of mask. Default character is \"_\". If set to null, unfilled parts will be empty, like in ordinary input.\n */\n maskChar?: string | null\n /**\n * Defines format characters with characters as keys and corresponding RegExp string as values. Default ones:\n * ```\n * {\n * \"9\": \"[0-9]\",\n * \"a\": \"[A-Za-z]\",\n * \"*\": \"[A-Za-z0-9]\"\n * }```\n */\n formatChars?: { [key: string]: string }\n /**\n * Show mask even in empty input without focus.\n */\n alwaysShowMask?: boolean\n /**\n * Use inputRef instead of ref if you need input node to manage focus, selection, etc.\n */\n inputRef?: React.Ref<HTMLInputElement>\n\n /**\n * In case you need to implement more complex masking behavior, you can provide\n * beforeMaskedValueChange function to change masked value and cursor position\n * before it will be applied to the input.\n */\n beforeMaskedValueChange?(\n _newState: InputState,\n _oldState: InputState,\n _userInput: string,\n _maskOptions: MaskOptions\n ): InputState\n /**\n * Input type\n */\n type?: string\n dataset?: Record<string, string>\n}\n\nInput.defaultProps = {\n rounded: true,\n type: 'text',\n width: 'l',\n color: 'mineShaft',\n placeholderColor: 'silver',\n}\n\nInput.Phone = InputPhone\nInput.displayName = 'Input'\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`InputField`](#/Миксины)\n * - `React.InputHTMLAttributes<HTMLInputElement>`\n */\nexport function Input(props: InputProps) {\n return <Styled.Root {...props} />\n}\n"],"names":["Input","props","_jsx","Styled.Root","_objectSpread","defaultProps","rounded","type","width","color","placeholderColor","Phone","InputPhone","displayName"],"mappings":"6LA2EO,SAASA,EAAMC,GACpB,OAAOC,EAACC,EAADC,EAAA,GAAiBH,IAjB1BD,EAAMK,aAAe,CACnBC,SAAS,EACTC,KAAM,OACNC,MAAO,IACPC,MAAO,YACPC,iBAAkB,UAGpBV,EAAMW,MAAQC,EACdZ,EAAMa,YAAc"}
1
+ {"version":3,"file":"Input.js","sources":["../../../../src/components/Input/Input.tsx"],"sourcesContent":["import { InputState, MaskOptions } from 'react-input-mask'\nimport { InputPhone } from '../../components/Input.Phone'\nimport { BaseProps, InputField } from '../../shared/interfaces'\nimport * as Styled from './style'\n\ntype InputHTMLAttributes = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'color' | 'width'>\n\nexport interface InputProps extends BaseProps, InputField, InputHTMLAttributes {\n /**\n * Mask string. Format characters are:\n * * `9`: `0-9`\n * * `a`: `A-Z, a-z`\n * * `\\*`: `A-Z, a-z, 0-9`\n *\n * Any character can be escaped with backslash, which usually will appear as double backslash in JS strings.\n * For example, German phone mask with unremoveable prefix +49 will look like `mask=\"+4\\\\9 99 999 99\"` or `mask={\"+4\\\\\\\\9 99 999 99\"}`\n */\n mask?: string | Array<string | RegExp>\n /**\n * Character to cover unfilled editable parts of mask. Default character is \"_\". If set to null, unfilled parts will be empty, like in ordinary input.\n */\n maskChar?: string | null\n /**\n * Defines format characters with characters as keys and corresponding RegExp string as values. Default ones:\n * ```\n * {\n * \"9\": \"[0-9]\",\n * \"a\": \"[A-Za-z]\",\n * \"*\": \"[A-Za-z0-9]\"\n * }```\n */\n formatChars?: { [key: string]: string }\n /**\n * Show mask even in empty input without focus.\n */\n alwaysShowMask?: boolean\n /**\n * Use inputRef instead of ref if you need input node to manage focus, selection, etc.\n */\n inputRef?: React.Ref<HTMLInputElement>\n\n /**\n * In case you need to implement more complex masking behavior, you can provide\n * beforeMaskedValueChange function to change masked value and cursor position\n * before it will be applied to the input.\n */\n beforeMaskedValueChange?(\n _newState: InputState,\n _oldState: InputState,\n _userInput: string,\n _maskOptions: MaskOptions\n ): InputState\n /**\n * Input type\n */\n type?: string\n dataset?: Record<string, string>\n}\n\nInput.defaultProps = {\n rounded: true,\n type: 'text',\n width: 'l',\n color: 'mineShaft',\n mask: '',\n placeholderColor: 'silver',\n}\n\nInput.Phone = InputPhone\nInput.displayName = 'Input'\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`InputField`](#/Миксины)\n * - `React.InputHTMLAttributes<HTMLInputElement>`\n */\nexport function Input(props: InputProps & typeof Input.defaultProps) {\n return <Styled.Root {...props} />\n}\n"],"names":["Input","props","_jsx","Styled.Root","_objectSpread","defaultProps","rounded","type","width","color","mask","placeholderColor","Phone","InputPhone","displayName"],"mappings":"6LA4EO,SAASA,EAAMC,GACpB,OAAOC,EAACC,EAADC,EAAA,GAAiBH,IAlB1BD,EAAMK,aAAe,CACnBC,SAAAA,EACAC,KAAM,OACNC,MAAO,IACPC,MAAO,YACPC,KAAM,GACNC,iBAAkB,UAGpBX,EAAMY,MAAQC,EACdb,EAAMc,YAAc"}
@@ -1,2 +1,2 @@
1
- import t from'@babel/runtime/helpers/esm/objectSpread2';import e from'@babel/runtime/helpers/esm/objectWithoutProperties';import{PureComponent as a}from'react';import{Input as r}from'../Input/Input.js';import{COUNTRY_DATA as s,DEFAULT_MASK as o,INITIAL_MASK as n,REGEXPS as i,RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH as u}from'./constants.js';import{jsx as l}from'react/jsx-runtime';var p=["countryData","defaultMask","initialMask","stripValue"];var h=function(t){var e=arguments.length>0&&void 0!==t?t:'';return e.replace(i.NOT_NUMBERS,'')};class c extends a{constructor(t){var e;super(t),e=this,this.autocorrectOf8=void 0,this.autocorrectOf9=void 0,this.getUpdates=function(t,a){var r=arguments.length>1&&void 0!==a?a:void 0;var{countryData:o,defaultMask:n,initialMask:l}=e.props;var p=h(t);var c=l;var v=null;var m=!1;var d=!1;if(!p)return{mask:c,numbers:p,startsFrom8:m,startsFrom9:d,regexp:v};var g=!1;for(var f=0;f<o.length;f++)p.startsWith(o[f][1])&&([,,c,v]=o[f],g=0===f||1===f);return m=g&&i.FROM_8.test(p)&&e.autocorrectOf8,d=(!c||p.length===u&&''===r)&&e.autocorrectOf9&&i.FROM_9.test(p),m&&(c=s[0][2],e.autocorrectOf8=!1),d&&(c=s[0][2],e.autocorrectOf9=!1),c||(c=n),{mask:c,numbers:p,startsFrom8:m,startsFrom9:d,regexp:v}},this.change=t=>{var{mask:e}=this.getUpdates(t);this.setState({mask:e})},this.handleChange=t=>{t.persist();var{onChange:e,stripValue:a}=this.props;if(e){var r=t;a&&(r.target.value=h(t.target.value)),e(r)}},this.beforeMaskedValueChange=(t,e)=>{var{mask:a,numbers:r,startsFrom8:s,startsFrom9:o,regexp:n}=this.getUpdates(t.value,e.value);return this.setState({mask:a,regexp:n}),o?{selection:1===r.length?{start:5,end:5}:t.selection,value:t.value.replace(i.FROM_9,'+79$1')}:s?{selection:{start:2,end:2},value:t.value.replace(i.FROM_8,'+7$1')}:i.FILLED.test(e.value)&&1===r.length?{selection:{start:2,end:2},value:t.value}:t},this.autocorrectOf8=!0,this.autocorrectOf9=!0;var{mask:a}=this.getUpdates(t.value||'');this.state={mask:a,regexp:null}}componentDidUpdate(t){var{value:e}=this.props;e!==t.value&&this.change(e)}render(){var a=e(this.props,p);var{mask:s,regexp:o}=this.state;return l(r,t(t({},a),{},{beforeMaskedValueChange:this.beforeMaskedValueChange,mask:s,dataset:{'data-regexp':"".concat(o||'')},onChange:this.handleChange}))}}c.displayName='Input.Phone',c.defaultProps={countryData:s,defaultMask:o,initialMask:n,placeholder:'+9 (999) 999-99-99'};export{c as InputPhone};
1
+ import t from'@babel/runtime/helpers/esm/objectSpread2';import e from'@babel/runtime/helpers/esm/objectWithoutProperties';import{PureComponent as a}from'react';import{Input as r}from'../Input/Input.js';import{COUNTRY_DATA as s,DEFAULT_MASK as o,INITIAL_MASK as n,REGEXPS as i,RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH as u}from'./constants.js';import{jsx as l}from'react/jsx-runtime';var p=["countryData","defaultMask","initialMask","stripValue"];var h=function(t){var e=arguments.length>0&&void 0!==t?t:'';return e.replace(i.NOT_NUMBERS,'')};class c extends a{constructor(t){var e;super(t),e=this,this.autocorrectOf8=void 0,this.autocorrectOf9=void 0,this.getUpdates=function(t,a){var r=arguments.length>1&&void 0!==a?a:void 0;var{countryData:o,defaultMask:n,initialMask:l}=e.props;var p=h(t);var c=l;var v=null;var m=!1;var d=!1;if(!p)return{mask:c,numbers:p,startsFrom8:m,startsFrom9:d,regexp:v};var g=!1;for(var f=0;f<o.length;f++)p.startsWith(o[f][1])&&([,,c,v]=o[f],g=0===f||1===f);return m=g&&i.FROM_8.test(p)&&e.autocorrectOf8,d=(!c||p.length===u&&''===r)&&e.autocorrectOf9&&i.FROM_9.test(p),m&&(c=s[0][2],e.autocorrectOf8=!1),d&&(c=s[0][2],e.autocorrectOf9=!1),c||(c=n),{mask:c,numbers:p,startsFrom8:m,startsFrom9:d,regexp:v}},this.change=t=>{var{mask:e}=this.getUpdates(t);this.setState({mask:e})},this.handleChange=t=>{t.persist();var{onChange:e,stripValue:a}=this.props;if(e){var r=t;a&&(r.target.value=h(t.target.value)),e(r)}},this.beforeMaskedValueChange=(t,e)=>{var{mask:a,numbers:r,startsFrom8:s,startsFrom9:o,regexp:n}=this.getUpdates(t.value,e.value);return this.setState({mask:a,regexp:n}),o?{selection:1===r.length?{start:5,end:5}:t.selection,value:t.value.replace(i.FROM_9,'+79$1')}:s?{selection:{start:2,end:2},value:t.value.replace(i.FROM_8,'+7$1')}:i.FILLED.test(e.value)&&1===r.length?{selection:{start:2,end:2},value:t.value}:t},this.autocorrectOf8=!0,this.autocorrectOf9=!0;var{mask:a}=this.getUpdates(t.value||'');this.state={mask:a,regexp:null}}componentDidUpdate(t){var{value:e}=this.props;e!==t.value&&this.change(e)}render(){var a=e(this.props,p);var{mask:s,regexp:o}=this.state;return l(r,t(t({},a),{},{beforeMaskedValueChange:this.beforeMaskedValueChange,mask:s,dataset:{'data-regexp':"".concat(o||'')},onChange:this.handleChange}))}}c.displayName='Input.Phone',c.defaultProps=t({countryData:s,defaultMask:o,initialMask:n,placeholder:'+9 (999) 999-99-99'},r.defaultProps);export{c as InputPhone};
2
2
  //# sourceMappingURL=Input.Phone.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.Phone.js","sources":["../../../../src/components/Input.Phone/Input.Phone.tsx"],"sourcesContent":["/* eslint-disable no-use-before-define */\nimport { PureComponent } from 'react'\nimport { InputState } from 'react-input-mask'\nimport { Input, InputProps } from '../Input/Input'\nimport {\n COUNTRY_DATA,\n DEFAULT_MASK,\n INITIAL_MASK,\n REGEXPS,\n RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH,\n} from './constants'\n\nconst onlyNumbers = (value = ''): string => value.replace(REGEXPS.NOT_NUMBERS, '')\n\nexport interface InputPhoneProps extends InputProps {\n /**\n * Settings for different country codes\n */\n countryData?: string[][]\n /**\n * Default field mask that is set when none of the countryData prop matches\n */\n defaultMask?: string\n /**\n * The default field mask when the phone field is empty is required to enable autocomplete in\n * the browser\n */\n initialMask?: string\n /** If event should return stripped phone value (not for redux forms) */\n stripValue?: boolean\n}\n\ninterface InputPhoneState {\n mask: string\n regexp?: RegExp | null\n}\n\n/**\n * Расширен:\n * - `InputProps`\n */\nexport class InputPhone extends PureComponent<typeof InputPhone.defaultProps & InputPhoneProps, InputPhoneState> {\n static displayName = 'Input.Phone'\n static defaultProps = {\n countryData: COUNTRY_DATA,\n defaultMask: DEFAULT_MASK,\n initialMask: INITIAL_MASK,\n placeholder: '+9 (999) 999-99-99',\n }\n\n autocorrectOf8: boolean\n autocorrectOf9: boolean\n\n constructor(props: typeof InputPhone.defaultProps & InputPhoneProps) {\n super(props)\n\n this.autocorrectOf8 = true\n this.autocorrectOf9 = true\n\n const { mask } = this.getUpdates(props.value || '')\n\n this.state = { mask, regexp: null }\n }\n\n componentDidUpdate(nextProps: InputPhoneProps) {\n const { value } = this.props\n\n if (value !== nextProps.value) {\n this.change(value)\n }\n }\n\n getUpdates = (\n value: InputPhoneProps['value'],\n prevValue: InputPhoneProps['value'] = undefined\n ): {\n mask: string\n numbers: string\n startsFrom8: boolean\n startsFrom9: boolean\n regexp: RegExp | null\n } => {\n const { countryData, defaultMask, initialMask } = this.props\n const numbers = onlyNumbers(value as string)\n\n let mask = initialMask\n let regexp = null\n let startsFrom8 = false\n let startsFrom9 = false\n\n if (!numbers)\n return {\n mask,\n numbers,\n startsFrom8,\n startsFrom9,\n regexp,\n }\n\n let isRussian = false\n\n for (let i = 0; i < countryData.length; i++) {\n if (numbers.startsWith(countryData[i][1])) {\n ;[, , mask, regexp] = countryData[i]\n isRussian = i === 0 || i === 1\n }\n }\n\n startsFrom8 = isRussian && REGEXPS.FROM_8.test(numbers) && this.autocorrectOf8\n startsFrom9 =\n (!mask || (numbers.length === RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH && prevValue === '')) &&\n this.autocorrectOf9 &&\n REGEXPS.FROM_9.test(numbers)\n\n if (startsFrom8) {\n // RUSSIAN_MASK\n mask = COUNTRY_DATA[0][2]\n\n this.autocorrectOf8 = false\n }\n\n if (startsFrom9) {\n // RUSSIAN_MASK\n mask = COUNTRY_DATA[0][2]\n\n this.autocorrectOf9 = false\n }\n\n if (!mask) {\n mask = defaultMask\n }\n\n return {\n mask,\n numbers,\n startsFrom8,\n startsFrom9,\n regexp,\n }\n }\n\n change = (phone: InputPhoneProps['value']) => {\n const { mask } = this.getUpdates(phone)\n\n this.setState({ mask })\n }\n\n handleChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {\n e.persist()\n\n const { onChange, stripValue } = this.props\n\n if (onChange) {\n const _e = e\n if (stripValue) _e.target.value = onlyNumbers(e.target.value)\n onChange(_e)\n }\n }\n\n beforeMaskedValueChange = (newState: InputState, oldState: InputState) => {\n const { mask, numbers, startsFrom8, startsFrom9, regexp } = this.getUpdates(newState.value, oldState.value)\n\n this.setState({ mask, regexp })\n\n /**\n * For the correct caret position, when the user enters 9 in the phone field and it's replaced\n * by '+7 (9'\n */\n if (startsFrom9) {\n return {\n selection: numbers.length === 1 ? { start: 5, end: 5 } : newState.selection,\n value: newState.value.replace(REGEXPS.FROM_9, '+79$1'),\n }\n }\n\n if (startsFrom8) {\n return { selection: { start: 2, end: 2 }, value: newState.value.replace(REGEXPS.FROM_8, '+7$1') }\n }\n\n if (REGEXPS.FILLED.test(oldState.value) && numbers.length === 1) {\n return { selection: { start: 2, end: 2 }, value: newState.value }\n }\n\n return newState\n }\n\n render() {\n const {\n /* eslint-disable no-unused-vars, @typescript-eslint/no-unused-vars */\n countryData,\n defaultMask,\n initialMask,\n stripValue,\n /* eslint-enable no-unused-vars, @typescript-eslint/no-unused-vars */\n ...props\n } = this.props\n const { mask, regexp } = this.state\n\n return (\n <Input\n {...props}\n beforeMaskedValueChange={this.beforeMaskedValueChange}\n mask={mask}\n dataset={{ 'data-regexp': `${regexp || ''}` }}\n onChange={this.handleChange}\n />\n )\n }\n}\n"],"names":["onlyNumbers","t","value","replace","REGEXPS","NOT_NUMBERS","InputPhone","PureComponent","constructor","props","_this","super","this","autocorrectOf8","autocorrectOf9","getUpdates","a","prevValue","countryData","defaultMask","initialMask","numbers","mask","regexp","startsFrom8","startsFrom9","isRussian","i","length","startsWith","FROM_8","test","RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH","FROM_9","COUNTRY_DATA","change","phone","setState","handleChange","e","persist","onChange","stripValue","_e","target","beforeMaskedValueChange","newState","oldState","selection","start","end","FILLED","state","componentDidUpdate","nextProps","render","_objectWithoutProperties","_excluded","_jsx","Input","_objectSpread","dataset","displayName","defaultProps","DEFAULT_MASK","INITIAL_MASK","placeholder"],"mappings":"8bAYA,IAAMA,EAAc,SAAAC,GAAA,IAACC,+BAADD,EAAAA,EAAS,GAAT,OAAwBC,EAAMC,QAAQC,EAAQC,YAAa,KA6BxE,MAAMC,UAAmBC,EAY9BC,YAAYC,GAAyD,IAAAC,EACnEC,MAAMF,GAD6DC,EAAAE,KAAAA,KAHrEC,oBAAAA,EAGqED,KAFrEE,oBAAAA,EAEqEF,KAmBrEG,WAAa,SACXb,EADWc,GASR,IAPHC,+BA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Input.Phone.js","sources":["../../../../src/components/Input.Phone/Input.Phone.tsx"],"sourcesContent":["/* eslint-disable no-use-before-define */\nimport { PureComponent } from 'react'\nimport { InputState } from 'react-input-mask'\nimport { Input, InputProps } from '../Input/Input'\nimport {\n COUNTRY_DATA,\n DEFAULT_MASK,\n INITIAL_MASK,\n REGEXPS,\n RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH,\n} from './constants'\n\nconst onlyNumbers = (value = ''): string => value.replace(REGEXPS.NOT_NUMBERS, '')\n\nexport interface InputPhoneProps extends InputProps {\n /**\n * Settings for different country codes\n */\n countryData?: string[][]\n /**\n * Default field mask that is set when none of the countryData prop matches\n */\n defaultMask?: string\n /**\n * The default field mask when the phone field is empty is required to enable autocomplete in\n * the browser\n */\n initialMask?: string\n /** If event should return stripped phone value (not for redux forms) */\n stripValue?: boolean\n}\n\ninterface InputPhoneState {\n mask: string\n regexp?: RegExp | null\n}\n\n/**\n * Расширен:\n * - `InputProps`\n */\nexport class InputPhone extends PureComponent<typeof InputPhone.defaultProps & InputPhoneProps, InputPhoneState> {\n static displayName = 'Input.Phone'\n static defaultProps = {\n countryData: COUNTRY_DATA,\n defaultMask: DEFAULT_MASK,\n initialMask: INITIAL_MASK,\n placeholder: '+9 (999) 999-99-99',\n ...Input.defaultProps,\n }\n\n autocorrectOf8: boolean\n autocorrectOf9: boolean\n\n constructor(props: typeof InputPhone.defaultProps & InputPhoneProps) {\n super(props)\n\n this.autocorrectOf8 = true\n this.autocorrectOf9 = true\n\n const { mask } = this.getUpdates(props.value || '')\n\n this.state = { mask, regexp: null }\n }\n\n componentDidUpdate(nextProps: InputPhoneProps) {\n const { value } = this.props\n\n if (value !== nextProps.value) {\n this.change(value)\n }\n }\n\n getUpdates = (\n value: InputPhoneProps['value'],\n prevValue: InputPhoneProps['value'] = undefined\n ): {\n mask: string\n numbers: string\n startsFrom8: boolean\n startsFrom9: boolean\n regexp: RegExp | null\n } => {\n const { countryData, defaultMask, initialMask } = this.props\n const numbers = onlyNumbers(value as string)\n\n let mask = initialMask\n let regexp = null\n let startsFrom8 = false\n let startsFrom9 = false\n\n if (!numbers)\n return {\n mask,\n numbers,\n startsFrom8,\n startsFrom9,\n regexp,\n }\n\n let isRussian = false\n\n for (let i = 0; i < countryData.length; i++) {\n if (numbers.startsWith(countryData[i][1])) {\n ;[, , mask, regexp] = countryData[i]\n isRussian = i === 0 || i === 1\n }\n }\n\n startsFrom8 = isRussian && REGEXPS.FROM_8.test(numbers) && this.autocorrectOf8\n startsFrom9 =\n (!mask || (numbers.length === RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH && prevValue === '')) &&\n this.autocorrectOf9 &&\n REGEXPS.FROM_9.test(numbers)\n\n if (startsFrom8) {\n // RUSSIAN_MASK\n mask = COUNTRY_DATA[0][2]\n\n this.autocorrectOf8 = false\n }\n\n if (startsFrom9) {\n // RUSSIAN_MASK\n mask = COUNTRY_DATA[0][2]\n\n this.autocorrectOf9 = false\n }\n\n if (!mask) {\n mask = defaultMask\n }\n\n return {\n mask,\n numbers,\n startsFrom8,\n startsFrom9,\n regexp,\n }\n }\n\n change = (phone: InputPhoneProps['value']) => {\n const { mask } = this.getUpdates(phone)\n\n this.setState({ mask })\n }\n\n handleChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {\n e.persist()\n\n const { onChange, stripValue } = this.props\n\n if (onChange) {\n const _e = e\n if (stripValue) _e.target.value = onlyNumbers(e.target.value)\n onChange(_e)\n }\n }\n\n beforeMaskedValueChange = (newState: InputState, oldState: InputState) => {\n const { mask, numbers, startsFrom8, startsFrom9, regexp } = this.getUpdates(newState.value, oldState.value)\n\n this.setState({ mask, regexp })\n\n /**\n * For the correct caret position, when the user enters 9 in the phone field and it's replaced\n * by '+7 (9'\n */\n if (startsFrom9) {\n return {\n selection: numbers.length === 1 ? { start: 5, end: 5 } : newState.selection,\n value: newState.value.replace(REGEXPS.FROM_9, '+79$1'),\n }\n }\n\n if (startsFrom8) {\n return { selection: { start: 2, end: 2 }, value: newState.value.replace(REGEXPS.FROM_8, '+7$1') }\n }\n\n if (REGEXPS.FILLED.test(oldState.value) && numbers.length === 1) {\n return { selection: { start: 2, end: 2 }, value: newState.value }\n }\n\n return newState\n }\n\n render() {\n const {\n /* eslint-disable no-unused-vars, @typescript-eslint/no-unused-vars */\n countryData,\n defaultMask,\n initialMask,\n stripValue,\n /* eslint-enable no-unused-vars, @typescript-eslint/no-unused-vars */\n ...props\n } = this.props\n const { mask, regexp } = this.state\n\n return (\n <Input\n {...props}\n beforeMaskedValueChange={this.beforeMaskedValueChange}\n mask={mask}\n dataset={{ 'data-regexp': `${regexp || ''}` }}\n onChange={this.handleChange}\n />\n )\n }\n}\n"],"names":["onlyNumbers","t","value","replace","REGEXPS","NOT_NUMBERS","InputPhone","PureComponent","constructor","props","_this","super","this","autocorrectOf8","autocorrectOf9","getUpdates","a","prevValue","undefined","countryData","defaultMask","initialMask","numbers","mask","regexp","startsFrom8","startsFrom9","isRussian","i","length","startsWith","FROM_8","test","RUSSIAN_PHONE_WITHOUT_COUNTY_CODE_LENGTH","FROM_9","COUNTRY_DATA","change","phone","setState","handleChange","e","persist","onChange","stripValue","_e","target","beforeMaskedValueChange","newState","oldState","selection","start","end","FILLED","state","componentDidUpdate","nextProps","render","_objectWithoutProperties","_excluded","_jsx","Input","_objectSpread","dataset","displayName","defaultProps","DEFAULT_MASK","INITIAL_MASK","placeholder"],"mappings":"8bAYA,IAAMA,EAAc,SAAAC,GAAA,IAACC,+BAADD,EAAAA,EAAS,GAAT,OAAwBC,EAAMC,QAAQC,EAAQC,YAAa,KA6BxE,MAAMC,UAAmBC,EAa9BC,YAAYC,GAAyD,IAAAC,EACnEC,MAAMF,GAD6DC,EAAAE,KAAAA,KAHrEC,oBAGqE,EAAAD,KAFrEE,oBAEqE,EAAAF,KAmBrEG,WAAa,SACXb,EADWc,GASR,IAPHC,+BAFWD,EAAAA,OAE2BE,EAQtC,IAAMC,YAAEA,EAAFC,YAAeA,EA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/Paper.tsx"],"sourcesContent":["import { BaseProps } from '../../shared/interfaces'\nimport { Display } from '../../mixins/display'\nimport { ResponsiveProperty } from '../../mixins/responsive-property'\nimport { Color } from '../../mixins/color'\nimport * as Styled from './style'\n\nexport interface PaperProps extends BaseProps, Display, Color, ResponsiveProperty<'padding'> {\n /**\n * Paper content\n */\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Set to true to generate a circlular paper container\n */\n circle?: boolean\n /**\n * Paper with rounded corners\n */\n rounded?: boolean\n /**\n * Paper with shadow\n */\n shadow?: boolean\n /**\n * This number represents the zDepth of the paper shadow\n */\n zDepth?: 0 | 1 | 2 | 3 | 4\n /**\n * Text align\n */\n textAlign?: 'left' | 'center' | 'right'\n}\n\nPaper.displayName = 'Paper'\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Display`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`ResponsiveProperty<'padding'>`](#/Миксины)\n */\nexport function Paper({ padding = 'm', rounded = true, shadow = true, ...props }: PaperProps) {\n return <Styled.Root padding={padding} rounded={rounded} shadow={shadow} {...props} />\n}\n"],"names":["Paper","_ref","padding","rounded","shadow","props","_objectWithoutProperties","_excluded","_jsx","Styled.Root","_objectSpread","displayName"],"mappings":"yOA6CO,SAASA,EAA8EC,GAAA,IAAxEC,QAAEA,EAAU,IAAZC,QAAiBA,GAAAA,EAAjBC,OAAiCA,GAAAA,GAAuCH,EAArBI,EAAqBC,EAAAL,EAAAM,GAC5F,OAAOC,EAACC,EAADC,EAAA,CAAaR,QAASA,EAASC,QAASA,EAASC,OAAQA,GAAYC,IAV9EL,EAAMW,YAAc"}
1
+ {"version":3,"file":"Paper.js","sources":["../../../../src/components/Paper/Paper.tsx"],"sourcesContent":["import { BaseProps } from '../../shared/interfaces'\nimport { Display } from '../../mixins/display'\nimport { ResponsiveProperty } from '../../mixins/responsive-property'\nimport { Color } from '../../mixins/color'\nimport * as Styled from './style'\n\nexport interface PaperProps extends BaseProps, Display, Color, ResponsiveProperty<'padding'> {\n /**\n * Paper content\n */\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Set to true to generate a circlular paper container\n */\n circle?: boolean\n /**\n * Paper with rounded corners\n */\n rounded?: boolean\n /**\n * Paper with shadow\n */\n shadow?: boolean\n /**\n * This number represents the zDepth of the paper shadow\n */\n zDepth?: false | 0 | 1 | 2 | 3 | 4\n /**\n * Text align\n */\n textAlign?: 'left' | 'center' | 'right'\n}\n\nPaper.displayName = 'Paper'\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Display`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`ResponsiveProperty<'padding'>`](#/Миксины)\n */\nexport function Paper({ padding = 'm', rounded = true, shadow = true, ...props }: PaperProps) {\n return <Styled.Root padding={padding} rounded={rounded} shadow={shadow} {...props} />\n}\n"],"names":["Paper","_ref","padding","rounded","shadow","props","_objectWithoutProperties","_excluded","_jsx","Styled.Root","_objectSpread","displayName"],"mappings":"yOA6CO,SAASA,EAA8EC,GAAA,IAAxEC,QAAEA,EAAU,IAAZC,QAAiBA,GAAAA,EAAjBC,OAAiCA,GAAAA,GAAuCH,EAArBI,EAAqBC,EAAAL,EAAAM,GAC5F,OAAOC,EAACC,EAADC,EAAA,CAAaR,QAASA,EAASC,QAASA,EAASC,OAAQA,GAAYC,IAV9EL,EAAMW,YAAc"}
@@ -1,2 +1,2 @@
1
- import{ProgressSegmented as r}from'../Progress.Segmented/Progress.Segmented.js';import{ProgressCircle as e}from'../Progress.Circle/Progress.Circle.js';import{Root as o,Bar as s}from'./style.js';import{jsx as a}from'react/jsx-runtime';function t(r){var{className:e,isLoading:t,backgroundColor:n,color:g,percent:i}=r;var c='string'==typeof i?parseInt(i,10):i||0;return c>100&&(c=100),c<0&&(c=0),a(o,{className:e,backgroundColor:n,color:g,children:a(s,{width:c,isLoading:Boolean(t)})})}t.defaultProps={percent:0,color:'green',backgroundColor:'alto',isLoading:!1},t.Circe=e,t.Segmented=r,t.displayName='Progress';export{t as Progress};
1
+ import{ProgressSegmented as r}from'../Progress.Segmented/Progress.Segmented.js';import{ProgressCircle as e}from'../Progress.Circle/Progress.Circle.js';import{Root as o,Bar as s}from'./style.js';import{jsx as a}from'react/jsx-runtime';function t(r){var{className:e,isLoading:t,backgroundColor:n,color:g,percent:i}=r;var l='string'==typeof i?parseInt(i,10):i||0;return l>100&&(l=100),l<0&&(l=0),a(o,{className:e,backgroundColor:n,color:g,children:a(s,{width:l,isLoading:Boolean(t)})})}t.defaultProps={percent:0,color:'green',backgroundColor:'alto',isLoading:!1},t.Circle=e,t.Segmented=r,t.displayName='Progress';export{t as Progress};
2
2
  //# sourceMappingURL=Progress.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Progress.js","sources":["../../../../src/components/Progress/Progress.tsx"],"sourcesContent":["import { ProgressSegmented } from '../../components/Progress.Segmented'\nimport { ProgressCircle } from '../../components/Progress.Circle'\nimport { Color } from '../../mixins/color'\nimport { BaseProps } from '../../shared/interfaces'\nimport * as Styled from './style'\n\nexport interface ProgressProps extends BaseProps, Color, Color<'backgroundColor'> {\n /**\n * Current percent complete\n */\n percent?: number\n isLoading?: boolean\n}\n\nProgress.defaultProps = {\n percent: 0,\n color: 'green',\n backgroundColor: 'alto',\n isLoading: false,\n}\n\nProgress.Circe = ProgressCircle\nProgress.Segmented = ProgressSegmented\nProgress.displayName = 'Progress'\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`Color<'backgroundColor'>`](#/Миксины)\n */\nexport function Progress(props: ProgressProps) {\n const { className, isLoading, backgroundColor, color, percent } = props\n\n let _percent: number = typeof percent === 'string' ? parseInt(percent, 10) : percent || 0\n\n if (_percent > 100) _percent = 100\n if (_percent < 0) _percent = 0\n\n return (\n <Styled.Root className={className} backgroundColor={backgroundColor} color={color}>\n <Styled.Bar width={_percent} isLoading={Boolean(isLoading)} />\n </Styled.Root>\n )\n}\n"],"names":["Progress","props","className","isLoading","backgroundColor","color","percent","_percent","parseInt","_jsx","Styled.Root","children","Styled.Bar","width","Boolean","defaultProps","Circe","ProgressCircle","Segmented","ProgressSegmented","displayName"],"mappings":"0OA+BO,SAASA,EAASC,GACvB,IAAMC,UAAEA,EAAFC,UAAaA,EAAbC,gBAAwBA,EAAxBC,MAAyCA,EAAzCC,QAAgDA,GAAYL,EAElE,IAAIM,EAAsC,iBAAZD,EAAuBE,SAASF,EAAS,IAAMA,GAAW,EAKxF,OAHIC,EAAW,MAAKA,EAAW,KAC3BA,EAAW,IAAGA,EAAW,GAG3BE,EAACC,EAAD,CAAaR,UAAWA,EAAWE,gBAAiBA,EAAiBC,MAAOA,EAA5EM,SACEF,EAACG,EAAD,CAAYC,MAAON,EAAUJ,UAAWW,QAAQX,OA3BtDH,EAASe,aAAe,CACtBT,QAAS,EACTD,MAAO,QACPD,gBAAiB,OACjBD,WAAAA,GAGFH,EAASgB,MAAQC,EACjBjB,EAASkB,UAAYC,EACrBnB,EAASoB,YAAc"}
1
+ {"version":3,"file":"Progress.js","sources":["../../../../src/components/Progress/Progress.tsx"],"sourcesContent":["import { ProgressSegmented } from '../../components/Progress.Segmented'\nimport { ProgressCircle } from '../../components/Progress.Circle'\nimport { Color } from '../../mixins/color'\nimport { BaseProps } from '../../shared/interfaces'\nimport * as Styled from './style'\n\nexport interface ProgressProps extends BaseProps, Color, Color<'backgroundColor'> {\n /**\n * Current percent complete\n */\n percent?: number\n isLoading?: boolean\n}\n\nProgress.defaultProps = {\n percent: 0,\n color: 'green',\n backgroundColor: 'alto',\n isLoading: false,\n}\n\nProgress.Circle = ProgressCircle\nProgress.Segmented = ProgressSegmented\nProgress.displayName = 'Progress'\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`Color<'backgroundColor'>`](#/Миксины)\n */\nexport function Progress(props: ProgressProps) {\n const { className, isLoading, backgroundColor, color, percent } = props\n\n let _percent: number = typeof percent === 'string' ? parseInt(percent, 10) : percent || 0\n\n if (_percent > 100) _percent = 100\n if (_percent < 0) _percent = 0\n\n return (\n <Styled.Root className={className} backgroundColor={backgroundColor} color={color}>\n <Styled.Bar width={_percent} isLoading={Boolean(isLoading)} />\n </Styled.Root>\n )\n}\n"],"names":["Progress","props","className","isLoading","backgroundColor","color","percent","_percent","parseInt","_jsx","Styled.Root","children","Styled.Bar","width","Boolean","defaultProps","Circle","ProgressCircle","Segmented","ProgressSegmented","displayName"],"mappings":"0OA+BO,SAASA,EAASC,GACvB,IAAMC,UAAEA,EAAFC,UAAaA,EAAbC,gBAAwBA,EAAxBC,MAAyCA,EAAzCC,QAAgDA,GAAYL,EAElE,IAAIM,EAAsC,iBAAZD,EAAuBE,SAASF,EAAS,IAAMA,GAAW,EAKxF,OAHIC,EAAW,MAAKA,EAAW,KAC3BA,EAAW,IAAGA,EAAW,GAG3BE,EAACC,EAAD,CAAaR,UAAWA,EAAWE,gBAAiBA,EAAiBC,MAAOA,EAA5EM,SACEF,EAACG,EAAD,CAAYC,MAAON,EAAUJ,UAAWW,QAAQX,OA3BtDH,EAASe,aAAe,CACtBT,QAAS,EACTD,MAAO,QACPD,gBAAiB,OACjBD,WAAAA,GAGFH,EAASgB,OAASC,EAClBjB,EAASkB,UAAYC,EACrBnB,EAASoB,YAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","sources":["../../../../src/components/Text/Text.tsx"],"sourcesContent":["import { TextHeading } from '../../components/Text.Heading'\nimport { TextEllipse } from '../../components/Text.Ellipse'\nimport { Color } from '../../mixins/color'\nimport { ResponsiveProperty } from '../../mixins/responsive-property'\nimport { Display } from '../../mixins/display'\nimport { BaseProps } from '../../shared/interfaces'\nimport * as Styled from './style'\n\nexport interface TextProps extends BaseProps, Color, ResponsiveProperty<'size'>, Display {\n /**\n * An element type to render as (string).\n */\n as?: 'div' | 'span' | 'h1' | 'h2' | 'h3' | 'h4' | 'p'\n /**\n * Primary content\n */\n content?: string\n /**\n * Primary content\n */\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Text font weight\n */\n weight?: 'lighter' | 'normal' | 'bold' | 'bolder' | number\n /**\n * Text font style\n */\n fontStyle?: 'normal' | 'italic'\n /**\n * Add underline to inline links\n */\n underlineLinks?: boolean\n /**\n * Text align\n */\n textAlign?: 'left' | 'center' | 'right'\n /**\n * Line height\n */\n lineHeight?: 'l' | 'm' | 's' | 'xs' | number\n /**\n * Element title\n */\n title?: string\n}\n\nText.Heading = TextHeading\nText.Ellipse = TextEllipse\nText.displayName = 'Text'\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`Display`](#/Миксины)\n * - [`ResponsiveProperty<'size'>`](#/Миксины)\n */\nexport function Text(props: TextProps) {\n const {\n as = 'div',\n children,\n weight = 'normal',\n content,\n textAlign,\n underlineLinks,\n className,\n style,\n lineHeight = 'm',\n fontStyle = 'normal',\n title,\n color = 'black',\n size = 'm',\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n display,\n } = props\n\n if (children) {\n return (\n <Styled.Root\n as={as}\n color={color}\n className={className}\n title={title}\n weight={weight}\n lineHeight={lineHeight}\n textAlign={textAlign}\n fontStyle={fontStyle}\n underlineLinks={underlineLinks}\n size={size}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n display={display}\n style={style}\n >\n {children}\n </Styled.Root>\n )\n }\n\n return (\n <Styled.Root\n as={as}\n color={color}\n className={className}\n title={title}\n weight={weight}\n lineHeight={lineHeight}\n textAlign={textAlign}\n fontStyle={fontStyle}\n underlineLinks={underlineLinks}\n size={size}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n display={display}\n style={style}\n dangerouslySetInnerHTML={{ __html: content || '' }}\n />\n )\n}\n"],"names":["Text","props","as","children","weight","content","textAlign","underlineLinks","className","style","lineHeight","fontStyle","title","color","size","sizeXS","sizeS","sizeM","sizeL","sizeXL","display","_jsx","Styled.Root","dangerouslySetInnerHTML","__html","Heading","TextHeading","Ellipse","TextEllipse","displayName"],"mappings":"sMA6DO,SAASA,EAAKC,GACnB,IAAMC,GACJA,EAAK,MADDC,SAEJA,EAFIC,OAGJA,EAAS,SAHLC,QAIJA,EAJIC,UAKJA,EALIC,eAMJA,EANIC,UAOJA,EAPIC,MAQJA,EARIC,WASJA,EAAa,IATTC,UAUJA,EAAY,SAVRC,MAWJA,EAXIC,MAYJA,EAAQ,QAZJC,KAaJA,EAAO,IAbHC,OAcJA,EAdIC,MAeJA,EAfIC,MAgBJA,EAhBIC,MAiBJA,EAjBIC,OAkBJA,EAlBIC,QAmBJA,GACEnB,EAEJ,OAEIoB,EAACC,EAFDnB,EAEA,CACED,GAAIA,EACJW,MAAOA,EACPL,UAAWA,EACXI,MAAOA,EACPR,OAAQA,EACRM,WAAYA,EACZJ,UAAWA,EACXK,UAAWA,EACXJ,eAAgBA,EAChBO,KAAMA,EACNC,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,EACRC,QAASA,EACTX,MAAOA,EAjBTN,SAmBGA,GAML,CACED,GAAIA,EACJW,MAAOA,EACPL,UAAWA,EACXI,MAAOA,EACPR,OAAQA,EACRM,WAAYA,EACZJ,UAAWA,EACXK,UAAWA,EACXJ,eAAgBA,EAChBO,KAAMA,EACNC,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,EACRC,QAASA,EACTX,MAAOA,EACPc,wBAAyB,CAAEC,OAAQnB,GAAW,MA/EpDL,EAAKyB,QAAUC,EACf1B,EAAK2B,QAAUC,EACf5B,EAAK6B,YAAc"}
1
+ {"version":3,"file":"Text.js","sources":["../../../../src/components/Text/Text.tsx"],"sourcesContent":["import { TextHeading } from '../../components/Text.Heading'\nimport { TextEllipse } from '../../components/Text.Ellipse'\nimport { Color } from '../../mixins/color'\nimport { ResponsiveProperty } from '../../mixins/responsive-property'\nimport { Display } from '../../mixins/display'\nimport { BaseProps } from '../../shared/interfaces'\nimport * as Styled from './style'\n\nexport interface TextProps extends BaseProps, Color, ResponsiveProperty<'size'>, Display {\n /**\n * An element type to render as (string).\n */\n as?: 'div' | 'span' | 'h1' | 'h2' | 'h3' | 'h4' | 'p'\n /**\n * Primary content\n */\n content?: string\n /**\n * Primary content\n */\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Text font weight\n */\n weight?: 'lighter' | 'normal' | 'bold' | 'bolder' | number\n /**\n * Text font style\n */\n fontStyle?: 'normal' | 'italic'\n /**\n * Add underline to inline links\n */\n underlineLinks?: boolean\n /**\n * Text align\n */\n textAlign?: 'left' | 'center' | 'right' | 'justify' | 'start' | 'end'\n /**\n * Line height\n */\n lineHeight?: 'l' | 'm' | 's' | 'xs' | number\n /**\n * Element title\n */\n title?: string\n}\n\nText.Heading = TextHeading\nText.Ellipse = TextEllipse\nText.displayName = 'Text'\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`Display`](#/Миксины)\n * - [`ResponsiveProperty<'size'>`](#/Миксины)\n */\nexport function Text(props: TextProps) {\n const {\n as = 'div',\n children,\n weight = 'normal',\n content,\n textAlign,\n underlineLinks,\n className,\n style,\n lineHeight = 'm',\n fontStyle = 'normal',\n title,\n color = 'black',\n size = 'm',\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n display,\n } = props\n\n if (children) {\n return (\n <Styled.Root\n as={as}\n color={color}\n className={className}\n title={title}\n weight={weight}\n lineHeight={lineHeight}\n textAlign={textAlign}\n fontStyle={fontStyle}\n underlineLinks={underlineLinks}\n size={size}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n display={display}\n style={style}\n >\n {children}\n </Styled.Root>\n )\n }\n\n return (\n <Styled.Root\n as={as}\n color={color}\n className={className}\n title={title}\n weight={weight}\n lineHeight={lineHeight}\n textAlign={textAlign}\n fontStyle={fontStyle}\n underlineLinks={underlineLinks}\n size={size}\n sizeXS={sizeXS}\n sizeS={sizeS}\n sizeM={sizeM}\n sizeL={sizeL}\n sizeXL={sizeXL}\n display={display}\n style={style}\n dangerouslySetInnerHTML={{ __html: content || '' }}\n />\n )\n}\n"],"names":["Text","props","as","children","weight","content","textAlign","underlineLinks","className","style","lineHeight","fontStyle","title","color","size","sizeXS","sizeS","sizeM","sizeL","sizeXL","display","_jsx","Styled.Root","dangerouslySetInnerHTML","__html","Heading","TextHeading","Ellipse","TextEllipse","displayName"],"mappings":"sMA6DO,SAASA,EAAKC,GACnB,IAAMC,GACJA,EAAK,MADDC,SAEJA,EAFIC,OAGJA,EAAS,SAHLC,QAIJA,EAJIC,UAKJA,EALIC,eAMJA,EANIC,UAOJA,EAPIC,MAQJA,EARIC,WASJA,EAAa,IATTC,UAUJA,EAAY,SAVRC,MAWJA,EAXIC,MAYJA,EAAQ,QAZJC,KAaJA,EAAO,IAbHC,OAcJA,EAdIC,MAeJA,EAfIC,MAgBJA,EAhBIC,MAiBJA,EAjBIC,OAkBJA,EAlBIC,QAmBJA,GACEnB,EAEJ,OAEIoB,EAACC,EAFDnB,EAEA,CACED,GAAIA,EACJW,MAAOA,EACPL,UAAWA,EACXI,MAAOA,EACPR,OAAQA,EACRM,WAAYA,EACZJ,UAAWA,EACXK,UAAWA,EACXJ,eAAgBA,EAChBO,KAAMA,EACNC,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,EACRC,QAASA,EACTX,MAAOA,EAjBTN,SAmBGA,GAML,CACED,GAAIA,EACJW,MAAOA,EACPL,UAAWA,EACXI,MAAOA,EACPR,OAAQA,EACRM,WAAYA,EACZJ,UAAWA,EACXK,UAAWA,EACXJ,eAAgBA,EAChBO,KAAMA,EACNC,OAAQA,EACRC,MAAOA,EACPC,MAAOA,EACPC,MAAOA,EACPC,OAAQA,EACRC,QAASA,EACTX,MAAOA,EACPc,wBAAyB,CAAEC,OAAQnB,GAAW,MA/EpDL,EAAKyB,QAAUC,EACf1B,EAAK2B,QAAUC,EACf5B,EAAK6B,YAAc"}
package/dts/index.d.ts CHANGED
@@ -490,6 +490,8 @@ declare enum IconNames {
490
490
  playPause = "playPause",
491
491
  video = "video"
492
492
  }
493
+ declare type Icon$1 = React.FC<React.SVGProps<SVGSVGElement>> | (() => JSX.Element);
494
+ declare const defaultIcons: Record<IconNames, Icon$1>;
493
495
 
494
496
  interface IconProps extends BaseProps, Color, VAlign, ResponsiveProperty<'size'> {
495
497
  /**
@@ -666,7 +668,7 @@ declare enum CurrencyCodes {
666
668
  }
667
669
  declare const CURRENCY_MAP: Readonly<Record<CurrencyCodes, string>>;
668
670
 
669
- interface AmountProps extends BaseProps, Color, ResponsiveProperty<'size'> {
671
+ interface AmountProps extends BaseProps, Color, ResponsiveProperty<'size'>, Display {
670
672
  /**
671
673
  * Value for amount
672
674
  */
@@ -762,6 +764,8 @@ interface AnchorProps extends BaseProps, Color, ResponsiveProperty<'size'>, Disp
762
764
  * Onclick handler
763
765
  */
764
766
  onClick?: () => void;
767
+ target?: string;
768
+ rel?: string;
765
769
  }
766
770
  /**
767
771
  * Расширен:
@@ -770,9 +774,12 @@ interface AnchorProps extends BaseProps, Color, ResponsiveProperty<'size'>, Disp
770
774
  * - [`ResponsiveProperty<'size'>`](#/Миксины)
771
775
  * - [`Display`](#/Миксины)
772
776
  */
773
- declare function Anchor(props: AnchorProps): JSX.Element;
777
+ declare function Anchor(props: typeof Anchor.defaultProps & AnchorProps): JSX.Element;
774
778
  declare namespace Anchor {
775
779
  var displayName: string;
780
+ var defaultProps: {
781
+ display: string;
782
+ };
776
783
  }
777
784
 
778
785
  interface ArrowProps extends BaseProps {
@@ -944,7 +951,7 @@ interface TextProps extends BaseProps, Color, ResponsiveProperty<'size'>, Displa
944
951
  /**
945
952
  * Text align
946
953
  */
947
- textAlign?: 'left' | 'center' | 'right';
954
+ textAlign?: 'left' | 'center' | 'right' | 'justify' | 'start' | 'end';
948
955
  /**
949
956
  * Line height
950
957
  */
@@ -993,11 +1000,9 @@ interface ButtonProps extends BaseProps, Tooltiped, Display, Color, Color<'fontC
993
1000
  /**
994
1001
  * Node type
995
1002
  */
996
- as?: 'div' | 'span' | 'a' | 'button' | typeof Link;
997
- /**
998
- * add attr tagret='_blank' for `a` tag
999
- */
1000
- blank?: boolean;
1003
+ as?: 'div' | 'span' | 'a' | 'button' | typeof Link | typeof Anchor;
1004
+ target?: string;
1005
+ rel?: string;
1001
1006
  /**
1002
1007
  * Link href
1003
1008
  */
@@ -1009,7 +1014,7 @@ interface ButtonProps extends BaseProps, Tooltiped, Display, Color, Color<'fontC
1009
1014
  /**
1010
1015
  * Type for button element
1011
1016
  */
1012
- type?: 'button' | 'submit';
1017
+ type?: 'button' | 'submit' | 'reset';
1013
1018
  /**
1014
1019
  * Children react node
1015
1020
  */
@@ -1232,7 +1237,7 @@ interface PaperProps extends BaseProps, Display, Color, ResponsiveProperty<'padd
1232
1237
  /**
1233
1238
  * This number represents the zDepth of the paper shadow
1234
1239
  */
1235
- zDepth?: 0 | 1 | 2 | 3 | 4;
1240
+ zDepth?: false | 0 | 1 | 2 | 3 | 4;
1236
1241
  /**
1237
1242
  * Text align
1238
1243
  */
@@ -1373,7 +1378,7 @@ declare namespace Progress {
1373
1378
  backgroundColor: string;
1374
1379
  isLoading: boolean;
1375
1380
  };
1376
- var Circe: typeof ProgressCircle;
1381
+ var Circle: typeof ProgressCircle;
1377
1382
  var Segmented: typeof ProgressSegmented;
1378
1383
  var displayName: string;
1379
1384
  }
@@ -2233,6 +2238,12 @@ interface InputPhoneState {
2233
2238
  declare class InputPhone extends PureComponent<typeof InputPhone.defaultProps & InputPhoneProps, InputPhoneState> {
2234
2239
  static displayName: string;
2235
2240
  static defaultProps: {
2241
+ rounded: boolean;
2242
+ type: string;
2243
+ width: string;
2244
+ color: string;
2245
+ mask: string;
2246
+ placeholderColor: string;
2236
2247
  countryData: [string, string, string, RegExp][];
2237
2248
  defaultMask: string;
2238
2249
  initialMask: string;
@@ -2266,7 +2277,7 @@ interface InputProps extends BaseProps, InputField, InputHTMLAttributes {
2266
2277
  * Any character can be escaped with backslash, which usually will appear as double backslash in JS strings.
2267
2278
  * For example, German phone mask with unremoveable prefix +49 will look like `mask="+4\\9 99 999 99"` or `mask={"+4\\\\9 99 999 99"}`
2268
2279
  */
2269
- mask: string | Array<string | RegExp>;
2280
+ mask?: string | Array<string | RegExp>;
2270
2281
  /**
2271
2282
  * Character to cover unfilled editable parts of mask. Default character is "_". If set to null, unfilled parts will be empty, like in ordinary input.
2272
2283
  */
@@ -2309,13 +2320,14 @@ interface InputProps extends BaseProps, InputField, InputHTMLAttributes {
2309
2320
  * - [`InputField`](#/Миксины)
2310
2321
  * - `React.InputHTMLAttributes<HTMLInputElement>`
2311
2322
  */
2312
- declare function Input(props: InputProps): JSX.Element;
2323
+ declare function Input(props: InputProps & typeof Input.defaultProps): JSX.Element;
2313
2324
  declare namespace Input {
2314
2325
  var defaultProps: {
2315
2326
  rounded: boolean;
2316
2327
  type: string;
2317
2328
  width: string;
2318
2329
  color: string;
2330
+ mask: string;
2319
2331
  placeholderColor: string;
2320
2332
  };
2321
2333
  var Phone: typeof InputPhone;
@@ -2492,4 +2504,4 @@ declare namespace Select {
2492
2504
  var displayName: string;
2493
2505
  }
2494
2506
 
2495
- export { ActionBtn, Amount, Anchor, Arrow, Avatar, Badge, Button, COUNTRY_DATA, CURRENCY_MAP, Checkbox, ColorNames, Container, ContextMenu, CurrencyCodes, DEFAULT_MASK, INITIAL_MASK, Icon, Input, Modal, Paper, Progress, Radio, withThemeScrollable as Scrollable, Section, Select, Separator, Spacer, Spinner, Switcher, Tabs, Tag, Text, Textarea, ThemeProvider, Tooltip, baseInputStyle, buildMediaQuery, color, property, responsiveProperty, screenL, screenM, screenMaxL, screenMaxM, screenMaxS, screenMaxXl, screenMaxXs, screenMaxXxs, screenMinL, screenMinM, screenMinS, screenMinXl, screenMinXs, screenRetina, screenS, screenXl, screenXs, theme, vAlign };
2507
+ export { ActionBtn, Amount, Anchor, Arrow, Avatar, Badge, Button, COUNTRY_DATA, CURRENCY_MAP, Checkbox, ColorNames, Container, ContextMenu, CurrencyCodes, DEFAULT_MASK, INITIAL_MASK, Icon, Input, Modal, Paper, Progress, Radio, withThemeScrollable as Scrollable, Section, Select, Separator, Spacer, Spinner, Switcher, Tabs, Tag, Text, Textarea, ThemeProvider, Tooltip, baseInputStyle, buildMediaQuery, color, defaultIcons, property, responsiveProperty, screenL, screenM, screenMaxL, screenMaxM, screenMaxS, screenMaxXl, screenMaxXs, screenMaxXxs, screenMinL, screenMinM, screenMinS, screenMinXl, screenMinXs, screenRetina, screenS, screenXl, screenXs, theme, vAlign };