@economic/taco 1.17.0 → 1.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.css +4 -4
- package/dist/esm/packages/taco/src/components/Input/Input.js +8 -20
- package/dist/esm/packages/taco/src/components/Input/Input.js.map +1 -1
- package/dist/index.css +4 -4
- package/dist/taco.cjs.development.js +7 -19
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/package.json +2 -2
package/dist/esm/index.css
CHANGED
@@ -513,7 +513,7 @@
|
|
513
513
|
|
514
514
|
/* rows */
|
515
515
|
.yt-table__row {
|
516
|
-
@apply border-grey-
|
516
|
+
@apply border-grey-200 flex border-b;
|
517
517
|
min-height: 2.5rem;
|
518
518
|
}
|
519
519
|
|
@@ -545,12 +545,12 @@
|
|
545
545
|
}
|
546
546
|
|
547
547
|
.yt-table__head .yt-table__head__group .yt-table__cell.yt-table__cell__group {
|
548
|
-
@apply border-grey-
|
548
|
+
@apply border-grey-200 border-b;
|
549
549
|
flex-basis: 100%;
|
550
550
|
}
|
551
551
|
|
552
552
|
.yt-table__head .yt-table__head__group + .yt-table__head__group {
|
553
|
-
@apply border-grey-
|
553
|
+
@apply border-grey-200 border-l;
|
554
554
|
}
|
555
555
|
|
556
556
|
.yt-table__head .yt-table__cell > [data-taco='icon'] {
|
@@ -558,7 +558,7 @@
|
|
558
558
|
}
|
559
559
|
|
560
560
|
.yt-table__head .yt-table__cell.yt-table__cell__group + .yt-table__cell__group {
|
561
|
-
@apply border-grey-
|
561
|
+
@apply border-grey-200 border-l-2;
|
562
562
|
}
|
563
563
|
|
564
564
|
.yt-table.yt-table--windowed.table-with-scrollbar .yt-table__head {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { forwardRef, createElement, useRef, memo,
|
1
|
+
import { forwardRef, createElement, useRef, memo, cloneElement } from 'react';
|
2
2
|
import cn from 'classnames';
|
3
3
|
import { Icon } from '../Icon/Icon.js';
|
4
4
|
import { getButtonStateClasses, getInputClasses } from './util.js';
|
@@ -43,7 +43,7 @@ const InputWithoutDeprecatedFeatures = /*#__PURE__*/forwardRef(function InputWit
|
|
43
43
|
'pr-8': !!postfix
|
44
44
|
}, attributes.className);
|
45
45
|
return /*#__PURE__*/createElement("div", {
|
46
|
-
className: "relative inline-flex"
|
46
|
+
className: "relative inline-flex w-full"
|
47
47
|
}, /*#__PURE__*/createElement("input", Object.assign({}, attributes, {
|
48
48
|
className: className,
|
49
49
|
"data-taco": "input",
|
@@ -72,30 +72,18 @@ const Affix = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Affix(props, r
|
|
72
72
|
disabled,
|
73
73
|
type
|
74
74
|
} = props;
|
75
|
-
let displayName;
|
76
75
|
if (children) {
|
77
|
-
let el = children;
|
78
|
-
if ( /*#__PURE__*/isValidElement(children)) {
|
79
|
-
var _children$type;
|
80
|
-
displayName = children === null || children === void 0 ? void 0 : (_children$type = children.type) === null || _children$type === void 0 ? void 0 : _children$type.displayName;
|
81
|
-
if (displayName === 'Icon') {
|
82
|
-
el = /*#__PURE__*/cloneElement(children, {
|
83
|
-
className: cn('!h-5 !w-5', children.props.className)
|
84
|
-
});
|
85
|
-
}
|
86
|
-
}
|
87
76
|
return /*#__PURE__*/createElement("span", {
|
88
|
-
className: cn('group absolute top-0 flex h-full items-center justify-center',
|
77
|
+
className: cn('group absolute top-0 flex h-full items-center justify-center px-2',
|
78
|
+
// icon
|
79
|
+
'[&_[data-taco="icon"]]:!h-5 [&_[data-taco="icon"]]:!w-5', {
|
89
80
|
'text-grey-300': disabled,
|
90
81
|
'text-grey-700': !disabled,
|
91
|
-
'left-0': type === 'prefix',
|
92
|
-
'right-0': type === 'postfix'
|
93
|
-
'px-0': displayName === 'IconButton',
|
94
|
-
'px-1.5': displayName === 'Icon',
|
95
|
-
'px-2': displayName !== 'IconButton' && displayName !== 'Icon'
|
82
|
+
'left-0 [&>button]:!-ml-2': type === 'prefix',
|
83
|
+
'right-0 [&>button]:!-mr-2': type === 'postfix'
|
96
84
|
}),
|
97
85
|
ref: ref
|
98
|
-
},
|
86
|
+
}, children);
|
99
87
|
}
|
100
88
|
return null;
|
101
89
|
}));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Input.js","sources":["../../../../../../../src/components/Input/Input.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport { Icon, IconName, IconProps } from '../Icon/Icon';\nimport { getButtonStateClasses, getInputClasses } from './util';\nimport { useBoundingClientRectListener } from '../../hooks/useBoundingClientRectListener';\nimport { useMergedRef } from '../../hooks/useMergedRef';\n\nexport type InputWithoutDeprecatedFeaturesProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix'> & {\n /** Draws attention to the input by changing its style and making it visually prominent */\n highlighted?: boolean;\n /* Whether the input is in an invalid state */\n invalid?: boolean;\n postfix?: string | JSX.Element;\n prefix?: string | JSX.Element;\n};\n\nconst validSetSelectionRangeTypes = ['text', 'search', 'url', 'tel', 'password'];\n\nconst InputWithoutDeprecatedFeatures = React.forwardRef(function InputWithoutDeprecatedFeatures(\n props: InputWithoutDeprecatedFeaturesProps,\n ref: React.Ref<HTMLInputElement>\n) {\n const { highlighted, invalid, onKeyDown, postfix, prefix, type = 'text', ...attributes } = props;\n const internalRef = useMergedRef<HTMLInputElement>(ref);\n\n let handleKeyDown = onKeyDown;\n\n // home and end keys only navigate to the start/end of input value if the input container does not scroll\n // if it has scroll height then the browser reverts to native scrolling behaviour only\n // so we manually override it to ensure _our_ desired behaviour remains intact\n // only the 'text', 'search', 'url', 'tel', 'password' input types support setSelectionRange\n if (validSetSelectionRangeTypes.includes(type)) {\n handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (!event.shiftKey && (event.key === 'Home' || event.key === 'End')) {\n event.preventDefault();\n const position = event.key === 'End' ? event.currentTarget.value.length : 0;\n event.currentTarget.setSelectionRange(position, position);\n }\n\n if (typeof onKeyDown === 'function') {\n onKeyDown(event);\n }\n };\n }\n\n const prefixRef = React.useRef<HTMLSpanElement>(null);\n const prefixRect = useBoundingClientRectListener(prefixRef);\n const postfixRef = React.useRef<HTMLSpanElement>(null);\n const postfixRect = useBoundingClientRectListener(postfixRef);\n\n const className = cn(\n getInputClasses(props),\n {\n 'pl-8': !!prefix,\n 'pr-8': !!postfix,\n },\n attributes.className\n );\n\n return (\n <div className=\"relative inline-flex\">\n <input\n {...attributes}\n className={className}\n data-taco=\"input\"\n onKeyDown={handleKeyDown}\n ref={internalRef}\n style={{\n paddingLeft: prefixRect ? `${prefixRect.width - 1}px` : undefined,\n paddingRight: postfixRect ? `${postfixRect.width - 1}px` : undefined,\n }}\n type={type}\n />\n {prefix ? <Affix type=\"prefix\" children={prefix} disabled={attributes.disabled} ref={prefixRef} /> : null}\n {postfix ? <Affix type=\"postfix\" children={postfix} disabled={attributes.disabled} ref={postfixRef} /> : null}\n </div>\n );\n});\n\ntype AffixProps = {\n children?: string | JSX.Element;\n disabled?: boolean;\n type: 'prefix' | 'postfix';\n};\nconst Affix = React.memo(\n React.forwardRef(function Affix(props: AffixProps, ref: React.Ref<HTMLSpanElement>) {\n const { children, disabled, type } = props;\n\n let displayName: string | undefined;\n\n if (children) {\n let el = children;\n\n if (React.isValidElement<IconProps>(children)) {\n displayName = (children?.type as React.FunctionComponent)?.displayName;\n\n if (displayName === 'Icon') {\n el = React.cloneElement(children, {\n className: cn('!h-5 !w-5', children.props.className),\n } as any);\n }\n }\n\n return (\n <span\n className={cn('group absolute top-0 flex h-full items-center justify-center', {\n 'text-grey-300': disabled,\n 'text-grey-700': !disabled,\n 'left-0': type === 'prefix',\n 'right-0': type === 'postfix',\n 'px-0': displayName === 'IconButton',\n 'px-1.5': displayName === 'Icon',\n 'px-2': displayName !== 'IconButton' && displayName !== 'Icon',\n })}\n ref={ref}>\n {el}\n </span>\n );\n }\n\n return null;\n })\n);\n\nexport type InputProps = InputWithoutDeprecatedFeaturesProps & {\n /** Shows a button within the input field */\n button?: React.ReactElement;\n /** Shows an icon within the input field */\n icon?: IconName | JSX.Element;\n};\n\nexport const Input = React.forwardRef(function LegacyInput(props: InputProps, ref: React.Ref<HTMLInputElement>) {\n const { button, icon, ...attributes } = props;\n\n let postfix;\n\n if (button) {\n const disabled = button.props.disabled || attributes.disabled;\n const buttonClassName = cn(\n 'items-center focus:z-10 flex justify-center border rounded-l-none rounded-r h-full focus:rounded focus:outline-none',\n {\n [getButtonStateClasses(attributes.invalid)]: !props.disabled,\n },\n button.props.className\n );\n postfix = React.cloneElement(button, {\n className: buttonClassName,\n disabled,\n });\n } else if (icon) {\n postfix = typeof icon === 'string' ? <Icon name={icon} /> : icon;\n }\n\n return <InputWithoutDeprecatedFeatures {...attributes} postfix={attributes.postfix ?? postfix} ref={ref} />;\n});\n"],"names":["validSetSelectionRangeTypes","InputWithoutDeprecatedFeatures","React","props","ref","highlighted","invalid","onKeyDown","postfix","prefix","type","attributes","internalRef","useMergedRef","handleKeyDown","includes","event","shiftKey","key","preventDefault","position","currentTarget","value","length","setSelectionRange","prefixRef","prefixRect","useBoundingClientRectListener","postfixRef","postfixRect","className","cn","getInputClasses","style","paddingLeft","width","undefined","paddingRight","Affix","children","disabled","displayName","el","Input","LegacyInput","button","icon","buttonClassName","getButtonStateClasses","Icon","name"],"mappings":";;;;;;;AAgBA,MAAMA,2BAA2B,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC;AAEhF,MAAMC,8BAA8B,gBAAGC,UAAgB,CAAC,SAASD,8BAA8B,CAC3FE,KAA0C,EAC1CC,GAAgC;EAEhC,MAAM;IAAEC,WAAW;IAAEC,OAAO;IAAEC,SAAS;IAAEC,OAAO;IAAEC,MAAM;IAAEC,IAAI,GAAG,MAAM;IAAE,GAAGC;GAAY,GAAGR,KAAK;EAChG,MAAMS,WAAW,GAAGC,YAAY,CAAmBT,GAAG,CAA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AI,KAAK,SAAS;QAC7B,MAAM,EAAE+B,WAAW,KAAK,YAAY;QACpC,QAAQ,EAAEA,WAAW,KAAK,MAAM;QAChC,MAAM,EAAEA,WAAW,KAAK,YAAY,IAAIA,WAAW,KAAK;OAC3D,CAAC;MACFrC,GAAG,EAAEA;OACJsC,EAAE,CACA;;EAIf,OAAO,IAAI;AACf,CAAC,CAAC,CACL;MASYC,KAAK,gBAAGzC,UAAgB,CAAC,SAAS0C,WAAW,CAACzC,KAAiB,EAAEC,GAAgC;;EAC1G,MAAM;IAAEyC,MAAM;IAAEC,IAAI;IAAE,GAAGnC;GAAY,GAAGR,KAAK;EAE7C,IAAIK,OAAO;EAEX,IAAIqC,MAAM,EAAE;IACR,MAAML,QAAQ,GAAGK,MAAM,CAAC1C,KAAK,CAACqC,QAAQ,IAAI7B,UAAU,CAAC6B,QAAQ;IAC7D,MAAMO,eAAe,GAAGhB,EAAE,CACtB,qHAAqH,EACrH;MACI,CAACiB,qBAAqB,CAACrC,UAAU,CAACL,OAAO,CAAC,GAAG,CAACH,KAAK,CAACqC;KACvD,EACDK,MAAM,CAAC1C,KAAK,CAAC2B,SAAS,CACzB;IACDtB,OAAO,gBAAGN,YAAkB,CAAC2C,MAAM,EAAE;MACjCf,SAAS,EAAEiB,eAAe;MAC1BP;KACH,CAAC;GACL,MAAM,IAAIM,IAAI,EAAE;IACbtC,OAAO,GAAG,OAAOsC,IAAI,KAAK,QAAQ,gBAAG5C,cAAC+C,IAAI;MAACC,IAAI,EAAEJ;MAAQ,GAAGA,IAAI;;EAGpE,oBAAO5C,cAACD,8BAA8B,oBAAKU,UAAU;IAAEH,OAAO,yBAAEG,UAAU,CAACH,OAAO,qEAAIA,OAAO;IAAEJ,GAAG,EAAEA;KAAO;AAC/G,CAAC;;;;"}
|
1
|
+
{"version":3,"file":"Input.js","sources":["../../../../../../../src/components/Input/Input.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport { Icon, IconName } from '../Icon/Icon';\nimport { getButtonStateClasses, getInputClasses } from './util';\nimport { useBoundingClientRectListener } from '../../hooks/useBoundingClientRectListener';\nimport { useMergedRef } from '../../hooks/useMergedRef';\n\nexport type InputWithoutDeprecatedFeaturesProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'prefix'> & {\n /** Draws attention to the input by changing its style and making it visually prominent */\n highlighted?: boolean;\n /* Whether the input is in an invalid state */\n invalid?: boolean;\n postfix?: string | JSX.Element;\n prefix?: string | JSX.Element;\n};\n\nconst validSetSelectionRangeTypes = ['text', 'search', 'url', 'tel', 'password'];\n\nconst InputWithoutDeprecatedFeatures = React.forwardRef(function InputWithoutDeprecatedFeatures(\n props: InputWithoutDeprecatedFeaturesProps,\n ref: React.Ref<HTMLInputElement>\n) {\n const { highlighted, invalid, onKeyDown, postfix, prefix, type = 'text', ...attributes } = props;\n const internalRef = useMergedRef<HTMLInputElement>(ref);\n\n let handleKeyDown = onKeyDown;\n\n // home and end keys only navigate to the start/end of input value if the input container does not scroll\n // if it has scroll height then the browser reverts to native scrolling behaviour only\n // so we manually override it to ensure _our_ desired behaviour remains intact\n // only the 'text', 'search', 'url', 'tel', 'password' input types support setSelectionRange\n if (validSetSelectionRangeTypes.includes(type)) {\n handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (!event.shiftKey && (event.key === 'Home' || event.key === 'End')) {\n event.preventDefault();\n const position = event.key === 'End' ? event.currentTarget.value.length : 0;\n event.currentTarget.setSelectionRange(position, position);\n }\n\n if (typeof onKeyDown === 'function') {\n onKeyDown(event);\n }\n };\n }\n\n const prefixRef = React.useRef<HTMLSpanElement>(null);\n const prefixRect = useBoundingClientRectListener(prefixRef);\n const postfixRef = React.useRef<HTMLSpanElement>(null);\n const postfixRect = useBoundingClientRectListener(postfixRef);\n\n const className = cn(\n getInputClasses(props),\n {\n 'pl-8': !!prefix,\n 'pr-8': !!postfix,\n },\n attributes.className\n );\n\n return (\n <div className=\"relative inline-flex w-full\">\n <input\n {...attributes}\n className={className}\n data-taco=\"input\"\n onKeyDown={handleKeyDown}\n ref={internalRef}\n style={{\n paddingLeft: prefixRect ? `${prefixRect.width - 1}px` : undefined,\n paddingRight: postfixRect ? `${postfixRect.width - 1}px` : undefined,\n }}\n type={type}\n />\n {prefix ? <Affix type=\"prefix\" children={prefix} disabled={attributes.disabled} ref={prefixRef} /> : null}\n {postfix ? <Affix type=\"postfix\" children={postfix} disabled={attributes.disabled} ref={postfixRef} /> : null}\n </div>\n );\n});\n\ntype AffixProps = {\n children?: string | JSX.Element;\n disabled?: boolean;\n type: 'prefix' | 'postfix';\n};\nconst Affix = React.memo(\n React.forwardRef(function Affix(props: AffixProps, ref: React.Ref<HTMLSpanElement>) {\n const { children, disabled, type } = props;\n\n if (children) {\n return (\n <span\n className={cn(\n 'group absolute top-0 flex h-full items-center justify-center px-2',\n // icon\n '[&_[data-taco=\"icon\"]]:!h-5 [&_[data-taco=\"icon\"]]:!w-5',\n {\n 'text-grey-300': disabled,\n 'text-grey-700': !disabled,\n 'left-0 [&>button]:!-ml-2': type === 'prefix',\n 'right-0 [&>button]:!-mr-2': type === 'postfix',\n }\n )}\n ref={ref}>\n {children}\n </span>\n );\n }\n\n return null;\n })\n);\n\nexport type InputProps = InputWithoutDeprecatedFeaturesProps & {\n /** Shows a button within the input field */\n button?: React.ReactElement;\n /** Shows an icon within the input field */\n icon?: IconName | JSX.Element;\n};\n\nexport const Input = React.forwardRef(function LegacyInput(props: InputProps, ref: React.Ref<HTMLInputElement>) {\n const { button, icon, ...attributes } = props;\n\n let postfix;\n\n if (button) {\n const disabled = button.props.disabled || attributes.disabled;\n const buttonClassName = cn(\n 'items-center focus:z-10 flex justify-center border rounded-l-none rounded-r h-full focus:rounded focus:outline-none',\n {\n [getButtonStateClasses(attributes.invalid)]: !props.disabled,\n },\n button.props.className\n );\n postfix = React.cloneElement(button, {\n className: buttonClassName,\n disabled,\n });\n } else if (icon) {\n postfix = typeof icon === 'string' ? <Icon name={icon} /> : icon;\n }\n\n return <InputWithoutDeprecatedFeatures {...attributes} postfix={attributes.postfix ?? postfix} ref={ref} />;\n});\n"],"names":["validSetSelectionRangeTypes","InputWithoutDeprecatedFeatures","React","props","ref","highlighted","invalid","onKeyDown","postfix","prefix","type","attributes","internalRef","useMergedRef","handleKeyDown","includes","event","shiftKey","key","preventDefault","position","currentTarget","value","length","setSelectionRange","prefixRef","prefixRect","useBoundingClientRectListener","postfixRef","postfixRect","className","cn","getInputClasses","style","paddingLeft","width","undefined","paddingRight","Affix","children","disabled","Input","LegacyInput","button","icon","buttonClassName","getButtonStateClasses","Icon","name"],"mappings":";;;;;;;AAgBA,MAAMA,2BAA2B,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC;AAEhF,MAAMC,8BAA8B,gBAAGC,UAAgB,CAAC,SAASD,8BAA8B,CAC3FE,KAA0C,EAC1CC,GAAgC;EAEhC,MAAM;IAAEC,WAAW;IAAEC,OAAO;IAAEC,SAAS;IAAEC,OAAO;IAAEC,MAAM;IAAEC,IAAI,GAAG,MAAM;IAAE,GAAGC;GAAY,GAAGR,KAAK;EAChG,MAAMS,WAAW,GAAGC,YAAY,CAAmBT,GAAG,CAAC;EAEvD,IAAIU,aAAa,GAAGP,SAAS;;;;;EAM7B,IAAIP,2BAA2B,CAACe,QAAQ,CAACL,IAAI,CAAC,EAAE;IAC5CI,aAAa,GAAIE,KAA4C;MACzD,IAAI,CAACA,KAAK,CAACC,QAAQ,KAAKD,KAAK,CAACE,GAAG,KAAK,MAAM,IAAIF,KAAK,CAACE,GAAG,KAAK,KAAK,CAAC,EAAE;QAClEF,KAAK,CAACG,cAAc,EAAE;QACtB,MAAMC,QAAQ,GAAGJ,KAAK,CAACE,GAAG,KAAK,KAAK,GAAGF,KAAK,CAACK,aAAa,CAACC,KAAK,CAACC,MAAM,GAAG,CAAC;QAC3EP,KAAK,CAACK,aAAa,CAACG,iBAAiB,CAACJ,QAAQ,EAAEA,QAA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IAAEH,OAAO,yBAAEG,UAAU,CAACH,OAAO,qEAAIA,OAAO;IAAEJ,GAAG,EAAEA;KAAO;AAC/G,CAAC;;;;"}
|
package/dist/index.css
CHANGED
@@ -513,7 +513,7 @@
|
|
513
513
|
|
514
514
|
/* rows */
|
515
515
|
.yt-table__row {
|
516
|
-
@apply border-grey-
|
516
|
+
@apply border-grey-200 flex border-b;
|
517
517
|
min-height: 2.5rem;
|
518
518
|
}
|
519
519
|
|
@@ -545,12 +545,12 @@
|
|
545
545
|
}
|
546
546
|
|
547
547
|
.yt-table__head .yt-table__head__group .yt-table__cell.yt-table__cell__group {
|
548
|
-
@apply border-grey-
|
548
|
+
@apply border-grey-200 border-b;
|
549
549
|
flex-basis: 100%;
|
550
550
|
}
|
551
551
|
|
552
552
|
.yt-table__head .yt-table__head__group + .yt-table__head__group {
|
553
|
-
@apply border-grey-
|
553
|
+
@apply border-grey-200 border-l;
|
554
554
|
}
|
555
555
|
|
556
556
|
.yt-table__head .yt-table__cell > [data-taco='icon'] {
|
@@ -558,7 +558,7 @@
|
|
558
558
|
}
|
559
559
|
|
560
560
|
.yt-table__head .yt-table__cell.yt-table__cell__group + .yt-table__cell__group {
|
561
|
-
@apply border-grey-
|
561
|
+
@apply border-grey-200 border-l-2;
|
562
562
|
}
|
563
563
|
|
564
564
|
.yt-table.yt-table--windowed.table-with-scrollbar .yt-table__head {
|
@@ -4008,7 +4008,7 @@ const InputWithoutDeprecatedFeatures = /*#__PURE__*/React.forwardRef(function In
|
|
4008
4008
|
'pr-8': !!postfix
|
4009
4009
|
}, attributes.className);
|
4010
4010
|
return /*#__PURE__*/React.createElement("div", {
|
4011
|
-
className: "relative inline-flex"
|
4011
|
+
className: "relative inline-flex w-full"
|
4012
4012
|
}, /*#__PURE__*/React.createElement("input", Object.assign({}, attributes, {
|
4013
4013
|
className: className,
|
4014
4014
|
"data-taco": "input",
|
@@ -4037,30 +4037,18 @@ const Affix = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Af
|
|
4037
4037
|
disabled,
|
4038
4038
|
type
|
4039
4039
|
} = props;
|
4040
|
-
let displayName;
|
4041
4040
|
if (children) {
|
4042
|
-
let el = children;
|
4043
|
-
if ( /*#__PURE__*/React.isValidElement(children)) {
|
4044
|
-
var _children$type;
|
4045
|
-
displayName = children === null || children === void 0 ? void 0 : (_children$type = children.type) === null || _children$type === void 0 ? void 0 : _children$type.displayName;
|
4046
|
-
if (displayName === 'Icon') {
|
4047
|
-
el = /*#__PURE__*/React.cloneElement(children, {
|
4048
|
-
className: cn('!h-5 !w-5', children.props.className)
|
4049
|
-
});
|
4050
|
-
}
|
4051
|
-
}
|
4052
4041
|
return /*#__PURE__*/React.createElement("span", {
|
4053
|
-
className: cn('group absolute top-0 flex h-full items-center justify-center',
|
4042
|
+
className: cn('group absolute top-0 flex h-full items-center justify-center px-2',
|
4043
|
+
// icon
|
4044
|
+
'[&_[data-taco="icon"]]:!h-5 [&_[data-taco="icon"]]:!w-5', {
|
4054
4045
|
'text-grey-300': disabled,
|
4055
4046
|
'text-grey-700': !disabled,
|
4056
|
-
'left-0': type === 'prefix',
|
4057
|
-
'right-0': type === 'postfix'
|
4058
|
-
'px-0': displayName === 'IconButton',
|
4059
|
-
'px-1.5': displayName === 'Icon',
|
4060
|
-
'px-2': displayName !== 'IconButton' && displayName !== 'Icon'
|
4047
|
+
'left-0 [&>button]:!-ml-2': type === 'prefix',
|
4048
|
+
'right-0 [&>button]:!-mr-2': type === 'postfix'
|
4061
4049
|
}),
|
4062
4050
|
ref: ref
|
4063
|
-
},
|
4051
|
+
}, children);
|
4064
4052
|
}
|
4065
4053
|
return null;
|
4066
4054
|
}));
|