@foxford/ui 2.77.0 → 2.77.1

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.
Files changed (104) hide show
  1. package/components/ActionBtn/ActionBtn.js.map +1 -1
  2. package/components/ActionBtn/ActionBtn.mjs.map +1 -1
  3. package/components/Amount/Amount.js.map +1 -1
  4. package/components/Amount/Amount.mjs.map +1 -1
  5. package/components/Anchor/Anchor.js.map +1 -1
  6. package/components/Anchor/Anchor.mjs.map +1 -1
  7. package/components/Arrow/Arrow.js.map +1 -1
  8. package/components/Arrow/Arrow.mjs.map +1 -1
  9. package/components/ArrowBadge/ArrowBadge.js.map +1 -1
  10. package/components/ArrowBadge/ArrowBadge.mjs.map +1 -1
  11. package/components/Avatar/Avatar.js.map +1 -1
  12. package/components/Avatar/Avatar.mjs.map +1 -1
  13. package/components/Badge/Badge.js.map +1 -1
  14. package/components/Badge/Badge.mjs.map +1 -1
  15. package/components/Button/Button.js.map +1 -1
  16. package/components/Button/Button.mjs.map +1 -1
  17. package/components/Chip/Chip.js.map +1 -1
  18. package/components/Chip/Chip.mjs.map +1 -1
  19. package/components/Container/Container.js.map +1 -1
  20. package/components/Container/Container.mjs.map +1 -1
  21. package/components/ContextMenu/ContextMenu.js.map +1 -1
  22. package/components/ContextMenu/ContextMenu.mjs.map +1 -1
  23. package/components/ContextMenu/Item.js.map +1 -1
  24. package/components/ContextMenu/Item.mjs.map +1 -1
  25. package/components/ContextMenu.Multilevel/ContextMenu.Multilevel.js.map +1 -1
  26. package/components/ContextMenu.Multilevel/ContextMenu.Multilevel.mjs.map +1 -1
  27. package/components/Dropdown/Dropdown.js.map +1 -1
  28. package/components/Dropdown/Dropdown.mjs.map +1 -1
  29. package/components/FormLabel/FormLabel.js.map +1 -1
  30. package/components/FormLabel/FormLabel.mjs.map +1 -1
  31. package/components/Icon/Icon.js.map +1 -1
  32. package/components/Icon/Icon.mjs.map +1 -1
  33. package/components/IconButton/IconButton.js.map +1 -1
  34. package/components/IconButton/IconButton.mjs.map +1 -1
  35. package/components/Indicator/Indicator.js.map +1 -1
  36. package/components/Indicator/Indicator.mjs.map +1 -1
  37. package/components/Input/Input.js.map +1 -1
  38. package/components/Input/Input.mjs.map +1 -1
  39. package/components/Input.Phone/Input.Phone.js.map +1 -1
  40. package/components/Input.Phone/Input.Phone.mjs.map +1 -1
  41. package/components/InputCheckbox/InputCheckbox.js.map +1 -1
  42. package/components/InputCheckbox/InputCheckbox.mjs.map +1 -1
  43. package/components/InputRadio/InputRadio.js.map +1 -1
  44. package/components/InputRadio/InputRadio.mjs.map +1 -1
  45. package/components/ListItem/ListItem.js.map +1 -1
  46. package/components/ListItem/ListItem.mjs.map +1 -1
  47. package/components/Menu/Menu.js.map +1 -1
  48. package/components/Menu/Menu.mjs.map +1 -1
  49. package/components/MenuComponent/MenuComponent.js.map +1 -1
  50. package/components/MenuComponent/MenuComponent.mjs.map +1 -1
  51. package/components/MenuContainer/MenuContainer.js.map +1 -1
  52. package/components/MenuContainer/MenuContainer.mjs.map +1 -1
  53. package/components/MenuDivider/MenuDivider.js.map +1 -1
  54. package/components/MenuDivider/MenuDivider.mjs.map +1 -1
  55. package/components/MenuList/MenuList.js.map +1 -1
  56. package/components/MenuList/MenuList.mjs.map +1 -1
  57. package/components/Modal/Modal.js.map +1 -1
  58. package/components/Modal/Modal.mjs.map +1 -1
  59. package/components/Notification/Notification.js.map +1 -1
  60. package/components/Notification/Notification.mjs.map +1 -1
  61. package/components/Paper/Paper.js.map +1 -1
  62. package/components/Paper/Paper.mjs.map +1 -1
  63. package/components/Progress/Progress.js.map +1 -1
  64. package/components/Progress/Progress.mjs.map +1 -1
  65. package/components/Progress.Circle/Progress.Circle.js.map +1 -1
  66. package/components/Progress.Circle/Progress.Circle.mjs.map +1 -1
  67. package/components/Progress.Segmented/Progress.Segmented.js.map +1 -1
  68. package/components/Progress.Segmented/Progress.Segmented.mjs.map +1 -1
  69. package/components/ProgressCircle/ProgressCircle.js.map +1 -1
  70. package/components/ProgressCircle/ProgressCircle.mjs.map +1 -1
  71. package/components/ProgressLine/ProgressLine.js.map +1 -1
  72. package/components/ProgressLine/ProgressLine.mjs.map +1 -1
  73. package/components/Radio/Radio.js.map +1 -1
  74. package/components/Radio/Radio.mjs.map +1 -1
  75. package/components/Section/Section.js.map +1 -1
  76. package/components/Section/Section.mjs.map +1 -1
  77. package/components/Separator/Separator.js.map +1 -1
  78. package/components/Separator/Separator.mjs.map +1 -1
  79. package/components/Skeleton/Skeleton.js.map +1 -1
  80. package/components/Skeleton/Skeleton.mjs.map +1 -1
  81. package/components/Spacer/Spacer.js.map +1 -1
  82. package/components/Spacer/Spacer.mjs.map +1 -1
  83. package/components/Spinner/Spinner.js.map +1 -1
  84. package/components/Spinner/Spinner.mjs.map +1 -1
  85. package/components/Switch/Switch.js.map +1 -1
  86. package/components/Switch/Switch.mjs.map +1 -1
  87. package/components/Tab/Tab.js.map +1 -1
  88. package/components/Tab/Tab.mjs.map +1 -1
  89. package/components/Tabs/Tabs.js.map +1 -1
  90. package/components/Tabs/Tabs.mjs.map +1 -1
  91. package/components/Tag/Tag.js.map +1 -1
  92. package/components/Tag/Tag.mjs.map +1 -1
  93. package/components/Text/Text.js.map +1 -1
  94. package/components/Text/Text.mjs.map +1 -1
  95. package/components/Text.Ellipse/Text.Ellipse.js.map +1 -1
  96. package/components/Text.Ellipse/Text.Ellipse.mjs.map +1 -1
  97. package/components/Textarea/Textarea.js.map +1 -1
  98. package/components/Textarea/Textarea.mjs.map +1 -1
  99. package/components/Tooltip/Tooltip.js.map +1 -1
  100. package/components/Tooltip/Tooltip.mjs.map +1 -1
  101. package/components/TooltipComponent/TooltipComponent.js.map +1 -1
  102. package/components/TooltipComponent/TooltipComponent.mjs.map +1 -1
  103. package/dts/index.d.ts +29 -165
  104. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ActionBtn.js","sources":["../../../../src/components/ActionBtn/ActionBtn.tsx"],"sourcesContent":["import type { DisplayProperty } from 'mixins/display'\nimport { useClassname } from 'hooks/useClassname'\nimport type { BaseProps } from 'shared/interfaces'\nimport { Icon } from 'components/Icon'\nimport type { IconName } from 'components/Icon'\nimport * as Styled from './style'\n\nexport interface ActionBtnProps extends BaseProps, DisplayProperty {\n /** Icon name (for inner Icon component) */\n icon?: IconName\n disabled?: boolean\n active?: boolean\n onClick?(): void\n /**\n * Children react node\n */\n children?: React.ReactNode\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Display`](#/Миксины)\n */\nfunction ActionBtn({ icon, disabled = false, onClick, children, className, active, style }: ActionBtnProps) {\n const _className = useClassname(ActionBtn.displayName, className)\n\n return (\n <Styled.Root className={_className} style={style} disabled={disabled} active={active} onClick={onClick}>\n {icon ? <Icon size={16} name={icon} /> : null}\n {children}\n </Styled.Root>\n )\n}\n\nActionBtn.displayName = 'ActionBtn'\n\nexport { ActionBtn }\n"],"names":["ActionBtn","icon","disabled","onClick","children","className","active","style","_className","useClassname","displayName","_jsxs","Styled","_jsx","jsx","Icon","size","name"],"mappings":"qLAwBA,SAASA,WAAUC,KAAEA,EAAIC,SAAEA,GAAW,EAAKC,QAAEA,EAAOC,SAAEA,EAAQC,UAAEA,EAASC,OAAEA,EAAQC,MAAAA,IACjF,MAAMC,EAAaC,aAAYA,aAACT,UAAUU,YAAaL,GAEvD,OACEM,WAAAA,KAACC,MAAAA,KAAW,CAACP,UAAWG,EAAYD,MAAOA,EAAOL,SAAUA,EAAUI,OAAQA,EAAQH,QAASA,EAAQC,SACpGH,CAAAA,EAAOY,WAAAC,IAACC,UAAI,CAACC,KAAM,GAAIC,KAAMhB,IAAW,KACxCG,IAGP,CAEAJ,UAAUU,YAAc"}
1
+ {"version":3,"file":"ActionBtn.js","sources":["../../../../src/components/ActionBtn/ActionBtn.tsx"],"sourcesContent":["import type { DisplayProperty } from 'mixins/display'\nimport { useClassname } from 'hooks/useClassname'\nimport type { BaseProps } from 'shared/interfaces'\nimport { Icon } from 'components/Icon'\nimport type { IconName } from 'components/Icon'\nimport * as Styled from './style'\n\nexport interface ActionBtnProps extends BaseProps, DisplayProperty {\n /** Icon name (for inner Icon component) */\n icon?: IconName\n disabled?: boolean\n active?: boolean\n onClick?(): void\n /**\n * Children react node\n */\n children?: React.ReactNode\n}\n\nfunction ActionBtn({ icon, disabled = false, onClick, children, className, active, style }: ActionBtnProps) {\n const _className = useClassname(ActionBtn.displayName, className)\n\n return (\n <Styled.Root className={_className} style={style} disabled={disabled} active={active} onClick={onClick}>\n {icon ? <Icon size={16} name={icon} /> : null}\n {children}\n </Styled.Root>\n )\n}\n\nActionBtn.displayName = 'ActionBtn'\n\nexport { ActionBtn }\n"],"names":["ActionBtn","icon","disabled","onClick","children","className","active","style","_className","useClassname","displayName","_jsxs","Styled","_jsx","jsx","Icon","size","name"],"mappings":"qLAmBA,SAASA,WAAUC,KAAEA,EAAIC,SAAEA,GAAW,EAAKC,QAAEA,EAAOC,SAAEA,EAAQC,UAAEA,EAASC,OAAEA,EAAQC,MAAAA,IACjF,MAAMC,EAAaC,aAAYA,aAACT,UAAUU,YAAaL,GAEvD,OACEM,WAAAA,KAACC,MAAAA,KAAW,CAACP,UAAWG,EAAYD,MAAOA,EAAOL,SAAUA,EAAUI,OAAQA,EAAQH,QAASA,EAAQC,SACpGH,CAAAA,EAAOY,WAAAC,IAACC,UAAI,CAACC,KAAM,GAAIC,KAAMhB,IAAW,KACxCG,IAGP,CAEAJ,UAAUU,YAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionBtn.mjs","sources":["../../../../src/components/ActionBtn/ActionBtn.tsx"],"sourcesContent":["import type { DisplayProperty } from 'mixins/display'\nimport { useClassname } from 'hooks/useClassname'\nimport type { BaseProps } from 'shared/interfaces'\nimport { Icon } from 'components/Icon'\nimport type { IconName } from 'components/Icon'\nimport * as Styled from './style'\n\nexport interface ActionBtnProps extends BaseProps, DisplayProperty {\n /** Icon name (for inner Icon component) */\n icon?: IconName\n disabled?: boolean\n active?: boolean\n onClick?(): void\n /**\n * Children react node\n */\n children?: React.ReactNode\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Display`](#/Миксины)\n */\nfunction ActionBtn({ icon, disabled = false, onClick, children, className, active, style }: ActionBtnProps) {\n const _className = useClassname(ActionBtn.displayName, className)\n\n return (\n <Styled.Root className={_className} style={style} disabled={disabled} active={active} onClick={onClick}>\n {icon ? <Icon size={16} name={icon} /> : null}\n {children}\n </Styled.Root>\n )\n}\n\nActionBtn.displayName = 'ActionBtn'\n\nexport { ActionBtn }\n"],"names":["ActionBtn","icon","disabled","onClick","children","className","active","style","_className","useClassname","displayName","_jsxs","Styled","_jsx","Icon","size","name"],"mappings":"gKAwBA,SAASA,WAAUC,KAAEA,EAAIC,SAAEA,GAAW,EAAKC,QAAEA,EAAOC,SAAEA,EAAQC,UAAEA,EAASC,OAAEA,EAAMC,MAAEA,IACjF,MAAMC,EAAaC,aAAaT,UAAUU,YAAaL,GAEvD,OACEM,KAACC,KAAW,CAACP,UAAWG,EAAYD,MAAOA,EAAOL,SAAUA,EAAUI,OAAQA,EAAQH,QAASA,EAAQC,SACpGH,CAAAA,EAAOY,IAACC,KAAI,CAACC,KAAM,GAAIC,KAAMf,IAAW,KACxCG,IAGP,CAEAJ,UAAUU,YAAc"}
1
+ {"version":3,"file":"ActionBtn.mjs","sources":["../../../../src/components/ActionBtn/ActionBtn.tsx"],"sourcesContent":["import type { DisplayProperty } from 'mixins/display'\nimport { useClassname } from 'hooks/useClassname'\nimport type { BaseProps } from 'shared/interfaces'\nimport { Icon } from 'components/Icon'\nimport type { IconName } from 'components/Icon'\nimport * as Styled from './style'\n\nexport interface ActionBtnProps extends BaseProps, DisplayProperty {\n /** Icon name (for inner Icon component) */\n icon?: IconName\n disabled?: boolean\n active?: boolean\n onClick?(): void\n /**\n * Children react node\n */\n children?: React.ReactNode\n}\n\nfunction ActionBtn({ icon, disabled = false, onClick, children, className, active, style }: ActionBtnProps) {\n const _className = useClassname(ActionBtn.displayName, className)\n\n return (\n <Styled.Root className={_className} style={style} disabled={disabled} active={active} onClick={onClick}>\n {icon ? <Icon size={16} name={icon} /> : null}\n {children}\n </Styled.Root>\n )\n}\n\nActionBtn.displayName = 'ActionBtn'\n\nexport { ActionBtn }\n"],"names":["ActionBtn","icon","disabled","onClick","children","className","active","style","_className","useClassname","displayName","_jsxs","Styled","_jsx","Icon","size","name"],"mappings":"gKAmBA,SAASA,WAAUC,KAAEA,EAAIC,SAAEA,GAAW,EAAKC,QAAEA,EAAOC,SAAEA,EAAQC,UAAEA,EAASC,OAAEA,EAAMC,MAAEA,IACjF,MAAMC,EAAaC,aAAaT,UAAUU,YAAaL,GAEvD,OACEM,KAACC,KAAW,CAACP,UAAWG,EAAYD,MAAOA,EAAOL,SAAUA,EAAUI,OAAQA,EAAQH,QAASA,EAAQC,SACpGH,CAAAA,EAAOY,IAACC,KAAI,CAACC,KAAM,GAAIC,KAAMf,IAAW,KACxCG,IAGP,CAEAJ,UAAUU,YAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Amount.js","sources":["../../../../src/components/Amount/Amount.tsx"],"sourcesContent":["import { PureComponent } from 'react'\nimport { Text } from 'components/Text'\nimport type { TextProps } from 'components/Text'\nimport { concatClassNames } from 'shared/utils/dom'\nimport { CURRENCY_MAP } from './data'\nimport type { CurrencyCodes } from './data'\nimport * as Styled from './style'\n\nexport interface AmountProps extends TextProps {\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 | string\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 getCurrencySymbol(currencyCode: keyof typeof CurrencyCodes | string) {\n return CURRENCY_MAP[currencyCode as keyof typeof CurrencyCodes] || currencyCode\n}\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 digitsAfterPoint: AmountProps['digitsAfterPoint'],\n currencyCode: AmountProps['currency'],\n value: AmountProps['value'] = 0\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 ? getCurrencySymbol(currencyCode) : '',\n }\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`ResponsiveNamedProperty<'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 = getCurrencySymbol\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(digitsAfterPoint, currency, value)\n\n const classNames = concatClassNames('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 : null}\n {majorPart}\n </span>\n {this.renderMinorPart(minorPart)}\n </>\n ) : null}\n {currency ? this.renderCurrencySymbol(currencySymbol) : null}\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","getCurrencySymbol","currencyCode","CURRENCY_MAP","Amount","PureComponent","static","isHeader","showZeroMinorPart","crossedOut","digitsAfterPoint","separator","onlyCurrency","renderMinorPart","minorPart","this","props","needMinorPart","test","_jsxs","className","children","_jsx","jsx","renderCurrencySymbol","currencySymbol","jsxs","style","position","currency","width","opacity","visibility","render","value","rest","majorPart","isNegative","numberParts","Math","abs","toFixed","split","majorPartFormatted","parts","str","length","from","slice","concat","createSplitter","amountSplitter","reverse","join","formatAmount","classNames","concatClassNames","amountInner","Styled","_Fragment","Text","Heading","as"],"mappings":"0OA4CA,MAAMA,uBAAyB,OAG/B,SAASC,kBAAkBC,GACzB,OAAOC,MAAYA,aAACD,IAA+CA,CACrE,gBAsDO,MAAME,eAAeC,MAAAA,cAC1BC,mBAAqB,SACrBA,oBAAsB,CACpBC,UAAU,EACVC,mBAAmB,EACnBC,YAAY,EACZC,iBAAkB,EAClBC,UAAW,IACXC,cAAc,GAGhBN,yBAA2BL,kBAE3BY,eAAAA,CAAgBC,GACd,MAAMN,kBAAEA,EAAiBG,UAAEA,GAAcI,KAAKC,MAE9C,IAAIC,GAAgB,EAUpB,OARIH,IACFG,GAAgB,GAEXT,GAAqBR,uBAAuBkB,KAAKJ,KACpDG,GAAgB,IAIhBA,EAEAE,WAAAA,KAAA,OAAA,CAAMC,UAAU,kBAAiBC,UAC/BC,WAAAC,IAAA,OAAA,CAAMH,UAAU,YAAWC,SAAEV,IAC7BW,WAAAC,IAAA,OAAA,CAAMH,UAAU,QAAOC,SAAEP,OAKxB,IACT,CAEAU,qBAAwBC,GACtBN,WAAAO,KAAA,OAAA,CAAMC,MAAO,CAAEC,SAAU,YAAaP,SAAA,CACnCN,KAAKC,MAAMa,WAAa,MACvBP,WAAAC,IAAA,OAAA,CACEI,MAAO,CACLC,SAAU,WACVE,MAAO,EACPC,QAAS,EACTC,WAAY,UACZX,SACH,SAGC,KACJC,WAAAC,IAAA,OAAA,CAAAF,SAAO,IAAII,SAIfQ,MAAAA,GACE,MAAMC,MAAEA,EAAKxB,iBAAEA,EAAgBmB,SAAEA,EAAQtB,SAAEA,EAAQa,UAAEA,QAAWO,EAAKlB,WAAEA,EAAUG,aAAEA,KAAiBuB,GAClGpB,KAAKC,MAEP,MAAMoB,UAAEA,EAAStB,UAAEA,EAASuB,WAAEA,EAAUZ,eAAEA,GA/F9C,EACEf,EACAR,EACAgC,EAA8B,KAE9B,MAAMG,EAAaH,EAAQ,EAK3B,MAAMI,EAHWC,KAAKC,IAAIN,GACGO,QAAQ/B,GAELgC,MAAM,KACtC,MAAMN,EAAYE,EAAY,GAC9B,MAAMxB,EAAYwB,EAAY,GAI9B,MAAMK,EAjCR,MACE,MAAMC,MAASC,IACb,MAAMC,OAAEA,GAAWD,EAEnB,GAAIC,GAZuB,EAazB,MAAO,CAACD,GAGV,MAAME,EAAOD,EAhBc,EAmB3B,MAAO,CAACD,EAAIG,MAAMD,EAFPD,IAEkBG,OAAOL,MAAMC,EAAIG,MAAM,EAAGD,IAAO,EAGhE,OAAOH,KACT,EAgByBM,EAEIC,CAAef,GAAWgB,UAAUC,KAAK,KAIpE,MAAO,CACLjB,UAAWO,EACX7B,YACAoB,MALwBS,GAAsB7B,EAAY,IAAIA,IAAc,IAM5EuB,aACAZ,eAAgBvB,EAAeD,kBAAkBC,GAAgB,GAErE,EAoEiEoD,CAAa5C,EAAkBmB,EAAUK,GAEtG,MAAMqB,EAAaC,IAAAA,iBAAiB,SAAUpC,GAE9C,MAAMqC,EACJtC,WAAAO,KAACgC,WAAW,CAACtC,UAAWmC,EAAY5B,MAAOA,EAAOlB,WAAYA,EAAWY,UACrET,EAQE,KAPFO,WAAAA,KAAAwC,WAAAA,SAAA,CAAAtC,UACEF,WAAAO,KAAA,OAAA,CAAMN,UAAU,QAAOC,UACpBgB,EA/Hc,IA+HsB,KACpCD,KAEFrB,KAAKF,gBAAgBC,MAGzBe,EAAWd,KAAKS,qBAAqBC,GAAkB,QAM5D,OACEH,WAAAA,IAHcf,EAAWqD,UAAKC,QAAUD,KAAAA,KAGhC,IAAKzB,EAAM2B,GAAG,OAAMzC,SACzBoC,GAGP"}
1
+ {"version":3,"file":"Amount.js","sources":["../../../../src/components/Amount/Amount.tsx"],"sourcesContent":["import { PureComponent } from 'react'\nimport { Text } from 'components/Text'\nimport type { TextProps } from 'components/Text'\nimport { concatClassNames } from 'shared/utils/dom'\nimport { CURRENCY_MAP } from './data'\nimport type { CurrencyCodes } from './data'\nimport * as Styled from './style'\n\nexport interface AmountProps extends TextProps {\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 | string\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 getCurrencySymbol(currencyCode: keyof typeof CurrencyCodes | string) {\n return CURRENCY_MAP[currencyCode as keyof typeof CurrencyCodes] || currencyCode\n}\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 digitsAfterPoint: AmountProps['digitsAfterPoint'],\n currencyCode: AmountProps['currency'],\n value: AmountProps['value'] = 0\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 ? getCurrencySymbol(currencyCode) : '',\n }\n}\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 = getCurrencySymbol\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(digitsAfterPoint, currency, value)\n\n const classNames = concatClassNames('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 : null}\n {majorPart}\n </span>\n {this.renderMinorPart(minorPart)}\n </>\n ) : null}\n {currency ? this.renderCurrencySymbol(currencySymbol) : null}\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","getCurrencySymbol","currencyCode","CURRENCY_MAP","Amount","PureComponent","static","isHeader","showZeroMinorPart","crossedOut","digitsAfterPoint","separator","onlyCurrency","renderMinorPart","minorPart","this","props","needMinorPart","test","_jsxs","className","children","_jsx","jsx","renderCurrencySymbol","currencySymbol","jsxs","style","position","currency","width","opacity","visibility","render","value","rest","majorPart","isNegative","numberParts","Math","abs","toFixed","split","majorPartFormatted","parts","str","length","from","slice","concat","createSplitter","amountSplitter","reverse","join","formatAmount","classNames","concatClassNames","amountInner","Styled","_Fragment","Text","Heading","as"],"mappings":"0OA4CA,MAAMA,uBAAyB,OAG/B,SAASC,kBAAkBC,GACzB,OAAOC,MAAYA,aAACD,IAA+CA,CACrE,gBAgDO,MAAME,eAAeC,MAAAA,cAC1BC,mBAAqB,SACrBA,oBAAsB,CACpBC,UAAU,EACVC,mBAAmB,EACnBC,YAAY,EACZC,iBAAkB,EAClBC,UAAW,IACXC,cAAc,GAGhBN,yBAA2BL,kBAE3BY,eAAAA,CAAgBC,GACd,MAAMN,kBAAEA,EAAiBG,UAAEA,GAAcI,KAAKC,MAE9C,IAAIC,GAAgB,EAUpB,OARIH,IACFG,GAAgB,GAEXT,GAAqBR,uBAAuBkB,KAAKJ,KACpDG,GAAgB,IAIhBA,EAEAE,WAAAA,KAAA,OAAA,CAAMC,UAAU,kBAAiBC,UAC/BC,WAAAC,IAAA,OAAA,CAAMH,UAAU,YAAWC,SAAEV,IAC7BW,WAAAC,IAAA,OAAA,CAAMH,UAAU,QAAOC,SAAEP,OAKxB,IACT,CAEAU,qBAAwBC,GACtBN,WAAAO,KAAA,OAAA,CAAMC,MAAO,CAAEC,SAAU,YAAaP,SAAA,CACnCN,KAAKC,MAAMa,WAAa,MACvBP,WAAAC,IAAA,OAAA,CACEI,MAAO,CACLC,SAAU,WACVE,MAAO,EACPC,QAAS,EACTC,WAAY,UACZX,SACH,SAGC,KACJC,WAAAC,IAAA,OAAA,CAAAF,SAAO,IAAII,SAIfQ,MAAAA,GACE,MAAMC,MAAEA,EAAKxB,iBAAEA,EAAgBmB,SAAEA,EAAQtB,SAAEA,EAAQa,UAAEA,QAAWO,EAAKlB,WAAEA,EAAUG,aAAEA,KAAiBuB,GAClGpB,KAAKC,MAEP,MAAMoB,UAAEA,EAAStB,UAAEA,EAASuB,WAAEA,EAAUZ,eAAEA,GAzF9C,EACEf,EACAR,EACAgC,EAA8B,KAE9B,MAAMG,EAAaH,EAAQ,EAK3B,MAAMI,EAHWC,KAAKC,IAAIN,GACGO,QAAQ/B,GAELgC,MAAM,KACtC,MAAMN,EAAYE,EAAY,GAC9B,MAAMxB,EAAYwB,EAAY,GAI9B,MAAMK,EAjCR,MACE,MAAMC,MAASC,IACb,MAAMC,OAAEA,GAAWD,EAEnB,GAAIC,GAZuB,EAazB,MAAO,CAACD,GAGV,MAAME,EAAOD,EAhBc,EAmB3B,MAAO,CAACD,EAAIG,MAAMD,EAFPD,IAEkBG,OAAOL,MAAMC,EAAIG,MAAM,EAAGD,IAAO,EAGhE,OAAOH,KACT,EAgByBM,EAEIC,CAAef,GAAWgB,UAAUC,KAAK,KAIpE,MAAO,CACLjB,UAAWO,EACX7B,YACAoB,MALwBS,GAAsB7B,EAAY,IAAIA,IAAc,IAM5EuB,aACAZ,eAAgBvB,EAAeD,kBAAkBC,GAAgB,GAErE,EA8DiEoD,CAAa5C,EAAkBmB,EAAUK,GAEtG,MAAMqB,EAAaC,IAAAA,iBAAiB,SAAUpC,GAE9C,MAAMqC,EACJtC,WAAAO,KAACgC,WAAW,CAACtC,UAAWmC,EAAY5B,MAAOA,EAAOlB,WAAYA,EAAWY,UACrET,EAQE,KAPFO,WAAAA,KAAAwC,WAAAA,SAAA,CAAAtC,UACEF,WAAAO,KAAA,OAAA,CAAMN,UAAU,QAAOC,UACpBgB,EAzHc,IAyHsB,KACpCD,KAEFrB,KAAKF,gBAAgBC,MAGzBe,EAAWd,KAAKS,qBAAqBC,GAAkB,QAM5D,OACEH,WAAAA,IAHcf,EAAWqD,UAAKC,QAAUD,KAAAA,KAGhC,IAAKzB,EAAM2B,GAAG,OAAMzC,SACzBoC,GAGP"}
@@ -1 +1 @@
1
- {"version":3,"file":"Amount.mjs","sources":["../../../../src/components/Amount/Amount.tsx"],"sourcesContent":["import { PureComponent } from 'react'\nimport { Text } from 'components/Text'\nimport type { TextProps } from 'components/Text'\nimport { concatClassNames } from 'shared/utils/dom'\nimport { CURRENCY_MAP } from './data'\nimport type { CurrencyCodes } from './data'\nimport * as Styled from './style'\n\nexport interface AmountProps extends TextProps {\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 | string\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 getCurrencySymbol(currencyCode: keyof typeof CurrencyCodes | string) {\n return CURRENCY_MAP[currencyCode as keyof typeof CurrencyCodes] || currencyCode\n}\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 digitsAfterPoint: AmountProps['digitsAfterPoint'],\n currencyCode: AmountProps['currency'],\n value: AmountProps['value'] = 0\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 ? getCurrencySymbol(currencyCode) : '',\n }\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`ResponsiveNamedProperty<'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 = getCurrencySymbol\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(digitsAfterPoint, currency, value)\n\n const classNames = concatClassNames('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 : null}\n {majorPart}\n </span>\n {this.renderMinorPart(minorPart)}\n </>\n ) : null}\n {currency ? this.renderCurrencySymbol(currencySymbol) : null}\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","getCurrencySymbol","currencyCode","CURRENCY_MAP","Amount","PureComponent","static","isHeader","showZeroMinorPart","crossedOut","digitsAfterPoint","separator","onlyCurrency","renderMinorPart","minorPart","this","props","needMinorPart","test","_jsxs","className","children","_jsx","renderCurrencySymbol","currencySymbol","style","position","currency","width","opacity","visibility","render","value","rest","majorPart","isNegative","numberParts","Math","abs","toFixed","split","majorPartFormatted","parts","str","length","from","slice","concat","createSplitter","amountSplitter","reverse","join","formatAmount","classNames","concatClassNames","amountInner","Styled","_Fragment","Text","Heading","as"],"mappings":"uPA4CA,MAAMA,uBAAyB,OAG/B,SAASC,kBAAkBC,GACzB,OAAOC,aAAaD,IAA+CA,CACrE,CAsDO,MAAME,eAAeC,cAC1BC,mBAAqB,SACrBA,oBAAsB,CACpBC,UAAU,EACVC,mBAAmB,EACnBC,YAAY,EACZC,iBAAkB,EAClBC,UAAW,IACXC,cAAc,GAGhBN,yBAA2BL,kBAE3BY,eAAAA,CAAgBC,GACd,MAAMN,kBAAEA,EAAiBG,UAAEA,GAAcI,KAAKC,MAE9C,IAAIC,GAAgB,EAUpB,OARIH,IACFG,GAAgB,GAEXT,GAAqBR,uBAAuBkB,KAAKJ,KACpDG,GAAgB,IAIhBA,EAEAE,KAAA,OAAA,CAAMC,UAAU,kBAAiBC,UAC/BC,IAAA,OAAA,CAAMF,UAAU,YAAWC,SAAEV,IAC7BW,IAAA,OAAA,CAAMF,UAAU,QAAOC,SAAEP,OAKxB,IACT,CAEAS,qBAAwBC,GACtBL,KAAA,OAAA,CAAMM,MAAO,CAAEC,SAAU,YAAaL,SAAA,CACnCN,KAAKC,MAAMW,WAAa,MACvBL,IAAA,OAAA,CACEG,MAAO,CACLC,SAAU,WACVE,MAAO,EACPC,QAAS,EACTC,WAAY,UACZT,SACH,SAGC,KACJC,IAAA,OAAA,CAAAD,SAAO,IAAIG,SAIfO,MAAAA,GACE,MAAMC,MAAEA,EAAKtB,iBAAEA,EAAgBiB,SAAEA,EAAQpB,SAAEA,EAAQa,UAAEA,EAASK,MAAEA,EAAKhB,WAAEA,EAAUG,aAAEA,KAAiBqB,GAClGlB,KAAKC,MAEP,MAAMkB,UAAEA,EAASpB,UAAEA,EAASqB,WAAEA,EAAUX,eAAEA,GA/F9C,EACEd,EACAR,EACA8B,EAA8B,KAE9B,MAAMG,EAAaH,EAAQ,EAK3B,MAAMI,EAHWC,KAAKC,IAAIN,GACGO,QAAQ7B,GAEL8B,MAAM,KACtC,MAAMN,EAAYE,EAAY,GAC9B,MAAMtB,EAAYsB,EAAY,GAI9B,MAAMK,EAjCR,MACE,MAAMC,MAASC,IACb,MAAMC,OAAEA,GAAWD,EAEnB,GAAIC,GAZuB,EAazB,MAAO,CAACD,GAGV,MAAME,EAAOD,EAhBc,EAmB3B,MAAO,CAACD,EAAIG,MAAMD,EAFPD,IAEkBG,OAAOL,MAAMC,EAAIG,MAAM,EAAGD,IAAO,EAGhE,OAAOH,KACT,EAgByBM,EAEIC,CAAef,GAAWgB,UAAUC,KAAK,KAIpE,MAAO,CACLjB,UAAWO,EACX3B,YACAkB,MALwBS,GAAsB3B,EAAY,IAAIA,IAAc,IAM5EqB,aACAX,eAAgBtB,EAAeD,kBAAkBC,GAAgB,GAErE,EAoEiEkD,CAAa1C,EAAkBiB,EAAUK,GAEtG,MAAMqB,EAAaC,iBAAiB,SAAUlC,GAE9C,MAAMmC,EACJpC,KAACqC,KAAW,CAACpC,UAAWiC,EAAY5B,MAAOA,EAAOhB,WAAYA,EAAWY,UACrET,EAQE,KAPFO,KAAAsC,SAAA,CAAApC,UACEF,KAAA,OAAA,CAAMC,UAAU,QAAOC,UACpBc,EA/Hc,IA+HsB,KACpCD,KAEFnB,KAAKF,gBAAgBC,MAGzBa,EAAWZ,KAAKQ,qBAAqBC,GAAkB,QAM5D,OACEF,IAHcf,EAAWmD,KAAKC,QAAUD,KAGhC,IAAKzB,EAAM2B,GAAG,OAAMvC,SACzBkC,GAGP"}
1
+ {"version":3,"file":"Amount.mjs","sources":["../../../../src/components/Amount/Amount.tsx"],"sourcesContent":["import { PureComponent } from 'react'\nimport { Text } from 'components/Text'\nimport type { TextProps } from 'components/Text'\nimport { concatClassNames } from 'shared/utils/dom'\nimport { CURRENCY_MAP } from './data'\nimport type { CurrencyCodes } from './data'\nimport * as Styled from './style'\n\nexport interface AmountProps extends TextProps {\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 | string\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 getCurrencySymbol(currencyCode: keyof typeof CurrencyCodes | string) {\n return CURRENCY_MAP[currencyCode as keyof typeof CurrencyCodes] || currencyCode\n}\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 digitsAfterPoint: AmountProps['digitsAfterPoint'],\n currencyCode: AmountProps['currency'],\n value: AmountProps['value'] = 0\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 ? getCurrencySymbol(currencyCode) : '',\n }\n}\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 = getCurrencySymbol\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(digitsAfterPoint, currency, value)\n\n const classNames = concatClassNames('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 : null}\n {majorPart}\n </span>\n {this.renderMinorPart(minorPart)}\n </>\n ) : null}\n {currency ? this.renderCurrencySymbol(currencySymbol) : null}\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","getCurrencySymbol","currencyCode","CURRENCY_MAP","Amount","PureComponent","static","isHeader","showZeroMinorPart","crossedOut","digitsAfterPoint","separator","onlyCurrency","renderMinorPart","minorPart","this","props","needMinorPart","test","_jsxs","className","children","_jsx","renderCurrencySymbol","currencySymbol","style","position","currency","width","opacity","visibility","render","value","rest","majorPart","isNegative","numberParts","Math","abs","toFixed","split","majorPartFormatted","parts","str","length","from","slice","concat","createSplitter","amountSplitter","reverse","join","formatAmount","classNames","concatClassNames","amountInner","Styled","_Fragment","Text","Heading","as"],"mappings":"uPA4CA,MAAMA,uBAAyB,OAG/B,SAASC,kBAAkBC,GACzB,OAAOC,aAAaD,IAA+CA,CACrE,CAgDO,MAAME,eAAeC,cAC1BC,mBAAqB,SACrBA,oBAAsB,CACpBC,UAAU,EACVC,mBAAmB,EACnBC,YAAY,EACZC,iBAAkB,EAClBC,UAAW,IACXC,cAAc,GAGhBN,yBAA2BL,kBAE3BY,eAAAA,CAAgBC,GACd,MAAMN,kBAAEA,EAAiBG,UAAEA,GAAcI,KAAKC,MAE9C,IAAIC,GAAgB,EAUpB,OARIH,IACFG,GAAgB,GAEXT,GAAqBR,uBAAuBkB,KAAKJ,KACpDG,GAAgB,IAIhBA,EAEAE,KAAA,OAAA,CAAMC,UAAU,kBAAiBC,UAC/BC,IAAA,OAAA,CAAMF,UAAU,YAAWC,SAAEV,IAC7BW,IAAA,OAAA,CAAMF,UAAU,QAAOC,SAAEP,OAKxB,IACT,CAEAS,qBAAwBC,GACtBL,KAAA,OAAA,CAAMM,MAAO,CAAEC,SAAU,YAAaL,SAAA,CACnCN,KAAKC,MAAMW,WAAa,MACvBL,IAAA,OAAA,CACEG,MAAO,CACLC,SAAU,WACVE,MAAO,EACPC,QAAS,EACTC,WAAY,UACZT,SACH,SAGC,KACJC,IAAA,OAAA,CAAAD,SAAO,IAAIG,SAIfO,MAAAA,GACE,MAAMC,MAAEA,EAAKtB,iBAAEA,EAAgBiB,SAAEA,EAAQpB,SAAEA,EAAQa,UAAEA,EAASK,MAAEA,EAAKhB,WAAEA,EAAUG,aAAEA,KAAiBqB,GAClGlB,KAAKC,MAEP,MAAMkB,UAAEA,EAASpB,UAAEA,EAASqB,WAAEA,EAAUX,eAAEA,GAzF9C,EACEd,EACAR,EACA8B,EAA8B,KAE9B,MAAMG,EAAaH,EAAQ,EAK3B,MAAMI,EAHWC,KAAKC,IAAIN,GACGO,QAAQ7B,GAEL8B,MAAM,KACtC,MAAMN,EAAYE,EAAY,GAC9B,MAAMtB,EAAYsB,EAAY,GAI9B,MAAMK,EAjCR,MACE,MAAMC,MAASC,IACb,MAAMC,OAAEA,GAAWD,EAEnB,GAAIC,GAZuB,EAazB,MAAO,CAACD,GAGV,MAAME,EAAOD,EAhBc,EAmB3B,MAAO,CAACD,EAAIG,MAAMD,EAFPD,IAEkBG,OAAOL,MAAMC,EAAIG,MAAM,EAAGD,IAAO,EAGhE,OAAOH,KACT,EAgByBM,EAEIC,CAAef,GAAWgB,UAAUC,KAAK,KAIpE,MAAO,CACLjB,UAAWO,EACX3B,YACAkB,MALwBS,GAAsB3B,EAAY,IAAIA,IAAc,IAM5EqB,aACAX,eAAgBtB,EAAeD,kBAAkBC,GAAgB,GAErE,EA8DiEkD,CAAa1C,EAAkBiB,EAAUK,GAEtG,MAAMqB,EAAaC,iBAAiB,SAAUlC,GAE9C,MAAMmC,EACJpC,KAACqC,KAAW,CAACpC,UAAWiC,EAAY5B,MAAOA,EAAOhB,WAAYA,EAAWY,UACrET,EAQE,KAPFO,KAAAsC,SAAA,CAAApC,UACEF,KAAA,OAAA,CAAMC,UAAU,QAAOC,UACpBc,EAzHc,IAyHsB,KACpCD,KAEFnB,KAAKF,gBAAgBC,MAGzBa,EAAWZ,KAAKQ,qBAAqBC,GAAkB,QAM5D,OACEF,IAHcf,EAAWmD,KAAKC,QAAUD,KAGhC,IAAKzB,EAAM2B,GAAG,OAAMvC,SACzBkC,GAGP"}
@@ -1 +1 @@
1
- {"version":3,"file":"Anchor.js","sources":["../../../../src/components/Anchor/Anchor.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { useTheme } from 'styled-components'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { useClassname } from 'hooks/useClassname'\nimport { Icon } from 'components/Icon'\nimport { Text } from 'components/Text'\nimport type { TextProps } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { AnchorProps } from './types'\n\nconst COMPONENT_NAME = 'Anchor'\n\n/**\n *\n * Component accepts all \\<a\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [AnchorProps](https://github.com/foxford/ui/blob/master/src/components/Anchor/types.ts)\n */\nconst Anchor: React.ForwardRefExoticComponent<AnchorProps> = withMergedProps<AnchorProps, HTMLAnchorElement>(\n forwardRef<HTMLAnchorElement, MergedProps<AnchorProps>>((props, ref) => {\n const {\n size = 'inherit',\n autoRel = true,\n textProps = {},\n iconProps = {},\n icon,\n children,\n content,\n ...restProps\n } = props\n\n const theme = useTheme()\n\n const className = useClassname(COMPONENT_NAME, restProps.className)\n const relBuilder = theme.utils?.relBuilder\n const href = restProps.href ?? restProps.to\n\n const rel =\n restProps.rel ??\n (autoRel && relBuilder && typeof href === 'string' ? relBuilder(href, restProps.target) : undefined)\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n underline: restProps.underline,\n marginLeft: before ? '0.20em' : undefined,\n marginRight: after ? '0.20em' : undefined,\n }\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n let rootNode\n if (restProps.to) rootNode = theme.link\n if (restProps.pseudo) rootNode = 'div'\n if (restProps.disabled) rootNode = 'span'\n if (restProps.as) rootNode = restProps.as\n\n return (\n <Styled.Root\n {...restProps}\n ref={ref}\n as={rootNode}\n className={className}\n size={size}\n rel={rel}\n data-disabled={restProps.disabled}\n >\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps, iconBaseProps, iconProps, icon })\n ) : restProps.preset === 'brand' ? (\n <>\n {before ? (\n <Icon\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n <Text {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n {after ? (\n <Icon\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n ) : (\n children || content\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Anchor, COMPONENT_NAME }\n"],"names":["Anchor","withMergedProps","forwardRef","props","ref","size","autoRel","textProps","iconProps","icon","children","content","restProps","theme","useTheme","className","useClassname","relBuilder","utils","href","to","rel","target","undefined","before","after","Array","isArray","baseTextProps","as","color","underline","marginLeft","marginRight","iconBaseProps","rootNode","link","pseudo","disabled","_jsx","Styled","preset","_jsxs","_Fragment","jsx","Icon","name","Text","displayName","sizes","SIZES"],"mappings":"iYAyBMA,MAAAA,OAAuDC,gBAAAA,gBAC3DC,MAAAA,YAAwD,CAACC,EAAOC,KAC9D,MAAMC,KACJA,EAAO,UAASC,QAChBA,GAAU,EAAIC,UACdA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EAAAC,KACdA,EAAIC,SACJA,EAAQC,QACRA,KACGC,GACDT,EAEJ,MAAMU,EAAQC,OAAAA,WAEd,MAAMC,EAAYC,aAAYA,aA3BX,SA2B4BJ,EAAUG,WACzD,MAAME,EAAaJ,EAAMK,OAAOD,WAChC,MAAME,EAAOP,EAAUO,MAAQP,EAAUQ,GAEzC,MAAMC,EACJT,EAAUS,MACTf,GAAWW,UAAqBE,GAAS,SAAWF,EAAWE,EAAMP,EAAUU,aAAUC,GAE5F,MAAOC,EAAQC,GAASC,MAAMC,QAAQlB,GAAQA,EAAO,CAACA,GAEtD,MAAMmB,EAA2B,CAC/BC,GAAI,OACJxB,KAAM,UACNyB,MAAO,UACPC,UAAWnB,EAAUmB,UACrBC,WAAYR,EAAS,cAAWD,EAChCU,YAAaR,EAAQ,cAAWF,GAGlC,MAAMW,EAA2B,CAAEL,GAAI,OAAQC,MAAO,WAEtD,IAAIK,EAMJ,OALIvB,EAAUQ,KAAIe,EAAWtB,EAAMuB,MAC/BxB,EAAUyB,SAAQF,EAAW,OAC7BvB,EAAU0B,WAAUH,EAAW,QAC/BvB,EAAUiB,KAAIM,EAAWvB,EAAUiB,IAGrCU,WAAAA,IAACC,MAAAA,KAAW,IACN5B,EACJR,IAAKA,EACLyB,GAAIM,EACJpB,UAAWA,EACXV,KAAMA,EACNgB,IAAKA,EACL,gBAAeT,EAAU0B,SAAS5B,gBAE1BA,GAAa,WACnBA,EAAS,CAAEkB,gBAAerB,YAAW2B,gBAAe1B,YAAWC,SAC7DG,EAAU6B,SAAW,QACvBC,WAAAA,KAAAC,WAAAA,SAAA,CAAAjC,SACGc,CAAAA,EACCe,WAAAK,IAACC,UAAI,CACHC,YAAatB,GAAW,SAAWA,OAASD,EAC5Cd,YAAae,GAAW,SAAWA,OAASD,KACxCW,KACA1B,IAEJ,KACJ+B,WAAAK,IAACG,UAAI,IAAKnB,KAAmBrB,EAASG,SACnCA,GAAYC,IAEdc,EACCc,WAAAK,IAACC,UAAI,CACHC,YAAarB,GAAU,SAAWA,OAAQF,EAC1Cd,YAAagB,GAAU,SAAWA,OAAQF,KACtCW,KACA1B,IAEJ,QAGNE,GAAYC,GAEF,IAGlB,CACEqC,YA/FmB,SAgGnBC,MAAOC,UAAAA,qDAhGY"}
1
+ {"version":3,"file":"Anchor.js","sources":["../../../../src/components/Anchor/Anchor.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { useTheme } from 'styled-components'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { useClassname } from 'hooks/useClassname'\nimport { Icon } from 'components/Icon'\nimport { Text } from 'components/Text'\nimport type { TextProps } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { AnchorProps } from './types'\n\nconst COMPONENT_NAME = 'Anchor'\n\n/**\n *\n * Component accepts all \\<a\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [AnchorProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/Anchor/types.ts)\n */\nconst Anchor: React.ForwardRefExoticComponent<AnchorProps> = withMergedProps<AnchorProps, HTMLAnchorElement>(\n forwardRef<HTMLAnchorElement, MergedProps<AnchorProps>>((props, ref) => {\n const {\n size = 'inherit',\n autoRel = true,\n textProps = {},\n iconProps = {},\n icon,\n children,\n content,\n ...restProps\n } = props\n\n const theme = useTheme()\n\n const className = useClassname(COMPONENT_NAME, restProps.className)\n const relBuilder = theme.utils?.relBuilder\n const href = restProps.href ?? restProps.to\n\n const rel =\n restProps.rel ??\n (autoRel && relBuilder && typeof href === 'string' ? relBuilder(href, restProps.target) : undefined)\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n underline: restProps.underline,\n marginLeft: before ? '0.20em' : undefined,\n marginRight: after ? '0.20em' : undefined,\n }\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n let rootNode\n if (restProps.to) rootNode = theme.link\n if (restProps.pseudo) rootNode = 'div'\n if (restProps.disabled) rootNode = 'span'\n if (restProps.as) rootNode = restProps.as\n\n return (\n <Styled.Root\n {...restProps}\n ref={ref}\n as={rootNode}\n className={className}\n size={size}\n rel={rel}\n data-disabled={restProps.disabled}\n >\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps, iconBaseProps, iconProps, icon })\n ) : restProps.preset === 'brand' ? (\n <>\n {before ? (\n <Icon\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n <Text {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n {after ? (\n <Icon\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n ) : (\n children || content\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Anchor, COMPONENT_NAME }\n"],"names":["Anchor","withMergedProps","forwardRef","props","ref","size","autoRel","textProps","iconProps","icon","children","content","restProps","theme","useTheme","className","useClassname","relBuilder","utils","href","to","rel","target","undefined","before","after","Array","isArray","baseTextProps","as","color","underline","marginLeft","marginRight","iconBaseProps","rootNode","link","pseudo","disabled","_jsx","Styled","preset","_jsxs","_Fragment","jsx","Icon","name","Text","displayName","sizes","SIZES"],"mappings":"iYAyBMA,MAAAA,OAAuDC,gBAAAA,gBAC3DC,MAAAA,YAAwD,CAACC,EAAOC,KAC9D,MAAMC,KACJA,EAAO,UAASC,QAChBA,GAAU,EAAIC,UACdA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EAAAC,KACdA,EAAIC,SACJA,EAAQC,QACRA,KACGC,GACDT,EAEJ,MAAMU,EAAQC,OAAAA,WAEd,MAAMC,EAAYC,aAAYA,aA3BX,SA2B4BJ,EAAUG,WACzD,MAAME,EAAaJ,EAAMK,OAAOD,WAChC,MAAME,EAAOP,EAAUO,MAAQP,EAAUQ,GAEzC,MAAMC,EACJT,EAAUS,MACTf,GAAWW,UAAqBE,GAAS,SAAWF,EAAWE,EAAMP,EAAUU,aAAUC,GAE5F,MAAOC,EAAQC,GAASC,MAAMC,QAAQlB,GAAQA,EAAO,CAACA,GAEtD,MAAMmB,EAA2B,CAC/BC,GAAI,OACJxB,KAAM,UACNyB,MAAO,UACPC,UAAWnB,EAAUmB,UACrBC,WAAYR,EAAS,cAAWD,EAChCU,YAAaR,EAAQ,cAAWF,GAGlC,MAAMW,EAA2B,CAAEL,GAAI,OAAQC,MAAO,WAEtD,IAAIK,EAMJ,OALIvB,EAAUQ,KAAIe,EAAWtB,EAAMuB,MAC/BxB,EAAUyB,SAAQF,EAAW,OAC7BvB,EAAU0B,WAAUH,EAAW,QAC/BvB,EAAUiB,KAAIM,EAAWvB,EAAUiB,IAGrCU,WAAAA,IAACC,MAAAA,KAAW,IACN5B,EACJR,IAAKA,EACLyB,GAAIM,EACJpB,UAAWA,EACXV,KAAMA,EACNgB,IAAKA,EACL,gBAAeT,EAAU0B,SAAS5B,gBAE1BA,GAAa,WACnBA,EAAS,CAAEkB,gBAAerB,YAAW2B,gBAAe1B,YAAWC,SAC7DG,EAAU6B,SAAW,QACvBC,WAAAA,KAAAC,WAAAA,SAAA,CAAAjC,SACGc,CAAAA,EACCe,WAAAK,IAACC,UAAI,CACHC,YAAatB,GAAW,SAAWA,OAASD,EAC5Cd,YAAae,GAAW,SAAWA,OAASD,KACxCW,KACA1B,IAEJ,KACJ+B,WAAAK,IAACG,UAAI,IAAKnB,KAAmBrB,EAASG,SACnCA,GAAYC,IAEdc,EACCc,WAAAK,IAACC,UAAI,CACHC,YAAarB,GAAU,SAAWA,OAAQF,EAC1Cd,YAAagB,GAAU,SAAWA,OAAQF,KACtCW,KACA1B,IAEJ,QAGNE,GAAYC,GAEF,IAGlB,CACEqC,YA/FmB,SAgGnBC,MAAOC,UAAAA,qDAhGY"}
@@ -1 +1 @@
1
- {"version":3,"file":"Anchor.mjs","sources":["../../../../src/components/Anchor/Anchor.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { useTheme } from 'styled-components'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { useClassname } from 'hooks/useClassname'\nimport { Icon } from 'components/Icon'\nimport { Text } from 'components/Text'\nimport type { TextProps } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { AnchorProps } from './types'\n\nconst COMPONENT_NAME = 'Anchor'\n\n/**\n *\n * Component accepts all \\<a\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [AnchorProps](https://github.com/foxford/ui/blob/master/src/components/Anchor/types.ts)\n */\nconst Anchor: React.ForwardRefExoticComponent<AnchorProps> = withMergedProps<AnchorProps, HTMLAnchorElement>(\n forwardRef<HTMLAnchorElement, MergedProps<AnchorProps>>((props, ref) => {\n const {\n size = 'inherit',\n autoRel = true,\n textProps = {},\n iconProps = {},\n icon,\n children,\n content,\n ...restProps\n } = props\n\n const theme = useTheme()\n\n const className = useClassname(COMPONENT_NAME, restProps.className)\n const relBuilder = theme.utils?.relBuilder\n const href = restProps.href ?? restProps.to\n\n const rel =\n restProps.rel ??\n (autoRel && relBuilder && typeof href === 'string' ? relBuilder(href, restProps.target) : undefined)\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n underline: restProps.underline,\n marginLeft: before ? '0.20em' : undefined,\n marginRight: after ? '0.20em' : undefined,\n }\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n let rootNode\n if (restProps.to) rootNode = theme.link\n if (restProps.pseudo) rootNode = 'div'\n if (restProps.disabled) rootNode = 'span'\n if (restProps.as) rootNode = restProps.as\n\n return (\n <Styled.Root\n {...restProps}\n ref={ref}\n as={rootNode}\n className={className}\n size={size}\n rel={rel}\n data-disabled={restProps.disabled}\n >\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps, iconBaseProps, iconProps, icon })\n ) : restProps.preset === 'brand' ? (\n <>\n {before ? (\n <Icon\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n <Text {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n {after ? (\n <Icon\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n ) : (\n children || content\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Anchor, COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","Anchor","withMergedProps","forwardRef","props","ref","size","autoRel","textProps","iconProps","icon","children","content","restProps","theme","useTheme","className","useClassname","relBuilder","utils","href","to","rel","target","undefined","before","after","Array","isArray","baseTextProps","as","color","underline","marginLeft","marginRight","iconBaseProps","rootNode","link","pseudo","disabled","_jsx","Styled","preset","_jsxs","_Fragment","Icon","name","Text","displayName","sizes","SIZES"],"mappings":"iXAaMA,MAAAA,eAAiB,SAYjBC,MAAAA,OAAuDC,gBAC3DC,YAAwD,CAACC,EAAOC,KAC9D,MAAMC,KACJA,EAAO,UAASC,QAChBA,GAAU,EAAIC,UACdA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EAAAC,KACdA,EAAIC,SACJA,EAAQC,QACRA,KACGC,GACDT,EAEJ,MAAMU,EAAQC,WAEd,MAAMC,EAAYC,aA3BC,SA2B4BJ,EAAUG,WACzD,MAAME,EAAaJ,EAAMK,OAAOD,WAChC,MAAME,EAAOP,EAAUO,MAAQP,EAAUQ,GAEzC,MAAMC,EACJT,EAAUS,MACTf,GAAWW,UAAqBE,GAAS,SAAWF,EAAWE,EAAMP,EAAUU,aAAUC,GAE5F,MAAOC,EAAQC,GAASC,MAAMC,QAAQlB,GAAQA,EAAO,CAACA,GAEtD,MAAMmB,EAA2B,CAC/BC,GAAI,OACJxB,KAAM,UACNyB,MAAO,UACPC,UAAWnB,EAAUmB,UACrBC,WAAYR,EAAS,cAAWD,EAChCU,YAAaR,EAAQ,cAAWF,GAGlC,MAAMW,EAA2B,CAAEL,GAAI,OAAQC,MAAO,WAEtD,IAAIK,EAMJ,OALIvB,EAAUQ,KAAIe,EAAWtB,EAAMuB,MAC/BxB,EAAUyB,SAAQF,EAAW,OAC7BvB,EAAU0B,WAAUH,EAAW,QAC/BvB,EAAUiB,KAAIM,EAAWvB,EAAUiB,IAGrCU,IAACC,KAAW,IACN5B,EACJR,IAAKA,EACLyB,GAAIM,EACJpB,UAAWA,EACXV,KAAMA,EACNgB,IAAKA,EACL,gBAAeT,EAAU0B,SAAS5B,gBAE1BA,GAAa,WACnBA,EAAS,CAAEkB,gBAAerB,YAAW2B,gBAAe1B,YAAWC,SAC7DG,EAAU6B,SAAW,QACvBC,KAAAC,SAAA,CAAAjC,SACGc,CAAAA,EACCe,IAACK,KAAI,CACHC,YAAarB,GAAW,SAAWA,OAASD,EAC5Cd,YAAae,GAAW,SAAWA,OAASD,KACxCW,KACA1B,IAEJ,KACJ+B,IAACO,KAAI,IAAKlB,KAAmBrB,EAASG,SACnCA,GAAYC,IAEdc,EACCc,IAACK,KAAI,CACHC,YAAapB,GAAU,SAAWA,OAAQF,EAC1Cd,YAAagB,GAAU,SAAWA,OAAQF,KACtCW,KACA1B,IAEJ,QAGNE,GAAYC,GAEF,IAGlB,CACEoC,YA/FmB,SAgGnBC,MAAOC"}
1
+ {"version":3,"file":"Anchor.mjs","sources":["../../../../src/components/Anchor/Anchor.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { useTheme } from 'styled-components'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { useClassname } from 'hooks/useClassname'\nimport { Icon } from 'components/Icon'\nimport { Text } from 'components/Text'\nimport type { TextProps } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { AnchorProps } from './types'\n\nconst COMPONENT_NAME = 'Anchor'\n\n/**\n *\n * Component accepts all \\<a\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [AnchorProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/Anchor/types.ts)\n */\nconst Anchor: React.ForwardRefExoticComponent<AnchorProps> = withMergedProps<AnchorProps, HTMLAnchorElement>(\n forwardRef<HTMLAnchorElement, MergedProps<AnchorProps>>((props, ref) => {\n const {\n size = 'inherit',\n autoRel = true,\n textProps = {},\n iconProps = {},\n icon,\n children,\n content,\n ...restProps\n } = props\n\n const theme = useTheme()\n\n const className = useClassname(COMPONENT_NAME, restProps.className)\n const relBuilder = theme.utils?.relBuilder\n const href = restProps.href ?? restProps.to\n\n const rel =\n restProps.rel ??\n (autoRel && relBuilder && typeof href === 'string' ? relBuilder(href, restProps.target) : undefined)\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n underline: restProps.underline,\n marginLeft: before ? '0.20em' : undefined,\n marginRight: after ? '0.20em' : undefined,\n }\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n let rootNode\n if (restProps.to) rootNode = theme.link\n if (restProps.pseudo) rootNode = 'div'\n if (restProps.disabled) rootNode = 'span'\n if (restProps.as) rootNode = restProps.as\n\n return (\n <Styled.Root\n {...restProps}\n ref={ref}\n as={rootNode}\n className={className}\n size={size}\n rel={rel}\n data-disabled={restProps.disabled}\n >\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps, iconBaseProps, iconProps, icon })\n ) : restProps.preset === 'brand' ? (\n <>\n {before ? (\n <Icon\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n <Text {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n {after ? (\n <Icon\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n ) : (\n children || content\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Anchor, COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","Anchor","withMergedProps","forwardRef","props","ref","size","autoRel","textProps","iconProps","icon","children","content","restProps","theme","useTheme","className","useClassname","relBuilder","utils","href","to","rel","target","undefined","before","after","Array","isArray","baseTextProps","as","color","underline","marginLeft","marginRight","iconBaseProps","rootNode","link","pseudo","disabled","_jsx","Styled","preset","_jsxs","_Fragment","Icon","name","Text","displayName","sizes","SIZES"],"mappings":"iXAaMA,MAAAA,eAAiB,SAYjBC,MAAAA,OAAuDC,gBAC3DC,YAAwD,CAACC,EAAOC,KAC9D,MAAMC,KACJA,EAAO,UAASC,QAChBA,GAAU,EAAIC,UACdA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EAAAC,KACdA,EAAIC,SACJA,EAAQC,QACRA,KACGC,GACDT,EAEJ,MAAMU,EAAQC,WAEd,MAAMC,EAAYC,aA3BC,SA2B4BJ,EAAUG,WACzD,MAAME,EAAaJ,EAAMK,OAAOD,WAChC,MAAME,EAAOP,EAAUO,MAAQP,EAAUQ,GAEzC,MAAMC,EACJT,EAAUS,MACTf,GAAWW,UAAqBE,GAAS,SAAWF,EAAWE,EAAMP,EAAUU,aAAUC,GAE5F,MAAOC,EAAQC,GAASC,MAAMC,QAAQlB,GAAQA,EAAO,CAACA,GAEtD,MAAMmB,EAA2B,CAC/BC,GAAI,OACJxB,KAAM,UACNyB,MAAO,UACPC,UAAWnB,EAAUmB,UACrBC,WAAYR,EAAS,cAAWD,EAChCU,YAAaR,EAAQ,cAAWF,GAGlC,MAAMW,EAA2B,CAAEL,GAAI,OAAQC,MAAO,WAEtD,IAAIK,EAMJ,OALIvB,EAAUQ,KAAIe,EAAWtB,EAAMuB,MAC/BxB,EAAUyB,SAAQF,EAAW,OAC7BvB,EAAU0B,WAAUH,EAAW,QAC/BvB,EAAUiB,KAAIM,EAAWvB,EAAUiB,IAGrCU,IAACC,KAAW,IACN5B,EACJR,IAAKA,EACLyB,GAAIM,EACJpB,UAAWA,EACXV,KAAMA,EACNgB,IAAKA,EACL,gBAAeT,EAAU0B,SAAS5B,gBAE1BA,GAAa,WACnBA,EAAS,CAAEkB,gBAAerB,YAAW2B,gBAAe1B,YAAWC,SAC7DG,EAAU6B,SAAW,QACvBC,KAAAC,SAAA,CAAAjC,SACGc,CAAAA,EACCe,IAACK,KAAI,CACHC,YAAarB,GAAW,SAAWA,OAASD,EAC5Cd,YAAae,GAAW,SAAWA,OAASD,KACxCW,KACA1B,IAEJ,KACJ+B,IAACO,KAAI,IAAKlB,KAAmBrB,EAASG,SACnCA,GAAYC,IAEdc,EACCc,IAACK,KAAI,CACHC,YAAapB,GAAU,SAAWA,OAAQF,EAC1Cd,YAAagB,GAAU,SAAWA,OAAQF,KACtCW,KACA1B,IAEJ,QAGNE,GAAYC,GAEF,IAGlB,CACEoC,YA/FmB,SAgGnBC,MAAOC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Arrow.js","sources":["../../../../src/components/Arrow/Arrow.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport type { IconProps } from 'components/Icon'\nimport { SIZES } from './constants'\nimport { SIZES_DEFAULT } from './default-constants'\nimport type { ArrowProps } from './types'\n\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Arrow'\n\n/**\n *\n * Component accepts all \\<button\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ArrowProps](https://github.com/foxford/ui/blob/master/src/components/Arrow/types.ts)\n */\nconst Arrow: React.ForwardRefExoticComponent<ArrowProps> = withMergedProps<ArrowProps, HTMLButtonElement>(\n forwardRef<HTMLButtonElement, MergedProps<ArrowProps>>((props, ref) => {\n const { type = 'button', size = 'l', top = true, iconProps = {}, ...restProps } = props\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} type={type} size={size} top={top} ref={ref}>\n <Icon name={restProps.preset === 'brand' ? 'arrowUp' : 'chevronUp'} {...iconBaseProps} {...iconProps} />\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => (props.preset === 'brand' ? SIZES : SIZES_DEFAULT),\n }\n)\n\nexport { Arrow, COMPONENT_NAME }\n\nexport type { ArrowProps }\n"],"names":["Arrow","withMergedProps","forwardRef","props","ref","type","size","top","iconProps","restProps","_jsx","Styled","children","jsx","Icon","name","preset","as","color","displayName","sizes","SIZES","SIZES_DEFAULT"],"mappings":"oTAuBMA,MAAAA,MAAqDC,gBAAAA,gBACzDC,MAAAA,YAAuD,CAACC,EAAOC,KAC7D,MAAMC,KAAEA,EAAO,SAAQC,KAAEA,EAAO,IAAGC,IAAEA,GAAM,EAAIC,UAAEA,EAAY,CAAE,KAAKC,GAAcN,EAIlF,OACEO,WAAAA,IAACC,MAAAA,KAAW,IAAKF,EAAWJ,KAAMA,EAAMC,KAAMA,EAAMC,IAAKA,EAAKH,IAAKA,EAAIQ,SACrEF,WAAAG,IAACC,UAAI,CAACC,KAAMN,EAAUO,SAAW,QAAU,UAAY,YAJxBC,GAAI,OAAQC,MAAO,aAIyCV,KAC/E,IAGlB,CACEW,YAzBmB,QA0BnBC,MAAQjB,GAAWA,EAAMa,SAAW,QAAUK,UAAKA,MAAGC,iBAAAA,2DA1BnC"}
1
+ {"version":3,"file":"Arrow.js","sources":["../../../../src/components/Arrow/Arrow.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport type { IconProps } from 'components/Icon'\nimport { SIZES } from './constants'\nimport { SIZES_DEFAULT } from './default-constants'\nimport type { ArrowProps } from './types'\n\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Arrow'\n\n/**\n *\n * Component accepts all \\<button\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ArrowProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/Arrow/types.ts)\n */\nconst Arrow: React.ForwardRefExoticComponent<ArrowProps> = withMergedProps<ArrowProps, HTMLButtonElement>(\n forwardRef<HTMLButtonElement, MergedProps<ArrowProps>>((props, ref) => {\n const { type = 'button', size = 'l', top = true, iconProps = {}, ...restProps } = props\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} type={type} size={size} top={top} ref={ref}>\n <Icon name={restProps.preset === 'brand' ? 'arrowUp' : 'chevronUp'} {...iconBaseProps} {...iconProps} />\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => (props.preset === 'brand' ? SIZES : SIZES_DEFAULT),\n }\n)\n\nexport { Arrow, COMPONENT_NAME }\n\nexport type { ArrowProps }\n"],"names":["Arrow","withMergedProps","forwardRef","props","ref","type","size","top","iconProps","restProps","_jsx","Styled","children","jsx","Icon","name","preset","as","color","displayName","sizes","SIZES","SIZES_DEFAULT"],"mappings":"oTAuBMA,MAAAA,MAAqDC,gBAAAA,gBACzDC,MAAAA,YAAuD,CAACC,EAAOC,KAC7D,MAAMC,KAAEA,EAAO,SAAQC,KAAEA,EAAO,IAAGC,IAAEA,GAAM,EAAIC,UAAEA,EAAY,CAAE,KAAKC,GAAcN,EAIlF,OACEO,WAAAA,IAACC,MAAAA,KAAW,IAAKF,EAAWJ,KAAMA,EAAMC,KAAMA,EAAMC,IAAKA,EAAKH,IAAKA,EAAIQ,SACrEF,WAAAG,IAACC,UAAI,CAACC,KAAMN,EAAUO,SAAW,QAAU,UAAY,YAJxBC,GAAI,OAAQC,MAAO,aAIyCV,KAC/E,IAGlB,CACEW,YAzBmB,QA0BnBC,MAAQjB,GAAWA,EAAMa,SAAW,QAAUK,UAAKA,MAAGC,iBAAAA,2DA1BnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Arrow.mjs","sources":["../../../../src/components/Arrow/Arrow.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport type { IconProps } from 'components/Icon'\nimport { SIZES } from './constants'\nimport { SIZES_DEFAULT } from './default-constants'\nimport type { ArrowProps } from './types'\n\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Arrow'\n\n/**\n *\n * Component accepts all \\<button\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ArrowProps](https://github.com/foxford/ui/blob/master/src/components/Arrow/types.ts)\n */\nconst Arrow: React.ForwardRefExoticComponent<ArrowProps> = withMergedProps<ArrowProps, HTMLButtonElement>(\n forwardRef<HTMLButtonElement, MergedProps<ArrowProps>>((props, ref) => {\n const { type = 'button', size = 'l', top = true, iconProps = {}, ...restProps } = props\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} type={type} size={size} top={top} ref={ref}>\n <Icon name={restProps.preset === 'brand' ? 'arrowUp' : 'chevronUp'} {...iconBaseProps} {...iconProps} />\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => (props.preset === 'brand' ? SIZES : SIZES_DEFAULT),\n }\n)\n\nexport { Arrow, COMPONENT_NAME }\n\nexport type { ArrowProps }\n"],"names":["COMPONENT_NAME","Arrow","withMergedProps","forwardRef","props","ref","type","size","top","iconProps","restProps","_jsx","Styled","children","Icon","name","preset","as","color","displayName","sizes","SIZES","SIZES_DEFAULT"],"mappings":"oRAWMA,MAAAA,eAAiB,QAYjBC,MAAAA,MAAqDC,gBACzDC,YAAuD,CAACC,EAAOC,KAC7D,MAAMC,KAAEA,EAAO,SAAQC,KAAEA,EAAO,IAAGC,IAAEA,GAAM,EAAIC,UAAEA,EAAY,CAAE,KAAKC,GAAcN,EAIlF,OACEO,IAACC,KAAW,IAAKF,EAAWJ,KAAMA,EAAMC,KAAMA,EAAMC,IAAKA,EAAKH,IAAKA,EAAIQ,SACrEF,IAACG,KAAI,CAACC,KAAML,EAAUM,SAAW,QAAU,UAAY,YAJxBC,GAAI,OAAQC,MAAO,aAIyCT,KAC/E,IAGlB,CACEU,YAzBmB,QA0BnBC,MAAQhB,GAAWA,EAAMY,SAAW,QAAUK,MAAQC"}
1
+ {"version":3,"file":"Arrow.mjs","sources":["../../../../src/components/Arrow/Arrow.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport type { IconProps } from 'components/Icon'\nimport { SIZES } from './constants'\nimport { SIZES_DEFAULT } from './default-constants'\nimport type { ArrowProps } from './types'\n\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Arrow'\n\n/**\n *\n * Component accepts all \\<button\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ArrowProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/Arrow/types.ts)\n */\nconst Arrow: React.ForwardRefExoticComponent<ArrowProps> = withMergedProps<ArrowProps, HTMLButtonElement>(\n forwardRef<HTMLButtonElement, MergedProps<ArrowProps>>((props, ref) => {\n const { type = 'button', size = 'l', top = true, iconProps = {}, ...restProps } = props\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} type={type} size={size} top={top} ref={ref}>\n <Icon name={restProps.preset === 'brand' ? 'arrowUp' : 'chevronUp'} {...iconBaseProps} {...iconProps} />\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => (props.preset === 'brand' ? SIZES : SIZES_DEFAULT),\n }\n)\n\nexport { Arrow, COMPONENT_NAME }\n\nexport type { ArrowProps }\n"],"names":["COMPONENT_NAME","Arrow","withMergedProps","forwardRef","props","ref","type","size","top","iconProps","restProps","_jsx","Styled","children","Icon","name","preset","as","color","displayName","sizes","SIZES","SIZES_DEFAULT"],"mappings":"oRAWMA,MAAAA,eAAiB,QAYjBC,MAAAA,MAAqDC,gBACzDC,YAAuD,CAACC,EAAOC,KAC7D,MAAMC,KAAEA,EAAO,SAAQC,KAAEA,EAAO,IAAGC,IAAEA,GAAM,EAAIC,UAAEA,EAAY,CAAE,KAAKC,GAAcN,EAIlF,OACEO,IAACC,KAAW,IAAKF,EAAWJ,KAAMA,EAAMC,KAAMA,EAAMC,IAAKA,EAAKH,IAAKA,EAAIQ,SACrEF,IAACG,KAAI,CAACC,KAAML,EAAUM,SAAW,QAAU,UAAY,YAJxBC,GAAI,OAAQC,MAAO,aAIyCT,KAC/E,IAGlB,CACEU,YAzBmB,QA0BnBC,MAAQhB,GAAWA,EAAMY,SAAW,QAAUK,MAAQC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ArrowBadge.js","sources":["../../../../src/components/ArrowBadge/ArrowBadge.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport type { TextProps } from 'components/Text'\nimport * as Styled from './style'\nimport type { ArrowBadgeProps } from './types'\nimport { SIZES } from './constants'\n\nconst COMPONENT_NAME = 'ArrowBadge'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ArrowBadgeProps](https://github.com/foxford/ui/blob/master/src/components/ArrowBadge/types.ts)\n */\nconst ArrowBadge: React.ForwardRefExoticComponent<ArrowBadgeProps> = withMergedProps<ArrowBadgeProps, HTMLDivElement>(\n forwardRef<HTMLDivElement, MergedProps<ArrowBadgeProps>>((props, ref) => {\n const { size = 'm', textProps = {}, children, left, right, fancy, ...restProps } = props\n\n const baseTextProps: TextProps = { as: 'div', size: 'inherit', color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} size={size} left={left} right={right} fancy={fancy} ref={ref}>\n <Styled.Edge left={left} fancy={fancy} />\n <Styled.Content>\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps })\n ) : (\n <Text {...baseTextProps} {...textProps}>\n {children}\n </Text>\n )}\n </Styled.Content>\n <Styled.Edge right={right} fancy={fancy} after />\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { ArrowBadge, COMPONENT_NAME }\n"],"names":["ArrowBadge","withMergedProps","forwardRef","props","ref","size","textProps","children","left","right","fancy","restProps","baseTextProps","as","color","_jsxs","Styled","_jsx","jsx","Text","after","displayName","sizes","SIZES"],"mappings":"6PAqBMA,MAAAA,WAA+DC,gBAAAA,gBACnEC,MAAAA,YAAyD,CAACC,EAAOC,KAC/D,MAAMC,KAAEA,EAAO,IAAGC,UAAEA,EAAY,CAAE,EAAAC,SAAEA,EAAQC,KAAEA,EAAIC,MAAEA,EAAKC,MAAEA,KAAUC,GAAcR,EAEnF,MAAMS,EAA2B,CAAEC,GAAI,MAAOR,KAAM,UAAWS,MAAO,WAEtE,OACEC,WAAAA,KAACC,MAAAA,KAAW,IAAKL,EAAWN,KAAMA,EAAMG,KAAMA,EAAMC,MAAOA,EAAOC,MAAOA,EAAON,IAAKA,EAAIG,SACvFU,CAAAA,WAAAC,IAACF,WAAW,CAACR,KAAMA,EAAME,MAAOA,IAChCO,WAAAC,IAACF,cAAc,CAAAT,gBACLA,GAAa,WACnBA,EAAS,CAAEK,gBAAeN,cAE1BW,WAAAC,IAACC,UAAI,IAAKP,KAAmBN,EAASC,SACnCA,MAIPU,WAAAC,IAACF,WAAW,CAACP,MAAOA,EAAOC,MAAOA,EAAOU,OAAK,MAClC,IAGlB,CACEC,YAnCmB,aAoCnBC,MAAOC,UAAAA,6DApCY"}
1
+ {"version":3,"file":"ArrowBadge.js","sources":["../../../../src/components/ArrowBadge/ArrowBadge.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport type { TextProps } from 'components/Text'\nimport * as Styled from './style'\nimport type { ArrowBadgeProps } from './types'\nimport { SIZES } from './constants'\n\nconst COMPONENT_NAME = 'ArrowBadge'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ArrowBadgeProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/ArrowBadge/types.ts)\n */\nconst ArrowBadge: React.ForwardRefExoticComponent<ArrowBadgeProps> = withMergedProps<ArrowBadgeProps, HTMLDivElement>(\n forwardRef<HTMLDivElement, MergedProps<ArrowBadgeProps>>((props, ref) => {\n const { size = 'm', textProps = {}, children, left, right, fancy, ...restProps } = props\n\n const baseTextProps: TextProps = { as: 'div', size: 'inherit', color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} size={size} left={left} right={right} fancy={fancy} ref={ref}>\n <Styled.Edge left={left} fancy={fancy} />\n <Styled.Content>\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps })\n ) : (\n <Text {...baseTextProps} {...textProps}>\n {children}\n </Text>\n )}\n </Styled.Content>\n <Styled.Edge right={right} fancy={fancy} after />\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { ArrowBadge, COMPONENT_NAME }\n"],"names":["ArrowBadge","withMergedProps","forwardRef","props","ref","size","textProps","children","left","right","fancy","restProps","baseTextProps","as","color","_jsxs","Styled","_jsx","jsx","Text","after","displayName","sizes","SIZES"],"mappings":"6PAqBMA,MAAAA,WAA+DC,gBAAAA,gBACnEC,MAAAA,YAAyD,CAACC,EAAOC,KAC/D,MAAMC,KAAEA,EAAO,IAAGC,UAAEA,EAAY,CAAE,EAAAC,SAAEA,EAAQC,KAAEA,EAAIC,MAAEA,EAAKC,MAAEA,KAAUC,GAAcR,EAEnF,MAAMS,EAA2B,CAAEC,GAAI,MAAOR,KAAM,UAAWS,MAAO,WAEtE,OACEC,WAAAA,KAACC,MAAAA,KAAW,IAAKL,EAAWN,KAAMA,EAAMG,KAAMA,EAAMC,MAAOA,EAAOC,MAAOA,EAAON,IAAKA,EAAIG,SACvFU,CAAAA,WAAAC,IAACF,WAAW,CAACR,KAAMA,EAAME,MAAOA,IAChCO,WAAAC,IAACF,cAAc,CAAAT,gBACLA,GAAa,WACnBA,EAAS,CAAEK,gBAAeN,cAE1BW,WAAAC,IAACC,UAAI,IAAKP,KAAmBN,EAASC,SACnCA,MAIPU,WAAAC,IAACF,WAAW,CAACP,MAAOA,EAAOC,MAAOA,EAAOU,OAAK,MAClC,IAGlB,CACEC,YAnCmB,aAoCnBC,MAAOC,UAAAA,6DApCY"}
@@ -1 +1 @@
1
- {"version":3,"file":"ArrowBadge.mjs","sources":["../../../../src/components/ArrowBadge/ArrowBadge.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport type { TextProps } from 'components/Text'\nimport * as Styled from './style'\nimport type { ArrowBadgeProps } from './types'\nimport { SIZES } from './constants'\n\nconst COMPONENT_NAME = 'ArrowBadge'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ArrowBadgeProps](https://github.com/foxford/ui/blob/master/src/components/ArrowBadge/types.ts)\n */\nconst ArrowBadge: React.ForwardRefExoticComponent<ArrowBadgeProps> = withMergedProps<ArrowBadgeProps, HTMLDivElement>(\n forwardRef<HTMLDivElement, MergedProps<ArrowBadgeProps>>((props, ref) => {\n const { size = 'm', textProps = {}, children, left, right, fancy, ...restProps } = props\n\n const baseTextProps: TextProps = { as: 'div', size: 'inherit', color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} size={size} left={left} right={right} fancy={fancy} ref={ref}>\n <Styled.Edge left={left} fancy={fancy} />\n <Styled.Content>\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps })\n ) : (\n <Text {...baseTextProps} {...textProps}>\n {children}\n </Text>\n )}\n </Styled.Content>\n <Styled.Edge right={right} fancy={fancy} after />\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { ArrowBadge, COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","ArrowBadge","withMergedProps","forwardRef","props","ref","size","textProps","children","left","right","fancy","restProps","baseTextProps","as","color","_jsxs","Styled","_jsx","Text","after","displayName","sizes","SIZES"],"mappings":"mPASMA,MAAAA,eAAiB,aAYjBC,MAAAA,WAA+DC,gBACnEC,YAAyD,CAACC,EAAOC,KAC/D,MAAMC,KAAEA,EAAO,IAAGC,UAAEA,EAAY,CAAE,EAAAC,SAAEA,EAAQC,KAAEA,EAAIC,MAAEA,EAAKC,MAAEA,KAAUC,GAAcR,EAEnF,MAAMS,EAA2B,CAAEC,GAAI,MAAOR,KAAM,UAAWS,MAAO,WAEtE,OACEC,KAACC,KAAW,IAAKL,EAAWN,KAAMA,EAAMG,KAAMA,EAAMC,MAAOA,EAAOC,MAAOA,EAAON,IAAKA,EAAIG,SACvFU,CAAAA,IAACD,KAAW,CAACR,KAAMA,EAAME,MAAOA,IAChCO,IAACD,QAAc,CAAAT,gBACLA,GAAa,WACnBA,EAAS,CAAEK,gBAAeN,cAE1BW,IAACC,KAAI,IAAKN,KAAmBN,EAASC,SACnCA,MAIPU,IAACD,KAAW,CAACP,MAAOA,EAAOC,MAAOA,EAAOS,OAAK,MAClC,IAGlB,CACEC,YAnCmB,aAoCnBC,MAAOC"}
1
+ {"version":3,"file":"ArrowBadge.mjs","sources":["../../../../src/components/ArrowBadge/ArrowBadge.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport type { TextProps } from 'components/Text'\nimport * as Styled from './style'\nimport type { ArrowBadgeProps } from './types'\nimport { SIZES } from './constants'\n\nconst COMPONENT_NAME = 'ArrowBadge'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ArrowBadgeProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/ArrowBadge/types.ts)\n */\nconst ArrowBadge: React.ForwardRefExoticComponent<ArrowBadgeProps> = withMergedProps<ArrowBadgeProps, HTMLDivElement>(\n forwardRef<HTMLDivElement, MergedProps<ArrowBadgeProps>>((props, ref) => {\n const { size = 'm', textProps = {}, children, left, right, fancy, ...restProps } = props\n\n const baseTextProps: TextProps = { as: 'div', size: 'inherit', color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} size={size} left={left} right={right} fancy={fancy} ref={ref}>\n <Styled.Edge left={left} fancy={fancy} />\n <Styled.Content>\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps })\n ) : (\n <Text {...baseTextProps} {...textProps}>\n {children}\n </Text>\n )}\n </Styled.Content>\n <Styled.Edge right={right} fancy={fancy} after />\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { ArrowBadge, COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","ArrowBadge","withMergedProps","forwardRef","props","ref","size","textProps","children","left","right","fancy","restProps","baseTextProps","as","color","_jsxs","Styled","_jsx","Text","after","displayName","sizes","SIZES"],"mappings":"mPASMA,MAAAA,eAAiB,aAYjBC,MAAAA,WAA+DC,gBACnEC,YAAyD,CAACC,EAAOC,KAC/D,MAAMC,KAAEA,EAAO,IAAGC,UAAEA,EAAY,CAAE,EAAAC,SAAEA,EAAQC,KAAEA,EAAIC,MAAEA,EAAKC,MAAEA,KAAUC,GAAcR,EAEnF,MAAMS,EAA2B,CAAEC,GAAI,MAAOR,KAAM,UAAWS,MAAO,WAEtE,OACEC,KAACC,KAAW,IAAKL,EAAWN,KAAMA,EAAMG,KAAMA,EAAMC,MAAOA,EAAOC,MAAOA,EAAON,IAAKA,EAAIG,SACvFU,CAAAA,IAACD,KAAW,CAACR,KAAMA,EAAME,MAAOA,IAChCO,IAACD,QAAc,CAAAT,gBACLA,GAAa,WACnBA,EAAS,CAAEK,gBAAeN,cAE1BW,IAACC,KAAI,IAAKN,KAAmBN,EAASC,SACnCA,MAIPU,IAACD,KAAW,CAACP,MAAOA,EAAOC,MAAOA,EAAOS,OAAK,MAClC,IAGlB,CACEC,YAnCmB,aAoCnBC,MAAOC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.js","sources":["../../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Skeleton } from 'components/Skeleton'\nimport { Text } from 'components/Text'\nimport { abbreviateCaption } from './utils'\nimport { SIZES, SIZES_SQUARE } from './constants'\nimport { SIZES_MAPPING_RULES, SIZES_DEFAULT } from './default-constants'\nimport type { AvatarProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Avatar'\n\n/**\n *\n * Component accepts all \\<span\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [AvatarProps](https://github.com/foxford/ui/blob/master/src/components/Avatar/types.ts)\n */\nconst Avatar: React.ForwardRefExoticComponent<AvatarProps> = withMergedProps<AvatarProps, HTMLSpanElement>(\n forwardRef<HTMLSpanElement, MergedProps<AvatarProps>>((props, ref) => {\n const { size = 'm', textProps = {}, children, text, ...restProps } = props\n\n const sizeMapped =\n typeof size === 'string' && (restProps.preset === 'default' || size === 'sm')\n ? (SIZES_MAPPING_RULES[size] ?? size)\n : size\n\n return (\n <Styled.Root {...restProps} size={sizeMapped} ref={ref}>\n {restProps.loading ? (\n <Skeleton as='span' width='100%' height='100%' borderRadius='inherit' />\n ) : (\n (children ??\n (!restProps.src && (\n <Text\n as='span'\n appearance='caption'\n size='inherit'\n color='inherit'\n lineHeight={1}\n marginTop={1}\n transform='uppercase'\n {...textProps}\n >\n {abbreviateCaption(text || restProps.title || '')}\n </Text>\n )))\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n if (props.preset === 'brand') {\n return props.square ? SIZES_SQUARE : SIZES\n }\n\n return SIZES_DEFAULT\n },\n }\n)\n\nexport { Avatar }\n\nexport { SIZES, SIZES_SQUARE }\n"],"names":["Avatar","withMergedProps","forwardRef","props","ref","size","textProps","children","text","restProps","sizeMapped","preset","SIZES_MAPPING_RULES","_jsx","Styled","loading","Skeleton","as","width","height","borderRadius","src","Text","appearance","color","lineHeight","marginTop","transform","abbreviateCaption","title","displayName","sizes","square","SIZES_SQUARE","SIZES","SIZES_DEFAULT"],"mappings":"oYAuBMA,MAAAA,OAAuDC,gBAAAA,gBAC3DC,MAAAA,YAAsD,CAACC,EAAOC,KAC5D,MAAMC,KAAEA,EAAO,IAAGC,UAAEA,EAAY,CAAE,EAAAC,SAAEA,EAAQC,KAAEA,KAASC,GAAcN,EAErE,MAAMO,SACGL,GAAS,UAAaI,EAAUE,SAAW,WAAaN,IAAS,KAEpEA,EADCO,iBAAmBA,oBAACP,IAASA,EAGpC,OACEQ,WAAAA,IAACC,MAAAA,KAAW,IAAKL,EAAWJ,KAAMK,EAAYN,IAAKA,EAAIG,SACpDE,EAAUM,QACTF,WAAAA,IAACG,SAAAA,SAAQ,CAACC,GAAG,OAAOC,MAAM,OAAOC,OAAO,OAAOC,aAAa,YAE3Db,KACCE,EAAUY,KACVR,WAAAA,IAACS,KAAAA,KAAI,CACHL,GAAG,OACHM,WAAW,UACXlB,KAAK,UACLmB,MAAM,UACNC,WAAY,EACZC,UAAW,EACXC,UAAU,eACNrB,EAASC,SAEZqB,MAAAA,kBAAkBpB,GAAQC,EAAUoB,OAAS,QAIxC,IAGlB,CACEC,YA9CmB,SA+CnBC,MAAQ5B,GACFA,EAAMQ,SAAW,QACZR,EAAM6B,OAASC,UAAYA,aAAGC,gBAGhCC"}
1
+ {"version":3,"file":"Avatar.js","sources":["../../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Skeleton } from 'components/Skeleton'\nimport { Text } from 'components/Text'\nimport { abbreviateCaption } from './utils'\nimport { SIZES, SIZES_SQUARE } from './constants'\nimport { SIZES_MAPPING_RULES, SIZES_DEFAULT } from './default-constants'\nimport type { AvatarProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Avatar'\n\n/**\n *\n * Component accepts all \\<span\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [AvatarProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/Avatar/types.ts)\n */\nconst Avatar: React.ForwardRefExoticComponent<AvatarProps> = withMergedProps<AvatarProps, HTMLSpanElement>(\n forwardRef<HTMLSpanElement, MergedProps<AvatarProps>>((props, ref) => {\n const { size = 'm', textProps = {}, children, text, ...restProps } = props\n\n const sizeMapped =\n typeof size === 'string' && (restProps.preset === 'default' || size === 'sm')\n ? (SIZES_MAPPING_RULES[size] ?? size)\n : size\n\n return (\n <Styled.Root {...restProps} size={sizeMapped} ref={ref}>\n {restProps.loading ? (\n <Skeleton as='span' width='100%' height='100%' borderRadius='inherit' />\n ) : (\n (children ??\n (!restProps.src && (\n <Text\n as='span'\n appearance='caption'\n size='inherit'\n color='inherit'\n lineHeight={1}\n marginTop={1}\n transform='uppercase'\n {...textProps}\n >\n {abbreviateCaption(text || restProps.title || '')}\n </Text>\n )))\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n if (props.preset === 'brand') {\n return props.square ? SIZES_SQUARE : SIZES\n }\n\n return SIZES_DEFAULT\n },\n }\n)\n\nexport { Avatar }\n\nexport { SIZES, SIZES_SQUARE }\n"],"names":["Avatar","withMergedProps","forwardRef","props","ref","size","textProps","children","text","restProps","sizeMapped","preset","SIZES_MAPPING_RULES","_jsx","Styled","loading","Skeleton","as","width","height","borderRadius","src","Text","appearance","color","lineHeight","marginTop","transform","abbreviateCaption","title","displayName","sizes","square","SIZES_SQUARE","SIZES","SIZES_DEFAULT"],"mappings":"oYAuBMA,MAAAA,OAAuDC,gBAAAA,gBAC3DC,MAAAA,YAAsD,CAACC,EAAOC,KAC5D,MAAMC,KAAEA,EAAO,IAAGC,UAAEA,EAAY,CAAE,EAAAC,SAAEA,EAAQC,KAAEA,KAASC,GAAcN,EAErE,MAAMO,SACGL,GAAS,UAAaI,EAAUE,SAAW,WAAaN,IAAS,KAEpEA,EADCO,iBAAmBA,oBAACP,IAASA,EAGpC,OACEQ,WAAAA,IAACC,MAAAA,KAAW,IAAKL,EAAWJ,KAAMK,EAAYN,IAAKA,EAAIG,SACpDE,EAAUM,QACTF,WAAAA,IAACG,SAAAA,SAAQ,CAACC,GAAG,OAAOC,MAAM,OAAOC,OAAO,OAAOC,aAAa,YAE3Db,KACCE,EAAUY,KACVR,WAAAA,IAACS,KAAAA,KAAI,CACHL,GAAG,OACHM,WAAW,UACXlB,KAAK,UACLmB,MAAM,UACNC,WAAY,EACZC,UAAW,EACXC,UAAU,eACNrB,EAASC,SAEZqB,MAAAA,kBAAkBpB,GAAQC,EAAUoB,OAAS,QAIxC,IAGlB,CACEC,YA9CmB,SA+CnBC,MAAQ5B,GACFA,EAAMQ,SAAW,QACZR,EAAM6B,OAASC,UAAYA,aAAGC,gBAGhCC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.mjs","sources":["../../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Skeleton } from 'components/Skeleton'\nimport { Text } from 'components/Text'\nimport { abbreviateCaption } from './utils'\nimport { SIZES, SIZES_SQUARE } from './constants'\nimport { SIZES_MAPPING_RULES, SIZES_DEFAULT } from './default-constants'\nimport type { AvatarProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Avatar'\n\n/**\n *\n * Component accepts all \\<span\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [AvatarProps](https://github.com/foxford/ui/blob/master/src/components/Avatar/types.ts)\n */\nconst Avatar: React.ForwardRefExoticComponent<AvatarProps> = withMergedProps<AvatarProps, HTMLSpanElement>(\n forwardRef<HTMLSpanElement, MergedProps<AvatarProps>>((props, ref) => {\n const { size = 'm', textProps = {}, children, text, ...restProps } = props\n\n const sizeMapped =\n typeof size === 'string' && (restProps.preset === 'default' || size === 'sm')\n ? (SIZES_MAPPING_RULES[size] ?? size)\n : size\n\n return (\n <Styled.Root {...restProps} size={sizeMapped} ref={ref}>\n {restProps.loading ? (\n <Skeleton as='span' width='100%' height='100%' borderRadius='inherit' />\n ) : (\n (children ??\n (!restProps.src && (\n <Text\n as='span'\n appearance='caption'\n size='inherit'\n color='inherit'\n lineHeight={1}\n marginTop={1}\n transform='uppercase'\n {...textProps}\n >\n {abbreviateCaption(text || restProps.title || '')}\n </Text>\n )))\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n if (props.preset === 'brand') {\n return props.square ? SIZES_SQUARE : SIZES\n }\n\n return SIZES_DEFAULT\n },\n }\n)\n\nexport { Avatar }\n\nexport { SIZES, SIZES_SQUARE }\n"],"names":["Avatar","withMergedProps","forwardRef","props","ref","size","textProps","children","text","restProps","sizeMapped","preset","SIZES_MAPPING_RULES","_jsx","Styled","loading","Skeleton","as","width","height","borderRadius","src","Text","appearance","color","lineHeight","marginTop","transform","abbreviateCaption","title","displayName","sizes","square","SIZES_SQUARE","SIZES","SIZES_DEFAULT"],"mappings":"+YAuBMA,MAAAA,OAAuDC,gBAC3DC,YAAsD,CAACC,EAAOC,KAC5D,MAAMC,KAAEA,EAAO,IAAGC,UAAEA,EAAY,CAAE,EAAAC,SAAEA,EAAQC,KAAEA,KAASC,GAAcN,EAErE,MAAMO,SACGL,GAAS,UAAaI,EAAUE,SAAW,WAAaN,IAAS,KAEpEA,EADCO,oBAAoBP,IAASA,EAGpC,OACEQ,IAACC,KAAW,IAAKL,EAAWJ,KAAMK,EAAYN,IAAKA,EAAIG,SACpDE,EAAUM,QACTF,IAACG,SAAQ,CAACC,GAAG,OAAOC,MAAM,OAAOC,OAAO,OAAOC,aAAa,YAE3Db,KACCE,EAAUY,KACVR,IAACS,KAAI,CACHL,GAAG,OACHM,WAAW,UACXlB,KAAK,UACLmB,MAAM,UACNC,WAAY,EACZC,UAAW,EACXC,UAAU,eACNrB,EAASC,SAEZqB,kBAAkBpB,GAAQC,EAAUoB,OAAS,QAIxC,IAGlB,CACEC,YA9CmB,SA+CnBC,MAAQ5B,GACFA,EAAMQ,SAAW,QACZR,EAAM6B,OAASC,aAAeC,MAGhCC"}
1
+ {"version":3,"file":"Avatar.mjs","sources":["../../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Skeleton } from 'components/Skeleton'\nimport { Text } from 'components/Text'\nimport { abbreviateCaption } from './utils'\nimport { SIZES, SIZES_SQUARE } from './constants'\nimport { SIZES_MAPPING_RULES, SIZES_DEFAULT } from './default-constants'\nimport type { AvatarProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Avatar'\n\n/**\n *\n * Component accepts all \\<span\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [AvatarProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/Avatar/types.ts)\n */\nconst Avatar: React.ForwardRefExoticComponent<AvatarProps> = withMergedProps<AvatarProps, HTMLSpanElement>(\n forwardRef<HTMLSpanElement, MergedProps<AvatarProps>>((props, ref) => {\n const { size = 'm', textProps = {}, children, text, ...restProps } = props\n\n const sizeMapped =\n typeof size === 'string' && (restProps.preset === 'default' || size === 'sm')\n ? (SIZES_MAPPING_RULES[size] ?? size)\n : size\n\n return (\n <Styled.Root {...restProps} size={sizeMapped} ref={ref}>\n {restProps.loading ? (\n <Skeleton as='span' width='100%' height='100%' borderRadius='inherit' />\n ) : (\n (children ??\n (!restProps.src && (\n <Text\n as='span'\n appearance='caption'\n size='inherit'\n color='inherit'\n lineHeight={1}\n marginTop={1}\n transform='uppercase'\n {...textProps}\n >\n {abbreviateCaption(text || restProps.title || '')}\n </Text>\n )))\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n if (props.preset === 'brand') {\n return props.square ? SIZES_SQUARE : SIZES\n }\n\n return SIZES_DEFAULT\n },\n }\n)\n\nexport { Avatar }\n\nexport { SIZES, SIZES_SQUARE }\n"],"names":["Avatar","withMergedProps","forwardRef","props","ref","size","textProps","children","text","restProps","sizeMapped","preset","SIZES_MAPPING_RULES","_jsx","Styled","loading","Skeleton","as","width","height","borderRadius","src","Text","appearance","color","lineHeight","marginTop","transform","abbreviateCaption","title","displayName","sizes","square","SIZES_SQUARE","SIZES","SIZES_DEFAULT"],"mappings":"+YAuBMA,MAAAA,OAAuDC,gBAC3DC,YAAsD,CAACC,EAAOC,KAC5D,MAAMC,KAAEA,EAAO,IAAGC,UAAEA,EAAY,CAAE,EAAAC,SAAEA,EAAQC,KAAEA,KAASC,GAAcN,EAErE,MAAMO,SACGL,GAAS,UAAaI,EAAUE,SAAW,WAAaN,IAAS,KAEpEA,EADCO,oBAAoBP,IAASA,EAGpC,OACEQ,IAACC,KAAW,IAAKL,EAAWJ,KAAMK,EAAYN,IAAKA,EAAIG,SACpDE,EAAUM,QACTF,IAACG,SAAQ,CAACC,GAAG,OAAOC,MAAM,OAAOC,OAAO,OAAOC,aAAa,YAE3Db,KACCE,EAAUY,KACVR,IAACS,KAAI,CACHL,GAAG,OACHM,WAAW,UACXlB,KAAK,UACLmB,MAAM,UACNC,WAAY,EACZC,UAAW,EACXC,UAAU,eACNrB,EAASC,SAEZqB,kBAAkBpB,GAAQC,EAAUoB,OAAS,QAIxC,IAGlB,CACEC,YA9CmB,SA+CnBC,MAAQ5B,GACFA,EAAMQ,SAAW,QACZR,EAAM6B,OAASC,aAAeC,MAGhCC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","sources":["../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport * as Styled from './style'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport type { BadgeProps } from './types'\n\nconst COMPONENT_NAME = 'Badge'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [BadgeProps](https://github.com/foxford/ui/blob/master/src/components/Badge/types.ts)\n */\nexport const Badge: React.ForwardRefExoticComponent<BadgeProps> = withMergedProps<BadgeProps, HTMLDivElement>(\n forwardRef<HTMLDivElement, MergedProps<BadgeProps>>((props, ref) => {\n const {\n size = 's',\n borderRadius = 3,\n textProps = {},\n iconProps = {},\n children,\n content,\n icon,\n ...restProps\n } = props\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n const iconBaseProps: IconProps = { color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} size={size} borderRadius={borderRadius} ref={ref}>\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps, iconBaseProps, iconProps, icon })\n ) : (\n <>\n {before ? (\n <Icon\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n {children || content ? (\n <Text {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n ) : null}\n {after ? (\n <Icon\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => (props.round ? SIZES_ROUND : SIZES),\n }\n)\n"],"names":["Badge","withMergedProps","forwardRef","props","ref","size","borderRadius","textProps","iconProps","children","content","icon","restProps","before","after","Array","isArray","baseTextProps","as","color","marginLeft","undefined","marginRight","iconBaseProps","_jsx","Styled","_jsxs","jsxs","_Fragment","jsx","Icon","name","Text","displayName","sizes","round","SIZES_ROUND","SIZES"],"mappings":"iSAuBO,MAAMA,MAAqDC,gBAAAA,gBAChEC,MAAAA,YAAoD,CAACC,EAAOC,KAC1D,MAAMC,KACJA,EAAO,IAAGC,aACVA,EAAe,EAACC,UAChBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EAAAC,SACdA,EAAQC,QACRA,EAAOC,KACPA,KACGC,GACDT,EAEJ,MAAOU,EAAQC,GAASC,MAAMC,QAAQL,GAAQA,EAAO,CAACA,GAEtD,MAAMM,EAA2B,CAC/BC,GAAI,OACJb,KAAM,UACNc,MAAO,UACPC,WAAYP,EAAS,cAAWQ,EAChCC,YAAaR,EAAQ,cAAWO,GAElC,MAAME,EAA2B,CAAEJ,MAAO,WAE1C,OACEK,WAAAA,IAACC,MAAAA,KAAW,IAAKb,EAAWP,KAAMA,EAAMC,aAAcA,EAAcF,IAAKA,EAAIK,gBACnEA,GAAa,WACnBA,EAAS,CAAEQ,gBAAeV,YAAWgB,gBAAef,YAAWG,SAE/De,WAAAC,KAAAC,oBAAA,CAAAnB,SACGI,CAAAA,EACCW,WAAAK,IAACC,UAAI,CACHC,YAAalB,GAAW,SAAWA,OAASQ,EAC5CV,YAAaE,GAAW,SAAWA,OAASQ,KACxCE,KACAf,IAEJ,KACHC,GAAYC,EACXc,WAAAA,IAACQ,KAAAA,KAAI,IAAKf,KAAmBV,EAASE,SACnCA,GAAYC,IAEb,KACHI,EACCU,WAAAA,IAACM,KAAAA,KAAI,CACHC,YAAajB,GAAU,SAAWA,OAAQO,EAC1CV,YAAaG,GAAU,SAAWA,OAAQO,KACtCE,KACAf,IAEJ,SAGI,IAGlB,CACEyB,YArEmB,QAsEnBC,MAAQ/B,GAAWA,EAAMgC,MAAQC,UAAWA,YAAGC,UAAAA"}
1
+ {"version":3,"file":"Badge.js","sources":["../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport * as Styled from './style'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport type { BadgeProps } from './types'\n\nconst COMPONENT_NAME = 'Badge'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [BadgeProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/Badge/types.ts)\n */\nexport const Badge: React.ForwardRefExoticComponent<BadgeProps> = withMergedProps<BadgeProps, HTMLDivElement>(\n forwardRef<HTMLDivElement, MergedProps<BadgeProps>>((props, ref) => {\n const {\n size = 's',\n borderRadius = 3,\n textProps = {},\n iconProps = {},\n children,\n content,\n icon,\n ...restProps\n } = props\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n const iconBaseProps: IconProps = { color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} size={size} borderRadius={borderRadius} ref={ref}>\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps, iconBaseProps, iconProps, icon })\n ) : (\n <>\n {before ? (\n <Icon\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n {children || content ? (\n <Text {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n ) : null}\n {after ? (\n <Icon\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => (props.round ? SIZES_ROUND : SIZES),\n }\n)\n"],"names":["Badge","withMergedProps","forwardRef","props","ref","size","borderRadius","textProps","iconProps","children","content","icon","restProps","before","after","Array","isArray","baseTextProps","as","color","marginLeft","undefined","marginRight","iconBaseProps","_jsx","Styled","_jsxs","jsxs","_Fragment","jsx","Icon","name","Text","displayName","sizes","round","SIZES_ROUND","SIZES"],"mappings":"iSAuBO,MAAMA,MAAqDC,gBAAAA,gBAChEC,MAAAA,YAAoD,CAACC,EAAOC,KAC1D,MAAMC,KACJA,EAAO,IAAGC,aACVA,EAAe,EAACC,UAChBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EAAAC,SACdA,EAAQC,QACRA,EAAOC,KACPA,KACGC,GACDT,EAEJ,MAAOU,EAAQC,GAASC,MAAMC,QAAQL,GAAQA,EAAO,CAACA,GAEtD,MAAMM,EAA2B,CAC/BC,GAAI,OACJb,KAAM,UACNc,MAAO,UACPC,WAAYP,EAAS,cAAWQ,EAChCC,YAAaR,EAAQ,cAAWO,GAElC,MAAME,EAA2B,CAAEJ,MAAO,WAE1C,OACEK,WAAAA,IAACC,MAAAA,KAAW,IAAKb,EAAWP,KAAMA,EAAMC,aAAcA,EAAcF,IAAKA,EAAIK,gBACnEA,GAAa,WACnBA,EAAS,CAAEQ,gBAAeV,YAAWgB,gBAAef,YAAWG,SAE/De,WAAAC,KAAAC,oBAAA,CAAAnB,SACGI,CAAAA,EACCW,WAAAK,IAACC,UAAI,CACHC,YAAalB,GAAW,SAAWA,OAASQ,EAC5CV,YAAaE,GAAW,SAAWA,OAASQ,KACxCE,KACAf,IAEJ,KACHC,GAAYC,EACXc,WAAAA,IAACQ,KAAAA,KAAI,IAAKf,KAAmBV,EAASE,SACnCA,GAAYC,IAEb,KACHI,EACCU,WAAAA,IAACM,KAAAA,KAAI,CACHC,YAAajB,GAAU,SAAWA,OAAQO,EAC1CV,YAAaG,GAAU,SAAWA,OAAQO,KACtCE,KACAf,IAEJ,SAGI,IAGlB,CACEyB,YArEmB,QAsEnBC,MAAQ/B,GAAWA,EAAMgC,MAAQC,UAAWA,YAAGC,UAAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.mjs","sources":["../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport * as Styled from './style'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport type { BadgeProps } from './types'\n\nconst COMPONENT_NAME = 'Badge'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [BadgeProps](https://github.com/foxford/ui/blob/master/src/components/Badge/types.ts)\n */\nexport const Badge: React.ForwardRefExoticComponent<BadgeProps> = withMergedProps<BadgeProps, HTMLDivElement>(\n forwardRef<HTMLDivElement, MergedProps<BadgeProps>>((props, ref) => {\n const {\n size = 's',\n borderRadius = 3,\n textProps = {},\n iconProps = {},\n children,\n content,\n icon,\n ...restProps\n } = props\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n const iconBaseProps: IconProps = { color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} size={size} borderRadius={borderRadius} ref={ref}>\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps, iconBaseProps, iconProps, icon })\n ) : (\n <>\n {before ? (\n <Icon\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n {children || content ? (\n <Text {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n ) : null}\n {after ? (\n <Icon\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => (props.round ? SIZES_ROUND : SIZES),\n }\n)\n"],"names":["Badge","withMergedProps","forwardRef","props","ref","size","borderRadius","textProps","iconProps","children","content","icon","restProps","before","after","Array","isArray","baseTextProps","as","color","marginLeft","undefined","marginRight","iconBaseProps","_jsx","Styled","_jsxs","_Fragment","Icon","name","Text","displayName","sizes","round","SIZES_ROUND","SIZES"],"mappings":"8RAuBO,MAAMA,MAAqDC,gBAChEC,YAAoD,CAACC,EAAOC,KAC1D,MAAMC,KACJA,EAAO,IAAGC,aACVA,EAAe,EAACC,UAChBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EAAAC,SACdA,EAAQC,QACRA,EAAOC,KACPA,KACGC,GACDT,EAEJ,MAAOU,EAAQC,GAASC,MAAMC,QAAQL,GAAQA,EAAO,CAACA,GAEtD,MAAMM,EAA2B,CAC/BC,GAAI,OACJb,KAAM,UACNc,MAAO,UACPC,WAAYP,EAAS,cAAWQ,EAChCC,YAAaR,EAAQ,cAAWO,GAElC,MAAME,EAA2B,CAAEJ,MAAO,WAE1C,OACEK,IAACC,KAAW,IAAKb,EAAWP,KAAMA,EAAMC,aAAcA,EAAcF,IAAKA,EAAIK,gBACnEA,GAAa,WACnBA,EAAS,CAAEQ,gBAAeV,YAAWgB,gBAAef,YAAWG,SAE/De,KAAAC,SAAA,CAAAlB,SACGI,CAAAA,EACCW,IAACI,KAAI,CACHC,YAAahB,GAAW,SAAWA,OAASQ,EAC5CV,YAAaE,GAAW,SAAWA,OAASQ,KACxCE,KACAf,IAEJ,KACHC,GAAYC,EACXc,IAACM,KAAI,IAAKb,KAAmBV,EAASE,SACnCA,GAAYC,IAEb,KACHI,EACCU,IAACI,KAAI,CACHC,YAAaf,GAAU,SAAWA,OAAQO,EAC1CV,YAAaG,GAAU,SAAWA,OAAQO,KACtCE,KACAf,IAEJ,SAGI,IAGlB,CACEuB,YArEmB,QAsEnBC,MAAQ7B,GAAWA,EAAM8B,MAAQC,YAAcC"}
1
+ {"version":3,"file":"Badge.mjs","sources":["../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport * as Styled from './style'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport type { BadgeProps } from './types'\n\nconst COMPONENT_NAME = 'Badge'\n\n/**\n *\n * Component accepts all \\<div\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [BadgeProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/Badge/types.ts)\n */\nexport const Badge: React.ForwardRefExoticComponent<BadgeProps> = withMergedProps<BadgeProps, HTMLDivElement>(\n forwardRef<HTMLDivElement, MergedProps<BadgeProps>>((props, ref) => {\n const {\n size = 's',\n borderRadius = 3,\n textProps = {},\n iconProps = {},\n children,\n content,\n icon,\n ...restProps\n } = props\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n const iconBaseProps: IconProps = { color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} size={size} borderRadius={borderRadius} ref={ref}>\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps, iconBaseProps, iconProps, icon })\n ) : (\n <>\n {before ? (\n <Icon\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n {children || content ? (\n <Text {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n ) : null}\n {after ? (\n <Icon\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => (props.round ? SIZES_ROUND : SIZES),\n }\n)\n"],"names":["Badge","withMergedProps","forwardRef","props","ref","size","borderRadius","textProps","iconProps","children","content","icon","restProps","before","after","Array","isArray","baseTextProps","as","color","marginLeft","undefined","marginRight","iconBaseProps","_jsx","Styled","_jsxs","_Fragment","Icon","name","Text","displayName","sizes","round","SIZES_ROUND","SIZES"],"mappings":"8RAuBO,MAAMA,MAAqDC,gBAChEC,YAAoD,CAACC,EAAOC,KAC1D,MAAMC,KACJA,EAAO,IAAGC,aACVA,EAAe,EAACC,UAChBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EAAAC,SACdA,EAAQC,QACRA,EAAOC,KACPA,KACGC,GACDT,EAEJ,MAAOU,EAAQC,GAASC,MAAMC,QAAQL,GAAQA,EAAO,CAACA,GAEtD,MAAMM,EAA2B,CAC/BC,GAAI,OACJb,KAAM,UACNc,MAAO,UACPC,WAAYP,EAAS,cAAWQ,EAChCC,YAAaR,EAAQ,cAAWO,GAElC,MAAME,EAA2B,CAAEJ,MAAO,WAE1C,OACEK,IAACC,KAAW,IAAKb,EAAWP,KAAMA,EAAMC,aAAcA,EAAcF,IAAKA,EAAIK,gBACnEA,GAAa,WACnBA,EAAS,CAAEQ,gBAAeV,YAAWgB,gBAAef,YAAWG,SAE/De,KAAAC,SAAA,CAAAlB,SACGI,CAAAA,EACCW,IAACI,KAAI,CACHC,YAAahB,GAAW,SAAWA,OAASQ,EAC5CV,YAAaE,GAAW,SAAWA,OAASQ,KACxCE,KACAf,IAEJ,KACHC,GAAYC,EACXc,IAACM,KAAI,IAAKb,KAAmBV,EAASE,SACnCA,GAAYC,IAEb,KACHI,EACCU,IAACI,KAAI,CACHC,YAAaf,GAAU,SAAWA,OAAQO,EAC1CV,YAAaG,GAAU,SAAWA,OAAQO,KACtCE,KACAf,IAEJ,SAGI,IAGlB,CACEuB,YArEmB,QAsEnBC,MAAQ7B,GAAWA,EAAM8B,MAAQC,YAAcC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["/* eslint-disable prefer-const */\nimport { forwardRef } from 'react'\nimport { useTheme } from 'styled-components'\nimport { useClassname } from 'hooks/useClassname'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport { Text } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { Size } from 'shared/types'\nimport { useComputedRel, useComputedLinkProps } from './hooks'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport { SIZES_DEFAULT, SIZES_ROUND_DEFAULT, PROPS_BY_SIZE } from './default-constants'\nimport type { ButtonProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Button'\n\n/**\n *\n * Component accepts all \\<button\\> attributes.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ButtonProps](https://github.com/foxford/ui/blob/master/src/components/Button/types.ts)\n */\nconst Button: React.ForwardRefExoticComponent<ButtonProps> = withMergedProps<ButtonProps, HTMLButtonElement>(\n forwardRef<HTMLButtonElement, MergedProps<ButtonProps>>((props, ref) => {\n let {\n size = 'm',\n inline = true,\n rounded = true,\n color = 'accent',\n fontColor = 'white',\n textProps = {},\n iconProps = {},\n as: _as,\n className,\n children,\n content,\n fontWeight,\n icon,\n innerRef,\n ...restProps\n } = props\n\n const theme = useTheme()\n\n if (restProps.preset === 'default' && typeof size === 'string' && !restProps.round) {\n const propsBySize = PROPS_BY_SIZE[size as Size] ?? {}\n restProps = { ...propsBySize, ...restProps }\n }\n\n if (restProps.href) _as = 'a'\n if (restProps.to) _as = theme.link\n if (restProps.disabled) _as = 'button'\n\n if (restProps.primary) color = 'primary'\n if (restProps.secondary) color = 'atlantis'\n\n const rootClassName = useClassname(COMPONENT_NAME, className)\n const textClassName = useClassname(COMPONENT_NAME)\n const rel = useComputedRel(theme, restProps)\n const linkProps = useComputedLinkProps(_as, restProps)\n\n let [before, after] = Array.isArray(icon) ? icon : [icon]\n\n if (restProps.success) {\n before = 'checkFill'\n after = null\n }\n\n if (restProps.preset === 'brand' && restProps.loading) {\n before = <Styled.LoaderIcon />\n after = null\n }\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n weight: fontWeight ?? (restProps.preset === 'brand' ? 800 : 600),\n lineHeight: restProps.preset === 'brand' ? 1.2 : 1,\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n return (\n <Styled.Root\n {...restProps}\n {...linkProps}\n size={size}\n inline={inline}\n color={color}\n fontColor={fontColor}\n rounded={rounded}\n rel={rel}\n as={_as}\n className={rootClassName}\n ref={ref ?? innerRef}\n >\n {typeof children === 'function' ? (\n children({\n baseTextProps,\n textProps,\n iconBaseProps,\n iconProps,\n icon: [before, after],\n })\n ) : (\n <>\n {before ? (\n <Icon\n className='icon'\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n {children || content ? (\n <Text className={`${textClassName}__content`} {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n ) : null}\n {after ? (\n <Icon\n className='icon'\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n let sizes = props.preset === 'brand' ? SIZES : SIZES_DEFAULT\n if (props.round) sizes = props.preset === 'brand' ? SIZES_ROUND : SIZES_ROUND_DEFAULT\n\n return sizes\n },\n }\n)\n\nexport { Button, COMPONENT_NAME, SIZES, SIZES_ROUND }\n\nexport type { ButtonProps }\n"],"names":["Button","withMergedProps","forwardRef","props","ref","size","inline","rounded","color","fontColor","textProps","iconProps","as","_as","className","children","content","fontWeight","icon","innerRef","restProps","theme","useTheme","preset","round","PROPS_BY_SIZE","href","to","link","disabled","primary","secondary","rootClassName","useClassname","textClassName","rel","useComputedRel","linkProps","useComputedLinkProps","before","after","Array","isArray","success","loading","_jsx","jsx","Styled","baseTextProps","weight","lineHeight","marginLeft","undefined","marginRight","iconBaseProps","_jsxs","jsxs","_Fragment","Icon","name","Text","displayName","sizes","SIZES","SIZES_DEFAULT","SIZES_ROUND","SIZES_ROUND_DEFAULT"],"mappings":"wdA6BMA,MAAAA,OAAuDC,gBAAAA,gBAC3DC,MAAAA,YAAwD,CAACC,EAAOC,KAC9D,IAAIC,KACFA,EAAO,IAAGC,OACVA,GAAS,EAAIC,QACbA,GAAU,EAAIC,MACdA,EAAQ,SAAQC,UAChBA,EAAY,QAAOC,UACnBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EACdC,GAAIC,EAAGC,UACPA,EAASC,SACTA,EAAQC,QACRA,EAAOC,WACPA,EAAUC,KACVA,EAAIC,SACJA,KACGC,GACDjB,EAEJ,MAAMkB,EAAQC,OAAAA,WAEVF,EAAUG,SAAW,kBAAoBlB,GAAS,UAAae,EAAUI,QAE3EJ,EAAY,IADQK,iBAAAA,cAAcpB,IAAiB,CAAA,KAClBe,IAG/BA,EAAUM,OAAMb,EAAM,KACtBO,EAAUO,KAAId,EAAMQ,EAAMO,MAC1BR,EAAUS,WAAUhB,EAAM,UAE1BO,EAAUU,UAAStB,EAAQ,WAC3BY,EAAUW,YAAWvB,EAAQ,YAEjC,MAAMwB,EAAgBC,aAAAA,aA9CH,SA8CgCnB,GACnD,MAAMoB,EAAgBD,0BA/CH,UAgDnB,MAAME,EAAMC,MAAAA,eAAef,EAAOD,GAClC,MAAMiB,EAAYC,MAAAA,qBAAqBzB,EAAKO,GAE5C,IAAKmB,EAAQC,GAASC,MAAMC,QAAQxB,GAAQA,EAAO,CAACA,GAEhDE,EAAUuB,UACZJ,EAAS,YACTC,EAAQ,MAGNpB,EAAUG,SAAW,SAAWH,EAAUwB,UAC5CL,EAASM,WAAAC,IAACC,qBACVP,EAAQ,MAGV,MAAMQ,EAA2B,CAC/BpC,GAAI,OACJP,KAAM,UACNG,MAAO,UACPyC,OAAQhC,IAAeG,EAAUG,SAAW,QAAU,IAAM,KAC5D2B,WAAY9B,EAAUG,SAAW,QAAU,IAAM,EACjD4B,WAAYZ,EAAS,cAAWa,EAChCC,YAAab,EAAQ,cAAWY,GAGlC,MAAME,EAA2B,CAAE1C,GAAI,OAAQJ,MAAO,WAEtD,OACEqC,WAAAA,IAACE,MAAAA,KAAW,IACN3B,KACAiB,EACJhC,KAAMA,EACNC,OAAQA,EACRE,MAAOA,EACPC,UAAWA,EACXF,QAASA,EACT4B,IAAKA,EACLvB,GAAIC,EACJC,UAAWkB,EACX5B,IAAKA,GAAOe,EAASJ,gBAEbA,GAAa,WACnBA,EAAS,CACPiC,gBACAtC,YACA4C,gBACA3C,YACAO,KAAM,CAACqB,EAAQC,KAGjBe,WAAAC,KAAAC,oBAAA,CAAA1C,SACGwB,CAAAA,EACCM,WAAAC,IAACY,UAAI,CACH5C,UAAU,OACV6C,YAAapB,GAAW,SAAWA,OAASa,EAC5ClC,YAAaqB,GAAW,SAAWA,OAASa,KACxCE,KACA3C,IAEJ,KACHI,GAAYC,EACX6B,WAAAA,IAACe,KAAAA,KAAI,CAAC9C,UAAW,GAAGoB,gBAA8Bc,KAAmBtC,EAASK,SAC3EA,GAAYC,IAEb,KACHwB,EACCK,WAAAA,IAACa,KAAAA,KAAI,CACH5C,UAAU,OACV6C,YAAanB,GAAU,SAAWA,OAAQY,EAC1ClC,YAAasB,GAAU,SAAWA,OAAQY,KACtCE,KACA3C,IAEJ,SAGI,IAGlB,CACEkD,YAhImB,SAiInBC,MAAQ3D,IACN,IAAI2D,EAAQ3D,EAAMoB,SAAW,QAAUwC,UAAAA,MAAQC,iBAAAA,cAG/C,OAFI7D,EAAMqB,QAAOsC,EAAQ3D,EAAMoB,SAAW,QAAU0C,UAAWA,YAAGC,sCAE3DJ,CAAK,yHArIK"}
1
+ {"version":3,"file":"Button.js","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["/* eslint-disable prefer-const */\nimport { forwardRef } from 'react'\nimport { useTheme } from 'styled-components'\nimport { useClassname } from 'hooks/useClassname'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport { Text } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { Size } from 'shared/types'\nimport { useComputedRel, useComputedLinkProps } from './hooks'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport { SIZES_DEFAULT, SIZES_ROUND_DEFAULT, PROPS_BY_SIZE } from './default-constants'\nimport type { ButtonProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Button'\n\n/**\n *\n * Component accepts all \\<button\\> attributes.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ButtonProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/Button/types.ts)\n */\nconst Button: React.ForwardRefExoticComponent<ButtonProps> = withMergedProps<ButtonProps, HTMLButtonElement>(\n forwardRef<HTMLButtonElement, MergedProps<ButtonProps>>((props, ref) => {\n let {\n size = 'm',\n inline = true,\n rounded = true,\n color = 'accent',\n fontColor = 'white',\n textProps = {},\n iconProps = {},\n as: _as,\n className,\n children,\n content,\n fontWeight,\n icon,\n innerRef,\n ...restProps\n } = props\n\n const theme = useTheme()\n\n if (restProps.preset === 'default' && typeof size === 'string' && !restProps.round) {\n const propsBySize = PROPS_BY_SIZE[size as Size] ?? {}\n restProps = { ...propsBySize, ...restProps }\n }\n\n if (restProps.href) _as = 'a'\n if (restProps.to) _as = theme.link\n if (restProps.disabled) _as = 'button'\n\n if (restProps.primary) color = 'primary'\n if (restProps.secondary) color = 'atlantis'\n\n const rootClassName = useClassname(COMPONENT_NAME, className)\n const textClassName = useClassname(COMPONENT_NAME)\n const rel = useComputedRel(theme, restProps)\n const linkProps = useComputedLinkProps(_as, restProps)\n\n let [before, after] = Array.isArray(icon) ? icon : [icon]\n\n if (restProps.success) {\n before = 'checkFill'\n after = null\n }\n\n if (restProps.preset === 'brand' && restProps.loading) {\n before = <Styled.LoaderIcon />\n after = null\n }\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n weight: fontWeight ?? (restProps.preset === 'brand' ? 800 : 600),\n lineHeight: restProps.preset === 'brand' ? 1.2 : 1,\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n return (\n <Styled.Root\n {...restProps}\n {...linkProps}\n size={size}\n inline={inline}\n color={color}\n fontColor={fontColor}\n rounded={rounded}\n rel={rel}\n as={_as}\n className={rootClassName}\n ref={ref ?? innerRef}\n >\n {typeof children === 'function' ? (\n children({\n baseTextProps,\n textProps,\n iconBaseProps,\n iconProps,\n icon: [before, after],\n })\n ) : (\n <>\n {before ? (\n <Icon\n className='icon'\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n {children || content ? (\n <Text className={`${textClassName}__content`} {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n ) : null}\n {after ? (\n <Icon\n className='icon'\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n let sizes = props.preset === 'brand' ? SIZES : SIZES_DEFAULT\n if (props.round) sizes = props.preset === 'brand' ? SIZES_ROUND : SIZES_ROUND_DEFAULT\n\n return sizes\n },\n }\n)\n\nexport { Button, COMPONENT_NAME, SIZES, SIZES_ROUND }\n\nexport type { ButtonProps }\n"],"names":["Button","withMergedProps","forwardRef","props","ref","size","inline","rounded","color","fontColor","textProps","iconProps","as","_as","className","children","content","fontWeight","icon","innerRef","restProps","theme","useTheme","preset","round","PROPS_BY_SIZE","href","to","link","disabled","primary","secondary","rootClassName","useClassname","textClassName","rel","useComputedRel","linkProps","useComputedLinkProps","before","after","Array","isArray","success","loading","_jsx","jsx","Styled","baseTextProps","weight","lineHeight","marginLeft","undefined","marginRight","iconBaseProps","_jsxs","jsxs","_Fragment","Icon","name","Text","displayName","sizes","SIZES","SIZES_DEFAULT","SIZES_ROUND","SIZES_ROUND_DEFAULT"],"mappings":"wdA6BMA,MAAAA,OAAuDC,gBAAAA,gBAC3DC,MAAAA,YAAwD,CAACC,EAAOC,KAC9D,IAAIC,KACFA,EAAO,IAAGC,OACVA,GAAS,EAAIC,QACbA,GAAU,EAAIC,MACdA,EAAQ,SAAQC,UAChBA,EAAY,QAAOC,UACnBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EACdC,GAAIC,EAAGC,UACPA,EAASC,SACTA,EAAQC,QACRA,EAAOC,WACPA,EAAUC,KACVA,EAAIC,SACJA,KACGC,GACDjB,EAEJ,MAAMkB,EAAQC,OAAAA,WAEVF,EAAUG,SAAW,kBAAoBlB,GAAS,UAAae,EAAUI,QAE3EJ,EAAY,IADQK,iBAAAA,cAAcpB,IAAiB,CAAA,KAClBe,IAG/BA,EAAUM,OAAMb,EAAM,KACtBO,EAAUO,KAAId,EAAMQ,EAAMO,MAC1BR,EAAUS,WAAUhB,EAAM,UAE1BO,EAAUU,UAAStB,EAAQ,WAC3BY,EAAUW,YAAWvB,EAAQ,YAEjC,MAAMwB,EAAgBC,aAAAA,aA9CH,SA8CgCnB,GACnD,MAAMoB,EAAgBD,0BA/CH,UAgDnB,MAAME,EAAMC,MAAAA,eAAef,EAAOD,GAClC,MAAMiB,EAAYC,MAAAA,qBAAqBzB,EAAKO,GAE5C,IAAKmB,EAAQC,GAASC,MAAMC,QAAQxB,GAAQA,EAAO,CAACA,GAEhDE,EAAUuB,UACZJ,EAAS,YACTC,EAAQ,MAGNpB,EAAUG,SAAW,SAAWH,EAAUwB,UAC5CL,EAASM,WAAAC,IAACC,qBACVP,EAAQ,MAGV,MAAMQ,EAA2B,CAC/BpC,GAAI,OACJP,KAAM,UACNG,MAAO,UACPyC,OAAQhC,IAAeG,EAAUG,SAAW,QAAU,IAAM,KAC5D2B,WAAY9B,EAAUG,SAAW,QAAU,IAAM,EACjD4B,WAAYZ,EAAS,cAAWa,EAChCC,YAAab,EAAQ,cAAWY,GAGlC,MAAME,EAA2B,CAAE1C,GAAI,OAAQJ,MAAO,WAEtD,OACEqC,WAAAA,IAACE,MAAAA,KAAW,IACN3B,KACAiB,EACJhC,KAAMA,EACNC,OAAQA,EACRE,MAAOA,EACPC,UAAWA,EACXF,QAASA,EACT4B,IAAKA,EACLvB,GAAIC,EACJC,UAAWkB,EACX5B,IAAKA,GAAOe,EAASJ,gBAEbA,GAAa,WACnBA,EAAS,CACPiC,gBACAtC,YACA4C,gBACA3C,YACAO,KAAM,CAACqB,EAAQC,KAGjBe,WAAAC,KAAAC,oBAAA,CAAA1C,SACGwB,CAAAA,EACCM,WAAAC,IAACY,UAAI,CACH5C,UAAU,OACV6C,YAAapB,GAAW,SAAWA,OAASa,EAC5ClC,YAAaqB,GAAW,SAAWA,OAASa,KACxCE,KACA3C,IAEJ,KACHI,GAAYC,EACX6B,WAAAA,IAACe,KAAAA,KAAI,CAAC9C,UAAW,GAAGoB,gBAA8Bc,KAAmBtC,EAASK,SAC3EA,GAAYC,IAEb,KACHwB,EACCK,WAAAA,IAACa,KAAAA,KAAI,CACH5C,UAAU,OACV6C,YAAanB,GAAU,SAAWA,OAAQY,EAC1ClC,YAAasB,GAAU,SAAWA,OAAQY,KACtCE,KACA3C,IAEJ,SAGI,IAGlB,CACEkD,YAhImB,SAiInBC,MAAQ3D,IACN,IAAI2D,EAAQ3D,EAAMoB,SAAW,QAAUwC,UAAAA,MAAQC,iBAAAA,cAG/C,OAFI7D,EAAMqB,QAAOsC,EAAQ3D,EAAMoB,SAAW,QAAU0C,UAAWA,YAAGC,sCAE3DJ,CAAK,yHArIK"}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.mjs","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["/* eslint-disable prefer-const */\nimport { forwardRef } from 'react'\nimport { useTheme } from 'styled-components'\nimport { useClassname } from 'hooks/useClassname'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport { Text } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { Size } from 'shared/types'\nimport { useComputedRel, useComputedLinkProps } from './hooks'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport { SIZES_DEFAULT, SIZES_ROUND_DEFAULT, PROPS_BY_SIZE } from './default-constants'\nimport type { ButtonProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Button'\n\n/**\n *\n * Component accepts all \\<button\\> attributes.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ButtonProps](https://github.com/foxford/ui/blob/master/src/components/Button/types.ts)\n */\nconst Button: React.ForwardRefExoticComponent<ButtonProps> = withMergedProps<ButtonProps, HTMLButtonElement>(\n forwardRef<HTMLButtonElement, MergedProps<ButtonProps>>((props, ref) => {\n let {\n size = 'm',\n inline = true,\n rounded = true,\n color = 'accent',\n fontColor = 'white',\n textProps = {},\n iconProps = {},\n as: _as,\n className,\n children,\n content,\n fontWeight,\n icon,\n innerRef,\n ...restProps\n } = props\n\n const theme = useTheme()\n\n if (restProps.preset === 'default' && typeof size === 'string' && !restProps.round) {\n const propsBySize = PROPS_BY_SIZE[size as Size] ?? {}\n restProps = { ...propsBySize, ...restProps }\n }\n\n if (restProps.href) _as = 'a'\n if (restProps.to) _as = theme.link\n if (restProps.disabled) _as = 'button'\n\n if (restProps.primary) color = 'primary'\n if (restProps.secondary) color = 'atlantis'\n\n const rootClassName = useClassname(COMPONENT_NAME, className)\n const textClassName = useClassname(COMPONENT_NAME)\n const rel = useComputedRel(theme, restProps)\n const linkProps = useComputedLinkProps(_as, restProps)\n\n let [before, after] = Array.isArray(icon) ? icon : [icon]\n\n if (restProps.success) {\n before = 'checkFill'\n after = null\n }\n\n if (restProps.preset === 'brand' && restProps.loading) {\n before = <Styled.LoaderIcon />\n after = null\n }\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n weight: fontWeight ?? (restProps.preset === 'brand' ? 800 : 600),\n lineHeight: restProps.preset === 'brand' ? 1.2 : 1,\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n return (\n <Styled.Root\n {...restProps}\n {...linkProps}\n size={size}\n inline={inline}\n color={color}\n fontColor={fontColor}\n rounded={rounded}\n rel={rel}\n as={_as}\n className={rootClassName}\n ref={ref ?? innerRef}\n >\n {typeof children === 'function' ? (\n children({\n baseTextProps,\n textProps,\n iconBaseProps,\n iconProps,\n icon: [before, after],\n })\n ) : (\n <>\n {before ? (\n <Icon\n className='icon'\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n {children || content ? (\n <Text className={`${textClassName}__content`} {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n ) : null}\n {after ? (\n <Icon\n className='icon'\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n let sizes = props.preset === 'brand' ? SIZES : SIZES_DEFAULT\n if (props.round) sizes = props.preset === 'brand' ? SIZES_ROUND : SIZES_ROUND_DEFAULT\n\n return sizes\n },\n }\n)\n\nexport { Button, COMPONENT_NAME, SIZES, SIZES_ROUND }\n\nexport type { ButtonProps }\n"],"names":["COMPONENT_NAME","Button","withMergedProps","forwardRef","props","ref","size","inline","rounded","color","fontColor","textProps","iconProps","as","_as","className","children","content","fontWeight","icon","innerRef","restProps","theme","useTheme","preset","round","PROPS_BY_SIZE","href","to","link","disabled","primary","secondary","rootClassName","useClassname","textClassName","rel","useComputedRel","linkProps","useComputedLinkProps","before","after","Array","isArray","success","loading","_jsx","Styled","baseTextProps","weight","lineHeight","marginLeft","undefined","marginRight","iconBaseProps","_jsxs","_Fragment","Icon","name","Text","displayName","sizes","SIZES","SIZES_DEFAULT","SIZES_ROUND","SIZES_ROUND_DEFAULT"],"mappings":"0hBAiBMA,MAAAA,eAAiB,SAYjBC,MAAAA,OAAuDC,gBAC3DC,YAAwD,CAACC,EAAOC,KAC9D,IAAIC,KACFA,EAAO,IAAGC,OACVA,GAAS,EAAIC,QACbA,GAAU,EAAIC,MACdA,EAAQ,SAAQC,UAChBA,EAAY,QAAOC,UACnBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EACdC,GAAIC,EAAGC,UACPA,EAASC,SACTA,EAAQC,QACRA,EAAOC,WACPA,EAAUC,KACVA,EAAIC,SACJA,KACGC,GACDjB,EAEJ,MAAMkB,EAAQC,WAEVF,EAAUG,SAAW,kBAAoBlB,GAAS,UAAae,EAAUI,QAE3EJ,EAAY,IADQK,cAAcpB,IAAiB,CAAA,KAClBe,IAG/BA,EAAUM,OAAMb,EAAM,KACtBO,EAAUO,KAAId,EAAMQ,EAAMO,MAC1BR,EAAUS,WAAUhB,EAAM,UAE1BO,EAAUU,UAAStB,EAAQ,WAC3BY,EAAUW,YAAWvB,EAAQ,YAEjC,MAAMwB,EAAgBC,aA9CH,SA8CgCnB,GACnD,MAAMoB,EAAgBD,aA/CH,UAgDnB,MAAME,EAAMC,eAAef,EAAOD,GAClC,MAAMiB,EAAYC,qBAAqBzB,EAAKO,GAE5C,IAAKmB,EAAQC,GAASC,MAAMC,QAAQxB,GAAQA,EAAO,CAACA,GAEhDE,EAAUuB,UACZJ,EAAS,YACTC,EAAQ,MAGNpB,EAAUG,SAAW,SAAWH,EAAUwB,UAC5CL,EAASM,IAACC,eACVN,EAAQ,MAGV,MAAMO,EAA2B,CAC/BnC,GAAI,OACJP,KAAM,UACNG,MAAO,UACPwC,OAAQ/B,IAAeG,EAAUG,SAAW,QAAU,IAAM,KAC5D0B,WAAY7B,EAAUG,SAAW,QAAU,IAAM,EACjD2B,WAAYX,EAAS,cAAWY,EAChCC,YAAaZ,EAAQ,cAAWW,GAGlC,MAAME,EAA2B,CAAEzC,GAAI,OAAQJ,MAAO,WAEtD,OACEqC,IAACC,KAAW,IACN1B,KACAiB,EACJhC,KAAMA,EACNC,OAAQA,EACRE,MAAOA,EACPC,UAAWA,EACXF,QAASA,EACT4B,IAAKA,EACLvB,GAAIC,EACJC,UAAWkB,EACX5B,IAAKA,GAAOe,EAASJ,gBAEbA,GAAa,WACnBA,EAAS,CACPgC,gBACArC,YACA2C,gBACA1C,YACAO,KAAM,CAACqB,EAAQC,KAGjBc,KAAAC,SAAA,CAAAxC,SACGwB,CAAAA,EACCM,IAACW,KAAI,CACH1C,UAAU,OACV2C,YAAalB,GAAW,SAAWA,OAASY,EAC5CjC,YAAaqB,GAAW,SAAWA,OAASY,KACxCE,KACA1C,IAEJ,KACHI,GAAYC,EACX6B,IAACa,KAAI,CAAC5C,UAAW,GAAGoB,gBAA8Ba,KAAmBrC,EAASK,SAC3EA,GAAYC,IAEb,KACHwB,EACCK,IAACW,KAAI,CACH1C,UAAU,OACV2C,YAAajB,GAAU,SAAWA,OAAQW,EAC1CjC,YAAasB,GAAU,SAAWA,OAAQW,KACtCE,KACA1C,IAEJ,SAGI,IAGlB,CACEgD,YAhImB,SAiInBC,MAAQzD,IACN,IAAIyD,EAAQzD,EAAMoB,SAAW,QAAUsC,MAAQC,cAG/C,OAFI3D,EAAMqB,QAAOoC,EAAQzD,EAAMoB,SAAW,QAAUwC,YAAcC,qBAE3DJ,CAAK"}
1
+ {"version":3,"file":"Button.mjs","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["/* eslint-disable prefer-const */\nimport { forwardRef } from 'react'\nimport { useTheme } from 'styled-components'\nimport { useClassname } from 'hooks/useClassname'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Icon } from 'components/Icon'\nimport { Text } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { Size } from 'shared/types'\nimport { useComputedRel, useComputedLinkProps } from './hooks'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport { SIZES_DEFAULT, SIZES_ROUND_DEFAULT, PROPS_BY_SIZE } from './default-constants'\nimport type { ButtonProps } from './types'\nimport * as Styled from './style'\n\nconst COMPONENT_NAME = 'Button'\n\n/**\n *\n * Component accepts all \\<button\\> attributes.\n *\n * Responsive \"size\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ButtonProps](https://github.com/foxford/ui/blob/master/packages/ui/src/components/Button/types.ts)\n */\nconst Button: React.ForwardRefExoticComponent<ButtonProps> = withMergedProps<ButtonProps, HTMLButtonElement>(\n forwardRef<HTMLButtonElement, MergedProps<ButtonProps>>((props, ref) => {\n let {\n size = 'm',\n inline = true,\n rounded = true,\n color = 'accent',\n fontColor = 'white',\n textProps = {},\n iconProps = {},\n as: _as,\n className,\n children,\n content,\n fontWeight,\n icon,\n innerRef,\n ...restProps\n } = props\n\n const theme = useTheme()\n\n if (restProps.preset === 'default' && typeof size === 'string' && !restProps.round) {\n const propsBySize = PROPS_BY_SIZE[size as Size] ?? {}\n restProps = { ...propsBySize, ...restProps }\n }\n\n if (restProps.href) _as = 'a'\n if (restProps.to) _as = theme.link\n if (restProps.disabled) _as = 'button'\n\n if (restProps.primary) color = 'primary'\n if (restProps.secondary) color = 'atlantis'\n\n const rootClassName = useClassname(COMPONENT_NAME, className)\n const textClassName = useClassname(COMPONENT_NAME)\n const rel = useComputedRel(theme, restProps)\n const linkProps = useComputedLinkProps(_as, restProps)\n\n let [before, after] = Array.isArray(icon) ? icon : [icon]\n\n if (restProps.success) {\n before = 'checkFill'\n after = null\n }\n\n if (restProps.preset === 'brand' && restProps.loading) {\n before = <Styled.LoaderIcon />\n after = null\n }\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n weight: fontWeight ?? (restProps.preset === 'brand' ? 800 : 600),\n lineHeight: restProps.preset === 'brand' ? 1.2 : 1,\n marginLeft: before ? '0.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n return (\n <Styled.Root\n {...restProps}\n {...linkProps}\n size={size}\n inline={inline}\n color={color}\n fontColor={fontColor}\n rounded={rounded}\n rel={rel}\n as={_as}\n className={rootClassName}\n ref={ref ?? innerRef}\n >\n {typeof children === 'function' ? (\n children({\n baseTextProps,\n textProps,\n iconBaseProps,\n iconProps,\n icon: [before, after],\n })\n ) : (\n <>\n {before ? (\n <Icon\n className='icon'\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n {children || content ? (\n <Text className={`${textClassName}__content`} {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n ) : null}\n {after ? (\n <Icon\n className='icon'\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => {\n let sizes = props.preset === 'brand' ? SIZES : SIZES_DEFAULT\n if (props.round) sizes = props.preset === 'brand' ? SIZES_ROUND : SIZES_ROUND_DEFAULT\n\n return sizes\n },\n }\n)\n\nexport { Button, COMPONENT_NAME, SIZES, SIZES_ROUND }\n\nexport type { ButtonProps }\n"],"names":["COMPONENT_NAME","Button","withMergedProps","forwardRef","props","ref","size","inline","rounded","color","fontColor","textProps","iconProps","as","_as","className","children","content","fontWeight","icon","innerRef","restProps","theme","useTheme","preset","round","PROPS_BY_SIZE","href","to","link","disabled","primary","secondary","rootClassName","useClassname","textClassName","rel","useComputedRel","linkProps","useComputedLinkProps","before","after","Array","isArray","success","loading","_jsx","Styled","baseTextProps","weight","lineHeight","marginLeft","undefined","marginRight","iconBaseProps","_jsxs","_Fragment","Icon","name","Text","displayName","sizes","SIZES","SIZES_DEFAULT","SIZES_ROUND","SIZES_ROUND_DEFAULT"],"mappings":"0hBAiBMA,MAAAA,eAAiB,SAYjBC,MAAAA,OAAuDC,gBAC3DC,YAAwD,CAACC,EAAOC,KAC9D,IAAIC,KACFA,EAAO,IAAGC,OACVA,GAAS,EAAIC,QACbA,GAAU,EAAIC,MACdA,EAAQ,SAAQC,UAChBA,EAAY,QAAOC,UACnBA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EACdC,GAAIC,EAAGC,UACPA,EAASC,SACTA,EAAQC,QACRA,EAAOC,WACPA,EAAUC,KACVA,EAAIC,SACJA,KACGC,GACDjB,EAEJ,MAAMkB,EAAQC,WAEVF,EAAUG,SAAW,kBAAoBlB,GAAS,UAAae,EAAUI,QAE3EJ,EAAY,IADQK,cAAcpB,IAAiB,CAAA,KAClBe,IAG/BA,EAAUM,OAAMb,EAAM,KACtBO,EAAUO,KAAId,EAAMQ,EAAMO,MAC1BR,EAAUS,WAAUhB,EAAM,UAE1BO,EAAUU,UAAStB,EAAQ,WAC3BY,EAAUW,YAAWvB,EAAQ,YAEjC,MAAMwB,EAAgBC,aA9CH,SA8CgCnB,GACnD,MAAMoB,EAAgBD,aA/CH,UAgDnB,MAAME,EAAMC,eAAef,EAAOD,GAClC,MAAMiB,EAAYC,qBAAqBzB,EAAKO,GAE5C,IAAKmB,EAAQC,GAASC,MAAMC,QAAQxB,GAAQA,EAAO,CAACA,GAEhDE,EAAUuB,UACZJ,EAAS,YACTC,EAAQ,MAGNpB,EAAUG,SAAW,SAAWH,EAAUwB,UAC5CL,EAASM,IAACC,eACVN,EAAQ,MAGV,MAAMO,EAA2B,CAC/BnC,GAAI,OACJP,KAAM,UACNG,MAAO,UACPwC,OAAQ/B,IAAeG,EAAUG,SAAW,QAAU,IAAM,KAC5D0B,WAAY7B,EAAUG,SAAW,QAAU,IAAM,EACjD2B,WAAYX,EAAS,cAAWY,EAChCC,YAAaZ,EAAQ,cAAWW,GAGlC,MAAME,EAA2B,CAAEzC,GAAI,OAAQJ,MAAO,WAEtD,OACEqC,IAACC,KAAW,IACN1B,KACAiB,EACJhC,KAAMA,EACNC,OAAQA,EACRE,MAAOA,EACPC,UAAWA,EACXF,QAASA,EACT4B,IAAKA,EACLvB,GAAIC,EACJC,UAAWkB,EACX5B,IAAKA,GAAOe,EAASJ,gBAEbA,GAAa,WACnBA,EAAS,CACPgC,gBACArC,YACA2C,gBACA1C,YACAO,KAAM,CAACqB,EAAQC,KAGjBc,KAAAC,SAAA,CAAAxC,SACGwB,CAAAA,EACCM,IAACW,KAAI,CACH1C,UAAU,OACV2C,YAAalB,GAAW,SAAWA,OAASY,EAC5CjC,YAAaqB,GAAW,SAAWA,OAASY,KACxCE,KACA1C,IAEJ,KACHI,GAAYC,EACX6B,IAACa,KAAI,CAAC5C,UAAW,GAAGoB,gBAA8Ba,KAAmBrC,EAASK,SAC3EA,GAAYC,IAEb,KACHwB,EACCK,IAACW,KAAI,CACH1C,UAAU,OACV2C,YAAajB,GAAU,SAAWA,OAAQW,EAC1CjC,YAAasB,GAAU,SAAWA,OAAQW,KACtCE,KACA1C,IAEJ,SAGI,IAGlB,CACEgD,YAhImB,SAiInBC,MAAQzD,IACN,IAAIyD,EAAQzD,EAAMoB,SAAW,QAAUsC,MAAQC,cAG/C,OAFI3D,EAAMqB,QAAOoC,EAAQzD,EAAMoB,SAAW,QAAUwC,YAAcC,qBAE3DJ,CAAK"}
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.js","sources":["../../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport { Avatar } from 'components/Avatar'\nimport { Indicator } from 'components/Indicator'\nimport { IconButton } from 'components/IconButton'\nimport type { TextProps } from 'components/Text'\nimport type { IconButtonProps } from 'components/IconButton'\nimport {\n SIZES,\n SIZES_ICON,\n SIZES_CHIP_INDICATOR,\n SIZES_CHIP_AVATAR,\n SIZES_CHIP_AVATAR_SQUARE,\n SIZES_DISCARD_BUTTON,\n SIZES_DISCARD_BUTTON_SQUARE,\n} from './constants'\nimport * as Styled from './style'\nimport type { ChipProps } from './types'\n\nconst COMPONENT_NAME = 'Chip'\n\n/**\n *\n * Компонент поддерживает все нативные атрибуты рутового элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/Chip/types.ts).\n */\nconst Chip: React.ForwardRefExoticComponent<ChipProps> = withMergedProps<ChipProps>(\n forwardRef<HTMLElement, MergedProps<ChipProps>>((props, ref) => {\n const {\n size = 'm',\n primary = true,\n textProps = {},\n captionProps = {},\n iconProps = {},\n avatarProps = {},\n indicatorProps = {},\n discardButtonProps = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n children,\n text,\n caption,\n icon,\n ...restProps\n } = props\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let rootNode: any = 'div'\n\n if (restProps.onClick) rootNode = 'button'\n if (discardButtonProps.onClick) rootNode = 'div'\n\n let rootType: ChipProps['type']\n\n if (rootNode === 'button') rootType = 'button'\n if (restProps.type) rootType = restProps.type\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const textBaseProps: TextProps = {\n as: 'span',\n appearance: 'body',\n size: 'inherit',\n color: 'inherit',\n lineHeight: caption ? 1.3 : 1,\n }\n\n const captionBaseProps: TextProps = {\n as: 'span',\n appearance: 'body',\n size: 0.75,\n sizeUnits: 'em',\n color: 'inherit',\n lineHeight: 1,\n }\n\n const discardButtonBaseProps: IconButtonProps = {\n icon: 'close',\n disabled: restProps.disabled,\n }\n\n return (\n <Styled.Root {...restProps} {...sizeProps} as={rootNode} type={rootType} primary={primary} ref={ref}>\n {typeof children === 'function' ? (\n children({\n textProps: textBaseProps,\n captionProps: captionBaseProps,\n discardButtonProps: discardButtonBaseProps,\n })\n ) : (\n <>\n {before ? (\n <Icon\n preset='brand'\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n sizes={SIZES_ICON}\n {...sizeProps}\n {...iconProps}\n />\n ) : null}\n {avatarProps.src || avatarProps.text ? (\n <Avatar\n preset='brand'\n sizes={avatarProps.square ? SIZES_CHIP_AVATAR_SQUARE : SIZES_CHIP_AVATAR}\n {...sizeProps}\n {...avatarProps}\n />\n ) : null}\n <Styled.Content>\n <Text {...textBaseProps} {...textProps}>\n {children ?? text}\n </Text>\n {caption ? (\n <Text {...captionBaseProps} {...captionProps}>\n {caption}\n </Text>\n ) : null}\n </Styled.Content>\n {indicatorProps.children || indicatorProps.text ? (\n <Indicator sizes={SIZES_CHIP_INDICATOR} marginRight={3} {...sizeProps} {...indicatorProps} />\n ) : null}\n {after ? (\n <Icon\n preset='brand'\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n sizes={SIZES_ICON}\n {...sizeProps}\n {...iconProps}\n />\n ) : null}\n {discardButtonProps.onClick ? (\n <IconButton\n sizes={discardButtonProps.square ? SIZES_DISCARD_BUTTON_SQUARE : SIZES_DISCARD_BUTTON}\n {...sizeProps}\n {...discardButtonBaseProps}\n {...discardButtonProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Chip }\n"],"names":["Chip","withMergedProps","forwardRef","props","ref","size","primary","textProps","captionProps","iconProps","avatarProps","indicatorProps","discardButtonProps","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","children","text","caption","icon","restProps","rootNode","rootType","onClick","type","sizeProps","before","after","Array","isArray","textBaseProps","as","appearance","color","lineHeight","captionBaseProps","sizeUnits","discardButtonBaseProps","disabled","_jsx","Styled","_jsxs","jsxs","_Fragment","jsx","Icon","preset","name","undefined","sizes","SIZES_ICON","src","Avatar","square","SIZES_CHIP_AVATAR_SQUARE","SIZES_CHIP_AVATAR","Text","Indicator","SIZES_CHIP_INDICATOR","marginRight","IconButton","SIZES_DISCARD_BUTTON_SQUARE","SIZES_DISCARD_BUTTON","displayName","SIZES"],"mappings":"obAkCMA,MAAAA,KAAmDC,gBAAAA,gBACvDC,MAAAA,YAAgD,CAACC,EAAOC,KACtD,MAAMC,KACJA,EAAO,IAAGC,QACVA,GAAU,EAAIC,UACdA,EAAY,CAAE,EAAAC,aACdA,EAAe,CAAE,EAAAC,UACjBA,EAAY,CAAE,EAAAC,YACdA,EAAc,CAAE,EAAAC,eAChBA,EAAiB,CAAE,EAAAC,mBACnBA,EAAqB,CAAE,EAAAC,QACvBA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,SACNA,EAAQC,KACRA,EAAIC,QACJA,EAAOC,KACPA,KACGC,GACDpB,EAGJ,IAAIqB,EAAgB,MAKpB,IAAIC,EAHAF,EAAUG,UAASF,EAAW,UAC9BZ,EAAmBc,UAASF,EAAW,OAIvCA,IAAa,WAAUC,EAAW,UAClCF,EAAUI,OAAMF,EAAWF,EAAUI,MAEzC,MAAMC,EAAY,CAChBvB,OACAQ,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAOW,EAAQC,GAASC,MAAMC,QAAQV,GAAQA,EAAO,CAACA,GAEtD,MAAMW,EAA2B,CAC/BC,GAAI,OACJC,WAAY,OACZ9B,KAAM,UACN+B,MAAO,UACPC,WAAYhB,EAAU,IAAM,GAG9B,MAAMiB,EAA8B,CAClCJ,GAAI,OACJC,WAAY,OACZ9B,KAAM,IACNkC,UAAW,KACXH,MAAO,UACPC,WAAY,GAGd,MAAMG,EAA0C,CAC9ClB,KAAM,QACNmB,SAAUlB,EAAUkB,UAGtB,OACEC,WAAAA,IAACC,MAAAA,KAAW,IAAKpB,KAAeK,EAAWM,GAAIV,EAAUG,KAAMF,EAAUnB,QAASA,EAASF,IAAKA,EAAIe,gBAC1FA,GAAa,WACnBA,EAAS,CACPZ,UAAW0B,EACXzB,aAAc8B,EACd1B,mBAAoB4B,IAGtBI,WAAAC,KAAAC,oBAAA,CAAA3B,SACGU,CAAAA,EACCa,WAAAK,IAACC,UAAI,CACHC,OAAO,QACPC,YAAarB,GAAW,SAAWA,OAASsB,EAC5C7B,YAAaO,GAAW,SAAWA,OAASsB,EAC5CC,MAAOC,UAAWA,cACdzB,KACAnB,IAEJ,KACHC,EAAY4C,KAAO5C,EAAYU,KAC9BsB,WAAAK,IAACQ,cAAM,CACLN,OAAO,QACPG,MAAO1C,EAAY8C,OAASC,UAAAA,yBAA2BC,UAAkBA,qBACrE9B,KACAlB,IAEJ,KACJkC,WAAAC,KAACF,cAAc,CAAAxB,SAAA,CACbuB,WAAAK,IAACY,UAAI,IAAK1B,KAAmB1B,EAASY,SACnCA,GAAYC,IAEdC,EACCqB,WAAAK,IAACY,UAAI,IAAKrB,KAAsB9B,EAAYW,SACzCE,IAED,QAELV,EAAeQ,UAAYR,EAAeS,KACzCsB,WAAAK,IAACa,oBAAS,CAACR,MAAOS,UAAqBA,qBAACC,YAAa,KAAOlC,KAAejB,IACzE,KACHmB,EACCY,WAAAA,IAACM,KAAAA,KAAI,CACHC,OAAO,QACPC,YAAapB,GAAU,SAAWA,OAAQqB,EAC1C7B,YAAaQ,GAAU,SAAWA,OAAQqB,EAC1CC,MAAOC,UAAWA,cACdzB,KACAnB,IAEJ,KACHG,EAAmBc,QAClBgB,WAAAA,IAACqB,WAAAA,WAAU,CACTX,MAAOxC,EAAmB4C,OAASQ,UAAAA,4BAA8BC,UAAqBA,wBAClFrC,KACAY,KACA5B,IAEJ,SAGI,IAGlB,CACEsD,YAlJmB,OAmJnBd,MAAOe,UAAAA"}
1
+ {"version":3,"file":"Chip.js","sources":["../../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport { Avatar } from 'components/Avatar'\nimport { Indicator } from 'components/Indicator'\nimport { IconButton } from 'components/IconButton'\nimport type { TextProps } from 'components/Text'\nimport type { IconButtonProps } from 'components/IconButton'\nimport {\n SIZES,\n SIZES_ICON,\n SIZES_CHIP_INDICATOR,\n SIZES_CHIP_AVATAR,\n SIZES_CHIP_AVATAR_SQUARE,\n SIZES_DISCARD_BUTTON,\n SIZES_DISCARD_BUTTON_SQUARE,\n} from './constants'\nimport * as Styled from './style'\nimport type { ChipProps } from './types'\n\nconst COMPONENT_NAME = 'Chip'\n\n/**\n *\n * Компонент поддерживает все нативные атрибуты рутового элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/packages/ui/src/components/Chip/types.ts).\n */\nconst Chip: React.ForwardRefExoticComponent<ChipProps> = withMergedProps<ChipProps>(\n forwardRef<HTMLElement, MergedProps<ChipProps>>((props, ref) => {\n const {\n size = 'm',\n primary = true,\n textProps = {},\n captionProps = {},\n iconProps = {},\n avatarProps = {},\n indicatorProps = {},\n discardButtonProps = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n children,\n text,\n caption,\n icon,\n ...restProps\n } = props\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let rootNode: any = 'div'\n\n if (restProps.onClick) rootNode = 'button'\n if (discardButtonProps.onClick) rootNode = 'div'\n\n let rootType: ChipProps['type']\n\n if (rootNode === 'button') rootType = 'button'\n if (restProps.type) rootType = restProps.type\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const textBaseProps: TextProps = {\n as: 'span',\n appearance: 'body',\n size: 'inherit',\n color: 'inherit',\n lineHeight: caption ? 1.3 : 1,\n }\n\n const captionBaseProps: TextProps = {\n as: 'span',\n appearance: 'body',\n size: 0.75,\n sizeUnits: 'em',\n color: 'inherit',\n lineHeight: 1,\n }\n\n const discardButtonBaseProps: IconButtonProps = {\n icon: 'close',\n disabled: restProps.disabled,\n }\n\n return (\n <Styled.Root {...restProps} {...sizeProps} as={rootNode} type={rootType} primary={primary} ref={ref}>\n {typeof children === 'function' ? (\n children({\n textProps: textBaseProps,\n captionProps: captionBaseProps,\n discardButtonProps: discardButtonBaseProps,\n })\n ) : (\n <>\n {before ? (\n <Icon\n preset='brand'\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n sizes={SIZES_ICON}\n {...sizeProps}\n {...iconProps}\n />\n ) : null}\n {avatarProps.src || avatarProps.text ? (\n <Avatar\n preset='brand'\n sizes={avatarProps.square ? SIZES_CHIP_AVATAR_SQUARE : SIZES_CHIP_AVATAR}\n {...sizeProps}\n {...avatarProps}\n />\n ) : null}\n <Styled.Content>\n <Text {...textBaseProps} {...textProps}>\n {children ?? text}\n </Text>\n {caption ? (\n <Text {...captionBaseProps} {...captionProps}>\n {caption}\n </Text>\n ) : null}\n </Styled.Content>\n {indicatorProps.children || indicatorProps.text ? (\n <Indicator sizes={SIZES_CHIP_INDICATOR} marginRight={3} {...sizeProps} {...indicatorProps} />\n ) : null}\n {after ? (\n <Icon\n preset='brand'\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n sizes={SIZES_ICON}\n {...sizeProps}\n {...iconProps}\n />\n ) : null}\n {discardButtonProps.onClick ? (\n <IconButton\n sizes={discardButtonProps.square ? SIZES_DISCARD_BUTTON_SQUARE : SIZES_DISCARD_BUTTON}\n {...sizeProps}\n {...discardButtonBaseProps}\n {...discardButtonProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Chip }\n"],"names":["Chip","withMergedProps","forwardRef","props","ref","size","primary","textProps","captionProps","iconProps","avatarProps","indicatorProps","discardButtonProps","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","children","text","caption","icon","restProps","rootNode","rootType","onClick","type","sizeProps","before","after","Array","isArray","textBaseProps","as","appearance","color","lineHeight","captionBaseProps","sizeUnits","discardButtonBaseProps","disabled","_jsx","Styled","_jsxs","jsxs","_Fragment","jsx","Icon","preset","name","undefined","sizes","SIZES_ICON","src","Avatar","square","SIZES_CHIP_AVATAR_SQUARE","SIZES_CHIP_AVATAR","Text","Indicator","SIZES_CHIP_INDICATOR","marginRight","IconButton","SIZES_DISCARD_BUTTON_SQUARE","SIZES_DISCARD_BUTTON","displayName","SIZES"],"mappings":"obAkCMA,MAAAA,KAAmDC,gBAAAA,gBACvDC,MAAAA,YAAgD,CAACC,EAAOC,KACtD,MAAMC,KACJA,EAAO,IAAGC,QACVA,GAAU,EAAIC,UACdA,EAAY,CAAE,EAAAC,aACdA,EAAe,CAAE,EAAAC,UACjBA,EAAY,CAAE,EAAAC,YACdA,EAAc,CAAE,EAAAC,eAChBA,EAAiB,CAAE,EAAAC,mBACnBA,EAAqB,CAAE,EAAAC,QACvBA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,SACNA,EAAQC,KACRA,EAAIC,QACJA,EAAOC,KACPA,KACGC,GACDpB,EAGJ,IAAIqB,EAAgB,MAKpB,IAAIC,EAHAF,EAAUG,UAASF,EAAW,UAC9BZ,EAAmBc,UAASF,EAAW,OAIvCA,IAAa,WAAUC,EAAW,UAClCF,EAAUI,OAAMF,EAAWF,EAAUI,MAEzC,MAAMC,EAAY,CAChBvB,OACAQ,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAOW,EAAQC,GAASC,MAAMC,QAAQV,GAAQA,EAAO,CAACA,GAEtD,MAAMW,EAA2B,CAC/BC,GAAI,OACJC,WAAY,OACZ9B,KAAM,UACN+B,MAAO,UACPC,WAAYhB,EAAU,IAAM,GAG9B,MAAMiB,EAA8B,CAClCJ,GAAI,OACJC,WAAY,OACZ9B,KAAM,IACNkC,UAAW,KACXH,MAAO,UACPC,WAAY,GAGd,MAAMG,EAA0C,CAC9ClB,KAAM,QACNmB,SAAUlB,EAAUkB,UAGtB,OACEC,WAAAA,IAACC,MAAAA,KAAW,IAAKpB,KAAeK,EAAWM,GAAIV,EAAUG,KAAMF,EAAUnB,QAASA,EAASF,IAAKA,EAAIe,gBAC1FA,GAAa,WACnBA,EAAS,CACPZ,UAAW0B,EACXzB,aAAc8B,EACd1B,mBAAoB4B,IAGtBI,WAAAC,KAAAC,oBAAA,CAAA3B,SACGU,CAAAA,EACCa,WAAAK,IAACC,UAAI,CACHC,OAAO,QACPC,YAAarB,GAAW,SAAWA,OAASsB,EAC5C7B,YAAaO,GAAW,SAAWA,OAASsB,EAC5CC,MAAOC,UAAWA,cACdzB,KACAnB,IAEJ,KACHC,EAAY4C,KAAO5C,EAAYU,KAC9BsB,WAAAK,IAACQ,cAAM,CACLN,OAAO,QACPG,MAAO1C,EAAY8C,OAASC,UAAAA,yBAA2BC,UAAkBA,qBACrE9B,KACAlB,IAEJ,KACJkC,WAAAC,KAACF,cAAc,CAAAxB,SAAA,CACbuB,WAAAK,IAACY,UAAI,IAAK1B,KAAmB1B,EAASY,SACnCA,GAAYC,IAEdC,EACCqB,WAAAK,IAACY,UAAI,IAAKrB,KAAsB9B,EAAYW,SACzCE,IAED,QAELV,EAAeQ,UAAYR,EAAeS,KACzCsB,WAAAK,IAACa,oBAAS,CAACR,MAAOS,UAAqBA,qBAACC,YAAa,KAAOlC,KAAejB,IACzE,KACHmB,EACCY,WAAAA,IAACM,KAAAA,KAAI,CACHC,OAAO,QACPC,YAAapB,GAAU,SAAWA,OAAQqB,EAC1C7B,YAAaQ,GAAU,SAAWA,OAAQqB,EAC1CC,MAAOC,UAAWA,cACdzB,KACAnB,IAEJ,KACHG,EAAmBc,QAClBgB,WAAAA,IAACqB,WAAAA,WAAU,CACTX,MAAOxC,EAAmB4C,OAASQ,UAAAA,4BAA8BC,UAAqBA,wBAClFrC,KACAY,KACA5B,IAEJ,SAGI,IAGlB,CACEsD,YAlJmB,OAmJnBd,MAAOe,UAAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.mjs","sources":["../../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport { Avatar } from 'components/Avatar'\nimport { Indicator } from 'components/Indicator'\nimport { IconButton } from 'components/IconButton'\nimport type { TextProps } from 'components/Text'\nimport type { IconButtonProps } from 'components/IconButton'\nimport {\n SIZES,\n SIZES_ICON,\n SIZES_CHIP_INDICATOR,\n SIZES_CHIP_AVATAR,\n SIZES_CHIP_AVATAR_SQUARE,\n SIZES_DISCARD_BUTTON,\n SIZES_DISCARD_BUTTON_SQUARE,\n} from './constants'\nimport * as Styled from './style'\nimport type { ChipProps } from './types'\n\nconst COMPONENT_NAME = 'Chip'\n\n/**\n *\n * Компонент поддерживает все нативные атрибуты рутового элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/src/components/Chip/types.ts).\n */\nconst Chip: React.ForwardRefExoticComponent<ChipProps> = withMergedProps<ChipProps>(\n forwardRef<HTMLElement, MergedProps<ChipProps>>((props, ref) => {\n const {\n size = 'm',\n primary = true,\n textProps = {},\n captionProps = {},\n iconProps = {},\n avatarProps = {},\n indicatorProps = {},\n discardButtonProps = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n children,\n text,\n caption,\n icon,\n ...restProps\n } = props\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let rootNode: any = 'div'\n\n if (restProps.onClick) rootNode = 'button'\n if (discardButtonProps.onClick) rootNode = 'div'\n\n let rootType: ChipProps['type']\n\n if (rootNode === 'button') rootType = 'button'\n if (restProps.type) rootType = restProps.type\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const textBaseProps: TextProps = {\n as: 'span',\n appearance: 'body',\n size: 'inherit',\n color: 'inherit',\n lineHeight: caption ? 1.3 : 1,\n }\n\n const captionBaseProps: TextProps = {\n as: 'span',\n appearance: 'body',\n size: 0.75,\n sizeUnits: 'em',\n color: 'inherit',\n lineHeight: 1,\n }\n\n const discardButtonBaseProps: IconButtonProps = {\n icon: 'close',\n disabled: restProps.disabled,\n }\n\n return (\n <Styled.Root {...restProps} {...sizeProps} as={rootNode} type={rootType} primary={primary} ref={ref}>\n {typeof children === 'function' ? (\n children({\n textProps: textBaseProps,\n captionProps: captionBaseProps,\n discardButtonProps: discardButtonBaseProps,\n })\n ) : (\n <>\n {before ? (\n <Icon\n preset='brand'\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n sizes={SIZES_ICON}\n {...sizeProps}\n {...iconProps}\n />\n ) : null}\n {avatarProps.src || avatarProps.text ? (\n <Avatar\n preset='brand'\n sizes={avatarProps.square ? SIZES_CHIP_AVATAR_SQUARE : SIZES_CHIP_AVATAR}\n {...sizeProps}\n {...avatarProps}\n />\n ) : null}\n <Styled.Content>\n <Text {...textBaseProps} {...textProps}>\n {children ?? text}\n </Text>\n {caption ? (\n <Text {...captionBaseProps} {...captionProps}>\n {caption}\n </Text>\n ) : null}\n </Styled.Content>\n {indicatorProps.children || indicatorProps.text ? (\n <Indicator sizes={SIZES_CHIP_INDICATOR} marginRight={3} {...sizeProps} {...indicatorProps} />\n ) : null}\n {after ? (\n <Icon\n preset='brand'\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n sizes={SIZES_ICON}\n {...sizeProps}\n {...iconProps}\n />\n ) : null}\n {discardButtonProps.onClick ? (\n <IconButton\n sizes={discardButtonProps.square ? SIZES_DISCARD_BUTTON_SQUARE : SIZES_DISCARD_BUTTON}\n {...sizeProps}\n {...discardButtonBaseProps}\n {...discardButtonProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Chip }\n"],"names":["Chip","withMergedProps","forwardRef","props","ref","size","primary","textProps","captionProps","iconProps","avatarProps","indicatorProps","discardButtonProps","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","children","text","caption","icon","restProps","rootNode","rootType","onClick","type","sizeProps","before","after","Array","isArray","textBaseProps","as","appearance","color","lineHeight","captionBaseProps","sizeUnits","discardButtonBaseProps","disabled","_jsx","Styled","_jsxs","_Fragment","Icon","preset","name","undefined","sizes","SIZES_ICON","src","Avatar","square","SIZES_CHIP_AVATAR_SQUARE","SIZES_CHIP_AVATAR","Text","Indicator","SIZES_CHIP_INDICATOR","marginRight","IconButton","SIZES_DISCARD_BUTTON_SQUARE","SIZES_DISCARD_BUTTON","displayName","SIZES"],"mappings":"siBAkCMA,MAAAA,KAAmDC,gBACvDC,YAAgD,CAACC,EAAOC,KACtD,MAAMC,KACJA,EAAO,IAAGC,QACVA,GAAU,EAAIC,UACdA,EAAY,CAAE,EAAAC,aACdA,EAAe,CAAE,EAAAC,UACjBA,EAAY,CAAE,EAAAC,YACdA,EAAc,CAAE,EAAAC,eAChBA,EAAiB,CAAE,EAAAC,mBACnBA,EAAqB,CAAE,EAAAC,QACvBA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,SACNA,EAAQC,KACRA,EAAIC,QACJA,EAAOC,KACPA,KACGC,GACDpB,EAGJ,IAAIqB,EAAgB,MAKpB,IAAIC,EAHAF,EAAUG,UAASF,EAAW,UAC9BZ,EAAmBc,UAASF,EAAW,OAIvCA,IAAa,WAAUC,EAAW,UAClCF,EAAUI,OAAMF,EAAWF,EAAUI,MAEzC,MAAMC,EAAY,CAChBvB,OACAQ,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAOW,EAAQC,GAASC,MAAMC,QAAQV,GAAQA,EAAO,CAACA,GAEtD,MAAMW,EAA2B,CAC/BC,GAAI,OACJC,WAAY,OACZ9B,KAAM,UACN+B,MAAO,UACPC,WAAYhB,EAAU,IAAM,GAG9B,MAAMiB,EAA8B,CAClCJ,GAAI,OACJC,WAAY,OACZ9B,KAAM,IACNkC,UAAW,KACXH,MAAO,UACPC,WAAY,GAGd,MAAMG,EAA0C,CAC9ClB,KAAM,QACNmB,SAAUlB,EAAUkB,UAGtB,OACEC,IAACC,KAAW,IAAKpB,KAAeK,EAAWM,GAAIV,EAAUG,KAAMF,EAAUnB,QAASA,EAASF,IAAKA,EAAIe,gBAC1FA,GAAa,WACnBA,EAAS,CACPZ,UAAW0B,EACXzB,aAAc8B,EACd1B,mBAAoB4B,IAGtBI,KAAAC,SAAA,CAAA1B,SACGU,CAAAA,EACCa,IAACI,KAAI,CACHC,OAAO,QACPC,YAAanB,GAAW,SAAWA,OAASoB,EAC5C3B,YAAaO,GAAW,SAAWA,OAASoB,EAC5CC,MAAOC,cACHvB,KACAnB,IAEJ,KACHC,EAAY0C,KAAO1C,EAAYU,KAC9BsB,IAACW,OAAM,CACLN,OAAO,QACPG,MAAOxC,EAAY4C,OAASC,yBAA2BC,qBACnD5B,KACAlB,IAEJ,KACJkC,KAACD,QAAc,CAAAxB,SAAA,CACbuB,IAACe,KAAI,IAAKxB,KAAmB1B,EAASY,SACnCA,GAAYC,IAEdC,EACCqB,IAACe,KAAI,IAAKnB,KAAsB9B,EAAYW,SACzCE,IAED,QAELV,EAAeQ,UAAYR,EAAeS,KACzCsB,IAACgB,UAAS,CAACR,MAAOS,qBAAsBC,YAAa,KAAOhC,KAAejB,IACzE,KACHmB,EACCY,IAACI,KAAI,CACHC,OAAO,QACPC,YAAalB,GAAU,SAAWA,OAAQmB,EAC1C3B,YAAaQ,GAAU,SAAWA,OAAQmB,EAC1CC,MAAOC,cACHvB,KACAnB,IAEJ,KACHG,EAAmBc,QAClBgB,IAACmB,WAAU,CACTX,MAAOtC,EAAmB0C,OAASQ,4BAA8BC,wBAC7DnC,KACAY,KACA5B,IAEJ,SAGI,IAGlB,CACEoD,YAlJmB,OAmJnBd,MAAOe"}
1
+ {"version":3,"file":"Chip.mjs","sources":["../../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport { Avatar } from 'components/Avatar'\nimport { Indicator } from 'components/Indicator'\nimport { IconButton } from 'components/IconButton'\nimport type { TextProps } from 'components/Text'\nimport type { IconButtonProps } from 'components/IconButton'\nimport {\n SIZES,\n SIZES_ICON,\n SIZES_CHIP_INDICATOR,\n SIZES_CHIP_AVATAR,\n SIZES_CHIP_AVATAR_SQUARE,\n SIZES_DISCARD_BUTTON,\n SIZES_DISCARD_BUTTON_SQUARE,\n} from './constants'\nimport * as Styled from './style'\nimport type { ChipProps } from './types'\n\nconst COMPONENT_NAME = 'Chip'\n\n/**\n *\n * Компонент поддерживает все нативные атрибуты рутового элемента.\n *\n * Можно передать \"ref\", который будет ассоциирован с рутовым элементом.\n *\n * Поддерживаются пропсы определения размеров и внешних отступов в зависимости от ширины вьюпорта.\n *\n * Полный интерфейс можно посмотреть [тут](https://github.com/foxford/ui/blob/master/packages/ui/src/components/Chip/types.ts).\n */\nconst Chip: React.ForwardRefExoticComponent<ChipProps> = withMergedProps<ChipProps>(\n forwardRef<HTMLElement, MergedProps<ChipProps>>((props, ref) => {\n const {\n size = 'm',\n primary = true,\n textProps = {},\n captionProps = {},\n iconProps = {},\n avatarProps = {},\n indicatorProps = {},\n discardButtonProps = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n children,\n text,\n caption,\n icon,\n ...restProps\n } = props\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let rootNode: any = 'div'\n\n if (restProps.onClick) rootNode = 'button'\n if (discardButtonProps.onClick) rootNode = 'div'\n\n let rootType: ChipProps['type']\n\n if (rootNode === 'button') rootType = 'button'\n if (restProps.type) rootType = restProps.type\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const textBaseProps: TextProps = {\n as: 'span',\n appearance: 'body',\n size: 'inherit',\n color: 'inherit',\n lineHeight: caption ? 1.3 : 1,\n }\n\n const captionBaseProps: TextProps = {\n as: 'span',\n appearance: 'body',\n size: 0.75,\n sizeUnits: 'em',\n color: 'inherit',\n lineHeight: 1,\n }\n\n const discardButtonBaseProps: IconButtonProps = {\n icon: 'close',\n disabled: restProps.disabled,\n }\n\n return (\n <Styled.Root {...restProps} {...sizeProps} as={rootNode} type={rootType} primary={primary} ref={ref}>\n {typeof children === 'function' ? (\n children({\n textProps: textBaseProps,\n captionProps: captionBaseProps,\n discardButtonProps: discardButtonBaseProps,\n })\n ) : (\n <>\n {before ? (\n <Icon\n preset='brand'\n name={typeof before === 'string' ? before : undefined}\n icon={typeof before !== 'string' ? before : undefined}\n sizes={SIZES_ICON}\n {...sizeProps}\n {...iconProps}\n />\n ) : null}\n {avatarProps.src || avatarProps.text ? (\n <Avatar\n preset='brand'\n sizes={avatarProps.square ? SIZES_CHIP_AVATAR_SQUARE : SIZES_CHIP_AVATAR}\n {...sizeProps}\n {...avatarProps}\n />\n ) : null}\n <Styled.Content>\n <Text {...textBaseProps} {...textProps}>\n {children ?? text}\n </Text>\n {caption ? (\n <Text {...captionBaseProps} {...captionProps}>\n {caption}\n </Text>\n ) : null}\n </Styled.Content>\n {indicatorProps.children || indicatorProps.text ? (\n <Indicator sizes={SIZES_CHIP_INDICATOR} marginRight={3} {...sizeProps} {...indicatorProps} />\n ) : null}\n {after ? (\n <Icon\n preset='brand'\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n sizes={SIZES_ICON}\n {...sizeProps}\n {...iconProps}\n />\n ) : null}\n {discardButtonProps.onClick ? (\n <IconButton\n sizes={discardButtonProps.square ? SIZES_DISCARD_BUTTON_SQUARE : SIZES_DISCARD_BUTTON}\n {...sizeProps}\n {...discardButtonBaseProps}\n {...discardButtonProps}\n />\n ) : null}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { Chip }\n"],"names":["Chip","withMergedProps","forwardRef","props","ref","size","primary","textProps","captionProps","iconProps","avatarProps","indicatorProps","discardButtonProps","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","children","text","caption","icon","restProps","rootNode","rootType","onClick","type","sizeProps","before","after","Array","isArray","textBaseProps","as","appearance","color","lineHeight","captionBaseProps","sizeUnits","discardButtonBaseProps","disabled","_jsx","Styled","_jsxs","_Fragment","Icon","preset","name","undefined","sizes","SIZES_ICON","src","Avatar","square","SIZES_CHIP_AVATAR_SQUARE","SIZES_CHIP_AVATAR","Text","Indicator","SIZES_CHIP_INDICATOR","marginRight","IconButton","SIZES_DISCARD_BUTTON_SQUARE","SIZES_DISCARD_BUTTON","displayName","SIZES"],"mappings":"siBAkCMA,MAAAA,KAAmDC,gBACvDC,YAAgD,CAACC,EAAOC,KACtD,MAAMC,KACJA,EAAO,IAAGC,QACVA,GAAU,EAAIC,UACdA,EAAY,CAAE,EAAAC,aACdA,EAAe,CAAE,EAAAC,UACjBA,EAAY,CAAE,EAAAC,YACdA,EAAc,CAAE,EAAAC,eAChBA,EAAiB,CAAE,EAAAC,mBACnBA,EAAqB,CAAE,EAAAC,QACvBA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,SACNA,EAAQC,KACRA,EAAIC,QACJA,EAAOC,KACPA,KACGC,GACDpB,EAGJ,IAAIqB,EAAgB,MAKpB,IAAIC,EAHAF,EAAUG,UAASF,EAAW,UAC9BZ,EAAmBc,UAASF,EAAW,OAIvCA,IAAa,WAAUC,EAAW,UAClCF,EAAUI,OAAMF,EAAWF,EAAUI,MAEzC,MAAMC,EAAY,CAChBvB,OACAQ,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAOW,EAAQC,GAASC,MAAMC,QAAQV,GAAQA,EAAO,CAACA,GAEtD,MAAMW,EAA2B,CAC/BC,GAAI,OACJC,WAAY,OACZ9B,KAAM,UACN+B,MAAO,UACPC,WAAYhB,EAAU,IAAM,GAG9B,MAAMiB,EAA8B,CAClCJ,GAAI,OACJC,WAAY,OACZ9B,KAAM,IACNkC,UAAW,KACXH,MAAO,UACPC,WAAY,GAGd,MAAMG,EAA0C,CAC9ClB,KAAM,QACNmB,SAAUlB,EAAUkB,UAGtB,OACEC,IAACC,KAAW,IAAKpB,KAAeK,EAAWM,GAAIV,EAAUG,KAAMF,EAAUnB,QAASA,EAASF,IAAKA,EAAIe,gBAC1FA,GAAa,WACnBA,EAAS,CACPZ,UAAW0B,EACXzB,aAAc8B,EACd1B,mBAAoB4B,IAGtBI,KAAAC,SAAA,CAAA1B,SACGU,CAAAA,EACCa,IAACI,KAAI,CACHC,OAAO,QACPC,YAAanB,GAAW,SAAWA,OAASoB,EAC5C3B,YAAaO,GAAW,SAAWA,OAASoB,EAC5CC,MAAOC,cACHvB,KACAnB,IAEJ,KACHC,EAAY0C,KAAO1C,EAAYU,KAC9BsB,IAACW,OAAM,CACLN,OAAO,QACPG,MAAOxC,EAAY4C,OAASC,yBAA2BC,qBACnD5B,KACAlB,IAEJ,KACJkC,KAACD,QAAc,CAAAxB,SAAA,CACbuB,IAACe,KAAI,IAAKxB,KAAmB1B,EAASY,SACnCA,GAAYC,IAEdC,EACCqB,IAACe,KAAI,IAAKnB,KAAsB9B,EAAYW,SACzCE,IAED,QAELV,EAAeQ,UAAYR,EAAeS,KACzCsB,IAACgB,UAAS,CAACR,MAAOS,qBAAsBC,YAAa,KAAOhC,KAAejB,IACzE,KACHmB,EACCY,IAACI,KAAI,CACHC,OAAO,QACPC,YAAalB,GAAU,SAAWA,OAAQmB,EAC1C3B,YAAaQ,GAAU,SAAWA,OAAQmB,EAC1CC,MAAOC,cACHvB,KACAnB,IAEJ,KACHG,EAAmBc,QAClBgB,IAACmB,WAAU,CACTX,MAAOtC,EAAmB0C,OAASQ,4BAA8BC,wBAC7DnC,KACAY,KACA5B,IAEJ,SAGI,IAGlB,CACEoD,YAlJmB,OAmJnBd,MAAOe"}
@@ -1 +1 @@
1
- {"version":3,"file":"Container.js","sources":["../../../../src/components/Container/Container.tsx"],"sourcesContent":["import type { ColorProperty } from 'mixins/color'\nimport type { DisplayProperty } from 'mixins/display'\nimport type { BaseProps } from 'shared/interfaces'\nimport * as Styled from './style'\n\nexport interface ContainerProps extends BaseProps, DisplayProperty, ColorProperty {\n /**\n * Primary content\n */\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Container has no maximum width.\n */\n fluid?: boolean\n /**\n * Align container text.\n */\n textAlign?: 'left' | 'center' | 'right' | 'justified'\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`Display`](#/Миксины)\n */\nfunction Container(props: ContainerProps) {\n return <Styled.Root {...props} />\n}\n\nContainer.displayName = 'Container'\n\nexport { Container }\n"],"names":["Container","props","_jsx","Styled","displayName"],"mappings":"yFA6BA,SAASA,UAAUC,GACjB,OAAOC,WAAAA,IAACC,MAAAA,KAAW,IAAKF,GAC1B,CAEAD,UAAUI,YAAc"}
1
+ {"version":3,"file":"Container.js","sources":["../../../../src/components/Container/Container.tsx"],"sourcesContent":["import type { ColorProperty } from 'mixins/color'\nimport type { DisplayProperty } from 'mixins/display'\nimport type { BaseProps } from 'shared/interfaces'\nimport * as Styled from './style'\n\nexport interface ContainerProps extends BaseProps, DisplayProperty, ColorProperty {\n /**\n * Primary content\n */\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Container has no maximum width.\n */\n fluid?: boolean\n /**\n * Align container text.\n */\n textAlign?: 'left' | 'center' | 'right' | 'justified'\n}\n\nfunction Container(props: ContainerProps) {\n return <Styled.Root {...props} />\n}\n\nContainer.displayName = 'Container'\n\nexport { Container }\n"],"names":["Container","props","_jsx","Styled","displayName"],"mappings":"yFAuBA,SAASA,UAAUC,GACjB,OAAOC,WAAAA,IAACC,MAAAA,KAAW,IAAKF,GAC1B,CAEAD,UAAUI,YAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Container.mjs","sources":["../../../../src/components/Container/Container.tsx"],"sourcesContent":["import type { ColorProperty } from 'mixins/color'\nimport type { DisplayProperty } from 'mixins/display'\nimport type { BaseProps } from 'shared/interfaces'\nimport * as Styled from './style'\n\nexport interface ContainerProps extends BaseProps, DisplayProperty, ColorProperty {\n /**\n * Primary content\n */\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Container has no maximum width.\n */\n fluid?: boolean\n /**\n * Align container text.\n */\n textAlign?: 'left' | 'center' | 'right' | 'justified'\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`Display`](#/Миксины)\n */\nfunction Container(props: ContainerProps) {\n return <Styled.Root {...props} />\n}\n\nContainer.displayName = 'Container'\n\nexport { Container }\n"],"names":["Container","props","_jsx","Styled","displayName"],"mappings":"iEA6BA,SAASA,UAAUC,GACjB,OAAOC,IAACC,KAAW,IAAKF,GAC1B,CAEAD,UAAUI,YAAc"}
1
+ {"version":3,"file":"Container.mjs","sources":["../../../../src/components/Container/Container.tsx"],"sourcesContent":["import type { ColorProperty } from 'mixins/color'\nimport type { DisplayProperty } from 'mixins/display'\nimport type { BaseProps } from 'shared/interfaces'\nimport * as Styled from './style'\n\nexport interface ContainerProps extends BaseProps, DisplayProperty, ColorProperty {\n /**\n * Primary content\n */\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Container has no maximum width.\n */\n fluid?: boolean\n /**\n * Align container text.\n */\n textAlign?: 'left' | 'center' | 'right' | 'justified'\n}\n\nfunction Container(props: ContainerProps) {\n return <Styled.Root {...props} />\n}\n\nContainer.displayName = 'Container'\n\nexport { Container }\n"],"names":["Container","props","_jsx","Styled","displayName"],"mappings":"iEAuBA,SAASA,UAAUC,GACjB,OAAOC,IAACC,KAAW,IAAKF,GAC1B,CAEAD,UAAUI,YAAc"}