@razorpay/blade 11.9.0 → 11.10.0

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.
Files changed (119) hide show
  1. package/build/lib/native/components/Box/Box.js +1 -1
  2. package/build/lib/native/components/Box/Box.js.map +1 -1
  3. package/build/lib/native/components/Button/BaseButton/BaseButton.js +1 -1
  4. package/build/lib/native/components/Button/BaseButton/BaseButton.js.map +1 -1
  5. package/build/lib/native/components/Dropdown/Dropdown.js +1 -1
  6. package/build/lib/native/components/Dropdown/Dropdown.js.map +1 -1
  7. package/build/lib/native/components/Dropdown/dropdownComponentIds.js +1 -1
  8. package/build/lib/native/components/Dropdown/dropdownComponentIds.js.map +1 -1
  9. package/build/lib/native/components/Input/BaseInput/BaseInput.js +1 -1
  10. package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
  11. package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js +1 -1
  12. package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
  13. package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js +1 -1
  14. package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js.map +1 -1
  15. package/build/lib/native/components/Input/BaseInput/baseInputStyles.js +2 -2
  16. package/build/lib/native/components/Input/BaseInput/baseInputStyles.js.map +1 -1
  17. package/build/lib/native/components/Input/BaseInput/utils.js +4 -0
  18. package/build/lib/native/components/Input/BaseInput/utils.js.map +1 -0
  19. package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +1 -1
  20. package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  21. package/build/lib/native/components/Input/PasswordInput/PasswordInput.js +1 -1
  22. package/build/lib/native/components/Input/PasswordInput/PasswordInput.js.map +1 -1
  23. package/build/lib/native/components/Input/PhoneNumberInput/PhoneNumberInput.native.js +7 -0
  24. package/build/lib/native/components/Input/PhoneNumberInput/PhoneNumberInput.native.js.map +1 -0
  25. package/build/lib/native/components/Input/TextArea/TextArea.js +1 -1
  26. package/build/lib/native/components/Input/TextArea/TextArea.js.map +1 -1
  27. package/build/lib/native/components/Input/TextInput/TextInput.js +2 -1
  28. package/build/lib/native/components/Input/TextInput/TextInput.js.map +1 -1
  29. package/build/lib/native/components/index.js +1 -0
  30. package/build/lib/native/components/index.js.map +1 -1
  31. package/build/lib/native/utils/metaAttribute/metaConstants.js +1 -1
  32. package/build/lib/native/utils/metaAttribute/metaConstants.js.map +1 -1
  33. package/build/lib/web/development/components/Box/BaseBox/BaseBox.web.js +6 -1
  34. package/build/lib/web/development/components/Box/BaseBox/BaseBox.web.js.map +1 -1
  35. package/build/lib/web/development/components/Box/Box.js +2 -1
  36. package/build/lib/web/development/components/Box/Box.js.map +1 -1
  37. package/build/lib/web/development/components/Button/BaseButton/BaseButton.js +8 -6
  38. package/build/lib/web/development/components/Button/BaseButton/BaseButton.js.map +1 -1
  39. package/build/lib/web/development/components/Dropdown/Dropdown.js +3 -1
  40. package/build/lib/web/development/components/Dropdown/Dropdown.js.map +1 -1
  41. package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js +7 -6
  42. package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js.map +1 -1
  43. package/build/lib/web/development/components/Dropdown/dropdownComponentIds.js +1 -0
  44. package/build/lib/web/development/components/Dropdown/dropdownComponentIds.js.map +1 -1
  45. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js +8 -5
  46. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
  47. package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js +43 -28
  48. package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
  49. package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js +2 -1
  50. package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
  51. package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js +9 -7
  52. package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js.map +1 -1
  53. package/build/lib/web/development/components/Input/BaseInput/utils.js +73 -0
  54. package/build/lib/web/development/components/Input/BaseInput/utils.js.map +1 -0
  55. package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +1 -1
  56. package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  57. package/build/lib/web/development/components/Input/PasswordInput/PasswordInput.js +1 -1
  58. package/build/lib/web/development/components/Input/PasswordInput/PasswordInput.js.map +1 -1
  59. package/build/lib/web/development/components/Input/PhoneNumberInput/CountrySelector.web.js +111 -0
  60. package/build/lib/web/development/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -0
  61. package/build/lib/web/development/components/Input/PhoneNumberInput/PhoneNumberInput.web.js +242 -0
  62. package/build/lib/web/development/components/Input/PhoneNumberInput/PhoneNumberInput.web.js.map +1 -0
  63. package/build/lib/web/development/components/Input/PhoneNumberInput/index.js +2 -0
  64. package/build/lib/web/development/components/Input/PhoneNumberInput/index.js.map +1 -0
  65. package/build/lib/web/development/components/Input/TextArea/TextArea.js +1 -1
  66. package/build/lib/web/development/components/Input/TextArea/TextArea.js.map +1 -1
  67. package/build/lib/web/development/components/Input/TextInput/TextInput.js +45 -115
  68. package/build/lib/web/development/components/Input/TextInput/TextInput.js.map +1 -1
  69. package/build/lib/web/development/components/Table/TableBody.web.js +3 -0
  70. package/build/lib/web/development/components/Table/TableBody.web.js.map +1 -1
  71. package/build/lib/web/development/components/index.js +2 -0
  72. package/build/lib/web/development/components/index.js.map +1 -1
  73. package/build/lib/web/development/utils/metaAttribute/metaConstants.js +1 -0
  74. package/build/lib/web/development/utils/metaAttribute/metaConstants.js.map +1 -1
  75. package/build/lib/web/production/components/Box/BaseBox/BaseBox.web.js +6 -1
  76. package/build/lib/web/production/components/Box/BaseBox/BaseBox.web.js.map +1 -1
  77. package/build/lib/web/production/components/Box/Box.js +2 -1
  78. package/build/lib/web/production/components/Box/Box.js.map +1 -1
  79. package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +8 -6
  80. package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
  81. package/build/lib/web/production/components/Dropdown/Dropdown.js +3 -1
  82. package/build/lib/web/production/components/Dropdown/Dropdown.js.map +1 -1
  83. package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js +7 -6
  84. package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js.map +1 -1
  85. package/build/lib/web/production/components/Dropdown/dropdownComponentIds.js +1 -0
  86. package/build/lib/web/production/components/Dropdown/dropdownComponentIds.js.map +1 -1
  87. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +8 -5
  88. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
  89. package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js +43 -28
  90. package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
  91. package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js +2 -1
  92. package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
  93. package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js +9 -7
  94. package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js.map +1 -1
  95. package/build/lib/web/production/components/Input/BaseInput/utils.js +73 -0
  96. package/build/lib/web/production/components/Input/BaseInput/utils.js.map +1 -0
  97. package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +1 -1
  98. package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  99. package/build/lib/web/production/components/Input/PasswordInput/PasswordInput.js +1 -1
  100. package/build/lib/web/production/components/Input/PasswordInput/PasswordInput.js.map +1 -1
  101. package/build/lib/web/production/components/Input/PhoneNumberInput/CountrySelector.web.js +111 -0
  102. package/build/lib/web/production/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -0
  103. package/build/lib/web/production/components/Input/PhoneNumberInput/PhoneNumberInput.web.js +242 -0
  104. package/build/lib/web/production/components/Input/PhoneNumberInput/PhoneNumberInput.web.js.map +1 -0
  105. package/build/lib/web/production/components/Input/PhoneNumberInput/index.js +2 -0
  106. package/build/lib/web/production/components/Input/PhoneNumberInput/index.js.map +1 -0
  107. package/build/lib/web/production/components/Input/TextArea/TextArea.js +1 -1
  108. package/build/lib/web/production/components/Input/TextArea/TextArea.js.map +1 -1
  109. package/build/lib/web/production/components/Input/TextInput/TextInput.js +45 -115
  110. package/build/lib/web/production/components/Input/TextInput/TextInput.js.map +1 -1
  111. package/build/lib/web/production/components/Table/TableBody.web.js +3 -0
  112. package/build/lib/web/production/components/Table/TableBody.web.js.map +1 -1
  113. package/build/lib/web/production/components/index.js +2 -0
  114. package/build/lib/web/production/components/index.js.map +1 -1
  115. package/build/lib/web/production/utils/metaAttribute/metaConstants.js +1 -0
  116. package/build/lib/web/production/utils/metaAttribute/metaConstants.js.map +1 -1
  117. package/build/types/components/index.d.ts +442 -3
  118. package/build/types/components/index.native.d.ts +98 -2
  119. package/package.json +4 -4
