@foxford/ui 2.56.1-beta-5c76f97-20241211 → 2.57.0-beta-2714d7a-20241218

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 (46) hide show
  1. package/components/Anchor/Anchor.js +1 -1
  2. package/components/Anchor/Anchor.js.map +1 -1
  3. package/components/Anchor/Anchor.mjs +1 -1
  4. package/components/Anchor/Anchor.mjs.map +1 -1
  5. package/components/Anchor/style.js +1 -1
  6. package/components/Anchor/style.js.map +1 -1
  7. package/components/Anchor/style.mjs +1 -1
  8. package/components/Anchor/style.mjs.map +1 -1
  9. package/components/Avatar/Avatar.js +1 -1
  10. package/components/Avatar/Avatar.js.map +1 -1
  11. package/components/Avatar/Avatar.mjs +1 -1
  12. package/components/Avatar/Avatar.mjs.map +1 -1
  13. package/components/Avatar/constants.js +1 -1
  14. package/components/Avatar/constants.js.map +1 -1
  15. package/components/Avatar/constants.mjs +1 -1
  16. package/components/Avatar/constants.mjs.map +1 -1
  17. package/components/Chip/Chip.js +1 -1
  18. package/components/Chip/Chip.js.map +1 -1
  19. package/components/Chip/Chip.mjs +1 -1
  20. package/components/Chip/Chip.mjs.map +1 -1
  21. package/components/Chip/constants.js +1 -1
  22. package/components/Chip/constants.js.map +1 -1
  23. package/components/Chip/constants.mjs +1 -1
  24. package/components/Chip/constants.mjs.map +1 -1
  25. package/components/Chip/style.js +1 -1
  26. package/components/Chip/style.js.map +1 -1
  27. package/components/Chip/style.mjs +1 -1
  28. package/components/Chip/style.mjs.map +1 -1
  29. package/components/Dropdown/Dropdown.js +1 -1
  30. package/components/Dropdown/Dropdown.js.map +1 -1
  31. package/components/Dropdown/Dropdown.mjs +1 -1
  32. package/components/Dropdown/Dropdown.mjs.map +1 -1
  33. package/components/Indicator/Indicator.js +1 -1
  34. package/components/Indicator/Indicator.js.map +1 -1
  35. package/components/Indicator/Indicator.mjs +1 -1
  36. package/components/Indicator/Indicator.mjs.map +1 -1
  37. package/components/Indicator/style.js +1 -1
  38. package/components/Indicator/style.js.map +1 -1
  39. package/components/Indicator/style.mjs +1 -1
  40. package/components/Indicator/style.mjs.map +1 -1
  41. package/components/Text/style.js +1 -1
  42. package/components/Text/style.js.map +1 -1
  43. package/components/Text/style.mjs +1 -1
  44. package/components/Text/style.mjs.map +1 -1
  45. package/dts/index.d.ts +73 -29
  46. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- 'use strict';var React=require('react');var reactRouterDom=require('react-router-dom');var styled=require('styled-components');var withMergedProps=require('../../hocs/withMergedProps.js');var useClassname=require('../../hooks/useClassname.js');var constants=require('./constants.js');var style=require('./style.js');var require$$0=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');var Text=require('../Text/Text.js');const Anchor=withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const{size:s="inherit",autoRel:t=!0,textProps:o={},iconProps:n={},icon:i,children:a,content:c,...u}=e;const d=styled.useTheme();const l=useClassname.useClassname("Anchor",u.className);const p=d.utils?.relBuilder;const h=u.href??u.to;const m=u.rel??(t&&p&&typeof h=='string'?p(h,u.target):void 0);const[q,v]=Array.isArray(i)?i:[i];const $={as:'span',size:'inherit',color:'inherit',underline:u.underline,marginLeft:q?'0.25em':void 0,marginRight:v?'0.25em':void 0};const x={as:'span',color:'inherit'};let g;return u.to&&(g=reactRouterDom.Link),u.pseudo&&(g='div'),u.disabled&&(g='span'),u.as&&(g=u.as),require$$0.jsx(style.Root,{...u,ref:r,as:g,className:l,size:s,rel:m,"data-disabled":u.disabled,children:typeof a=='function'?a({baseTextProps:$,textProps:o,iconBaseProps:x,iconProps:n,icon:i}):e.preset==='brand'?require$$0.jsxs(require$$0.Fragment,{children:[q&&require$$0.jsx(Icon.Icon,{name:typeof q=='string'?q:void 0,icon:typeof q!='string'?q:void 0,...x,...n}),require$$0.jsx(Text.Text,{...$,...o,children:a||c}),v&&require$$0.jsx(Icon.Icon,{name:typeof v=='string'?v:void 0,icon:typeof v!='string'?v:void 0,...x,...n})]}):require$$0.jsx(require$$0.Fragment,{children:a||c})})})),{displayName:"Anchor",sizes:constants.SIZES});exports.Anchor=Anchor,exports.COMPONENT_NAME="Anchor";
1
+ 'use strict';var React=require('react');var reactRouterDom=require('react-router-dom');var styled=require('styled-components');var withMergedProps=require('../../hocs/withMergedProps.js');var useClassname=require('../../hooks/useClassname.js');var constants=require('./constants.js');var style=require('./style.js');var require$$0=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');const Anchor=withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const{size:s="inherit",autoRel:o=!0,textProps:t={},iconProps:n={},icon:i,children:a,content:c,underline:d,...u}=e;const l=styled.useTheme();const p=useClassname.useClassname("Anchor",u.className);const h=l.utils?.relBuilder;const m=u.href??u.to;const q=u.rel??(o&&h&&typeof m=='string'?h(m,u.target):void 0);const[$,v]=Array.isArray(i)?i:[i];const y={size:'inherit',color:'inherit',marginLeft:$?'0.20em':void 0,marginRight:v?'0.20em':void 0};const g={as:'span',color:'inherit'};let f;return u.to&&(f=reactRouterDom.Link),u.pseudo&&(f='div'),u.disabled&&(f='span'),u.as&&(f=u.as),require$$0.jsx(style.Root,{...u,ref:r,as:f,className:p,size:s,underline:d,rel:q,"data-disabled":u.disabled,children:typeof a=='function'?a({baseTextProps:y,textProps:t,iconBaseProps:g,iconProps:n,icon:i}):e.preset==='brand'?require$$0.jsxs(require$$0.Fragment,{children:[$&&require$$0.jsx(Icon.Icon,{name:typeof $=='string'?$:void 0,icon:typeof $!='string'?$:void 0,...g,...n}),require$$0.jsx(style.Content,{forwardedAs:"span",underline:d,...y,...t,children:a||c}),v&&require$$0.jsx(Icon.Icon,{name:typeof v=='string'?v:void 0,icon:typeof v!='string'?v:void 0,...g,...n})]}):require$$0.jsx(require$$0.Fragment,{children:a||c})})})),{displayName:"Anchor",sizes:constants.SIZES});exports.Anchor=Anchor,exports.COMPONENT_NAME="Anchor";
2
2
  //# sourceMappingURL=Anchor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Anchor.js","sources":["../../../../src/components/Anchor/Anchor.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { Link } from 'react-router-dom'\nimport { useTheme } from 'styled-components'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { useClassname } from 'hooks/useClassname'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\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((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.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n let rootNode\n if (restProps.to) rootNode = 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 ) : props.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 )}\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 )}\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":"gbAyBMA,MAAAA,OAAuDC,gBAAAA,gBAC3DC,MAAAA,YAAW,CAACC,EAAOC,KACjB,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,EAAWC,qBACzBxB,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,SAC7DN,EAAMsC,SAAW,QACnBC,WAAAA,KAAAC,WAAAA,SAAA,CAAAjC,SACGc,CAAAA,GACCe,WAAAK,IAACC,UAAI,CACHC,YAAatB,GAAW,SAAWA,OAASD,EAC5Cd,YAAae,GAAW,SAAWA,OAASD,KACxCW,KACA1B,IAGR+B,WAAAK,IAACG,UAAI,IAAKnB,KAAmBrB,EAASG,SACnCA,GAAYC,IAEdc,GACCc,WAAAK,IAACC,UAAI,CACHC,YAAarB,GAAU,SAAWA,OAAQF,EAC1Cd,YAAagB,GAAU,SAAWA,OAAQF,KACtCW,KACA1B,OAKV+B,WAAAK,IAAAD,oBAAA,CAAAjC,SAAGA,GAAYC,KAEL,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 { Link } from 'react-router-dom'\nimport { useTheme } from 'styled-components'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { useClassname } from 'hooks/useClassname'\nimport { Icon } from 'components/Icon'\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((props, ref) => {\n const {\n size = 'inherit',\n autoRel = true,\n textProps = {},\n iconProps = {},\n icon,\n children,\n content,\n underline,\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 size: 'inherit',\n color: 'inherit',\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 = 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 underline={underline}\n rel={rel}\n data-disabled={restProps.disabled}\n >\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps, iconBaseProps, iconProps, icon })\n ) : props.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 )}\n <Styled.Content forwardedAs='span' underline={underline} {...baseTextProps} {...textProps}>\n {children || content}\n </Styled.Content>\n {after && (\n <Icon\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n )}\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","underline","restProps","theme","useTheme","className","useClassname","relBuilder","utils","href","to","rel","target","undefined","before","after","Array","isArray","baseTextProps","color","marginLeft","marginRight","iconBaseProps","as","rootNode","Link","pseudo","disabled","_jsx","Styled","preset","_jsxs","_Fragment","jsx","Icon","name","forwardedAs","displayName","sizes","SIZES"],"mappings":"4YAwBMA,MAAAA,OAAuDC,gBAAAA,gBAC3DC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,UAASC,QAChBA,GAAU,EAAIC,UACdA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,EAAAC,KACdA,EAAIC,SACJA,EAAQC,QACRA,EAAOC,UACPA,KACGC,GACDV,EAEJ,MAAMW,EAAQC,OAAAA,WAEd,MAAMC,EAAYC,aAAYA,aA5BX,SA4B4BJ,EAAUG,WACzD,MAAME,EAAaJ,EAAMK,OAAOD,WAChC,MAAME,EAAOP,EAAUO,MAAQP,EAAUQ,GAEzC,MAAMC,EACJT,EAAUS,MACThB,GAAWY,UAAqBE,GAAS,SAAWF,EAAWE,EAAMP,EAAUU,aAAUC,GAE5F,MAAOC,EAAQC,GAASC,MAAMC,QAAQnB,GAAQA,EAAO,CAACA,GAEtD,MAAMoB,EAA2B,CAC/BxB,KAAM,UACNyB,MAAO,UACPC,WAAYN,EAAS,cAAWD,EAChCQ,YAAaN,EAAQ,cAAWF,GAGlC,MAAMS,EAA2B,CAAEC,GAAI,OAAQJ,MAAO,WAEtD,IAAIK,EAMJ,OALItB,EAAUQ,KAAIc,EAAWC,qBACzBvB,EAAUwB,SAAQF,EAAW,OAC7BtB,EAAUyB,WAAUH,EAAW,QAC/BtB,EAAUqB,KAAIC,EAAWtB,EAAUqB,IAGrCK,WAAAA,IAACC,MAAAA,KAAW,IACN3B,EACJT,IAAKA,EACL8B,GAAIC,EACJnB,UAAWA,EACXX,KAAMA,EACNO,UAAWA,EACXU,IAAKA,EACL,gBAAeT,EAAUyB,SAAS5B,gBAE1BA,GAAa,WACnBA,EAAS,CAAEmB,gBAAetB,YAAW0B,gBAAezB,YAAWC,SAC7DN,EAAMsC,SAAW,QACnBC,WAAAA,KAAAC,WAAAA,SAAA,CAAAjC,SACGe,CAAAA,GACCc,WAAAK,IAACC,UAAI,CACHC,YAAarB,GAAW,SAAWA,OAASD,EAC5Cf,YAAagB,GAAW,SAAWA,OAASD,KACxCS,KACAzB,IAGR+B,WAAAK,IAACJ,cAAc,CAACO,YAAY,OAAOnC,UAAWA,KAAeiB,KAAmBtB,EAASG,SACtFA,GAAYC,IAEde,GACCa,WAAAK,IAACC,UAAI,CACHC,YAAapB,GAAU,SAAWA,OAAQF,EAC1Cf,YAAaiB,GAAU,SAAWA,OAAQF,KACtCS,KACAzB,OAKV+B,WAAAK,IAAAD,oBAAA,CAAAjC,SAAGA,GAAYC,KAEL,IAGlB,CACEqC,YA/FmB,SAgGnBC,MAAOC,UAAAA,qDAhGY"}
@@ -1,2 +1,2 @@
1
- import{forwardRef}from'react';import{Link}from'react-router-dom';import{useTheme}from'styled-components';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{useClassname}from'../../hooks/useClassname.mjs';import{SIZES}from'./constants.mjs';import{Root}from'./style.mjs';import{jsx,jsxs,Fragment}from'react/jsx-runtime';import{Icon}from'../Icon/Icon.mjs';import{Text}from'../Text/Text.mjs';const COMPONENT_NAME='Anchor';const Anchor=withMergedProps(forwardRef(((o,e)=>{const{size:s="inherit",autoRel:r=!0,textProps:t={},iconProps:n={},icon:i,children:m,content:a,...c}=o;const d=useTheme();const p=useClassname("Anchor",c.className);const l=d.utils?.relBuilder;const f=c.href??c.to;const h=c.rel??(r&&l&&typeof f=='string'?l(f,c.target):void 0);const[x,g]=Array.isArray(i)?i:[i];const j={as:'span',size:'inherit',color:'inherit',underline:c.underline,marginLeft:x?'0.25em':void 0,marginRight:g?'0.25em':void 0};const u={as:'span',color:'inherit'};let y;return c.to&&(y=Link),c.pseudo&&(y='div'),c.disabled&&(y='span'),c.as&&(y=c.as),jsx(Root,{...c,ref:e,as:y,className:p,size:s,rel:h,"data-disabled":c.disabled,children:typeof m=='function'?m({baseTextProps:j,textProps:t,iconBaseProps:u,iconProps:n,icon:i}):o.preset==='brand'?jsxs(Fragment,{children:[x&&jsx(Icon,{name:typeof x=='string'?x:void 0,icon:typeof x!='string'?x:void 0,...u,...n}),jsx(Text,{...j,...t,children:m||a}),g&&jsx(Icon,{name:typeof g=='string'?g:void 0,icon:typeof g!='string'?g:void 0,...u,...n})]}):jsx(Fragment,{children:m||a})})})),{displayName:"Anchor",sizes:SIZES});export{Anchor,COMPONENT_NAME};
1
+ import{forwardRef}from'react';import{Link}from'react-router-dom';import{useTheme}from'styled-components';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{useClassname}from'../../hooks/useClassname.mjs';import{SIZES}from'./constants.mjs';import{Root,Content}from'./style.mjs';import{jsx,jsxs,Fragment}from'react/jsx-runtime';import{Icon}from'../Icon/Icon.mjs';const COMPONENT_NAME='Anchor';const Anchor=withMergedProps(forwardRef(((o,e)=>{const{size:r="inherit",autoRel:s=!0,textProps:n={},iconProps:t={},icon:i,children:a,content:c,underline:m,...d}=o;const p=useTheme();const l=useClassname("Anchor",d.className);const f=p.utils?.relBuilder;const h=d.href??d.to;const u=d.rel??(s&&f&&typeof h=='string'?f(h,d.target):void 0);const[g,j]=Array.isArray(i)?i:[i];const x={size:'inherit',color:'inherit',marginLeft:g?'0.20em':void 0,marginRight:j?'0.20em':void 0};const y={as:'span',color:'inherit'};let P;return d.to&&(P=Link),d.pseudo&&(P='div'),d.disabled&&(P='span'),d.as&&(P=d.as),jsx(Root,{...d,ref:e,as:P,className:l,size:r,underline:m,rel:u,"data-disabled":d.disabled,children:typeof a=='function'?a({baseTextProps:x,textProps:n,iconBaseProps:y,iconProps:t,icon:i}):o.preset==='brand'?jsxs(Fragment,{children:[g&&jsx(Icon,{name:typeof g=='string'?g:void 0,icon:typeof g!='string'?g:void 0,...y,...t}),jsx(Content,{forwardedAs:"span",underline:m,...x,...n,children:a||c}),j&&jsx(Icon,{name:typeof j=='string'?j:void 0,icon:typeof j!='string'?j:void 0,...y,...t})]}):jsx(Fragment,{children:a||c})})})),{displayName:"Anchor",sizes:SIZES});export{Anchor,COMPONENT_NAME};
2
2
  //# sourceMappingURL=Anchor.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Anchor.mjs","sources":["../../../../src/components/Anchor/Anchor.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { Link } from 'react-router-dom'\nimport { useTheme } from 'styled-components'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { useClassname } from 'hooks/useClassname'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\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((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.25em' : undefined,\n marginRight: after ? '0.25em' : undefined,\n }\n\n const iconBaseProps: IconProps = { as: 'span', color: 'inherit' }\n\n let rootNode\n if (restProps.to) rootNode = 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 ) : props.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 )}\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 )}\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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A,OAASD,EAC5Cd,YAAae,GAAW,SAAWA,OAASD,KACxCW,KACA1B,IAGR+B,IAACO,KAAI,IAAKlB,KAAmBrB,EAASG,SACnCA,GAAYC,IAEdc,GACCc,IAACK,KAAI,CACHC,YAAapB,GAAU,SAAWA,OAAQF,EAC1Cd,YAAagB,GAAU,SAAWA,OAAQF,KACtCW,KACA1B,OAKV+B,IAAAI,SAAA,CAAAjC,SAAGA,GAAYC,KAEL,IAGlB,CACEoC,YA/FmB,SAgGnBC,MAAOC"}
1
+ {"version":3,"file":"Anchor.mjs","sources":["../../../../src/components/Anchor/Anchor.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { Link } from 'react-router-dom'\nimport { useTheme } from 'styled-components'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { useClassname } from 'hooks/useClassname'\nimport { Icon } from 'components/Icon'\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((props, ref) => {\n const {\n size = 'inherit',\n autoRel = true,\n textProps = {},\n iconProps = {},\n icon,\n children,\n content,\n underline,\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 size: 'inherit',\n color: 'inherit',\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 = 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 underline={underline}\n rel={rel}\n data-disabled={restProps.disabled}\n >\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps, iconBaseProps, iconProps, icon })\n ) : props.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 )}\n <Styled.Content forwardedAs='span' underline={underline} {...baseTextProps} {...textProps}>\n {children || content}\n </Styled.Content>\n {after && (\n <Icon\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconBaseProps}\n {...iconProps}\n />\n )}\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","underline","restProps","theme","useTheme","className","useClassname","relBuilder","utils","href","to","rel","target","undefined","before","after","Array","isArray","baseTextProps","color","marginLeft","marginRight","iconBaseProps","as","rootNode","Link","pseudo","disabled","_jsx","Styled","preset","_jsxs","_Fragment","Icon","name","forwardedAs","displayName","sizes","SIZES"],"mappings":"yXAYMA,MAAAA,eAAiB,SAYjBC,MAAAA,OAAuDC,gBAC3DC,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,UAASC,QAChBA,GAAU,EAAIC,UACdA,EAAY,CAAE,EAAAC,UACdA,EAAY,CAAE,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,KACtCS,KACAzB,OAKV+B,IAAAI,SAAA,CAAAjC,SAAGA,GAAYC,KAEL,IAGlB,CACEoC,YA/FmB,SAgGnBC,MAAOC"}
@@ -1,2 +1,2 @@
1
- 'use strict';var styled=require('styled-components');var tinycolor=require('../../external/.pnpm/tinycolor2@1.4.2/node_modules/tinycolor2/tinycolor.js');var style=require('../../shared/utils/style.js');var color=require('../../mixins/color.js');var focus=require('../../mixins/focus.js');var responsiveSize=require('../../mixins/responsive-size.js');var responsiveMargin=require('../../mixins/responsive-margin.js');var display=require('../../mixins/display.js');function _interopDefault(o){return o&&o.__esModule?o:{default:o}}var styled__default=_interopDefault(styled);const shouldForwardAnchorProp=style.createShouldForwardProp((o=>!['display','underline','onColored','verticalAlign','pseudo','wrapper'].includes(o)));const template=o=>`\n color: ${o.color};\n &:hover {\n color: ${o.colorHover};\n }\n &:active {\n color: ${o.color};\n }\n &[data-disabled="true"] {\n color: ${o.colorDisabled};\n }\n`;const COLOR_SCHEMA={default:styled.css(["",""],(o=>template({color:o.wrapper?'inherit':o.theme.colors.accent,colorHover:o.wrapper?'inherit':o.theme.colors.primary,colorDisabled:o.theme.colors['content-disabled'],...o.palette}))),primary:styled.css(["",""],(o=>template({color:o.theme.colors['content-link'],colorHover:tinycolor.default(o.theme.colors['content-link']).lighten(10).toString(),colorDisabled:o.theme.colors['content-disabled'],...o.palette}))),onColored:styled.css(["",""],(o=>template({color:o.theme.colors['content-oncolor-primary'],colorHover:tinycolor.default(o.theme.colors['content-oncolor-primary']).darken(10).toString(),colorDisabled:o.theme.colors['content-oncolor-disabled'],...o.palette})))};const Root=styled__default.default.a.withConfig({shouldForwardProp:shouldForwardAnchorProp}).withConfig({displayName:"Anchor__Root",componentId:"ui__sc-1n89po4-0"})([""," "," "," "," "," "," ",""],(o=>`\n box-sizing: border-box;\n isolation: isolate;\n transition-property: color;\n transition-duration: 150ms;\n transition-timing-function: ease-in;\n cursor: ${o.disabled?'not-allowed':'pointer'};\n vertical-align: ${o.verticalAlign?`${typeof o.verticalAlign=='string'?o.verticalAlign:'text-bottom'}`:'baseline'};\n ${o.preset==='brand'?"\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n text-decoration: none;\n ":`\n display: ${o.wrapper?'block':'inline-block'};\n text-decoration-line: ${o.underline===!0?'underline':'none'};\n border-bottom: ${o.pseudo||typeof o.underline=='string'?`1px ${typeof o.underline=='string'?o.underline:'dashed'}`:'none'};\n `}\n \n `),(o=>o.onColored?COLOR_SCHEMA.onColored:o.preset==='brand'?COLOR_SCHEMA.primary:COLOR_SCHEMA.default),focus.focus,responsiveSize.responsiveSize,responsiveMargin.responsiveMargin,(o=>o.display&&display.display(o.display)),(o=>o.color&&`color: ${color.getColor(o.color,o)};`));exports.Root=Root;
1
+ 'use strict';var styled=require('styled-components');var tinycolor=require('../../external/.pnpm/tinycolor2@1.4.2/node_modules/tinycolor2/tinycolor.js');var style=require('../../shared/utils/style.js');var color=require('../../mixins/color.js');var focus=require('../../mixins/focus.js');var responsiveSize=require('../../mixins/responsive-size.js');var responsiveMargin=require('../../mixins/responsive-margin.js');var display=require('../../mixins/display.js');var Text=require('../Text/Text.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var styled__default=_interopDefault(styled);const shouldForwardAnchorProp=style.createShouldForwardProp((e=>!['display','underline','onColored','verticalAlign','pseudo','wrapper'].includes(e)));const template=e=>`\n color: ${e.color};\n &:hover {\n color: ${e.colorHover};\n }\n &:active {\n color: ${e.color};\n }\n &[data-disabled="true"] {\n color: ${e.colorDisabled};\n }\n`;const COLOR_SCHEMA={default:styled.css(["",""],(e=>template({color:e.wrapper?'inherit':e.theme.colors.accent,colorHover:e.wrapper?'inherit':e.theme.colors.primary,colorDisabled:e.theme.colors['content-disabled'],...e.palette}))),primary:styled.css(["",""],(e=>template({color:e.theme.colors['content-link'],colorHover:tinycolor.default(e.theme.colors['content-link']).lighten(10).toString(),colorDisabled:e.theme.colors['content-disabled'],...e.palette}))),onColored:styled.css(["",""],(e=>template({color:e.theme.colors['content-oncolor-primary'],colorHover:tinycolor.default(e.theme.colors['content-oncolor-primary']).darken(10).toString(),colorDisabled:e.theme.colors['content-oncolor-disabled'],...e.palette})))};const Root=styled__default.default.a.withConfig({shouldForwardProp:shouldForwardAnchorProp}).withConfig({displayName:"Anchor__Root",componentId:"ui__sc-1n89po4-0"})([""," "," "," "," "," "," ",""],(e=>`\n box-sizing: border-box;\n isolation: isolate;\n transition-property: color;\n transition-duration: 150ms;\n transition-timing-function: ease-in;\n cursor: ${e.disabled?'not-allowed':'pointer'};\n vertical-align: ${e.verticalAlign?`${typeof e.verticalAlign=='string'?e.verticalAlign:'text-bottom'}`:'baseline'};\n ${e.preset==='brand'?"\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n ":`\n display: ${e.wrapper?'block':'inline-block'};\n text-decoration-line: ${e.underline===!0?'underline':'none'};\n border-bottom: ${e.pseudo||typeof e.underline=='string'?`1px ${typeof e.underline=='string'?e.underline:'dashed'}`:'none'};\n `}\n \n `),(e=>e.onColored?COLOR_SCHEMA.onColored:e.preset==='brand'?COLOR_SCHEMA.primary:COLOR_SCHEMA.default),focus.focus,responsiveSize.responsiveSize,responsiveMargin.responsiveMargin,(e=>e.display&&display.display(e.display)),(e=>e.color&&`color: ${color.getColor(e.color,e)};`));const Content=styled__default.default(Text.Text).withConfig({shouldForwardProp:e=>e!=='underline'}).withConfig({displayName:"Anchor__Content",componentId:"ui__sc-1n89po4-1"})(["",""],(e=>e.underline&&`\n text-decoration-line: underline;\n text-decoration-style: ${typeof e.underline=='string'?e.underline:'solid'};\n text-underline-offset: 0.3em;\n `));exports.Content=Content,exports.Root=Root;
2
2
  //# sourceMappingURL=style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sources":["../../../../src/components/Anchor/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport tinycolor from 'tinycolor2'\nimport type { ThemedStyledProps, DefaultTheme } from 'styled-components'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { getColor } from 'mixins/color'\nimport { focus } from 'mixins/focus'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport { display } from 'mixins/display'\nimport type { CSSColor } from 'shared/types'\nimport type { StyledAnchorProps, AnchorPalette } from './types'\n\nconst shouldForwardAnchorProp = createShouldForwardProp(\n (propKey) => !['display', 'underline', 'onColored', 'verticalAlign', 'pseudo', 'wrapper'].includes(propKey)\n)\n\nconst template = (palette: AnchorPalette) => `\n color: ${palette.color};\n &:hover {\n color: ${palette.colorHover};\n }\n &:active {\n color: ${palette.color};\n }\n &[data-disabled=\"true\"] {\n color: ${palette.colorDisabled};\n }\n`\n\nconst COLOR_SCHEMA = {\n default: css<StyledAnchorProps>`\n ${(props) =>\n template({\n color: props.wrapper ? 'inherit' : props.theme.colors.accent,\n colorHover: props.wrapper ? 'inherit' : props.theme.colors.primary,\n colorDisabled: props.theme.colors['content-disabled'],\n ...props.palette,\n })}\n `,\n primary: css<StyledAnchorProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-link'],\n colorHover: tinycolor(props.theme.colors['content-link']).lighten(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-disabled'],\n ...props.palette,\n })}\n `,\n onColored: css<StyledAnchorProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-oncolor-primary'],\n colorHover: tinycolor(props.theme.colors['content-oncolor-primary']).darken(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-oncolor-disabled'],\n ...props.palette,\n })}\n `,\n}\n\nconst anchorStyles = (props: ThemedStyledProps<StyledAnchorProps, DefaultTheme>) => {\n if (props.onColored) return COLOR_SCHEMA.onColored\n return props.preset === 'brand' ? COLOR_SCHEMA.primary : COLOR_SCHEMA.default\n}\n\nexport const Root = styled.a.withConfig<StyledAnchorProps>({\n shouldForwardProp: shouldForwardAnchorProp,\n})`\n ${(props) => `\n box-sizing: border-box;\n isolation: isolate;\n transition-property: color;\n transition-duration: 150ms;\n transition-timing-function: ease-in;\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n vertical-align: ${\n props.verticalAlign\n ? `${typeof props.verticalAlign === 'string' ? props.verticalAlign : 'text-bottom'}`\n : 'baseline'\n };\n ${\n props.preset === 'brand'\n ? `\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n text-decoration: none;\n `\n : `\n display: ${props.wrapper ? 'block' : 'inline-block'};\n text-decoration-line: ${props.underline === true ? 'underline' : 'none'};\n border-bottom: ${\n props.pseudo || typeof props.underline === 'string'\n ? `1px ${typeof props.underline === 'string' ? props.underline : 'dashed'}`\n : 'none'\n };\n `\n }\n \n `}\n\n ${anchorStyles}\n ${focus}\n ${responsiveSize}\n ${responsiveMargin}\n \n ${(props) => props.display && display(props.display)}\n ${(props) => props.color && `color: ${getColor(props.color, props)};`}\n`\n"],"names":["shouldForwardAnchorProp","createShouldForwardProp","propKey","includes","template","palette","color","colorHover","colorDisabled","COLOR_SCHEMA","default","css","props","wrapper","theme","colors","accent","primary","tinycolor","lighten","toString","onColored","darken","Root","styled","a","withConfig","shouldForwardProp","displayName","componentId","disabled","verticalAlign","preset","underline","pseudo","focus","responsiveSize","responsiveMargin","display","getColor"],"mappings":"4jBAYA,MAAMA,wBAA0BC,MAAAA,yBAC7BC,IAAa,CAAC,UAAW,YAAa,YAAa,gBAAiB,SAAU,WAAWC,SAASD,KAGrG,MAAME,SAAYC,GAA2B,cAClCA,EAAQC,mCAEND,EAAQE,8CAGRF,EAAQC,wDAGRD,EAAQG,wBAIrB,MAAMC,aAAe,CACnBC,QAASC,OAAGA,IAAA,CAAA,GAAA,KACPC,GACDR,SAAS,CACPE,MAAOM,EAAMC,QAAU,UAAYD,EAAME,MAAMC,OAAOC,OACtDT,WAAYK,EAAMC,QAAU,UAAYD,EAAME,MAAMC,OAAOE,QAC3DT,cAAeI,EAAME,MAAMC,OAAO,uBAC/BH,EAAMP,YAGfY,QAASN,OAAGA,IAAA,CAAA,GAAA,KACPC,GACDR,SAAS,CACPE,MAAOM,EAAME,MAAMC,OAAO,gBAC1BR,WAAYW,UAASR,QAACE,EAAME,MAAMC,OAAO,iBAAiBI,QAAQ,IAAIC,WACtEZ,cAAeI,EAAME,MAAMC,OAAO,uBAC/BH,EAAMP,YAGfgB,UAAWV,OAAGA,IAAA,CAAA,GAAA,KACTC,GACDR,SAAS,CACPE,MAAOM,EAAME,MAAMC,OAAO,2BAC1BR,WAAYW,UAASR,QAACE,EAAME,MAAMC,OAAO,4BAA4BO,OAAO,IAAIF,WAChFZ,cAAeI,EAAME,MAAMC,OAAO,+BAC/BH,EAAMP,aAUV,MAAMkB,KAAOC,gBAAAA,QAAOC,EAAEC,WAA8B,CACzDC,kBAAmB3B,0BACnB0B,WAAA,CAAAE,YAAA,eAAAC,YAAA,oBAFkBL,CAElB,CAAA,GAAA,IAAA,IAAA,IAAA,IAAA,IAAA,IAAA,KACGZ,GAAU,+LAMCA,EAAMkB,SAAW,cAAgB,qCAEzClB,EAAMmB,cACF,UAAUnB,EAAMmB,eAAkB,SAAWnB,EAAMmB,cAAgB,gBACnE,sBAGJnB,EAAMoB,SAAW,QACb,uMAOA,4BACapB,EAAMC,QAAU,QAAU,wDACbD,EAAMqB,aAAc,EAAO,YAAc,yCAE/DrB,EAAMsB,eAAiBtB,EAAMqB,WAAc,SACvC,cAAcrB,EAAMqB,WAAc,SAAWrB,EAAMqB,UAAY,WAC/D,oCAnCErB,GAChBA,EAAMS,UAAkBZ,aAAaY,UAClCT,EAAMoB,SAAW,QAAUvB,aAAaQ,QAAUR,aAAaC,SAyCpEyB,MAAKA,MACLC,8BACAC,iBAAAA,kBAECzB,GAAUA,EAAM0B,SAAWA,QAAOA,QAAC1B,EAAM0B,WACzC1B,GAAUA,EAAMN,OAAS,UAAUiC,eAAS3B,EAAMN,MAAOM"}
1
+ {"version":3,"file":"style.js","sources":["../../../../src/components/Anchor/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport tinycolor from 'tinycolor2'\nimport type { ThemedStyledProps, DefaultTheme } from 'styled-components'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { getColor } from 'mixins/color'\nimport { focus } from 'mixins/focus'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport { display } from 'mixins/display'\nimport { Text } from 'components/Text'\nimport type { CSSColor } from 'shared/types'\nimport type { StyledAnchorProps, AnchorPalette, StyledContentProps } from './types'\n\nconst shouldForwardAnchorProp = createShouldForwardProp(\n (propKey) => !['display', 'underline', 'onColored', 'verticalAlign', 'pseudo', 'wrapper'].includes(propKey)\n)\n\nconst template = (palette: AnchorPalette) => `\n color: ${palette.color};\n &:hover {\n color: ${palette.colorHover};\n }\n &:active {\n color: ${palette.color};\n }\n &[data-disabled=\"true\"] {\n color: ${palette.colorDisabled};\n }\n`\n\nconst COLOR_SCHEMA = {\n default: css<StyledAnchorProps>`\n ${(props) =>\n template({\n color: props.wrapper ? 'inherit' : props.theme.colors.accent,\n colorHover: props.wrapper ? 'inherit' : props.theme.colors.primary,\n colorDisabled: props.theme.colors['content-disabled'],\n ...props.palette,\n })}\n `,\n primary: css<StyledAnchorProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-link'],\n colorHover: tinycolor(props.theme.colors['content-link']).lighten(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-disabled'],\n ...props.palette,\n })}\n `,\n onColored: css<StyledAnchorProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-oncolor-primary'],\n colorHover: tinycolor(props.theme.colors['content-oncolor-primary']).darken(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-oncolor-disabled'],\n ...props.palette,\n })}\n `,\n}\n\nconst anchorStyles = (props: ThemedStyledProps<StyledAnchorProps, DefaultTheme>) => {\n if (props.onColored) return COLOR_SCHEMA.onColored\n return props.preset === 'brand' ? COLOR_SCHEMA.primary : COLOR_SCHEMA.default\n}\n\nexport const Root = styled.a.withConfig<StyledAnchorProps>({\n shouldForwardProp: shouldForwardAnchorProp,\n})`\n ${(props) => `\n box-sizing: border-box;\n isolation: isolate;\n transition-property: color;\n transition-duration: 150ms;\n transition-timing-function: ease-in;\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n vertical-align: ${\n props.verticalAlign\n ? `${typeof props.verticalAlign === 'string' ? props.verticalAlign : 'text-bottom'}`\n : 'baseline'\n };\n ${\n props.preset === 'brand'\n ? `\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n `\n : `\n display: ${props.wrapper ? 'block' : 'inline-block'};\n text-decoration-line: ${props.underline === true ? 'underline' : 'none'};\n border-bottom: ${\n props.pseudo || typeof props.underline === 'string'\n ? `1px ${typeof props.underline === 'string' ? props.underline : 'dashed'}`\n : 'none'\n };\n `\n }\n \n `}\n\n ${anchorStyles}\n ${focus}\n ${responsiveSize}\n ${responsiveMargin}\n \n ${(props) => props.display && display(props.display)}\n ${(props) => props.color && `color: ${getColor(props.color, props)};`}\n`\n\nexport const Content = styled(Text).withConfig<StyledContentProps>({\n shouldForwardProp: (propKey) => propKey !== 'underline',\n})`\n ${(props) =>\n props.underline &&\n `\n text-decoration-line: underline;\n text-decoration-style: ${typeof props.underline === 'string' ? props.underline : 'solid'};\n text-underline-offset: 0.3em;\n `}\n`\n"],"names":["shouldForwardAnchorProp","createShouldForwardProp","propKey","includes","template","palette","color","colorHover","colorDisabled","COLOR_SCHEMA","default","css","props","wrapper","theme","colors","accent","primary","tinycolor","lighten","toString","onColored","darken","Root","styled","a","withConfig","shouldForwardProp","displayName","componentId","disabled","verticalAlign","preset","underline","pseudo","focus","responsiveSize","responsiveMargin","display","getColor","Content","Text"],"mappings":"gmBAaA,MAAMA,wBAA0BC,MAAAA,yBAC7BC,IAAa,CAAC,UAAW,YAAa,YAAa,gBAAiB,SAAU,WAAWC,SAASD,KAGrG,MAAME,SAAYC,GAA2B,cAClCA,EAAQC,mCAEND,EAAQE,8CAGRF,EA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AAMoB,SAAW,QAAUvB,aAAaQ,QAAUR,aAAaC,SAwCpEyB,MAAKA,MACLC,8BACAC,iBAAAA,kBAECzB,GAAUA,EAAM0B,SAAWA,QAAOA,QAAC1B,EAAM0B,WACzC1B,GAAUA,EAAMN,OAAS,UAAUiC,MAAAA,SAAS3B,EAAMN,MAAOM,QAGvD,MAAM4B,QAAUhB,gBAAMd,QAAC+B,WAAMf,WAA+B,CACjEC,kBAAoBzB,GAAYA,IAAY,cAC5CwB,WAAA,CAAAE,YAAA,kBAAAC,YAAA,oBAFqBL,CAErB,CAAA,GAAA,KACGZ,GACDA,EAAMqB,WACN,iFAEkCrB,EAAMqB,WAAc,SAAWrB,EAAMqB,UAAY"}
@@ -1,2 +1,2 @@
1
- import styled,{css}from'styled-components';import tinycolor from'../../external/.pnpm/tinycolor2@1.4.2/node_modules/tinycolor2/tinycolor.mjs';import{createShouldForwardProp}from'../../shared/utils/style.mjs';import{getColor}from'../../mixins/color.mjs';import{focus}from'../../mixins/focus.mjs';import{responsiveSize}from'../../mixins/responsive-size.mjs';import{responsiveMargin}from'../../mixins/responsive-margin.mjs';import{display}from'../../mixins/display.mjs';const shouldForwardAnchorProp=createShouldForwardProp((o=>!['display','underline','onColored','verticalAlign','pseudo','wrapper'].includes(o)));const template=o=>`\n color: ${o.color};\n &:hover {\n color: ${o.colorHover};\n }\n &:active {\n color: ${o.color};\n }\n &[data-disabled="true"] {\n color: ${o.colorDisabled};\n }\n`;const COLOR_SCHEMA={default:css(["",""],(o=>template({color:o.wrapper?'inherit':o.theme.colors.accent,colorHover:o.wrapper?'inherit':o.theme.colors.primary,colorDisabled:o.theme.colors['content-disabled'],...o.palette}))),primary:css(["",""],(o=>template({color:o.theme.colors['content-link'],colorHover:tinycolor(o.theme.colors['content-link']).lighten(10).toString(),colorDisabled:o.theme.colors['content-disabled'],...o.palette}))),onColored:css(["",""],(o=>template({color:o.theme.colors['content-oncolor-primary'],colorHover:tinycolor(o.theme.colors['content-oncolor-primary']).darken(10).toString(),colorDisabled:o.theme.colors['content-oncolor-disabled'],...o.palette})))};const Root=styled.a.withConfig({shouldForwardProp:shouldForwardAnchorProp}).withConfig({displayName:"Anchor__Root",componentId:"ui__sc-1n89po4-0"})([""," "," "," "," "," "," ",""],(o=>`\n box-sizing: border-box;\n isolation: isolate;\n transition-property: color;\n transition-duration: 150ms;\n transition-timing-function: ease-in;\n cursor: ${o.disabled?'not-allowed':'pointer'};\n vertical-align: ${o.verticalAlign?`${typeof o.verticalAlign=='string'?o.verticalAlign:'text-bottom'}`:'baseline'};\n ${o.preset==='brand'?"\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n text-decoration: none;\n ":`\n display: ${o.wrapper?'block':'inline-block'};\n text-decoration-line: ${o.underline===!0?'underline':'none'};\n border-bottom: ${o.pseudo||typeof o.underline=='string'?`1px ${typeof o.underline=='string'?o.underline:'dashed'}`:'none'};\n `}\n \n `),(o=>o.onColored?COLOR_SCHEMA.onColored:o.preset==='brand'?COLOR_SCHEMA.primary:COLOR_SCHEMA.default),focus,responsiveSize,responsiveMargin,(o=>o.display&&display(o.display)),(o=>o.color&&`color: ${getColor(o.color,o)};`));export{Root};
1
+ import styled,{css}from'styled-components';import tinycolor from'../../external/.pnpm/tinycolor2@1.4.2/node_modules/tinycolor2/tinycolor.mjs';import{createShouldForwardProp}from'../../shared/utils/style.mjs';import{getColor}from'../../mixins/color.mjs';import{focus}from'../../mixins/focus.mjs';import{responsiveSize}from'../../mixins/responsive-size.mjs';import{responsiveMargin}from'../../mixins/responsive-margin.mjs';import{display}from'../../mixins/display.mjs';import{Text}from'../Text/Text.mjs';const shouldForwardAnchorProp=createShouldForwardProp((o=>!['display','underline','onColored','verticalAlign','pseudo','wrapper'].includes(o)));const template=o=>`\n color: ${o.color};\n &:hover {\n color: ${o.colorHover};\n }\n &:active {\n color: ${o.color};\n }\n &[data-disabled="true"] {\n color: ${o.colorDisabled};\n }\n`;const COLOR_SCHEMA={default:css(["",""],(o=>template({color:o.wrapper?'inherit':o.theme.colors.accent,colorHover:o.wrapper?'inherit':o.theme.colors.primary,colorDisabled:o.theme.colors['content-disabled'],...o.palette}))),primary:css(["",""],(o=>template({color:o.theme.colors['content-link'],colorHover:tinycolor(o.theme.colors['content-link']).lighten(10).toString(),colorDisabled:o.theme.colors['content-disabled'],...o.palette}))),onColored:css(["",""],(o=>template({color:o.theme.colors['content-oncolor-primary'],colorHover:tinycolor(o.theme.colors['content-oncolor-primary']).darken(10).toString(),colorDisabled:o.theme.colors['content-oncolor-disabled'],...o.palette})))};const Root=styled.a.withConfig({shouldForwardProp:shouldForwardAnchorProp}).withConfig({displayName:"Anchor__Root",componentId:"ui__sc-1n89po4-0"})([""," "," "," "," "," "," ",""],(o=>`\n box-sizing: border-box;\n isolation: isolate;\n transition-property: color;\n transition-duration: 150ms;\n transition-timing-function: ease-in;\n cursor: ${o.disabled?'not-allowed':'pointer'};\n vertical-align: ${o.verticalAlign?`${typeof o.verticalAlign=='string'?o.verticalAlign:'text-bottom'}`:'baseline'};\n ${o.preset==='brand'?"\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n ":`\n display: ${o.wrapper?'block':'inline-block'};\n text-decoration-line: ${o.underline===!0?'underline':'none'};\n border-bottom: ${o.pseudo||typeof o.underline=='string'?`1px ${typeof o.underline=='string'?o.underline:'dashed'}`:'none'};\n `}\n \n `),(o=>o.onColored?COLOR_SCHEMA.onColored:o.preset==='brand'?COLOR_SCHEMA.primary:COLOR_SCHEMA.default),focus,responsiveSize,responsiveMargin,(o=>o.display&&display(o.display)),(o=>o.color&&`color: ${getColor(o.color,o)};`));const Content=styled(Text).withConfig({shouldForwardProp:o=>o!=='underline'}).withConfig({displayName:"Anchor__Content",componentId:"ui__sc-1n89po4-1"})(["",""],(o=>o.underline&&`\n text-decoration-line: underline;\n text-decoration-style: ${typeof o.underline=='string'?o.underline:'solid'};\n text-underline-offset: 0.3em;\n `));export{Content,Root};
2
2
  //# sourceMappingURL=style.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.mjs","sources":["../../../../src/components/Anchor/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport tinycolor from 'tinycolor2'\nimport type { ThemedStyledProps, DefaultTheme } from 'styled-components'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { getColor } from 'mixins/color'\nimport { focus } from 'mixins/focus'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport { display } from 'mixins/display'\nimport type { CSSColor } from 'shared/types'\nimport type { StyledAnchorProps, AnchorPalette } from './types'\n\nconst shouldForwardAnchorProp = createShouldForwardProp(\n (propKey) => !['display', 'underline', 'onColored', 'verticalAlign', 'pseudo', 'wrapper'].includes(propKey)\n)\n\nconst template = (palette: AnchorPalette) => `\n color: ${palette.color};\n &:hover {\n color: ${palette.colorHover};\n }\n &:active {\n color: ${palette.color};\n }\n &[data-disabled=\"true\"] {\n color: ${palette.colorDisabled};\n }\n`\n\nconst COLOR_SCHEMA = {\n default: css<StyledAnchorProps>`\n ${(props) =>\n template({\n color: props.wrapper ? 'inherit' : props.theme.colors.accent,\n colorHover: props.wrapper ? 'inherit' : props.theme.colors.primary,\n colorDisabled: props.theme.colors['content-disabled'],\n ...props.palette,\n })}\n `,\n primary: css<StyledAnchorProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-link'],\n colorHover: tinycolor(props.theme.colors['content-link']).lighten(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-disabled'],\n ...props.palette,\n })}\n `,\n onColored: css<StyledAnchorProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-oncolor-primary'],\n colorHover: tinycolor(props.theme.colors['content-oncolor-primary']).darken(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-oncolor-disabled'],\n ...props.palette,\n })}\n `,\n}\n\nconst anchorStyles = (props: ThemedStyledProps<StyledAnchorProps, DefaultTheme>) => {\n if (props.onColored) return COLOR_SCHEMA.onColored\n return props.preset === 'brand' ? COLOR_SCHEMA.primary : COLOR_SCHEMA.default\n}\n\nexport const Root = styled.a.withConfig<StyledAnchorProps>({\n shouldForwardProp: shouldForwardAnchorProp,\n})`\n ${(props) => `\n box-sizing: border-box;\n isolation: isolate;\n transition-property: color;\n transition-duration: 150ms;\n transition-timing-function: ease-in;\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n vertical-align: ${\n props.verticalAlign\n ? `${typeof props.verticalAlign === 'string' ? props.verticalAlign : 'text-bottom'}`\n : 'baseline'\n };\n ${\n props.preset === 'brand'\n ? `\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n text-decoration: none;\n `\n : `\n display: ${props.wrapper ? 'block' : 'inline-block'};\n text-decoration-line: ${props.underline === true ? 'underline' : 'none'};\n border-bottom: ${\n props.pseudo || typeof props.underline === 'string'\n ? `1px ${typeof props.underline === 'string' ? props.underline : 'dashed'}`\n : 'none'\n };\n `\n }\n \n `}\n\n ${anchorStyles}\n ${focus}\n ${responsiveSize}\n ${responsiveMargin}\n \n ${(props) => props.display && display(props.display)}\n ${(props) => props.color && `color: ${getColor(props.color, props)};`}\n`\n"],"names":["shouldForwardAnchorProp","createShouldForwardProp","propKey","includes","template","palette","color","colorHover","colorDisabled","COLOR_SCHEMA","default","css","props","wrapper","theme","colors","accent","primary","tinycolor","lighten","toString","onColored","darken","Root","styled","a","withConfig","shouldForwardProp","displayName","componentId","disabled","verticalAlign","preset","underline","pseudo","focus","responsiveSize","responsiveMargin","display","getColor"],"mappings":"mdAYA,MAAMA,wBAA0BC,yBAC7BC,IAAa,CAAC,UAAW,YAAa,YAAa,gBAAiB,SAAU,WAAWC,SAASD,KAGrG,MAAME,SAAYC,GAA2B,cAClCA,EAAQC,mCAEND,EAAQE,8CAGRF,EAAQC,wDAGRD,EAAQG,wBAIrB,MAAMC,aAAe,CACnBC,QAASC,IAAG,CAAA,GAAA,KACPC,GACDR,SAAS,CACPE,MAAOM,EAAMC,Q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,SAAS3B,EAAMN,MAAOM"}
1
+ {"version":3,"file":"style.mjs","sources":["../../../../src/components/Anchor/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport tinycolor from 'tinycolor2'\nimport type { ThemedStyledProps, DefaultTheme } from 'styled-components'\nimport { createShouldForwardProp } from 'shared/utils/style'\nimport { getColor } from 'mixins/color'\nimport { focus } from 'mixins/focus'\nimport { responsiveSize } from 'mixins/responsive-size'\nimport { responsiveMargin } from 'mixins/responsive-margin'\nimport { display } from 'mixins/display'\nimport { Text } from 'components/Text'\nimport type { CSSColor } from 'shared/types'\nimport type { StyledAnchorProps, AnchorPalette, StyledContentProps } from './types'\n\nconst shouldForwardAnchorProp = createShouldForwardProp(\n (propKey) => !['display', 'underline', 'onColored', 'verticalAlign', 'pseudo', 'wrapper'].includes(propKey)\n)\n\nconst template = (palette: AnchorPalette) => `\n color: ${palette.color};\n &:hover {\n color: ${palette.colorHover};\n }\n &:active {\n color: ${palette.color};\n }\n &[data-disabled=\"true\"] {\n color: ${palette.colorDisabled};\n }\n`\n\nconst COLOR_SCHEMA = {\n default: css<StyledAnchorProps>`\n ${(props) =>\n template({\n color: props.wrapper ? 'inherit' : props.theme.colors.accent,\n colorHover: props.wrapper ? 'inherit' : props.theme.colors.primary,\n colorDisabled: props.theme.colors['content-disabled'],\n ...props.palette,\n })}\n `,\n primary: css<StyledAnchorProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-link'],\n colorHover: tinycolor(props.theme.colors['content-link']).lighten(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-disabled'],\n ...props.palette,\n })}\n `,\n onColored: css<StyledAnchorProps>`\n ${(props) =>\n template({\n color: props.theme.colors['content-oncolor-primary'],\n colorHover: tinycolor(props.theme.colors['content-oncolor-primary']).darken(10).toString() as CSSColor,\n colorDisabled: props.theme.colors['content-oncolor-disabled'],\n ...props.palette,\n })}\n `,\n}\n\nconst anchorStyles = (props: ThemedStyledProps<StyledAnchorProps, DefaultTheme>) => {\n if (props.onColored) return COLOR_SCHEMA.onColored\n return props.preset === 'brand' ? COLOR_SCHEMA.primary : COLOR_SCHEMA.default\n}\n\nexport const Root = styled.a.withConfig<StyledAnchorProps>({\n shouldForwardProp: shouldForwardAnchorProp,\n})`\n ${(props) => `\n box-sizing: border-box;\n isolation: isolate;\n transition-property: color;\n transition-duration: 150ms;\n transition-timing-function: ease-in;\n cursor: ${props.disabled ? 'not-allowed' : 'pointer'};\n vertical-align: ${\n props.verticalAlign\n ? `${typeof props.verticalAlign === 'string' ? props.verticalAlign : 'text-bottom'}`\n : 'baseline'\n };\n ${\n props.preset === 'brand'\n ? `\n display: inline-flex;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n `\n : `\n display: ${props.wrapper ? 'block' : 'inline-block'};\n text-decoration-line: ${props.underline === true ? 'underline' : 'none'};\n border-bottom: ${\n props.pseudo || typeof props.underline === 'string'\n ? `1px ${typeof props.underline === 'string' ? props.underline : 'dashed'}`\n : 'none'\n };\n `\n }\n \n `}\n\n ${anchorStyles}\n ${focus}\n ${responsiveSize}\n ${responsiveMargin}\n \n ${(props) => props.display && display(props.display)}\n ${(props) => props.color && `color: ${getColor(props.color, props)};`}\n`\n\nexport const Content = styled(Text).withConfig<StyledContentProps>({\n shouldForwardProp: (propKey) => propKey !== 'underline',\n})`\n ${(props) =>\n props.underline &&\n `\n text-decoration-line: underline;\n text-decoration-style: ${typeof props.underline === 'string' ? props.underline : 'solid'};\n text-underline-offset: 0.3em;\n `}\n`\n"],"names":["shouldForwardAnchorProp","createShouldForwardProp","propKey","includes","template","palette","color","colorHover","colorDisabled","COLOR_SCHEMA","default","css","props","wrapper","theme","colors","accent","primary","tinycolor","lighten","toString","onColored","darken","Root","styled","a","withConfig","shouldForwardProp","displayName","componentId","disabled","verticalAlign","preset","underline","pseudo","focus","responsiveSize","responsiveMargin","display","getColor","Content","Text"],"mappings":"sfAaA,MAAMA,wBAA0BC,yBAC7BC,IAAa,CAAC,UAAW,YAAa,YAAa,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AC/D,oCAlCErB,GAChBA,EAAMS,UAAkBZ,aAAaY,UAClCT,EAAMoB,SAAW,QAAUvB,aAAaQ,QAAUR,aAAaC,SAwCpEyB,MACAC,eACAC,kBAECzB,GAAUA,EAAM0B,SAAWA,QAAQ1B,EAAM0B,WACzC1B,GAAUA,EAAMN,OAAS,UAAUiC,SAAS3B,EAAMN,MAAOM,QAGvD,MAAM4B,QAAUhB,OAAOiB,MAAMf,WAA+B,CACjEC,kBAAoBzB,GAAYA,IAAY,cAC5CwB,WAAA,CAAAE,YAAA,kBAAAC,YAAA,oBAFqBL,CAErB,CAAA,GAAA,KACGZ,GACDA,EAAMqB,WACN,iFAEkCrB,EAAMqB,WAAc,SAAWrB,EAAMqB,UAAY"}
@@ -1,2 +1,2 @@
1
- 'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var utils=require('./utils.js');var constants=require('./constants.js');var defaultConstants=require('./default-constants.js');var style=require('./style.js');var require$$0=require('react/jsx-runtime');var Skeleton=require('../Skeleton/Skeleton.js');var Text=require('../Text/Text.js');const Avatar=withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const{size:t="m",textProps:s={},children:a,text:i,...n}=e;const o=typeof t!='string'||n.preset!=='default'&&t!=='sm'?t:defaultConstants.SIZES_MAPPING_RULES[t]??t;return require$$0.jsx(style.Root,{...n,size:o,ref:r,children:n.loading?require$$0.jsx(Skeleton.Skeleton,{as:"span",width:"100%",height:"100%",borderRadius:"inherit"}):require$$0.jsx(require$$0.Fragment,{children:a??(!n.src&&require$$0.jsx(Text.Text,{as:"span",appearance:"caption",size:"inherit",color:"inherit",lineHeight:1,marginTop:1,transform:"uppercase",...s,children:utils.abbreviateCaption(i||n.title||'')}))})})})),{displayName:'Avatar',sizes:e=>e.preset==='brand'?e.square?constants.SIZES_SQUARE:constants.SIZES:defaultConstants.SIZES_DEFAULT});exports.Avatar=Avatar;
1
+ 'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var utils=require('./utils.js');var constants=require('./constants.js');var defaultConstants=require('./default-constants.js');var style=require('./style.js');var require$$0=require('react/jsx-runtime');var Skeleton=require('../Skeleton/Skeleton.js');var Text=require('../Text/Text.js');const Avatar=withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const{size:t="m",textProps:s={},children:a,text:i,...n}=e;const o=typeof t!='string'||n.preset!=='default'&&t!=='sm'?t:defaultConstants.SIZES_MAPPING_RULES[t]??t;return require$$0.jsx(style.Root,{...n,size:o,ref:r,children:n.loading?require$$0.jsx(Skeleton.Skeleton,{as:"span",width:"100%",height:"100%",borderRadius:"inherit"}):require$$0.jsx(require$$0.Fragment,{children:a??(!n.src&&require$$0.jsx(Text.Text,{as:"span",appearance:"caption",size:"inherit",color:"inherit",lineHeight:1,marginTop:1,transform:"uppercase",...s,children:utils.abbreviateCaption(i||n.title||'')}))})})})),{displayName:'Avatar',sizes:e=>e.preset==='brand'?e.square?constants.SIZES_SQUARE:constants.SIZES:defaultConstants.SIZES_DEFAULT});exports.SIZES=constants.SIZES,exports.SIZES_SQUARE=constants.SIZES_SQUARE,exports.Avatar=Avatar;
2
2
  //# sourceMappingURL=Avatar.js.map
@@ -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 { 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((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 <>\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 )}\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"],"names":["Avatar","withMergedProps","forwardRef","props","ref","size","textProps","children","text","restProps","sizeMapped","preset","SIZES_MAPPING_RULES","_jsx","Styled","loading","Skeleton","as","width","height","borderRadius","jsx","_Fragment","src","Text","appearance","color","lineHeight","marginTop","transform","abbreviateCaption","title","displayName","sizes","square","SIZES_SQUARE","SIZES","SIZES_DEFAULT"],"mappings":"oYAsBMA,MAAAA,OAAuDC,gBAAAA,gBAC3DC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,KAAEA,EAAO,IAAGC,UAAEA,EAAY,CAAE,EAAAC,SAAEA,EAAQC,KAAEA,KAASC,GAAcN,EAErE,MAAMO,SACGL,GAAS,UAAaI,EAAUE,SAAW,WAAaN,IAAS,KAEpEA,EADAO,iBAAmBA,oBAACP,IAASA,EAGnC,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,YAE5DP,WAAAQ,IAAAC,oBAAA,CAAAf,SACGA,KACGE,EAAUc,KACVV,WAAAA,IAACW,KAAAA,KAAI,CACHP,GAAG,OACHQ,WAAW,UACXpB,KAAK,UACLqB,MAAM,UACNC,WAAY,EACZC,UAAW,EACXC,UAAU,eACNvB,EAASC,SAEZuB,MAAAA,kBAAkBtB,GAAQC,EAAUsB,OAAS,UAK5C,IAGlB,CACEC,YAhDmB,SAiDnBC,MAAQ9B,GACFA,EAAMQ,SAAW,QACZR,EAAM+B,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 { 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((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 <>\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 )}\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","jsx","_Fragment","src","Text","appearance","color","lineHeight","marginTop","transform","abbreviateCaption","title","displayName","sizes","square","SIZES_SQUARE","SIZES","SIZES_DEFAULT"],"mappings":"oYAsBMA,MAAAA,OAAuDC,gBAAAA,gBAC3DC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,KAAEA,EAAO,IAAGC,UAAEA,EAAY,CAAE,EAAAC,SAAEA,EAAQC,KAAEA,KAASC,GAAcN,EAErE,MAAMO,SACGL,GAAS,UAAaI,EAAUE,SAAW,WAAaN,IAAS,KAEpEA,EADAO,iBAAmBA,oBAACP,IAASA,EAGnC,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,YAE5DP,WAAAQ,IAAAC,oBAAA,CAAAf,SACGA,KACGE,EAAUc,KACVV,WAAAA,IAACW,KAAAA,KAAI,CACHP,GAAG,OACHQ,WAAW,UACXpB,KAAK,UACLqB,MAAM,UACNC,WAAY,EACZC,UAAW,EACXC,UAAU,eACNvB,EAASC,SAEZuB,MAAAA,kBAAkBtB,GAAQC,EAAUsB,OAAS,UAK5C,IAGlB,CACEC,YAhDmB,SAiDnBC,MAAQ9B,GACFA,EAAMQ,SAAW,QACZR,EAAM+B,OAASC,UAAYA,aAAGC,gBAGhCC"}
@@ -1,2 +1,2 @@
1
- import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{abbreviateCaption}from'./utils.mjs';import{SIZES_SQUARE,SIZES}from'./constants.mjs';import{SIZES_DEFAULT,SIZES_MAPPING_RULES}from'./default-constants.mjs';import{Root}from'./style.mjs';import{jsx,Fragment}from'react/jsx-runtime';import{Skeleton}from'../Skeleton/Skeleton.mjs';import{Text}from'../Text/Text.mjs';const Avatar=withMergedProps(forwardRef(((t,e)=>{const{size:r="m",textProps:o={},children:s,text:i,...a}=t;const n=typeof r!='string'||a.preset!=='default'&&r!=='sm'?r:SIZES_MAPPING_RULES[r]??r;return jsx(Root,{...a,size:n,ref:e,children:a.loading?jsx(Skeleton,{as:"span",width:"100%",height:"100%",borderRadius:"inherit"}):jsx(Fragment,{children:s??(!a.src&&jsx(Text,{as:"span",appearance:"caption",size:"inherit",color:"inherit",lineHeight:1,marginTop:1,transform:"uppercase",...o,children:abbreviateCaption(i||a.title||'')}))})})})),{displayName:'Avatar',sizes:t=>t.preset==='brand'?t.square?SIZES_SQUARE:SIZES:SIZES_DEFAULT});export{Avatar};
1
+ import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{abbreviateCaption}from'./utils.mjs';import{SIZES_SQUARE,SIZES}from'./constants.mjs';import{SIZES_DEFAULT,SIZES_MAPPING_RULES}from'./default-constants.mjs';import{Root}from'./style.mjs';import{jsx,Fragment}from'react/jsx-runtime';import{Skeleton}from'../Skeleton/Skeleton.mjs';import{Text}from'../Text/Text.mjs';const Avatar=withMergedProps(forwardRef(((t,e)=>{const{size:r="m",textProps:o={},children:s,text:i,...a}=t;const n=typeof r!='string'||a.preset!=='default'&&r!=='sm'?r:SIZES_MAPPING_RULES[r]??r;return jsx(Root,{...a,size:n,ref:e,children:a.loading?jsx(Skeleton,{as:"span",width:"100%",height:"100%",borderRadius:"inherit"}):jsx(Fragment,{children:s??(!a.src&&jsx(Text,{as:"span",appearance:"caption",size:"inherit",color:"inherit",lineHeight:1,marginTop:1,transform:"uppercase",...o,children:abbreviateCaption(i||a.title||'')}))})})})),{displayName:'Avatar',sizes:t=>t.preset==='brand'?t.square?SIZES_SQUARE:SIZES:SIZES_DEFAULT});export{Avatar,SIZES,SIZES_SQUARE};
2
2
  //# sourceMappingURL=Avatar.mjs.map
@@ -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 { 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((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 <>\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 )}\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"],"names":["Avatar","withMergedProps","forwardRef","props","ref","size","textProps","children","text","restProps","sizeMapped","preset","SIZES_MAPPING_RULES","_jsx","Styled","loading","Skeleton","as","width","height","borderRadius","_Fragment","src","Text","appearance","color","lineHeight","marginTop","transform","abbreviateCaption","title","displayName","sizes","square","SIZES_SQUARE","SIZES","SIZES_DEFAULT"],"mappings":"wZAsBMA,MAAAA,OAAuDC,gBAC3DC,YAAW,CAACC,EAAOC,KACjB,MAAMC,KAAEA,EAAO,IAAGC,UAAEA,EAAY,CAAE,EAAAC,SAAEA,EAAQC,KAAEA,KAASC,GAAcN,EAErE,MAAMO,SACGL,GAAS,UAAaI,EAAUE,SAAW,WAAaN,IAAS,KAEpEA,EADAO,oBAAoBP,IAASA,EAGnC,OACEQ,IAACC,KAAW,IAAKL,EAAWJ,KAAMK,EAAYN,IAAKA,EAAIG,SACpDE,EAAUM,QACTF,IAACG,SAAQ,CAACC,GAAG,OAAOC,MAAM,OAAOC,OAAO,OAAOC,aAAa,YAE5DP,IAAAQ,SAAA,CAAAd,SACGA,KACGE,EAAUa,KACVT,IAACU,KAAI,CACHN,GAAG,OACHO,WAAW,UACXnB,KAAK,UACLoB,MAAM,UACNC,WAAY,EACZC,UAAW,EACXC,UAAU,eACNtB,EAASC,SAEZsB,kBAAkBrB,GAAQC,EAAUqB,OAAS,UAK5C,IAGlB,CACEC,YAhDmB,SAiDnBC,MAAQ7B,GACFA,EAAMQ,SAAW,QACZR,EAAM8B,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 { 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((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 <>\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 )}\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","_Fragment","src","Text","appearance","color","lineHeight","marginTop","transform","abbreviateCaption","title","displayName","sizes","square","SIZES_SQUARE","SIZES","SIZES_DEFAULT"],"mappings":"wZAsBMA,MAAAA,OAAuDC,gBAC3DC,YAAW,CAACC,EAAOC,KACjB,MAAMC,KAAEA,EAAO,IAAGC,UAAEA,EAAY,CAAE,EAAAC,SAAEA,EAAQC,KAAEA,KAASC,GAAcN,EAErE,MAAMO,SACGL,GAAS,UAAaI,EAAUE,SAAW,WAAaN,IAAS,KAEpEA,EADAO,oBAAoBP,IAASA,EAGnC,OACEQ,IAACC,KAAW,IAAKL,EAAWJ,KAAMK,EAAYN,IAAKA,EAAIG,SACpDE,EAAUM,QACTF,IAACG,SAAQ,CAACC,GAAG,OAAOC,MAAM,OAAOC,OAAO,OAAOC,aAAa,YAE5DP,IAAAQ,SAAA,CAAAd,SACGA,KACGE,EAAUa,KACVT,IAACU,KAAI,CACHN,GAAG,OACHO,WAAW,UACXnB,KAAK,UACLoB,MAAM,UACNC,WAAY,EACZC,UAAW,EACXC,UAAU,eACNtB,EAASC,SAEZsB,kBAAkBrB,GAAQC,EAAUqB,OAAS,UAK5C,IAGlB,CACEC,YAhDmB,SAiDnBC,MAAQ7B,GACFA,EAAMQ,SAAW,QACZR,EAAM8B,OAASC,aAAeC,MAGhCC"}
@@ -1,2 +1,2 @@
1
- 'use strict';exports.SIZES={xxxl:{width:120,height:120,fontSize:36,borderRadius:'50%'},xxl:{width:68,height:68,fontSize:24,borderRadius:'50%'},xl:{width:52,height:52,fontSize:18,borderRadius:'50%'},l:{width:48,height:48,fontSize:16,borderRadius:'50%'},m:{width:40,height:40,fontSize:14,borderRadius:'50%'},s:{width:32,height:32,fontSize:12,borderRadius:'50%'},xs:{width:24,height:24,fontSize:10,borderRadius:'50%'},xxs:{width:20,height:20,fontSize:8,borderRadius:'50%'},xxxs:{width:16,height:16,fontSize:6,borderRadius:'50%'}},exports.SIZES_SQUARE={xxxl:{width:120,height:120,fontSize:36,borderRadius:24},xxl:{width:68,height:68,fontSize:24,borderRadius:14},xl:{width:52,height:52,fontSize:18,borderRadius:11},l:{width:48,height:48,fontSize:16,borderRadius:10},m:{width:40,height:40,fontSize:14,borderRadius:8},s:{width:32,height:32,fontSize:12,borderRadius:7},xs:{width:24,height:24,fontSize:10,borderRadius:5},xxs:{width:20,height:20,fontSize:8,borderRadius:4},xxxs:{width:16,height:16,fontSize:6,borderRadius:4}};
1
+ 'use strict';exports.SIZES={xxxl:{width:120,height:120,fontSize:36,borderRadius:'50%'},xxl:{width:68,height:68,fontSize:24,borderRadius:'50%'},xl:{width:52,height:52,fontSize:18,borderRadius:'50%'},l:{width:48,height:48,fontSize:16,borderRadius:'50%'},m:{width:40,height:40,fontSize:14,borderRadius:'50%'},s:{width:32,height:32,fontSize:12,borderRadius:'50%'},xs:{width:28,height:28,fontSize:12,borderRadius:'50%'},xxs:{width:24,height:24,fontSize:10,borderRadius:'50%'},xxxs:{width:20,height:20,fontSize:8,borderRadius:'50%'}},exports.SIZES_SQUARE={xxxl:{width:120,height:120,fontSize:36,borderRadius:24},xxl:{width:68,height:68,fontSize:24,borderRadius:14},xl:{width:52,height:52,fontSize:18,borderRadius:11},l:{width:48,height:48,fontSize:16,borderRadius:10},m:{width:40,height:40,fontSize:14,borderRadius:8},s:{width:32,height:32,fontSize:12,borderRadius:7},xs:{width:28,height:28,fontSize:12,borderRadius:5},xxs:{width:24,height:24,fontSize:10,borderRadius:5},xxxs:{width:20,height:20,fontSize:8,borderRadius:4}};
2
2
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../src/components/Avatar/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Size } from 'shared/types'\n\nexport const SIZES: Record<Size, CSSProperties> = {\n xxxl: {\n width: 120,\n height: 120,\n fontSize: 36,\n borderRadius: '50%',\n },\n xxl: {\n width: 68,\n height: 68,\n fontSize: 24,\n borderRadius: '50%',\n },\n xl: {\n width: 52,\n height: 52,\n fontSize: 18,\n borderRadius: '50%',\n },\n l: {\n width: 48,\n height: 48,\n fontSize: 16,\n borderRadius: '50%',\n },\n m: {\n width: 40,\n height: 40,\n fontSize: 14,\n borderRadius: '50%',\n },\n s: {\n width: 32,\n height: 32,\n fontSize: 12,\n borderRadius: '50%',\n },\n xs: {\n width: 24,\n height: 24,\n fontSize: 10,\n borderRadius: '50%',\n },\n xxs: {\n width: 20,\n height: 20,\n fontSize: 8,\n borderRadius: '50%',\n },\n xxxs: {\n width: 16,\n height: 16,\n fontSize: 6,\n borderRadius: '50%',\n },\n}\n\nexport const SIZES_SQUARE: Record<Size, CSSProperties> = {\n xxxl: {\n width: 120,\n height: 120,\n fontSize: 36,\n borderRadius: 24,\n },\n xxl: {\n width: 68,\n height: 68,\n fontSize: 24,\n borderRadius: 14,\n },\n xl: {\n width: 52,\n height: 52,\n fontSize: 18,\n borderRadius: 11,\n },\n l: {\n width: 48,\n height: 48,\n fontSize: 16,\n borderRadius: 10,\n },\n m: {\n width: 40,\n height: 40,\n fontSize: 14,\n borderRadius: 8,\n },\n s: {\n width: 32,\n height: 32,\n fontSize: 12,\n borderRadius: 7,\n },\n xs: {\n width: 24,\n height: 24,\n fontSize: 10,\n borderRadius: 5,\n },\n xxs: {\n width: 20,\n height: 20,\n fontSize: 8,\n borderRadius: 4,\n },\n xxxs: {\n width: 16,\n height: 16,\n fontSize: 6,\n borderRadius: 4,\n },\n}\n"],"names":["xxxl","width","height","fontSize","borderRadius","xxl","xl","l","m","s","xs","xxs","xxxs"],"mappings":"2BAGkD,CAChDA,KAAM,CACJC,MAAO,IACPC,OAAQ,IACRC,SAAU,GACVC,aAAc,OAEhBC,IAAK,CACHJ,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBE,GAAI,CACFL,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBG,EAAG,CACDN,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBI,EAAG,CACDP,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBK,EAAG,CACDR,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBM,GAAI,CACFT,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBO,IAAK,CACHV,MAAO,GACPC,OAAQ,GACRC,SAAU,EACVC,aAAc,OAEhBQ,KAAM,CACJX,MAAO,GACPC,OAAQ,GACRC,SAAU,EACVC,aAAc,6BAIuC,CACvDJ,KAAM,CACJC,MAAO,IACPC,OAAQ,IACRC,SAAU,GACVC,aAAc,IAEhBC,IAAK,CACHJ,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,IAEhBE,GAAI,CACFL,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,IAEhBG,EAAG,CACDN,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,IAEhBI,EAAG,CACDP,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,GAEhBK,EAAG,CACDR,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,GAEhBM,GAAI,CACFT,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,GAEhBO,IAAK,CACHV,MAAO,GACPC,OAAQ,GACRC,SAAU,EACVC,aAAc,GAEhBQ,KAAM,CACJX,MAAO,GACPC,OAAQ,GACRC,SAAU,EACVC,aAAc"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/components/Avatar/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Size } from 'shared/types'\n\nexport const SIZES: Record<Size, CSSProperties> = {\n xxxl: {\n width: 120,\n height: 120,\n fontSize: 36,\n borderRadius: '50%',\n },\n xxl: {\n width: 68,\n height: 68,\n fontSize: 24,\n borderRadius: '50%',\n },\n xl: {\n width: 52,\n height: 52,\n fontSize: 18,\n borderRadius: '50%',\n },\n l: {\n width: 48,\n height: 48,\n fontSize: 16,\n borderRadius: '50%',\n },\n m: {\n width: 40,\n height: 40,\n fontSize: 14,\n borderRadius: '50%',\n },\n s: {\n width: 32,\n height: 32,\n fontSize: 12,\n borderRadius: '50%',\n },\n xs: {\n width: 28,\n height: 28,\n fontSize: 12,\n borderRadius: '50%',\n },\n xxs: {\n width: 24,\n height: 24,\n fontSize: 10,\n borderRadius: '50%',\n },\n xxxs: {\n width: 20,\n height: 20,\n fontSize: 8,\n borderRadius: '50%',\n },\n}\n\nexport const SIZES_SQUARE: Record<Size, CSSProperties> = {\n xxxl: {\n width: 120,\n height: 120,\n fontSize: 36,\n borderRadius: 24,\n },\n xxl: {\n width: 68,\n height: 68,\n fontSize: 24,\n borderRadius: 14,\n },\n xl: {\n width: 52,\n height: 52,\n fontSize: 18,\n borderRadius: 11,\n },\n l: {\n width: 48,\n height: 48,\n fontSize: 16,\n borderRadius: 10,\n },\n m: {\n width: 40,\n height: 40,\n fontSize: 14,\n borderRadius: 8,\n },\n s: {\n width: 32,\n height: 32,\n fontSize: 12,\n borderRadius: 7,\n },\n xs: {\n width: 28,\n height: 28,\n fontSize: 12,\n borderRadius: 5,\n },\n xxs: {\n width: 24,\n height: 24,\n fontSize: 10,\n borderRadius: 5,\n },\n xxxs: {\n width: 20,\n height: 20,\n fontSize: 8,\n borderRadius: 4,\n },\n}\n"],"names":["xxxl","width","height","fontSize","borderRadius","xxl","xl","l","m","s","xs","xxs","xxxs"],"mappings":"2BAGkD,CAChDA,KAAM,CACJC,MAAO,IACPC,OAAQ,IACRC,SAAU,GACVC,aAAc,OAEhBC,IAAK,CACHJ,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBE,GAAI,CACFL,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBG,EAAG,CACDN,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBI,EAAG,CACDP,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBK,EAAG,CACDR,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBM,GAAI,CACFT,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBO,IAAK,CACHV,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBQ,KAAM,CACJX,MAAO,GACPC,OAAQ,GACRC,SAAU,EACVC,aAAc,6BAIuC,CACvDJ,KAAM,CACJC,MAAO,IACPC,OAAQ,IACRC,SAAU,GACVC,aAAc,IAEhBC,IAAK,CACHJ,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,IAEhBE,GAAI,CACFL,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,IAEhBG,EAAG,CACDN,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,IAEhBI,EAAG,CACDP,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,GAEhBK,EAAG,CACDR,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,GAEhBM,GAAI,CACFT,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,GAEhBO,IAAK,CACHV,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,GAEhBQ,KAAM,CACJX,MAAO,GACPC,OAAQ,GACRC,SAAU,EACVC,aAAc"}
@@ -1,2 +1,2 @@
1
- const SIZES={xxxl:{width:120,height:120,fontSize:36,borderRadius:'50%'},xxl:{width:68,height:68,fontSize:24,borderRadius:'50%'},xl:{width:52,height:52,fontSize:18,borderRadius:'50%'},l:{width:48,height:48,fontSize:16,borderRadius:'50%'},m:{width:40,height:40,fontSize:14,borderRadius:'50%'},s:{width:32,height:32,fontSize:12,borderRadius:'50%'},xs:{width:24,height:24,fontSize:10,borderRadius:'50%'},xxs:{width:20,height:20,fontSize:8,borderRadius:'50%'},xxxs:{width:16,height:16,fontSize:6,borderRadius:'50%'}};const SIZES_SQUARE={xxxl:{width:120,height:120,fontSize:36,borderRadius:24},xxl:{width:68,height:68,fontSize:24,borderRadius:14},xl:{width:52,height:52,fontSize:18,borderRadius:11},l:{width:48,height:48,fontSize:16,borderRadius:10},m:{width:40,height:40,fontSize:14,borderRadius:8},s:{width:32,height:32,fontSize:12,borderRadius:7},xs:{width:24,height:24,fontSize:10,borderRadius:5},xxs:{width:20,height:20,fontSize:8,borderRadius:4},xxxs:{width:16,height:16,fontSize:6,borderRadius:4}};export{SIZES,SIZES_SQUARE};
1
+ const SIZES={xxxl:{width:120,height:120,fontSize:36,borderRadius:'50%'},xxl:{width:68,height:68,fontSize:24,borderRadius:'50%'},xl:{width:52,height:52,fontSize:18,borderRadius:'50%'},l:{width:48,height:48,fontSize:16,borderRadius:'50%'},m:{width:40,height:40,fontSize:14,borderRadius:'50%'},s:{width:32,height:32,fontSize:12,borderRadius:'50%'},xs:{width:28,height:28,fontSize:12,borderRadius:'50%'},xxs:{width:24,height:24,fontSize:10,borderRadius:'50%'},xxxs:{width:20,height:20,fontSize:8,borderRadius:'50%'}};const SIZES_SQUARE={xxxl:{width:120,height:120,fontSize:36,borderRadius:24},xxl:{width:68,height:68,fontSize:24,borderRadius:14},xl:{width:52,height:52,fontSize:18,borderRadius:11},l:{width:48,height:48,fontSize:16,borderRadius:10},m:{width:40,height:40,fontSize:14,borderRadius:8},s:{width:32,height:32,fontSize:12,borderRadius:7},xs:{width:28,height:28,fontSize:12,borderRadius:5},xxs:{width:24,height:24,fontSize:10,borderRadius:5},xxxs:{width:20,height:20,fontSize:8,borderRadius:4}};export{SIZES,SIZES_SQUARE};
2
2
  //# sourceMappingURL=constants.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.mjs","sources":["../../../../src/components/Avatar/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Size } from 'shared/types'\n\nexport const SIZES: Record<Size, CSSProperties> = {\n xxxl: {\n width: 120,\n height: 120,\n fontSize: 36,\n borderRadius: '50%',\n },\n xxl: {\n width: 68,\n height: 68,\n fontSize: 24,\n borderRadius: '50%',\n },\n xl: {\n width: 52,\n height: 52,\n fontSize: 18,\n borderRadius: '50%',\n },\n l: {\n width: 48,\n height: 48,\n fontSize: 16,\n borderRadius: '50%',\n },\n m: {\n width: 40,\n height: 40,\n fontSize: 14,\n borderRadius: '50%',\n },\n s: {\n width: 32,\n height: 32,\n fontSize: 12,\n borderRadius: '50%',\n },\n xs: {\n width: 24,\n height: 24,\n fontSize: 10,\n borderRadius: '50%',\n },\n xxs: {\n width: 20,\n height: 20,\n fontSize: 8,\n borderRadius: '50%',\n },\n xxxs: {\n width: 16,\n height: 16,\n fontSize: 6,\n borderRadius: '50%',\n },\n}\n\nexport const SIZES_SQUARE: Record<Size, CSSProperties> = {\n xxxl: {\n width: 120,\n height: 120,\n fontSize: 36,\n borderRadius: 24,\n },\n xxl: {\n width: 68,\n height: 68,\n fontSize: 24,\n borderRadius: 14,\n },\n xl: {\n width: 52,\n height: 52,\n fontSize: 18,\n borderRadius: 11,\n },\n l: {\n width: 48,\n height: 48,\n fontSize: 16,\n borderRadius: 10,\n },\n m: {\n width: 40,\n height: 40,\n fontSize: 14,\n borderRadius: 8,\n },\n s: {\n width: 32,\n height: 32,\n fontSize: 12,\n borderRadius: 7,\n },\n xs: {\n width: 24,\n height: 24,\n fontSize: 10,\n borderRadius: 5,\n },\n xxs: {\n width: 20,\n height: 20,\n fontSize: 8,\n borderRadius: 4,\n },\n xxxs: {\n width: 16,\n height: 16,\n fontSize: 6,\n borderRadius: 4,\n },\n}\n"],"names":["SIZES","xxxl","width","height","fontSize","borderRadius","xxl","xl","l","m","s","xs","xxs","xxxs","SIZES_SQUARE"],"mappings":"AAGO,MAAMA,MAAqC,CAChDC,KAAM,CACJC,MAAO,IACPC,OAAQ,IACRC,SAAU,GACVC,aAAc,OAEhBC,IAAK,CACHJ,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBE,GAAI,CACFL,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBG,EAAG,CACDN,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBI,EAAG,CACDP,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBK,EAAG,CACDR,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBM,GAAI,CACFT,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBO,IAAK,CACHV,MAAO,GACPC,OAAQ,GACRC,SAAU,EACVC,aAAc,OAEhBQ,KAAM,CACJX,MAAO,GACPC,OAAQ,GACRC,SAAU,EACVC,aAAc,QAIX,MAAMS,aAA4C,CACvDb,KAAM,CACJC,MAAO,IACPC,OAAQ,IACRC,SAAU,GACVC,aAAc,IAEhBC,IAAK,CACHJ,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,IAEhBE,GAAI,CACFL,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,IAEhBG,EAAG,CACDN,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,IAEhBI,EAAG,CACDP,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,GAEhBK,EAAG,CACDR,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,GAEhBM,GAAI,CACFT,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,GAEhBO,IAAK,CACHV,MAAO,GACPC,OAAQ,GACRC,SAAU,EACVC,aAAc,GAEhBQ,KAAM,CACJX,MAAO,GACPC,OAAQ,GACRC,SAAU,EACVC,aAAc"}
1
+ {"version":3,"file":"constants.mjs","sources":["../../../../src/components/Avatar/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { Size } from 'shared/types'\n\nexport const SIZES: Record<Size, CSSProperties> = {\n xxxl: {\n width: 120,\n height: 120,\n fontSize: 36,\n borderRadius: '50%',\n },\n xxl: {\n width: 68,\n height: 68,\n fontSize: 24,\n borderRadius: '50%',\n },\n xl: {\n width: 52,\n height: 52,\n fontSize: 18,\n borderRadius: '50%',\n },\n l: {\n width: 48,\n height: 48,\n fontSize: 16,\n borderRadius: '50%',\n },\n m: {\n width: 40,\n height: 40,\n fontSize: 14,\n borderRadius: '50%',\n },\n s: {\n width: 32,\n height: 32,\n fontSize: 12,\n borderRadius: '50%',\n },\n xs: {\n width: 28,\n height: 28,\n fontSize: 12,\n borderRadius: '50%',\n },\n xxs: {\n width: 24,\n height: 24,\n fontSize: 10,\n borderRadius: '50%',\n },\n xxxs: {\n width: 20,\n height: 20,\n fontSize: 8,\n borderRadius: '50%',\n },\n}\n\nexport const SIZES_SQUARE: Record<Size, CSSProperties> = {\n xxxl: {\n width: 120,\n height: 120,\n fontSize: 36,\n borderRadius: 24,\n },\n xxl: {\n width: 68,\n height: 68,\n fontSize: 24,\n borderRadius: 14,\n },\n xl: {\n width: 52,\n height: 52,\n fontSize: 18,\n borderRadius: 11,\n },\n l: {\n width: 48,\n height: 48,\n fontSize: 16,\n borderRadius: 10,\n },\n m: {\n width: 40,\n height: 40,\n fontSize: 14,\n borderRadius: 8,\n },\n s: {\n width: 32,\n height: 32,\n fontSize: 12,\n borderRadius: 7,\n },\n xs: {\n width: 28,\n height: 28,\n fontSize: 12,\n borderRadius: 5,\n },\n xxs: {\n width: 24,\n height: 24,\n fontSize: 10,\n borderRadius: 5,\n },\n xxxs: {\n width: 20,\n height: 20,\n fontSize: 8,\n borderRadius: 4,\n },\n}\n"],"names":["SIZES","xxxl","width","height","fontSize","borderRadius","xxl","xl","l","m","s","xs","xxs","xxxs","SIZES_SQUARE"],"mappings":"AAGO,MAAMA,MAAqC,CAChDC,KAAM,CACJC,MAAO,IACPC,OAAQ,IACRC,SAAU,GACVC,aAAc,OAEhBC,IAAK,CACHJ,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBE,GAAI,CACFL,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBG,EAAG,CACDN,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBI,EAAG,CACDP,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBK,EAAG,CACDR,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBM,GAAI,CACFT,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBO,IAAK,CACHV,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,OAEhBQ,KAAM,CACJX,MAAO,GACPC,OAAQ,GACRC,SAAU,EACVC,aAAc,QAIX,MAAMS,aAA4C,CACvDb,KAAM,CACJC,MAAO,IACPC,OAAQ,IACRC,SAAU,GACVC,aAAc,IAEhBC,IAAK,CACHJ,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,IAEhBE,GAAI,CACFL,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,IAEhBG,EAAG,CACDN,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,IAEhBI,EAAG,CACDP,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,GAEhBK,EAAG,CACDR,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,GAEhBM,GAAI,CACFT,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,GAEhBO,IAAK,CACHV,MAAO,GACPC,OAAQ,GACRC,SAAU,GACVC,aAAc,GAEhBQ,KAAM,CACJX,MAAO,GACPC,OAAQ,GACRC,SAAU,EACVC,aAAc"}
@@ -1,2 +1,2 @@
1
- 'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var constants=require('./constants.js');var style=require('./style.js');var require$$0=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');var Avatar=require('../Avatar/Avatar.js');var Text=require('../Text/Text.js');var Indicator=require('../Indicator/Indicator.js');var IconButton=require('../IconButton/IconButton.js');const Chip=withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const{size:t="m",textProps:i={},captionProps:s={},iconProps:n={},avatarProps:o={},indicatorProps:a={},discardButtonProps:c={},sizeXXS:p,sizeXS:d,sizeS:u,sizeM:l,sizeL:x,sizeXL:$,children:q,text:v,caption:h,icon:j,...z}=e;let I='div';let y;z.onClick&&(I='button'),c.onClick&&(I='div'),I==='button'&&(y='button'),z.type&&(y=z.type);const P={size:t,sizeXXS:p,sizeXS:d,sizeS:u,sizeM:l,sizeL:x,sizeXL:$};const[g,b]=Array.isArray(j)?j:[j];const f={as:'span',appearance:'body',size:'inherit',color:'inherit',lineHeight:h?1.3:1};const C={as:'span',appearance:'body',size:.75,sizeUnits:'em',color:'inherit',lineHeight:1};const S={icon:'close',square:!0,disabled:z.disabled};return require$$0.jsx(style.Root,{...z,...P,as:I,type:y,ref:r,children:typeof q=='function'?q({textProps:f,captionProps:C,discardButtonProps:S}):require$$0.jsxs(require$$0.Fragment,{children:[g&&require$$0.jsx(Icon.Icon,{preset:"brand",name:typeof g=='string'?g:void 0,icon:typeof g!='string'?g:void 0,...n}),(o.src||o.text)&&require$$0.jsx(Avatar.Avatar,{...P,preset:"brand",...o}),require$$0.jsxs(style.Content,{children:[require$$0.jsx(Text.Text,{...f,...i,children:q??v}),h&&require$$0.jsx(Text.Text,{...C,...s,children:h})]}),(a.children||a.text)&&require$$0.jsx(Indicator.Indicator,{...P,...a}),b&&require$$0.jsx(Icon.Icon,{preset:"brand",name:typeof b=='string'?b:void 0,icon:typeof b!='string'?b:void 0,...n}),c.onClick&&require$$0.jsx(IconButton.IconButton,{...P,...S,...c})]})})})),{displayName:'Chip',sizes:constants.SIZES});exports.Chip=Chip;
1
+ 'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var constants=require('./constants.js');var style=require('./style.js');var require$$0=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');var Avatar=require('../Avatar/Avatar.js');var Text=require('../Text/Text.js');var Indicator=require('../Indicator/Indicator.js');var IconButton=require('../IconButton/IconButton.js');const Chip=withMergedProps.withMergedProps(React.forwardRef(((e,r)=>{const{size:t="m",primary:s=!0,textProps:i={},captionProps:n={},iconProps:o={},avatarProps:a={},indicatorProps:c={},discardButtonProps:p={},sizeXXS:d,sizeXS:u,sizeS:I,sizeM:S,sizeL:l,sizeXL:q,children:x,text:$,caption:z,icon:h,...v}=e;let j='div';let y;v.onClick&&(j='button'),p.onClick&&(j='div'),j==='button'&&(y='button'),v.type&&(y=v.type);const A={size:t,sizeXXS:d,sizeXS:u,sizeS:I,sizeM:S,sizeL:l,sizeXL:q};const[C,P]=Array.isArray(h)?h:[h];const T={as:'span',appearance:'body',size:'inherit',color:'inherit',lineHeight:z?1.3:1};const _={as:'span',appearance:'body',size:.75,sizeUnits:'em',color:'inherit',lineHeight:1};const g={icon:'close',disabled:v.disabled};return require$$0.jsx(style.Root,{...v,...A,as:j,type:y,primary:s,ref:r,children:typeof x=='function'?x({textProps:T,captionProps:_,discardButtonProps:g}):require$$0.jsxs(require$$0.Fragment,{children:[C&&require$$0.jsx(Icon.Icon,{preset:"brand",name:typeof C=='string'?C:void 0,icon:typeof C!='string'?C:void 0,sizes:constants.SIZES_ICON,...A,...o}),(a.src||a.text)&&require$$0.jsx(Avatar.Avatar,{preset:"brand",sizes:a.square?constants.SIZES_CHIP_AVATAR_SQUARE:constants.SIZES_CHIP_AVATAR,...A,...a}),require$$0.jsxs(style.Content,{children:[require$$0.jsx(Text.Text,{...T,...i,children:x??$}),z&&require$$0.jsx(Text.Text,{..._,...n,children:z})]}),(c.children||c.text)&&require$$0.jsx(Indicator.Indicator,{sizes:constants.SIZES_CHIP_INDICATOR,marginRight:3,...A,...c}),P&&require$$0.jsx(Icon.Icon,{preset:"brand",name:typeof P=='string'?P:void 0,icon:typeof P!='string'?P:void 0,sizes:constants.SIZES_ICON,...A,...o}),p.onClick&&require$$0.jsx(IconButton.IconButton,{sizes:p.square?constants.SIZES_DISCARD_BUTTON_SQUARE:constants.SIZES_DISCARD_BUTTON,...A,...g,...p})]})})})),{displayName:'Chip',sizes:constants.SIZES});exports.Chip=Chip;
2
2
  //# sourceMappingURL=Chip.js.map
