@foxford/ui 2.0.0-beta-7590978-20220708 → 2.0.0-beta-1c48b33-20220712

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- import e from'@babel/runtime/helpers/objectSpread2';import a from'@babel/runtime/helpers/objectWithoutProperties';import{Link as r}from'react-router-dom';import{useClassname as t}from'../../hooks/useClassname.js';import{Root as s,Content as o}from'./style.js';import{PROPS_BY_SIZE as i,PRESETS as n}from'./default.js';import{jsxs as l,jsx as m}from'react/jsx-runtime';var d=["children","className","disabled","href","to","as","target","onClick","ref","icon","type","innerRef"];function c(p){var{children:f,className:u,disabled:y,href:b,to:h,as:v,target:j,onClick:N,ref:C,icon:g,type:k,innerRef:x}=p,P=a(p,d);var R=v||(y?'button':b?'a':h?r:'button');var S='a'!==R||y?{}:{href:b||h,target:j};var _='string'==typeof R||y?{}:{to:h||b};var z=P.size&&!P.round&&i[P.size]||{};var B=(e=>e.primary?n.primary:e.secondary?n.secondary:n.default)(p);var E=t(c.displayName,u);var w=t(c.displayName);return l(s,e(e(e(e(e(e({as:R,className:E,type:'button'===R?k:void 0,onClick:y||P.loading?void 0:N},z),S),_),B),P),{},{disabled:y,ref:C||x,children:[g&&m("span",{className:"icon",children:g}),f&&m(o,{className:"".concat(w,"__content"),children:f})]}))}c.defaultProps={size:'m',rounded:!0,display:'inline-flex',type:'button',width:'auto'},c.displayName='Button';export{c as Button};
1
+ import e from'@babel/runtime/helpers/objectSpread2';import a from'@babel/runtime/helpers/objectWithoutProperties';import{Link as r}from'react-router-dom';import{useClassname as t}from'../../hooks/useClassname.js';import{Root as o,Content as s}from'./style.js';import{PROPS_BY_SIZE as n,PRESETS as i}from'./default.js';import{jsxs as l,jsx as m}from'react/jsx-runtime';var d=["children","className","disabled","href","to","as","target","content","onClick","ref","icon","type","innerRef"];function c(p){var{children:f,className:u,disabled:y,href:b,to:h,as:v,target:j,content:N,onClick:C,ref:g,icon:k,type:x,innerRef:P}=p,R=a(p,d);var S=v||(y?'button':b?'a':h?r:'button');var _='a'!==S||y?{}:{href:b||h,target:j};var z='string'==typeof S||y?{}:{to:h||b};var B=R.size&&!R.round&&n[R.size]||{};var E=(e=>e.primary?i.primary:e.secondary?i.secondary:i.default)(p);var w=t(c.displayName,u);var I=t(c.displayName);return l(o,e(e(e(e(e(e({as:S,className:w,type:'button'===S?x:void 0,onClick:y||R.loading?void 0:C},B),_),z),E),R),{},{disabled:y,ref:g||P,children:[k&&m("span",{className:"icon",children:k}),(N||f)&&m(s,{className:"".concat(I,"__content"),children:N||f})]}))}c.defaultProps={size:'m',rounded:!0,display:'inline-flex',type:'button',width:'auto'},c.displayName='Button';export{c as Button};
2
2
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import { Link } from 'react-router-dom'\nimport { useClassname } from 'hooks/useClassname'\nimport { Display } from '../../mixins/display'\nimport { ResponsiveNamedProperty } from '../../mixins/responsive-property'\nimport { BaseProps, Tooltiped } from '../../shared/interfaces'\nimport { Color } from '../../mixins/color'\nimport { Anchor } from '../../components/Anchor'\nimport * as Styled from './style'\nimport { PRESETS, PROPS_BY_SIZE } from './default'\n\nexport interface ButtonProps\n extends BaseProps,\n Tooltiped,\n Display,\n Color,\n Color<'fontColor'>,\n ResponsiveNamedProperty<'padding'>,\n ResponsiveNamedProperty<'paddingTop'>,\n ResponsiveNamedProperty<'paddingRight'>,\n ResponsiveNamedProperty<'paddingBottom'>,\n ResponsiveNamedProperty<'paddingLeft'>,\n ResponsiveNamedProperty<'margin'>,\n ResponsiveNamedProperty<'marginTop'>,\n ResponsiveNamedProperty<'marginRight'>,\n ResponsiveNamedProperty<'marginBottom'>,\n ResponsiveNamedProperty<'marginLeft'>,\n ResponsiveNamedProperty<'fontSize'>,\n ResponsiveNamedProperty<'fluid', boolean>,\n ResponsiveNamedProperty<'width', 'auto' | 'l' | 'm' | 's' | 'xs' | number>,\n ResponsiveNamedProperty<'height', 'l' | 'm' | 's' | 'xs' | number> {\n /**\n * Node type\n */\n as?: 'div' | 'span' | 'a' | 'button' | typeof Link | typeof Anchor\n target?: string\n rel?: string\n /**\n * Link href\n */\n href?: string\n /**\n * React router link to\n */\n to?: string\n /**\n * Type for button element\n */\n type?: 'button' | 'submit' | 'reset'\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Basic button\n */\n basic?: boolean\n /**\n * Disabled\n */\n disabled?: boolean\n /**\n * Is primary\n */\n primary?: boolean\n /**\n * Is secondary\n */\n secondary?: boolean\n /**\n * Is inverted\n */\n inverted?: boolean\n /**\n * Is rounded\n */\n rounded?: boolean\n /**\n * Is round (in a shape of circle)\n */\n round?: boolean\n /**\n * Indicates if there should not be any margin\n * between this button and the previous one\n */\n noSpacing?: boolean\n /**\n * Is in loading state\n */\n loading?: boolean\n /**\n * Button icon\n */\n icon?: React.ReactNode\n /** On click callback */\n onClick?: () => void\n /** Function to make ref */\n ref?: React.LegacyRef<HTMLDivElement>\n /**\n * Size\n */\n size?: keyof typeof PROPS_BY_SIZE\n}\n\nButton.defaultProps = {\n size: 'm',\n rounded: true,\n display: 'inline-flex',\n type: 'button',\n width: 'auto',\n}\n\nButton.displayName = 'Button'\n\nconst extractPresetByProps = (props: ButtonProps): Partial<ButtonProps> => {\n if (props.primary) return PRESETS.primary\n if (props.secondary) return PRESETS.secondary\n return PRESETS.default\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Display`](#/Миксины)\n * - [`Tooltiped`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`Color<'fontColor'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'padding'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'paddingTop'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'paddingRight'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'paddingBottom'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'paddingLeft'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'margin'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'marginTop'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'marginRight'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'marginBottom'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'marginLeft'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'fontSize'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'fluid', boolean>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'width', 'auto' | 'l' | 'm' | 's' | 'xs' | number>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'height', 'l' | 'm' | 's' | 'xs' | number>`](#/Миксины)\n */\nexport function Button(props: ButtonProps) {\n const { children, className, disabled, href, to, as, target, onClick, ref, icon, type, innerRef, ...restProps } =\n props\n\n const _as = as || (disabled ? 'button' : href ? 'a' : to ? Link : 'button')\n const aProps = _as === 'a' && !disabled ? { href: href || to, target } : {}\n const linkProps = typeof _as !== 'string' && !disabled ? { to: to || href } : {}\n const propsBySize: Partial<ButtonProps> =\n restProps.size && !restProps.round ? PROPS_BY_SIZE[restProps.size] || {} : {}\n const presetProps: Partial<ButtonProps> = extractPresetByProps(props)\n const _className = useClassname(Button.displayName, className)\n const _contentClassName = useClassname(Button.displayName)\n\n return (\n <Styled.Root\n as={_as}\n className={_className}\n type={_as === 'button' ? type : undefined}\n onClick={disabled || restProps.loading ? undefined : onClick}\n {...propsBySize}\n {...aProps}\n {...linkProps}\n {...presetProps}\n {...restProps}\n disabled={disabled}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={(ref || innerRef) as any}\n >\n {icon && <span className='icon'>{icon}</span>}\n {children && <Styled.Content className={`${_contentClassName}__content`}>{children}</Styled.Content>}\n </Styled.Root>\n )\n}\n"],"names":["Button","props","children","className","disabled","href","to","as","target","onClick","ref","icon","type","innerRef","restProps","_excluded","_as","Link","aProps","linkProps","propsBySize","size","round","PROPS_BY_SIZE","presetProps","primary","PRESETS","secondary","default","_className","useClassname","displayName","_contentClassName","_jsxs","Styled.Root","_objectSpread","loading","_jsx","Styled.Content","concat","defaultProps","rounded","display","width"],"mappings":"6dA6IO,SAASA,EAAOC,GACrB,IAAMC,SAAEA,EAAFC,UAAYA,EAAZC,SAAuBA,EAAvBC,KAAiCA,EAAjCC,GAAuCA,EAAvCC,GAA2CA,EAA3CC,OAA+CA,EAA/CC,QAAuDA,EAAvDC,IAAgEA,EAAhEC,KAAqEA,EAArEC,KAA2EA,EAA3EC,SAAiFA,GACrFZ,EADkGa,IAClGb,EADFc,GAGA,IAAMC,EAAMT,IAAOH,EAAW,SAAWC,EAAO,IAAMC,EAAKW,EAAO,UAClE,IAAMC,EAAiB,MAARF,GAAgBZ,EAA0C,GAA/B,CAAEC,KAAMA,GAAQC,EAAIE,OAAAA,GAC9D,IAAMW,EAA2B,iBAARH,GAAqBZ,EAAgC,GAArB,CAAEE,GAAIA,GAAMD,GACrE,IAAMe,EACJN,EAAUO,OAASP,EAAUQ,OAAQC,EAAcT,EAAUO,OAAc,GAC7E,IAAMG,EArCsBvB,CAAAA,GACxBA,EAAMwB,QAAgBC,EAAQD,QAC9BxB,EAAM0B,UAAkBD,EAAQC,UAC7BD,EAAQE,QAHa3B,CAqCmCA,GAC/D,IAAM4B,EAAaC,EAAa9B,EAAO+B,YAAa5B,GACpD,IAAM6B,EAAoBF,EAAa9B,EAAO+B,aAE9C,OACEE,EAACC,EAADC,EAAAA,EAAAA,EAAAA,EAAAA,EAAAA,EAAA,CACE5B,GAAIS,EACJb,UAAW0B,EACXjB,KAAc,WAARI,EAAmBJ,OAAAA,EACzBH,QAASL,GAAYU,EAAUsB,eAAsB3B,GACjDW,GACAF,GACAC,GACAK,GACAV,GATN,GAAA,CAUEV,SAAUA,EAEVM,IAAMA,GAAOG,EAZfX,SAAA,CAcGS,GAAQ0B,EAAA,OAAA,CAAMlC,UAAU,OAAhBD,SAAwBS,IAChCT,GAAYmC,EAACC,EAAD,CAAgBnC,UAAS,GAAAoC,OAAKP,EAA9B,aAAA9B,SAA6DA,QAnEhFF,EAAOwC,aAAe,CACpBnB,KAAM,IACNoB,SAAAA,EACAC,QAAS,cACT9B,KAAM,SACN+B,MAAO,QAGT3C,EAAO+B,YAAc"}
1
+ {"version":3,"file":"Button.js","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["import { Link } from 'react-router-dom'\nimport { useClassname } from 'hooks/useClassname'\nimport { Display } from '../../mixins/display'\nimport { ResponsiveNamedProperty } from '../../mixins/responsive-property'\nimport { BaseProps, Tooltiped } from '../../shared/interfaces'\nimport { Color } from '../../mixins/color'\nimport { Anchor } from '../../components/Anchor'\nimport * as Styled from './style'\nimport { PRESETS, PROPS_BY_SIZE } from './default'\n\nexport interface ButtonProps\n extends BaseProps,\n Tooltiped,\n Display,\n Color,\n Color<'fontColor'>,\n ResponsiveNamedProperty<'padding'>,\n ResponsiveNamedProperty<'paddingTop'>,\n ResponsiveNamedProperty<'paddingRight'>,\n ResponsiveNamedProperty<'paddingBottom'>,\n ResponsiveNamedProperty<'paddingLeft'>,\n ResponsiveNamedProperty<'margin'>,\n ResponsiveNamedProperty<'marginTop'>,\n ResponsiveNamedProperty<'marginRight'>,\n ResponsiveNamedProperty<'marginBottom'>,\n ResponsiveNamedProperty<'marginLeft'>,\n ResponsiveNamedProperty<'fontSize'>,\n ResponsiveNamedProperty<'fluid', boolean>,\n ResponsiveNamedProperty<'width', 'auto' | 'l' | 'm' | 's' | 'xs' | number>,\n ResponsiveNamedProperty<'height', 'l' | 'm' | 's' | 'xs' | number> {\n /**\n * Node type\n */\n as?: 'div' | 'span' | 'a' | 'button' | typeof Link | typeof Anchor\n target?: string\n rel?: string\n /**\n * Link href\n */\n href?: string\n /**\n * React router link to\n */\n to?: string\n /**\n * Type for button element\n */\n type?: 'button' | 'submit' | 'reset'\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * Basic button\n */\n basic?: boolean\n /**\n * Disabled\n */\n disabled?: boolean\n /**\n * Is primary\n */\n primary?: boolean\n /**\n * Is secondary\n */\n secondary?: boolean\n /**\n * Is inverted\n */\n inverted?: boolean\n /**\n * Is rounded\n */\n rounded?: boolean\n /**\n * Is round (in a shape of circle)\n */\n round?: boolean\n /**\n * Indicates if there should not be any margin\n * between this button and the previous one\n */\n noSpacing?: boolean\n /**\n * Is in loading state\n */\n loading?: boolean\n /**\n * Button icon\n */\n icon?: React.ReactNode\n /** On click callback */\n onClick?: () => void\n /** Function to make ref */\n ref?: React.LegacyRef<HTMLDivElement>\n /**\n * Size\n */\n size?: keyof typeof PROPS_BY_SIZE\n /**\n * Content of button\n * @deprecated Use children property\n */\n content?: React.ReactNode\n}\n\nButton.defaultProps = {\n size: 'm',\n rounded: true,\n display: 'inline-flex',\n type: 'button',\n width: 'auto',\n}\n\nButton.displayName = 'Button'\n\nconst extractPresetByProps = (props: ButtonProps): Partial<ButtonProps> => {\n if (props.primary) return PRESETS.primary\n if (props.secondary) return PRESETS.secondary\n return PRESETS.default\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Display`](#/Миксины)\n * - [`Tooltiped`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`Color<'fontColor'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'padding'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'paddingTop'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'paddingRight'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'paddingBottom'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'paddingLeft'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'margin'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'marginTop'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'marginRight'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'marginBottom'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'marginLeft'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'fontSize'>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'fluid', boolean>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'width', 'auto' | 'l' | 'm' | 's' | 'xs' | number>`](#/Миксины)\n * - [`ResponsiveNamedProperty<'height', 'l' | 'm' | 's' | 'xs' | number>`](#/Миксины)\n */\nexport function Button(props: ButtonProps) {\n const {\n children,\n className,\n disabled,\n href,\n to,\n as,\n target,\n content,\n onClick,\n ref,\n icon,\n type,\n innerRef,\n ...restProps\n } = props\n\n const _as = as || (disabled ? 'button' : href ? 'a' : to ? Link : 'button')\n const aProps = _as === 'a' && !disabled ? { href: href || to, target } : {}\n const linkProps = typeof _as !== 'string' && !disabled ? { to: to || href } : {}\n const propsBySize: Partial<ButtonProps> =\n restProps.size && !restProps.round ? PROPS_BY_SIZE[restProps.size] || {} : {}\n const presetProps: Partial<ButtonProps> = extractPresetByProps(props)\n const _className = useClassname(Button.displayName, className)\n const _contentClassName = useClassname(Button.displayName)\n\n return (\n <Styled.Root\n as={_as}\n className={_className}\n type={_as === 'button' ? type : undefined}\n onClick={disabled || restProps.loading ? undefined : onClick}\n {...propsBySize}\n {...aProps}\n {...linkProps}\n {...presetProps}\n {...restProps}\n disabled={disabled}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={(ref || innerRef) as any}\n >\n {icon && <span className='icon'>{icon}</span>}\n {(content || children) && (\n <Styled.Content className={`${_contentClassName}__content`}>{content || children}</Styled.Content>\n )}\n </Styled.Root>\n )\n}\n"],"names":["Button","props","children","className","disabled","href","to","as","target","content","onClick","ref","icon","type","innerRef","restProps","_excluded","_as","Link","aProps","linkProps","propsBySize","size","round","PROPS_BY_SIZE","presetProps","primary","PRESETS","secondary","default","_className","useClassname","displayName","_contentClassName","_jsxs","Styled.Root","_objectSpread","undefined","loading","_jsx","Styled.Content","concat","defaultProps","rounded","display","width"],"mappings":"ueAkJO,SAASA,EAAOC,GACrB,IAAMC,SACJA,EADIC,UAEJA,EAFIC,SAGJA,EAHIC,KAIJA,EAJIC,GAKJA,EALIC,GAMJA,EANIC,OAOJA,EAPIC,QAQJA,EARIC,QASJA,EATIC,IAUJA,EAVIC,KAWJA,EAXIC,KAYJA,EAZIC,SAaJA,GAEEb,EADCc,IACDd,EAfJe,GAiBA,IAAMC,EAAMV,IAAOH,EAAW,SAAWC,EAAO,IAAMC,EAAKY,EAAO,UAClE,IAAMC,EAAiB,MAARF,GAAgBb,EAA0C,GAA/B,CAAEC,KAAMA,GAAQC,EAAIE,OAAAA,GAC9D,IAAMY,EAA2B,iBAARH,GAAqBb,EAAgC,GAArB,CAAEE,GAAIA,GAAMD,GACrE,IAAMgB,EACJN,EAAUO,OAASP,EAAUQ,OAAQC,EAAcT,EAAUO,OAAc,GAC7E,IAAMG,EAnDsBxB,CAAAA,GACxBA,EAAMyB,QAAgBC,EAAQD,QAC9BzB,EAAM2B,UAAkBD,EAAQC,UAC7BD,EAAQE,QAHa5B,CAmDmCA,GAC/D,IAAM6B,EAAaC,EAAa/B,EAAOgC,YAAa7B,GACpD,IAAM8B,EAAoBF,EAAa/B,EAAOgC,aAE9C,OACEE,EAACC,EAADC,EAAAA,EAAAA,EAAAA,EAAAA,EAAAA,EAAA,CACE7B,GAAIU,EACJd,UAAW2B,EACXjB,KAAc,WAARI,EAAmBJ,OAAOwB,EAChC3B,QAASN,GAAYW,EAAUuB,aAAAA,EAAsB5B,GACjDW,GACAF,GACAC,GACAK,GACAV,GATN,GAAA,CAUEX,SAAUA,EAEVO,IAAMA,GAAOG,EAZfZ,SAAA,CAcGU,GAAQ2B,EAAA,OAAA,CAAMpC,UAAU,OAAhBD,SAAwBU,KAC/BH,GAAWP,IACXqC,EAACC,EAAD,CAAgBrC,UAAS,GAAAsC,OAAKR,EAA9B,aAAA/B,SAA6DO,GAAWP,QAlFhFF,EAAO0C,aAAe,CACpBpB,KAAM,IACNqB,SAAAA,EACAC,QAAS,cACT/B,KAAM,SACNgC,MAAO,QAGT7C,EAAOgC,YAAc"}
@@ -1,2 +1,2 @@
1
- import i from'@babel/runtime/helpers/taggedTemplateLiteral';import l,{css as n}from'styled-components';import{screenMaxS as e}from'../../mixins/screen.js';import{responsiveProperty as r}from'../../mixins/responsive-property.js';import{display as o}from'../../mixins/display.js';var t;var a=function(i){var l=arguments.length>0&&void 0!==i?i:14;return n(["font-size:","px;svg{width:","px;height:","px;}"],l,l,l)};var s=n(["cursor:not-allowed;color:#d4d4d4;svg{circle:nth-child(1){stroke:#d4d4d4;}circle:nth-child(2){fill:#d4d4d4;}}span.label{cursor:not-allowed;}"]);var d=n(["svg{circle{fill:#ffeef0;stroke:#ffa3a3;}circle:nth-child(2){fill:#ffa3a3;}}"]);var p=l.label.withConfig({shouldForwardProp:i=>!['size','error','fluid','width','display'].includes(i)}).withConfig({componentId:"fox-ui__sc-1u0nc40-0"})(["align-items:baseline;user-select:none;cursor:pointer;width:auto;svg{position:relative;top:2px;flex-shrink:0;circle:nth-child(2){opacity:0;transition:all 0.2s ease;}}& + &{margin-left:15px;}input{display:none;appearance:none;&:checked + svg{circle:nth-child(2){opacity:1;transform:scale(1);}}}span.label{margin-left:10px;cursor:pointer;}"," "," "," "," "," "," "," ",""],(i=>'small'===i.size?a(14):null),(i=>'medium'===i.size?a(16):null),(i=>'large'===i.size?a(18):null),(i=>i.disabled?s:null),(i=>i.error?d:null),(i=>i.display?o(i.display):null),(i=>r('width',i.fluid&&'auto'!==i.width?'max-width':'width')),(i=>i.fluid?n(["width:100%;"]):null));var c=l.div.withConfig({shouldForwardProp:i=>'inline'!==i}).withConfig({componentId:"fox-ui__sc-1u0nc40-1"})(["display:flex;flex-direction:column;line-height:normal;> ","{margin-left:0;&:not(:first-child){margin-top:15px;}}",""],p,(l=>l.inline?n(["flex-direction:row;&&& > ","{margin-top:0;}> "," + ","{margin-left:15px;}",""],p,p,p,e()(t||(t=i(["\n flex-direction: column;\n > &{Root} {\n margin-top: 0;\n }\n > "," + "," {\n margin-left: 0;\n margin-top: 15px;\n }\n "])),p,p)):null));export{c as Group,p as Root};
1
+ import i from'@babel/runtime/helpers/taggedTemplateLiteral';import l,{css as e}from'styled-components';import{screenMaxS as n}from'../../mixins/screen.js';import{responsiveProperty as r}from'../../mixins/responsive-property.js';import{display as o}from'../../mixins/display.js';var t;var a=function(i){var l=arguments.length>0&&void 0!==i?i:14;return e(["font-size:","px;svg{width:","px;height:","px;}"],l,l,l)};var s=e(["cursor:not-allowed;color:#d4d4d4;svg{circle:nth-child(1){stroke:#d4d4d4;}circle:nth-child(2){fill:#d4d4d4;}}span.label{cursor:not-allowed;}"]);var d=e(["svg{circle{fill:#ffeef0;stroke:#ffa3a3;}circle:nth-child(2){fill:#ffa3a3;}}"]);var c=l.label.withConfig({shouldForwardProp:i=>!['size','error','fluid','width','display'].includes(i)}).withConfig({componentId:"fox-ui__sc-1u0nc40-0"})(["align-items:baseline;user-select:none;cursor:pointer;width:auto;svg{position:relative;top:2px;flex-shrink:0;circle:nth-child(2){opacity:0;transition:all 0.2s ease;}}& + &{margin-left:15px;}input{display:none;appearance:none;&:checked + svg{circle:nth-child(2){opacity:1;transform:scale(1);}","}}span.label{margin-left:10px;cursor:pointer;}"," "," "," "," "," "," "," ",""],(i=>i.error?null:e(["circle:not(:disabled){stroke:#48a1e6;}circle:not(:disabled):last-child{fill:#48a1e6;}"])),(i=>'small'===i.size?a(14):null),(i=>'medium'===i.size?a(16):null),(i=>'large'===i.size?a(18):null),(i=>i.disabled?s:null),(i=>i.error?d:null),(i=>i.display?o(i.display):null),(i=>r('width',i.fluid&&'auto'!==i.width?'max-width':'width')),(i=>i.fluid?e(["width:100%;"]):null));var p=l.div.withConfig({shouldForwardProp:i=>'inline'!==i}).withConfig({componentId:"fox-ui__sc-1u0nc40-1"})(["display:flex;flex-direction:column;line-height:normal;> ","{margin-left:0;&:not(:first-child){margin-top:15px;}}",""],c,(l=>l.inline?e(["flex-direction:row;&&& > ","{margin-top:0;}> "," + ","{margin-left:15px;}",""],c,c,c,n()(t||(t=i(["\n flex-direction: column;\n > &{Root} {\n margin-top: 0;\n }\n > "," + "," {\n margin-left: 0;\n margin-top: 15px;\n }\n "])),c,c)):null));export{p as Group,c as Root};
2
2
  //# sourceMappingURL=style.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","sources":["../../../../src/components/Radio/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { screenMaxS } from 'mixins/screen'\nimport { responsiveProperty } from '../../mixins/responsive-property'\nimport { display } from '../../mixins/display'\nimport { RadioGroupProps } from './Group'\nimport { RadioProps } from './Radio'\n\nconst sizeRadio = (size = 14) => css`\n font-size: ${size}px;\n svg {\n width: ${size}px;\n height: ${size}px;\n }\n`\n\nconst disabled = css`\n cursor: not-allowed;\n color: #d4d4d4;\n svg {\n circle:nth-child(1) {\n stroke: #d4d4d4;\n }\n circle:nth-child(2) {\n fill: #d4d4d4;\n }\n }\n span.label {\n cursor: not-allowed;\n }\n`\n\nconst error = css`\n svg {\n circle {\n fill: #ffeef0;\n stroke: #ffa3a3;\n }\n circle:nth-child(2) {\n fill: #ffa3a3;\n }\n }\n`\n\nexport const Root = styled.label.withConfig<RadioProps>({\n shouldForwardProp: (prop) => !['size', 'error', 'fluid', 'width', 'display'].includes(prop),\n})`\n align-items: baseline;\n user-select: none;\n cursor: pointer;\n width: auto;\n svg {\n position: relative;\n top: 2px;\n flex-shrink: 0;\n circle:nth-child(2) {\n opacity: 0;\n transition: all 0.2s ease;\n }\n }\n & + & {\n margin-left: 15px;\n }\n input {\n display: none;\n appearance: none;\n &:checked + svg {\n circle:nth-child(2) {\n opacity: 1;\n transform: scale(1);\n }\n }\n }\n span.label {\n margin-left: 10px;\n cursor: pointer;\n }\n ${(props) => (props.size === 'small' ? sizeRadio(14) : null)}\n ${(props) => (props.size === 'medium' ? sizeRadio(16) : null)}\n ${(props) => (props.size === 'large' ? sizeRadio(18) : null)}\n ${(props) => (props.disabled ? disabled : null)}\n ${(props) => (props.error ? error : null)}\n ${(props) => (props.display ? display(props.display) : null)}\n ${(props) => responsiveProperty('width', props.fluid && props.width !== 'auto' ? 'max-width' : 'width')}\n ${(props) =>\n props.fluid\n ? css`\n width: 100%;\n `\n : null}\n`\n\nexport const Group = styled.div.withConfig<RadioGroupProps>({\n shouldForwardProp: (prop) => prop !== 'inline',\n})`\n display: flex;\n flex-direction: column;\n line-height: normal;\n > ${Root} {\n margin-left: 0;\n &:not(:first-child) {\n margin-top: 15px;\n }\n }\n ${(props) =>\n props.inline\n ? css`\n flex-direction: row;\n &&& > ${Root} {\n margin-top: 0;\n }\n > ${Root} + ${Root} {\n margin-left: 15px;\n }\n ${screenMaxS()`\n flex-direction: column;\n > &{Root} {\n margin-top: 0;\n }\n > ${Root} + ${Root} {\n margin-left: 0;\n margin-top: 15px;\n }\n `}\n `\n : null}\n`\n"],"names":["sizeRadio","i","size","css","disabled","error","Root","styled","label","withConfig","shouldForwardProp","prop","includes","componentId","props","display","responsiveProperty","fluid","width","Group","div","inline","screenMaxS","_templateObject","_taggedTemplateLiteral"],"mappings":"4RAOA,IAAMA,EAAY,SAAAC,GAAA,IAACC,+BAADD,EAAAA,EAAQ,GAAR,OAAeE,EAClBD,CAAAA,aAAAA,gBAAAA,aAAAA,QAAAA,EAEFA,EACCA,IAId,IAAME,EAAWD,EAAjB,CAAA,gJAgBA,IAAME,EAAQF,EAAd,CAAA,gFAYO,IAAMG,EAAOC,EAAOC,MAAMC,WAAuB,CACtDC,kBAAoBC,IAAU,CAAC,OAAQ,QAAS,QAAS,QAAS,WAAWC,SAASD,KADvEF,WAAA,CAAAI,YAAA,wBAAGN,CAiCfO,CAAAA,mVAAAA,IAAAA,IAAAA,IAAAA,IAAAA,IAAAA,IAAAA,IAAAA,KAAAA,GAA0B,UAAfA,EAAMZ,KAAmBF,EAAU,IAAM,OACpDc,GAA0B,WAAfA,EAAMZ,KAAoBF,EAAU,IAAM,OACrDc,GAA0B,UAAfA,EAAMZ,KAAmBF,EAAU,IAAM,OACpDc,GAAWA,EAAMV,SAAWA,EAAW,OACvCU,GAAWA,EAAMT,MAAQA,EAAQ,OACjCS,GAAWA,EAAMC,QAAUA,EAAQD,EAAMC,SAAW,OACpDD,GAAUE,EAAmB,QAASF,EAAMG,OAAyB,SAAhBH,EAAMI,MAAmB,YAAc,WAC5FJ,GACDA,EAAMG,MACFd,EAGA,CAAA,gBAAA,OAGD,IAAMgB,EAAQZ,EAAOa,IAAIX,WAA4B,CAC1DC,kBAAoBC,GAAkB,WAATA,IADbF,WAAA,CAAAI,YAAA,wBAAGN,CAMfD,CAAAA,2DAAAA,wDAAAA,IAAAA,GAMDQ,GACDA,EAAMO,OACFlB,EADJ,CAAA,4BAAA,oBAAA,MAAA,sBAAA,IAGcG,EAGJA,EAAUA,EAGZgB,GAAAA,CATRC,IAAAA,EAAAC,EAAA,CAAA,8HAAA,MAAA,mGAcYlB,EAAUA,IAMlB"}
1
+ {"version":3,"file":"style.js","sources":["../../../../src/components/Radio/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { screenMaxS } from 'mixins/screen'\nimport { responsiveProperty } from '../../mixins/responsive-property'\nimport { display } from '../../mixins/display'\nimport { RadioGroupProps } from './Group'\nimport { RadioProps } from './Radio'\n\nconst sizeRadio = (size = 14) => css`\n font-size: ${size}px;\n svg {\n width: ${size}px;\n height: ${size}px;\n }\n`\n\nconst disabled = css`\n cursor: not-allowed;\n color: #d4d4d4;\n svg {\n circle:nth-child(1) {\n stroke: #d4d4d4;\n }\n circle:nth-child(2) {\n fill: #d4d4d4;\n }\n }\n span.label {\n cursor: not-allowed;\n }\n`\n\nconst error = css`\n svg {\n circle {\n fill: #ffeef0;\n stroke: #ffa3a3;\n }\n circle:nth-child(2) {\n fill: #ffa3a3;\n }\n }\n`\n\nexport const Root = styled.label.withConfig<RadioProps>({\n shouldForwardProp: (prop) => !['size', 'error', 'fluid', 'width', 'display'].includes(prop),\n})`\n align-items: baseline;\n user-select: none;\n cursor: pointer;\n width: auto;\n svg {\n position: relative;\n top: 2px;\n flex-shrink: 0;\n circle:nth-child(2) {\n opacity: 0;\n transition: all 0.2s ease;\n }\n }\n & + & {\n margin-left: 15px;\n }\n input {\n display: none;\n appearance: none;\n &:checked + svg {\n circle:nth-child(2) {\n opacity: 1;\n transform: scale(1);\n }\n ${(props) =>\n !props.error\n ? css`\n circle:not(:disabled) {\n stroke: #48a1e6;\n }\n circle:not(:disabled):last-child {\n fill: #48a1e6;\n }\n `\n : null}\n }\n }\n span.label {\n margin-left: 10px;\n cursor: pointer;\n }\n ${(props) => (props.size === 'small' ? sizeRadio(14) : null)}\n ${(props) => (props.size === 'medium' ? sizeRadio(16) : null)}\n ${(props) => (props.size === 'large' ? sizeRadio(18) : null)}\n ${(props) => (props.disabled ? disabled : null)}\n ${(props) => (props.error ? error : null)}\n ${(props) => (props.display ? display(props.display) : null)}\n ${(props) => responsiveProperty('width', props.fluid && props.width !== 'auto' ? 'max-width' : 'width')}\n ${(props) =>\n props.fluid\n ? css`\n width: 100%;\n `\n : null}\n`\n\nexport const Group = styled.div.withConfig<RadioGroupProps>({\n shouldForwardProp: (prop) => prop !== 'inline',\n})`\n display: flex;\n flex-direction: column;\n line-height: normal;\n > ${Root} {\n margin-left: 0;\n &:not(:first-child) {\n margin-top: 15px;\n }\n }\n ${(props) =>\n props.inline\n ? css`\n flex-direction: row;\n &&& > ${Root} {\n margin-top: 0;\n }\n > ${Root} + ${Root} {\n margin-left: 15px;\n }\n ${screenMaxS()`\n flex-direction: column;\n > &{Root} {\n margin-top: 0;\n }\n > ${Root} + ${Root} {\n margin-left: 0;\n margin-top: 15px;\n }\n `}\n `\n : null}\n`\n"],"names":["sizeRadio","i","size","css","disabled","error","Root","styled","label","withConfig","shouldForwardProp","prop","includes","componentId","props","display","responsiveProperty","fluid","width","Group","div","inline","screenMaxS","_templateObject","_taggedTemplateLiteral"],"mappings":"4RAOA,IAAMA,EAAY,SAAAC,GAAA,IAACC,+BAADD,EAAAA,EAAQ,GAAR,OAAeE,EAClBD,CAAAA,aAAAA,gBAAAA,aAAAA,QAAAA,EAEFA,EACCA,IAId,IAAME,EAAWD,EAAjB,CAAA,gJAgBA,IAAME,EAAQF,EAAd,CAAA,gFAYO,IAAMG,EAAOC,EAAOC,MAAMC,WAAuB,CACtDC,kBAAoBC,IAAU,CAAC,OAAQ,QAAS,QAAS,QAAS,WAAWC,SAASD,KADvEF,WAAA,CAAAI,YAAA,wBAAGN,CA2BXO,CAAAA,qSAAAA,iDAAAA,IAAAA,IAAAA,IAAAA,IAAAA,IAAAA,IAAAA,IAAAA,KAAAA,GACAA,EAAMT,MASH,KARAF,EADJ,CAAA,4FAgBHW,GAA0B,UAAfA,EAAMZ,KAAmBF,EAAU,IAAM,OACpDc,GAA0B,WAAfA,EAAMZ,KAAoBF,EAAU,IAAM,OACrDc,GAA0B,UAAfA,EAAMZ,KAAmBF,EAAU,IAAM,OACpDc,GAAWA,EAAMV,SAAWA,EAAW,OACvCU,GAAWA,EAAMT,MAAQA,EAAQ,OACjCS,GAAWA,EAAMC,QAAUA,EAAQD,EAAMC,SAAW,OACpDD,GAAUE,EAAmB,QAASF,EAAMG,OAAyB,SAAhBH,EAAMI,MAAmB,YAAc,WAC5FJ,GACDA,EAAMG,MACFd,EAGA,CAAA,gBAAA,OAGD,IAAMgB,EAAQZ,EAAOa,IAAIX,WAA4B,CAC1DC,kBAAoBC,GAAkB,WAATA,IADbF,WAAA,CAAAI,YAAA,wBAAGN,CAMfD,CAAAA,2DAAAA,wDAAAA,IAAAA,GAMDQ,GACDA,EAAMO,OACFlB,EADJ,CAAA,4BAAA,oBAAA,MAAA,sBAAA,IAGcG,EAGJA,EAAUA,EAGZgB,GAAAA,CATRC,IAAAA,EAAAC,EAAA,CAAA,8HAAA,MAAA,mGAcYlB,EAAUA,IAMlB"}
package/dts/index.d.ts CHANGED
@@ -1107,6 +1107,11 @@ interface ButtonProps extends BaseProps, Tooltiped, Display, Color, Color<'fontC
1107
1107
  * Size
1108
1108
  */
1109
1109
  size?: keyof typeof PROPS_BY_SIZE;
1110
+ /**
1111
+ * Content of button
1112
+ * @deprecated Use children property
1113
+ */
1114
+ content?: React.ReactNode;
1110
1115
  }
1111
1116
  /**
1112
1117
  * Расширен: