@razorpay/blade 12.97.1 → 12.98.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/build/lib/native/components/ActionList/ActionListItem.js +1 -0
- package/build/lib/native/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/native/components/ActionList/ActionListNoResults.js +1 -0
- package/build/lib/native/components/ActionList/ActionListNoResults.js.map +1 -1
- package/build/lib/native/components/Alert/Alert.js +1 -0
- package/build/lib/native/components/Alert/Alert.js.map +1 -1
- package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js +1 -0
- package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/native/components/BottomSheet/BottomSheetCommon.js +1 -0
- package/build/lib/native/components/BottomSheet/BottomSheetCommon.js.map +1 -1
- package/build/lib/native/components/Carousel/NavigationButton/NavigationButton.js +1 -0
- package/build/lib/native/components/Carousel/NavigationButton/NavigationButton.js.map +1 -1
- package/build/lib/native/components/Collapsible/CollapsibleChevronIcon.native.js +1 -0
- package/build/lib/native/components/Collapsible/CollapsibleChevronIcon.native.js.map +1 -1
- package/build/lib/native/components/FileUpload/FileUploadItem.js +1 -0
- package/build/lib/native/components/FileUpload/FileUploadItem.js.map +1 -1
- package/build/lib/native/components/Form/FormHint.js +1 -0
- package/build/lib/native/components/Form/FormHint.js.map +1 -1
- package/build/lib/native/components/Icons/ReticleIcon/ReticleIcon.js +13 -0
- package/build/lib/native/components/Icons/ReticleIcon/ReticleIcon.js.map +1 -0
- package/build/lib/native/components/Input/DropdownInputTriggers/Chevron.js +1 -0
- package/build/lib/native/components/Input/DropdownInputTriggers/Chevron.js.map +1 -1
- package/build/lib/native/components/Input/PasswordInput/PasswordInput.js +1 -0
- package/build/lib/native/components/Input/PasswordInput/PasswordInput.js.map +1 -1
- package/build/lib/native/components/Input/SearchInput/SearchInput.js +1 -0
- package/build/lib/native/components/Input/SearchInput/SearchInput.js.map +1 -1
- package/build/lib/native/components/Input/TextArea/TextArea.js +1 -0
- package/build/lib/native/components/Input/TextArea/TextArea.js.map +1 -1
- package/build/lib/native/components/Input/TextInput/TextInput.js +1 -0
- package/build/lib/native/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/native/components/Popover/PopoverCloseButton.js +1 -0
- package/build/lib/native/components/Popover/PopoverCloseButton.js.map +1 -1
- package/build/lib/native/components/QuickFilters/QuickFilter.js +1 -0
- package/build/lib/native/components/QuickFilters/QuickFilter.js.map +1 -1
- package/build/lib/native/components/Table/tokens.js +1 -0
- package/build/lib/native/components/Table/tokens.js.map +1 -1
- package/build/lib/native/components/Tag/Tag.js +1 -0
- package/build/lib/native/components/Tag/Tag.js.map +1 -1
- package/build/lib/native/components/index.js +1 -0
- package/build/lib/native/components/index.js.map +1 -1
- package/build/lib/web/development/_virtual/cloneDeep.js +1 -1
- package/build/lib/web/development/_virtual/cloneDeep3.js +1 -1
- package/build/lib/web/development/components/ActionList/ActionListBox.web.js +45 -21
- package/build/lib/web/development/components/ActionList/ActionListBox.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/InputDropdownButton.web.js +4 -2
- package/build/lib/web/development/components/Dropdown/InputDropdownButton.web.js.map +1 -1
- package/build/lib/web/development/components/Icons/ReticleIcon/ReticleIcon.js +42 -0
- package/build/lib/web/development/components/Icons/ReticleIcon/ReticleIcon.js.map +1 -0
- package/build/lib/web/development/components/Icons/ReticleIcon/index.js +2 -0
- package/build/lib/web/development/components/Icons/ReticleIcon/index.js.map +1 -0
- package/build/lib/web/development/components/Icons/index.js +1 -0
- package/build/lib/web/development/components/Icons/index.js.map +1 -1
- package/build/lib/web/development/components/Input/PhoneNumberInput/CountrySelector.web.js +3 -2
- package/build/lib/web/development/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -1
- package/build/lib/web/development/components/index.js +1 -0
- package/build/lib/web/development/components/index.js.map +1 -1
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +1 -1
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/predicate/matches.js +2 -2
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js +2 -2
- package/build/lib/web/development/node_modules/es-toolkit/dist/object/cloneDeep.js +1 -1
- package/build/lib/web/production/_virtual/cloneDeep.js +1 -1
- package/build/lib/web/production/_virtual/cloneDeep3.js +1 -1
- package/build/lib/web/production/components/ActionList/ActionListBox.web.js +45 -21
- package/build/lib/web/production/components/ActionList/ActionListBox.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/InputDropdownButton.web.js +4 -2
- package/build/lib/web/production/components/Dropdown/InputDropdownButton.web.js.map +1 -1
- package/build/lib/web/production/components/Icons/ReticleIcon/ReticleIcon.js +42 -0
- package/build/lib/web/production/components/Icons/ReticleIcon/ReticleIcon.js.map +1 -0
- package/build/lib/web/production/components/Icons/ReticleIcon/index.js +2 -0
- package/build/lib/web/production/components/Icons/ReticleIcon/index.js.map +1 -0
- package/build/lib/web/production/components/Icons/index.js +1 -0
- package/build/lib/web/production/components/Icons/index.js.map +1 -1
- package/build/lib/web/production/components/Input/PhoneNumberInput/CountrySelector.web.js +3 -2
- package/build/lib/web/production/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -1
- package/build/lib/web/production/components/index.js +1 -0
- package/build/lib/web/production/components/index.js.map +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/predicate/matches.js +2 -2
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js +2 -2
- package/build/lib/web/production/node_modules/es-toolkit/dist/object/cloneDeep.js +1 -1
- package/build/types/components/index.d.ts +10 -2
- package/build/types/components/index.native.d.ts +3 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUploadItem.js","sources":["../../../../../src/components/FileUpload/FileUploadItem.tsx"],"sourcesContent":["import { memo } from 'react';\nimport { StyledFileUploadItemWrapper } from './StyledFileUploadItemWrapper';\nimport type { FileUploadItemProps } from './types';\nimport { FileUploadItemIcon } from './FileUploadItemIcon';\nimport { MAKE_ANALYTICS_CONSTANTS } from '~utils/makeAnalyticsAttribute';\nimport isUndefined from '~utils/lodashButBetter/isUndefined';\nimport {\n TrashIcon,\n EyeIcon,\n CloseIcon,\n CheckCircleIcon,\n RotateClockWiseIcon,\n} from '~components/Icons';\nimport { BaseBox } from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport { Divider } from '~components/Divider';\nimport { IconButton } from '~components/Button/IconButton';\nimport { ProgressBar } from '~components/ProgressBar';\nimport { BaseLink } from '~components/Link/BaseLink';\nimport { getStyledProps } from '~components/Box/styledProps';\n\nconst FileUploadItem = memo(\n ({\n file,\n onPreview,\n onRemove,\n onReupload,\n onDismiss,\n size: containerSize,\n width,\n minWidth,\n maxWidth,\n flexShrink,\n flexGrow,\n flexBasis,\n ...rest\n }: FileUploadItemProps): React.ReactElement => {\n const { name, size, uploadPercent, errorText, status } = file;\n const isUploading = status === 'uploading';\n const sizeInKB = size / 1024;\n const sizeInMB = sizeInKB / 1024;\n const showSizeInKB = sizeInKB < 1024;\n\n return (\n <StyledFileUploadItemWrapper\n size={containerSize ?? 'medium'}\n status={status ?? 'success'}\n borderRadius=\"medium\"\n borderWidth=\"thin\"\n width={width}\n minWidth={minWidth}\n maxWidth={maxWidth}\n flexShrink={flexShrink}\n flexGrow={flexGrow}\n flexBasis={flexBasis}\n {...getStyledProps(rest)}\n >\n <BaseBox width=\"100%\" display=\"flex\" flexDirection=\"column\">\n <BaseBox\n display=\"flex\"\n flexDirection=\"row\"\n margin={\n containerSize === 'large'\n ? 'spacing.4'\n : ['spacing.3', 'spacing.4', 'spacing.3', 'spacing.3']\n }\n >\n <BaseBox marginRight=\"spacing.4\">\n <FileUploadItemIcon fileName={name} uploadStatus={status} />\n </BaseBox>\n <BaseBox flexGrow={1}>\n <BaseBox alignItems=\"center\" display=\"flex\">\n <BaseBox alignItems=\"center\" maxWidth=\"70%\" display=\"flex\" marginRight=\"spacing.3\">\n <Text\n size=\"medium\"\n weight=\"medium\"\n color=\"surface.text.gray.subtle\"\n truncateAfterLines={1}\n >\n {name}\n </Text>\n </BaseBox>\n {status === 'success' && (\n <CheckCircleIcon\n size=\"medium\"\n marginRight=\"spacing.2\"\n color=\"interactive.icon.positive.normal\"\n />\n )}\n </BaseBox>\n <Text\n size=\"small\"\n weight=\"regular\"\n color={\n status === 'error' ? 'feedback.text.negative.intense' : 'surface.text.gray.muted'\n }\n truncateAfterLines={1}\n >\n {errorText ??\n `${(showSizeInKB ? sizeInKB : sizeInMB).toFixed(2)} ${\n showSizeInKB ? 'KB' : 'MB'\n } ${isUploading && uploadPercent ? `(${uploadPercent}%)` : ''}`}\n </Text>\n </BaseBox>\n {status === 'uploading' ? (\n <BaseBox display=\"flex\" alignItems=\"center\">\n <IconButton\n accessibilityLabel=\"Remove File\"\n icon={CloseIcon}\n onClick={() => onDismiss?.({ file })}\n />\n </BaseBox>\n ) : status === 'error' ? (\n <BaseBox display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <BaseLink\n marginX=\"spacing.1\"\n variant=\"button\"\n icon={RotateClockWiseIcon}\n color=\"negative\"\n size=\"small\"\n onClick={() => {\n onReupload?.({ file });\n }}\n data-analytics-name={MAKE_ANALYTICS_CONSTANTS.FILE_UPLOAD.REUPLOAD_BUTTON}\n >\n Re-upload\n </BaseLink>\n </BaseBox>\n ) : (\n <BaseBox display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n {onPreview ? (\n <BaseBox\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"center\"\n padding=\"spacing.0\"\n gap=\"spacing.3\"\n >\n <IconButton\n accessibilityLabel=\"Preview File\"\n icon={EyeIcon}\n onClick={() => onPreview?.({ file })}\n />\n <Divider orientation=\"vertical\" thickness=\"thinner\" variant=\"normal\" />\n <IconButton\n accessibilityLabel=\"Remove File\"\n icon={TrashIcon}\n onClick={() => onRemove?.({ file })}\n />\n </BaseBox>\n ) : (\n <IconButton\n accessibilityLabel=\"Remove File\"\n icon={TrashIcon}\n onClick={() => onRemove?.({ file })}\n />\n )}\n </BaseBox>\n )}\n </BaseBox>\n {isUploading && (\n <BaseBox width=\"100%\" position=\"absolute\" bottom=\"spacing.0\">\n <ProgressBar\n left=\"spacing.0\"\n showPercentage={false}\n value={uploadPercent ?? 0}\n isIndeterminate={isUndefined(uploadPercent)}\n />\n </BaseBox>\n )}\n </BaseBox>\n </StyledFileUploadItemWrapper>\n );\n },\n);\n\nexport type { FileUploadItemProps } from './types';\nexport { FileUploadItem };\n"],"names":["FileUploadItem","memo","_ref","file","onPreview","onRemove","onReupload","onDismiss","containerSize","size","width","minWidth","maxWidth","flexShrink","flexGrow","flexBasis","rest","_objectWithoutProperties","_excluded","name","uploadPercent","errorText","status","isUploading","sizeInKB","sizeInMB","showSizeInKB","_jsx","StyledFileUploadItemWrapper","Object","assign","borderRadius","borderWidth","getStyledProps","children","_jsxs","BaseBox","display","flexDirection","margin","marginRight","FileUploadItemIcon","fileName","uploadStatus","alignItems","Text","weight","color","truncateAfterLines","CheckCircleIcon","toFixed","IconButton","accessibilityLabel","icon","CloseIcon","onClick","BaseLink","marginX","variant","RotateClockWiseIcon","MAKE_ANALYTICS_CONSTANTS","FILE_UPLOAD","REUPLOAD_BUTTON","padding","gap","EyeIcon","Divider","orientation","thickness","TrashIcon","position","bottom","ProgressBar","left","showPercentage","value","isIndeterminate","isUndefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC,CACtC,CAAC,CACFwB,GAAA,CAACuC,OAAO,CAAA,CAACC,WAAW,CAAC,UAAU,CAACC,SAAS,CAAC,SAAS,CAACV,OAAO,CAAC,QAAQ,CAAE,CAAC,CACvE/B,GAAA,CAACwB,UAAU,CACTC,CAAAA,kBAAkB,CAAC,aAAa,CAChCC,IAAI,CAAEgB,SAAU,CAChBd,OAAO,CAAE,SAATA,OAAOA,EAAA,CAAA,OAAQlD,QAAQ,EAARA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,QAAQ,CAAG,CAAEF,IAAI,CAAJA,IAAK,CAAC,CAAC,EAAC,CACrC,CAAC,CACK,CAAA,CAAC,CAEVwB,GAAA,CAACwB,UAAU,CAAA,CACTC,kBAAkB,CAAC,aAAa,CAChCC,IAAI,CAAEgB,SAAU,CAChBd,OAAO,CAAE,SAATA,OAAOA,EAAQ,CAAA,OAAAlD,QAAQ,EAAA,IAAA,CAAA,KAAA,CAAA,CAARA,QAAQ,CAAG,CAAEF,IAAI,CAAJA,IAAK,CAAC,CAAC,CAAC,CAAA,CACrC,CACF,CACM,CACV,CAAA,CACM,CAAC,CACToB,WAAW,EACVI,GAAA,CAACS,OAAO,EAAC1B,KAAK,CAAC,MAAM,CAAC4D,QAAQ,CAAC,UAAU,CAACC,MAAM,CAAC,WAAW,CAAArC,QAAA,CAC1DP,GAAA,CAAC6C,WAAW,CAAA,CACVC,IAAI,CAAC,WAAW,CAChBC,cAAc,CAAE,KAAM,CACtBC,KAAK,CAAEvD,aAAa,EAAA,IAAA,CAAbA,aAAa,CAAI,CAAE,CAC1BwD,eAAe,CAAEC,WAAW,CAACzD,aAAa,CAAE,CAC7C,CAAC,CACK,CACV,CACM,CAAA,CAAC,CACiB,CAAA,CAAC,CAElC,CACF;;;;"}
|
|
1
|
+
{"version":3,"file":"FileUploadItem.js","sources":["../../../../../src/components/FileUpload/FileUploadItem.tsx"],"sourcesContent":["import { memo } from 'react';\nimport { StyledFileUploadItemWrapper } from './StyledFileUploadItemWrapper';\nimport type { FileUploadItemProps } from './types';\nimport { FileUploadItemIcon } from './FileUploadItemIcon';\nimport { MAKE_ANALYTICS_CONSTANTS } from '~utils/makeAnalyticsAttribute';\nimport isUndefined from '~utils/lodashButBetter/isUndefined';\nimport {\n TrashIcon,\n EyeIcon,\n CloseIcon,\n CheckCircleIcon,\n RotateClockWiseIcon,\n} from '~components/Icons';\nimport { BaseBox } from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport { Divider } from '~components/Divider';\nimport { IconButton } from '~components/Button/IconButton';\nimport { ProgressBar } from '~components/ProgressBar';\nimport { BaseLink } from '~components/Link/BaseLink';\nimport { getStyledProps } from '~components/Box/styledProps';\n\nconst FileUploadItem = memo(\n ({\n file,\n onPreview,\n onRemove,\n onReupload,\n onDismiss,\n size: containerSize,\n width,\n minWidth,\n maxWidth,\n flexShrink,\n flexGrow,\n flexBasis,\n ...rest\n }: FileUploadItemProps): React.ReactElement => {\n const { name, size, uploadPercent, errorText, status } = file;\n const isUploading = status === 'uploading';\n const sizeInKB = size / 1024;\n const sizeInMB = sizeInKB / 1024;\n const showSizeInKB = sizeInKB < 1024;\n\n return (\n <StyledFileUploadItemWrapper\n size={containerSize ?? 'medium'}\n status={status ?? 'success'}\n borderRadius=\"medium\"\n borderWidth=\"thin\"\n width={width}\n minWidth={minWidth}\n maxWidth={maxWidth}\n flexShrink={flexShrink}\n flexGrow={flexGrow}\n flexBasis={flexBasis}\n {...getStyledProps(rest)}\n >\n <BaseBox width=\"100%\" display=\"flex\" flexDirection=\"column\">\n <BaseBox\n display=\"flex\"\n flexDirection=\"row\"\n margin={\n containerSize === 'large'\n ? 'spacing.4'\n : ['spacing.3', 'spacing.4', 'spacing.3', 'spacing.3']\n }\n >\n <BaseBox marginRight=\"spacing.4\">\n <FileUploadItemIcon fileName={name} uploadStatus={status} />\n </BaseBox>\n <BaseBox flexGrow={1}>\n <BaseBox alignItems=\"center\" display=\"flex\">\n <BaseBox alignItems=\"center\" maxWidth=\"70%\" display=\"flex\" marginRight=\"spacing.3\">\n <Text\n size=\"medium\"\n weight=\"medium\"\n color=\"surface.text.gray.subtle\"\n truncateAfterLines={1}\n >\n {name}\n </Text>\n </BaseBox>\n {status === 'success' && (\n <CheckCircleIcon\n size=\"medium\"\n marginRight=\"spacing.2\"\n color=\"interactive.icon.positive.normal\"\n />\n )}\n </BaseBox>\n <Text\n size=\"small\"\n weight=\"regular\"\n color={\n status === 'error' ? 'feedback.text.negative.intense' : 'surface.text.gray.muted'\n }\n truncateAfterLines={1}\n >\n {errorText ??\n `${(showSizeInKB ? sizeInKB : sizeInMB).toFixed(2)} ${\n showSizeInKB ? 'KB' : 'MB'\n } ${isUploading && uploadPercent ? `(${uploadPercent}%)` : ''}`}\n </Text>\n </BaseBox>\n {status === 'uploading' ? (\n <BaseBox display=\"flex\" alignItems=\"center\">\n <IconButton\n accessibilityLabel=\"Remove File\"\n icon={CloseIcon}\n onClick={() => onDismiss?.({ file })}\n />\n </BaseBox>\n ) : status === 'error' ? (\n <BaseBox display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <BaseLink\n marginX=\"spacing.1\"\n variant=\"button\"\n icon={RotateClockWiseIcon}\n color=\"negative\"\n size=\"small\"\n onClick={() => {\n onReupload?.({ file });\n }}\n data-analytics-name={MAKE_ANALYTICS_CONSTANTS.FILE_UPLOAD.REUPLOAD_BUTTON}\n >\n Re-upload\n </BaseLink>\n </BaseBox>\n ) : (\n <BaseBox display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n {onPreview ? (\n <BaseBox\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"center\"\n padding=\"spacing.0\"\n gap=\"spacing.3\"\n >\n <IconButton\n accessibilityLabel=\"Preview File\"\n icon={EyeIcon}\n onClick={() => onPreview?.({ file })}\n />\n <Divider orientation=\"vertical\" thickness=\"thinner\" variant=\"normal\" />\n <IconButton\n accessibilityLabel=\"Remove File\"\n icon={TrashIcon}\n onClick={() => onRemove?.({ file })}\n />\n </BaseBox>\n ) : (\n <IconButton\n accessibilityLabel=\"Remove File\"\n icon={TrashIcon}\n onClick={() => onRemove?.({ file })}\n />\n )}\n </BaseBox>\n )}\n </BaseBox>\n {isUploading && (\n <BaseBox width=\"100%\" position=\"absolute\" bottom=\"spacing.0\">\n <ProgressBar\n left=\"spacing.0\"\n showPercentage={false}\n value={uploadPercent ?? 0}\n isIndeterminate={isUndefined(uploadPercent)}\n />\n </BaseBox>\n )}\n </BaseBox>\n </StyledFileUploadItemWrapper>\n );\n },\n);\n\nexport type { FileUploadItemProps } from './types';\nexport { FileUploadItem };\n"],"names":["FileUploadItem","memo","_ref","file","onPreview","onRemove","onReupload","onDismiss","containerSize","size","width","minWidth","maxWidth","flexShrink","flexGrow","flexBasis","rest","_objectWithoutProperties","_excluded","name","uploadPercent","errorText","status","isUploading","sizeInKB","sizeInMB","showSizeInKB","_jsx","StyledFileUploadItemWrapper","Object","assign","borderRadius","borderWidth","getStyledProps","children","_jsxs","BaseBox","display","flexDirection","margin","marginRight","FileUploadItemIcon","fileName","uploadStatus","alignItems","Text","weight","color","truncateAfterLines","CheckCircleIcon","toFixed","IconButton","accessibilityLabel","icon","CloseIcon","onClick","BaseLink","marginX","variant","RotateClockWiseIcon","MAKE_ANALYTICS_CONSTANTS","FILE_UPLOAD","REUPLOAD_BUTTON","padding","gap","EyeIcon","Divider","orientation","thickness","TrashIcon","position","bottom","ProgressBar","left","showPercentage","value","isIndeterminate","isUndefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AO,CAAA,CAACC,WAAW,CAAC,UAAU,CAACC,SAAS,CAAC,SAAS,CAACV,OAAO,CAAC,QAAQ,CAAE,CAAC,CACvE/B,GAAA,CAACwB,UAAU,CACTC,CAAAA,kBAAkB,CAAC,aAAa,CAChCC,IAAI,CAAEgB,SAAU,CAChBd,OAAO,CAAE,SAATA,OAAOA,EAAA,CAAA,OAAQlD,QAAQ,EAARA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,QAAQ,CAAG,CAAEF,IAAI,CAAJA,IAAK,CAAC,CAAC,EAAC,CACrC,CAAC,CACK,CAAA,CAAC,CAEVwB,GAAA,CAACwB,UAAU,CAAA,CACTC,kBAAkB,CAAC,aAAa,CAChCC,IAAI,CAAEgB,SAAU,CAChBd,OAAO,CAAE,SAATA,OAAOA,EAAQ,CAAA,OAAAlD,QAAQ,EAAA,IAAA,CAAA,KAAA,CAAA,CAARA,QAAQ,CAAG,CAAEF,IAAI,CAAJA,IAAK,CAAC,CAAC,CAAC,CAAA,CACrC,CACF,CACM,CACV,CAAA,CACM,CAAC,CACToB,WAAW,EACVI,GAAA,CAACS,OAAO,EAAC1B,KAAK,CAAC,MAAM,CAAC4D,QAAQ,CAAC,UAAU,CAACC,MAAM,CAAC,WAAW,CAAArC,QAAA,CAC1DP,GAAA,CAAC6C,WAAW,CAAA,CACVC,IAAI,CAAC,WAAW,CAChBC,cAAc,CAAE,KAAM,CACtBC,KAAK,CAAEvD,aAAa,EAAA,IAAA,CAAbA,aAAa,CAAI,CAAE,CAC1BwD,eAAe,CAAEC,WAAW,CAACzD,aAAa,CAAE,CAC7C,CAAC,CACK,CACV,CACM,CAAA,CAAC,CACiB,CAAA,CAAC,CAElC,CACF;;;;"}
|
|
@@ -321,6 +321,7 @@ import '../Icons/RefreshIcon/RefreshIcon.js';
|
|
|
321
321
|
import '../Icons/RepeatIcon/RepeatIcon.js';
|
|
322
322
|
import '../Icons/ReportsIcon/ReportsIcon.js';
|
|
323
323
|
import '../Icons/ResizerIcon/ResizerIcon.js';
|
|
324
|
+
import '../Icons/ReticleIcon/ReticleIcon.js';
|
|
324
325
|
import '../Icons/RewindIcon/RewindIcon.js';
|
|
325
326
|
import '../Icons/RotateClockWiseIcon/RotateClockWiseIcon.js';
|
|
326
327
|
import '../Icons/RotateCounterClockWiseIcon/RotateCounterClockWiseIcon.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormHint.js","sources":["../../../../../src/components/Form/FormHint.tsx"],"sourcesContent":["/* eslint-disable react/display-name */\nimport type { ReactElement } from 'react';\nimport React from 'react';\nimport { FormHintWrapper } from './FormHintWrapper';\nimport { hintIconSize, hintMarginTop, hintTextSize } from './formTokens';\nimport type { TextProps } from '~components/Typography/Text';\nimport { Text } from '~components/Typography/Text';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { IconComponent } from '~components/Icons';\nimport { CheckIcon, InfoIcon } from '~components/Icons';\nimport { getPlatformType } from '~utils/getPlatformType';\nimport { Box } from '~components/Box';\n\ntype HintTextProps = {\n icon?: IconComponent;\n children: string;\n id?: string;\n color: TextProps<{ variant: 'caption' }>['color'];\n size: 'xsmall' | 'small' | 'medium' | 'large';\n};\n\nconst HintText = ({ icon: Icon, children, id, color, size }: HintTextProps): ReactElement => {\n const isReactNative = getPlatformType() === 'react-native';\n\n return (\n <BaseBox marginTop={hintMarginTop[size]} id={id}>\n <FormHintWrapper>\n {Icon ? (\n // offset block element 2px down to align with text\n <Box flexShrink={0} marginTop=\"spacing.1\">\n <Icon />\n </Box>\n ) : null}\n <Text\n as={isReactNative ? undefined : 'span'}\n color={color}\n size={hintTextSize[size]}\n variant=\"caption\"\n wordBreak=\"break-word\"\n marginTop={size === 'large' && Icon ? 'spacing.1' : 'spacing.0'}\n >\n {children}\n </Text>\n </FormHintWrapper>\n </BaseBox>\n );\n};\n\nexport type FormHintProps = {\n type: 'help' | 'error' | 'success';\n /**\n * Help text for the group\n */\n helpText?: string;\n /**\n * Error text for the group\n *\n * Renders when `state` is set to 'error'\n */\n errorText?: string;\n /**\n * Success text for the group\n *\n * Renders when `state` is set to 'success'\n */\n successText?: string;\n /**\n * Sets the id on errorText.\n * Needed for accessibility reasons.\n */\n errorTextId?: string;\n /**\n * Sets the id on helpText.\n * Needed for accessibility reasons.\n */\n helpTextId?: string;\n /**\n * Sets the id on successText.\n * Needed for accessibility reasons.\n */\n successTextId?: string;\n /**\n * Sets the size of the hint\n * @default medium\n */\n size?: 'xsmall' | 'small' | 'medium' | 'large';\n};\n\nconst Icons = {\n error: ({ size }: { size: 'xsmall' | 'small' | 'medium' | 'large' }): ReactElement => (\n <InfoIcon\n display={'block' as never}\n color=\"feedback.icon.negative.intense\"\n size={hintIconSize[size]}\n />\n ),\n success: ({ size }: { size: 'xsmall' | 'small' | 'medium' | 'large' }): ReactElement => (\n <CheckIcon\n display={'block' as never}\n color=\"feedback.icon.positive.intense\"\n size={hintIconSize[size]}\n />\n ),\n};\n\nconst FormHint = ({\n type,\n helpText,\n errorText,\n successText,\n helpTextId,\n errorTextId,\n successTextId,\n size = 'medium',\n}: FormHintProps): React.ReactElement => {\n const colors: Record<string, TextProps<{ variant: 'caption' }>['color']> = {\n help: 'surface.text.gray.muted',\n error: 'feedback.text.negative.intense',\n success: 'feedback.text.positive.intense',\n };\n\n const showError = type === 'error' && errorText;\n const showSuccess = type === 'success' && successText;\n const showHelp = !showError && !showSuccess && helpText;\n\n return (\n <>\n {showHelp && (\n <HintText size={size} id={helpTextId} color={colors.help}>\n {helpText}\n </HintText>\n )}\n\n {showError && (\n <HintText\n size={size}\n id={errorTextId}\n icon={() => Icons.error({ size })}\n color={colors.error}\n >\n {errorText}\n </HintText>\n )}\n\n {showSuccess && (\n <HintText\n size={size}\n id={successTextId}\n icon={() => Icons.success({ size })}\n color={colors.success}\n >\n {successText}\n </HintText>\n )}\n </>\n );\n};\n\nexport { FormHint };\n"],"names":["HintText","_ref","Icon","icon","children","id","color","size","isReactNative","getPlatformType","_jsx","BaseBox","marginTop","hintMarginTop","_jsxs","FormHintWrapper","Box","flexShrink","Text","as","undefined","hintTextSize","variant","wordBreak","Icons","error","_ref2","InfoIcon","display","hintIconSize","success","_ref3","CheckIcon","FormHint","_ref4","type","helpText","errorText","successText","helpTextId","errorTextId","successTextId","_ref4$size","colors","help","showError","showSuccess","showHelp","_Fragment"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FormHint.js","sources":["../../../../../src/components/Form/FormHint.tsx"],"sourcesContent":["/* eslint-disable react/display-name */\nimport type { ReactElement } from 'react';\nimport React from 'react';\nimport { FormHintWrapper } from './FormHintWrapper';\nimport { hintIconSize, hintMarginTop, hintTextSize } from './formTokens';\nimport type { TextProps } from '~components/Typography/Text';\nimport { Text } from '~components/Typography/Text';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { IconComponent } from '~components/Icons';\nimport { CheckIcon, InfoIcon } from '~components/Icons';\nimport { getPlatformType } from '~utils/getPlatformType';\nimport { Box } from '~components/Box';\n\ntype HintTextProps = {\n icon?: IconComponent;\n children: string;\n id?: string;\n color: TextProps<{ variant: 'caption' }>['color'];\n size: 'xsmall' | 'small' | 'medium' | 'large';\n};\n\nconst HintText = ({ icon: Icon, children, id, color, size }: HintTextProps): ReactElement => {\n const isReactNative = getPlatformType() === 'react-native';\n\n return (\n <BaseBox marginTop={hintMarginTop[size]} id={id}>\n <FormHintWrapper>\n {Icon ? (\n // offset block element 2px down to align with text\n <Box flexShrink={0} marginTop=\"spacing.1\">\n <Icon />\n </Box>\n ) : null}\n <Text\n as={isReactNative ? undefined : 'span'}\n color={color}\n size={hintTextSize[size]}\n variant=\"caption\"\n wordBreak=\"break-word\"\n marginTop={size === 'large' && Icon ? 'spacing.1' : 'spacing.0'}\n >\n {children}\n </Text>\n </FormHintWrapper>\n </BaseBox>\n );\n};\n\nexport type FormHintProps = {\n type: 'help' | 'error' | 'success';\n /**\n * Help text for the group\n */\n helpText?: string;\n /**\n * Error text for the group\n *\n * Renders when `state` is set to 'error'\n */\n errorText?: string;\n /**\n * Success text for the group\n *\n * Renders when `state` is set to 'success'\n */\n successText?: string;\n /**\n * Sets the id on errorText.\n * Needed for accessibility reasons.\n */\n errorTextId?: string;\n /**\n * Sets the id on helpText.\n * Needed for accessibility reasons.\n */\n helpTextId?: string;\n /**\n * Sets the id on successText.\n * Needed for accessibility reasons.\n */\n successTextId?: string;\n /**\n * Sets the size of the hint\n * @default medium\n */\n size?: 'xsmall' | 'small' | 'medium' | 'large';\n};\n\nconst Icons = {\n error: ({ size }: { size: 'xsmall' | 'small' | 'medium' | 'large' }): ReactElement => (\n <InfoIcon\n display={'block' as never}\n color=\"feedback.icon.negative.intense\"\n size={hintIconSize[size]}\n />\n ),\n success: ({ size }: { size: 'xsmall' | 'small' | 'medium' | 'large' }): ReactElement => (\n <CheckIcon\n display={'block' as never}\n color=\"feedback.icon.positive.intense\"\n size={hintIconSize[size]}\n />\n ),\n};\n\nconst FormHint = ({\n type,\n helpText,\n errorText,\n successText,\n helpTextId,\n errorTextId,\n successTextId,\n size = 'medium',\n}: FormHintProps): React.ReactElement => {\n const colors: Record<string, TextProps<{ variant: 'caption' }>['color']> = {\n help: 'surface.text.gray.muted',\n error: 'feedback.text.negative.intense',\n success: 'feedback.text.positive.intense',\n };\n\n const showError = type === 'error' && errorText;\n const showSuccess = type === 'success' && successText;\n const showHelp = !showError && !showSuccess && helpText;\n\n return (\n <>\n {showHelp && (\n <HintText size={size} id={helpTextId} color={colors.help}>\n {helpText}\n </HintText>\n )}\n\n {showError && (\n <HintText\n size={size}\n id={errorTextId}\n icon={() => Icons.error({ size })}\n color={colors.error}\n >\n {errorText}\n </HintText>\n )}\n\n {showSuccess && (\n <HintText\n size={size}\n id={successTextId}\n icon={() => Icons.success({ size })}\n color={colors.success}\n >\n {successText}\n </HintText>\n )}\n </>\n );\n};\n\nexport { FormHint };\n"],"names":["HintText","_ref","Icon","icon","children","id","color","size","isReactNative","getPlatformType","_jsx","BaseBox","marginTop","hintMarginTop","_jsxs","FormHintWrapper","Box","flexShrink","Text","as","undefined","hintTextSize","variant","wordBreak","Icons","error","_ref2","InfoIcon","display","hintIconSize","success","_ref3","CheckIcon","FormHint","_ref4","type","helpText","errorText","successText","helpTextId","errorTextId","successTextId","_ref4$size","colors","help","showError","showSuccess","showHelp","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAMA,QAAQ,CAAG,SAAXA,QAAQA,CAAAC,IAAA,CAA+E,CAAnE,IAAAC,IAAI,CAAAD,IAAA,CAAVE,IAAI,CAAQC,QAAQ,CAAAH,IAAA,CAARG,QAAQ,CAAEC,EAAE,CAAAJ,IAAA,CAAFI,EAAE,CAAEC,KAAK,CAAAL,IAAA,CAALK,KAAK,CAAEC,IAAI,CAAAN,IAAA,CAAJM,IAAI,CACvD,IAAMC,aAAa,CAAGC,eAAe,EAAE,GAAK,cAAc,CAE1D,OACEC,GAAA,CAACC,OAAO,CAAA,CAACC,SAAS,CAAEC,aAAa,CAACN,IAAI,CAAE,CAACF,EAAE,CAAEA,EAAG,CAAAD,QAAA,CAC9CU,IAAA,CAACC,eAAe,CAAA,CAAAX,QAAA,CAAA,CACbF,IAAI,CAEHQ,G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CAAEoC,aAAc,CAClBtC,IAAI,CAAE,SAANA,IAAIA,EAAA,CAAA,OAAQqB,KAAK,CAACM,OAAO,CAAC,CAAEvB,IAAI,CAAJA,IAAK,CAAC,CAAC,CAAA,CAAC,CACpCD,KAAK,CAAEqC,MAAM,CAACb,OAAQ,CAAA1B,QAAA,CAErBkC,WAAW,CACJ,CACX,CAAA,CACD,CAAC,CAEP;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
2
|
+
import 'react-native-svg';
|
|
3
|
+
import '@babel/runtime/helpers/defineProperty';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
import Path from '../_Svg/Path/Path.native.js';
|
|
6
|
+
import Svg from '../_Svg/Svg/Svg.native.js';
|
|
7
|
+
import useIconProps from '../useIconProps/useIconProps.js';
|
|
8
|
+
import { assignWithoutSideEffects } from '../../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
9
|
+
|
|
10
|
+
var _excluded=["size","color"];var _ReticleIcon=function _ReticleIcon(_ref){var size=_ref.size,color=_ref.color,styledProps=_objectWithoutProperties(_ref,_excluded);var _useIconProps=useIconProps({size:size,color:color}),height=_useIconProps.height,width=_useIconProps.width,iconColor=_useIconProps.iconColor;return jsx(Svg,Object.assign({},styledProps,{width:width,height:height,viewBox:"0 0 24 24",fill:"none",children:jsx(Path,{d:"M13.0254 23H10.9629V13.8789H13.0254V23ZM10.1211 13.0332H1V10.9707H10.1211V13.0332ZM23.001 13.0332H13.8799V10.9707H23.001V13.0332ZM13.0254 10.1211H10.9629V1H13.0254V10.1211Z",fill:iconColor})}));};var ReticleIcon=assignWithoutSideEffects(_ReticleIcon,{componentId:'ReticleIcon'});
|
|
11
|
+
|
|
12
|
+
export { ReticleIcon as default };
|
|
13
|
+
//# sourceMappingURL=ReticleIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReticleIcon.js","sources":["../../../../../../src/components/Icons/ReticleIcon/ReticleIcon.tsx"],"sourcesContent":["import { Svg, Path } from '../_Svg';\nimport type { IconComponent } from '..';\nimport useIconProps from '../useIconProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\n\nconst _ReticleIcon: IconComponent = ({ size, color, ...styledProps }) => {\n const { height, width, iconColor } = useIconProps({ size, color });\n\n return (\n <Svg {...styledProps} width={width} height={height} viewBox=\"0 0 24 24\" fill=\"none\">\n <Path\n d=\"M13.0254 23H10.9629V13.8789H13.0254V23ZM10.1211 13.0332H1V10.9707H10.1211V13.0332ZM23.001 13.0332H13.8799V10.9707H23.001V13.0332ZM13.0254 10.1211H10.9629V1H13.0254V10.1211Z\"\n fill={iconColor}\n />\n </Svg>\n );\n};\n\nconst ReticleIcon = assignWithoutSideEffects(_ReticleIcon, {\n componentId: 'ReticleIcon',\n});\n\nexport default ReticleIcon;\n"],"names":["_ReticleIcon","_ref","size","color","styledProps","_objectWithoutProperties","_excluded","_useIconProps","useIconProps","height","width","iconColor","_jsx","Svg","Object","assign","viewBox","fill","children","Path","d","ReticleIcon","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,MAAA,CAAA,OAAA,CAAA,CAKA,IAAMA,YAA2B,CAAG,SAA9BA,YAA2BA,CAAAC,IAAA,CAAwC,CAAA,IAAlCC,IAAI,CAAAD,IAAA,CAAJC,IAAI,CAAEC,KAAK,CAAAF,IAAA,CAALE,KAAK,CAAKC,WAAW,CAAAC,wBAAA,CAAAJ,IAAA,CAAAK,SAAA,CAChE,CAAA,IAAAC,aAAA,CAAqCC,YAAY,CAAC,CAAEN,IAAI,CAAJA,IAAI,CAAEC,KAAK,CAALA,KAAM,CAAC,CAAC,CAA1DM,MAAM,CAAAF,aAAA,CAANE,MAAM,CAAEC,KAAK,CAAAH,aAAA,CAALG,KAAK,CAAEC,SAAS,CAAAJ,aAAA,CAATI,SAAS,CAEhC,OACEC,GAAA,CAACC,GAAG,CAAAC,MAAA,CAAAC,MAAA,CAAA,EAAA,CAAKX,WAAW,CAAA,CAAEM,KAAK,CAAEA,KAAM,CAACD,MAAM,CAAEA,MAAO,CAACO,OAAO,CAAC,WAAW,CAACC,IAAI,CAAC,MAAM,CAAAC,QAAA,CACjFN,GAAA,CAACO,IAAI,CACHC,CAAAA,CAAC,CAAC,8KAA8K,CAChLH,IAAI,CAAEN,SAAU,CACjB,CAAC,CACC,CAAA,CAAC,CAEV,CAAC,CAEK,IAAAU,WAAW,CAAGC,wBAAwB,CAACtB,YAAY,CAAE,CACzDuB,WAAW,CAAE,aACf,CAAC;;;;"}
|
|
@@ -317,6 +317,7 @@ import '../../Icons/RefreshIcon/RefreshIcon.js';
|
|
|
317
317
|
import '../../Icons/RepeatIcon/RepeatIcon.js';
|
|
318
318
|
import '../../Icons/ReportsIcon/ReportsIcon.js';
|
|
319
319
|
import '../../Icons/ResizerIcon/ResizerIcon.js';
|
|
320
|
+
import '../../Icons/ReticleIcon/ReticleIcon.js';
|
|
320
321
|
import '../../Icons/RewindIcon/RewindIcon.js';
|
|
321
322
|
import '../../Icons/RotateClockWiseIcon/RotateClockWiseIcon.js';
|
|
322
323
|
import '../../Icons/RotateCounterClockWiseIcon/RotateCounterClockWiseIcon.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chevron.js","sources":["../../../../../../src/components/Input/DropdownInputTriggers/Chevron.tsx"],"sourcesContent":["import React from 'react';\nimport { ChevronDownIcon, ChevronUpIcon } from '~components/Icons';\n\nconst Chevron = (props: { isOpen?: boolean; isDisabled?: boolean }): React.ReactElement => {\n const iconColor = `surface.icon.gray.${props.isDisabled ? 'disabled' : 'muted'}` as const;\n\n return (\n <>\n <ChevronDownIcon display={props.isOpen ? 'none' : 'flex'} size=\"medium\" color={iconColor} />\n <ChevronUpIcon display={props.isOpen ? 'flex' : 'none'} size=\"medium\" color={iconColor} />\n </>\n );\n};\n\nexport { Chevron };\n"],"names":["Chevron","props","iconColor","isDisabled","_jsxs","_Fragment","children","_jsx","ChevronDownIcon","display","isOpen","size","color","ChevronUpIcon"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Chevron.js","sources":["../../../../../../src/components/Input/DropdownInputTriggers/Chevron.tsx"],"sourcesContent":["import React from 'react';\nimport { ChevronDownIcon, ChevronUpIcon } from '~components/Icons';\n\nconst Chevron = (props: { isOpen?: boolean; isDisabled?: boolean }): React.ReactElement => {\n const iconColor = `surface.icon.gray.${props.isDisabled ? 'disabled' : 'muted'}` as const;\n\n return (\n <>\n <ChevronDownIcon display={props.isOpen ? 'none' : 'flex'} size=\"medium\" color={iconColor} />\n <ChevronUpIcon display={props.isOpen ? 'flex' : 'none'} size=\"medium\" color={iconColor} />\n </>\n );\n};\n\nexport { Chevron };\n"],"names":["Chevron","props","iconColor","isDisabled","_jsxs","_Fragment","children","_jsx","ChevronDownIcon","display","isOpen","size","color","ChevronUpIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGM,IAAAA,OAAO,CAAG,SAAVA,OAAOA,CAAIC,KAAiD,CAAyB,CACzF,IAAMC,SAAS,CAAG,CAAqBD,kBAAAA,EAAAA,KAAK,CAACE,UAAU,CAAG,UAAU,CAAG,OAAO,CAAA,CAAW,CAEzF,OACEC,IAAA,CAAAC,QAAA,CAAA,CAAAC,QAAA,CACEC,CAAAA,GAAA,CAACC,eAAe,CAACC,CAAAA,OAAO,CAAER,KAAK,CAACS,MAAM,CAAG,MAAM,CAAG,MAAO,CAACC,IAAI,CAAC,QAAQ,CAACC,KAAK,CAAEV,SAAU,CAAE,CAAC,CAC5FK,GAAA,CAACM,aAAa,CAACJ,CAAAA,OAAO,CAAER,KAAK,CAACS,MAAM,CAAG,MAAM,CAAG,MAAO,CAACC,IAAI,CAAC,QAAQ,CAACC,KAAK,CAAEV,SAAU,CAAE,CAAC,CAC1F,CAAA,CAAC,CAEP;;;;"}
|
|
@@ -320,6 +320,7 @@ import '../../Icons/RefreshIcon/RefreshIcon.js';
|
|
|
320
320
|
import '../../Icons/RepeatIcon/RepeatIcon.js';
|
|
321
321
|
import '../../Icons/ReportsIcon/ReportsIcon.js';
|
|
322
322
|
import '../../Icons/ResizerIcon/ResizerIcon.js';
|
|
323
|
+
import '../../Icons/ReticleIcon/ReticleIcon.js';
|
|
323
324
|
import '../../Icons/RewindIcon/RewindIcon.js';
|
|
324
325
|
import '../../Icons/RotateClockWiseIcon/RotateClockWiseIcon.js';
|
|
325
326
|
import '../../Icons/RotateCounterClockWiseIcon/RotateCounterClockWiseIcon.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordInput.js","sources":["../../../../../../src/components/Input/PasswordInput/PasswordInput.tsx"],"sourcesContent":["import React from 'react';\nimport type { BaseInputProps } from '../BaseInput';\nimport { BaseInput } from '../BaseInput';\nimport { EyeIcon, EyeOffIcon } from '~components/Icons';\nimport BaseBox from '~components/Box/BaseBox';\nimport { CharacterCounter } from '~components/Form/CharacterCounter';\nimport { IconButton } from '~components/Button/IconButton';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport type { DataAnalyticsAttribute, BladeElementRef } from '~utils/types';\n\ntype PasswordInputExtraProps = {\n /**\n * Shows a reveal button to toggle password visibility\n *\n * @default true\n */\n showRevealButton?: boolean;\n\n /**\n * Displays asterisk (`*`) when `isRequired` is enabled\n *\n * @default none\n */\n necessityIndicator?: Exclude<BaseInputProps['necessityIndicator'], 'optional'>;\n\n /**\n * Determines what autoComplete suggestion type to show. Defaults to using platform heuristics.\n *\n * It's not recommended to turn this off in favor of safe password practices.\n * Providing `password` or `newPassword` is more informative to the platform for browser autofill or password managers.\n *\n * **Note**: Using `newPassword` on iOS has some [known issue](https://github.com/facebook/react-native/issues/21911) on React Native\n *\n * Internally it'll render platform specific attributes:\n *\n * - web: `autocomplete`\n * - iOS: `textContentType`\n * - android: `autoComplete`\n *\n */\n autoCompleteSuggestionType?: Extract<\n BaseInputProps['autoCompleteSuggestionType'],\n 'none' | 'password' | 'newPassword'\n >;\n};\n\ntype PasswordInputCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\n | 'labelSuffix'\n | 'labelTrailing'\n | 'maxCharacters'\n | 'validationState'\n | 'errorText'\n | 'successText'\n | 'helpText'\n | 'isDisabled'\n | 'defaultValue'\n | 'placeholder'\n | 'isRequired'\n | 'value'\n | 'onChange'\n | 'onBlur'\n | 'onSubmit'\n | 'onFocus'\n | 'name'\n | 'autoFocus'\n | 'keyboardReturnKeyType'\n | 'autoCompleteSuggestionType'\n | 'testID'\n | 'size'\n | keyof DataAnalyticsAttribute\n> &\n PasswordInputExtraProps &\n StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype PasswordInputPropsWithA11yLabel = {\n /**\n * Label to be shown for the input field\n */\n label?: undefined;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel: string;\n};\n\n/*\n Optional accessibilityLabel prop when label is provided\n*/\ntype PasswordInputPropsWithLabel = {\n /**\n * Label to be shown for the input field\n */\n label: string;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel?: string;\n};\n\ntype PasswordInputProps = (PasswordInputPropsWithA11yLabel | PasswordInputPropsWithLabel) &\n PasswordInputCommonProps;\n\nconst _PasswordInput: React.ForwardRefRenderFunction<BladeElementRef, PasswordInputProps> = (\n {\n label,\n accessibilityLabel,\n labelPosition = 'top',\n showRevealButton = true,\n maxCharacters,\n validationState,\n errorText,\n successText,\n helpText,\n isDisabled = false,\n defaultValue,\n placeholder,\n isRequired = false,\n necessityIndicator = 'none',\n value,\n onChange,\n onFocus,\n onBlur,\n onSubmit,\n name,\n autoFocus = false,\n keyboardReturnKeyType = 'done',\n autoCompleteSuggestionType,\n testID,\n size = 'medium',\n labelSuffix,\n labelTrailing,\n ...rest\n },\n ref,\n) => {\n const [isRevealed, setIsRevealed] = React.useState(false);\n const isEnabled = !isDisabled;\n\n // If input is disabled reveal button shouldn't be present and input should be masked\n const isRevealedAndEnabled = isRevealed && isEnabled;\n\n const toggleIsRevealed = (): void => setIsRevealed((revealed) => !revealed);\n const iconAccessibilityLabel = isRevealedAndEnabled ? 'Hide password' : 'Show password';\n const type = isRevealedAndEnabled ? 'text' : 'password';\n\n const revealButtonIcon = isRevealedAndEnabled ? EyeOffIcon : EyeIcon;\n const revealButton =\n showRevealButton && !isDisabled ? (\n <IconButton\n size=\"medium\"\n icon={revealButtonIcon}\n onClick={toggleIsRevealed}\n accessibilityLabel={iconAccessibilityLabel}\n />\n ) : null;\n\n const trailingFooterSlot = (value?: string): React.ReactNode =>\n maxCharacters ? (\n <BaseBox marginTop=\"spacing.2\" marginRight=\"spacing.1\">\n <CharacterCounter currentCount={value?.length ?? 0} maxCount={maxCharacters} />\n </BaseBox>\n ) : null;\n\n return (\n <BaseInput\n ref={ref}\n componentName={MetaConstants.PasswordInput}\n id=\"password-field\"\n label={label as string}\n accessibilityLabel={accessibilityLabel}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\n type={type}\n labelSuffix={labelSuffix}\n labelTrailing={labelTrailing}\n trailingInteractionElement={revealButton}\n trailingFooterSlot={trailingFooterSlot}\n maxCharacters={maxCharacters}\n validationState={validationState}\n errorText={errorText}\n successText={successText}\n helpText={helpText}\n isDisabled={isDisabled}\n defaultValue={defaultValue}\n placeholder={placeholder}\n isRequired={isRequired}\n necessityIndicator={necessityIndicator}\n value={value}\n onChange={onChange}\n onBlur={onBlur}\n onSubmit={onSubmit}\n onFocus={onFocus}\n name={name}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n autoCompleteSuggestionType={autoCompleteSuggestionType}\n keyboardReturnKeyType={keyboardReturnKeyType}\n autoCapitalize=\"none\"\n testID={testID}\n size={size}\n {...rest}\n />\n );\n};\n\n// nosemgrep\nconst PasswordInput = assignWithoutSideEffects(React.forwardRef(_PasswordInput), {\n displayName: 'PasswordInput',\n});\n\nexport type { PasswordInputProps };\nexport { PasswordInput };\n"],"names":["_PasswordInput","_ref","ref","label","accessibilityLabel","_ref$labelPosition","labelPosition","_ref$showRevealButton","showRevealButton","maxCharacters","validationState","errorText","successText","helpText","_ref$isDisabled","isDisabled","defaultValue","placeholder","_ref$isRequired","isRequired","_ref$necessityIndicat","necessityIndicator","value","onChange","onFocus","onBlur","onSubmit","name","_ref$autoFocus","autoFocus","_ref$keyboardReturnKe","keyboardReturnKeyType","autoCompleteSuggestionType","testID","_ref$size","size","labelSuffix","labelTrailing","rest","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","isRevealed","setIsRevealed","isEnabled","isRevealedAndEnabled","toggleIsRevealed","revealed","iconAccessibilityLabel","type","revealButtonIcon","EyeOffIcon","EyeIcon","revealButton","_jsx","IconButton","icon","onClick","trailingFooterSlot","_value$length","BaseBox","marginTop","marginRight","children","CharacterCounter","currentCount","length","maxCount","BaseInput","Object","assign","componentName","MetaConstants","PasswordInput","id","hideLabelText","Boolean","trailingInteractionElement","autoCapitalize","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AEA,IAAK,CAEXE,SAAS,CAAEA,SAAU,CACrBG,0BAA0B,CAAEA,0BAA2B,CACvDD,qBAAqB,CAAEA,qBAAsB,CAC7CmD,cAAc,CAAC,MAAM,CACrBjD,MAAM,CAAEA,MAAO,CACfE,IAAI,CAAEA,IAAK,CAAA,CACPG,IAAI,CACT,CAAC,CAEN,CAAC,CAGK,IAAAuC,aAAa,CAAGM,wBAAwB,CAACzC,cAAK,CAAC0C,UAAU,CAACpF,cAAc,CAAC,CAAE,CAC/EqF,WAAW,CAAE,eACf,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"PasswordInput.js","sources":["../../../../../../src/components/Input/PasswordInput/PasswordInput.tsx"],"sourcesContent":["import React from 'react';\nimport type { BaseInputProps } from '../BaseInput';\nimport { BaseInput } from '../BaseInput';\nimport { EyeIcon, EyeOffIcon } from '~components/Icons';\nimport BaseBox from '~components/Box/BaseBox';\nimport { CharacterCounter } from '~components/Form/CharacterCounter';\nimport { IconButton } from '~components/Button/IconButton';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport type { DataAnalyticsAttribute, BladeElementRef } from '~utils/types';\n\ntype PasswordInputExtraProps = {\n /**\n * Shows a reveal button to toggle password visibility\n *\n * @default true\n */\n showRevealButton?: boolean;\n\n /**\n * Displays asterisk (`*`) when `isRequired` is enabled\n *\n * @default none\n */\n necessityIndicator?: Exclude<BaseInputProps['necessityIndicator'], 'optional'>;\n\n /**\n * Determines what autoComplete suggestion type to show. Defaults to using platform heuristics.\n *\n * It's not recommended to turn this off in favor of safe password practices.\n * Providing `password` or `newPassword` is more informative to the platform for browser autofill or password managers.\n *\n * **Note**: Using `newPassword` on iOS has some [known issue](https://github.com/facebook/react-native/issues/21911) on React Native\n *\n * Internally it'll render platform specific attributes:\n *\n * - web: `autocomplete`\n * - iOS: `textContentType`\n * - android: `autoComplete`\n *\n */\n autoCompleteSuggestionType?: Extract<\n BaseInputProps['autoCompleteSuggestionType'],\n 'none' | 'password' | 'newPassword'\n >;\n};\n\ntype PasswordInputCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\n | 'labelSuffix'\n | 'labelTrailing'\n | 'maxCharacters'\n | 'validationState'\n | 'errorText'\n | 'successText'\n | 'helpText'\n | 'isDisabled'\n | 'defaultValue'\n | 'placeholder'\n | 'isRequired'\n | 'value'\n | 'onChange'\n | 'onBlur'\n | 'onSubmit'\n | 'onFocus'\n | 'name'\n | 'autoFocus'\n | 'keyboardReturnKeyType'\n | 'autoCompleteSuggestionType'\n | 'testID'\n | 'size'\n | keyof DataAnalyticsAttribute\n> &\n PasswordInputExtraProps &\n StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype PasswordInputPropsWithA11yLabel = {\n /**\n * Label to be shown for the input field\n */\n label?: undefined;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel: string;\n};\n\n/*\n Optional accessibilityLabel prop when label is provided\n*/\ntype PasswordInputPropsWithLabel = {\n /**\n * Label to be shown for the input field\n */\n label: string;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel?: string;\n};\n\ntype PasswordInputProps = (PasswordInputPropsWithA11yLabel | PasswordInputPropsWithLabel) &\n PasswordInputCommonProps;\n\nconst _PasswordInput: React.ForwardRefRenderFunction<BladeElementRef, PasswordInputProps> = (\n {\n label,\n accessibilityLabel,\n labelPosition = 'top',\n showRevealButton = true,\n maxCharacters,\n validationState,\n errorText,\n successText,\n helpText,\n isDisabled = false,\n defaultValue,\n placeholder,\n isRequired = false,\n necessityIndicator = 'none',\n value,\n onChange,\n onFocus,\n onBlur,\n onSubmit,\n name,\n autoFocus = false,\n keyboardReturnKeyType = 'done',\n autoCompleteSuggestionType,\n testID,\n size = 'medium',\n labelSuffix,\n labelTrailing,\n ...rest\n },\n ref,\n) => {\n const [isRevealed, setIsRevealed] = React.useState(false);\n const isEnabled = !isDisabled;\n\n // If input is disabled reveal button shouldn't be present and input should be masked\n const isRevealedAndEnabled = isRevealed && isEnabled;\n\n const toggleIsRevealed = (): void => setIsRevealed((revealed) => !revealed);\n const iconAccessibilityLabel = isRevealedAndEnabled ? 'Hide password' : 'Show password';\n const type = isRevealedAndEnabled ? 'text' : 'password';\n\n const revealButtonIcon = isRevealedAndEnabled ? EyeOffIcon : EyeIcon;\n const revealButton =\n showRevealButton && !isDisabled ? (\n <IconButton\n size=\"medium\"\n icon={revealButtonIcon}\n onClick={toggleIsRevealed}\n accessibilityLabel={iconAccessibilityLabel}\n />\n ) : null;\n\n const trailingFooterSlot = (value?: string): React.ReactNode =>\n maxCharacters ? (\n <BaseBox marginTop=\"spacing.2\" marginRight=\"spacing.1\">\n <CharacterCounter currentCount={value?.length ?? 0} maxCount={maxCharacters} />\n </BaseBox>\n ) : null;\n\n return (\n <BaseInput\n ref={ref}\n componentName={MetaConstants.PasswordInput}\n id=\"password-field\"\n label={label as string}\n accessibilityLabel={accessibilityLabel}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\n type={type}\n labelSuffix={labelSuffix}\n labelTrailing={labelTrailing}\n trailingInteractionElement={revealButton}\n trailingFooterSlot={trailingFooterSlot}\n maxCharacters={maxCharacters}\n validationState={validationState}\n errorText={errorText}\n successText={successText}\n helpText={helpText}\n isDisabled={isDisabled}\n defaultValue={defaultValue}\n placeholder={placeholder}\n isRequired={isRequired}\n necessityIndicator={necessityIndicator}\n value={value}\n onChange={onChange}\n onBlur={onBlur}\n onSubmit={onSubmit}\n onFocus={onFocus}\n name={name}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n autoCompleteSuggestionType={autoCompleteSuggestionType}\n keyboardReturnKeyType={keyboardReturnKeyType}\n autoCapitalize=\"none\"\n testID={testID}\n size={size}\n {...rest}\n />\n );\n};\n\n// nosemgrep\nconst PasswordInput = assignWithoutSideEffects(React.forwardRef(_PasswordInput), {\n displayName: 'PasswordInput',\n});\n\nexport type { PasswordInputProps };\nexport { PasswordInput };\n"],"names":["_PasswordInput","_ref","ref","label","accessibilityLabel","_ref$labelPosition","labelPosition","_ref$showRevealButton","showRevealButton","maxCharacters","validationState","errorText","successText","helpText","_ref$isDisabled","isDisabled","defaultValue","placeholder","_ref$isRequired","isRequired","_ref$necessityIndicat","necessityIndicator","value","onChange","onFocus","onBlur","onSubmit","name","_ref$autoFocus","autoFocus","_ref$keyboardReturnKe","keyboardReturnKeyType","autoCompleteSuggestionType","testID","_ref$size","size","labelSuffix","labelTrailing","rest","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","isRevealed","setIsRevealed","isEnabled","isRevealedAndEnabled","toggleIsRevealed","revealed","iconAccessibilityLabel","type","revealButtonIcon","EyeOffIcon","EyeIcon","revealButton","_jsx","IconButton","icon","onClick","trailingFooterSlot","_value$length","BaseBox","marginTop","marginRight","children","CharacterCounter","currentCount","length","maxCount","BaseInput","Object","assign","componentName","MetaConstants","PasswordInput","id","hideLabelText","Boolean","trailingInteractionElement","autoCapitalize","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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KAAgB,CACvBC,kBAAkB,CAAEA,kBAAmB,CACvC2E,aAAa,CAAE,CAACC,OAAO,CAAC7E,KAAK,CAAE,CAC/BG,aAAa,CAAEA,aAAc,CAC7B+C,IAAI,CAAEA,IAAK,CACXjB,WAAW,CAAEA,WAAY,CACzBC,aAAa,CAAEA,aAAc,CAC7B4C,0BAA0B,CAAExB,YAAa,CACzCK,kBAAkB,CAAEA,kBAAmB,CACvCrD,aAAa,CAAEA,aAAc,CAC7BC,eAAe,CAAEA,eAAgB,CACjCC,SAAS,CAAEA,SAAU,CACrBC,WAAW,CAAEA,WAAY,CACzBC,QAAQ,CAAEA,QAAS,CACnBE,UAAU,CAAEA,UAAW,CACvBC,YAAY,CAAEA,YAAa,CAC3BC,WAAW,CAAEA,WAAY,CACzBE,UAAU,CAAEA,UAAW,CACvBE,kBAAkB,CAAEA,kBAAmB,CACvCC,KAAK,CAAEA,KAAM,CACbC,QAAQ,CAAEA,QAAS,CACnBE,MAAM,CAAEA,MAAO,CACfC,QAAQ,CAAEA,QAAS,CACnBF,OAAO,CAAEA,OAAQ,CACjBG,IAAI,CAAEA,IAAK,CAEXE,SAAS,CAAEA,SAAU,CACrBG,0BAA0B,CAAEA,0BAA2B,CACvDD,qBAAqB,CAAEA,qBAAsB,CAC7CmD,cAAc,CAAC,MAAM,CACrBjD,MAAM,CAAEA,MAAO,CACfE,IAAI,CAAEA,IAAK,CAAA,CACPG,IAAI,CACT,CAAC,CAEN,CAAC,CAGK,IAAAuC,aAAa,CAAGM,wBAAwB,CAACzC,cAAK,CAAC0C,UAAU,CAACpF,cAAc,CAAC,CAAE,CAC/EqF,WAAW,CAAE,eACf,CAAC;;;;"}
|
|
@@ -322,6 +322,7 @@ import '../../Icons/RefreshIcon/RefreshIcon.js';
|
|
|
322
322
|
import '../../Icons/RepeatIcon/RepeatIcon.js';
|
|
323
323
|
import '../../Icons/ReportsIcon/ReportsIcon.js';
|
|
324
324
|
import '../../Icons/ResizerIcon/ResizerIcon.js';
|
|
325
|
+
import '../../Icons/ReticleIcon/ReticleIcon.js';
|
|
325
326
|
import '../../Icons/RewindIcon/RewindIcon.js';
|
|
326
327
|
import '../../Icons/RotateClockWiseIcon/RotateClockWiseIcon.js';
|
|
327
328
|
import '../../Icons/RotateCounterClockWiseIcon/RotateCounterClockWiseIcon.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.js","sources":["../../../../../../src/components/Input/SearchInput/SearchInput.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport type { ReactElement, ReactNode } from 'react';\nimport type { TextInput as TextInputReactNative } from 'react-native';\nimport type { BaseInputProps } from '../BaseInput';\nimport { BaseInput } from '../BaseInput';\nimport { getKeyboardAndAutocompleteProps } from '../BaseInput/utils';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport { CloseIcon, SearchIcon } from '~components/Icons';\nimport { IconButton } from '~components/Button/IconButton';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Spinner } from '~components/Spinner';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getPlatformType } from '~utils';\nimport { useMergeRefs } from '~utils/useMergeRefs';\nimport type {\n BladeElementRef,\n BladeElementRefWithValue,\n DataAnalyticsAttribute,\n} from '~utils/types';\nimport { dropdownComponentIds } from '~components/Dropdown/dropdownComponentIds';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport { DropdownOverlay, InputDropdownButton } from '~components/Dropdown';\nimport { Divider } from '~components/Divider';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\nimport { TopNavOverlayThemeOverride } from '~components/TopNav/TopNavOverlayThemeOverride';\nimport { useModalContext } from '~components/Modal/ModalContext';\n\ntype SearchInputCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\n | 'labelSuffix'\n | 'labelTrailing'\n | 'helpText'\n | 'placeholder'\n | 'defaultValue'\n | 'name'\n | 'onChange'\n | 'onFocus'\n | 'onBlur'\n | 'value'\n | 'isDisabled'\n | 'autoFocus'\n | 'onSubmit'\n | 'autoCapitalize'\n | 'testID'\n | 'onClick'\n | 'size'\n | keyof DataAnalyticsAttribute\n> & {\n /**\n * Event handler to handle the onClick event for clear button.\n */\n onClearButtonClick?: () => void;\n\n /**\n * Decides whether to show a loading spinner for the input field.\n */\n isLoading?: boolean;\n /**\n * Toggle the visibility of the search icon.\n *\n * @default true\n */\n showSearchIcon?: boolean;\n /**\n * Optional trailing to be shown at the end of the input.\n */\n trailing?: React.ReactNode;\n} & StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype SearchInputPropsWithA11yLabel = {\n /**\n * Label to be shown for the input field\n */\n label?: undefined;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel: string;\n};\n\n/*\n Optional accessibilityLabel prop when label is provided\n*/\ntype SearchInputPropsWithLabel = {\n /**\n * Label to be shown for the input field\n */\n label: string;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel?: string;\n};\n\ntype SearchInputProps = (SearchInputPropsWithA11yLabel | SearchInputPropsWithLabel) &\n SearchInputCommonProps;\n\n// need to do this to tell TS to infer type as SearchInput of React Native and make it believe that `ref.current.clear()` exists\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isReactNative = (_textInputRef?: any): _textInputRef is TextInputReactNative => {\n return getPlatformType() === 'react-native';\n};\n\nconst _SearchInput: React.ForwardRefRenderFunction<BladeElementRef, SearchInputProps> = (\n {\n label,\n accessibilityLabel,\n labelPosition = 'top',\n placeholder,\n defaultValue,\n name,\n value,\n onChange,\n onClick,\n onFocus,\n onBlur,\n onSubmit,\n isDisabled,\n labelSuffix,\n labelTrailing,\n helpText,\n onClearButtonClick,\n isLoading,\n autoCapitalize,\n autoFocus,\n testID,\n size = 'medium',\n showSearchIcon = true,\n trailing,\n ...rest\n },\n ref,\n): ReactElement => {\n const textInputRef = React.useRef<BladeElementRefWithValue>(null);\n const mergedRef = useMergeRefs(ref, textInputRef);\n const [shouldShowClearButton, setShouldShowClearButton] = useState(false);\n const [isTrailingDropDownOpen, setIsTrailingDropDownOpen] = useState(false);\n const {\n triggererWrapperRef,\n onTriggerKeydown,\n onTriggerClick,\n dropdownTriggerer,\n close: closeParentDropDown,\n isOpen: isParentDropDownOpen,\n } = useDropdown();\n const isInsideDropdown = dropdownTriggerer === 'SearchInput';\n\n const [isSearchFocused, setIsSearchFocused] = useState(false);\n\n const modalContext = useModalContext();\n\n React.useEffect(() => {\n setShouldShowClearButton(Boolean(defaultValue ?? value));\n }, [defaultValue, value]);\n\n useEffect(() => {\n if (isParentDropDownOpen && isTrailingDropDownOpen) {\n setIsTrailingDropDownOpen(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [closeParentDropDown, isParentDropDownOpen]);\n\n useEffect(() => {\n if (isTrailingDropDownOpen && isParentDropDownOpen) {\n closeParentDropDown();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [setIsTrailingDropDownOpen, isTrailingDropDownOpen]);\n\n const trailingDropdown =\n trailing && getComponentId(trailing as React.ReactElement) === 'Dropdown' ? trailing : null;\n\n const renderTrailingDropDown = (): React.ReactElement | null => {\n if (!trailingDropdown) {\n return null;\n }\n return React.cloneElement(trailingDropdown as React.ReactElement, {\n selectionType: 'single',\n isOpen: isTrailingDropDownOpen,\n height: '100%',\n onOpenChange: (isOpen: boolean) => {\n setIsTrailingDropDownOpen(isOpen);\n },\n children: React.Children.map(\n (trailingDropdown as React.ReactElement).props.children,\n (child) => {\n if (child.type === InputDropdownButton) {\n return React.cloneElement(child, {\n _isInsideSearchInput: true,\n size,\n });\n }\n if (child.type === DropdownOverlay) {\n return React.cloneElement(child, {\n referenceRef: triggererWrapperRef,\n _isNestedDropdown: true,\n defaultPlacement: 'bottom-end',\n });\n }\n return child;\n },\n ),\n });\n };\n\n const renderClearButton = (): React.ReactElement => {\n return (\n <IconButton\n size=\"medium\"\n icon={CloseIcon}\n onClick={() => {\n if (isEmpty(value) && textInputRef.current) {\n // when the input field is uncontrolled take the ref and clear the input and then call the onClearButtonClick function\n if (isReactNative(textInputRef.current)) {\n textInputRef.current.clear();\n textInputRef.current.focus();\n } else if (textInputRef.current instanceof HTMLInputElement) {\n textInputRef.current.value = '';\n textInputRef.current.focus();\n }\n }\n\n // if the input field is controlled just call the click handler and the value change shall be left upto the consumer\n onClearButtonClick?.();\n textInputRef?.current?.focus();\n setShouldShowClearButton(false);\n }}\n isDisabled={isDisabled}\n accessibilityLabel=\"Clear Input Content\"\n />\n );\n };\n\n const renderInteractionElement = (): ReactNode => {\n if (isLoading) {\n return <Spinner accessibilityLabel=\"Loading Content\" color=\"primary\" />;\n }\n\n if (shouldShowClearButton && trailingDropdown) {\n return (\n <BaseBox display=\"flex\" gap=\"spacing.3\">\n {renderClearButton()} <Divider orientation=\"vertical\" />\n </BaseBox>\n );\n }\n if (shouldShowClearButton) {\n return renderClearButton();\n }\n\n return null;\n };\n\n const searchContent = (\n <BaseBox position=\"relative\">\n <BaseInput\n id=\"searchinput\"\n componentName={MetaConstants.SearchInput}\n ref={mergedRef}\n isDropdownTrigger={true}\n setInputWrapperRef={\n isInsideDropdown || isTrailingDropDownOpen\n ? (wrapperNode) => {\n triggererWrapperRef.current = wrapperNode;\n }\n : undefined\n }\n label={label as string}\n accessibilityLabel={accessibilityLabel}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\n labelSuffix={labelSuffix}\n labelTrailing={labelTrailing}\n placeholder={placeholder}\n defaultValue={defaultValue}\n value={value}\n name={name}\n onKeyDown={isInsideDropdown ? onTriggerKeydown : undefined}\n onChange={({ name, value }) => {\n if (value?.length) {\n // show the clear button when the user starts typing in\n setShouldShowClearButton(true);\n }\n\n if (shouldShowClearButton && !value?.length) {\n // hide the clear button when the input field is empty\n setShouldShowClearButton(false);\n }\n\n onChange?.({ name, value });\n }}\n onClick={(e) => {\n if (isDisabled) return;\n if (isInsideDropdown) {\n onTriggerClick();\n }\n onClick?.(e);\n }}\n onFocus={(e) => {\n setIsSearchFocused(true);\n onFocus?.(e);\n }}\n onBlur={(e) => {\n setIsSearchFocused(false);\n onBlur?.(e);\n }}\n onSubmit={onSubmit}\n isDisabled={isDisabled}\n leadingIcon={showSearchIcon ? SearchIcon : undefined}\n trailingInteractionElement={renderInteractionElement()}\n trailingDropDown={renderTrailingDropDown()}\n helpText={helpText}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n testID={testID}\n {...getKeyboardAndAutocompleteProps({\n type: 'search',\n autoCapitalize,\n })}\n size={size}\n {...rest}\n />\n </BaseBox>\n );\n\n return (\n <TopNavOverlayThemeOverride\n shouldOverrideTheme={modalContext.isInsideModal ? true : isSearchFocused}\n >\n {searchContent}\n </TopNavOverlayThemeOverride>\n );\n};\n\nconst SearchInput = assignWithoutSideEffects(React.forwardRef(_SearchInput), {\n displayName: 'SearchInput',\n componentId: dropdownComponentIds.triggers.SearchInput,\n});\n\nexport type { SearchInputProps };\nexport { SearchInput };\n"],"names":["isReactNative","_textInputRef","getPlatformType","_SearchInput","_ref","ref","label","accessibilityLabel","_ref$labelPosition","labelPosition","placeholder","defaultValue","name","value","onChange","onClick","onFocus","onBlur","onSubmit","isDisabled","labelSuffix","labelTrailing","helpText","onClearButtonClick","isLoading","autoCapitalize","autoFocus","testID","_ref$size","size","_ref$showSearchIcon","showSearchIcon","trailing","rest","_objectWithoutProperties","_excluded","textInputRef","React","useRef","mergedRef","useMergeRefs","_useState","useState","_useState2","_slicedToArray","shouldShowClearButton","setShouldShowClearButton","_useState3","_useState4","isTrailingDropDownOpen","setIsTrailingDropDownOpen","_useDropdown","useDropdown","triggererWrapperRef","onTriggerKeydown","onTriggerClick","dropdownTriggerer","closeParentDropDown","close","isParentDropDownOpen","isOpen","isInsideDropdown","_useState5","_useState6","isSearchFocused","setIsSearchFocused","modalContext","useModalContext","useEffect","Boolean","trailingDropdown","getComponentId","renderTrailingDropDown","cloneElement","selectionType","height","onOpenChange","children","Children","map","props","child","type","InputDropdownButton","_isInsideSearchInput","DropdownOverlay","referenceRef","_isNestedDropdown","defaultPlacement","renderClearButton","_jsx","IconButton","icon","CloseIcon","_textInputRef$current","isEmpty","current","clear","focus","HTMLInputElement","renderInteractionElement","Spinner","color","_jsxs","BaseBox","display","gap","Divider","orientation","searchContent","position","BaseInput","Object","assign","id","componentName","MetaConstants","SearchInput","isDropdownTrigger","setInputWrapperRef","wrapperNode","undefined","hideLabelText","onKeyDown","_ref2","length","e","leadingIcon","SearchIcon","trailingInteractionElement","trailingDropDown","getKeyboardAndAutocompleteProps","TopNavOverlayThemeOverride","shouldOverrideTheme","isInsideModal","assignWithoutSideEffects","forwardRef","displayName","componentId","dropdownComponentIds","triggers"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,eAAA,CAAA,aAAA,CAAA,cAAA,CAAA,MAAA,CAAA,OAAA,CAAA,UAAA,CAAA,SAAA,CAAA,SAA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AAA,CAAA,CAAPA,QAAO,CAAG8G,CAAC,CAAC,CACd,CAAE,CACF7G,MAAM,CAAE,SAARA,MAAMA,CAAG6G,CAAC,CAAK,CACb7D,kBAAkB,CAAC,KAAK,CAAC,CACzBhD,OAAM,EAAA,IAAA,CAAA,KAAA,CAAA,CAANA,OAAM,CAAG6G,CAAC,CAAC,CACb,CAAE,CACF5G,QAAQ,CAAEA,QAAS,CACnBC,UAAU,CAAEA,UAAW,CACvB4G,WAAW,CAAEhG,cAAc,CAAGiG,UAAU,CAAGP,SAAU,CACrDQ,0BAA0B,CAAE7B,wBAAwB,EAAG,CACvD8B,gBAAgB,CAAE1D,sBAAsB,EAAG,CAC3ClD,QAAQ,CAAEA,QAAS,CAEnBI,SAAS,CAAEA,SAAU,CACrBC,MAAM,CAAEA,MAAO,CAAA,CACXwG,+BAA+B,CAAC,CAClCjD,IAAI,CAAE,QAAQ,CACdzD,cAAc,CAAdA,cACF,CAAC,CAAC,CAAA,CACFI,IAAI,CAAEA,IAAK,CACPI,CAAAA,IAAI,CACT,CAAC,CACK,CACV,CAED,OACEyD,GAAA,CAAC0C,0BAA0B,CACzBC,CAAAA,mBAAmB,CAAEnE,YAAY,CAACoE,aAAa,CAAG,IAAI,CAAGtE,eAAgB,CAAAa,QAAA,CAExEgC,aAAa,CACY,CAAC,CAEjC,CAAC,CAEK,IAAAQ,WAAW,CAAGkB,wBAAwB,CAAClG,cAAK,CAACmG,UAAU,CAACrI,YAAY,CAAC,CAAE,CAC3EsI,WAAW,CAAE,aAAa,CAC1BC,WAAW,CAAEC,oBAAoB,CAACC,QAAQ,CAACvB,WAC7C,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"SearchInput.js","sources":["../../../../../../src/components/Input/SearchInput/SearchInput.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport type { ReactElement, ReactNode } from 'react';\nimport type { TextInput as TextInputReactNative } from 'react-native';\nimport type { BaseInputProps } from '../BaseInput';\nimport { BaseInput } from '../BaseInput';\nimport { getKeyboardAndAutocompleteProps } from '../BaseInput/utils';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport { CloseIcon, SearchIcon } from '~components/Icons';\nimport { IconButton } from '~components/Button/IconButton';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Spinner } from '~components/Spinner';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getPlatformType } from '~utils';\nimport { useMergeRefs } from '~utils/useMergeRefs';\nimport type {\n BladeElementRef,\n BladeElementRefWithValue,\n DataAnalyticsAttribute,\n} from '~utils/types';\nimport { dropdownComponentIds } from '~components/Dropdown/dropdownComponentIds';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport { DropdownOverlay, InputDropdownButton } from '~components/Dropdown';\nimport { Divider } from '~components/Divider';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\nimport { TopNavOverlayThemeOverride } from '~components/TopNav/TopNavOverlayThemeOverride';\nimport { useModalContext } from '~components/Modal/ModalContext';\n\ntype SearchInputCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\n | 'labelSuffix'\n | 'labelTrailing'\n | 'helpText'\n | 'placeholder'\n | 'defaultValue'\n | 'name'\n | 'onChange'\n | 'onFocus'\n | 'onBlur'\n | 'value'\n | 'isDisabled'\n | 'autoFocus'\n | 'onSubmit'\n | 'autoCapitalize'\n | 'testID'\n | 'onClick'\n | 'size'\n | keyof DataAnalyticsAttribute\n> & {\n /**\n * Event handler to handle the onClick event for clear button.\n */\n onClearButtonClick?: () => void;\n\n /**\n * Decides whether to show a loading spinner for the input field.\n */\n isLoading?: boolean;\n /**\n * Toggle the visibility of the search icon.\n *\n * @default true\n */\n showSearchIcon?: boolean;\n /**\n * Optional trailing to be shown at the end of the input.\n */\n trailing?: React.ReactNode;\n} & StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype SearchInputPropsWithA11yLabel = {\n /**\n * Label to be shown for the input field\n */\n label?: undefined;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel: string;\n};\n\n/*\n Optional accessibilityLabel prop when label is provided\n*/\ntype SearchInputPropsWithLabel = {\n /**\n * Label to be shown for the input field\n */\n label: string;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel?: string;\n};\n\ntype SearchInputProps = (SearchInputPropsWithA11yLabel | SearchInputPropsWithLabel) &\n SearchInputCommonProps;\n\n// need to do this to tell TS to infer type as SearchInput of React Native and make it believe that `ref.current.clear()` exists\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isReactNative = (_textInputRef?: any): _textInputRef is TextInputReactNative => {\n return getPlatformType() === 'react-native';\n};\n\nconst _SearchInput: React.ForwardRefRenderFunction<BladeElementRef, SearchInputProps> = (\n {\n label,\n accessibilityLabel,\n labelPosition = 'top',\n placeholder,\n defaultValue,\n name,\n value,\n onChange,\n onClick,\n onFocus,\n onBlur,\n onSubmit,\n isDisabled,\n labelSuffix,\n labelTrailing,\n helpText,\n onClearButtonClick,\n isLoading,\n autoCapitalize,\n autoFocus,\n testID,\n size = 'medium',\n showSearchIcon = true,\n trailing,\n ...rest\n },\n ref,\n): ReactElement => {\n const textInputRef = React.useRef<BladeElementRefWithValue>(null);\n const mergedRef = useMergeRefs(ref, textInputRef);\n const [shouldShowClearButton, setShouldShowClearButton] = useState(false);\n const [isTrailingDropDownOpen, setIsTrailingDropDownOpen] = useState(false);\n const {\n triggererWrapperRef,\n onTriggerKeydown,\n onTriggerClick,\n dropdownTriggerer,\n close: closeParentDropDown,\n isOpen: isParentDropDownOpen,\n } = useDropdown();\n const isInsideDropdown = dropdownTriggerer === 'SearchInput';\n\n const [isSearchFocused, setIsSearchFocused] = useState(false);\n\n const modalContext = useModalContext();\n\n React.useEffect(() => {\n setShouldShowClearButton(Boolean(defaultValue ?? value));\n }, [defaultValue, value]);\n\n useEffect(() => {\n if (isParentDropDownOpen && isTrailingDropDownOpen) {\n setIsTrailingDropDownOpen(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [closeParentDropDown, isParentDropDownOpen]);\n\n useEffect(() => {\n if (isTrailingDropDownOpen && isParentDropDownOpen) {\n closeParentDropDown();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [setIsTrailingDropDownOpen, isTrailingDropDownOpen]);\n\n const trailingDropdown =\n trailing && getComponentId(trailing as React.ReactElement) === 'Dropdown' ? trailing : null;\n\n const renderTrailingDropDown = (): React.ReactElement | null => {\n if (!trailingDropdown) {\n return null;\n }\n return React.cloneElement(trailingDropdown as React.ReactElement, {\n selectionType: 'single',\n isOpen: isTrailingDropDownOpen,\n height: '100%',\n onOpenChange: (isOpen: boolean) => {\n setIsTrailingDropDownOpen(isOpen);\n },\n children: React.Children.map(\n (trailingDropdown as React.ReactElement).props.children,\n (child) => {\n if (child.type === InputDropdownButton) {\n return React.cloneElement(child, {\n _isInsideSearchInput: true,\n size,\n });\n }\n if (child.type === DropdownOverlay) {\n return React.cloneElement(child, {\n referenceRef: triggererWrapperRef,\n _isNestedDropdown: true,\n defaultPlacement: 'bottom-end',\n });\n }\n return child;\n },\n ),\n });\n };\n\n const renderClearButton = (): React.ReactElement => {\n return (\n <IconButton\n size=\"medium\"\n icon={CloseIcon}\n onClick={() => {\n if (isEmpty(value) && textInputRef.current) {\n // when the input field is uncontrolled take the ref and clear the input and then call the onClearButtonClick function\n if (isReactNative(textInputRef.current)) {\n textInputRef.current.clear();\n textInputRef.current.focus();\n } else if (textInputRef.current instanceof HTMLInputElement) {\n textInputRef.current.value = '';\n textInputRef.current.focus();\n }\n }\n\n // if the input field is controlled just call the click handler and the value change shall be left upto the consumer\n onClearButtonClick?.();\n textInputRef?.current?.focus();\n setShouldShowClearButton(false);\n }}\n isDisabled={isDisabled}\n accessibilityLabel=\"Clear Input Content\"\n />\n );\n };\n\n const renderInteractionElement = (): ReactNode => {\n if (isLoading) {\n return <Spinner accessibilityLabel=\"Loading Content\" color=\"primary\" />;\n }\n\n if (shouldShowClearButton && trailingDropdown) {\n return (\n <BaseBox display=\"flex\" gap=\"spacing.3\">\n {renderClearButton()} <Divider orientation=\"vertical\" />\n </BaseBox>\n );\n }\n if (shouldShowClearButton) {\n return renderClearButton();\n }\n\n return null;\n };\n\n const searchContent = (\n <BaseBox position=\"relative\">\n <BaseInput\n id=\"searchinput\"\n componentName={MetaConstants.SearchInput}\n ref={mergedRef}\n isDropdownTrigger={true}\n setInputWrapperRef={\n isInsideDropdown || isTrailingDropDownOpen\n ? (wrapperNode) => {\n triggererWrapperRef.current = wrapperNode;\n }\n : undefined\n }\n label={label as string}\n accessibilityLabel={accessibilityLabel}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\n labelSuffix={labelSuffix}\n labelTrailing={labelTrailing}\n placeholder={placeholder}\n defaultValue={defaultValue}\n value={value}\n name={name}\n onKeyDown={isInsideDropdown ? onTriggerKeydown : undefined}\n onChange={({ name, value }) => {\n if (value?.length) {\n // show the clear button when the user starts typing in\n setShouldShowClearButton(true);\n }\n\n if (shouldShowClearButton && !value?.length) {\n // hide the clear button when the input field is empty\n setShouldShowClearButton(false);\n }\n\n onChange?.({ name, value });\n }}\n onClick={(e) => {\n if (isDisabled) return;\n if (isInsideDropdown) {\n onTriggerClick();\n }\n onClick?.(e);\n }}\n onFocus={(e) => {\n setIsSearchFocused(true);\n onFocus?.(e);\n }}\n onBlur={(e) => {\n setIsSearchFocused(false);\n onBlur?.(e);\n }}\n onSubmit={onSubmit}\n isDisabled={isDisabled}\n leadingIcon={showSearchIcon ? SearchIcon : undefined}\n trailingInteractionElement={renderInteractionElement()}\n trailingDropDown={renderTrailingDropDown()}\n helpText={helpText}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n testID={testID}\n {...getKeyboardAndAutocompleteProps({\n type: 'search',\n autoCapitalize,\n })}\n size={size}\n {...rest}\n />\n </BaseBox>\n );\n\n return (\n <TopNavOverlayThemeOverride\n shouldOverrideTheme={modalContext.isInsideModal ? true : isSearchFocused}\n >\n {searchContent}\n </TopNavOverlayThemeOverride>\n );\n};\n\nconst SearchInput = assignWithoutSideEffects(React.forwardRef(_SearchInput), {\n displayName: 'SearchInput',\n componentId: dropdownComponentIds.triggers.SearchInput,\n});\n\nexport type { SearchInputProps };\nexport { SearchInput };\n"],"names":["isReactNative","_textInputRef","getPlatformType","_SearchInput","_ref","ref","label","accessibilityLabel","_ref$labelPosition","labelPosition","placeholder","defaultValue","name","value","onChange","onClick","onFocus","onBlur","onSubmit","isDisabled","labelSuffix","labelTrailing","helpText","onClearButtonClick","isLoading","autoCapitalize","autoFocus","testID","_ref$size","size","_ref$showSearchIcon","showSearchIcon","trailing","rest","_objectWithoutProperties","_excluded","textInputRef","React","useRef","mergedRef","useMergeRefs","_useState","useState","_useState2","_slicedToArray","shouldShowClearButton","setShouldShowClearButton","_useState3","_useState4","isTrailingDropDownOpen","setIsTrailingDropDownOpen","_useDropdown","useDropdown","triggererWrapperRef","onTriggerKeydown","onTriggerClick","dropdownTriggerer","closeParentDropDown","close","isParentDropDownOpen","isOpen","isInsideDropdown","_useState5","_useState6","isSearchFocused","setIsSearchFocused","modalContext","useModalContext","useEffect","Boolean","trailingDropdown","getComponentId","renderTrailingDropDown","cloneElement","selectionType","height","onOpenChange","children","Children","map","props","child","type","InputDropdownButton","_isInsideSearchInput","DropdownOverlay","referenceRef","_isNestedDropdown","defaultPlacement","renderClearButton","_jsx","IconButton","icon","CloseIcon","_textInputRef$current","isEmpty","current","clear","focus","HTMLInputElement","renderInteractionElement","Spinner","color","_jsxs","BaseBox","display","gap","Divider","orientation","searchContent","position","BaseInput","Object","assign","id","componentName","MetaConstants","SearchInput","isDropdownTrigger","setInputWrapperRef","wrapperNode","undefined","hideLabelText","onKeyDown","_ref2","length","e","leadingIcon","SearchIcon","trailingInteractionElement","trailingDropDown","getKeyboardAndAutocompleteProps","TopNavOverlayThemeOverride","shouldOverrideTheme","isInsideModal","assignWithoutSideEffects","forwardRef","displayName","componentId","dropdownComponentIds","triggers"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,eAAA,CAAA,aAAA,CAAA,cAAA,CAAA,MAAA,CAAA,OAAA,CAAA,UAAA,CAAA,SAAA,CAAA,SAAA,CAAA,QAAA,CAAA,UAAA,CAAA,YAAA,CAAA,aAAA,CAAA,eAAA,CAAA,UAAA,CAAA,oBAAA,CAAA,WAAA,CAAA,gBAAA,CAAA,WAAA,CAAA,QAAA,CAAA,MAAA,CAAA,gBAAA,CAAA,UAAA,CAAA,CA2GA,IAAMA,aAAa,CAAG,SAAhBA,aAAaA,CAAIC,aAAmB,CAA4C,CACpF,OAAOC,eAAe,EAAE,GAAK,cAAc,CAC7C,CAAC,CAED,IAAMC,YAA+E,CAAG,SAAlFA,YAA+EA,CAAAC,IAAA,CA4BnFC,GAAG,CACc,CAAA,IA3BfC,KAAK,CAAAF,IAAA,CAALE,KAAK,CACLC,kBAAkB,CA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Q,CAAEA,QAAS,CAEnBI,SAAS,CAAEA,SAAU,CACrBC,MAAM,CAAEA,MAAO,CAAA,CACXwG,+BAA+B,CAAC,CAClCjD,IAAI,CAAE,QAAQ,CACdzD,cAAc,CAAdA,cACF,CAAC,CAAC,CAAA,CACFI,IAAI,CAAEA,IAAK,CACPI,CAAAA,IAAI,CACT,CAAC,CACK,CACV,CAED,OACEyD,GAAA,CAAC0C,0BAA0B,CACzBC,CAAAA,mBAAmB,CAAEnE,YAAY,CAACoE,aAAa,CAAG,IAAI,CAAGtE,eAAgB,CAAAa,QAAA,CAExEgC,aAAa,CACY,CAAC,CAEjC,CAAC,CAEK,IAAAQ,WAAW,CAAGkB,wBAAwB,CAAClG,cAAK,CAACmG,UAAU,CAACrI,YAAY,CAAC,CAAE,CAC3EsI,WAAW,CAAE,aAAa,CAC1BC,WAAW,CAAEC,oBAAoB,CAACC,QAAQ,CAACvB,WAC7C,CAAC;;;;"}
|
|
@@ -322,6 +322,7 @@ import '../../Icons/RefreshIcon/RefreshIcon.js';
|
|
|
322
322
|
import '../../Icons/RepeatIcon/RepeatIcon.js';
|
|
323
323
|
import '../../Icons/ReportsIcon/ReportsIcon.js';
|
|
324
324
|
import '../../Icons/ResizerIcon/ResizerIcon.js';
|
|
325
|
+
import '../../Icons/ReticleIcon/ReticleIcon.js';
|
|
325
326
|
import '../../Icons/RewindIcon/RewindIcon.js';
|
|
326
327
|
import '../../Icons/RotateClockWiseIcon/RotateClockWiseIcon.js';
|
|
327
328
|
import '../../Icons/RotateCounterClockWiseIcon/RotateCounterClockWiseIcon.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.js","sources":["../../../../../../src/components/Input/TextArea/TextArea.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-autofocus */\nimport React from 'react';\nimport type { TextInput as TextInputReactNative } from 'react-native';\nimport type { BaseInputProps } from '../BaseInput';\nimport { BaseInput } from '../BaseInput';\nimport type { TaggedInputProps } from '../BaseInput/useTaggedInput';\nimport { useTaggedInput } from '../BaseInput/useTaggedInput';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport { CloseIcon } from '~components/Icons';\nimport { IconButton } from '~components/Button/IconButton';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { CharacterCounter } from '~components/Form/CharacterCounter';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getPlatformType } from '~utils';\nimport { useMergeRefs } from '~utils/useMergeRefs';\nimport type {\n BladeElementRef,\n BladeElementRefWithValue,\n DataAnalyticsAttribute,\n} from '~utils/types';\nimport { hintMarginTop } from '~components/Form/formTokens';\nimport type { FormInputOnKeyDownEvent } from '~components/Form/FormTypes';\n\ntype TextAreaCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\n | 'labelSuffix'\n | 'labelTrailing'\n | 'necessityIndicator'\n | 'validationState'\n | 'helpText'\n | 'errorText'\n | 'successText'\n | 'placeholder'\n | 'defaultValue'\n | 'name'\n | 'onChange'\n | 'onFocus'\n | 'onBlur'\n | 'onSubmit'\n | 'value'\n | 'isDisabled'\n | 'isRequired'\n | 'maxCharacters'\n | 'autoFocus'\n | 'numberOfLines'\n | 'testID'\n | 'size'\n | keyof DataAnalyticsAttribute\n> & {\n /**\n * Decides whether to render a clear icon button\n */\n showClearButton?: boolean;\n /**\n * Event handler to handle the onClick event for clear button. Used when `showClearButton` is `true`\n */\n onClearButtonClick?: () => void;\n\n onKeyDown?: ({\n name,\n value,\n event,\n }: {\n name?: FormInputOnKeyDownEvent['name'];\n value: string;\n event: FormInputOnKeyDownEvent['event'];\n }) => void;\n} & TaggedInputProps &\n StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype TextAreaPropsWithA11yLabel = {\n /**\n * Label to be shown for the input field\n */\n label?: undefined;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel: string;\n};\n\n/*\n Optional accessibilityLabel prop when label is provided\n*/\ntype TextAreaPropsWithLabel = {\n /**\n * Label to be shown for the input field\n */\n label: string;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel?: string;\n};\n\ntype TextAreaProps = (TextAreaPropsWithA11yLabel | TextAreaPropsWithLabel) & TextAreaCommonProps;\n\n// need to do this to tell TS to infer type as TextInput of React Native and make it believe that `ref.current.clear()` exists\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isReactNative = (_textInputRef: any): _textInputRef is TextInputReactNative => {\n return getPlatformType() === 'react-native';\n};\n\nconst _TextArea: React.ForwardRefRenderFunction<BladeElementRef, TextAreaProps> = (\n {\n label,\n accessibilityLabel,\n labelPosition,\n labelSuffix,\n labelTrailing,\n necessityIndicator,\n errorText,\n helpText,\n successText,\n validationState,\n defaultValue,\n isDisabled,\n isRequired,\n name,\n onChange,\n onFocus,\n onBlur,\n onSubmit,\n onKeyDown,\n placeholder,\n value,\n maxCharacters,\n showClearButton,\n onClearButtonClick,\n autoFocus,\n numberOfLines = 2,\n testID,\n size = 'medium',\n isTaggedInput,\n tags,\n onTagChange,\n ...rest\n },\n ref,\n) => {\n const inputRef = React.useRef<BladeElementRefWithValue>(null);\n const mergedRef = useMergeRefs(ref, inputRef);\n const [isInputFocussed, setIsInputFocussed] = React.useState(autoFocus ?? false);\n const {\n activeTagIndex,\n setActiveTagIndex,\n getTags,\n handleTaggedInputKeydown,\n handleTaggedInputChange,\n handleTagsClear,\n } = useTaggedInput({\n tags,\n onTagChange,\n isDisabled,\n inputRef,\n isTaggedInput,\n name,\n value,\n onChange,\n });\n\n const [shouldShowClearButton, setShouldShowClearButton] = React.useState(false);\n\n React.useEffect(() => {\n setShouldShowClearButton(Boolean(showClearButton && (value?.length || defaultValue?.length)));\n }, [showClearButton, defaultValue, value]);\n\n const renderInteractionElement = (): React.ReactNode => {\n if (shouldShowClearButton) {\n return (\n <BaseBox paddingTop=\"spacing.3\" marginTop=\"spacing.1\">\n <IconButton\n icon={CloseIcon}\n accessibilityLabel=\"Clear textarea content\"\n onClick={() => {\n if (isEmpty(value) && inputRef.current) {\n // when the input field is uncontrolled take the ref and clear the input and then call the onClearButtonClick function\n if (isReactNative(inputRef.current)) {\n inputRef.current.clear();\n inputRef.current.focus();\n } else if (inputRef.current instanceof HTMLTextAreaElement) {\n inputRef.current.value = '';\n inputRef.current.focus();\n }\n }\n handleTagsClear();\n // if the input field is controlled just call the click handler and the value change shall be left upto the consumer\n onClearButtonClick?.();\n inputRef?.current?.focus();\n setShouldShowClearButton(false);\n }}\n />\n </BaseBox>\n );\n }\n\n return null;\n };\n\n return (\n <BaseInput\n as=\"textarea\"\n id=\"textarea\"\n maxTagRows=\"multiple\"\n componentName={MetaConstants.TextArea}\n autoFocus={autoFocus}\n ref={mergedRef}\n label={label as string}\n tags={isTaggedInput ? getTags({ size }) : undefined}\n activeTagIndex={activeTagIndex}\n setActiveTagIndex={setActiveTagIndex}\n isDropdownTrigger={isTaggedInput}\n showAllTags={isInputFocussed}\n accessibilityLabel={accessibilityLabel}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\n labelSuffix={labelSuffix}\n labelTrailing={labelTrailing}\n necessityIndicator={necessityIndicator}\n errorText={errorText}\n helpText={helpText}\n successText={successText}\n validationState={validationState}\n isDisabled={isDisabled}\n isRequired={isRequired}\n name={name}\n maxCharacters={maxCharacters}\n placeholder={placeholder}\n trailingInteractionElement={renderInteractionElement()}\n defaultValue={defaultValue}\n value={value}\n numberOfLines={numberOfLines}\n onChange={({ name, value }) => {\n if (showClearButton && value?.length) {\n // show the clear button when the user starts typing in\n setShouldShowClearButton(true);\n }\n\n if (shouldShowClearButton && !value?.length) {\n // hide the clear button when the input field is empty\n setShouldShowClearButton(false);\n }\n\n handleTaggedInputChange({ name, value });\n onChange?.({ name, value });\n }}\n onFocus={(e) => {\n setIsInputFocussed(true);\n onFocus?.(e);\n }}\n onBlur={(e) => {\n setIsInputFocussed(false);\n onBlur?.(e);\n }}\n onKeyDown={(e) => {\n handleTaggedInputKeydown(e);\n onKeyDown?.({\n name: e.name,\n value: e.event.currentTarget.value,\n event: e.event,\n });\n }}\n onSubmit={onSubmit}\n trailingFooterSlot={(value) => {\n return maxCharacters ? (\n <BaseBox marginTop={hintMarginTop[size]} marginRight=\"spacing.1\">\n <CharacterCounter currentCount={value?.length ?? 0} maxCount={maxCharacters} />\n </BaseBox>\n ) : null;\n }}\n testID={testID}\n size={size}\n {...rest}\n />\n );\n};\n\nconst TextArea = assignWithoutSideEffects(React.forwardRef(_TextArea), {\n displayName: 'TextArea',\n});\n\nexport type { TextAreaProps };\nexport { TextArea };\n"],"names":["isReactNative","_textInputRef","getPlatformType","_TextArea","_ref","ref","label","accessibilityLabel","labelPosition","labelSuffix","labelTrailing","necessityIndicator","errorText","helpText","successText","validationState","defaultValue","isDisabled","isRequired","name","onChange","onFocus","onBlur","onSubmit","onKeyDown","placeholder","value","maxCharacters","showClearButton","onClearButtonClick","autoFocus","_ref$numberOfLines","numberOfLines","testID","_ref$size","size","isTaggedInput","tags","onTagChange","rest","_objectWithoutProperties","_excluded","inputRef","React","useRef","mergedRef","useMergeRefs","_React$useState","useState","_React$useState2","_slicedToArray","isInputFocussed","setIsInputFocussed","_useTaggedInput","useTaggedInput","activeTagIndex","setActiveTagIndex","getTags","handleTaggedInputKeydown","handleTaggedInputChange","handleTagsClear","_React$useState3","_React$useState4","shouldShowClearButton","setShouldShowClearButton","useEffect","Boolean","length","renderInteractionElement","_jsx","BaseBox","paddingTop","marginTop","children","IconButton","icon","CloseIcon","onClick","_inputRef$current","isEmpty","current","clear","focus","HTMLTextAreaElement","BaseInput","Object","assign","as","id","maxTagRows","componentName","MetaConstants","TextArea","undefined","isDropdownTrigger","showAllTags","hideLabelText","trailingInteractionElement","_ref2","e","event","currentTarget","trailingFooterSlot","_value$length","hintMarginTop","marginRight","CharacterCounter","currentCount","maxCount","assignWithoutSideEffects","forwardRef","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IAAI,CAAEgF,CAAC,CAAChF,IAAI,CACZO,KAAK,CAAEyE,CAAC,CAACC,KAAK,CAACC,aAAa,CAAC3E,KAAK,CAClC0E,KAAK,CAAED,CAAC,CAACC,KACX,CAAC,CAAC,CACJ,CAAE,CACF7E,QAAQ,CAAEA,QAAS,CACnB+E,kBAAkB,CAAE,SAApBA,kBAAkBA,CAAG5E,KAAK,CAAK,CAAA,IAAA6E,aAAA,CAC7B,OAAO5E,aAAa,CAClB0C,GAAA,CAACC,OAAO,CAACE,CAAAA,SAAS,CAAEgC,aAAa,CAACrE,IAAI,CAAE,CAACsE,WAAW,CAAC,WAAW,CAAAhC,QAAA,CAC9DJ,GAAA,CAACqC,gBAAgB,CAACC,CAAAA,YAAY,CAAAJ,CAAAA,aAAA,CAAE7E,KAAK,EAALA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,KAAK,CAAEyC,MAAM,QAAAoC,aAAA,CAAI,CAAE,CAACK,QAAQ,CAAEjF,aAAc,CAAE,CAAC,CACxE,CAAC,CACR,IAAI,CACV,CAAE,CACFM,MAAM,CAAEA,MAAO,CACfE,IAAI,CAAEA,IAAK,CACPI,CAAAA,IAAI,CACT,CAAC,CAEN,CAAC,CAEK,IAAAqD,QAAQ,CAAGiB,wBAAwB,CAAClE,cAAK,CAACmE,UAAU,CAAC3G,SAAS,CAAC,CAAE,CACrE4G,WAAW,CAAE,UACf,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"TextArea.js","sources":["../../../../../../src/components/Input/TextArea/TextArea.tsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-autofocus */\nimport React from 'react';\nimport type { TextInput as TextInputReactNative } from 'react-native';\nimport type { BaseInputProps } from '../BaseInput';\nimport { BaseInput } from '../BaseInput';\nimport type { TaggedInputProps } from '../BaseInput/useTaggedInput';\nimport { useTaggedInput } from '../BaseInput/useTaggedInput';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport { CloseIcon } from '~components/Icons';\nimport { IconButton } from '~components/Button/IconButton';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { CharacterCounter } from '~components/Form/CharacterCounter';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getPlatformType } from '~utils';\nimport { useMergeRefs } from '~utils/useMergeRefs';\nimport type {\n BladeElementRef,\n BladeElementRefWithValue,\n DataAnalyticsAttribute,\n} from '~utils/types';\nimport { hintMarginTop } from '~components/Form/formTokens';\nimport type { FormInputOnKeyDownEvent } from '~components/Form/FormTypes';\n\ntype TextAreaCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\n | 'labelSuffix'\n | 'labelTrailing'\n | 'necessityIndicator'\n | 'validationState'\n | 'helpText'\n | 'errorText'\n | 'successText'\n | 'placeholder'\n | 'defaultValue'\n | 'name'\n | 'onChange'\n | 'onFocus'\n | 'onBlur'\n | 'onSubmit'\n | 'value'\n | 'isDisabled'\n | 'isRequired'\n | 'maxCharacters'\n | 'autoFocus'\n | 'numberOfLines'\n | 'testID'\n | 'size'\n | keyof DataAnalyticsAttribute\n> & {\n /**\n * Decides whether to render a clear icon button\n */\n showClearButton?: boolean;\n /**\n * Event handler to handle the onClick event for clear button. Used when `showClearButton` is `true`\n */\n onClearButtonClick?: () => void;\n\n onKeyDown?: ({\n name,\n value,\n event,\n }: {\n name?: FormInputOnKeyDownEvent['name'];\n value: string;\n event: FormInputOnKeyDownEvent['event'];\n }) => void;\n} & TaggedInputProps &\n StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype TextAreaPropsWithA11yLabel = {\n /**\n * Label to be shown for the input field\n */\n label?: undefined;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel: string;\n};\n\n/*\n Optional accessibilityLabel prop when label is provided\n*/\ntype TextAreaPropsWithLabel = {\n /**\n * Label to be shown for the input field\n */\n label: string;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel?: string;\n};\n\ntype TextAreaProps = (TextAreaPropsWithA11yLabel | TextAreaPropsWithLabel) & TextAreaCommonProps;\n\n// need to do this to tell TS to infer type as TextInput of React Native and make it believe that `ref.current.clear()` exists\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isReactNative = (_textInputRef: any): _textInputRef is TextInputReactNative => {\n return getPlatformType() === 'react-native';\n};\n\nconst _TextArea: React.ForwardRefRenderFunction<BladeElementRef, TextAreaProps> = (\n {\n label,\n accessibilityLabel,\n labelPosition,\n labelSuffix,\n labelTrailing,\n necessityIndicator,\n errorText,\n helpText,\n successText,\n validationState,\n defaultValue,\n isDisabled,\n isRequired,\n name,\n onChange,\n onFocus,\n onBlur,\n onSubmit,\n onKeyDown,\n placeholder,\n value,\n maxCharacters,\n showClearButton,\n onClearButtonClick,\n autoFocus,\n numberOfLines = 2,\n testID,\n size = 'medium',\n isTaggedInput,\n tags,\n onTagChange,\n ...rest\n },\n ref,\n) => {\n const inputRef = React.useRef<BladeElementRefWithValue>(null);\n const mergedRef = useMergeRefs(ref, inputRef);\n const [isInputFocussed, setIsInputFocussed] = React.useState(autoFocus ?? false);\n const {\n activeTagIndex,\n setActiveTagIndex,\n getTags,\n handleTaggedInputKeydown,\n handleTaggedInputChange,\n handleTagsClear,\n } = useTaggedInput({\n tags,\n onTagChange,\n isDisabled,\n inputRef,\n isTaggedInput,\n name,\n value,\n onChange,\n });\n\n const [shouldShowClearButton, setShouldShowClearButton] = React.useState(false);\n\n React.useEffect(() => {\n setShouldShowClearButton(Boolean(showClearButton && (value?.length || defaultValue?.length)));\n }, [showClearButton, defaultValue, value]);\n\n const renderInteractionElement = (): React.ReactNode => {\n if (shouldShowClearButton) {\n return (\n <BaseBox paddingTop=\"spacing.3\" marginTop=\"spacing.1\">\n <IconButton\n icon={CloseIcon}\n accessibilityLabel=\"Clear textarea content\"\n onClick={() => {\n if (isEmpty(value) && inputRef.current) {\n // when the input field is uncontrolled take the ref and clear the input and then call the onClearButtonClick function\n if (isReactNative(inputRef.current)) {\n inputRef.current.clear();\n inputRef.current.focus();\n } else if (inputRef.current instanceof HTMLTextAreaElement) {\n inputRef.current.value = '';\n inputRef.current.focus();\n }\n }\n handleTagsClear();\n // if the input field is controlled just call the click handler and the value change shall be left upto the consumer\n onClearButtonClick?.();\n inputRef?.current?.focus();\n setShouldShowClearButton(false);\n }}\n />\n </BaseBox>\n );\n }\n\n return null;\n };\n\n return (\n <BaseInput\n as=\"textarea\"\n id=\"textarea\"\n maxTagRows=\"multiple\"\n componentName={MetaConstants.TextArea}\n autoFocus={autoFocus}\n ref={mergedRef}\n label={label as string}\n tags={isTaggedInput ? getTags({ size }) : undefined}\n activeTagIndex={activeTagIndex}\n setActiveTagIndex={setActiveTagIndex}\n isDropdownTrigger={isTaggedInput}\n showAllTags={isInputFocussed}\n accessibilityLabel={accessibilityLabel}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\n labelSuffix={labelSuffix}\n labelTrailing={labelTrailing}\n necessityIndicator={necessityIndicator}\n errorText={errorText}\n helpText={helpText}\n successText={successText}\n validationState={validationState}\n isDisabled={isDisabled}\n isRequired={isRequired}\n name={name}\n maxCharacters={maxCharacters}\n placeholder={placeholder}\n trailingInteractionElement={renderInteractionElement()}\n defaultValue={defaultValue}\n value={value}\n numberOfLines={numberOfLines}\n onChange={({ name, value }) => {\n if (showClearButton && value?.length) {\n // show the clear button when the user starts typing in\n setShouldShowClearButton(true);\n }\n\n if (shouldShowClearButton && !value?.length) {\n // hide the clear button when the input field is empty\n setShouldShowClearButton(false);\n }\n\n handleTaggedInputChange({ name, value });\n onChange?.({ name, value });\n }}\n onFocus={(e) => {\n setIsInputFocussed(true);\n onFocus?.(e);\n }}\n onBlur={(e) => {\n setIsInputFocussed(false);\n onBlur?.(e);\n }}\n onKeyDown={(e) => {\n handleTaggedInputKeydown(e);\n onKeyDown?.({\n name: e.name,\n value: e.event.currentTarget.value,\n event: e.event,\n });\n }}\n onSubmit={onSubmit}\n trailingFooterSlot={(value) => {\n return maxCharacters ? (\n <BaseBox marginTop={hintMarginTop[size]} marginRight=\"spacing.1\">\n <CharacterCounter currentCount={value?.length ?? 0} maxCount={maxCharacters} />\n </BaseBox>\n ) : null;\n }}\n testID={testID}\n size={size}\n {...rest}\n />\n );\n};\n\nconst TextArea = assignWithoutSideEffects(React.forwardRef(_TextArea), {\n displayName: 'TextArea',\n});\n\nexport type { TextAreaProps };\nexport { TextArea };\n"],"names":["isReactNative","_textInputRef","getPlatformType","_TextArea","_ref","ref","label","accessibilityLabel","labelPosition","labelSuffix","labelTrailing","necessityIndicator","errorText","helpText","successText","validationState","defaultValue","isDisabled","isRequired","name","onChange","onFocus","onBlur","onSubmit","onKeyDown","placeholder","value","maxCharacters","showClearButton","onClearButtonClick","autoFocus","_ref$numberOfLines","numberOfLines","testID","_ref$size","size","isTaggedInput","tags","onTagChange","rest","_objectWithoutProperties","_excluded","inputRef","React","useRef","mergedRef","useMergeRefs","_React$useState","useState","_React$useState2","_slicedToArray","isInputFocussed","setIsInputFocussed","_useTaggedInput","useTaggedInput","activeTagIndex","setActiveTagIndex","getTags","handleTaggedInputKeydown","handleTaggedInputChange","handleTagsClear","_React$useState3","_React$useState4","shouldShowClearButton","setShouldShowClearButton","useEffect","Boolean","length","renderInteractionElement","_jsx","BaseBox","paddingTop","marginTop","children","IconButton","icon","CloseIcon","onClick","_inputRef$current","isEmpty","current","clear","focus","HTMLTextAreaElement","BaseInput","Object","assign","as","id","maxTagRows","componentName","MetaConstants","TextArea","undefined","isDropdownTrigger","showAllTags","hideLabelText","trailingInteractionElement","_ref2","e","event","currentTarget","trailingFooterSlot","_value$length","hintMarginTop","marginRight","CharacterCounter","currentCount","maxCount","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC,CAACC,KACX,CAAC,CAAC,CACJ,CAAE,CACF7E,QAAQ,CAAEA,QAAS,CACnB+E,kBAAkB,CAAE,SAApBA,kBAAkBA,CAAG5E,KAAK,CAAK,CAAA,IAAA6E,aAAA,CAC7B,OAAO5E,aAAa,CAClB0C,GAAA,CAACC,OAAO,CAACE,CAAAA,SAAS,CAAEgC,aAAa,CAACrE,IAAI,CAAE,CAACsE,WAAW,CAAC,WAAW,CAAAhC,QAAA,CAC9DJ,GAAA,CAACqC,gBAAgB,CAACC,CAAAA,YAAY,CAAAJ,CAAAA,aAAA,CAAE7E,KAAK,EAALA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,KAAK,CAAEyC,MAAM,QAAAoC,aAAA,CAAI,CAAE,CAACK,QAAQ,CAAEjF,aAAc,CAAE,CAAC,CACxE,CAAC,CACR,IAAI,CACV,CAAE,CACFM,MAAM,CAAEA,MAAO,CACfE,IAAI,CAAEA,IAAK,CACPI,CAAAA,IAAI,CACT,CAAC,CAEN,CAAC,CAEK,IAAAqD,QAAQ,CAAGiB,wBAAwB,CAAClE,cAAK,CAACmE,UAAU,CAAC3G,SAAS,CAAC,CAAE,CACrE4G,WAAW,CAAE,UACf,CAAC;;;;"}
|
|
@@ -324,6 +324,7 @@ import '../../Icons/RefreshIcon/RefreshIcon.js';
|
|
|
324
324
|
import '../../Icons/RepeatIcon/RepeatIcon.js';
|
|
325
325
|
import '../../Icons/ReportsIcon/ReportsIcon.js';
|
|
326
326
|
import '../../Icons/ResizerIcon/ResizerIcon.js';
|
|
327
|
+
import '../../Icons/ReticleIcon/ReticleIcon.js';
|
|
327
328
|
import '../../Icons/RewindIcon/RewindIcon.js';
|
|
328
329
|
import '../../Icons/RotateClockWiseIcon/RotateClockWiseIcon.js';
|
|
329
330
|
import '../../Icons/RotateCounterClockWiseIcon/RotateCounterClockWiseIcon.js';
|