@foxford/ui 2.16.0-beta-efb0e62-20231127 → 2.16.1-beta-e2dc1ab-20231127
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.
- package/components/Badge/Badge.js +1 -1
- package/components/Badge/Badge.js.map +1 -1
- package/index.cjs.js +1 -1
- package/index.cjs.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r from'@babel/runtime/helpers/objectSpread2';import o from'@babel/runtime/helpers/objectWithoutProperties';import{forwardRef as e}from'react';import{withMergedProps as s}from'../../hocs/withMergedProps.js';import{Text as i}from'../Text/Text.js';import{Icon as t}from'../Icon/Icon.js';import'../Icon/icons.js';import{Root as a}from'./style.js';import{SIZES_ROUND as n,SIZES as c}from'./constants.js';import{jsx as
|
|
1
|
+
import r from'@babel/runtime/helpers/objectSpread2';import o from'@babel/runtime/helpers/objectWithoutProperties';import{forwardRef as e}from'react';import{withMergedProps as s}from'../../hocs/withMergedProps.js';import{Text as i}from'../Text/Text.js';import{Icon as t}from'../Icon/Icon.js';import'../Icon/icons.js';import{Root as a}from'./style.js';import{SIZES_ROUND as n,SIZES as c}from'./constants.js';import{jsx as m,jsxs as p,Fragment as d}from'react/jsx-runtime';var f=["size","borderRadius","textProps","iconProps","children","content","icon"];var h=s(e(((e,s)=>{var{size:n="s",borderRadius:c=3,textProps:h={},iconProps:l={},children:j,content:x,icon:P}=e,b=o(e,f);var[u,g]=Array.isArray(P)?P:[P];var v={as:'span',size:'inherit',color:'inherit',marginLeft:u?'0.5em':void 0,marginRight:g?'0.5em':void 0};var R={color:'inherit'};return m(a,r(r({},b),{},{size:n,borderRadius:c,ref:s,children:'function'==typeof j?j({baseTextProps:v,textProps:h,iconBaseProps:R,iconProps:l,icon:P}):p(d,{children:[u&&m(t,r(r({icon:u},R),l)),(j||x)&&m(i,r(r(r({},v),h),{},{children:j||x})),g&&m(t,r(r({icon:g},R),l))]})}))})),{displayName:'Badge',sizes:r=>r.round?n:c});export{h as Badge};
|
|
2
2
|
//# sourceMappingURL=Badge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.js","sources":["../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport * as Styled from './style'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport type { BadgeProps } from './types'\n\nconst COMPONENT_NAME = 'Badge'\n\n/**\n *\n * Component interface extends:\n * - [`ResponsiveSizeProps`](#/Interfaces)\n * - [`ResponsiveMarginProps`](#/Interfaces)\n * - [`ColorSchemaProps`](#/Interfaces)\n * - [`ColorPaletteProps<keyof BadgePalette>`](#/Interfaces)\n * - [`TypographyProps`](#/Interfaces)\n * - [`BaseProps`](#/Interfaces)\n * - [`React.ComponentPropsWithRef<'div'>`](#/Interfaces)\n */\nexport const Badge: React.ForwardRefExoticComponent<BadgeProps> = withMergedProps<BadgeProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n borderRadius = 3,\n textProps = {},\n iconProps = {},\n children,\n content,\n icon,\n ...restProps\n } = props\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n marginLeft: before ?
|
|
1
|
+
{"version":3,"file":"Badge.js","sources":["../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport type { TextProps } from 'components/Text'\nimport type { IconProps } from 'components/Icon'\nimport * as Styled from './style'\nimport { SIZES, SIZES_ROUND } from './constants'\nimport type { BadgeProps } from './types'\n\nconst COMPONENT_NAME = 'Badge'\n\n/**\n *\n * Component interface extends:\n * - [`ResponsiveSizeProps`](#/Interfaces)\n * - [`ResponsiveMarginProps`](#/Interfaces)\n * - [`ColorSchemaProps`](#/Interfaces)\n * - [`ColorPaletteProps<keyof BadgePalette>`](#/Interfaces)\n * - [`TypographyProps`](#/Interfaces)\n * - [`BaseProps`](#/Interfaces)\n * - [`React.ComponentPropsWithRef<'div'>`](#/Interfaces)\n */\nexport const Badge: React.ForwardRefExoticComponent<BadgeProps> = withMergedProps<BadgeProps, HTMLDivElement>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n borderRadius = 3,\n textProps = {},\n iconProps = {},\n children,\n content,\n icon,\n ...restProps\n } = props\n\n const [before, after] = Array.isArray(icon) ? icon : [icon]\n\n const baseTextProps: TextProps = {\n as: 'span',\n size: 'inherit',\n color: 'inherit',\n marginLeft: before ? '0.5em' : undefined,\n marginRight: after ? '0.5em' : undefined,\n }\n const iconBaseProps: IconProps = { color: 'inherit' }\n\n return (\n <Styled.Root {...restProps} size={size} borderRadius={borderRadius} ref={ref}>\n {typeof children === 'function' ? (\n children({ baseTextProps, textProps, iconBaseProps, iconProps, icon })\n ) : (\n <>\n {before && <Icon icon={before} {...iconBaseProps} {...iconProps} />}\n {(children || content) && (\n <Text {...baseTextProps} {...textProps}>\n {children || content}\n </Text>\n )}\n {after && <Icon icon={after} {...iconBaseProps} {...iconProps} />}\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n displayName: COMPONENT_NAME,\n sizes: (props) => (props.round ? SIZES_ROUND : SIZES),\n }\n)\n"],"names":["Badge","withMergedProps","forwardRef","props","ref","size","borderRadius","textProps","iconProps","children","content","icon","restProps","_excluded","before","after","Array","isArray","baseTextProps","as","color","marginLeft","marginRight","iconBaseProps","_jsx","Styled.Root","_jsxs","_Fragment","Icon","_objectSpread","Text","displayName","sizes","round","SIZES_ROUND","SIZES"],"mappings":"wiBAuBO,IAAMA,EAAqDC,EAChEC,GAAAA,CAAYC,EAAOC,KACjB,IAAMC,KACJA,EAAO,IADHC,aAEJA,EAAe,EAFXC,UAGJA,EAAY,GAHRC,UAIJA,EAAY,GAJRC,SAKJA,EALIC,QAMJA,EANIC,KAOJA,GAEER,EADCS,IACDT,EATJU,GAWA,IAAOC,EAAQC,GAASC,MAAMC,QAAQN,GAAQA,EAAO,CAACA,GAEtD,IAAMO,EAA2B,CAC/BC,GAAI,OACJd,KAAM,UACNe,MAAO,UACPC,WAAYP,EAAS,eACrBQ,YAAaP,EAAQ,aAAA,GAEvB,IAAMQ,EAA2B,CAAEH,MAAO,WAE1C,OACEI,EAACC,SAAgBb,GAAjB,GAAA,CAA4BP,KAAMA,EAAMC,aAAcA,EAAcF,IAAKA,EAAzEK,SACuB,mBAAbA,EACNA,EAAS,CAAES,cAAAA,EAAeX,UAAAA,EAAWgB,cAAAA,EAAef,UAAAA,EAAWG,KAAAA,IAE/De,EAAAC,EAAA,CAAAlB,SACGK,CAAAA,GAAUU,EAACI,EAADC,EAAAA,EAAA,CAAMlB,KAAMG,GAAYS,GAAmBf,KACpDC,GAAYC,IACZc,EAACM,EAASZ,EAAAA,EAAAA,EAAAA,GAAAA,GAAmBX,GAA7B,GAAA,CAAAE,SACGA,GAAYC,KAGhBK,GAASS,EAACI,EAADC,EAAAA,EAAA,CAAMlB,KAAMI,GAAWQ,GAAmBf,aAM9D,CACEuB,YAxDmB,QAyDnBC,MAAQ7B,GAAWA,EAAM8B,MAAQC,EAAcC"}
|