@@ -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 { 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 { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { ChipProps } from './types'\n\nconst COMPONENT_NAME = 'Chip'\n\n/**\n *\n * Component accepts all root HTML attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ChipProps](https://github.com/foxford/ui/blob/master/src/components/Chip/types.ts)\n */\nconst Chip: React.ForwardRefExoticComponent<ChipProps> = withMergedProps<ChipProps>(\n forwardRef((props, ref) => {\n const {\n size = 'm',\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 square: true,\n disabled: restProps.disabled,\n }\n\n return (\n <Styled.Root {...restProps} {...sizeProps} as={rootNode} type={rootType} 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 {...iconProps}\n />\n )}\n {(avatarProps.src || avatarProps.text) && <Avatar {...sizeProps} preset='brand' {...avatarProps} />}\n <Styled.Content>\n <Text {...textBaseProps} {...textProps}>\n {children ?? text}\n </Text>\n {caption && (\n <Text {...captionBaseProps} {...captionProps}>\n {caption}\n </Text>\n )}\n </Styled.Content>\n {(indicatorProps.children || indicatorProps.text) && <Indicator {...sizeProps} {...indicatorProps} />}\n {after && (\n <Icon\n preset='brand'\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconProps}\n />\n )}\n {discardButtonProps.onClick && (\n <IconButton {...sizeProps} {...discardButtonBaseProps} {...discardButtonProps} />\n )}\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","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","square","disabled","_jsx","Styled","_jsxs","jsxs","_Fragment","jsx","Icon","preset","name","undefined","src","Avatar","Text","Indicator","IconButton","displayName","sizes","SIZES"],"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AAO,QACPC,YAAatB,GAAW,SAAWA,OAASuB,EAC5C9B,YAAaO,GAAW,SAAWA,OAASuB,KACxC3C,KAGNC,EAAY2C,KAAO3C,EAAYU,OAASuB,WAAAK,IAACM,cAAM,IAAK1B,EAAWsB,OAAO,WAAYxC,IACpFmC,WAAAC,KAACF,cAAc,CAAAzB,SAAA,CACbwB,WAAAK,IAACO,UAAI,IAAKtB,KAAmB1B,EAASY,SACnCA,GAAYC,IAEdC,GACCsB,WAAAK,IAACO,UAAI,IAAKjB,KAAsB9B,EAAYW,SACzCE,QAILV,EAAeQ,UAAYR,EAAeS,OAASuB,WAAAK,IAACQ,oBAAS,IAAK5B,KAAejB,IAClFmB,GACCa,WAAAK,IAACC,UAAI,CACHC,OAAO,QACPC,YAAarB,GAAU,SAAWA,OAAQsB,EAC1C9B,YAAaQ,GAAU,SAAWA,OAAQsB,KACtC3C,IAGPG,EAAmBc,SAClBiB,WAAAA,IAACc,WAAAA,WAAU,IAAK7B,KAAeY,KAA4B5B,QAIrD,IAGlB,CACE8C,YAhImB,OAiInBC,MAAOC,UAAAA"}
1
+ {"version":3,"file":"Chip.js","sources":["../../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } 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((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 )}\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 )}\n <Styled.Content>\n <Text {...textBaseProps} {...textProps}>\n {children ?? text}\n </Text>\n {caption && (\n <Text {...captionBaseProps} {...captionProps}>\n {caption}\n </Text>\n )}\n </Styled.Content>\n {(indicatorProps.children || indicatorProps.text) && (\n <Indicator sizes={SIZES_CHIP_INDICATOR} marginRight={3} {...sizeProps} {...indicatorProps} />\n )}\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 )}\n {discardButtonProps.onClick && (\n <IconButton\n sizes={discardButtonProps.square ? SIZES_DISCARD_BUTTON_SQUARE : SIZES_DISCARD_BUTTON}\n {...sizeProps}\n {...discardButtonBaseProps}\n {...discardButtonProps}\n />\n )}\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":"obA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AAI,CACHC,OAAO,QACPC,YAAarB,GAAW,SAAWA,OAASsB,EAC5C7B,YAAaO,GAAW,SAAWA,OAASsB,EAC5CC,MAAOC,UAAWA,cACdzB,KACAnB,KAGNC,EAAY4C,KAAO5C,EAAYU,OAC/BsB,WAAAK,IAACQ,cAAM,CACLN,OAAO,QACPG,MAAO1C,EAAY8C,OAASC,UAAAA,yBAA2BC,UAAkBA,qBACrE9B,KACAlB,IAGRkC,WAAAC,KAACF,cAAc,CAAAxB,SAAA,CACbuB,WAAAK,IAACY,UAAI,IAAK1B,KAAmB1B,EAASY,SACnCA,GAAYC,IAEdC,GACCqB,WAAAK,IAACY,UAAI,IAAKrB,KAAsB9B,EAAYW,SACzCE,QAILV,EAAeQ,UAAYR,EAAeS,OAC1CsB,WAAAK,IAACa,oBAAS,CAACR,MAAOS,UAAqBA,qBAACC,YAAa,KAAOlC,KAAejB,IAE5EmB,GACCY,WAAAK,IAACC,UAAI,CACHC,OAAO,QACPC,YAAapB,GAAU,SAAWA,OAAQqB,EAC1C7B,YAAaQ,GAAU,SAAWA,OAAQqB,EAC1CC,MAAOC,UAAWA,cACdzB,KACAnB,IAGPG,EAAmBc,SAClBgB,WAAAA,IAACqB,WAAAA,WAAU,CACTX,MAAOxC,EAAmB4C,OAASQ,UAAAA,4BAA8BC,UAAqBA,wBAClFrC,KACAY,KACA5B,QAKA,IAGlB,CACEsD,YAlJmB,OAmJnBd,MAAOe,UAAAA"}
@@ -1,2 +1,2 @@
1
- import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{SIZES}from'./constants.mjs';import{Root,Content}from'./style.mjs';import{jsx,jsxs,Fragment}from'react/jsx-runtime';import{Icon}from'../Icon/Icon.mjs';import{Avatar}from'../Avatar/Avatar.mjs';import{Text}from'../Text/Text.mjs';import{Indicator}from'../Indicator/Indicator.mjs';import{IconButton}from'../IconButton/IconButton.mjs';const Chip=withMergedProps(forwardRef(((t,o)=>{const{size:r="m",textProps:e={},captionProps:s={},iconProps:i={},avatarProps:n={},indicatorProps:c={},discardButtonProps:a={},sizeXXS:p,sizeXS:d,sizeS:m,sizeM:x,sizeL:f,sizeXL:j,children:l,text:h,caption:z,icon:I,...y}=t;let u='div';let P;y.onClick&&(u='button'),a.onClick&&(u='div'),u==='button'&&(P='button'),y.type&&(P=y.type);const g={size:r,sizeXXS:p,sizeXS:d,sizeS:m,sizeM:x,sizeL:f,sizeXL:j};const[v,b]=Array.isArray(I)?I:[I];const S={as:'span',appearance:'body',size:'inherit',color:'inherit',lineHeight:z?1.3:1};const C={as:'span',appearance:'body',size:.75,sizeUnits:'em',color:'inherit',lineHeight:1};const X={icon:'close',square:!0,disabled:y.disabled};return jsx(Root,{...y,...g,as:u,type:P,ref:o,children:typeof l=='function'?l({textProps:S,captionProps:C,discardButtonProps:X}):jsxs(Fragment,{children:[v&&jsx(Icon,{preset:"brand",name:typeof v=='string'?v:void 0,icon:typeof v!='string'?v:void 0,...i}),(n.src||n.text)&&jsx(Avatar,{...g,preset:"brand",...n}),jsxs(Content,{children:[jsx(Text,{...S,...e,children:l??h}),z&&jsx(Text,{...C,...s,children:z})]}),(c.children||c.text)&&jsx(Indicator,{...g,...c}),b&&jsx(Icon,{preset:"brand",name:typeof b=='string'?b:void 0,icon:typeof b!='string'?b:void 0,...i}),a.onClick&&jsx(IconButton,{...g,...X,...a})]})})})),{displayName:'Chip',sizes:SIZES});export{Chip};
1
+ import{forwardRef}from'react';import{withMergedProps}from'../../hocs/withMergedProps.mjs';import{SIZES,SIZES_ICON,SIZES_CHIP_AVATAR_SQUARE,SIZES_CHIP_AVATAR,SIZES_CHIP_INDICATOR,SIZES_DISCARD_BUTTON_SQUARE,SIZES_DISCARD_BUTTON}from'./constants.mjs';import{Root,Content}from'./style.mjs';import{jsx,jsxs,Fragment}from'react/jsx-runtime';import{Icon}from'../Icon/Icon.mjs';import{Avatar}from'../Avatar/Avatar.mjs';import{Text}from'../Text/Text.mjs';import{Indicator}from'../Indicator/Indicator.mjs';import{IconButton}from'../IconButton/IconButton.mjs';const Chip=withMergedProps(forwardRef(((t,o)=>{const{size:s="m",primary:i=!0,textProps:r={},captionProps:e={},iconProps:n={},avatarProps:a={},indicatorProps:c={},discardButtonProps:p={},sizeXXS:I,sizeXS:S,sizeS:m,sizeM:d,sizeL:A,sizeXL:_,children:x,text:z,caption:C,icon:f,...j}=t;let l='div';let h;j.onClick&&(l='button'),p.onClick&&(l='div'),l==='button'&&(h='button'),j.type&&(h=j.type);const E={size:s,sizeXXS:I,sizeXS:S,sizeS:m,sizeM:d,sizeL:A,sizeXL:_};const[R,T]=Array.isArray(f)?f:[f];const P={as:'span',appearance:'body',size:'inherit',color:'inherit',lineHeight:C?1.3:1};const y={as:'span',appearance:'body',size:.75,sizeUnits:'em',color:'inherit',lineHeight:1};const Z={icon:'close',disabled:j.disabled};return jsx(Root,{...j,...E,as:l,type:h,primary:i,ref:o,children:typeof x=='function'?x({textProps:P,captionProps:y,discardButtonProps:Z}):jsxs(Fragment,{children:[R&&jsx(Icon,{preset:"brand",name:typeof R=='string'?R:void 0,icon:typeof R!='string'?R:void 0,sizes:SIZES_ICON,...E,...n}),(a.src||a.text)&&jsx(Avatar,{preset:"brand",sizes:a.square?SIZES_CHIP_AVATAR_SQUARE:SIZES_CHIP_AVATAR,...E,...a}),jsxs(Content,{children:[jsx(Text,{...P,...r,children:x??z}),C&&jsx(Text,{...y,...e,children:C})]}),(c.children||c.text)&&jsx(Indicator,{sizes:SIZES_CHIP_INDICATOR,marginRight:3,...E,...c}),T&&jsx(Icon,{preset:"brand",name:typeof T=='string'?T:void 0,icon:typeof T!='string'?T:void 0,sizes:SIZES_ICON,...E,...n}),p.onClick&&jsx(IconButton,{sizes:p.square?SIZES_DISCARD_BUTTON_SQUARE:SIZES_DISCARD_BUTTON,...E,...Z,...p})]})})})),{displayName:'Chip',sizes:SIZES});export{Chip};
2
2
  //# sourceMappingURL=Chip.mjs.map
@@ -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 { 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 { SIZES } from './constants'\nimport * as Styled from './style'\nimport type { ChipProps } from './types'\n\nconst COMPONENT_NAME = 'Chip'\n\n/**\n *\n * Component accepts all root HTML attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [ChipProps](https://github.com/foxford/ui/blob/master/src/components/Chip/types.ts)\n */\nconst Chip: React.ForwardRefExoticComponent<ChipProps> = withMergedProps<ChipProps>(\n forwardRef((props, ref) => {\n const {\n size = 'm',\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 square: true,\n disabled: restProps.disabled,\n }\n\n return (\n <Styled.Root {...restProps} {...sizeProps} as={rootNode} type={rootType} 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 {...iconProps}\n />\n )}\n {(avatarProps.src || avatarProps.text) && <Avatar {...sizeProps} preset='brand' {...avatarProps} />}\n <Styled.Content>\n <Text {...textBaseProps} {...textProps}>\n {children ?? text}\n </Text>\n {caption && (\n <Text {...captionBaseProps} {...captionProps}>\n {caption}\n </Text>\n )}\n </Styled.Content>\n {(indicatorProps.children || indicatorProps.text) && <Indicator {...sizeProps} {...indicatorProps} />}\n {after && (\n <Icon\n preset='brand'\n name={typeof after === 'string' ? after : undefined}\n icon={typeof after !== 'string' ? after : undefined}\n {...iconProps}\n />\n )}\n {discardButtonProps.onClick && (\n <IconButton {...sizeProps} {...discardButtonBaseProps} {...discardButtonProps} />\n )}\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","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","square","disabled","_jsx","Styled","_jsxs","_Fragment","Icon","preset","name","undefined","src","Avatar","Text","Indicator","IconButton","displayName","sizes","SIZES"],"mappings":"0aAyBMA,MAAAA,KAAmDC,gBACvDC,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,UACVA,EAA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AWoB,OAAO,WAAYtC,IACpFmC,KAACD,QAAc,CAAAzB,SAAA,CACbwB,IAACU,KAAI,IAAKpB,KAAmB1B,EAASY,SACnCA,GAAYC,IAEdC,GACCsB,IAACU,KAAI,IAAKf,KAAsB9B,EAAYW,SACzCE,QAILV,EAAeQ,UAAYR,EAAeS,OAASuB,IAACW,UAAS,IAAK1B,KAAejB,IAClFmB,GACCa,IAACI,KAAI,CACHC,OAAO,QACPC,YAAanB,GAAU,SAAWA,OAAQoB,EAC1C5B,YAAaQ,GAAU,SAAWA,OAAQoB,KACtCzC,IAGPG,EAAmBc,SAClBiB,IAACY,WAAU,IAAK3B,KAAeY,KAA4B5B,QAIrD,IAGlB,CACE4C,YAhImB,OAiInBC,MAAOC"}
1
+ {"version":3,"file":"Chip.mjs","sources":["../../../../src/components/Chip/Chip.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } 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((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 )}\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 )}\n <Styled.Content>\n <Text {...textBaseProps} {...textProps}>\n {children ?? text}\n </Text>\n {caption && (\n <Text {...captionBaseProps} {...captionProps}>\n {caption}\n </Text>\n )}\n </Styled.Content>\n {(indicatorProps.children || indicatorProps.text) && (\n <Indicator sizes={SIZES_CHIP_INDICATOR} marginRight={3} {...sizeProps} {...indicatorProps} />\n )}\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 )}\n {discardButtonProps.onClick && (\n <IconButton\n sizes={discardButtonProps.square ? SIZES_DISCARD_BUTTON_SQUARE : SIZES_DISCARD_BUTTON}\n {...sizeProps}\n {...discardButtonBaseProps}\n {...discardButtonProps}\n />\n )}\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":"siBAiCMA,MAAAA,KAAmDC,gBACvDC,YAAW,CAACC,EAAOC,KACjB,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,CAA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SAAA,CACbuB,IAACe,KAAI,IAAKxB,KAAmB1B,EAASY,SACnCA,GAAYC,IAEdC,GACCqB,IAACe,KAAI,IAAKnB,KAAsB9B,EAAYW,SACzCE,QAILV,EAAeQ,UAAYR,EAAeS,OAC1CsB,IAACgB,UAAS,CAACR,MAAOS,qBAAsBC,YAAa,KAAOhC,KAAejB,IAE5EmB,GACCY,IAACI,KAAI,CACHC,OAAO,QACPC,YAAalB,GAAU,SAAWA,OAAQmB,EAC1C3B,YAAaQ,GAAU,SAAWA,OAAQmB,EAC1CC,MAAOC,cACHvB,KACAnB,IAGPG,EAAmBc,SAClBgB,IAACmB,WAAU,CACTX,MAAOtC,EAAmB0C,OAASQ,4BAA8BC,wBAC7DnC,KACAY,KACA5B,QAKA,IAGlB,CACEoD,YAlJmB,OAmJnBd,MAAOe"}
@@ -1,2 +1,2 @@
1
- 'use strict';exports.SIZES={l:{fontSize:18,minHeight:40,padding:8,borderRadius:8},m:{fontSize:16,minHeight:36,padding:7,borderRadius:8},s:{fontSize:14,minHeight:32,padding:6,borderRadius:7},xs:{fontSize:12,minHeight:20,padding:4,borderRadius:6}};
1
+ 'use strict';var constants=require('../Indicator/constants.js');require('../Indicator/Indicator.js');var constants$1=require('../Avatar/constants.js');require('../Avatar/Avatar.js');var constants$2=require('../IconButton/constants.js');const SIZES_CHIP_INDICATOR={xxl:constants.SIZES_SQUARE.l,xl:constants.SIZES_SQUARE.l,l:constants.SIZES_SQUARE.m,m:constants.SIZES_SQUARE.m,s:constants.SIZES_SQUARE.s,xs:constants.SIZES_SQUARE.s};const SIZES_CHIP_AVATAR={xxl:constants$1.SIZES.xs,xl:constants$1.SIZES.xs,l:constants$1.SIZES.xxs,m:constants$1.SIZES.xxs,s:constants$1.SIZES.xxxs,xs:constants$1.SIZES.xxxs};const SIZES_CHIP_AVATAR_SQUARE={xxl:constants$1.SIZES_SQUARE.xs,xl:constants$1.SIZES_SQUARE.xs,l:constants$1.SIZES_SQUARE.xxs,m:constants$1.SIZES_SQUARE.xxs,s:constants$1.SIZES_SQUARE.xxxs,xs:constants$1.SIZES_SQUARE.xxxs};const SIZES_DISCARD_BUTTON={xxl:constants$2.SIZES.l,xl:constants$2.SIZES.l,l:constants$2.SIZES.m,m:constants$2.SIZES.m,s:constants$2.SIZES.s,xs:constants$2.SIZES.s};const SIZES_DISCARD_BUTTON_SQUARE={xxl:constants$2.SIZES_SQUARE.l,xl:constants$2.SIZES_SQUARE.l,l:constants$2.SIZES_SQUARE.m,m:constants$2.SIZES_SQUARE.m,s:constants$2.SIZES_SQUARE.s,xs:constants$2.SIZES_SQUARE.s};exports.SIZES={xxl:{fontSize:18,width:'max-content',minHeight:56,padding:'12px 14px',borderRadius:12},xl:{fontSize:18,width:'max-content',minHeight:48,padding:'8px 10px',borderRadius:10},l:{fontSize:16,width:'max-content',minHeight:40,padding:'6px 8px',borderRadius:8},m:{fontSize:16,width:'max-content',minHeight:36,padding:'4px 6px',borderRadius:8},s:{fontSize:14,width:'max-content',minHeight:32,padding:'4px 6px',borderRadius:7},xs:{fontSize:14,width:'max-content',minHeight:28,padding:'2px 4px',borderRadius:6}},exports.SIZES_CHIP_AVATAR=SIZES_CHIP_AVATAR,exports.SIZES_CHIP_AVATAR_SQUARE=SIZES_CHIP_AVATAR_SQUARE,exports.SIZES_CHIP_INDICATOR=SIZES_CHIP_INDICATOR,exports.SIZES_DISCARD_BUTTON=SIZES_DISCARD_BUTTON,exports.SIZES_DISCARD_BUTTON_SQUARE=SIZES_DISCARD_BUTTON_SQUARE,exports.SIZES_ICON={xxl:{fontSize:24},xl:{fontSize:24},l:{fontSize:20},m:{fontSize:20},s:{fontSize:16},xs:{fontSize:16}};
2
2
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../src/components/Chip/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { ChipSize } from './types'\n\nexport const SIZES: Record<ChipSize, CSSProperties> = {\n l: {\n fontSize: 18,\n minHeight: 40,\n padding: 8,\n borderRadius: 8,\n },\n m: {\n fontSize: 16,\n minHeight: 36,\n padding: 7,\n borderRadius: 8,\n },\n s: {\n fontSize: 14,\n minHeight: 32,\n padding: 6,\n borderRadius: 7,\n },\n xs: {\n fontSize: 12,\n minHeight: 20,\n padding: 4,\n borderRadius: 6,\n },\n}\n"],"names":["l","fontSize","minHeight","padding","borderRadius","m","s","xs"],"mappings":"2BAGsD,CACpDA,EAAG,CACDC,SAAU,GACVC,UAAW,GACXC,QAAS,EACTC,aAAc,GAEhBC,EAAG,CACDJ,SAAU,GACVC,UAAW,GACXC,QAAS,EACTC,aAAc,GAEhBE,EAAG,CACDL,SAAU,GACVC,UAAW,GACXC,QAAS,EACTC,aAAc,GAEhBG,GAAI,CACFN,SAAU,GACVC,UAAW,GACXC,QAAS,EACTC,aAAc"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/components/Chip/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport { SIZES_SQUARE as SIZES_INDICATOR } from 'components/Indicator'\nimport { SIZES as SIZES_AVATAR, SIZES_SQUARE as SIZES_AVATAR_SQUARE } from 'components/Avatar'\nimport { SIZES as SIZES_ICON_BUTTON, SIZES_SQUARE as SIZES_ICON_BUTTON_SQUARE } from 'components/IconButton'\nimport type { ChipSize } from './types'\n\nexport const SIZES: Record<ChipSize, CSSProperties> = {\n xxl: {\n fontSize: 18,\n width: 'max-content',\n minHeight: 56,\n padding: '12px 14px',\n borderRadius: 12,\n },\n xl: {\n fontSize: 18,\n width: 'max-content',\n minHeight: 48,\n padding: '8px 10px',\n borderRadius: 10,\n },\n l: {\n fontSize: 16,\n width: 'max-content',\n minHeight: 40,\n padding: '6px 8px',\n borderRadius: 8,\n },\n m: {\n fontSize: 16,\n width: 'max-content',\n minHeight: 36,\n padding: '4px 6px',\n borderRadius: 8,\n },\n s: {\n fontSize: 14,\n width: 'max-content',\n minHeight: 32,\n padding: '4px 6px',\n borderRadius: 7,\n },\n xs: {\n fontSize: 14,\n width: 'max-content',\n minHeight: 28,\n padding: '2px 4px',\n borderRadius: 6,\n },\n}\n\nexport const SIZES_ICON: Record<ChipSize, CSSProperties> = {\n xxl: { fontSize: 24 },\n xl: { fontSize: 24 },\n l: { fontSize: 20 },\n m: { fontSize: 20 },\n s: { fontSize: 16 },\n xs: { fontSize: 16 },\n}\n\nexport const SIZES_CHIP_INDICATOR: Record<ChipSize, CSSProperties> = {\n xxl: SIZES_INDICATOR.l,\n xl: SIZES_INDICATOR.l,\n l: SIZES_INDICATOR.m,\n m: SIZES_INDICATOR.m,\n s: SIZES_INDICATOR.s,\n xs: SIZES_INDICATOR.s,\n}\n\nexport const SIZES_CHIP_AVATAR: Record<ChipSize, CSSProperties> = {\n xxl: SIZES_AVATAR.xs,\n xl: SIZES_AVATAR.xs,\n l: SIZES_AVATAR.xxs,\n m: SIZES_AVATAR.xxs,\n s: SIZES_AVATAR.xxxs,\n xs: SIZES_AVATAR.xxxs,\n}\n\nexport const SIZES_CHIP_AVATAR_SQUARE: Record<ChipSize, CSSProperties> = {\n xxl: SIZES_AVATAR_SQUARE.xs,\n xl: SIZES_AVATAR_SQUARE.xs,\n l: SIZES_AVATAR_SQUARE.xxs,\n m: SIZES_AVATAR_SQUARE.xxs,\n s: SIZES_AVATAR_SQUARE.xxxs,\n xs: SIZES_AVATAR_SQUARE.xxxs,\n}\n\nexport const SIZES_DISCARD_BUTTON: Record<ChipSize, CSSProperties> = {\n xxl: SIZES_ICON_BUTTON.l,\n xl: SIZES_ICON_BUTTON.l,\n l: SIZES_ICON_BUTTON.m,\n m: SIZES_ICON_BUTTON.m,\n s: SIZES_ICON_BUTTON.s,\n xs: SIZES_ICON_BUTTON.s,\n}\n\nexport const SIZES_DISCARD_BUTTON_SQUARE: Record<ChipSize, CSSProperties> = {\n xxl: SIZES_ICON_BUTTON_SQUARE.l,\n xl: SIZES_ICON_BUTTON_SQUARE.l,\n l: SIZES_ICON_BUTTON_SQUARE.m,\n m: SIZES_ICON_BUTTON_SQUARE.m,\n s: SIZES_ICON_BUTTON_SQUARE.s,\n xs: SIZES_ICON_BUTTON_SQUARE.s,\n}\n"],"names":["SIZES_CHIP_INDICATOR","xxl","SIZES_INDICATOR","SIZES_SQUARE","l","xl","m","s","xs","SIZES_CHIP_AVATAR","SIZES_AVATAR","SIZES","xxs","xxxs","SIZES_CHIP_AVATAR_SQUARE","SIZES_AVATAR_SQUARE","SIZES_DISCARD_BUTTON","SIZES_ICON_BUTTON","SIZES_DISCARD_BUTTON_SQUARE","SIZES_ICON_BUTTON_SQUARE","fontSize","width","minHeight","padding","borderRadius"],"mappings":"4OA4DO,MAAMA,qBAAwD,CACnEC,IAAKC,UAAeC,aAACC,EACrBC,GAAIH,UAAeC,aAACC,EACpBA,EAAGF,UAAeC,aAACG,EACnBA,EAAGJ,UAAeC,aAACG,EACnBC,EAAGL,UAAeC,aAACI,EACnBC,GAAIN,UAAeC,aAACI,GAGf,MAAME,kBAAqD,CAChER,IAAKS,YAAYC,MAACH,GAClBH,GAAIK,YAAYC,MAACH,GACjBJ,EAAGM,YAAYC,MAACC,IAChBN,EAAGI,YAAYC,MAACC,IAChBL,EAAGG,YAAYC,MAACE,KAChBL,GAAIE,YAAYC,MAACE,MAGZ,MAAMC,yBAA4D,CACvEb,IAAKc,YAAmBZ,aAACK,GACzBH,GAAIU,YAAmBZ,aAACK,GACxBJ,EAAGW,YAAmBZ,aAACS,IACvBN,EAAGS,YAAmBZ,aAACS,IACvBL,EAAGQ,YAAmBZ,aAACU,KACvBL,GAAIO,YAAmBZ,aAACU,MAGnB,MAAMG,qBAAwD,CACnEf,IAAKgB,YAAiBN,MAACP,EACvBC,GAAIY,YAAiBN,MAACP,EACtBA,EAAGa,YAAiBN,MAACL,EACrBA,EAAGW,YAAiBN,MAACL,EACrBC,EAAGU,YAAiBN,MAACJ,EACrBC,GAAIS,YAAiBN,MAACJ,GAGjB,MAAMW,4BAA+D,CAC1EjB,IAAKkB,YAAwBhB,aAACC,EAC9BC,GAAIc,YAAwBhB,aAACC,EAC7BA,EAAGe,YAAwBhB,aAACG,EAC5BA,EAAGa,YAAwBhB,aAACG,EAC5BC,EAAGY,YAAwBhB,aAACI,EAC5BC,GAAIW,YAAwBhB,aAACI,iBAhGuB,CACpDN,IAAK,CACHmB,SAAU,GACVC,MAAO,cACPC,UAAW,GACXC,QAAS,YACTC,aAAc,IAEhBnB,GAAI,CACFe,SAAU,GACVC,MAAO,cACPC,UAAW,GACXC,QAAS,WACTC,aAAc,IAEhBpB,EAAG,CACDgB,SAAU,GACVC,MAAO,cACPC,UAAW,GACXC,QAAS,UACTC,aAAc,GAEhBlB,EAAG,CACDc,SAAU,GACVC,MAAO,cACPC,UAAW,GACXC,QAAS,UACTC,aAAc,GAEhBjB,EAAG,CACDa,SAAU,GACVC,MAAO,cACPC,UAAW,GACXC,QAAS,UACTC,aAAc,GAEhBhB,GAAI,CACFY,SAAU,GACVC,MAAO,cACPC,UAAW,GACXC,QAAS,UACTC,aAAc,iSAIyC,CACzDvB,IAAK,CAAEmB,SAAU,IACjBf,GAAI,CAAEe,SAAU,IAChBhB,EAAG,CAAEgB,SAAU,IACfd,EAAG,CAAEc,SAAU,IACfb,EAAG,CAAEa,SAAU,IACfZ,GAAI,CAAEY,SAAU"}
@@ -1,2 +1,2 @@
1
- const SIZES={l:{fontSize:18,minHeight:40,padding:8,borderRadius:8},m:{fontSize:16,minHeight:36,padding:7,borderRadius:8},s:{fontSize:14,minHeight:32,padding:6,borderRadius:7},xs:{fontSize:12,minHeight:20,padding:4,borderRadius:6}};export{SIZES};
1
+ import{SIZES_SQUARE}from'../Indicator/constants.mjs';import'../Indicator/Indicator.mjs';import{SIZES as SIZES$1,SIZES_SQUARE as SIZES_SQUARE$1}from'../Avatar/constants.mjs';import'../Avatar/Avatar.mjs';import{SIZES as SIZES$2,SIZES_SQUARE as SIZES_SQUARE$2}from'../IconButton/constants.mjs';const SIZES={xxl:{fontSize:18,width:'max-content',minHeight:56,padding:'12px 14px',borderRadius:12},xl:{fontSize:18,width:'max-content',minHeight:48,padding:'8px 10px',borderRadius:10},l:{fontSize:16,width:'max-content',minHeight:40,padding:'6px 8px',borderRadius:8},m:{fontSize:16,width:'max-content',minHeight:36,padding:'4px 6px',borderRadius:8},s:{fontSize:14,width:'max-content',minHeight:32,padding:'4px 6px',borderRadius:7},xs:{fontSize:14,width:'max-content',minHeight:28,padding:'2px 4px',borderRadius:6}};const SIZES_ICON={xxl:{fontSize:24},xl:{fontSize:24},l:{fontSize:20},m:{fontSize:20},s:{fontSize:16},xs:{fontSize:16}};const SIZES_CHIP_INDICATOR={xxl:SIZES_SQUARE.l,xl:SIZES_SQUARE.l,l:SIZES_SQUARE.m,m:SIZES_SQUARE.m,s:SIZES_SQUARE.s,xs:SIZES_SQUARE.s};const SIZES_CHIP_AVATAR={xxl:SIZES$1.xs,xl:SIZES$1.xs,l:SIZES$1.xxs,m:SIZES$1.xxs,s:SIZES$1.xxxs,xs:SIZES$1.xxxs};const SIZES_CHIP_AVATAR_SQUARE={xxl:SIZES_SQUARE$1.xs,xl:SIZES_SQUARE$1.xs,l:SIZES_SQUARE$1.xxs,m:SIZES_SQUARE$1.xxs,s:SIZES_SQUARE$1.xxxs,xs:SIZES_SQUARE$1.xxxs};const SIZES_DISCARD_BUTTON={xxl:SIZES$2.l,xl:SIZES$2.l,l:SIZES$2.m,m:SIZES$2.m,s:SIZES$2.s,xs:SIZES$2.s};const SIZES_DISCARD_BUTTON_SQUARE={xxl:SIZES_SQUARE$2.l,xl:SIZES_SQUARE$2.l,l:SIZES_SQUARE$2.m,m:SIZES_SQUARE$2.m,s:SIZES_SQUARE$2.s,xs:SIZES_SQUARE$2.s};export{SIZES,SIZES_CHIP_AVATAR,SIZES_CHIP_AVATAR_SQUARE,SIZES_CHIP_INDICATOR,SIZES_DISCARD_BUTTON,SIZES_DISCARD_BUTTON_SQUARE,SIZES_ICON};
2
2
  //# sourceMappingURL=constants.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.mjs","sources":["../../../../src/components/Chip/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport type { ChipSize } from './types'\n\nexport const SIZES: Record<ChipSize, CSSProperties> = {\n l: {\n fontSize: 18,\n minHeight: 40,\n padding: 8,\n borderRadius: 8,\n },\n m: {\n fontSize: 16,\n minHeight: 36,\n padding: 7,\n borderRadius: 8,\n },\n s: {\n fontSize: 14,\n minHeight: 32,\n padding: 6,\n borderRadius: 7,\n },\n xs: {\n fontSize: 12,\n minHeight: 20,\n padding: 4,\n borderRadius: 6,\n },\n}\n"],"names":["SIZES","l","fontSize","minHeight","padding","borderRadius","m","s","xs"],"mappings":"AAGO,MAAMA,MAAyC,CACpDC,EAAG,CACDC,SAAU,GACVC,UAAW,GACXC,QAAS,EACTC,aAAc,GAEhBC,EAAG,CACDJ,SAAU,GACVC,UAAW,GACXC,QAAS,EACTC,aAAc,GAEhBE,EAAG,CACDL,SAAU,GACVC,UAAW,GACXC,QAAS,EACTC,aAAc,GAEhBG,GAAI,CACFN,SAAU,GACVC,UAAW,GACXC,QAAS,EACTC,aAAc"}
1
+ {"version":3,"file":"constants.mjs","sources":["../../../../src/components/Chip/constants.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport { SIZES_SQUARE as SIZES_INDICATOR } from 'components/Indicator'\nimport { SIZES as SIZES_AVATAR, SIZES_SQUARE as SIZES_AVATAR_SQUARE } from 'components/Avatar'\nimport { SIZES as SIZES_ICON_BUTTON, SIZES_SQUARE as SIZES_ICON_BUTTON_SQUARE } from 'components/IconButton'\nimport type { ChipSize } from './types'\n\nexport const SIZES: Record<ChipSize, CSSProperties> = {\n xxl: {\n fontSize: 18,\n width: 'max-content',\n minHeight: 56,\n padding: '12px 14px',\n borderRadius: 12,\n },\n xl: {\n fontSize: 18,\n width: 'max-content',\n minHeight: 48,\n padding: '8px 10px',\n borderRadius: 10,\n },\n l: {\n fontSize: 16,\n width: 'max-content',\n minHeight: 40,\n padding: '6px 8px',\n borderRadius: 8,\n },\n m: {\n fontSize: 16,\n width: 'max-content',\n minHeight: 36,\n padding: '4px 6px',\n borderRadius: 8,\n },\n s: {\n fontSize: 14,\n width: 'max-content',\n minHeight: 32,\n padding: '4px 6px',\n borderRadius: 7,\n },\n xs: {\n fontSize: 14,\n width: 'max-content',\n minHeight: 28,\n padding: '2px 4px',\n borderRadius: 6,\n },\n}\n\nexport const SIZES_ICON: Record<ChipSize, CSSProperties> = {\n xxl: { fontSize: 24 },\n xl: { fontSize: 24 },\n l: { fontSize: 20 },\n m: { fontSize: 20 },\n s: { fontSize: 16 },\n xs: { fontSize: 16 },\n}\n\nexport const SIZES_CHIP_INDICATOR: Record<ChipSize, CSSProperties> = {\n xxl: SIZES_INDICATOR.l,\n xl: SIZES_INDICATOR.l,\n l: SIZES_INDICATOR.m,\n m: SIZES_INDICATOR.m,\n s: SIZES_INDICATOR.s,\n xs: SIZES_INDICATOR.s,\n}\n\nexport const SIZES_CHIP_AVATAR: Record<ChipSize, CSSProperties> = {\n xxl: SIZES_AVATAR.xs,\n xl: SIZES_AVATAR.xs,\n l: SIZES_AVATAR.xxs,\n m: SIZES_AVATAR.xxs,\n s: SIZES_AVATAR.xxxs,\n xs: SIZES_AVATAR.xxxs,\n}\n\nexport const SIZES_CHIP_AVATAR_SQUARE: Record<ChipSize, CSSProperties> = {\n xxl: SIZES_AVATAR_SQUARE.xs,\n xl: SIZES_AVATAR_SQUARE.xs,\n l: SIZES_AVATAR_SQUARE.xxs,\n m: SIZES_AVATAR_SQUARE.xxs,\n s: SIZES_AVATAR_SQUARE.xxxs,\n xs: SIZES_AVATAR_SQUARE.xxxs,\n}\n\nexport const SIZES_DISCARD_BUTTON: Record<ChipSize, CSSProperties> = {\n xxl: SIZES_ICON_BUTTON.l,\n xl: SIZES_ICON_BUTTON.l,\n l: SIZES_ICON_BUTTON.m,\n m: SIZES_ICON_BUTTON.m,\n s: SIZES_ICON_BUTTON.s,\n xs: SIZES_ICON_BUTTON.s,\n}\n\nexport const SIZES_DISCARD_BUTTON_SQUARE: Record<ChipSize, CSSProperties> = {\n xxl: SIZES_ICON_BUTTON_SQUARE.l,\n xl: SIZES_ICON_BUTTON_SQUARE.l,\n l: SIZES_ICON_BUTTON_SQUARE.m,\n m: SIZES_ICON_BUTTON_SQUARE.m,\n s: SIZES_ICON_BUTTON_SQUARE.s,\n xs: SIZES_ICON_BUTTON_SQUARE.s,\n}\n"],"names":["SIZES","xxl","fontSize","width","minHeight","padding","borderRadius","xl","l","m","s","xs","SIZES_ICON","SIZES_CHIP_INDICATOR","SIZES_INDICATOR","SIZES_CHIP_AVATAR","SIZES_AVATAR","xxs","xxxs","SIZES_CHIP_AVATAR_SQUARE","SIZES_AVATAR_SQUARE","SIZES_DISCARD_BUTTON","SIZES_ICON_BUTTON","SIZES_DISCARD_BUTTON_SQUARE","SIZES_ICON_BUTTON_SQUARE"],"mappings":"mSAMO,MAAMA,MAAyC,CACpDC,IAAK,CACHC,SAAU,GACVC,MAAO,cACPC,UAAW,GACXC,QAAS,YACTC,aAAc,IAEhBC,GAAI,CACFL,SAAU,GACVC,MAAO,cACPC,UAAW,GACXC,QAAS,WACTC,aAAc,IAEhBE,EAAG,CACDN,SAAU,GACVC,MAAO,cACPC,UAAW,GACXC,QAAS,UACTC,aAAc,GAEhBG,EAAG,CACDP,SAAU,GACVC,MAAO,cACPC,UAAW,GACXC,QAAS,UACTC,aAAc,GAEhBI,EAAG,CACDR,SAAU,GACVC,MAAO,cACPC,UAAW,GACXC,QAAS,UACTC,aAAc,GAEhBK,GAAI,CACFT,SAAU,GACVC,MAAO,cACPC,UAAW,GACXC,QAAS,UACTC,aAAc,IAIX,MAAMM,WAA8C,CACzDX,IAAK,CAAEC,SAAU,IACjBK,GAAI,CAAEL,SAAU,IAChBM,EAAG,CAAEN,SAAU,IACfO,EAAG,CAAEP,SAAU,IACfQ,EAAG,CAAER,SAAU,IACfS,GAAI,CAAET,SAAU,KAGX,MAAMW,qBAAwD,CACnEZ,IA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