to children\n link = cloneElement(link, linkProps, [Icon, ...Children.toArray(linkChildren)]);\n }\n\n const convertedSize = typeof fileSize === 'string' ? fileSize : convertBytes(fileSize);\n\n const wrapClassName = cn(className, {\n [styles.wrap]: isFileTypeExist,\n [styles.wrapMargin]: marginBottom,\n });\n\n return (\n \n \n {link}\n \n {convertedSize && (\n \n {convertedSize}\n \n )}\n
\n );\n};\n","const postfixes = ['б', 'Кб', 'Мб', 'Гб', 'Тб'];\n\n/**\n * Показывает размер файла в сокращенном виде с пост-фиксом\n */\nexport const convertBytes = (bytes?: number | string | null): string => {\n const postfixesLength = postfixes.length - 1;\n\n let result: number = parseInt(`${bytes}`, 10);\n\n if ((!result && result !== 0) || result < 0) {\n return '';\n }\n\n let index = 0;\n\n while (result >= 1024 && index < postfixesLength) {\n result /= 1024;\n index += 1;\n }\n\n if (result >= 1000) {\n if (index >= postfixesLength) {\n return '';\n }\n\n result = 1;\n index += 1;\n }\n\n const postfix = postfixes[index];\n\n result = Math.round(result * 10) / 10;\n\n return `${result.toString().split('.').join(',')} ${postfix}`;\n};\n","const caption = {\n s: 1.4,\n m: 1.4,\n l: 1.3,\n};\n\nconst subtitle = {\n s: 1.4,\n m: 1.3,\n l: 1.2,\n};\n\nexport const heights = {\n 'body-text': caption,\n caption,\n subtitle,\n};\n","export const XS = 'xs';\nexport const S = 's';\nexport const M = 'm';\nexport const L = 'l';\nexport const XXL = 'xxl';\n\nexport const DEFAULT_SIZE = L;\n\nexport const SIZES = [XS, S, M, L, XXL];\n\nexport const WHITE = 'white';\nexport const BLUE = 'blue';\nexport const GREY = 'grey';\nexport const BLACK = 'black';\n\nexport const DEFAULT_THEME = WHITE;\n\nexport const THEMES = [WHITE, BLUE, GREY, BLACK];\n\nconst BODY_TEXT = 'body-text';\nconst CAPTION = 'caption';\nconst SUBTITLE = 'subtitle';\n\nexport const DEFAULT_KIND = BODY_TEXT;\n\nexport const KINDS = [BODY_TEXT, CAPTION, SUBTITLE];\n\nconst PARENT_H3 = 'h3';\n\nexport const PARENT_TYPES = [PARENT_H3];\n\nexport const PRIORITIES = [0, 1, 2, 3, 4, 5];\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport cn from 'classnames';\n\nimport {\n DEFAULT_THEME,\n DEFAULT_KIND,\n DEFAULT_SIZE,\n KINDS,\n PARENT_TYPES,\n PRIORITIES,\n SIZES,\n THEMES,\n} from './configs/config';\n\nexport const Text = ({\n Tag,\n children,\n className,\n configs: { fontSize, lineHeight },\n inline,\n keepStyles,\n kind,\n lines,\n marginBottom,\n marginTop,\n parentType,\n priority,\n size,\n styles,\n theme,\n ...rest\n}) => {\n const selectedFontSize = fontSize[kind][size];\n const selectedLineHeight = lineHeight[kind][size];\n\n const height = lines ? `calc(${lines} * ${selectedLineHeight} * ${selectedFontSize}px)` : null;\n\n const tagByPriority = priority ? `h${priority}` : 'p';\n const TagName = Tag ?? (inline ? 'span' : tagByPriority);\n\n const classNames = cn(\n styles.main,\n {\n [styles[`${kind}-margin-top-${size}`]]: marginTop && !inline,\n [styles[`${kind}-margin-bottom-${size}`]]: marginBottom && !inline,\n [styles[`${kind}-margin-bottom-parent-${parentType}-${size}`]]:\n !inline && marginBottom && kind === 'subtitle' && parentType,\n [styles[`${kind}-line-height-${size}`]]: !inline,\n [styles[`${kind}-font-size-${size}`]]: !inline || (inline && keepStyles),\n },\n styles[`${kind}-theme-${theme}`],\n className\n );\n\n return (\n \n {children}\n \n );\n};\n\nText.propTypes = {\n /** Содержимое */\n children: PropTypes.node.isRequired,\n /** Внешние стили для переопределения */\n className: PropTypes.string,\n /** JS-размены шрифтов */\n configs: PropTypes.objectOf(PropTypes.object),\n /** Меняет HTML-представление на */\n inline: PropTypes.bool,\n /**\n * При использовании 'inline=true', компонент наследует большую часть стилей от родителя.\n * Чтобы сохранить стили, используй 'keepStyles=true'\n */\n keepStyles: PropTypes.bool,\n /** Визуальный стиль текстового элемента */\n kind: PropTypes.oneOf(KINDS),\n /** При 'lines=(INT)' элемент сразу занимает на экране фиксированное число строк, независимо от контента */\n lines: PropTypes.number,\n /** 'marginBottom=false' выключает нижний отступ */\n marginBottom: PropTypes.bool,\n /** 'marginTop=false' выключает верхний отступ */\n marginTop: PropTypes.bool,\n /** Иногда нужно указать родителя, чтобы получить правильный отступ снизу */\n parentType: PropTypes.oneOf(PARENT_TYPES),\n /** Меняет HTML-представление элемента на */\n priority: PropTypes.oneOf(PRIORITIES),\n /** Визуальный размер элемента */\n size: PropTypes.oneOf(SIZES),\n /** CSS-стили компонента */\n styles: PropTypes.objectOf(PropTypes.string),\n /** Визуальная тема элемента (цвет) */\n theme: PropTypes.oneOf(THEMES),\n};\n\nText.defaultProps = {\n className: '',\n configs: {},\n inline: false,\n keepStyles: false,\n kind: DEFAULT_KIND,\n lines: 0,\n marginBottom: true,\n marginTop: true,\n parentType: null,\n priority: 0,\n size: DEFAULT_SIZE,\n styles: {},\n theme: DEFAULT_THEME,\n};\n","import { ComponentType } from 'react';\n\nimport { ICreateWidget } from './models';\nimport { hoist, createWrapper } from './helpers';\n\n/**\n * Функция hoc, для создания виджета, принимает объект зависимостей\n * и возвращает компонент с внедренными зависимостями\n */\nexport const createWidget: ICreateWidget =\n (dependencies?: T) =>\n (Widget: ComponentType) =>\n hoist(createWrapper(Widget, dependencies), Widget);\n","// extracted by mini-css-extract-plugin\nexport default {\"borderRadius0\":\"aG2mw\",\"borderRadius4\":\"bG2mw\",\"borderRadius8\":\"cG2mw\",\"borderRadius12\":\"dG2mw\",\"marginTop0\":\"eG2mw\",\"marginTop2\":\"fG2mw\",\"marginTop4\":\"gG2mw\",\"marginTop8\":\"hG2mw\",\"marginTop12\":\"iG2mw\",\"marginTop16\":\"jG2mw\",\"marginTop20\":\"kG2mw\",\"marginTop24\":\"lG2mw\",\"marginTop28\":\"mG2mw\",\"marginTop32\":\"nG2mw\",\"marginTop36\":\"oG2mw\",\"marginTop40\":\"pG2mw\",\"marginTop44\":\"qG2mw\",\"marginTop48\":\"rG2mw\",\"marginTop52\":\"sG2mw\",\"marginTop56\":\"tG2mw\",\"marginTop60\":\"uG2mw\",\"marginTop64\":\"vG2mw\",\"marginTop68\":\"wG2mw\",\"marginTop72\":\"xG2mw\",\"marginRight0\":\"yG2mw\",\"marginRight2\":\"zG2mw\",\"marginRight4\":\"AG2mw\",\"marginRight8\":\"BG2mw\",\"marginRight12\":\"CG2mw\",\"marginRight16\":\"DG2mw\",\"marginRight20\":\"EG2mw\",\"marginRight24\":\"FG2mw\",\"marginRight28\":\"GG2mw\",\"marginRight32\":\"HG2mw\",\"marginRight36\":\"IG2mw\",\"marginRight40\":\"JG2mw\",\"marginRight44\":\"KG2mw\",\"marginRight48\":\"LG2mw\",\"marginRight52\":\"MG2mw\",\"marginRight56\":\"NG2mw\",\"marginRight60\":\"OG2mw\",\"marginRight64\":\"PG2mw\",\"marginRight68\":\"QG2mw\",\"marginRight72\":\"RG2mw\",\"marginBottom0\":\"SG2mw\",\"marginBottom2\":\"TG2mw\",\"marginBottom4\":\"UG2mw\",\"marginBottom8\":\"VG2mw\",\"marginBottom12\":\"WG2mw\",\"marginBottom16\":\"XG2mw\",\"marginBottom20\":\"YG2mw\",\"marginBottom24\":\"ZG2mw\",\"marginBottom28\":\"__G2mw\",\"marginBottom32\":\"_0G2mw\",\"marginBottom36\":\"_1G2mw\",\"marginBottom40\":\"_2G2mw\",\"marginBottom44\":\"_3G2mw\",\"marginBottom48\":\"_4G2mw\",\"marginBottom52\":\"_5G2mw\",\"marginBottom56\":\"_6G2mw\",\"marginBottom60\":\"_7G2mw\",\"marginBottom64\":\"_8G2mw\",\"marginBottom68\":\"_9G2mw\",\"marginBottom72\":\"_-G2mw\",\"marginLeft0\":\"aaG2mw\",\"marginLeft2\":\"abG2mw\",\"marginLeft4\":\"acG2mw\",\"marginLeft8\":\"adG2mw\",\"marginLeft12\":\"aeG2mw\",\"marginLeft16\":\"afG2mw\",\"marginLeft20\":\"agG2mw\",\"marginLeft24\":\"ahG2mw\",\"marginLeft28\":\"aiG2mw\",\"marginLeft32\":\"ajG2mw\",\"marginLeft36\":\"akG2mw\",\"marginLeft40\":\"alG2mw\",\"marginLeft44\":\"amG2mw\",\"marginLeft48\":\"anG2mw\",\"marginLeft52\":\"aoG2mw\",\"marginLeft56\":\"apG2mw\",\"marginLeft60\":\"aqG2mw\",\"marginLeft64\":\"arG2mw\",\"marginLeft68\":\"asG2mw\",\"marginLeft72\":\"atG2mw\",\"paddingTop0\":\"auG2mw\",\"paddingTop2\":\"avG2mw\",\"paddingTop4\":\"awG2mw\",\"paddingTop8\":\"axG2mw\",\"paddingTop12\":\"ayG2mw\",\"paddingTop16\":\"azG2mw\",\"paddingTop20\":\"aAG2mw\",\"paddingTop24\":\"aBG2mw\",\"paddingTop28\":\"aCG2mw\",\"paddingTop32\":\"aDG2mw\",\"paddingTop36\":\"aEG2mw\",\"paddingTop40\":\"aFG2mw\",\"paddingTop44\":\"aGG2mw\",\"paddingTop48\":\"aHG2mw\",\"paddingTop52\":\"aIG2mw\",\"paddingTop56\":\"aJG2mw\",\"paddingTop60\":\"aKG2mw\",\"paddingTop64\":\"aLG2mw\",\"paddingTop68\":\"aMG2mw\",\"paddingTop72\":\"aNG2mw\",\"paddingRight0\":\"aOG2mw\",\"paddingRight2\":\"aPG2mw\",\"paddingRight4\":\"aQG2mw\",\"paddingRight8\":\"aRG2mw\",\"paddingRight12\":\"aSG2mw\",\"paddingRight16\":\"aTG2mw\",\"paddingRight20\":\"aUG2mw\",\"paddingRight24\":\"aVG2mw\",\"paddingRight28\":\"aWG2mw\",\"paddingRight32\":\"aXG2mw\",\"paddingRight36\":\"aYG2mw\",\"paddingRight40\":\"aZG2mw\",\"paddingRight44\":\"a_G2mw\",\"paddingRight48\":\"a0G2mw\",\"paddingRight52\":\"a1G2mw\",\"paddingRight56\":\"a2G2mw\",\"paddingRight60\":\"a3G2mw\",\"paddingRight64\":\"a4G2mw\",\"paddingRight68\":\"a5G2mw\",\"paddingRight72\":\"a6G2mw\",\"paddingBottom0\":\"a7G2mw\",\"paddingBottom2\":\"a8G2mw\",\"paddingBottom4\":\"a9G2mw\",\"paddingBottom8\":\"a-G2mw\",\"paddingBottom12\":\"baG2mw\",\"paddingBottom16\":\"bbG2mw\",\"paddingBottom20\":\"bcG2mw\",\"paddingBottom24\":\"bdG2mw\",\"paddingBottom28\":\"beG2mw\",\"paddingBottom32\":\"bfG2mw\",\"paddingBottom36\":\"bgG2mw\",\"paddingBottom40\":\"bhG2mw\",\"paddingBottom44\":\"biG2mw\",\"paddingBottom48\":\"bjG2mw\",\"paddingBottom52\":\"bkG2mw\",\"paddingBottom56\":\"blG2mw\",\"paddingBottom60\":\"bmG2mw\",\"paddingBottom64\":\"bnG2mw\",\"paddingBottom68\":\"boG2mw\",\"paddingBottom72\":\"bpG2mw\",\"paddingLeft0\":\"bqG2mw\",\"paddingLeft2\":\"brG2mw\",\"paddingLeft4\":\"bsG2mw\",\"paddingLeft8\":\"btG2mw\",\"paddingLeft12\":\"buG2mw\",\"paddingLeft16\":\"bvG2mw\",\"paddingLeft20\":\"bwG2mw\",\"paddingLeft24\":\"bxG2mw\",\"paddingLeft28\":\"byG2mw\",\"paddingLeft32\":\"bzG2mw\",\"paddingLeft36\":\"bAG2mw\",\"paddingLeft40\":\"bBG2mw\",\"paddingLeft44\":\"bCG2mw\",\"paddingLeft48\":\"bDG2mw\",\"paddingLeft52\":\"bEG2mw\",\"paddingLeft56\":\"bFG2mw\",\"paddingLeft60\":\"bGG2mw\",\"paddingLeft64\":\"bHG2mw\",\"paddingLeft68\":\"bIG2mw\",\"paddingLeft72\":\"bJG2mw\"};","import isEmpty from 'lodash/isEmpty';\n\nimport styles from './styles/common.css';\nimport { IStyler } from './models';\n\ntype TStyle = keyof typeof styles;\n\nconst RULES: Array<[keyof IStyler, keyof IStyler]> = [\n ['borderRadius', 'borderRadius'],\n ['marginTop', 'margin'],\n ['marginRight', 'margin'],\n ['marginBottom', 'margin'],\n ['marginLeft', 'margin'],\n ['paddingTop', 'padding'],\n ['paddingRight', 'padding'],\n ['paddingBottom', 'padding'],\n ['paddingLeft', 'padding'],\n];\n\nexport const generateStyle = (\n styler: IStyler = {},\n injectedClassName?: string\n): { className: string } | undefined => {\n const classNames: string[] = [];\n\n if (isEmpty(styler)) {\n return injectedClassName ? { className: injectedClassName } : undefined;\n }\n\n for (const [rule, fallback] of RULES) {\n if (styler[rule] !== undefined) {\n classNames.push(styles[`${rule}${styler[rule]}` as TStyle]);\n } else if (styler[fallback] !== undefined) {\n classNames.push(styles[`${rule}${styler[fallback]}` as TStyle]);\n }\n }\n\n if (injectedClassName) {\n classNames.push(injectedClassName);\n }\n\n if (classNames.length) return { className: classNames.join(' ') };\n\n return undefined;\n};\n","import React, { ComponentType } from 'react';\nimport hoistStatics from 'hoist-non-react-statics';\n\nimport { generateStyle } from './generate-style';\nimport { TWrapper } from './models';\n\n/**\n * Вернуть объект с названием виджета\n */\nexport const getDisplayName = (TargetWidget: ComponentType) => ({\n displayName: TargetWidget.displayName || TargetWidget.name || 'UnnamedWidget',\n});\n\n/**\n * Создать обертку, добавляющую стайлер и зависимости\n */\nexport const createWrapper =\n (Widget: ComponentType, dependencies?: T): ComponentType> =>\n ({ className, styler, ...props }) =>\n ;\n\n/**\n * Добавить изначальные свойства виджета, displayName и любые дополнительные\n */\nexport const hoist = (\n Wrapper: ComponentType,\n Widget: ComponentType,\n ...rest: any[]\n): ComponentType =>\n Object.assign(hoistStatics(Wrapper, Widget), getDisplayName(Widget), ...rest);\n","/*!\n Copyright (c) 2018 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString === Object.prototype.toString) {\n\t\t\t\t\tfor (var key in arg) {\n\t\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","// extracted by mini-css-extract-plugin\nexport default {\"background-$(backgroundColorBg)\":\"a3w6h\",\"background-$(backgroundColor)\":\"b3w6h\",\"wrap\":\"c3w6h\",\"icon\":\"d3w6h\",\"wrapMargin\":\"e3w6h\"};","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n"],"names":["SKETCH","FILE_TYPES","ICONS","height","width","xmlns","fill","d","FileLink","Text","children","fileSize","fileType","marginBottom","styles","className","theme","WHITE","convertBytes","link","Children","isFileTypeExist","includes","React","icon","key","Icon","linkProps","props","linkChildren","cloneElement","convertedSize","wrapClassName","cn","wrap","wrapMargin","marginTop","kind","size","postfixes","bytes","postfixesLength","length","result","parseInt","index","postfix","Math","round","toString","split","join","caption","s","m","l","heights","subtitle","SIZES","THEMES","BODY_TEXT","KINDS","PARENT_TYPES","Tag","configs","fontSize","lineHeight","inline","keepStyles","lines","parentType","priority","rest","selectedFontSize","selectedLineHeight","TagName","classNames","main","style","propTypes","PropTypes","defaultProps","createWidget","dependencies","Widget","hoist","createWrapper","RULES","getDisplayName","TargetWidget","displayName","name","styler","injectedClassName","isEmpty","undefined","rule","fallback","push","generateStyle","Wrapper","Object","assign","hoistStatics","hasOwn","hasOwnProperty","classes","i","arguments","arg","argType","Array","isArray","inner","apply","prototype","call","module","exports","default","ReactPropTypesSecret","emptyFunction","emptyFunctionWithReset","resetWarningCache","shim","propName","componentName","location","propFullName","secret","err","Error","getShim","isRequired","ReactPropTypes","array","bigint","bool","func","number","object","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes"],"sourceRoot":""}