@foxford/ui 2.22.0-beta-a195497-20240401 → 2.22.1-beta-7105d19-20240401

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 s from'@babel/runtime/helpers/objectWithoutProperties';import{forwardRef as o,cloneElement as r}from'react';import{withMergedProps as t}from'../../hocs/withMergedProps.js';import{Text as i}from'../Text/Text.js';import{Icon as a}from'../Icon/Icon.js';import'../Icon/icons.js';import{Root as n,Content as l,HintButton as p}from'./style.js';import{SIZES as c}from'./constants.js';import d from'./images/hint.module.svg.js';import{jsxs as m,jsx as z}from'react/jsx-runtime';var b=["size","textProps","hint","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","disabled","error","success","checked","onColored","children","control","label","palette"];var h='FormLabel';var f=t(o(((o,t)=>{var c;var{size:h="m",textProps:f={},hint:u={},sizeXXS:j,sizeXS:x,sizeS:S,sizeM:X,sizeL:v,sizeXL:P,disabled:L,error:y,success:M,checked:g,onColored:C,children:I,control:T,label:E,palette:N}=o,k=s(o,b);var w={size:h,sizeXXS:j,sizeXS:x,sizeS:S,sizeM:X,sizeL:v,sizeXL:P};var F={disabled:L,error:y,success:M,checked:g,onColored:C};var O='object'==typeof T&&'object'==typeof T.props&&null!==T.props?T.props:{};var{textProps:R={},iconProps:A={}}=u;return m(n,e(e(e(e({},k),w),F),{},{palette:N,ref:t,children:['function'==typeof T?T(e(e({},w),F)):r(T,e(e(e({},w),F),O)),m(l,{children:[z(i,e(e({as:"span",appearance:"body",size:"inherit",color:"inherit"},f),{},{children:null!=E?E:I})),u.text&&z(i,e(e({as:"span",appearance:"caption",color:F.disabled?'content-disabled':'content-onmain-secondary',size:.8,sizeUnits:"em",marginTop:2},R),{},{children:u.text}))]}),u.buttonProps&&z(p,e(e({},u.buttonProps),{},{disabled:F.disabled||u.buttonProps.disabled,palette:N,children:z(a,e({as:"span",icon:null!==(c=u.icon)&&void 0!==c?c:z(d,{}),size:20},A))}))]}))})),{displayName:"FormLabel",sizes:c});export{h as COMPONENT_NAME,f as FormLabel};
1
+ import e from'@babel/runtime/helpers/objectSpread2';import s from'@babel/runtime/helpers/objectWithoutProperties';import{forwardRef as o,cloneElement as r}from'react';import{withMergedProps as t}from'../../hocs/withMergedProps.js';import{Text as i}from'../Text/Text.js';import{Icon as a}from'../Icon/Icon.js';import'../Icon/icons.js';import{Root as n,Content as p,HintButton as l}from'./style.js';import{SIZES as c}from'./constants.js';import d from'./images/hint.module.svg.js';import{jsxs as m,jsx as b}from'react/jsx-runtime';var z=["size","textProps","hint","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","disabled","error","success","checked","onColored","children","control","label","palette"];var h='FormLabel';var u=t(o(((o,t)=>{var c;var{size:h="m",textProps:u={},hint:f={},sizeXXS:j,sizeXS:x,sizeS:S,sizeM:X,sizeL:v,sizeXL:P,disabled:L,error:y,success:M,checked:g,onColored:C,children:I,control:T,label:E,palette:N}=o,k=s(o,z);var w={size:h,sizeXXS:j,sizeXS:x,sizeS:S,sizeM:X,sizeL:v,sizeXL:P};var F={disabled:L,error:y,success:M,checked:g,onColored:C};var O='object'==typeof T&&'object'==typeof T.props&&null!==T.props?T.props:{};var{textProps:R={},iconProps:A={}}=f;return m(n,e(e(e(e({},k),w),F),{},{palette:N,ref:t,children:['function'==typeof T?T(e(e({},w),F)):r(T,e(e(e({},w),F),O)),m(p,{children:[b(i,e(e({as:"span",appearance:"body",size:"inherit",color:"inherit"},u),{},{children:null!=E?E:I})),f.text&&b(i,e(e({as:"span",appearance:"caption",color:F.disabled?'content-disabled':'content-onmain-secondary',size:.8,sizeUnits:"em",marginTop:2},R),{},{children:f.text}))]}),f.buttonProps&&b(l,e(e({},f.buttonProps),{},{disabled:F.disabled||f.buttonProps.disabled,palette:N,type:"button",children:b(a,e({as:"span",icon:null!==(c=f.icon)&&void 0!==c?c:b(d,{}),size:20},A))}))]}))})),{displayName:"FormLabel",sizes:c});export{h as COMPONENT_NAME,u as FormLabel};
2
2
  //# sourceMappingURL=FormLabel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormLabel.js","sources":["../../../../src/components/FormLabel/FormLabel.tsx"],"sourcesContent":["import { forwardRef, cloneElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport * as Styled from './style'\nimport { SIZES } from './constants'\nimport Hint from './images/hint.module.svg'\nimport type { FormLabelProps } from './types'\n\nconst COMPONENT_NAME = 'FormLabel'\n\n/**\n *\n * Component accepts all \\<label\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [FormLabelProps](https://github.com/foxford/ui/blob/master/src/components/FormLabel/types.ts)\n */\nconst FormLabel: React.ForwardRefExoticComponent<FormLabelProps> = withMergedProps<FormLabelProps, HTMLLabelElement>(\n forwardRef(\n (\n {\n size = 'm',\n textProps = {},\n hint = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n disabled,\n error,\n success,\n checked,\n onColored,\n children,\n control,\n label,\n palette,\n ...props\n },\n ref\n ) => {\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const stateProps = {\n disabled,\n error,\n success,\n checked,\n onColored,\n }\n\n const elementProps =\n typeof control === 'object' && typeof control.props === 'object' && control.props !== null ? control.props : {}\n\n const { textProps: hintTextProps = {}, iconProps: hintIconProps = {} } = hint\n\n return (\n <Styled.Root {...props} {...sizeProps} {...stateProps} palette={palette} ref={ref}>\n {typeof control === 'function'\n ? control({\n ...sizeProps,\n ...stateProps,\n })\n : cloneElement(control, {\n ...sizeProps,\n ...stateProps,\n ...elementProps,\n })}\n <Styled.Content>\n <Text as='span' appearance='body' size='inherit' color='inherit' {...textProps}>\n {label ?? children}\n </Text>\n {hint.text && (\n <Text\n as='span'\n appearance='caption'\n color={stateProps.disabled ? 'content-disabled' : 'content-onmain-secondary'}\n size={0.8}\n sizeUnits='em'\n marginTop={2}\n {...hintTextProps}\n >\n {hint.text}\n </Text>\n )}\n </Styled.Content>\n {hint.buttonProps && (\n <Styled.HintButton\n {...hint.buttonProps}\n disabled={stateProps.disabled || hint.buttonProps.disabled}\n palette={palette}\n >\n <Icon as='span' icon={hint.icon ?? <Hint />} size={20} {...hintIconProps} />\n </Styled.HintButton>\n )}\n </Styled.Root>\n )\n }\n ),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { FormLabel, COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","FormLabel","withMergedProps","forwardRef","_ref","ref","_hint$icon","size","textProps","hint","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","disabled","error","success","checked","onColored","children","control","label","palette","props","_objectWithoutProperties","_excluded","sizeProps","stateProps","elementProps","hintTextProps","iconProps","hintIconProps","_jsxs","Styled.Root","_objectSpread","cloneElement","Styled.Content","_jsx","Text","as","appearance","color","text","sizeUnits","marginTop","buttonProps","Styled.HintButton","Icon","icon","Hint","displayName","sizes","SIZES"],"mappings":"isBASMA,IAAAA,EAAiB,YAYjBC,IAAAA,EAA6DC,EACjEC,GAAAA,CACEC,EAsBEC,KACG,IAAAC,EAAA,IAtBHC,KACEA,EAAO,IADTC,UAEEA,EAAY,GAFdC,KAGEA,EAAO,GAHTC,QAIEA,EAJFC,OAKEA,EALFC,MAMEA,EANFC,MAOEA,EAPFC,MAQEA,EARFC,OASEA,EATFC,SAUEA,EAVFC,MAWEA,EAXFC,QAYEA,EAZFC,QAaEA,EAbFC,UAcEA,EAdFC,SAeEA,EAfFC,QAgBEA,EAhBFC,MAiBEA,EAjBFC,QAkBEA,GAICpB,EAHEqB,EAGFC,EAAAtB,EAAAuB,GACH,IAAMC,EAAY,CAChBrB,KAAAA,EACAG,QAAAA,EACAC,OAAAA,EACAC,MAAA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ormLabel/FormLabel.tsx"],"sourcesContent":["import { forwardRef, cloneElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport * as Styled from './style'\nimport { SIZES } from './constants'\nimport Hint from './images/hint.module.svg'\nimport type { FormLabelProps } from './types'\n\nconst COMPONENT_NAME = 'FormLabel'\n\n/**\n *\n * Component accepts all \\<label\\> attributes.\n *\n * Responsive \"size\", \"margin\" props are supported.\n *\n * Exposed \"ref\" attached to root node.\n *\n * See full [FormLabelProps](https://github.com/foxford/ui/blob/master/src/components/FormLabel/types.ts)\n */\nconst FormLabel: React.ForwardRefExoticComponent<FormLabelProps> = withMergedProps<FormLabelProps, HTMLLabelElement>(\n forwardRef(\n (\n {\n size = 'm',\n textProps = {},\n hint = {},\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n disabled,\n error,\n success,\n checked,\n onColored,\n children,\n control,\n label,\n palette,\n ...props\n },\n ref\n ) => {\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const stateProps = {\n disabled,\n error,\n success,\n checked,\n onColored,\n }\n\n const elementProps =\n typeof control === 'object' && typeof control.props === 'object' && control.props !== null ? control.props : {}\n\n const { textProps: hintTextProps = {}, iconProps: hintIconProps = {} } = hint\n\n return (\n <Styled.Root {...props} {...sizeProps} {...stateProps} palette={palette} ref={ref}>\n {typeof control === 'function'\n ? control({\n ...sizeProps,\n ...stateProps,\n })\n : cloneElement(control, {\n ...sizeProps,\n ...stateProps,\n ...elementProps,\n })}\n <Styled.Content>\n <Text as='span' appearance='body' size='inherit' color='inherit' {...textProps}>\n {label ?? children}\n </Text>\n {hint.text && (\n <Text\n as='span'\n appearance='caption'\n color={stateProps.disabled ? 'content-disabled' : 'content-onmain-secondary'}\n size={0.8}\n sizeUnits='em'\n marginTop={2}\n {...hintTextProps}\n >\n {hint.text}\n </Text>\n )}\n </Styled.Content>\n {hint.buttonProps && (\n <Styled.HintButton\n {...hint.buttonProps}\n disabled={stateProps.disabled || hint.buttonProps.disabled}\n palette={palette}\n type='button'\n >\n <Icon as='span' icon={hint.icon ?? <Hint />} size={20} {...hintIconProps} />\n </Styled.HintButton>\n )}\n </Styled.Root>\n )\n }\n ),\n {\n displayName: COMPONENT_NAME,\n sizes: SIZES,\n }\n)\n\nexport { FormLabel, COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","FormLabel","withMergedProps","forwardRef","_ref","ref","_hint$icon","size","textProps","hint","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","disabled","error","success","checked","onColored","children","control","label","palette","props","_objectWithoutProperties","_excluded","sizeProps","stateProps","elementProps","hintTextProps","iconProps","hintIconProps","_jsxs","Styled.Root","_objectSpread","cloneElement","Styled.Content","_jsx","Text","as","appearance","color","text","sizeUnits","marginTop","buttonProps","Styled.HintButton","type","Icon","icon","Hint","displayName","sizes","SIZES"],"mappings":"isBASMA,IAAAA,EAAiB,YAYjBC,IAAAA,EAA6DC,EACjEC,GAAAA,CACEC,EAsBEC,KACG,IAAAC,EAAA,IAtBHC,KACEA,EAAO,IADTC,UAEEA,EAAY,GAFdC,KAGEA,EAAO,GAHTC,QAIEA,EAJFC,OAKEA,EALFC,MAMEA,EANFC,MAOEA,EAPFC,MAQEA,EARFC,OASEA,EATFC,SAUEA,EAVFC,MAWEA,EAXFC,QAYEA,EAZFC,QAaEA,EAbFC,UAcEA,EAdFC,SAeEA,EAfFC,QAgBEA,EAhBFC,MAiBEA,EAjBFC,QAkBEA,GAICpB,EAHEqB,EAGFC,EAAAtB,EAAAuB,GACH,IAAMC,EAAY,CAChBrB,KAAAA,EACAG,QAAAA,EACAC,OAAAA,EACAC,MAAAA,EACAC,MAAAA,EACAC,MAAAA,EACAC,OAAAA,GAGF,IAAMc,EAAa,CACjBb,SAAAA,EACAC,MAAAA,EACAC,QAAAA,EACAC,QAAAA,EACAC,UAAAA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