@@ -0,0 +1,111 @@
1
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
+ import { getDialCodeByCountryCode, getFlagOfCountry } from '@razorpay/i18nify-js';
3
+ import React__default from 'react';
4
+ import styled from 'styled-components';
5
+ import '../../ActionList/index.js';
6
+ import '../../BottomSheet/index.js';
7
+ import '../../Dropdown/index.js';
8
+ import '../../Icons/index.js';
9
+ import { useIsMobile } from '../../../utils/useIsMobile.js';
10
+ import '../../../tokens/global/index.js';
11
+ import '../../../utils/index.js';
12
+ import '../../Box/BaseBox/index.js';
13
+ import { jsx, jsxs } from 'react/jsx-runtime';
14
+ import { BaseBox } from '../../Box/BaseBox/BaseBox.web.js';
15
+ import { ActionList } from '../../ActionList/ActionList.js';
16
+ import { ActionListItem, ActionListItemText } from '../../ActionList/ActionListItem.js';
17
+ import { ActionListItemAsset } from '../../ActionList/ActionListItemAsset.web.js';
18
+ import { makeSize } from '../../../utils/makeSize/makeSize.js';
19
+ import { size } from '../../../tokens/global/size.js';
20
+ import { Dropdown } from '../../Dropdown/Dropdown.js';
21
+ import { DropdownButton } from '../../Dropdown/DropdownButton.js';
22
+ import ChevronUpIcon from '../../Icons/ChevronUpIcon/ChevronUpIcon.js';
23
+ import ChevronDownIcon from '../../Icons/ChevronDownIcon/ChevronDownIcon.js';
24
+ import { BottomSheet } from '../../BottomSheet/BottomSheet.web.js';
25
+ import { BottomSheetHeader } from '../../BottomSheet/BottomSheetHeader.web.js';
26
+ import { BottomSheetBody } from '../../BottomSheet/BottomSheetBody.web.js';
27
+ import { DropdownOverlay } from '../../Dropdown/DropdownOverlay.web.js';
28
+
29
+ var countryNameFormatter = new Intl.DisplayNames(['en'], {
30
+ type: 'region'
31
+ });
32
+ var CountryDropdownButtonWrapper = /*#__PURE__*/styled(BaseBox).withConfig({
33
+ displayName: "CountrySelectorweb__CountryDropdownButtonWrapper",
34
+ componentId: "nhlxq5-0"
35
+ })(function () {
36
+ return {
37
+ '& > button': {
38
+ padding: '0',
39
+ width: '100%'
40
+ }
41
+ };
42
+ });
43
+ var CountrySelector = function CountrySelector(_ref) {
44
+ var isDisabled = _ref.isDisabled,
45
+ selectedCountry = _ref.selectedCountry,
46
+ inputWrapperRef = _ref.inputWrapperRef,
47
+ countryData = _ref.countryData,
48
+ onItemClick = _ref.onItemClick,
49
+ flags = _ref.flags,
50
+ size$1 = _ref.size;
51
+ var _React$useState = React__default.useState(false),
52
+ _React$useState2 = _slicedToArray(_React$useState, 2),
53
+ isDropdownOpen = _React$useState2[0],
54
+ setIsDropdownOpen = _React$useState2[1];
55
+ var isMobile = useIsMobile();
56
+ var actionList = /*#__PURE__*/jsx(ActionList, {
57
+ children: countryData.map(function (country) {
58
+ return /*#__PURE__*/jsx(ActionListItem, {
59
+ onClick: onItemClick,
60
+ leading: /*#__PURE__*/jsx(ActionListItemAsset, {
61
+ src: flags[country.code]['4X3'],
62
+ alt: country.name
63
+ }),
64
+ title: country.name,
65
+ value: country.code,
66
+ trailing: /*#__PURE__*/jsx(ActionListItemText, {
67
+ children: getDialCodeByCountryCode(country.code)
68
+ })
69
+ }, country.code);
70
+ })
71
+ });
72
+ var flagSize = {
73
+ medium: makeSize(size[20]),
74
+ large: makeSize(size[24])
75
+ };
76
+ return /*#__PURE__*/jsxs(Dropdown, {
77
+ isOpen: isDropdownOpen,
78
+ onOpenChange: setIsDropdownOpen,
79
+ children: [/*#__PURE__*/jsx(CountryDropdownButtonWrapper, {
80
+ width: size$1 === 'medium' ? '45px' : '60px',
81
+ marginLeft: size$1 === 'medium' ? '-3px' : '-2px',
82
+ children: /*#__PURE__*/jsx(DropdownButton, {
83
+ isDisabled: isDisabled,
84
+ size: size$1 === 'medium' ? 'xsmall' : 'medium',
85
+ variant: "tertiary",
86
+ accessibilityLabel: "".concat(countryNameFormatter.of(selectedCountry), " - Select Country"),
87
+ icon: isDropdownOpen ? ChevronUpIcon : ChevronDownIcon,
88
+ iconPosition: "right",
89
+ children: /*#__PURE__*/jsx("img", {
90
+ loading: "lazy",
91
+ role: "presentation",
92
+ width: flagSize[size$1],
93
+ src: getFlagOfCountry(selectedCountry)['4X3'],
94
+ alt: ""
95
+ })
96
+ })
97
+ }), isMobile ? /*#__PURE__*/jsxs(BottomSheet, {
98
+ children: [/*#__PURE__*/jsx(BottomSheetHeader, {
99
+ title: "Select A Country"
100
+ }), /*#__PURE__*/jsx(BottomSheetBody, {
101
+ children: actionList
102
+ })]
103
+ }) : /*#__PURE__*/jsx(DropdownOverlay, {
104
+ referenceRef: inputWrapperRef,
105
+ children: actionList
106
+ })]
107
+ });
108
+ };
109
+
110
+ export { CountrySelector, countryNameFormatter };
111
+ //# sourceMappingURL=CountrySelector.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CountrySelector.web.js","sources":["../../../../../../../src/components/Input/PhoneNumberInput/CountrySelector.web.tsx"],"sourcesContent":["import type { CountryCodeType, getFlagsForAllCountries } from '@razorpay/i18nify-js';\nimport { getDialCodeByCountryCode, getFlagOfCountry } from '@razorpay/i18nify-js';\nimport React from 'react';\nimport styled from 'styled-components';\nimport {\n ActionList,\n ActionListItem,\n ActionListItemAsset,\n ActionListItemText,\n} from '~components/ActionList';\nimport { BottomSheet, BottomSheetBody, BottomSheetHeader } from '~components/BottomSheet';\nimport type { DropdownOverlayProps } from '~components/Dropdown';\nimport { Dropdown, DropdownButton, DropdownOverlay } from '~components/Dropdown';\nimport { ChevronDownIcon, ChevronUpIcon } from '~components/Icons';\nimport { useIsMobile } from '~utils/useIsMobile';\nimport { size as sizes } from '~tokens/global';\nimport { makeSize } from '~utils';\nimport BaseBox from '~components/Box/BaseBox';\n\nconst countryNameFormatter = new Intl.DisplayNames(['en'], { type: 'region' });\n\ntype CountryData = {\n code: CountryCodeType;\n name: string;\n}[];\ntype CounterSelectorProps = {\n selectedCountry: CountryCodeType;\n inputWrapperRef: DropdownOverlayProps['referenceRef'];\n countryData: CountryData;\n onItemClick: (props: { name: string }) => void;\n flags: ReturnType<typeof getFlagsForAllCountries>;\n isDisabled?: boolean;\n size: 'medium' | 'large';\n};\n\nconst CountryDropdownButtonWrapper = styled(BaseBox)(() => {\n return {\n '& > button': {\n padding: '0',\n width: '100%',\n },\n };\n});\n\nconst CountrySelector = ({\n isDisabled,\n selectedCountry,\n inputWrapperRef,\n countryData,\n onItemClick,\n flags,\n size,\n}: CounterSelectorProps): React.ReactElement => {\n const [isDropdownOpen, setIsDropdownOpen] = React.useState(false);\n const isMobile = useIsMobile();\n\n const actionList = (\n <ActionList>\n {countryData.map((country) => {\n return (\n <ActionListItem\n key={country.code}\n onClick={onItemClick}\n leading={<ActionListItemAsset src={flags[country.code]['4X3']} alt={country.name} />}\n title={country.name}\n value={country.code}\n trailing={\n <ActionListItemText>{getDialCodeByCountryCode(country.code)}</ActionListItemText>\n }\n />\n );\n })}\n </ActionList>\n );\n\n const flagSize = {\n medium: makeSize(sizes[20]),\n large: makeSize(sizes[24]),\n } as const;\n\n return (\n <Dropdown isOpen={isDropdownOpen} onOpenChange={setIsDropdownOpen}>\n {/* TODO: Remove once CountrySelector's button sizing is fixed in figma */}\n <CountryDropdownButtonWrapper\n width={size === 'medium' ? '45px' : '60px'}\n marginLeft={size === 'medium' ? '-3px' : '-2px'}\n >\n <DropdownButton\n isDisabled={isDisabled}\n size={size === 'medium' ? 'xsmall' : 'medium'}\n variant=\"tertiary\"\n accessibilityLabel={`${countryNameFormatter.of(selectedCountry)} - Select Country`}\n icon={isDropdownOpen ? ChevronUpIcon : ChevronDownIcon}\n iconPosition=\"right\"\n >\n {/* @ts-expect-error */}\n <img\n loading=\"lazy\"\n role=\"presentation\"\n width={flagSize[size]}\n src={getFlagOfCountry(selectedCountry)['4X3']}\n alt=\"\"\n />\n </DropdownButton>\n </CountryDropdownButtonWrapper>\n {isMobile ? (\n <BottomSheet>\n <BottomSheetHeader title=\"Select A Country\" />\n <BottomSheetBody>{actionList}</BottomSheetBody>\n </BottomSheet>\n ) : (\n <DropdownOverlay referenceRef={inputWrapperRef}>{actionList}</DropdownOverlay>\n )}\n </Dropdown>\n );\n};\n\nexport { CountrySelector, countryNameFormatter };\n"],"names":["countryNameFormatter","Intl","DisplayNames","type","CountryDropdownButtonWrapper","styled","BaseBox","withConfig","displayName","componentId","padding","width","CountrySelector","_ref","isDisabled","selectedCountry","inputWrapperRef","countryData","onItemClick","flags","size","_React$useState","React","useState","_React$useState2","_slicedToArray","isDropdownOpen","setIsDropdownOpen","isMobile","useIsMobile","actionList","_jsx","ActionList","children","map","country","ActionListItem","onClick","leading","ActionListItemAsset","src","code","alt","name","title","value","trailing","ActionListItemText","getDialCodeByCountryCode","flagSize","medium","makeSize","sizes","large","_jsxs","Dropdown","isOpen","onOpenChange","marginLeft","DropdownButton","variant","accessibilityLabel","concat","of","icon","ChevronUpIcon","ChevronDownIcon","iconPosition","loading","role","getFlagOfCountry","BottomSheet","BottomSheetHeader","BottomSheetBody","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QAAS;AAC9CwC,QAAAA,OAAO,EAAC,UAAU;QAClBC,kBAAkB,EAAA,EAAA,CAAAC,MAAA,CAAK9D,oBAAoB,CAAC+D,EAAE,CAAChD,eAAe,CAAC,EAAoB,mBAAA,CAAA;AACnFiD,QAAAA,IAAI,EAAEtC,cAAc,GAAGuC,aAAa,GAAGC,eAAgB;AACvDC,QAAAA,YAAY,EAAC,OAAO;AAAAlC,QAAAA,QAAA,eAGpBF,GAAA,CAAA,KAAA,EAAA;AACEqC,UAAAA,OAAO,EAAC,MAAM;AACdC,UAAAA,IAAI,EAAC,cAAc;AACnB1D,UAAAA,KAAK,EAAEsC,QAAQ,CAAC7B,MAAI,CAAE;AACtBoB,UAAAA,GAAG,EAAE8B,gBAAgB,CAACvD,eAAe,CAAC,CAAC,KAAK,CAAE;AAC9C2B,UAAAA,GAAG,EAAC,EAAA;SACL,CAAA;OACa,CAAA;AAAC,KACW,CAAC,EAC9Bd,QAAQ,gBACP0B,IAAA,CAACiB,WAAW,EAAA;MAAAtC,QAAA,EAAA,cACVF,GAAA,CAACyC,iBAAiB,EAAA;AAAC5B,QAAAA,KAAK,EAAC,kBAAA;AAAkB,OAAE,CAAC,eAC9Cb,GAAA,CAAC0C,eAAe,EAAA;AAAAxC,QAAAA,QAAA,EAAEH,UAAAA;AAAU,OAAkB,CAAC,CAAA;AAAA,KACpC,CAAC,gBAEdC,GAAA,CAAC2C,eAAe,EAAA;AAACC,MAAAA,YAAY,EAAE3D,eAAgB;AAAAiB,MAAAA,QAAA,EAAEH,UAAAA;AAAU,KAAkB,CAC9E,CAAA;AAAA,GACO,CAAC,CAAA;AAEf;;;;"}
@@ -0,0 +1,242 @@
1
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
3
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
4
+ import { getFlagsForAllCountries, formatPhoneNumber, getDialCodeByCountryCode } from '@razorpay/i18nify-js';
5
+ import React__default from 'react';
6
+ import { countryNameFormatter, CountrySelector } from './CountrySelector.web.js';
7
+ import '../BaseInput/index.js';
8
+ import '../../Button/IconButton/index.js';
9
+ import isEmpty from '../../../utils/lodashButBetter/isEmpty.js';
10
+ import { getKeyboardAndAutocompleteProps } from '../BaseInput/utils.js';
11
+ import '../../../utils/assignWithoutSideEffects/index.js';
12
+ import { useMergeRefs } from '../../../utils/useMergeRefs.js';
13
+ import '../../Icons/index.js';
14
+ import '../../../utils/metaAttribute/index.js';
15
+ import { useControllableState } from '../../../utils/useControllable.js';
16
+ import { jsx } from 'react/jsx-runtime';
17
+ import { IconButton } from '../../Button/IconButton/IconButton.js';
18
+ import CloseIcon from '../../Icons/CloseIcon/CloseIcon.js';
19
+ import { BaseInput } from '../BaseInput/BaseInput.js';
20
+ import { MetaConstants } from '../../../utils/metaAttribute/metaConstants.js';
21
+ import { assignWithoutSideEffects } from '../../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
22
+
23
+ var _excluded = ["defaultCountry", "country", "onCountryChange", "label", "labelPosition", "defaultValue", "value", "name", "onChange", "necessityIndicator", "isRequired", "isDisabled", "leadingIcon", "trailingIcon", "validationState", "errorText", "helpText", "successText", "size", "onClearButtonClick", "showCountrySelector", "showDialCode", "onClick", "onBlur", "onFocus", "accessibilityLabel", "autoFocus", "testID", "keyboardReturnKeyType", "autoCompleteSuggestionType", "allowedCountries"];
24
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
25
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
26
+ var _PhoneNumberInput = function _PhoneNumberInput(_ref, ref) {
27
+ var _ref$defaultCountry = _ref.defaultCountry,
28
+ defaultCountry = _ref$defaultCountry === void 0 ? 'IN' : _ref$defaultCountry,
29
+ country = _ref.country,
30
+ onCountryChange = _ref.onCountryChange,
31
+ label = _ref.label,
32
+ labelPosition = _ref.labelPosition,
33
+ defaultValue = _ref.defaultValue,
34
+ value = _ref.value,
35
+ name = _ref.name,
36
+ onChange = _ref.onChange,
37
+ necessityIndicator = _ref.necessityIndicator,
38
+ isRequired = _ref.isRequired,
39
+ isDisabled = _ref.isDisabled,
40
+ leadingIcon = _ref.leadingIcon,
41
+ trailingIcon = _ref.trailingIcon,
42
+ validationState = _ref.validationState,
43
+ errorText = _ref.errorText,
44
+ helpText = _ref.helpText,
45
+ successText = _ref.successText,
46
+ _ref$size = _ref.size,
47
+ size = _ref$size === void 0 ? 'medium' : _ref$size,
48
+ onClearButtonClick = _ref.onClearButtonClick,
49
+ _ref$showCountrySelec = _ref.showCountrySelector,
50
+ showCountrySelector = _ref$showCountrySelec === void 0 ? true : _ref$showCountrySelec,
51
+ _ref$showDialCode = _ref.showDialCode,
52
+ showDialCode = _ref$showDialCode === void 0 ? true : _ref$showDialCode,
53
+ onClick = _ref.onClick,
54
+ onBlur = _ref.onBlur,
55
+ onFocus = _ref.onFocus,
56
+ _ref$accessibilityLab = _ref.accessibilityLabel,
57
+ accessibilityLabel = _ref$accessibilityLab === void 0 ? 'Enter phone number' : _ref$accessibilityLab,
58
+ autoFocus = _ref.autoFocus,
59
+ testID = _ref.testID,
60
+ _ref$keyboardReturnKe = _ref.keyboardReturnKeyType,
61
+ keyboardReturnKeyType = _ref$keyboardReturnKe === void 0 ? 'done' : _ref$keyboardReturnKe,
62
+ autoCompleteSuggestionType = _ref.autoCompleteSuggestionType,
63
+ allowedCountries = _ref.allowedCountries,
64
+ styledProps = _objectWithoutProperties(_ref, _excluded);
65
+ var inputRef = React__default.useRef(null);
66
+ var mergedRef = useMergeRefs(ref, inputRef);
67
+ var inputWrapperRef = React__default.useRef(null);
68
+ var _React$useState = React__default.useState(false),
69
+ _React$useState2 = _slicedToArray(_React$useState, 2),
70
+ shouldShowClearButton = _React$useState2[0],
71
+ setShouldShowClearButton = _React$useState2[1];
72
+ var _useControllableState = useControllableState({
73
+ defaultValue: defaultCountry,
74
+ value: country,
75
+ onChange: function onChange(country) {
76
+ return onCountryChange === null || onCountryChange === void 0 ? void 0 : onCountryChange({
77
+ country: country
78
+ });
79
+ }
80
+ }),
81
+ _useControllableState2 = _slicedToArray(_useControllableState, 2),
82
+ selectedCountry = _useControllableState2[0],
83
+ setSelectedCountry = _useControllableState2[1];
84
+ React__default.useEffect(function () {
85
+ setShouldShowClearButton(Boolean(defaultValue !== null && defaultValue !== void 0 ? defaultValue : value));
86
+ }, [defaultValue, value]);
87
+ var renderTrailingInteractionElement = function renderTrailingInteractionElement() {
88
+ if (!shouldShowClearButton) return null;
89
+ return /*#__PURE__*/jsx(IconButton, {
90
+ size: "medium",
91
+ icon: CloseIcon,
92
+ onClick: function onClick() {
93
+ var _inputRef$current;
94
+ if (isEmpty(value) && inputRef.current) {
95
+ // when the input field is uncontrolled take the ref and clear the input and then call the onClearButtonClick function
96
+ if (inputRef.current instanceof HTMLInputElement) {
97
+ inputRef.current.value = '';
98
+ inputRef.current.focus();
99
+ }
100
+ }
101
+ // if the input field is controlled just call the click handler and the value change shall be left upto the consumer
102
+ onClearButtonClick === null || onClearButtonClick === void 0 ? void 0 : onClearButtonClick();
103
+ inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
104
+ setShouldShowClearButton(false);
105
+ },
106
+ isDisabled: isDisabled,
107
+ accessibilityLabel: "Clear Input Content"
108
+ });
109
+ };
110
+ var flags = React__default.useMemo(function () {
111
+ return getFlagsForAllCountries();
112
+ }, []);
113
+ var countryData = React__default.useMemo(function () {
114
+ if (allowedCountries) {
115
+ return allowedCountries.map(function (countryCode) {
116
+ return {
117
+ code: countryCode,
118
+ name: countryNameFormatter.of(countryCode)
119
+ };
120
+ });
121
+ }
122
+ return Object.keys(flags).map(function (countryCode) {
123
+ return {
124
+ code: countryCode,
125
+ name: countryNameFormatter.of(countryCode)
126
+ };
127
+ }).sort(function (a, b) {
128
+ return a.name.localeCompare(b.name);
129
+ });
130
+ }, [allowedCountries, flags]);
131
+ var handleOnChange = function handleOnChange(_ref2) {
132
+ var name = _ref2.name,
133
+ value = _ref2.value,
134
+ selectedCountry = _ref2.selectedCountry;
135
+ onChange === null || onChange === void 0 ? void 0 : onChange({
136
+ name: name,
137
+ value: value,
138
+ phoneNumber: value ? formatPhoneNumber(value, selectedCountry) : undefined,
139
+ dialCode: getDialCodeByCountryCode(selectedCountry),
140
+ country: selectedCountry
141
+ });
142
+ };
143
+ var onItemClick = function onItemClick(_ref3) {
144
+ var _inputRef$current2, _inputRef$current3, _inputRef$current4;
145
+ var name = _ref3.name;
146
+ var selectedCountry = name;
147
+ setSelectedCountry(function () {
148
+ return selectedCountry;
149
+ });
150
+ handleOnChange({
151
+ selectedCountry: selectedCountry,
152
+ name: (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.name,
153
+ value: (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.value
154
+ });
155
+ (_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : _inputRef$current4.focus();
156
+ };
157
+ return /*#__PURE__*/jsx(BaseInput, _objectSpread(_objectSpread({
158
+ setInputWrapperRef: function setInputWrapperRef(node) {
159
+ inputWrapperRef.current = node;
160
+ },
161
+ ref: mergedRef,
162
+ id: "phone-number-input",
163
+ componentName: MetaConstants.PhoneNumberInput,
164
+ label: label,
165
+ hideLabelText: !Boolean(label),
166
+ labelPosition: labelPosition,
167
+ defaultValue: defaultValue,
168
+ value: value,
169
+ name: name,
170
+ placeholder: formatPhoneNumber('1234567890', selectedCountry),
171
+ trailingIcon: trailingIcon,
172
+ leadingIcon: leadingIcon,
173
+ prefix: showDialCode ? getDialCodeByCountryCode(selectedCountry) : undefined,
174
+ trailingInteractionElement: renderTrailingInteractionElement(),
175
+ leadingInteractionElement: showCountrySelector ? /*#__PURE__*/jsx(CountrySelector, {
176
+ size: size,
177
+ countryData: countryData,
178
+ flags: flags,
179
+ inputWrapperRef: inputWrapperRef,
180
+ isDisabled: isDisabled,
181
+ selectedCountry: selectedCountry,
182
+ onItemClick: onItemClick
183
+ }) : null,
184
+ onChange: function onChange(_ref4) {
185
+ var name = _ref4.name,
186
+ value = _ref4.value;
187
+ if (value !== null && value !== void 0 && value.length) {
188
+ // show the clear button when the user starts typing in
189
+ setShouldShowClearButton(true);
190
+ }
191
+ if (shouldShowClearButton && !(value !== null && value !== void 0 && value.length)) {
192
+ // hide the clear button when the input field is empty
193
+ setShouldShowClearButton(false);
194
+ }
195
+ handleOnChange({
196
+ name: name,
197
+ value: value,
198
+ selectedCountry: selectedCountry
199
+ });
200
+ },
201
+ onClick: onClick,
202
+ onFocus: onFocus,
203
+ onBlur: onBlur,
204
+ isDisabled: isDisabled,
205
+ accessibilityLabel: accessibilityLabel,
206
+ necessityIndicator: necessityIndicator,
207
+ isRequired: isRequired,
208
+ validationState: validationState,
209
+ errorText: errorText,
210
+ helpText: helpText,
211
+ successText: successText
212
+ // eslint-disable-next-line jsx-a11y/no-autofocus
213
+ ,
214
+ autoFocus: autoFocus,
215
+ testID: testID,
216
+ size: size
217
+ }, getKeyboardAndAutocompleteProps({
218
+ type: 'number',
219
+ keyboardReturnKeyType: keyboardReturnKeyType,
220
+ autoCompleteSuggestionType: autoCompleteSuggestionType,
221
+ autoCapitalize: 'none'
222
+ })), {}, {
223
+ type: "telephone"
224
+ }, styledProps));
225
+ };
226
+
227
+ /**
228
+ * PhoneNumberInput is a component that allows users to input phone numbers.
229
+ * It provides a country selector dropdown to select the country code.
230
+ *
231
+ * @example
232
+ *
233
+ * ```ts
234
+ * <PhoneNumberInput />
235
+ * ```
236
+ */
237
+ var PhoneNumberInput = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/React__default.forwardRef(_PhoneNumberInput), {
238
+ displayName: 'PhoneNumberInput'
239
+ });
240
+
241
+ export { PhoneNumberInput };
242
+ //# sourceMappingURL=PhoneNumberInput.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PhoneNumberInput.web.js","sources":["../../../../../../../src/components/Input/PhoneNumberInput/PhoneNumberInput.web.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport type { CountryCodeType } from '@razorpay/i18nify-js';\nimport {\n formatPhoneNumber,\n getDialCodeByCountryCode,\n getFlagsForAllCountries,\n} from '@razorpay/i18nify-js';\nimport React from 'react';\nimport type { PhoneNumberInputProps } from './types';\nimport { countryNameFormatter, CountrySelector } from './CountrySelector';\nimport { BaseInput } from '~components/Input/BaseInput';\nimport { IconButton } from '~components/Button/IconButton';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport { getKeyboardAndAutocompleteProps } from '~components/Input/BaseInput/utils';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { useMergeRefs } from '~utils/useMergeRefs';\nimport type { BladeElementRef } from '~utils/types';\nimport { CloseIcon } from '~components/Icons';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { useControllableState } from '~utils/useControllable';\n\nconst _PhoneNumberInput: React.ForwardRefRenderFunction<BladeElementRef, PhoneNumberInputProps> = (\n {\n defaultCountry = 'IN',\n country,\n onCountryChange,\n label,\n labelPosition,\n defaultValue,\n value,\n name,\n onChange,\n necessityIndicator,\n isRequired,\n isDisabled,\n leadingIcon,\n trailingIcon,\n validationState,\n errorText,\n helpText,\n successText,\n size = 'medium',\n onClearButtonClick,\n showCountrySelector = true,\n showDialCode = true,\n onClick,\n onBlur,\n onFocus,\n accessibilityLabel = 'Enter phone number',\n autoFocus,\n testID,\n keyboardReturnKeyType = 'done',\n autoCompleteSuggestionType,\n allowedCountries,\n ...styledProps\n },\n ref,\n): React.ReactElement => {\n const inputRef = React.useRef<HTMLInputElement | null>(null);\n const mergedRef = useMergeRefs(ref, inputRef);\n\n const inputWrapperRef = React.useRef<HTMLDivElement | null>(null);\n const [shouldShowClearButton, setShouldShowClearButton] = React.useState(false);\n const [selectedCountry, setSelectedCountry] = useControllableState<CountryCodeType>({\n defaultValue: defaultCountry as CountryCodeType,\n value: country,\n onChange: (country) => onCountryChange?.({ country }),\n });\n\n React.useEffect(() => {\n setShouldShowClearButton(Boolean(defaultValue ?? value));\n }, [defaultValue, value]);\n\n const renderTrailingInteractionElement = (): React.ReactNode => {\n if (!shouldShowClearButton) return null;\n return (\n <IconButton\n size=\"medium\"\n icon={CloseIcon}\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 (inputRef.current instanceof HTMLInputElement) {\n inputRef.current.value = '';\n inputRef.current.focus();\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 inputRef?.current?.focus();\n setShouldShowClearButton(false);\n }}\n isDisabled={isDisabled}\n accessibilityLabel=\"Clear Input Content\"\n />\n );\n };\n\n const flags = React.useMemo(() => getFlagsForAllCountries(), []);\n const countryData = React.useMemo(() => {\n if (allowedCountries) {\n return allowedCountries.map((countryCode) => {\n return {\n code: countryCode,\n name: countryNameFormatter.of(countryCode)!,\n };\n });\n }\n\n return (Object.keys(flags) as CountryCodeType[])\n .map((countryCode) => {\n return {\n code: countryCode,\n name: countryNameFormatter.of(countryCode)!,\n };\n })\n .sort((a, b) => a.name.localeCompare(b.name));\n }, [allowedCountries, flags]);\n\n const handleOnChange = ({\n name,\n value,\n selectedCountry,\n }: {\n name?: string;\n value?: string;\n selectedCountry: CountryCodeType;\n }): void => {\n onChange?.({\n name: name!,\n value: value!,\n phoneNumber: value ? formatPhoneNumber(value, selectedCountry) : undefined!,\n dialCode: getDialCodeByCountryCode(selectedCountry),\n country: selectedCountry,\n });\n };\n\n const onItemClick = ({ name }: { name: string }): void => {\n const selectedCountry = name as CountryCodeType;\n setSelectedCountry(() => selectedCountry);\n handleOnChange({\n selectedCountry,\n name: inputRef.current?.name,\n value: inputRef.current?.value,\n });\n inputRef.current?.focus();\n };\n\n return (\n <BaseInput\n setInputWrapperRef={(node) => {\n inputWrapperRef.current = node as HTMLInputElement;\n }}\n ref={mergedRef}\n id=\"phone-number-input\"\n componentName={MetaConstants.PhoneNumberInput}\n label={label as string}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\n defaultValue={defaultValue}\n value={value}\n name={name}\n placeholder={formatPhoneNumber('1234567890', selectedCountry)}\n trailingIcon={trailingIcon}\n leadingIcon={leadingIcon}\n prefix={showDialCode ? getDialCodeByCountryCode(selectedCountry) : undefined}\n trailingInteractionElement={renderTrailingInteractionElement()}\n leadingInteractionElement={\n showCountrySelector ? (\n <CountrySelector\n size={size}\n countryData={countryData}\n flags={flags}\n inputWrapperRef={inputWrapperRef}\n isDisabled={isDisabled}\n selectedCountry={selectedCountry}\n onItemClick={onItemClick}\n />\n ) : null\n }\n onChange={({ name, value }) => {\n if (value?.length) {\n // show the clear button when the user starts typing in\n setShouldShowClearButton(true);\n }\n if (shouldShowClearButton && !value?.length) {\n // hide the clear button when the input field is empty\n setShouldShowClearButton(false);\n }\n handleOnChange({ name, value, selectedCountry });\n }}\n onClick={onClick}\n onFocus={onFocus}\n onBlur={onBlur}\n isDisabled={isDisabled}\n accessibilityLabel={accessibilityLabel}\n necessityIndicator={necessityIndicator}\n isRequired={isRequired}\n validationState={validationState}\n errorText={errorText}\n helpText={helpText}\n successText={successText}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n testID={testID}\n size={size}\n {...getKeyboardAndAutocompleteProps({\n type: 'number',\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n autoCapitalize: 'none',\n })}\n type=\"telephone\"\n {...styledProps}\n />\n );\n};\n\n/**\n * PhoneNumberInput is a component that allows users to input phone numbers.\n * It provides a country selector dropdown to select the country code.\n *\n * @example\n *\n * ```ts\n * <PhoneNumberInput />\n * ```\n */\nconst PhoneNumberInput = assignWithoutSideEffects(React.forwardRef(_PhoneNumberInput), {\n displayName: 'PhoneNumberInput',\n});\n\nexport { PhoneNumberInput };\n"],"names":["_PhoneNumberInput","_ref","ref","_ref$defaultCountry","defaultCountry","country","onCountryChange","label","labelPosition","defaultValue","value","name","onChange","necessityIndicator","isRequired","isDisabled","leadingIcon","trailingIcon","validationState","errorText","helpText","successText","_ref$size","size","onClearButtonClick","_ref$showCountrySelec","showCountrySelector","_ref$showDialCode","showDialCode","onClick","onBlur","onFocus","_ref$accessibilityLab","accessibilityLabel","autoFocus","testID","_ref$keyboardReturnKe","keyboardReturnKeyType","autoCompleteSuggestionType","allowedCountries","styledProps","_objectWithoutProperties","_excluded","inputRef","React","useRef","mergedRef","useMergeRefs","inputWrapperRef","_React$useState","useState","_React$useState2","_slicedToArray","shouldShowClearButton","setShouldShowClearButton","_useControllableState","useControllableState","_useControllableState2","selectedCountry","setSelectedCountry","useEffect","Boolean","renderTrailingInteractionElement","_jsx","IconButton","icon","CloseIcon","_inputRef$current","isEmpty","current","HTMLInputElement","focus","flags","useMemo","getFlagsForAllCountries","countryData","map","countryCode","code","countryNameFormatter","of","Object","keys","sort","a","b","localeCompare","handleOnChange","_ref2","phoneNumber","formatPhoneNumber","undefined","dialCode","getDialCodeByCountryCode","onItemClick","_ref3","_inputRef$current2","_inputRef$current3","_inputRef$current4","BaseInput","_objectSpread","setInputWrapperRef","node","id","componentName","MetaConstants","PhoneNumberInput","hideLabelText","placeholder","prefix","trailingInteractionElement","leadingInteractionElement","CountrySelector","_ref4","length","getKeyboardAndAutocompleteProps","type","auto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AAA;KAChD;AACF7B,IAAAA,OAAO,EAAEA,OAAQ;AACjBE,IAAAA,OAAO,EAAEA,OAAQ;AACjBD,IAAAA,MAAM,EAAEA,MAAO;AACff,IAAAA,UAAU,EAAEA,UAAW;AACvBkB,IAAAA,kBAAkB,EAAEA,kBAAmB;AACvCpB,IAAAA,kBAAkB,EAAEA,kBAAmB;AACvCC,IAAAA,UAAU,EAAEA,UAAW;AACvBI,IAAAA,eAAe,EAAEA,eAAgB;AACjCC,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,QAAQ,EAAEA,QAAS;AACnBC,IAAAA,WAAW,EAAEA,WAAAA;AACb;AAAA;AACAa,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,MAAM,EAAEA,MAAO;AACfZ,IAAAA,IAAI,EAAEA,IAAAA;AAAK,GAAA,EACP4F,+BAA+B,CAAC;AAClCC,IAAAA,IAAI,EAAE,QAAQ;AACd/E,IAAAA,qBAAqB,EAArBA,qBAAqB;AACrBC,IAAAA,0BAA0B,EAA1BA,0BAA0B;AAC1B+E,IAAAA,cAAc,EAAE,MAAA;AAClB,GAAC,CAAC,CAAA,EAAA,EAAA,EAAA;AACFD,IAAAA,IAAI,EAAC,WAAA;GACD5E,EAAAA,WAAW,CAChB,CAAC,CAAA;AAEN,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACMkE,IAAAA,gBAAgB,gBAAGY,wBAAwB,eAAC1E,cAAK,CAAC2E,UAAU,CAACvH,iBAAiB,CAAC,EAAE;AACrFwH,EAAAA,WAAW,EAAE,kBAAA;AACf,CAAC;;;;"}
@@ -0,0 +1,2 @@
1
+ export { PhoneNumberInput } from './PhoneNumberInput.web.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -119,7 +119,7 @@ var _TextArea = function _TextArea(_ref, ref) {
119
119
  name: name,
120
120
  maxCharacters: maxCharacters,
121
121
  placeholder: placeholder,
122
- interactionElement: renderInteractionElement(),
122
+ trailingInteractionElement: renderInteractionElement(),
123
123
  defaultValue: defaultValue,
124
124
  value: value,
125
125
  numberOfLines: numberOfLines,
@@ -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 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 { BladeElementRef } from '~utils/types';\nimport { hintMarginTop } from '~components/Form/formTokens';\n\ntype TextAreaCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\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> & {\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} & 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 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 placeholder,\n value,\n maxCharacters,\n showClearButton,\n onClearButtonClick,\n autoFocus,\n numberOfLines = 2,\n testID,\n size = 'medium',\n ...styledProps\n },\n ref,\n) => {\n const inputRef = React.useRef<BladeElementRef>(null);\n const mergedRef = useMergeRefs(ref, inputRef);\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 // 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 componentName={MetaConstants.TextArea}\n autoFocus={autoFocus}\n ref={mergedRef}\n label={label as string}\n accessibilityLabel={accessibilityLabel}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\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 interactionElement={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 onChange?.({ name, value });\n }}\n onFocus={onFocus}\n onBlur={onBlur}\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 {...styledProps}\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","necessityIndicator","errorText","helpText","successText","validationState","defaultValue","isDisabled","isRequired","name","onChange","onFocus","onBlur","onSubmit","placeholder","value","maxCharacters","showClearButton","onClearButtonClick","autoFocus","_ref$numberOfLines","numberOfLines","testID","_ref$size","size","styledProps","_objectWithoutProperties","_excluded","inputRef","React","useRef","mergedRef","useMergeRefs","_React$useState","useState","_React$useState2","_slicedToArray","shouldShowClearButton","setShouldShowClearButton","useEffect","Boolean","length","renderInteractionElement","_jsx","BaseBox","paddingTop","marginTop","children","IconButton","icon","CloseIcon","onClick","_inputRef$current","isEmpty","current","clear","focus","HTMLTextAreaElement","BaseInput","_objectSpread","as","id","componentName","MetaConstants","TextArea","hideLabelText","interactionElement","_ref2","trailingFooterSlot","_value$length","hintMarginTop","marginRight","CharacterCounter","currentCount","maxCount","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFA;AACA;AACA,IAAMA,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,aAAkB,EAA4C;AACnF,EAAA,OAAOC,eAAe,EAAE,KAAK,cAAc,CAAA;AAC7C,CAAC,CAAA;AAED,IAAMC,SAAyE,GAAG,SAA5EA,SAAyEA,CAAAC,IAAA,EA6B7EC,GAAG,EACA;AAAA,EAAA,IA5BDC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,kBAAkB,GAAAH,IAAA,CAAlBG,kBAAkB;IAClBC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,kBAAkB,GAAAL,IAAA,CAAlBK,kBAAkB;IAClBC,SAAS,GAAAN,IAAA,CAATM,SAAS;IACTC,QAAQ,GAAAP,IAAA,CAARO,QAAQ;IACRC,WAAW,GAAAR,IAAA,CAAXQ,WAAW;IACXC,eAAe,GAAAT,IAAA,CAAfS,eAAe;IACfC,YAAY,GAAAV,IAAA,CAAZU,YAAY;IACZC,UAAU,GAAAX,IAAA,CAAVW,UAAU;IACVC,UAAU,GAAAZ,IAAA,CAAVY,UAAU;IACVC,IAAI,GAAAb,IAAA,CAAJa,IAAI;IACJC,SAAQ,GAAAd,IAAA,CAARc,QAAQ;IACRC,OAAO,G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B,gBAAgB,EAAA;AAACC,UAAAA,YAAY,EAAAJ,CAAAA,aAAA,GAAEtD,KAAK,aAALA,KAAK,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAALA,KAAK,CAAE0B,MAAM,MAAA4B,IAAAA,IAAAA,aAAA,KAAAA,KAAAA,CAAAA,GAAAA,aAAA,GAAI,CAAE;AAACK,UAAAA,QAAQ,EAAE1D,aAAAA;SAAgB,CAAA;OACvE,CAAC,GACR,IAAI,CAAA;KACR;AACFM,IAAAA,MAAM,EAAEA,MAAO;AACfE,IAAAA,IAAI,EAAEA,IAAAA;GACFC,EAAAA,WAAW,CAChB,CAAC,CAAA;AAEN,CAAC,CAAA;AAEKuC,IAAAA,QAAQ,gBAAGW,wBAAwB,eAAC9C,cAAK,CAAC+C,UAAU,CAACjF,SAAS,CAAC,EAAE;AACrEkF,EAAAA,WAAW,EAAE,UAAA;AACf,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 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 { BladeElementRef } from '~utils/types';\nimport { hintMarginTop } from '~components/Form/formTokens';\n\ntype TextAreaCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\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> & {\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} & 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 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 placeholder,\n value,\n maxCharacters,\n showClearButton,\n onClearButtonClick,\n autoFocus,\n numberOfLines = 2,\n testID,\n size = 'medium',\n ...styledProps\n },\n ref,\n) => {\n const inputRef = React.useRef<BladeElementRef>(null);\n const mergedRef = useMergeRefs(ref, inputRef);\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 // 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 componentName={MetaConstants.TextArea}\n autoFocus={autoFocus}\n ref={mergedRef}\n label={label as string}\n accessibilityLabel={accessibilityLabel}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\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 onChange?.({ name, value });\n }}\n onFocus={onFocus}\n onBlur={onBlur}\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 {...styledProps}\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","necessityIndicator","errorText","helpText","successText","validationState","defaultValue","isDisabled","isRequired","name","onChange","onFocus","onBlur","onSubmit","placeholder","value","maxCharacters","showClearButton","onClearButtonClick","autoFocus","_ref$numberOfLines","numberOfLines","testID","_ref$size","size","styledProps","_objectWithoutProperties","_excluded","inputRef","React","useRef","mergedRef","useMergeRefs","_React$useState","useState","_React$useState2","_slicedToArray","shouldShowClearButton","setShouldShowClearButton","useEffect","Boolean","length","renderInteractionElement","_jsx","BaseBox","paddingTop","marginTop","children","IconButton","icon","CloseIcon","onClick","_inputRef$current","isEmpty","current","clear","focus","HTMLTextAreaElement","BaseInput","_objectSpread","as","id","componentName","MetaConstants","TextArea","hideLabelText","trailingInteractionElement","_ref2","trailingFooterSlot","_value$length","hintMarginTop","marginRight","CharacterCounter","currentCount","maxCount","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFA;AACA;AACA,IAAMA,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,aAAkB,EAA4C;AACnF,EAAA,OAAOC,eAAe,EAAE,KAAK,cAAc,CAAA;AAC7C,CAAC,CAAA;AAED,IAAMC,SAAyE,GAAG,SAA5EA,SAAyEA,CAAAC,IAAA,EA6B7EC,GAAG,EACA;AAAA,EAAA,IA5BDC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,kBAAkB,GAAAH,IAAA,CAAlBG,kBAAkB;IAClBC,aAAa,GAAAJ,IAAA,CAAbI,aA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