@razorpay/blade 12.32.3 → 12.33.2
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/Accordion/AccordionButton.native.js +1 -1
- package/build/lib/native/components/Accordion/AccordionButton.native.js.map +1 -1
- package/build/lib/native/components/Accordion/AccordionItemHeader.js +2 -1
- package/build/lib/native/components/Accordion/AccordionItemHeader.js.map +1 -1
- package/build/lib/native/components/Accordion/commonStyles.js +1 -1
- package/build/lib/native/components/Accordion/commonStyles.js.map +1 -1
- package/build/lib/native/components/ActionList/ActionListItem.js +1 -1
- package/build/lib/native/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/native/components/ActionList/ActionListNoResults.js +2 -2
- package/build/lib/native/components/Alert/Alert.js +2 -2
- package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js +4 -4
- package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/native/components/BottomSheet/BottomSheetCommon.js +3 -3
- package/build/lib/native/components/Button/BaseButton/BaseButton.js +1 -1
- package/build/lib/native/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js +1 -1
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/native/components/Carousel/NavigationButton/NavigationButton.js +2 -2
- package/build/lib/native/components/Collapsible/CollapsibleChevronIcon.native.js +2 -2
- package/build/lib/native/components/Dropdown/Dropdown.js +1 -1
- package/build/lib/native/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/native/components/Dropdown/DropdownButton.js +1 -1
- package/build/lib/native/components/Dropdown/DropdownButton.js.map +1 -1
- package/build/lib/native/components/Dropdown/InputDropdownButton.native.js +7 -0
- package/build/lib/native/components/Dropdown/InputDropdownButton.native.js.map +1 -0
- package/build/lib/native/components/Dropdown/dropdownComponentIds.js +1 -1
- package/build/lib/native/components/Dropdown/dropdownComponentIds.js.map +1 -1
- package/build/lib/native/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/native/components/Form/FormHint.js +2 -2
- package/build/lib/native/components/Icons/ChevronUpDownIcon/ChevronUpDownIcon.js +12 -0
- package/build/lib/native/components/Icons/ChevronUpDownIcon/ChevronUpDownIcon.js.map +1 -0
- package/build/lib/native/components/Icons/useIconProps/iconSizeMap.js +8 -0
- package/build/lib/native/components/Icons/useIconProps/iconSizeMap.js.map +1 -0
- package/build/lib/native/components/Icons/useIconProps/useIconProps.js +2 -4
- package/build/lib/native/components/Icons/useIconProps/useIconProps.js.map +1 -1
- package/build/lib/native/components/InfoGroup/InfoGroup.native.js +7 -0
- package/build/lib/native/components/InfoGroup/InfoGroup.native.js.map +1 -0
- package/build/lib/native/components/Input/BaseInput/BaseInput.js +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/baseInputStyles.js +1 -1
- package/build/lib/native/components/Input/BaseInput/baseInputStyles.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/baseInputTokens.js +1 -1
- package/build/lib/native/components/Input/BaseInput/baseInputTokens.js.map +1 -1
- package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +2 -5
- package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
- package/build/lib/native/components/Input/DropdownInputTriggers/Chevron.js +2 -2
- package/build/lib/native/components/Input/PasswordInput/PasswordInput.js +2 -2
- package/build/lib/native/components/Input/SearchInput/SearchInput.js +14 -5
- package/build/lib/native/components/Input/SearchInput/SearchInput.js.map +1 -1
- package/build/lib/native/components/Input/TextArea/TextArea.js +2 -2
- package/build/lib/native/components/Input/TextInput/TextInput.js +13 -5
- package/build/lib/native/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/native/components/Popover/PopoverCloseButton.js +2 -2
- package/build/lib/native/components/Table/tokens.js +2 -2
- package/build/lib/native/components/Typography/Text/Text.js +1 -1
- package/build/lib/native/components/Typography/Text/Text.js.map +1 -1
- package/build/lib/native/components/index.js +3 -0
- package/build/lib/native/components/index.js.map +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/native/utils/useControlledDropdownInput/useControlledDropdownInput.js +14 -0
- package/build/lib/native/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -0
- package/build/lib/web/development/components/Accordion/AccordionItemHeader.js +18 -2
- package/build/lib/web/development/components/Accordion/AccordionItemHeader.js.map +1 -1
- package/build/lib/web/development/components/Accordion/StyledAccordionButton.web.js +4 -3
- package/build/lib/web/development/components/Accordion/StyledAccordionButton.web.js.map +1 -1
- package/build/lib/web/development/components/Accordion/commonStyles.js +1 -11
- package/build/lib/web/development/components/Accordion/commonStyles.js.map +1 -1
- package/build/lib/web/development/components/ActionList/ActionListItem.js +2 -1
- package/build/lib/web/development/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js +6 -3
- package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js +24 -3
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/StyledBaseButton.web.js +14 -2
- package/build/lib/web/development/components/Button/BaseButton/StyledBaseButton.web.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js +19 -0
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/Dropdown.js +4 -1
- package/build/lib/web/development/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/DropdownButton.js +4 -1
- package/build/lib/web/development/components/Dropdown/DropdownButton.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js +4 -2
- package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/InputDropdownButton.web.js +180 -0
- package/build/lib/web/development/components/Dropdown/InputDropdownButton.web.js.map +1 -0
- package/build/lib/web/development/components/Dropdown/dropdownComponentIds.js +2 -1
- package/build/lib/web/development/components/Dropdown/dropdownComponentIds.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/index.js +1 -0
- package/build/lib/web/development/components/Dropdown/index.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/web/development/components/Icons/ChevronUpDownIcon/ChevronUpDownIcon.js +40 -0
- package/build/lib/web/development/components/Icons/ChevronUpDownIcon/ChevronUpDownIcon.js.map +1 -0
- package/build/lib/web/development/components/Icons/ChevronUpDownIcon/index.js +2 -0
- package/build/lib/web/development/components/Icons/ChevronUpDownIcon/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/Icons/useIconProps/iconSizeMap.js +14 -0
- package/build/lib/web/development/components/Icons/useIconProps/iconSizeMap.js.map +1 -0
- package/build/lib/web/development/components/Icons/useIconProps/useIconProps.js +3 -12
- package/build/lib/web/development/components/Icons/useIconProps/useIconProps.js.map +1 -1
- package/build/lib/web/development/components/InfoGroup/InfoGroup.web.js +448 -0
- package/build/lib/web/development/components/InfoGroup/InfoGroup.web.js.map +1 -0
- package/build/lib/web/development/components/InfoGroup/InfoGroupContext.js +26 -0
- package/build/lib/web/development/components/InfoGroup/InfoGroupContext.js.map +1 -0
- package/build/lib/web/development/components/InfoGroup/index.js +3 -0
- package/build/lib/web/development/components/InfoGroup/index.js.map +1 -0
- package/build/lib/web/development/components/InfoGroup/infoGroupTokens.js +49 -0
- package/build/lib/web/development/components/InfoGroup/infoGroupTokens.js.map +1 -0
- package/build/lib/web/development/components/InfoGroup/types.js +2 -0
- package/build/lib/web/development/components/InfoGroup/types.js.map +1 -0
- package/build/lib/web/development/components/Input/BaseInput/BaseInput.js +10 -4
- package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js +32 -8
- package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js +2 -1
- package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js +8 -4
- package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/baseInputTokens.js +1 -1
- package/build/lib/web/development/components/Input/BaseInput/baseInputTokens.js.map +1 -1
- package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +25 -124
- package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
- package/build/lib/web/development/components/Input/PhoneNumberInput/CountrySelector.web.js +6 -4
- package/build/lib/web/development/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -1
- package/build/lib/web/development/components/Input/SearchInput/SearchInput.js +97 -30
- package/build/lib/web/development/components/Input/SearchInput/SearchInput.js.map +1 -1
- package/build/lib/web/development/components/Input/TextInput/TextInput.js +123 -31
- package/build/lib/web/development/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/web/development/components/Typography/Text/Text.js +0 -1
- package/build/lib/web/development/components/Typography/Text/Text.js.map +1 -1
- package/build/lib/web/development/components/index.js +4 -0
- package/build/lib/web/development/components/index.js.map +1 -1
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js +5 -0
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/development/utils/useControlledDropdownInput/index.js +2 -0
- package/build/lib/web/development/utils/useControlledDropdownInput/index.js.map +1 -0
- package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js +108 -0
- package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -0
- package/build/lib/web/production/components/Accordion/AccordionItemHeader.js +18 -2
- package/build/lib/web/production/components/Accordion/AccordionItemHeader.js.map +1 -1
- package/build/lib/web/production/components/Accordion/StyledAccordionButton.web.js +4 -3
- package/build/lib/web/production/components/Accordion/StyledAccordionButton.web.js.map +1 -1
- package/build/lib/web/production/components/Accordion/commonStyles.js +1 -11
- package/build/lib/web/production/components/Accordion/commonStyles.js.map +1 -1
- package/build/lib/web/production/components/ActionList/ActionListItem.js +2 -1
- package/build/lib/web/production/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js +6 -3
- package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +24 -3
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/StyledBaseButton.web.js +14 -2
- package/build/lib/web/production/components/Button/BaseButton/StyledBaseButton.web.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js +19 -0
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/Dropdown.js +4 -1
- package/build/lib/web/production/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/DropdownButton.js +4 -1
- package/build/lib/web/production/components/Dropdown/DropdownButton.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js +4 -2
- package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/InputDropdownButton.web.js +180 -0
- package/build/lib/web/production/components/Dropdown/InputDropdownButton.web.js.map +1 -0
- package/build/lib/web/production/components/Dropdown/dropdownComponentIds.js +2 -1
- package/build/lib/web/production/components/Dropdown/dropdownComponentIds.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/index.js +1 -0
- package/build/lib/web/production/components/Dropdown/index.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/web/production/components/Icons/ChevronUpDownIcon/ChevronUpDownIcon.js +40 -0
- package/build/lib/web/production/components/Icons/ChevronUpDownIcon/ChevronUpDownIcon.js.map +1 -0
- package/build/lib/web/production/components/Icons/ChevronUpDownIcon/index.js +2 -0
- package/build/lib/web/production/components/Icons/ChevronUpDownIcon/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/Icons/useIconProps/iconSizeMap.js +14 -0
- package/build/lib/web/production/components/Icons/useIconProps/iconSizeMap.js.map +1 -0
- package/build/lib/web/production/components/Icons/useIconProps/useIconProps.js +3 -12
- package/build/lib/web/production/components/Icons/useIconProps/useIconProps.js.map +1 -1
- package/build/lib/web/production/components/InfoGroup/InfoGroup.web.js +448 -0
- package/build/lib/web/production/components/InfoGroup/InfoGroup.web.js.map +1 -0
- package/build/lib/web/production/components/InfoGroup/InfoGroupContext.js +26 -0
- package/build/lib/web/production/components/InfoGroup/InfoGroupContext.js.map +1 -0
- package/build/lib/web/production/components/InfoGroup/index.js +3 -0
- package/build/lib/web/production/components/InfoGroup/index.js.map +1 -0
- package/build/lib/web/production/components/InfoGroup/infoGroupTokens.js +49 -0
- package/build/lib/web/production/components/InfoGroup/infoGroupTokens.js.map +1 -0
- package/build/lib/web/production/components/InfoGroup/types.js +2 -0
- package/build/lib/web/production/components/InfoGroup/types.js.map +1 -0
- package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +10 -4
- package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js +32 -8
- package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js +2 -1
- package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js +8 -4
- package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/baseInputTokens.js +1 -1
- package/build/lib/web/production/components/Input/BaseInput/baseInputTokens.js.map +1 -1
- package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +25 -124
- package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
- package/build/lib/web/production/components/Input/PhoneNumberInput/CountrySelector.web.js +6 -4
- package/build/lib/web/production/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -1
- package/build/lib/web/production/components/Input/SearchInput/SearchInput.js +97 -30
- package/build/lib/web/production/components/Input/SearchInput/SearchInput.js.map +1 -1
- package/build/lib/web/production/components/Input/TextInput/TextInput.js +123 -31
- package/build/lib/web/production/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/web/production/components/Typography/Text/Text.js +0 -1
- package/build/lib/web/production/components/Typography/Text/Text.js.map +1 -1
- package/build/lib/web/production/components/index.js +4 -0
- package/build/lib/web/production/components/index.js.map +1 -1
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js +5 -0
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/production/utils/useControlledDropdownInput/index.js +2 -0
- package/build/lib/web/production/utils/useControlledDropdownInput/index.js.map +1 -0
- package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js +108 -0
- package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -0
- package/build/types/components/index.d.ts +4446 -3019
- package/build/types/components/index.native.d.ts +2782 -2661
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
-
import React__default, { useState } from 'react';
|
|
3
|
+
import React__default, { useState, useRef, useEffect } from 'react';
|
|
4
4
|
import { BaseInput } from '../BaseInput/BaseInput.js';
|
|
5
5
|
import { getKeyboardAndAutocompleteProps } from '../BaseInput/utils.js';
|
|
6
6
|
import { useTaggedInput } from '../BaseInput/useTaggedInput.js';
|
|
@@ -8,8 +8,10 @@ import isEmpty from '../../../utils/lodashButBetter/isEmpty.js';
|
|
|
8
8
|
import 'react-native-svg';
|
|
9
9
|
import '@babel/runtime/helpers/defineProperty';
|
|
10
10
|
import { MetaConstants } from '../../../utils/metaAttribute/metaConstants.js';
|
|
11
|
-
import { jsx } from 'react/jsx-runtime';
|
|
11
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
12
|
import '../../Icons/_Svg/Svg/Svg.native.js';
|
|
13
|
+
import '../../../tokens/global/typography.js';
|
|
14
|
+
import '../../../tokens/global/motion.js';
|
|
13
15
|
import 'styled-components/native';
|
|
14
16
|
import '@gorhom/portal';
|
|
15
17
|
import 'react-native-gesture-handler';
|
|
@@ -17,8 +19,6 @@ import '../../BladeProvider/useTheme.js';
|
|
|
17
19
|
import 'react-native';
|
|
18
20
|
import { getPlatformType } from '../../../utils/getPlatformType/getPlatformType.js';
|
|
19
21
|
import '../../BottomSheet/BottomSheetStack.js';
|
|
20
|
-
import '../../../tokens/global/typography.js';
|
|
21
|
-
import '../../../tokens/global/motion.js';
|
|
22
22
|
import CloseIcon from '../../Icons/CloseIcon/CloseIcon.js';
|
|
23
23
|
import { IconButton } from '../../Button/IconButton/IconButton.js';
|
|
24
24
|
import { CharacterCounter } from '../../Form/CharacterCounter/CharacterCounter.js';
|
|
@@ -27,8 +27,16 @@ import { Spinner } from '../../Spinner/Spinner/Spinner.js';
|
|
|
27
27
|
import { assignWithoutSideEffects } from '../../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
28
28
|
import { useMergeRefs } from '../../../utils/useMergeRefs.js';
|
|
29
29
|
import { hintMarginTop } from '../../Form/formTokens.js';
|
|
30
|
+
import { Divider } from '../../Divider/Divider.js';
|
|
31
|
+
import { getComponentId } from '../../../utils/isValidAllowedChildren/isValidAllowedChildren.js';
|
|
32
|
+
import '../../Dropdown/Dropdown.js';
|
|
33
|
+
import { DropdownOverlay } from '../../Dropdown/DropdownOverlay.native.js';
|
|
34
|
+
import '../../Dropdown/DropdownButton.js';
|
|
35
|
+
import '../../Dropdown/DropdownLink.js';
|
|
36
|
+
import '../../Dropdown/DropdownIconButton.js';
|
|
37
|
+
import '../../Dropdown/DropdownHeaderFooter.js';
|
|
30
38
|
|
|
31
|
-
var _excluded=["label","accessibilityLabel","labelPosition","placeholder","type","defaultValue","name","value","maxCharacters","onChange","onClick","onFocus","onBlur","onSubmit","isDisabled","necessityIndicator","validationState","errorText","helpText","successText","isRequired","icon","prefix","showClearButton","onClearButtonClick","isLoading","suffix","autoFocus","keyboardReturnKeyType","autoCompleteSuggestionType","autoCapitalize","testID","size","leadingIcon","trailingIcon","isTaggedInput","tags","onTagChange"];var isReactNative=function isReactNative(_textInputRef){return getPlatformType()==='react-native';};var _TextInput=function _TextInput(_ref,ref){var label=_ref.label,accessibilityLabel=_ref.accessibilityLabel,_ref$labelPosition=_ref.labelPosition,labelPosition=_ref$labelPosition===void 0?'top':_ref$labelPosition,placeholder=_ref.placeholder,_ref$type=_ref.type,type=_ref$type===void 0?'text':_ref$type,defaultValue=_ref.defaultValue,name=_ref.name,value=_ref.value,maxCharacters=_ref.maxCharacters,_onChange=_ref.onChange,onClick=_ref.onClick,_onFocus=_ref.onFocus,_onBlur=_ref.onBlur,onSubmit=_ref.onSubmit,isDisabled=_ref.isDisabled,necessityIndicator=_ref.necessityIndicator,validationState=_ref.validationState,errorText=_ref.errorText,helpText=_ref.helpText,successText=_ref.successText,isRequired=_ref.isRequired,icon=_ref.icon,prefix=_ref.prefix,showClearButton=_ref.showClearButton,onClearButtonClick=_ref.onClearButtonClick,isLoading=_ref.isLoading,suffix=_ref.suffix,autoFocus=_ref.autoFocus,keyboardReturnKeyType=_ref.keyboardReturnKeyType,autoCompleteSuggestionType=_ref.autoCompleteSuggestionType,autoCapitalize=_ref.autoCapitalize,testID=_ref.testID,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,leadingIcon=_ref.leadingIcon,trailingIcon=_ref.trailingIcon,isTaggedInput=_ref.isTaggedInput,tags=_ref.tags,onTagChange=_ref.onTagChange,rest=_objectWithoutProperties(_ref,_excluded);var textInputRef=React__default.useRef(null);var mergedRef=useMergeRefs(ref,textInputRef);var _useState=useState(false),_useState2=_slicedToArray(_useState,2),shouldShowClearButton=_useState2[0],setShouldShowClearButton=_useState2[1];var _useState3=useState(autoFocus!=null?autoFocus:false),_useState4=_slicedToArray(_useState3,2),isInputFocussed=_useState4[0],setIsInputFocussed=_useState4[1];var _useTaggedInput=useTaggedInput({isTaggedInput:isTaggedInput,tags:tags,onTagChange:onTagChange,isDisabled:isDisabled,onChange:_onChange,name:name,value:value,inputRef:textInputRef}),activeTagIndex=_useTaggedInput.activeTagIndex,setActiveTagIndex=_useTaggedInput.setActiveTagIndex,getTags=_useTaggedInput.getTags,handleTaggedInputKeydown=_useTaggedInput.handleTaggedInputKeydown,handleTaggedInputChange=_useTaggedInput.handleTaggedInputChange,handleTagsClear=_useTaggedInput.handleTagsClear;React__default.useEffect(function(){
|
|
39
|
+
var _excluded=["label","accessibilityLabel","labelPosition","placeholder","type","defaultValue","name","value","maxCharacters","onChange","onClick","onFocus","onBlur","onSubmit","isDisabled","necessityIndicator","validationState","errorText","helpText","successText","isRequired","icon","prefix","showClearButton","onClearButtonClick","isLoading","suffix","autoFocus","keyboardReturnKeyType","autoCompleteSuggestionType","autoCapitalize","testID","size","leadingIcon","trailingIcon","isTaggedInput","tags","onTagChange","trailing","leading"];var isReactNative=function isReactNative(_textInputRef){return getPlatformType()==='react-native';};var _TextInput=function _TextInput(_ref,ref){var _leading$name,_trailing$name,_ref3;var label=_ref.label,accessibilityLabel=_ref.accessibilityLabel,_ref$labelPosition=_ref.labelPosition,labelPosition=_ref$labelPosition===void 0?'top':_ref$labelPosition,placeholder=_ref.placeholder,_ref$type=_ref.type,type=_ref$type===void 0?'text':_ref$type,defaultValue=_ref.defaultValue,name=_ref.name,value=_ref.value,maxCharacters=_ref.maxCharacters,_onChange=_ref.onChange,onClick=_ref.onClick,_onFocus=_ref.onFocus,_onBlur=_ref.onBlur,onSubmit=_ref.onSubmit,isDisabled=_ref.isDisabled,necessityIndicator=_ref.necessityIndicator,validationState=_ref.validationState,errorText=_ref.errorText,helpText=_ref.helpText,successText=_ref.successText,isRequired=_ref.isRequired,icon=_ref.icon,prefix=_ref.prefix,showClearButton=_ref.showClearButton,onClearButtonClick=_ref.onClearButtonClick,isLoading=_ref.isLoading,suffix=_ref.suffix,autoFocus=_ref.autoFocus,keyboardReturnKeyType=_ref.keyboardReturnKeyType,autoCompleteSuggestionType=_ref.autoCompleteSuggestionType,autoCapitalize=_ref.autoCapitalize,testID=_ref.testID,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,leadingIcon=_ref.leadingIcon,trailingIcon=_ref.trailingIcon,isTaggedInput=_ref.isTaggedInput,tags=_ref.tags,onTagChange=_ref.onTagChange,trailing=_ref.trailing,leading=_ref.leading,rest=_objectWithoutProperties(_ref,_excluded);var textInputRef=React__default.useRef(null);var mergedRef=useMergeRefs(ref,textInputRef);var _useState=useState(false),_useState2=_slicedToArray(_useState,2),shouldShowClearButton=_useState2[0],setShouldShowClearButton=_useState2[1];var _useState3=useState(autoFocus!=null?autoFocus:false),_useState4=_slicedToArray(_useState3,2),isInputFocussed=_useState4[0],setIsInputFocussed=_useState4[1];var _useTaggedInput=useTaggedInput({isTaggedInput:isTaggedInput,tags:tags,onTagChange:onTagChange,isDisabled:isDisabled,onChange:_onChange,name:name,value:value,inputRef:textInputRef}),activeTagIndex=_useTaggedInput.activeTagIndex,setActiveTagIndex=_useTaggedInput.setActiveTagIndex,getTags=_useTaggedInput.getTags,handleTaggedInputKeydown=_useTaggedInput.handleTaggedInputKeydown,handleTaggedInputChange=_useTaggedInput.handleTaggedInputChange,handleTagsClear=_useTaggedInput.handleTagsClear;var _React$useState=React__default.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isTrailingDropDownOpen=_React$useState2[0],setIsTrailingDropDownOpen=_React$useState2[1];var _React$useState3=React__default.useState(false),_React$useState4=_slicedToArray(_React$useState3,2),isLeadingDropDownOpen=_React$useState4[0],setIsLeadingDropDownOpen=_React$useState4[1];var textInputWrapperRef=useRef(null);useEffect(function(){if(isTrailingDropDownOpen&&isLeadingDropDownOpen){setIsLeadingDropDownOpen(false);}},[isTrailingDropDownOpen]);useEffect(function(){if(isLeadingDropDownOpen&&isTrailingDropDownOpen){setIsTrailingDropDownOpen(false);}},[isLeadingDropDownOpen]);var leadingDropDown=leading&&getComponentId(leading)==='Dropdown'?leading:null;var trailingDropdown=trailing&&getComponentId(trailing)==='Dropdown'?trailing:null;var _leadingIcon=leading&&typeof leading==='function'&&(_leading$name=leading.name)!=null&&_leading$name.endsWith('Icon')?leading:undefined;var _trailingIcon=trailing&&typeof trailing==='function'&&(_trailing$name=trailing.name)!=null&&_trailing$name.endsWith('Icon')?trailing:undefined;var hasLeadingInteractionElement=!_leadingIcon&&!leadingDropDown&&leading;var hasTrailingInteractionElement=!_trailingIcon&&!trailingDropdown&&trailing;var renderDropdown=function renderDropdown(dropdown,isOpen,setIsOpen,defaultPlacement){if(!dropdown){return null;}return React__default.cloneElement(dropdown,{selectionType:'single',isOpen:isOpen,onOpenChange:function onOpenChange(isOpen){setIsOpen(isOpen);},children:React__default.Children.map(dropdown.props.children,function(child){if(child.type===DropdownOverlay){return React__default.cloneElement(child,{referenceRef:textInputWrapperRef,_isNestedDropdown:true,defaultPlacement:defaultPlacement});}return child;})});};var renderLeadingDropDown=renderDropdown(leadingDropDown,isLeadingDropDownOpen,setIsLeadingDropDownOpen,'bottom-start');var renderTrailingDropDown=renderDropdown(trailingDropdown,isTrailingDropDownOpen,setIsTrailingDropDownOpen,'bottom-end');React__default.useEffect(function(){setShouldShowClearButton(Boolean(showClearButton&&(defaultValue!=null?defaultValue:value)));},[showClearButton,defaultValue,value]);var renderClearButton=function renderClearButton(){return jsx(IconButton,{size:"medium",icon:CloseIcon,onClick:function onClick(){var _textInputRef$current;if(isEmpty(value)&&textInputRef.current){if(isReactNative(textInputRef.current)){textInputRef.current.clear();textInputRef.current.focus();}else if(textInputRef.current instanceof HTMLInputElement){textInputRef.current.value='';textInputRef.current.focus();}}handleTagsClear();onClearButtonClick==null?void 0:onClearButtonClick();textInputRef==null?void 0:(_textInputRef$current=textInputRef.current)==null?void 0:_textInputRef$current.focus();setShouldShowClearButton(false);},isDisabled:isDisabled,accessibilityLabel:"Clear Input Content"});};var hasTrailingDropDown=Boolean(trailingDropdown);var renderInteractionElement=function renderInteractionElement(){if(isLoading){return jsx(Spinner,{accessibilityLabel:"Loading Content",color:"primary"});}if(shouldShowClearButton&&hasTrailingDropDown){return jsxs(BaseBox,{display:"flex",gap:"spacing.3",children:[renderClearButton()," ",jsx(Divider,{orientation:"vertical"})]});}if(showClearButton&&hasTrailingInteractionElement){return jsxs(BaseBox,{display:"flex",gap:"spacing.3",children:[renderClearButton()," ",jsx(Divider,{orientation:"vertical"})," ",trailing]});}if(shouldShowClearButton){return renderClearButton();}if(hasTrailingInteractionElement){return trailing;}return null;};return jsx(BaseInput,Object.assign({id:"textinput",componentName:MetaConstants.TextInput,ref:mergedRef,setInputWrapperRef:function setInputWrapperRef(wrapperNode){textInputWrapperRef.current=wrapperNode;},label:label,accessibilityLabel:accessibilityLabel,hideLabelText:!Boolean(label),labelPosition:labelPosition,placeholder:placeholder,defaultValue:defaultValue,value:value,name:name,maxCharacters:maxCharacters,isDropdownTrigger:isTaggedInput,tags:isTaggedInput?getTags({size:size}):undefined,showAllTags:isInputFocussed,maxTagRows:"single",activeTagIndex:activeTagIndex,setActiveTagIndex:setActiveTagIndex,leadingDropDown:renderLeadingDropDown,trailingDropDown:renderTrailingDropDown,leadingInteractionElement:hasLeadingInteractionElement?leading:null,onChange:function onChange(_ref2){var name=_ref2.name,value=_ref2.value;if(showClearButton&&value!=null&&value.length){setShouldShowClearButton(true);}if(shouldShowClearButton&&!(value!=null&&value.length)){setShouldShowClearButton(false);}handleTaggedInputChange({name:name,value:value});_onChange==null?void 0:_onChange({name:name,value:value});},onClick:onClick,onFocus:function onFocus(e){setIsInputFocussed(true);_onFocus==null?void 0:_onFocus(e);},onBlur:function onBlur(e){setIsInputFocussed(false);_onBlur==null?void 0:_onBlur(e);},onKeyDown:function onKeyDown(e){handleTaggedInputKeydown(e);},onSubmit:onSubmit,isDisabled:isDisabled,necessityIndicator:necessityIndicator,isRequired:isRequired,leadingIcon:(_ref3=_leadingIcon!=null?_leadingIcon:leadingIcon)!=null?_ref3:icon,prefix:prefix,trailingInteractionElement:renderInteractionElement(),trailingIcon:_trailingIcon!=null?_trailingIcon:trailingIcon,suffix:suffix,validationState:validationState,errorText:errorText,helpText:helpText,successText:successText,trailingFooterSlot:function trailingFooterSlot(value){var _value$length;return maxCharacters?jsx(BaseBox,{marginTop:hintMarginTop[size],marginRight:"spacing.1",children:jsx(CharacterCounter,{currentCount:(_value$length=value==null?void 0:value.length)!=null?_value$length:0,maxCount:maxCharacters,size:size})}):null;},autoFocus:autoFocus,testID:testID},getKeyboardAndAutocompleteProps({type:type,keyboardReturnKeyType:keyboardReturnKeyType,autoCompleteSuggestionType:autoCompleteSuggestionType,autoCapitalize:autoCapitalize}),{size:size},rest));};var TextInput=assignWithoutSideEffects(React__default.forwardRef(_TextInput),{displayName:'TextInput'});
|
|
32
40
|
|
|
33
41
|
export { TextInput };
|
|
34
42
|
//# sourceMappingURL=TextInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.js","sources":["../../../../../../src/components/Input/TextInput/TextInput.tsx"],"sourcesContent":["import React, { 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 type { TaggedInputProps } from '../BaseInput/useTaggedInput';\nimport { useTaggedInput } from '../BaseInput/useTaggedInput';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport type { IconComponent } from '~components/Icons';\nimport { CloseIcon } from '~components/Icons';\nimport { IconButton } from '~components/Button/IconButton';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { CharacterCounter } from '~components/Form/CharacterCounter';\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 { hintMarginTop } from '~components/Form/formTokens';\n\n// Users should use PasswordInput for input type password\ntype Type = Exclude<BaseInputProps['type'], 'password'>;\n\ntype TextInputCommonProps = 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 | 'value'\n | 'isDisabled'\n | 'isRequired'\n | 'prefix'\n | 'suffix'\n | 'maxCharacters'\n | 'autoFocus'\n | 'keyboardReturnKeyType'\n | 'autoCompleteSuggestionType'\n | 'onSubmit'\n | 'autoCapitalize'\n | 'testID'\n | 'onClick'\n | 'size'\n | 'leadingIcon'\n | 'trailingButton'\n | 'trailingIcon'\n | 'textAlign'\n | keyof DataAnalyticsAttribute\n> & {\n /**\n * Decides whether to render a clear icon button\n */\n showClearButton?: boolean;\n\n /**\n * Event handler to handle the onClick event for clear button. Used when `showClearButton` is `true`\n */\n onClearButtonClick?: () => void;\n\n /**\n * Decides whether to show a loading spinner for the input field.\n */\n isLoading?: boolean;\n\n /**\n * Icon that will be rendered at the beginning of the input field\n * @deprecated Use `leadingIcon` instead. This prop will be removed in the next major version.\n */\n icon?: IconComponent;\n /**\n * Type of Input Field to be rendered. Use `PasswordInput` for type `password`\n *\n *\n * **Note on number type**\n *\n * `type=\"number\"` internally uses `inputMode=\"numeric\"` instead of HTML's `type=\"number\"` which also allows text characters.\n * If you have a usecase where you only want to support number input, you can handle it on validations end.\n *\n * Check out [Why the GOV.UK Design System team changed the input type for numbers](https://technology.blog.gov.uk/2020/02/24/why-the-gov-uk-design-system-team-changed-the-input-type-for-numbers/) for reasoning\n *\n * @default text\n */\n type?: Type;\n} & TaggedInputProps &\n StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype TextInputPropsWithA11yLabel = {\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 TextInputPropsWithLabel = {\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 TextInputProps = (TextInputPropsWithA11yLabel | TextInputPropsWithLabel) &\n TextInputCommonProps;\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 _TextInput: React.ForwardRefRenderFunction<BladeElementRef, TextInputProps> = (\n {\n label,\n accessibilityLabel,\n labelPosition = 'top',\n placeholder,\n type = 'text',\n defaultValue,\n name,\n value,\n maxCharacters,\n onChange,\n onClick,\n onFocus,\n onBlur,\n onSubmit,\n isDisabled,\n necessityIndicator,\n validationState,\n errorText,\n helpText,\n successText,\n isRequired,\n icon,\n prefix,\n showClearButton,\n onClearButtonClick,\n isLoading,\n suffix,\n autoFocus,\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n autoCapitalize,\n testID,\n size = 'medium',\n leadingIcon,\n trailingIcon,\n isTaggedInput,\n tags,\n onTagChange,\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 [isInputFocussed, setIsInputFocussed] = useState(autoFocus ?? false);\n const {\n activeTagIndex,\n setActiveTagIndex,\n getTags,\n handleTaggedInputKeydown,\n handleTaggedInputChange,\n handleTagsClear,\n } = useTaggedInput({\n isTaggedInput,\n tags,\n onTagChange,\n isDisabled,\n onChange,\n name,\n value,\n inputRef: textInputRef,\n });\n\n React.useEffect(() => {\n setShouldShowClearButton(Boolean(showClearButton && (defaultValue ?? value)));\n }, [showClearButton, defaultValue, value]);\n\n const renderInteractionElement = (): ReactNode => {\n if (isLoading) {\n return <Spinner accessibilityLabel=\"Loading Content\" color=\"primary\" />;\n }\n\n if (shouldShowClearButton) {\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 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 textInputRef?.current?.focus();\n setShouldShowClearButton(false);\n }}\n isDisabled={isDisabled}\n accessibilityLabel=\"Clear Input Content\"\n />\n );\n }\n\n return null;\n };\n\n return (\n <BaseInput\n id=\"textinput\"\n componentName={MetaConstants.TextInput}\n ref={mergedRef}\n label={label as string}\n accessibilityLabel={accessibilityLabel}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\n placeholder={placeholder}\n defaultValue={defaultValue}\n value={value}\n name={name}\n maxCharacters={maxCharacters}\n isDropdownTrigger={isTaggedInput}\n tags={isTaggedInput ? getTags({ size }) : undefined}\n showAllTags={isInputFocussed}\n maxTagRows=\"single\"\n activeTagIndex={activeTagIndex}\n setActiveTagIndex={setActiveTagIndex}\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 onClick={onClick}\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 }}\n onSubmit={onSubmit}\n isDisabled={isDisabled}\n necessityIndicator={necessityIndicator}\n isRequired={isRequired}\n leadingIcon={leadingIcon ?? icon}\n prefix={prefix}\n trailingInteractionElement={renderInteractionElement()}\n trailingIcon={trailingIcon}\n suffix={suffix}\n validationState={validationState}\n errorText={errorText}\n helpText={helpText}\n successText={successText}\n trailingFooterSlot={(value) => {\n return maxCharacters ? (\n <BaseBox marginTop={hintMarginTop[size]} marginRight=\"spacing.1\">\n <CharacterCounter\n currentCount={value?.length ?? 0}\n maxCount={maxCharacters}\n size={size}\n />\n </BaseBox>\n ) : null;\n }}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n testID={testID}\n {...getKeyboardAndAutocompleteProps({\n type,\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n autoCapitalize,\n })}\n size={size}\n {...rest}\n />\n );\n};\n\nconst TextInput = assignWithoutSideEffects(React.forwardRef(_TextInput), {\n displayName: 'TextInput',\n});\n\nexport type { TextInputProps };\nexport { TextInput };\n"],"names":["isReactNative","_textInputRef","getPlatformType","_TextInput","_ref","ref","label","accessibilityLabel","_ref$labelPosition","labelPosition","placeholder","_ref$type","type","defaultValue","name","value","maxCharacters","onChange","onClick","onFocus","onBlur","onSubmit","isDisabled","necessityIndicator","validationState","errorText","helpText","successText","isRequired","icon","prefix","showClearButton","onClearButtonClick","isLoading","suffix","autoFocus","keyboardReturnKeyType","autoCompleteSuggestionType","autoCapitalize","testID","_ref$size","size","leadingIcon","trailingIcon","isTaggedInput","tags","onTagChange","rest","_objectWithoutProperties","_excluded","textInputRef","React","useRef","mergedRef","useMergeRefs","_useState","useState","_useState2","_slicedToArray","shouldShowClearButton","setShouldShowClearButton","_useState3","_useState4","isInputFocussed","setIsInputFocussed","_useTaggedInput","useTaggedInput","inputRef","activeTagIndex","setActiveTagIndex","getTags","handleTaggedInputKeydown","handleTaggedInputChange","handleTagsClear","useEffect","Boolean","renderInteractionElement","_jsx","Spinner","color","IconButton","CloseIcon","_textInputRef$current","isEmpty","current","clear","focus","HTMLInputElement","BaseInput","Object","assign","id","componentName","MetaConstants","TextInput","hideLabelText","isDropdownTrigger","undefined","showAllTags","maxTagRows","_ref2","length","e","onKeyDown","trailingInteractionElement","trailingFooterSlot","_value$length","BaseBox","marginTop","hintMarginTop","marginRight","children","CharacterCounter","currentCount","maxCount","getKeyboardAndAutocompleteProps","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,eAAA,CAAA,aAAA,CAAA,MAAA,CAAA,cAAA,CAAA,MAAA,CAAA,OAAA,CAAA,eAAA,CAAA,UAAA,CAAA,SAAA,CAAA,SAAA,CAAA,QAA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QAAAK,aAAA,CAAI,CAAE,CACjCQ,QAAQ,CAAElG,aAAc,CACxByB,IAAI,CAAEA,IAAK,CACZ,CAAC,CACK,CAAC,CACR,IAAI,CACV,CAAE,CAEFN,SAAS,CAAEA,SAAU,CACrBI,MAAM,CAAEA,MAAO,CAAA,CACX4E,+BAA+B,CAAC,CAClCvG,IAAI,CAAJA,IAAI,CACJwB,qBAAqB,CAArBA,qBAAqB,CACrBC,0BAA0B,CAA1BA,0BAA0B,CAC1BC,cAAc,CAAdA,cACF,CAAC,CAAC,CACFG,CAAAA,IAAI,CAAEA,IAAK,EACPM,IAAI,CACT,CAAC,CAEN,CAAC,CAEK,IAAA+C,SAAS,CAAGsB,wBAAwB,CAACjE,cAAK,CAACkE,UAAU,CAAClH,UAAU,CAAC,CAAE,CACvEmH,WAAW,CAAE,WACf,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"TextInput.js","sources":["../../../../../../src/components/Input/TextInput/TextInput.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef } 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 type { TaggedInputProps } from '../BaseInput/useTaggedInput';\nimport { useTaggedInput } from '../BaseInput/useTaggedInput';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport type { IconComponent } from '~components/Icons';\nimport { CloseIcon } from '~components/Icons';\nimport { IconButton } from '~components/Button/IconButton';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { CharacterCounter } from '~components/Form/CharacterCounter';\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 ContainerElementType,\n DataAnalyticsAttribute,\n} from '~utils/types';\nimport { hintMarginTop } from '~components/Form/formTokens';\nimport { Divider } from '~components/Divider';\nimport { getComponentId } from '~utils/isValidAllowedChildren';\nimport { DropdownOverlay } from '~components/Dropdown';\n\n// Users should use PasswordInput for input type password\ntype Type = Exclude<BaseInputProps['type'], 'password'>;\n\ntype TextInputCommonProps = 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 | 'value'\n | 'isDisabled'\n | 'isRequired'\n | 'prefix'\n | 'suffix'\n | 'maxCharacters'\n | 'autoFocus'\n | 'keyboardReturnKeyType'\n | 'autoCompleteSuggestionType'\n | 'onSubmit'\n | 'autoCapitalize'\n | 'testID'\n | 'onClick'\n | 'size'\n | 'leadingIcon'\n | 'trailingButton'\n | 'trailingIcon'\n | 'textAlign'\n | keyof DataAnalyticsAttribute\n> & {\n /**\n * Decides whether to render a clear icon button\n */\n showClearButton?: boolean;\n\n /**\n * Event handler to handle the onClick event for clear button. Used when `showClearButton` is `true`\n */\n onClearButtonClick?: () => void;\n\n /**\n * Decides whether to show a loading spinner for the input field.\n */\n isLoading?: boolean;\n\n /**\n * Icon that will be rendered at the beginning of the input field\n * @deprecated Use `leading` instead. This prop will be removed in the next major version.\n */\n icon?: IconComponent;\n /**\n * Type of Input Field to be rendered. Use `PasswordInput` for type `password`\n *\n *\n * **Note on number type**\n *\n * `type=\"number\"` internally uses `inputMode=\"numeric\"` instead of HTML's `type=\"number\"` which also allows text characters.\n * If you have a usecase where you only want to support number input, you can handle it on validations end.\n *\n * Check out [Why the GOV.UK Design System team changed the input type for numbers](https://technology.blog.gov.uk/2020/02/24/why-the-gov-uk-design-system-team-changed-the-input-type-for-numbers/) for reasoning\n *\n * @default text\n */\n type?: Type;\n /**\n *\n * Icon or React Element to be rendered at the end of the input field\n */\n trailing?: React.ReactElement | IconComponent;\n /**\n * Icon or React Element to be rendered at the beginning of the input field\n */\n leading?: React.ReactElement | IconComponent;\n} & TaggedInputProps &\n StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype TextInputPropsWithA11yLabel = {\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 TextInputPropsWithLabel = {\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 TextInputProps = (TextInputPropsWithA11yLabel | TextInputPropsWithLabel) &\n TextInputCommonProps;\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 _TextInput: React.ForwardRefRenderFunction<BladeElementRef, TextInputProps> = (\n {\n label,\n accessibilityLabel,\n labelPosition = 'top',\n placeholder,\n type = 'text',\n defaultValue,\n name,\n value,\n maxCharacters,\n onChange,\n onClick,\n onFocus,\n onBlur,\n onSubmit,\n isDisabled,\n necessityIndicator,\n validationState,\n errorText,\n helpText,\n successText,\n isRequired,\n icon,\n prefix,\n showClearButton,\n onClearButtonClick,\n isLoading,\n suffix,\n autoFocus,\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n autoCapitalize,\n testID,\n size = 'medium',\n leadingIcon,\n trailingIcon,\n isTaggedInput,\n tags,\n onTagChange,\n trailing,\n leading,\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 [isInputFocussed, setIsInputFocussed] = useState(autoFocus ?? false);\n const {\n activeTagIndex,\n setActiveTagIndex,\n getTags,\n handleTaggedInputKeydown,\n handleTaggedInputChange,\n handleTagsClear,\n } = useTaggedInput({\n isTaggedInput,\n tags,\n onTagChange,\n isDisabled,\n onChange,\n name,\n value,\n inputRef: textInputRef,\n });\n const [isTrailingDropDownOpen, setIsTrailingDropDownOpen] = React.useState(false);\n const [isLeadingDropDownOpen, setIsLeadingDropDownOpen] = React.useState(false);\n const textInputWrapperRef = useRef<ContainerElementType | null>(null);\n\n useEffect(() => {\n if (isTrailingDropDownOpen && isLeadingDropDownOpen) {\n setIsLeadingDropDownOpen(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isTrailingDropDownOpen]);\n\n useEffect(() => {\n if (isLeadingDropDownOpen && isTrailingDropDownOpen) {\n setIsTrailingDropDownOpen(false);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isLeadingDropDownOpen]);\n\n const leadingDropDown =\n leading && getComponentId(leading as React.ReactElement) === 'Dropdown' ? leading : null;\n\n const trailingDropdown =\n trailing && getComponentId(trailing as React.ReactElement) === 'Dropdown' ? trailing : null;\n // we need to look into name of component and check if it 's and icon or a dropdown\n const _leadingIcon: IconComponent | undefined =\n leading && typeof leading === 'function' && leading.name?.endsWith('Icon')\n ? (leading as IconComponent)\n : undefined;\n\n const _trailingIcon: IconComponent | undefined =\n trailing && typeof trailing === 'function' && trailing.name?.endsWith('Icon')\n ? (trailing as IconComponent)\n : undefined;\n const hasLeadingInteractionElement = !_leadingIcon && !leadingDropDown && leading;\n\n const hasTrailingInteractionElement = !_trailingIcon && !trailingDropdown && trailing;\n\n const renderDropdown = (\n dropdown: React.ReactElement,\n isOpen: boolean,\n setIsOpen: (isOpen: boolean) => void,\n defaultPlacement: 'bottom-start' | 'bottom-end',\n ): React.ReactElement | null => {\n if (!dropdown) {\n return null;\n }\n return React.cloneElement(dropdown, {\n selectionType: 'single',\n isOpen,\n onOpenChange: (isOpen: boolean) => {\n setIsOpen(isOpen);\n },\n children: React.Children.map(dropdown.props.children, (child) => {\n if (child.type === DropdownOverlay) {\n return React.cloneElement(child, {\n referenceRef: textInputWrapperRef,\n _isNestedDropdown: true,\n defaultPlacement,\n });\n }\n return child;\n }),\n });\n };\n\n const renderLeadingDropDown = renderDropdown(\n leadingDropDown as React.ReactElement,\n isLeadingDropDownOpen,\n setIsLeadingDropDownOpen,\n 'bottom-start',\n );\n const renderTrailingDropDown = renderDropdown(\n trailingDropdown as React.ReactElement,\n isTrailingDropDownOpen,\n setIsTrailingDropDownOpen,\n 'bottom-end',\n );\n\n React.useEffect(() => {\n setShouldShowClearButton(Boolean(showClearButton && (defaultValue ?? value)));\n }, [showClearButton, defaultValue, value]);\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 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 textInputRef?.current?.focus();\n setShouldShowClearButton(false);\n }}\n isDisabled={isDisabled}\n accessibilityLabel=\"Clear Input Content\"\n />\n );\n };\n const hasTrailingDropDown = Boolean(trailingDropdown);\n\n const renderInteractionElement = (): ReactNode => {\n if (isLoading) {\n return <Spinner accessibilityLabel=\"Loading Content\" color=\"primary\" />;\n }\n\n if (shouldShowClearButton && hasTrailingDropDown) {\n return (\n <BaseBox display=\"flex\" gap=\"spacing.3\">\n {renderClearButton()} <Divider orientation=\"vertical\" />\n </BaseBox>\n );\n }\n\n if (showClearButton && hasTrailingInteractionElement) {\n return (\n <BaseBox display=\"flex\" gap=\"spacing.3\">\n {renderClearButton()} <Divider orientation=\"vertical\" /> {trailing as React.ReactElement}\n </BaseBox>\n );\n }\n\n if (shouldShowClearButton) {\n return renderClearButton();\n }\n\n if (hasTrailingInteractionElement) {\n return trailing as React.ReactElement;\n }\n return null;\n };\n return (\n <BaseInput\n id=\"textinput\"\n componentName={MetaConstants.TextInput}\n ref={mergedRef}\n setInputWrapperRef={(wrapperNode) => {\n textInputWrapperRef.current = wrapperNode;\n }}\n label={label as string}\n accessibilityLabel={accessibilityLabel}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\n placeholder={placeholder}\n defaultValue={defaultValue}\n value={value}\n name={name}\n maxCharacters={maxCharacters}\n isDropdownTrigger={isTaggedInput}\n tags={isTaggedInput ? getTags({ size }) : undefined}\n showAllTags={isInputFocussed}\n maxTagRows=\"single\"\n activeTagIndex={activeTagIndex}\n setActiveTagIndex={setActiveTagIndex}\n leadingDropDown={renderLeadingDropDown}\n trailingDropDown={renderTrailingDropDown}\n leadingInteractionElement={\n hasLeadingInteractionElement ? (leading as React.ReactElement) : null\n }\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 onClick={onClick}\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 }}\n onSubmit={onSubmit}\n isDisabled={isDisabled}\n necessityIndicator={necessityIndicator}\n isRequired={isRequired}\n leadingIcon={_leadingIcon ?? leadingIcon ?? icon}\n prefix={prefix}\n trailingInteractionElement={renderInteractionElement()}\n trailingIcon={_trailingIcon ?? trailingIcon}\n suffix={suffix}\n validationState={validationState}\n errorText={errorText}\n helpText={helpText}\n successText={successText}\n trailingFooterSlot={(value) => {\n return maxCharacters ? (\n <BaseBox marginTop={hintMarginTop[size]} marginRight=\"spacing.1\">\n <CharacterCounter\n currentCount={value?.length ?? 0}\n maxCount={maxCharacters}\n size={size}\n />\n </BaseBox>\n ) : null;\n }}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n testID={testID}\n {...getKeyboardAndAutocompleteProps({\n type,\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n autoCapitalize,\n })}\n size={size}\n {...rest}\n />\n );\n};\n\nconst TextInput = assignWithoutSideEffects(React.forwardRef(_TextInput), {\n displayName: 'TextInput',\n});\n\nexport type { TextInputProps };\nexport { TextInput };\n"],"names":["isReactNative","_textInputRef","getPlatformType","_TextInput","_ref","ref","_leading$name","_trailing$name","_ref3","label","accessibilityLabel","_ref$labelPosition","labelPosition","placeholder","_ref$type","type","defaultValue","name","value","maxCharacters","onChange","onClick","onFocus","onBlur","onSubmit","isDisabled","necessityIndicator","validationState","errorText","helpText","successText","isRequired","icon","prefix","showClearButton","onClearButtonClick","isLoading","suffix","autoFocus","keyboardReturnKeyType","autoCompleteSuggestionType","autoCapitalize","testID","_ref$size","size","leadingIcon","trailingIcon","isTaggedInput","tags","onTagChange","trailing","leading","rest","_objectWithoutProperties","_excluded","textInputRef","React","useRef","mergedRef","useMergeRefs","_useState","useState","_useState2","_slicedToArray","shouldShowClearButton","setShouldShowClearButton","_useState3","_useState4","isInputFocussed","setIsInputFocussed","_useTaggedInput","useTaggedInput","inputRef","activeTagIndex","setActiveTagIndex","getTags","handleTaggedInputKeydown","handleTaggedInputChange","handleTagsClear","_React$useState","_React$useState2","isTrailingDropDownOpen","setIsTrailingDropDownOpen","_React$useState3","_React$useState4","isLeadingDropDownOpen","setIsLeadingDropDownOpen","textInputWrapperRef","useEffect","leadingDropDown","getComponentId","trailingDropdown","_leadingIcon","endsWith","undefined","_trailingIcon","hasLeadingInteractionElement","hasTrailingInteractionElement","renderDropdown","dropdown","isOpen","setIsOpen","defaultPlacement","cloneElement","selectionType","onOpenChange","children","Children","map","props","child","DropdownOverlay","referenceRef","_isNestedDropdown","renderLeadingDropDown","renderTrailingDropDown","Boolean","renderClearButton","_jsx","IconButton","CloseIcon","_textInputRef$current","isEmpty","current","clear","focus","HTMLInputElement","hasTrailingDropDown","renderInteractionElement","Spinner","color","_jsxs","BaseBox","display","gap","Divider","orientation","BaseInput","Object","assign","id","componentName","MetaConstants","TextInput","setInputWrapperRef","wrapperNode","hideLabelText","isDropdownTrigger","showAllTags","maxTagRows","trailingDropDown","leadingInteractionElement","_ref2","length","e","onKeyDown","trailingInteractionElement","trailingFooterSlot","_value$length","marginTop","hintMarginTop","marginRight","CharacterCounter","currentCount","maxCount","getKeyboardAndAutocompleteProps","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8hBAqJA,IAAMA,aAAa,CAAG,SAAhBA,aAAaA,CAAIC,aAAkB,CAA4C,CACnF,OAAOC,eAAe,EAAE,GAAK,cAAc,CAC7C,CAAC,CAED,IAAMC,UAA2E,CAAG,SAA9EA,UAA2EA,CAAAC,IAAA,CA4C/EC,GAAG,CACc,KAAAC,aAAA,CAAAC,cAAA,CAAAC,KAAA,CA3Cf,IAAAC,KAAK,CAAAL,IAAA,CAALK,KAAK,CACLC,kBAAkB,CAAAN,IAAA,CAAlBM,kBAAkB,CAAAC,kBAAA,CAAAP,IAAA,CAClBQ,aAAa,CAAbA,aAAa,CAAAD,kBAAA,UAAG,KAAK,CAAAA,kBAAA,CACrBE,WAAW,CAAAT,IAAA,CAAXS,WAAW,CAAAC,SAAA,CAAAV,IAAA,CACXW,IAAI,CAAJA,IAAI,CAAAD,SAAA,GAAA,KAAA,CAAA,CAAG,MAAM,CAAAA,SAAA,CACbE,YAAY,CAAAZ,IAAA,CAAZY,YAAY,CACZC,IAAI,CAAAb,IAAA,CAAJa,IAAI,CACJC,KAAK,CA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CAClBmG,GAAA,CAACc,OAAO,CAAC2B,CAAAA,SAAS,CAAEC,aAAa,CAACpH,IAAI,CAAE,CAACqH,WAAW,CAAC,WAAW,CAAAvD,QAAA,CAC9DY,GAAA,CAAC4C,gBAAgB,EACfC,YAAY,CAAA,CAAAL,aAAA,CAAE5I,KAAK,cAALA,KAAK,CAAEuI,MAAM,GAAA,IAAA,CAAAK,aAAA,CAAI,CAAE,CACjCM,QAAQ,CAAEjJ,aAAc,CACxByB,IAAI,CAAEA,IAAK,CACZ,CAAC,CACK,CAAC,CACR,IAAI,CACV,CAAE,CAEFN,SAAS,CAAEA,SAAU,CACrBI,MAAM,CAAEA,MAAO,CACX2H,CAAAA,+BAA+B,CAAC,CAClCtJ,IAAI,CAAJA,IAAI,CACJwB,qBAAqB,CAArBA,qBAAqB,CACrBC,0BAA0B,CAA1BA,0BAA0B,CAC1BC,cAAc,CAAdA,cACF,CAAC,CAAC,EACFG,IAAI,CAAEA,IAAK,CAAA,CACPQ,IAAI,CACT,CAAC,CAEN,CAAC,CAEK,IAAA2F,SAAS,CAAGuB,wBAAwB,CAAC9G,cAAK,CAAC+G,UAAU,CAACpK,UAAU,CAAC,CAAE,CACvEqK,WAAW,CAAE,WACf,CAAC;;;;"}
|
|
@@ -5,6 +5,8 @@ import 'react-native-svg';
|
|
|
5
5
|
import '@babel/runtime/helpers/defineProperty';
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
7
7
|
import '../Icons/_Svg/Svg/Svg.native.js';
|
|
8
|
+
import '../../tokens/global/typography.js';
|
|
9
|
+
import '../../tokens/global/motion.js';
|
|
8
10
|
import 'styled-components/native';
|
|
9
11
|
import '@gorhom/portal';
|
|
10
12
|
import 'react-native-gesture-handler';
|
|
@@ -13,8 +15,6 @@ import 'react-native';
|
|
|
13
15
|
import '@babel/runtime/helpers/slicedToArray';
|
|
14
16
|
import 'react';
|
|
15
17
|
import '../BottomSheet/BottomSheetStack.js';
|
|
16
|
-
import '../../tokens/global/typography.js';
|
|
17
|
-
import '../../tokens/global/motion.js';
|
|
18
18
|
import CloseIcon from '../Icons/CloseIcon/CloseIcon.js';
|
|
19
19
|
|
|
20
20
|
var PopoverCloseButton=function PopoverCloseButton(){var _usePopoverContext=usePopoverContext(),close=_usePopoverContext.close,defaultInitialFocusRef=_usePopoverContext.defaultInitialFocusRef;return jsx(IconButton,{ref:defaultInitialFocusRef,size:"large",icon:CloseIcon,accessibilityLabel:"Close",onClick:close});};
|
|
@@ -3,6 +3,8 @@ import 'react-native-svg';
|
|
|
3
3
|
import '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import 'react/jsx-runtime';
|
|
5
5
|
import '../Icons/_Svg/Svg/Svg.native.js';
|
|
6
|
+
import '../../tokens/global/typography.js';
|
|
7
|
+
import '../../tokens/global/motion.js';
|
|
6
8
|
import 'styled-components/native';
|
|
7
9
|
import '@gorhom/portal';
|
|
8
10
|
import 'react-native-gesture-handler';
|
|
@@ -11,8 +13,6 @@ import 'react-native';
|
|
|
11
13
|
import '@babel/runtime/helpers/slicedToArray';
|
|
12
14
|
import 'react';
|
|
13
15
|
import '../BottomSheet/BottomSheetStack.js';
|
|
14
|
-
import '../../tokens/global/typography.js';
|
|
15
|
-
import '../../tokens/global/motion.js';
|
|
16
16
|
import AlertCircleIcon from '../Icons/AlertCircleIcon/AlertCircleIcon.js';
|
|
17
17
|
import CheckIcon from '../Icons/CheckIcon/CheckIcon.js';
|
|
18
18
|
|
|
@@ -12,7 +12,7 @@ import '../../BladeProvider/useTheme.js';
|
|
|
12
12
|
import { assignWithoutSideEffects } from '../../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
13
13
|
import { jsx } from 'react/jsx-runtime';
|
|
14
14
|
|
|
15
|
-
var _excluded=["as","variant","weight","size","truncateAfterLines","children","color","testID","textAlign","textDecorationLine","wordBreak"];var validAsValues=['p','span','div','abbr','figcaption','cite','q','label'];var getTextProps=function getTextProps(_ref){var variant=_ref.variant,weight=_ref.weight,size=_ref.size,_ref$color=_ref.color,color=_ref$color===void 0?'surface.text.gray.normal':_ref$color,testID=_ref.testID,textAlign=_ref.textAlign,textDecorationLine=_ref.textDecorationLine;var props={color:color,fontSize:100,fontWeight:weight!=null?weight:'regular',fontStyle:'normal',lineHeight:100,fontFamily:'text',componentName:'text',testID:testID,textAlign:textAlign,textDecorationLine:textDecorationLine};if(variant==='caption'){if(size&&size!=='small'&&size!=='medium'){if(__DEV__){throwBladeError({moduleName:'Text',message:`size cannot be '${size}' when variant is 'caption'`});}size='small';}}else if(variant!=='caption'&&!size){size='medium';}if(variant==='body'){if(size==='xsmall'){props.fontSize=25;props.lineHeight=25;}if(size==='small'){props.fontSize=75;props.lineHeight=75;}if(size==='medium'){props.fontSize=100;props.lineHeight=100;}if(size==='large'){props.fontSize=200;props.lineHeight=200;}}if(variant==='caption'){if(size==='small'){props.fontSize=50;props.lineHeight=50;props.fontWeight='regular';}if(size==='medium'){props.fontSize=100;props.lineHeight=50;props.fontWeight='regular';}
|
|
15
|
+
var _excluded=["as","variant","weight","size","truncateAfterLines","children","color","testID","textAlign","textDecorationLine","wordBreak"];var validAsValues=['p','span','div','abbr','figcaption','cite','q','label'];var getTextProps=function getTextProps(_ref){var variant=_ref.variant,weight=_ref.weight,size=_ref.size,_ref$color=_ref.color,color=_ref$color===void 0?'surface.text.gray.normal':_ref$color,testID=_ref.testID,textAlign=_ref.textAlign,textDecorationLine=_ref.textDecorationLine;var props={color:color,fontSize:100,fontWeight:weight!=null?weight:'regular',fontStyle:'normal',lineHeight:100,fontFamily:'text',componentName:'text',testID:testID,textAlign:textAlign,textDecorationLine:textDecorationLine};if(variant==='caption'){if(size&&size!=='small'&&size!=='medium'){if(__DEV__){throwBladeError({moduleName:'Text',message:`size cannot be '${size}' when variant is 'caption'`});}size='small';}}else if(variant!=='caption'&&!size){size='medium';}if(variant==='body'){if(size==='xsmall'){props.fontSize=25;props.lineHeight=25;}if(size==='small'){props.fontSize=75;props.lineHeight=75;}if(size==='medium'){props.fontSize=100;props.lineHeight=100;}if(size==='large'){props.fontSize=200;props.lineHeight=200;}}if(variant==='caption'){if(size==='small'){props.fontSize=50;props.lineHeight=50;props.fontWeight='regular';}if(size==='medium'){props.fontSize=100;props.lineHeight=50;props.fontWeight='regular';}}return props;};var _Text=function _Text(_ref2,ref){var _ref2$as=_ref2.as,as=_ref2$as===void 0?'p':_ref2$as,_ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'body':_ref2$variant,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'regular':_ref2$weight,size=_ref2.size,truncateAfterLines=_ref2.truncateAfterLines,children=_ref2.children,color=_ref2.color,testID=_ref2.testID,textAlign=_ref2.textAlign,textDecorationLine=_ref2.textDecorationLine,wordBreak=_ref2.wordBreak,styledProps=_objectWithoutProperties(_ref2,_excluded);var props=Object.assign({as:as,truncateAfterLines:truncateAfterLines,wordBreak:wordBreak},getTextProps({variant:variant,weight:weight,color:color,size:size,testID:testID,textAlign:textAlign,textDecorationLine:textDecorationLine}));useValidateAsProp({componentName:'Text',as:as,validAsValues:validAsValues});return jsx(BaseText,Object.assign({ref:ref},props,getStyledProps(styledProps),{children:children}));};var Text=assignWithoutSideEffects(React__default.forwardRef(_Text),{displayName:'Text',componentId:'Text'});
|
|
16
16
|
|
|
17
17
|
export { Text, getTextProps };
|
|
18
18
|
//# sourceMappingURL=Text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","sources":["../../../../../../src/components/Typography/Text/Text.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport type { ReactElement } from 'react';\nimport React from 'react';\nimport { BaseText } from '../BaseText';\nimport type { BaseTextProps, BaseTextSizes } from '../BaseText/types';\nimport { useValidateAsProp } from '../utils';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { BladeElementRef, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\n\nconst validAsValues = ['p', 'span', 'div', 'abbr', 'figcaption', 'cite', 'q', 'label'] as const;\ntype TextCommonProps = {\n as?: typeof validAsValues[number];\n truncateAfterLines?: number;\n children: React.ReactNode;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n /**\n * Overrides the color of the Text component.\n *\n * **Note** This takes priority over `type` and `contrast` prop to decide color of text\n */\n color?: BaseTextProps['color'];\n textAlign?: BaseTextProps['textAlign'];\n textDecorationLine?: BaseTextProps['textDecorationLine'];\n wordBreak?: BaseTextProps['wordBreak'];\n} & TestID &\n StyledPropsBlade;\n\nexport type TextVariant = 'body' | 'caption';\n\ntype TextBodyVariant = TextCommonProps & {\n variant?: Extract<TextVariant, 'body'>;\n size?: Extract<BaseTextSizes, 'xsmall' | 'small' | 'medium' | 'large'>;\n};\n\ntype TextCaptionVariant = TextCommonProps & {\n variant?: Extract<TextVariant, 'caption'>;\n size?: Extract<BaseTextSizes, 'small' | 'medium'>;\n};\n\nexport type TextProps<T> = T extends { variant: infer Variant }\n ? Variant extends 'caption'\n ? TextCaptionVariant\n : Variant extends 'body'\n ? TextBodyVariant\n : T\n : T;\n\ntype GetTextPropsReturn = Omit<BaseTextProps, 'children'>;\ntype GetTextProps<T extends { variant: TextVariant }> = Pick<\n TextProps<T>,\n 'variant' | 'weight' | 'size' | 'color' | 'testID' | 'textAlign' | 'textDecorationLine'\n>;\n\nconst getTextProps = <T extends { variant: TextVariant }>({\n variant,\n weight,\n size,\n color = 'surface.text.gray.normal',\n testID,\n textAlign,\n textDecorationLine,\n}: GetTextProps<T>): GetTextPropsReturn => {\n const props: GetTextPropsReturn = {\n color,\n fontSize: 100,\n fontWeight: weight ?? 'regular',\n fontStyle: 'normal',\n lineHeight: 100,\n fontFamily: 'text',\n componentName: 'text',\n testID,\n textAlign,\n textDecorationLine,\n };\n\n if (variant === 'caption') {\n // variant of caption can only have size of small\n if (size && size !== 'small' && size !== 'medium') {\n if (__DEV__) {\n throwBladeError({\n moduleName: 'Text',\n message: `size cannot be '${size}' when variant is 'caption'`,\n });\n }\n // Set size as small in case of invalid size\n size = 'small';\n }\n } else if (variant !== 'caption' && !size) {\n size = 'medium';\n }\n\n if (variant === 'body') {\n if (size === 'xsmall') {\n props.fontSize = 25;\n props.lineHeight = 25;\n }\n if (size === 'small') {\n props.fontSize = 75;\n props.lineHeight = 75;\n }\n if (size === 'medium') {\n props.fontSize = 100;\n props.lineHeight = 100;\n }\n if (size === 'large') {\n props.fontSize = 200;\n props.lineHeight = 200;\n }\n }\n if (variant === 'caption') {\n if (size === 'small') {\n props.fontSize = 50;\n props.lineHeight = 50;\n props.fontWeight = 'regular';\n }\n if (size === 'medium') {\n props.fontSize = 100;\n props.lineHeight = 50;\n props.fontWeight = 'regular';\n }\n
|
|
1
|
+
{"version":3,"file":"Text.js","sources":["../../../../../../src/components/Typography/Text/Text.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport type { ReactElement } from 'react';\nimport React from 'react';\nimport { BaseText } from '../BaseText';\nimport type { BaseTextProps, BaseTextSizes } from '../BaseText/types';\nimport { useValidateAsProp } from '../utils';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { BladeElementRef, TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\n\nconst validAsValues = ['p', 'span', 'div', 'abbr', 'figcaption', 'cite', 'q', 'label'] as const;\ntype TextCommonProps = {\n as?: typeof validAsValues[number];\n truncateAfterLines?: number;\n children: React.ReactNode;\n weight?: Extract<BaseTextProps['fontWeight'], 'regular' | 'medium' | 'semibold'>;\n /**\n * Overrides the color of the Text component.\n *\n * **Note** This takes priority over `type` and `contrast` prop to decide color of text\n */\n color?: BaseTextProps['color'];\n textAlign?: BaseTextProps['textAlign'];\n textDecorationLine?: BaseTextProps['textDecorationLine'];\n wordBreak?: BaseTextProps['wordBreak'];\n} & TestID &\n StyledPropsBlade;\n\nexport type TextVariant = 'body' | 'caption';\n\ntype TextBodyVariant = TextCommonProps & {\n variant?: Extract<TextVariant, 'body'>;\n size?: Extract<BaseTextSizes, 'xsmall' | 'small' | 'medium' | 'large'>;\n};\n\ntype TextCaptionVariant = TextCommonProps & {\n variant?: Extract<TextVariant, 'caption'>;\n size?: Extract<BaseTextSizes, 'small' | 'medium'>;\n};\n\nexport type TextProps<T> = T extends { variant: infer Variant }\n ? Variant extends 'caption'\n ? TextCaptionVariant\n : Variant extends 'body'\n ? TextBodyVariant\n : T\n : T;\n\ntype GetTextPropsReturn = Omit<BaseTextProps, 'children'>;\ntype GetTextProps<T extends { variant: TextVariant }> = Pick<\n TextProps<T>,\n 'variant' | 'weight' | 'size' | 'color' | 'testID' | 'textAlign' | 'textDecorationLine'\n>;\n\nconst getTextProps = <T extends { variant: TextVariant }>({\n variant,\n weight,\n size,\n color = 'surface.text.gray.normal',\n testID,\n textAlign,\n textDecorationLine,\n}: GetTextProps<T>): GetTextPropsReturn => {\n const props: GetTextPropsReturn = {\n color,\n fontSize: 100,\n fontWeight: weight ?? 'regular',\n fontStyle: 'normal',\n lineHeight: 100,\n fontFamily: 'text',\n componentName: 'text',\n testID,\n textAlign,\n textDecorationLine,\n };\n\n if (variant === 'caption') {\n // variant of caption can only have size of small\n if (size && size !== 'small' && size !== 'medium') {\n if (__DEV__) {\n throwBladeError({\n moduleName: 'Text',\n message: `size cannot be '${size}' when variant is 'caption'`,\n });\n }\n // Set size as small in case of invalid size\n size = 'small';\n }\n } else if (variant !== 'caption' && !size) {\n size = 'medium';\n }\n\n if (variant === 'body') {\n if (size === 'xsmall') {\n props.fontSize = 25;\n props.lineHeight = 25;\n }\n if (size === 'small') {\n props.fontSize = 75;\n props.lineHeight = 75;\n }\n if (size === 'medium') {\n props.fontSize = 100;\n props.lineHeight = 100;\n }\n if (size === 'large') {\n props.fontSize = 200;\n props.lineHeight = 200;\n }\n }\n if (variant === 'caption') {\n if (size === 'small') {\n props.fontSize = 50;\n props.lineHeight = 50;\n props.fontWeight = 'regular';\n }\n if (size === 'medium') {\n props.fontSize = 100;\n props.lineHeight = 50;\n props.fontWeight = 'regular';\n }\n }\n\n return props;\n};\n\nconst _Text = <T extends { variant: TextVariant }>(\n {\n as = 'p',\n variant = 'body',\n weight = 'regular',\n size,\n truncateAfterLines,\n children,\n color,\n testID,\n textAlign,\n textDecorationLine,\n wordBreak,\n ...styledProps\n }: TextProps<T>,\n ref: React.Ref<BladeElementRef>,\n): ReactElement => {\n const props: Omit<BaseTextProps, 'children'> = {\n as,\n truncateAfterLines,\n wordBreak,\n ...getTextProps({\n variant,\n weight,\n color,\n size,\n testID,\n textAlign,\n textDecorationLine,\n }),\n };\n\n useValidateAsProp({ componentName: 'Text', as, validAsValues });\n\n return (\n <BaseText ref={ref} {...props} {...getStyledProps(styledProps)}>\n {children}\n </BaseText>\n );\n};\n\nconst Text = assignWithoutSideEffects(React.forwardRef(_Text), {\n displayName: 'Text',\n componentId: 'Text',\n});\n\nexport { Text, getTextProps };\n"],"names":["validAsValues","getTextProps","_ref","variant","weight","size","_ref$color","color","testID","textAlign","textDecorationLine","props","fontSize","fontWeight","fontStyle","lineHeight","fontFamily","componentName","__DEV__","throwBladeError","moduleName","message","_Text","_ref2","ref","_ref2$as","as","_ref2$variant","_ref2$weight","truncateAfterLines","children","wordBreak","styledProps","_objectWithoutProperties","_excluded","Object","assign","useValidateAsProp","_jsx","BaseText","getStyledProps","Text","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;AAEA,IAAA,SAAA,CAAA,CAAA,IAAA,CAAA,SAAA,CAAA,QAAA,CAAA,MAAA,CAAA,oBAAA,CAAA,UAAA,CAAA,OAAA,CAAA,QAAA,CAAA,WAAA,CAAA,oBAAA,CAAA,WAAA,CAAA,CAUA,IAAMA,aAAa,CAAG,CAAC,G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CAAE,CAC7DuB,WAAW,CAAE,MAAM,CACnBC,WAAW,CAAE,MACf,CAAC;;;;"}
|
|
@@ -50,6 +50,7 @@ export { DropdownIconButton } from './Dropdown/DropdownIconButton.js';
|
|
|
50
50
|
export { DropdownFooter, DropdownHeader } from './Dropdown/DropdownHeaderFooter.js';
|
|
51
51
|
export { BaseFilterChip } from './Dropdown/FilterChipSelectInput.native.js';
|
|
52
52
|
export { FilterChipGroup } from './Dropdown/FilterChipGroup.native.js';
|
|
53
|
+
export { InputDropdownButton } from './Dropdown/InputDropdownButton.native.js';
|
|
53
54
|
export { Elevate } from './Elevate/Elevate.native.js';
|
|
54
55
|
export { Fade } from './Fade/Fade.native.js';
|
|
55
56
|
export { FileUpload } from './FileUpload/FileUpload.native.js';
|
|
@@ -133,6 +134,7 @@ export { default as CheckSquareIcon } from './Icons/CheckSquareIcon/CheckSquareI
|
|
|
133
134
|
export { default as ChevronDownIcon } from './Icons/ChevronDownIcon/ChevronDownIcon.js';
|
|
134
135
|
export { default as ChevronLeftIcon } from './Icons/ChevronLeftIcon/ChevronLeftIcon.js';
|
|
135
136
|
export { default as ChevronRightIcon } from './Icons/ChevronRightIcon/ChevronRightIcon.js';
|
|
137
|
+
export { default as ChevronUpDownIcon } from './Icons/ChevronUpDownIcon/ChevronUpDownIcon.js';
|
|
136
138
|
export { default as ChevronUpIcon } from './Icons/ChevronUpIcon/ChevronUpIcon.js';
|
|
137
139
|
export { default as ChevronsDownIcon } from './Icons/ChevronsDownIcon/ChevronsDownIcon.js';
|
|
138
140
|
export { default as ChevronsLeftIcon } from './Icons/ChevronsLeftIcon/ChevronsLeftIcon.js';
|
|
@@ -439,6 +441,7 @@ export { default as YoutubeIcon } from './Icons/YoutubeIcon/YoutubeIcon.js';
|
|
|
439
441
|
export { default as ZapIcon } from './Icons/ZapIcon/ZapIcon.js';
|
|
440
442
|
export { default as ZoomInIcon } from './Icons/ZoomInIcon/ZoomInIcon.js';
|
|
441
443
|
export { default as ZoomOutIcon } from './Icons/ZoomOutIcon/ZoomOutIcon.js';
|
|
444
|
+
export { InfoGroup, InfoItem, InfoItemKey, InfoItemValue } from './InfoGroup/InfoGroup.native.js';
|
|
442
445
|
export { Indicator } from './Indicator/Indicator.js';
|
|
443
446
|
export { SelectInput } from './Input/DropdownInputTriggers/SelectInput.js';
|
|
444
447
|
export { AutoComplete } from './Input/DropdownInputTriggers/AutoComplete.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var MetaConstants={Accordion:'accordion',AccordionButton:'accordion-button',AccordionItem:'accordion-item',AccordionItemHeader:'accordion-item-header',AccordionItemBody:'accordion-item-body',ActionList:'action-list',ActionListItem:'action-list-item',ActionListSection:'action-list-section',Alert:'alert',Amount:'amount',AutoComplete:'autocomplete',Avatar:'avatar',AvatarGroup:'avatar-group',Badge:'badge',BaseFilterChip:'base-filter-chip',Box:'box',BaseBox:'base-box',BaseText:'base-text',Button:'button',ButtonGroup:'button-group',Breadcrumb:'breadcrumb',BreadcrumbItem:'breadcrumb-item',BottomNav:'bottomnav',BottomNavItem:'bottomnav-item',Carousel:'carousel',ChatMessage:'chat-message',Checkbox:'checkbox',CheckboxGroup:'checkbox-group',CheckboxLabel:'checkbox-label',Chip:'chip',ChipGroup:'chip-group',ChipLabel:'chip-label',Code:'code',Component:'blade-component',Counter:'counter',Display:'display',Divider:'divider',Drawer:'drawer',Dropdown:'dropdown',DropdownOverlay:'dropdown-overlay',DropdownFooter:'dropdown-footer',DropdownHeader:'dropdown-header',DatePicker:'datepicker',Calendar:'calendar',FileUpload:'file-upload',FileUploadItem:'file-upload-item',FileUploadLabel:'file-upload-label',FilterChipGroup:'filter-chip-group',Icon:'icon',IconButton:'icon-button',Indicator:'indicator',InputGroup:'input-group',Link:'link',List:'list',ListItem:'list-item',ListItemCode:'list-item-code',ListItemLink:'list-item-link',ListItemText:'list-item-text',ListView:'list-view',ListViewFilter:'list-view-filter',OTPInput:'otp-input',PasswordInput:'password-input',SearchInput:'search-input',TextArea:'textarea',TextInput:'textinput',PhoneNumberInput:'phone-number-input',Toast:'toast',ToastContainer:'toast-container',TopNav:'top-nav',TopNavBrand:'top-nav-brand',TopNavContent:'top-nav-content',TopNavActions:'top-nav-actions',TabNav:'tab-nav',TabNavItems:'tab-nav-items',TabNavItem:'tab-nav-item',TabNavItemLink:'tab-nav-item-link',ProgressBar:'progress-bar',Radio:'radio',RadioGroup:'radio-group',RadioLabel:'radio-label',SkipNav:'skipnav',Spinner:'spinner',SideNav:'sidenav',SelectInput:'select-input',Tag:'tag',Tooltip:'tooltip',TooltipInteractiveWrapper:'tooltip-interactive-wrapper',Tabs:'tabs',TabList:'tab-list',TabItem:'tab-item',TabPanel:'tab-panel',TabIndicator:'tab-indicator',Table:'table',TableBody:'table-body',TableRow:'table-row',TableCell:'table-cell',TableCellWrapper:'table-cell-wrapper',TableSortButton:'table-sort-button',TableHeader:'table-header',TableHeaderRow:'table-header-row',TableHeaderCell:'table-header-cell',TableFooter:'table-footer',TableFooterRow:'table-footer-row',TableFooterCell:'table-footer-cell',TableElement:'table-element',TablePageSelectionButton:'table-page-selection-button',TourPopover:'tour-popover',TourMask:'tour-mask',Popover:'popover',PopoverInteractiveWrapper:'popover-interactive-wrapper',BottomSheet:'bottom-sheet',BottomSheetBody:'bottom-sheet-body',BottomSheetHeader:'bottom-sheet-header',BottomSheetFooter:'bottom-sheet-footer',BottomSheetGrabHandle:'bottomsheet-grab-handle',Card:'card',CardBody:'card-body',CardHeader:'card-header',CardFooter:'card-footer',Collapsible:'collapsible',CollapsibleBody:'collapsible-body',CollapsibleButton:'collapsible-button',CollapsibleLink:'collapsible-link',Menu:'menu',MenuHeader:'menu-header',MenuFooter:'menu-footer',Modal:'modal',ModalBody:'modal-body',ModalHeader:'modal-header',ModalFooter:'modal-footer',ModalBackdrop:'modal-backdrop',ModalScrollOverlay:'modal-scroll-overlay',VisuallyHidden:'visually-hidden',FormLabel:'form-label',Switch:'switch',SwitchLabel:'switch-label',StyledBaseInput:'styled-base-input',Skeleton:'skeleton',StepGroup:'step-group',StepItem:'step-item',PreviewWindow:'preview-window',PreviewHeader:'preview-header',PreviewBody:'preview-body',PreviewFooter:'preview-footer'};
|
|
1
|
+
var MetaConstants={Accordion:'accordion',AccordionButton:'accordion-button',AccordionItem:'accordion-item',AccordionItemHeader:'accordion-item-header',AccordionItemBody:'accordion-item-body',ActionList:'action-list',ActionListItem:'action-list-item',ActionListSection:'action-list-section',Alert:'alert',Amount:'amount',AutoComplete:'autocomplete',Avatar:'avatar',AvatarGroup:'avatar-group',Badge:'badge',BaseFilterChip:'base-filter-chip',Box:'box',BaseBox:'base-box',BaseText:'base-text',Button:'button',ButtonGroup:'button-group',Breadcrumb:'breadcrumb',BreadcrumbItem:'breadcrumb-item',BottomNav:'bottomnav',BottomNavItem:'bottomnav-item',Carousel:'carousel',ChatMessage:'chat-message',Checkbox:'checkbox',CheckboxGroup:'checkbox-group',CheckboxLabel:'checkbox-label',Chip:'chip',ChipGroup:'chip-group',ChipLabel:'chip-label',Code:'code',Component:'blade-component',Counter:'counter',Display:'display',Divider:'divider',Drawer:'drawer',Dropdown:'dropdown',DropdownOverlay:'dropdown-overlay',DropdownFooter:'dropdown-footer',DropdownHeader:'dropdown-header',DatePicker:'datepicker',Calendar:'calendar',FileUpload:'file-upload',FileUploadItem:'file-upload-item',FileUploadLabel:'file-upload-label',FilterChipGroup:'filter-chip-group',Icon:'icon',IconButton:'icon-button',InfoGroup:'info-group',InfoItem:'info-item',InfoItemKey:'info-item-key',InfoItemValue:'info-item-value',InfoItemIcon:'info-item-icon',Indicator:'indicator',InputGroup:'input-group',Link:'link',List:'list',ListItem:'list-item',ListItemCode:'list-item-code',ListItemLink:'list-item-link',ListItemText:'list-item-text',ListView:'list-view',ListViewFilter:'list-view-filter',OTPInput:'otp-input',PasswordInput:'password-input',SearchInput:'search-input',TextArea:'textarea',TextInput:'textinput',PhoneNumberInput:'phone-number-input',Toast:'toast',ToastContainer:'toast-container',TopNav:'top-nav',TopNavBrand:'top-nav-brand',TopNavContent:'top-nav-content',TopNavActions:'top-nav-actions',TabNav:'tab-nav',TabNavItems:'tab-nav-items',TabNavItem:'tab-nav-item',TabNavItemLink:'tab-nav-item-link',ProgressBar:'progress-bar',Radio:'radio',RadioGroup:'radio-group',RadioLabel:'radio-label',SkipNav:'skipnav',Spinner:'spinner',SideNav:'sidenav',SelectInput:'select-input',Tag:'tag',Tooltip:'tooltip',TooltipInteractiveWrapper:'tooltip-interactive-wrapper',Tabs:'tabs',TabList:'tab-list',TabItem:'tab-item',TabPanel:'tab-panel',TabIndicator:'tab-indicator',Table:'table',TableBody:'table-body',TableRow:'table-row',TableCell:'table-cell',TableCellWrapper:'table-cell-wrapper',TableSortButton:'table-sort-button',TableHeader:'table-header',TableHeaderRow:'table-header-row',TableHeaderCell:'table-header-cell',TableFooter:'table-footer',TableFooterRow:'table-footer-row',TableFooterCell:'table-footer-cell',TableElement:'table-element',TablePageSelectionButton:'table-page-selection-button',TourPopover:'tour-popover',TourMask:'tour-mask',Popover:'popover',PopoverInteractiveWrapper:'popover-interactive-wrapper',BottomSheet:'bottom-sheet',BottomSheetBody:'bottom-sheet-body',BottomSheetHeader:'bottom-sheet-header',BottomSheetFooter:'bottom-sheet-footer',BottomSheetGrabHandle:'bottomsheet-grab-handle',Card:'card',CardBody:'card-body',CardHeader:'card-header',CardFooter:'card-footer',Collapsible:'collapsible',CollapsibleBody:'collapsible-body',CollapsibleButton:'collapsible-button',CollapsibleLink:'collapsible-link',Menu:'menu',MenuHeader:'menu-header',MenuFooter:'menu-footer',Modal:'modal',ModalBody:'modal-body',ModalHeader:'modal-header',ModalFooter:'modal-footer',ModalBackdrop:'modal-backdrop',ModalScrollOverlay:'modal-scroll-overlay',VisuallyHidden:'visually-hidden',FormLabel:'form-label',Switch:'switch',SwitchLabel:'switch-label',StyledBaseInput:'styled-base-input',Skeleton:'skeleton',StepGroup:'step-group',StepItem:'step-item',PreviewWindow:'preview-window',PreviewHeader:'preview-header',PreviewBody:'preview-body',PreviewFooter:'preview-footer'};
|
|
2
2
|
|
|
3
3
|
export { MetaConstants };
|
|
4
4
|
//# sourceMappingURL=metaConstants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metaConstants.js","sources":["../../../../../src/utils/metaAttribute/metaConstants.ts"],"sourcesContent":["export const MetaConstants = {\n Accordion: 'accordion',\n AccordionButton: 'accordion-button',\n AccordionItem: 'accordion-item',\n AccordionItemHeader: 'accordion-item-header',\n AccordionItemBody: 'accordion-item-body',\n ActionList: 'action-list',\n ActionListItem: 'action-list-item',\n ActionListSection: 'action-list-section',\n Alert: 'alert',\n Amount: 'amount',\n AutoComplete: 'autocomplete',\n Avatar: 'avatar',\n AvatarGroup: 'avatar-group',\n Badge: 'badge',\n BaseFilterChip: 'base-filter-chip',\n Box: 'box',\n BaseBox: 'base-box',\n BaseText: 'base-text',\n Button: 'button',\n ButtonGroup: 'button-group',\n Breadcrumb: 'breadcrumb',\n BreadcrumbItem: 'breadcrumb-item',\n BottomNav: 'bottomnav',\n BottomNavItem: 'bottomnav-item',\n Carousel: 'carousel',\n ChatMessage: 'chat-message',\n Checkbox: 'checkbox',\n CheckboxGroup: 'checkbox-group',\n CheckboxLabel: 'checkbox-label',\n Chip: 'chip',\n ChipGroup: 'chip-group',\n ChipLabel: 'chip-label',\n Code: 'code',\n Component: 'blade-component',\n Counter: 'counter',\n Display: 'display',\n Divider: 'divider',\n Drawer: 'drawer',\n Dropdown: 'dropdown',\n DropdownOverlay: 'dropdown-overlay',\n DropdownFooter: 'dropdown-footer',\n DropdownHeader: 'dropdown-header',\n DatePicker: 'datepicker',\n Calendar: 'calendar',\n FileUpload: 'file-upload',\n FileUploadItem: 'file-upload-item',\n FileUploadLabel: 'file-upload-label',\n FilterChipGroup: 'filter-chip-group',\n Icon: 'icon',\n IconButton: 'icon-button',\n Indicator: 'indicator',\n InputGroup: 'input-group',\n Link: 'link',\n List: 'list',\n ListItem: 'list-item',\n ListItemCode: 'list-item-code',\n ListItemLink: 'list-item-link',\n ListItemText: 'list-item-text',\n ListView: 'list-view',\n ListViewFilter: 'list-view-filter',\n OTPInput: 'otp-input',\n PasswordInput: 'password-input',\n SearchInput: 'search-input',\n TextArea: 'textarea',\n TextInput: 'textinput',\n PhoneNumberInput: 'phone-number-input',\n Toast: 'toast',\n ToastContainer: 'toast-container',\n TopNav: 'top-nav',\n TopNavBrand: 'top-nav-brand',\n TopNavContent: 'top-nav-content',\n TopNavActions: 'top-nav-actions',\n TabNav: 'tab-nav',\n TabNavItems: 'tab-nav-items',\n TabNavItem: 'tab-nav-item',\n TabNavItemLink: 'tab-nav-item-link',\n ProgressBar: 'progress-bar',\n Radio: 'radio',\n RadioGroup: 'radio-group',\n RadioLabel: 'radio-label',\n SkipNav: 'skipnav',\n Spinner: 'spinner',\n SideNav: 'sidenav',\n SelectInput: 'select-input',\n Tag: 'tag',\n Tooltip: 'tooltip',\n TooltipInteractiveWrapper: 'tooltip-interactive-wrapper',\n Tabs: 'tabs',\n TabList: 'tab-list',\n TabItem: 'tab-item',\n TabPanel: 'tab-panel',\n TabIndicator: 'tab-indicator',\n Table: 'table',\n TableBody: 'table-body',\n TableRow: 'table-row',\n TableCell: 'table-cell',\n TableCellWrapper: 'table-cell-wrapper',\n TableSortButton: 'table-sort-button',\n TableHeader: 'table-header',\n TableHeaderRow: 'table-header-row',\n TableHeaderCell: 'table-header-cell',\n TableFooter: 'table-footer',\n TableFooterRow: 'table-footer-row',\n TableFooterCell: 'table-footer-cell',\n TableElement: 'table-element',\n TablePageSelectionButton: 'table-page-selection-button',\n TourPopover: 'tour-popover',\n TourMask: 'tour-mask',\n Popover: 'popover',\n PopoverInteractiveWrapper: 'popover-interactive-wrapper',\n BottomSheet: 'bottom-sheet',\n BottomSheetBody: 'bottom-sheet-body',\n BottomSheetHeader: 'bottom-sheet-header',\n BottomSheetFooter: 'bottom-sheet-footer',\n BottomSheetGrabHandle: 'bottomsheet-grab-handle',\n Card: 'card',\n CardBody: 'card-body',\n CardHeader: 'card-header',\n CardFooter: 'card-footer',\n Collapsible: 'collapsible',\n CollapsibleBody: 'collapsible-body',\n CollapsibleButton: 'collapsible-button',\n CollapsibleLink: 'collapsible-link',\n Menu: 'menu',\n MenuHeader: 'menu-header',\n MenuFooter: 'menu-footer',\n Modal: 'modal',\n ModalBody: 'modal-body',\n ModalHeader: 'modal-header',\n ModalFooter: 'modal-footer',\n ModalBackdrop: 'modal-backdrop',\n ModalScrollOverlay: 'modal-scroll-overlay',\n VisuallyHidden: 'visually-hidden',\n FormLabel: 'form-label',\n Switch: 'switch',\n SwitchLabel: 'switch-label',\n StyledBaseInput: 'styled-base-input',\n Skeleton: 'skeleton',\n StepGroup: 'step-group',\n StepItem: 'step-item',\n PreviewWindow: 'preview-window',\n PreviewHeader: 'preview-header',\n PreviewBody: 'preview-body',\n PreviewFooter: 'preview-footer',\n} as const;\n"],"names":["MetaConstants","Accordion","AccordionButton","AccordionItem","AccordionItemHeader","AccordionItemBody","ActionList","ActionListItem","ActionListSection","Alert","Amount","AutoComplete","Avatar","AvatarGroup","Badge","BaseFilterChip","Box","BaseBox","BaseText","Button","ButtonGroup","Breadcrumb","BreadcrumbItem","BottomNav","BottomNavItem","Carousel","ChatMessage","Checkbox","CheckboxGroup","CheckboxLabel","Chip","ChipGroup","ChipLabel","Code","Component","Counter","Display","Divider","Drawer","Dropdown","DropdownOverlay","DropdownFooter","DropdownHeader","DatePicker","Calendar","FileUpload","FileUploadItem","FileUploadLabel","FilterChipGroup","Icon","IconButton","Indicator","InputGroup","Link","List","ListItem","ListItemCode","ListItemLink","ListItemText","ListView","ListViewFilter","OTPInput","PasswordInput","SearchInput","TextArea","TextInput","PhoneNumberInput","Toast","ToastContainer","TopNav","TopNavBrand","TopNavContent","TopNavActions","TabNav","TabNavItems","TabNavItem","TabNavItemLink","ProgressBar","Radio","RadioGroup","RadioLabel","SkipNav","Spinner","SideNav","SelectInput","Tag","Tooltip","TooltipInteractiveWrapper","Tabs","TabList","TabItem","TabPanel","TabIndicator","Table","TableBody","TableRow","TableCell","TableCellWrapper","TableSortButton","TableHeader","TableHeaderRow","TableHeaderCell","TableFooter","TableFooterRow","TableFooterCell","TableElement","TablePageSelectionButton","TourPopover","TourMask","Popover","PopoverInteractiveWrapper","BottomSheet","BottomSheetBody","BottomSheetHeader","BottomSheetFooter","BottomSheetGrabHandle","Card","CardBody","CardHeader","CardFooter","Collapsible","CollapsibleBody","CollapsibleButton","CollapsibleLink","Menu","MenuHeader","MenuFooter","Modal","ModalBody","ModalHeader","ModalFooter","ModalBackdrop","ModalScrollOverlay","VisuallyHidden","FormLabel","Switch","SwitchLabel","StyledBaseInput","Skeleton","StepGroup","StepItem","PreviewWindow","Pre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AAE,mBAAmB,CACpCC,QAAQ,CAAE,UAAU,CACpBC,SAAS,CAAE,YAAY,CACvBC,QAAQ,CAAE,WAAW,CACrBC,aAAa,CAAE,gBAAgB,CAC/BC,aAAa,CAAE,gBAAgB,CAC/BC,WAAW,CAAE,cAAc,CAC3BC,aAAa,CAAE,gBACjB;;;;"}
|
|
1
|
+
{"version":3,"file":"metaConstants.js","sources":["../../../../../src/utils/metaAttribute/metaConstants.ts"],"sourcesContent":["export const MetaConstants = {\n Accordion: 'accordion',\n AccordionButton: 'accordion-button',\n AccordionItem: 'accordion-item',\n AccordionItemHeader: 'accordion-item-header',\n AccordionItemBody: 'accordion-item-body',\n ActionList: 'action-list',\n ActionListItem: 'action-list-item',\n ActionListSection: 'action-list-section',\n Alert: 'alert',\n Amount: 'amount',\n AutoComplete: 'autocomplete',\n Avatar: 'avatar',\n AvatarGroup: 'avatar-group',\n Badge: 'badge',\n BaseFilterChip: 'base-filter-chip',\n Box: 'box',\n BaseBox: 'base-box',\n BaseText: 'base-text',\n Button: 'button',\n ButtonGroup: 'button-group',\n Breadcrumb: 'breadcrumb',\n BreadcrumbItem: 'breadcrumb-item',\n BottomNav: 'bottomnav',\n BottomNavItem: 'bottomnav-item',\n Carousel: 'carousel',\n ChatMessage: 'chat-message',\n Checkbox: 'checkbox',\n CheckboxGroup: 'checkbox-group',\n CheckboxLabel: 'checkbox-label',\n Chip: 'chip',\n ChipGroup: 'chip-group',\n ChipLabel: 'chip-label',\n Code: 'code',\n Component: 'blade-component',\n Counter: 'counter',\n Display: 'display',\n Divider: 'divider',\n Drawer: 'drawer',\n Dropdown: 'dropdown',\n DropdownOverlay: 'dropdown-overlay',\n DropdownFooter: 'dropdown-footer',\n DropdownHeader: 'dropdown-header',\n DatePicker: 'datepicker',\n Calendar: 'calendar',\n FileUpload: 'file-upload',\n FileUploadItem: 'file-upload-item',\n FileUploadLabel: 'file-upload-label',\n FilterChipGroup: 'filter-chip-group',\n Icon: 'icon',\n IconButton: 'icon-button',\n InfoGroup: 'info-group',\n InfoItem: 'info-item',\n InfoItemKey: 'info-item-key',\n InfoItemValue: 'info-item-value',\n InfoItemIcon: 'info-item-icon',\n Indicator: 'indicator',\n InputGroup: 'input-group',\n Link: 'link',\n List: 'list',\n ListItem: 'list-item',\n ListItemCode: 'list-item-code',\n ListItemLink: 'list-item-link',\n ListItemText: 'list-item-text',\n ListView: 'list-view',\n ListViewFilter: 'list-view-filter',\n OTPInput: 'otp-input',\n PasswordInput: 'password-input',\n SearchInput: 'search-input',\n TextArea: 'textarea',\n TextInput: 'textinput',\n PhoneNumberInput: 'phone-number-input',\n Toast: 'toast',\n ToastContainer: 'toast-container',\n TopNav: 'top-nav',\n TopNavBrand: 'top-nav-brand',\n TopNavContent: 'top-nav-content',\n TopNavActions: 'top-nav-actions',\n TabNav: 'tab-nav',\n TabNavItems: 'tab-nav-items',\n TabNavItem: 'tab-nav-item',\n TabNavItemLink: 'tab-nav-item-link',\n ProgressBar: 'progress-bar',\n Radio: 'radio',\n RadioGroup: 'radio-group',\n RadioLabel: 'radio-label',\n SkipNav: 'skipnav',\n Spinner: 'spinner',\n SideNav: 'sidenav',\n SelectInput: 'select-input',\n Tag: 'tag',\n Tooltip: 'tooltip',\n TooltipInteractiveWrapper: 'tooltip-interactive-wrapper',\n Tabs: 'tabs',\n TabList: 'tab-list',\n TabItem: 'tab-item',\n TabPanel: 'tab-panel',\n TabIndicator: 'tab-indicator',\n Table: 'table',\n TableBody: 'table-body',\n TableRow: 'table-row',\n TableCell: 'table-cell',\n TableCellWrapper: 'table-cell-wrapper',\n TableSortButton: 'table-sort-button',\n TableHeader: 'table-header',\n TableHeaderRow: 'table-header-row',\n TableHeaderCell: 'table-header-cell',\n TableFooter: 'table-footer',\n TableFooterRow: 'table-footer-row',\n TableFooterCell: 'table-footer-cell',\n TableElement: 'table-element',\n TablePageSelectionButton: 'table-page-selection-button',\n TourPopover: 'tour-popover',\n TourMask: 'tour-mask',\n Popover: 'popover',\n PopoverInteractiveWrapper: 'popover-interactive-wrapper',\n BottomSheet: 'bottom-sheet',\n BottomSheetBody: 'bottom-sheet-body',\n BottomSheetHeader: 'bottom-sheet-header',\n BottomSheetFooter: 'bottom-sheet-footer',\n BottomSheetGrabHandle: 'bottomsheet-grab-handle',\n Card: 'card',\n CardBody: 'card-body',\n CardHeader: 'card-header',\n CardFooter: 'card-footer',\n Collapsible: 'collapsible',\n CollapsibleBody: 'collapsible-body',\n CollapsibleButton: 'collapsible-button',\n CollapsibleLink: 'collapsible-link',\n Menu: 'menu',\n MenuHeader: 'menu-header',\n MenuFooter: 'menu-footer',\n Modal: 'modal',\n ModalBody: 'modal-body',\n ModalHeader: 'modal-header',\n ModalFooter: 'modal-footer',\n ModalBackdrop: 'modal-backdrop',\n ModalScrollOverlay: 'modal-scroll-overlay',\n VisuallyHidden: 'visually-hidden',\n FormLabel: 'form-label',\n Switch: 'switch',\n SwitchLabel: 'switch-label',\n StyledBaseInput: 'styled-base-input',\n Skeleton: 'skeleton',\n StepGroup: 'step-group',\n StepItem: 'step-item',\n PreviewWindow: 'preview-window',\n PreviewHeader: 'preview-header',\n PreviewBody: 'preview-body',\n PreviewFooter: 'preview-footer',\n} as const;\n"],"names":["MetaConstants","Accordion","AccordionButton","AccordionItem","AccordionItemHeader","AccordionItemBody","ActionList","ActionListItem","ActionListSection","Alert","Amount","AutoComplete","Avatar","AvatarGroup","Badge","BaseFilterChip","Box","BaseBox","BaseText","Button","ButtonGroup","Breadcrumb","BreadcrumbItem","BottomNav","BottomNavItem","Carousel","ChatMessage","Checkbox","CheckboxGroup","CheckboxLabel","Chip","ChipGroup","ChipLabel","Code","Component","Counter","Display","Divider","Drawer","Dropdown","DropdownOverlay","DropdownFooter","DropdownHeader","DatePicker","Calendar","FileUpload","FileUploadItem","FileUploadLabel","FilterChipGroup","Icon","IconButton","InfoGroup","InfoItem","InfoItemKey","InfoItemValue","InfoItemIcon","Indicator","InputGroup","Link","List","ListItem","ListItemCode","ListItemLink","ListItemText","ListView","ListViewFilter","OTPInput","PasswordInput","SearchInput","TextArea","TextInput","PhoneNumberInput","Toast","ToastContainer","TopNav","TopNavBrand","TopNavContent","TopNavActions","TabNav","TabNavItems","TabNavItem","TabNavItemLink","ProgressBar","Radio","RadioGroup","RadioLabel","SkipNav","Spinner","SideNav","SelectInput","Tag","Tooltip","TooltipInteractiveWrapper","Tabs","TabList","TabItem","TabPanel","TabIndicator","Table","TableBody","TableRow","TableCell","TableCellWrapper","TableSortButton","TableHeader","TableHeaderRow","TableHeaderCell","TableFooter","TableFooterRow","TableFooterCell","TableElement","TablePageSelectionButton","TourPopover","TourMask","Popover","PopoverInteractiveWrapper","BottomSheet","BottomSheetBody","BottomSheetHeader","BottomSheetFooter","BottomSheetGrabHandle","Card","CardBody","CardHeader","CardFooter","Collapsible","CollapsibleBody","CollapsibleButton","CollapsibleLink","Menu","MenuHeader","MenuFooter","Modal","ModalBody","ModalHeader","ModalFooter","ModalBackdrop","ModalScrollOverlay","VisuallyHidden","FormLabel","Switch","SwitchLabel","StyledBaseInput","Skeleton","StepGroup","StepItem","PreviewWindow","PreviewHeader","PreviewBody","PreviewFooter"],"mappings":"AAAa,IAAAA,aAAa,CAAG,CAC3BC,SAAS,CAAE,WAAW,CACtBC,eAAe,CAAE,kBAAkB,CACnCC,aAAa,CAAE,gBAAgB,CAC/BC,mBAAmB,CAAE,uBAAuB,CAC5CC,iBAAiB,CAAE,qBAAqB,CACxCC,UAAU,CAAE,aAAa,CACzBC,cAAc,CAAE,kBAAkB,CAClCC,iBAAiB,CAAE,qBAAqB,CACxCC,KAAK,CAAE,OAAO,CACdC,MAAM,CAAE,QAAQ,CAChBC,YAAY,CAAE,cAAc,CAC5BC,MAAM,CAAE,QAAQ,CAChBC,WAAW,CAAE,cAAc,CAC3BC,KAAK,CAAE,OAAO,CACdC,cAAc,CAAE,kBAAkB,CAClCC,GAAG,CAAE,KAAK,CACVC,OAAO,CAAE,UAAU,CACnBC,QAAQ,CAAE,WAAW,CACrBC,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WAAW,CAAE,cAAc,CAC3BC,QAAQ,CAAE,WAAW,CACrBC,OAAO,CAAE,SAAS,CAClBC,yBAAyB,CAAE,6BAA6B,CACxDC,WAAW,CAAE,cAAc,CAC3BC,eAAe,CAAE,mBAAmB,CACpCC,iBAAiB,CAAE,qBAAqB,CACxCC,iBAAiB,CAAE,qBAAqB,CACxCC,qBAAqB,CAAE,yBAAyB,CAChDC,IAAI,CAAE,MAAM,CACZC,QAAQ,CAAE,WAAW,CACrBC,UAAU,CAAE,aAAa,CACzBC,UAAU,CAAE,aAAa,CACzBC,WAAW,CAAE,aAAa,CAC1BC,eAAe,CAAE,kBAAkB,CACnCC,iBAAiB,CAAE,oBAAoB,CACvCC,eAAe,CAAE,kBAAkB,CACnCC,IAAI,CAAE,MAAM,CACZC,UAAU,CAAE,aAAa,CACzBC,UAAU,CAAE,aAAa,CACzBC,KAAK,CAAE,OAAO,CACdC,SAAS,CAAE,YAAY,CACvBC,WAAW,CAAE,cAAc,CAC3BC,WAAW,CAAE,cAAc,CAC3BC,aAAa,CAAE,gBAAgB,CAC/BC,kBAAkB,CAAE,sBAAsB,CAC1CC,cAAc,CAAE,iBAAiB,CACjCC,SAAS,CAAE,YAAY,CACvBC,MAAM,CAAE,QAAQ,CAChBC,WAAW,CAAE,cAAc,CAC3BC,eAAe,CAAE,mBAAmB,CACpCC,QAAQ,CAAE,UAAU,CACpBC,SAAS,CAAE,YAAY,CACvBC,QAAQ,CAAE,WAAW,CACrBC,aAAa,CAAE,gBAAgB,CAC/BC,aAAa,CAAE,gBAAgB,CAC/BC,WAAW,CAAE,cAAc,CAC3BC,aAAa,CAAE,gBACjB;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import isEmpty from '../lodashButBetter/isEmpty.js';
|
|
3
|
+
import 'react-native';
|
|
4
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
5
|
+
import { isBrowser } from '../platform/isBrowser.js';
|
|
6
|
+
import '../../components/BladeProvider/useTheme.js';
|
|
7
|
+
import { useFirstRender } from '../useFirstRender.js';
|
|
8
|
+
import { fireNativeEvent } from '../fireNativeEvent/fireNativeEvent.native.js';
|
|
9
|
+
import { useDropdown } from '../../components/Dropdown/useDropdown.js';
|
|
10
|
+
|
|
11
|
+
var useControlledDropdownInput=function useControlledDropdownInput(props){var isFirstRender=useFirstRender();var _useDropdown=useDropdown(),changeCallbackTriggerer=_useDropdown.changeCallbackTriggerer,isControlled=_useDropdown.isControlled,options=_useDropdown.options,selectedIndices=_useDropdown.selectedIndices,controlledValueIndices=_useDropdown.controlledValueIndices,setSelectedIndices=_useDropdown.setSelectedIndices,selectionType=_useDropdown.selectionType,setIsControlled=_useDropdown.setIsControlled;var getValuesArrayFromIndices=function getValuesArrayFromIndices(){var indices=[];if(isControlled){indices=controlledValueIndices;}else {indices=selectedIndices;}return indices.map(function(selectionIndex){return options[selectionIndex].value;});};var selectValues=function selectValues(valuesToSelect){if(options.length>0){if(isEmpty(valuesToSelect)){setSelectedIndices([]);}else if(typeof valuesToSelect==='string'){var selectedItemIndex=options.findIndex(function(option){return option.value===valuesToSelect;});if(selectedItemIndex>=0){setSelectedIndices([selectedItemIndex]);}}else {var uniqueValues=Array.from(new Set(valuesToSelect));var userValues=selectionType==='single'?[valuesToSelect==null?void 0:valuesToSelect[0]]:uniqueValues;var selectedItemIndices=userValues.map(function(optionValue){return options.findIndex(function(option){return option.value===optionValue;});}).filter(function(value){return value>=0;});setSelectedIndices(selectedItemIndices);}}};React__default.useEffect(function(){if(options.length>0&&props.defaultValue){selectValues(props.defaultValue);}},[options.length]);React__default.useEffect(function(){if(options.length>0&&props.value!==undefined){if(!isControlled){setIsControlled(true);}selectValues(props.value);if(selectionType==='single'&&!Array.isArray(props.value)&&!props.isSelectInput){props.syncInputValueWithSelection==null?void 0:props.syncInputValueWithSelection(props.value);}}},[props.value,options]);React__default.useEffect(function(){if(!isFirstRender){props.onChange==null?void 0:props.onChange({name:props.name,values:getValuesArrayFromIndices()});if(isBrowser()){fireNativeEvent(props.triggererRef);}}},[changeCallbackTriggerer]);};
|
|
12
|
+
|
|
13
|
+
export { useControlledDropdownInput };
|
|
14
|
+
//# sourceMappingURL=useControlledDropdownInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useControlledDropdownInput.js","sources":["../../../../../src/utils/useControlledDropdownInput/useControlledDropdownInput.tsx"],"sourcesContent":["import React from 'react';\nimport type { BaseDropdownInputTriggerProps } from '~components/Input/DropdownInputTriggers/types';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport { isBrowser } from '~utils';\nimport { useFirstRender } from '~utils/useFirstRender';\nimport { fireNativeEvent } from '~utils/fireNativeEvent';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\n\nexport type useControlledDropdownInputProps = Pick<\n BaseDropdownInputTriggerProps,\n | 'onChange'\n | 'name'\n | 'value'\n | 'defaultValue'\n | 'onInputValueChange'\n | 'syncInputValueWithSelection'\n | 'isSelectInput'\n> & {\n triggererRef: React.RefObject<HTMLElement>;\n};\n\nconst useControlledDropdownInput = (props: useControlledDropdownInputProps): void => {\n const isFirstRender = useFirstRender();\n const {\n changeCallbackTriggerer,\n isControlled,\n options,\n selectedIndices,\n controlledValueIndices,\n setSelectedIndices,\n selectionType,\n setIsControlled,\n } = useDropdown();\n\n const getValuesArrayFromIndices = (): string[] => {\n let indices: number[] = [];\n if (isControlled) {\n indices = controlledValueIndices;\n } else {\n indices = selectedIndices;\n }\n\n return indices.map((selectionIndex) => options[selectionIndex].value);\n };\n\n const selectValues = (valuesToSelect: string | string[]): void => {\n if (options.length > 0) {\n // we use empty `''` for clearing the input\n if (isEmpty(valuesToSelect)) {\n setSelectedIndices([]);\n } else if (typeof valuesToSelect === 'string') {\n // single select control\n const selectedItemIndex = options.findIndex((option) => option.value === valuesToSelect);\n if (selectedItemIndex >= 0) {\n setSelectedIndices([selectedItemIndex]);\n }\n } else {\n // multiselect control\n\n // Handles repeated values in user state\n const uniqueValues = Array.from(new Set(valuesToSelect));\n // Handle selectionType single with multiselect values\n const userValues = selectionType === 'single' ? [valuesToSelect?.[0]] : uniqueValues;\n\n const selectedItemIndices = userValues\n .map((optionValue) => options.findIndex((option) => option.value === optionValue))\n .filter((value) => value >= 0);\n\n setSelectedIndices(selectedItemIndices);\n }\n }\n };\n\n // Handles `defaultValue` prop\n React.useEffect(() => {\n if (options.length > 0 && props.defaultValue) {\n selectValues(props.defaultValue);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [options.length]);\n\n // Handles `value` prop\n React.useEffect(() => {\n if (options.length > 0 && props.value !== undefined) {\n if (!isControlled) {\n setIsControlled(true);\n }\n\n selectValues(props.value);\n\n // in single select AutoComplete, we have to set inputValue of autocomplete according to the new selection.\n if (selectionType === 'single' && !Array.isArray(props.value) && !props.isSelectInput) {\n props.syncInputValueWithSelection?.(props.value);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.value, options]);\n\n // onChange behaviour\n React.useEffect(() => {\n // Ignore calling onChange on mount\n\n if (!isFirstRender) {\n props.onChange?.({\n name: props.name,\n values: getValuesArrayFromIndices(),\n });\n if (isBrowser()) {\n fireNativeEvent(props.triggererRef, ['change', 'input']);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [changeCallbackTriggerer]);\n};\n\nexport { useControlledDropdownInput };\n"],"names":["useControlledDropdownInput","props","isFirstRender","useFirstRender","_useDropdown","useDropdown","changeCallbackTriggerer","isControlled","options","selectedIndices","controlledValueIndices","setSelectedIndices","selectionType","setIsControlled","getValuesArrayFromIndices","indices","map","selectionIndex","value","selectValues","valuesToSelect","length","isEmpty","selectedItemIndex","findIndex","option","uniqueValues","Array","from","Set","userValues","selectedItemIndices","optionValue","filter","React","useEffect","defaultValue","undefined","isArray","isSelectInput","syncInputValueWithSelection","onChange","name","values","isBrowser","fireNativeEvent","triggererRef"],"mappings":";;;;;;;;;;AAqBM,IAAAA,0BAA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AAE,CACrFtC,KAAK,CAACuC,2BAA2B,EAAjCvC,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,KAAK,CAACuC,2BAA2B,CAAGvC,KAAK,CAACiB,KAAK,CAAC,CAClD,CACF,CAEF,CAAC,CAAE,CAACjB,KAAK,CAACiB,KAAK,CAAEV,OAAO,CAAC,CAAC,CAG1B0B,cAAK,CAACC,SAAS,CAAC,UAAM,CAGpB,GAAI,CAACjC,aAAa,CAAE,CAClBD,KAAK,CAACwC,QAAQ,EAAdxC,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,KAAK,CAACwC,QAAQ,CAAG,CACfC,IAAI,CAAEzC,KAAK,CAACyC,IAAI,CAChBC,MAAM,CAAE7B,yBAAyB,EACnC,CAAC,CAAC,CACF,GAAI8B,SAAS,EAAE,CAAE,CACfC,eAAe,CAAC5C,KAAK,CAAC6C,YAAiC,CAAC,CAC1D,CACF,CAEF,CAAC,CAAE,CAACxC,uBAAuB,CAAC,CAAC,CAC/B;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
+
import React__default from 'react';
|
|
3
4
|
import { useAccordion, useAccordionItemIndex } from './AccordionContext.js';
|
|
4
5
|
import { componentIds } from './componentIds.js';
|
|
5
6
|
import { BaseHeader } from '../BaseHeaderFooter/BaseHeader.js';
|
|
@@ -30,10 +31,20 @@ var _AccordionItemHeader = function _AccordionItemHeader(_ref) {
|
|
|
30
31
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
32
|
var _useAccordion = useAccordion(),
|
|
32
33
|
size = _useAccordion.size,
|
|
33
|
-
showNumberPrefix = _useAccordion.showNumberPrefix
|
|
34
|
+
showNumberPrefix = _useAccordion.showNumberPrefix,
|
|
35
|
+
expandedIndex = _useAccordion.expandedIndex;
|
|
34
36
|
var _useAccordionItemInde = useAccordionItemIndex(),
|
|
35
37
|
index = _useAccordionItemInde.index,
|
|
36
38
|
isDisabled = _useAccordionItemInde.isDisabled;
|
|
39
|
+
var isLeadingNumberOrIcon = React__default.useMemo(function () {
|
|
40
|
+
var _leading$type$name;
|
|
41
|
+
// Check if leading is a number
|
|
42
|
+
if (showNumberPrefix && typeof index === 'number') return true;
|
|
43
|
+
|
|
44
|
+
// Check if leading is an Icon component (name ends with "Icon")
|
|
45
|
+
if (leading && /*#__PURE__*/React__default.isValidElement(leading) && typeof leading.type === 'function' && (_leading$type$name = leading.type.name) !== null && _leading$type$name !== void 0 && _leading$type$name.endsWith('Icon')) return true;
|
|
46
|
+
return false;
|
|
47
|
+
}, [leading, showNumberPrefix, index]);
|
|
37
48
|
return /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({}, metaAttribute({
|
|
38
49
|
name: MetaConstants.AccordionItemHeader
|
|
39
50
|
})), {}, {
|
|
@@ -56,10 +67,15 @@ var _AccordionItemHeader = function _AccordionItemHeader(_ref) {
|
|
|
56
67
|
isDisabled: isDisabled,
|
|
57
68
|
showBackButton: false,
|
|
58
69
|
showCloseButton: false,
|
|
59
|
-
showDivider:
|
|
70
|
+
showDivider: expandedIndex === index,
|
|
60
71
|
paddingX: "spacing.5",
|
|
61
72
|
marginY: "spacing.5",
|
|
62
73
|
size: size,
|
|
74
|
+
alignItems: !subtitle && !isLeadingNumberOrIcon ? 'center' : 'flex-start',
|
|
75
|
+
dividerProps: {
|
|
76
|
+
thickness: 'thinner',
|
|
77
|
+
marginX: 'spacing.5'
|
|
78
|
+
},
|
|
63
79
|
trailingInteractionElement: /*#__PURE__*/jsx(CollapsibleChevronIcon, {
|
|
64
80
|
color: isDisabled ? 'interactive.icon.gray.disabled' : 'interactive.icon.gray.muted',
|
|
65
81
|
size: "large"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionItemHeader.js","sources":["../../../../../../src/components/Accordion/AccordionItemHeader.tsx"],"sourcesContent":["import { useAccordion, useAccordionItemIndex } from './AccordionContext';\nimport { componentIds } from './componentIds';\nimport type { BaseHeaderProps } from '~components/BaseHeaderFooter/BaseHeader';\nimport { BaseHeader } from '~components/BaseHeaderFooter/BaseHeader';\nimport { Text } from '~components/Typography';\nimport BaseBox from '~components/Box/BaseBox';\nimport { CollapsibleChevronIcon } from '~components/Collapsible/CollapsibleChevronIcon';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { DataAnalyticsAttribute } from '~utils/types';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst _AccordionItemHeader = ({\n title,\n subtitle,\n leading,\n children,\n trailing,\n titleSuffix,\n ...rest\n}: Pick<\n BaseHeaderProps,\n 'title' | 'subtitle' | 'leading' | 'children' | 'trailing' | 'titleSuffix'\n> &\n DataAnalyticsAttribute): React.ReactElement => {\n const { size, showNumberPrefix } = useAccordion();\n const { index, isDisabled } = useAccordionItemIndex();\n\n return (\n <BaseBox {...metaAttribute({ name: MetaConstants.AccordionItemHeader })} flex=\"1\">\n <BaseHeader\n leading={\n showNumberPrefix && typeof index === 'number' ? (\n // we have to add -2px margin to align the number with title of BaseHeader\n <Text size={size} weight=\"semibold\" marginTop=\"-2px\" as=\"span\">\n {index + 1}.\n </Text>\n ) : (\n leading\n )\n }\n title={title}\n subtitle={subtitle}\n trailing={trailing}\n titleSuffix={titleSuffix}\n isDisabled={isDisabled}\n showBackButton={false}\n showCloseButton={false}\n showDivider={
|
|
1
|
+
{"version":3,"file":"AccordionItemHeader.js","sources":["../../../../../../src/components/Accordion/AccordionItemHeader.tsx"],"sourcesContent":["import React from 'react';\nimport { useAccordion, useAccordionItemIndex } from './AccordionContext';\nimport { componentIds } from './componentIds';\nimport type { BaseHeaderProps } from '~components/BaseHeaderFooter/BaseHeader';\nimport { BaseHeader } from '~components/BaseHeaderFooter/BaseHeader';\nimport { Text } from '~components/Typography';\nimport BaseBox from '~components/Box/BaseBox';\nimport { CollapsibleChevronIcon } from '~components/Collapsible/CollapsibleChevronIcon';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { DataAnalyticsAttribute } from '~utils/types';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst _AccordionItemHeader = ({\n title,\n subtitle,\n leading,\n children,\n trailing,\n titleSuffix,\n ...rest\n}: Pick<\n BaseHeaderProps,\n 'title' | 'subtitle' | 'leading' | 'children' | 'trailing' | 'titleSuffix'\n> &\n DataAnalyticsAttribute): React.ReactElement => {\n const { size, showNumberPrefix, expandedIndex } = useAccordion();\n const { index, isDisabled } = useAccordionItemIndex();\n\n const isLeadingNumberOrIcon = React.useMemo(() => {\n // Check if leading is a number\n if (showNumberPrefix && typeof index === 'number') return true;\n\n // Check if leading is an Icon component (name ends with \"Icon\")\n if (\n leading &&\n React.isValidElement(leading) &&\n typeof leading.type === 'function' &&\n leading.type.name?.endsWith('Icon')\n )\n return true;\n\n return false;\n }, [leading, showNumberPrefix, index]);\n\n return (\n <BaseBox {...metaAttribute({ name: MetaConstants.AccordionItemHeader })} flex=\"1\">\n <BaseHeader\n leading={\n showNumberPrefix && typeof index === 'number' ? (\n // we have to add -2px margin to align the number with title of BaseHeader\n <Text size={size} weight=\"semibold\" marginTop=\"-2px\" as=\"span\">\n {index + 1}.\n </Text>\n ) : (\n leading\n )\n }\n title={title}\n subtitle={subtitle}\n trailing={trailing}\n titleSuffix={titleSuffix}\n isDisabled={isDisabled}\n showBackButton={false}\n showCloseButton={false}\n showDivider={expandedIndex === index}\n paddingX=\"spacing.5\"\n marginY=\"spacing.5\"\n size={size}\n alignItems={!subtitle && !isLeadingNumberOrIcon ? 'center' : 'flex-start'}\n dividerProps={{\n thickness: 'thinner',\n marginX: 'spacing.5',\n }}\n trailingInteractionElement={\n <CollapsibleChevronIcon\n color={isDisabled ? 'interactive.icon.gray.disabled' : 'interactive.icon.gray.muted'}\n size=\"large\"\n />\n }\n {...makeAnalyticsAttribute(rest)}\n >\n {children}\n </BaseHeader>\n </BaseBox>\n );\n};\n\nconst AccordionItemHeader = assignWithoutSideEffects(_AccordionItemHeader, {\n componentId: componentIds.AccordionItemHeader,\n});\n\nexport { AccordionItemHeader };\n"],"names":["_AccordionItemHeader","_ref","title","subtitle","leading","children","trailing","titleSuffix","rest","_objectWithoutProperties","_excluded","_useAccordion","useAccordion","size","showNumberPrefix","expandedIndex","_useAccordionItemInde","useAccordionItemIndex","index","isDisabled","isLeadingNumberOrIcon","React","useMemo","_leading$type$name","isValidElement","type","name","endsWith","_jsx","BaseBox","_objectSpread","metaAttribute","MetaConstants","AccordionItemHeader","flex","BaseHeader","_jsxs","Text","weight","marginTop","as","showBackButton","showCloseButton","showDivider","paddingX","marginY","alignItems","dividerProps","thickness","marginX","trailingInteractionElement","CollapsibleChevronIcon","color","makeAnalyticsAttribute","assignWithoutSideEffects","componentId","componentIds"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,EAYuB;AAAA,EAAA,IAX/CC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IACPC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;IACRC,QAAQ,GAAAL,IAAA,CAARK,QAAQ;IACRC,WAAW,GAAAN,IAAA,CAAXM,WAAW;AACRC,IAAAA,IAAI,GAAAC,wBAAA,CAAAR,IAAA,EAAAS,SAAA,CAAA,CAAA;AAMP,EAAA,IAAAC,aAAA,GAAkDC,YAAY,EAAE;IAAxDC,IAAI,GAAAF,aAAA,CAAJE,IAAI;IAAEC,gBAAgB,GAAAH,aAAA,CAAhBG,gBAAgB;IAAEC,aAAa,GAAAJ,aAAA,CAAbI,aAAa,CAAA;AAC7C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
20
20
|
backgroundColor: getBackgroundColor({
|
|
21
21
|
theme: theme,
|
|
22
|
-
isExpanded: isExpanded,
|
|
23
22
|
isActive: false
|
|
24
23
|
}),
|
|
25
24
|
transitionProperty: 'background-color, box-shadow, border-radius, color',
|
|
@@ -33,10 +32,12 @@ var StyledAccordionButton = /*#__PURE__*/styled.button.withConfig({
|
|
|
33
32
|
'&:hover, &:focus-visible': {
|
|
34
33
|
backgroundColor: getBackgroundColor({
|
|
35
34
|
theme: theme,
|
|
36
|
-
isExpanded: isExpanded,
|
|
37
35
|
isActive: true
|
|
38
36
|
}),
|
|
39
|
-
color: theme.colors.interactive.icon.gray.subtle
|
|
37
|
+
color: theme.colors.interactive.icon.gray.subtle,
|
|
38
|
+
'& [data-blade-component="divider"]': {
|
|
39
|
+
opacity: 0
|
|
40
|
+
}
|
|
40
41
|
},
|
|
41
42
|
'&:focus-visible': _objectSpread(_objectSpread({}, getFocusRingStyles({
|
|
42
43
|
theme: theme
|