@razorpay/blade 11.7.0 → 11.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/native/components/Button/BaseButton/AnimatedButtonContent.native.js +16 -0
- package/build/lib/native/components/Button/BaseButton/AnimatedButtonContent.native.js.map +1 -0
- package/build/lib/native/components/Button/BaseButton/BaseButton.js +7 -5
- package/build/lib/native/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/StyledBaseButton.native.js +1 -1
- package/build/lib/native/components/Button/BaseButton/StyledBaseButton.native.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js +7 -2
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/getStyledBaseButtonStyles.js +1 -1
- package/build/lib/native/components/Button/BaseButton/getStyledBaseButtonStyles.js.map +1 -1
- package/build/lib/native/components/ButtonGroup/ButtonGroup.native.js +7 -0
- package/build/lib/native/components/ButtonGroup/ButtonGroup.native.js.map +1 -0
- package/build/lib/native/components/ButtonGroup/ButtonGroupContext.js +6 -0
- package/build/lib/native/components/ButtonGroup/ButtonGroupContext.js.map +1 -0
- package/build/lib/native/components/Dropdown/useDropdown.js +1 -1
- package/build/lib/native/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/native/components/index.js +1 -0
- package/build/lib/native/components/index.js.map +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/AnimatedButtonContent.web.js +18 -0
- package/build/lib/web/development/components/Button/BaseButton/AnimatedButtonContent.web.js.map +1 -0
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js +127 -71
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js +11 -31
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/getStyledBaseButtonStyles.js +6 -2
- package/build/lib/web/development/components/Button/BaseButton/getStyledBaseButtonStyles.js.map +1 -1
- package/build/lib/web/development/components/ButtonGroup/ButtonGroup.web.js +158 -0
- package/build/lib/web/development/components/ButtonGroup/ButtonGroup.web.js.map +1 -0
- package/build/lib/web/development/components/ButtonGroup/ButtonGroupContext.js +11 -0
- package/build/lib/web/development/components/ButtonGroup/ButtonGroupContext.js.map +1 -0
- package/build/lib/web/development/components/ButtonGroup/StyledButtonGroup.js +46 -0
- package/build/lib/web/development/components/ButtonGroup/StyledButtonGroup.js.map +1 -0
- package/build/lib/web/development/components/ButtonGroup/index.js +2 -0
- package/build/lib/web/development/components/ButtonGroup/index.js.map +1 -0
- package/build/lib/web/development/components/Dropdown/useDropdown.js +3 -1
- package/build/lib/web/development/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/web/development/components/index.js +2 -0
- package/build/lib/web/development/components/index.js.map +1 -1
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js +1 -0
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/AnimatedButtonContent.web.js +18 -0
- package/build/lib/web/production/components/Button/BaseButton/AnimatedButtonContent.web.js.map +1 -0
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +127 -71
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js +11 -31
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/getStyledBaseButtonStyles.js +6 -2
- package/build/lib/web/production/components/Button/BaseButton/getStyledBaseButtonStyles.js.map +1 -1
- package/build/lib/web/production/components/ButtonGroup/ButtonGroup.web.js +158 -0
- package/build/lib/web/production/components/ButtonGroup/ButtonGroup.web.js.map +1 -0
- package/build/lib/web/production/components/ButtonGroup/ButtonGroupContext.js +11 -0
- package/build/lib/web/production/components/ButtonGroup/ButtonGroupContext.js.map +1 -0
- package/build/lib/web/production/components/ButtonGroup/StyledButtonGroup.js +46 -0
- package/build/lib/web/production/components/ButtonGroup/StyledButtonGroup.js.map +1 -0
- package/build/lib/web/production/components/ButtonGroup/index.js +2 -0
- package/build/lib/web/production/components/ButtonGroup/index.js.map +1 -0
- package/build/lib/web/production/components/Dropdown/useDropdown.js +3 -1
- package/build/lib/web/production/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/web/production/components/index.js +2 -0
- package/build/lib/web/production/components/index.js.map +1 -1
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js +1 -0
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/types/components/index.d.ts +68 -1
- package/build/types/components/index.native.d.ts +42 -1
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ import '@babel/runtime/helpers/slicedToArray';
|
|
|
8
8
|
import { isReactNative } from '../../utils/platform/isReactNative.js';
|
|
9
9
|
import '../BladeProvider/useTheme.js';
|
|
10
10
|
|
|
11
|
-
var _excluded=["isOpen","setIsOpen","close","selectedIndices","setSelectedIndices","activeIndex","setActiveIndex","activeTagIndex","setActiveTagIndex","visibleTagsCountRef","isKeydownPressed","setIsKeydownPressed","options","selectionType","changeCallbackTriggerer","setChangeCallbackTriggerer","isControlled","setControlledValueIndices","filteredValues","dropdownTriggerer"];var noop=function noop(){};var DropdownContext=React__default.createContext({isOpen:false,setIsOpen:noop,close:noop,selectedIndices:[],setSelectedIndices:noop,controlledValueIndices:[],setControlledValueIndices:noop,options:[],setOptions:noop,filteredValues:[],setFilteredValues:noop,activeIndex:-1,setActiveIndex:noop,activeTagIndex:-1,setActiveTagIndex:noop,shouldIgnoreBlurAnimation:false,setShouldIgnoreBlurAnimation:noop,hasFooterAction:false,setHasFooterAction:noop,hasAutoCompleteInBottomSheetHeader:false,setHasAutoCompleteInBottomSheetHeader:noop,isKeydownPressed:false,setIsKeydownPressed:noop,changeCallbackTriggerer:0,setChangeCallbackTriggerer:noop,isControlled:false,setIsControlled:noop,dropdownBaseId:'',actionListItemRef:{current:null},triggererRef:{current:null},isTagDismissedRef:{current:null},visibleTagsCountRef:{current:null},triggererWrapperRef:{current:null}});var searchTimeout;var searchString='';var useDropdown=function useDropdown(){var _React$useContext=React__default.useContext(DropdownContext),isOpen=_React$useContext.isOpen,setIsOpen=_React$useContext.setIsOpen,close=_React$useContext.close,selectedIndices=_React$useContext.selectedIndices,setSelectedIndices=_React$useContext.setSelectedIndices,activeIndex=_React$useContext.activeIndex,setActiveIndex=_React$useContext.setActiveIndex,activeTagIndex=_React$useContext.activeTagIndex,setActiveTagIndex=_React$useContext.setActiveTagIndex,visibleTagsCountRef=_React$useContext.visibleTagsCountRef,isKeydownPressed=_React$useContext.isKeydownPressed,setIsKeydownPressed=_React$useContext.setIsKeydownPressed,options=_React$useContext.options,selectionType=_React$useContext.selectionType,changeCallbackTriggerer=_React$useContext.changeCallbackTriggerer,setChangeCallbackTriggerer=_React$useContext.setChangeCallbackTriggerer,isControlled=_React$useContext.isControlled,setControlledValueIndices=_React$useContext.setControlledValueIndices,filteredValues=_React$useContext.filteredValues,dropdownTriggerer=_React$useContext.dropdownTriggerer,rest=_objectWithoutProperties(_React$useContext,_excluded);var setIndices=function setIndices(indices){if(isControlled){setControlledValueIndices(indices);}else {setSelectedIndices(indices);}};var removeOption=function removeOption(index){var existingItemIndex=selectedIndices.indexOf(index);if(existingItemIndex<0){return;}setIndices([].concat(_toConsumableArray(selectedIndices.slice(0,existingItemIndex)),_toConsumableArray(selectedIndices.slice(existingItemIndex+1))));};var selectOption=function selectOption(index){var properties=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{closeOnSelection:true};var isSelected=false;if(index<0||index>options.length-1){return isSelected;}if(selectionType==='multiple'){if(selectedIndices.includes(index)){removeOption(index);isSelected=false;}else {setIndices([].concat(_toConsumableArray(selectedIndices),[index]));isSelected=true;}}else {setIndices([index]);isSelected=true;}setChangeCallbackTriggerer(changeCallbackTriggerer+1);if(activeIndex!==index){setActiveIndex(index);}if(properties!=null&&properties.closeOnSelection&&selectionType!=='multiple'){close();}return isSelected;};var onTriggerClick=function onTriggerClick(){if(isOpen){close();}else {setIsOpen(true);}};var onOptionChange=function onOptionChange(actionType,index){setActiveTagIndex(-1);var newIndex=index!=null?index:activeIndex;var updatedIndex;var hasAutoComplete=rest.hasAutoCompleteInBottomSheetHeader||dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete;if(hasAutoComplete&&filteredValues.length>0){var filteredIndexes=filteredValues.map(function(filteredValue){return options.findIndex(function(option){return option.value===filteredValue;});}).sort();updatedIndex=filteredIndexes[getUpdatedIndex({currentIndex:filteredIndexes.indexOf(newIndex),maxIndex:filteredIndexes.length-1,actionType:actionType})];}else {updatedIndex=getUpdatedIndex({currentIndex:newIndex,maxIndex:options.length-1,actionType:actionType});}setActiveIndex(updatedIndex);var optionValues=options.map(function(option){return option.value;});ensureScrollVisiblity(updatedIndex,rest.actionListItemRef.current,optionValues);};var onOptionClick=function onOptionClick(e,index){var actionType=getActionFromKey(e,isOpen,dropdownTriggerer);if(typeof actionType==='number'){onOptionChange(actionType,index);}selectOption(index);if(!isReactNative()){var _rest$triggererRef$cu;(_rest$triggererRef$cu=rest.triggererRef.current)==null?void 0:_rest$triggererRef$cu.focus();}};var onComboType=function onComboType(letter,actionType){setIsOpen(true);if(rest.hasAutoCompleteInBottomSheetHeader||dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete){return;}if(typeof searchTimeout==='number'){window.clearTimeout(searchTimeout);}searchTimeout=window.setTimeout(function(){searchString='';},500);searchString=searchString+letter;var optionTitles=options.map(function(option){return option.title;});var searchIndex=getIndexByLetter(optionTitles,searchString,activeIndex+1);if(searchIndex>=0){onOptionChange(actionType,searchIndex);}else {window.clearTimeout(searchTimeout);searchString='';}};var onTriggerKeydown=function onTriggerKeydown(e){if(!isKeydownPressed&&![' ','Enter','Escape','Meta'].includes(e.event.key)){setIsKeydownPressed(true);}var actionType=getActionFromKey(e.event,isOpen,dropdownTriggerer);if(actionType){performAction(actionType,e,{setIsOpen:setIsOpen,close:close,onOptionChange:onOptionChange,onComboType:onComboType,selectCurrentOption:function selectCurrentOption(){var _options$activeIndex$,_options$activeIndex;if(activeIndex<0){return;}var isSelected=selectOption(activeIndex);if(rest.hasFooterAction&&!isReactNative()){var _rest$triggererRef$cu2;(_rest$triggererRef$cu2=rest.triggererRef.current)==null?void 0:_rest$triggererRef$cu2.focus();}(_options$activeIndex$=(_options$activeIndex=options[activeIndex]).onClickTrigger)==null?void 0:_options$activeIndex$.call(_options$activeIndex,isSelected);}});}};return Object.assign({isOpen:isOpen,setIsOpen:setIsOpen,close:close,selectedIndices:selectedIndices,setSelectedIndices:setSelectedIndices,filteredValues:filteredValues,removeOption:removeOption,setControlledValueIndices:setControlledValueIndices,onTriggerClick:onTriggerClick,onTriggerKeydown:onTriggerKeydown,onOptionClick:onOptionClick,activeIndex:activeIndex,setActiveIndex:setActiveIndex,activeTagIndex:activeTagIndex,setActiveTagIndex:setActiveTagIndex,visibleTagsCountRef:visibleTagsCountRef,isKeydownPressed:isKeydownPressed,setIsKeydownPressed:setIsKeydownPressed,changeCallbackTriggerer:changeCallbackTriggerer,setChangeCallbackTriggerer:setChangeCallbackTriggerer,isControlled:isControlled,options:options,value:makeInputValue(selectedIndices,options),displayValue:makeInputDisplayValue(selectedIndices,options),selectionType:selectionType,dropdownTriggerer:dropdownTriggerer},rest);};
|
|
11
|
+
var _excluded=["isOpen","setIsOpen","close","selectedIndices","setSelectedIndices","activeIndex","setActiveIndex","activeTagIndex","setActiveTagIndex","visibleTagsCountRef","isKeydownPressed","setIsKeydownPressed","options","selectionType","changeCallbackTriggerer","setChangeCallbackTriggerer","isControlled","setControlledValueIndices","filteredValues","dropdownTriggerer"];var noop=function noop(){};var DropdownContext=React__default.createContext({isOpen:false,setIsOpen:noop,close:noop,selectedIndices:[],setSelectedIndices:noop,controlledValueIndices:[],setControlledValueIndices:noop,options:[],setOptions:noop,filteredValues:[],setFilteredValues:noop,activeIndex:-1,setActiveIndex:noop,activeTagIndex:-1,setActiveTagIndex:noop,shouldIgnoreBlurAnimation:false,setShouldIgnoreBlurAnimation:noop,hasFooterAction:false,setHasFooterAction:noop,hasAutoCompleteInBottomSheetHeader:false,setHasAutoCompleteInBottomSheetHeader:noop,isKeydownPressed:false,setIsKeydownPressed:noop,changeCallbackTriggerer:0,setChangeCallbackTriggerer:noop,isControlled:false,setIsControlled:noop,dropdownBaseId:'',actionListItemRef:{current:null},triggererRef:{current:null},isTagDismissedRef:{current:null},visibleTagsCountRef:{current:null},triggererWrapperRef:{current:null}});var searchTimeout;var searchString='';var useDropdown=function useDropdown(){var _React$useContext=React__default.useContext(DropdownContext),isOpen=_React$useContext.isOpen,setIsOpen=_React$useContext.setIsOpen,close=_React$useContext.close,selectedIndices=_React$useContext.selectedIndices,setSelectedIndices=_React$useContext.setSelectedIndices,activeIndex=_React$useContext.activeIndex,setActiveIndex=_React$useContext.setActiveIndex,activeTagIndex=_React$useContext.activeTagIndex,setActiveTagIndex=_React$useContext.setActiveTagIndex,visibleTagsCountRef=_React$useContext.visibleTagsCountRef,isKeydownPressed=_React$useContext.isKeydownPressed,setIsKeydownPressed=_React$useContext.setIsKeydownPressed,options=_React$useContext.options,selectionType=_React$useContext.selectionType,changeCallbackTriggerer=_React$useContext.changeCallbackTriggerer,setChangeCallbackTriggerer=_React$useContext.setChangeCallbackTriggerer,isControlled=_React$useContext.isControlled,setControlledValueIndices=_React$useContext.setControlledValueIndices,filteredValues=_React$useContext.filteredValues,dropdownTriggerer=_React$useContext.dropdownTriggerer,rest=_objectWithoutProperties(_React$useContext,_excluded);var setIndices=function setIndices(indices){if(isControlled){setControlledValueIndices(indices);}else {setSelectedIndices(indices);}};var removeOption=function removeOption(index){var existingItemIndex=selectedIndices.indexOf(index);if(existingItemIndex<0){return;}setIndices([].concat(_toConsumableArray(selectedIndices.slice(0,existingItemIndex)),_toConsumableArray(selectedIndices.slice(existingItemIndex+1))));};var selectOption=function selectOption(index){var properties=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{closeOnSelection:true};var isSelected=false;if(index<0||index>options.length-1){return isSelected;}if(selectionType==='multiple'){if(selectedIndices.includes(index)){removeOption(index);isSelected=false;}else {setIndices([].concat(_toConsumableArray(selectedIndices),[index]));isSelected=true;}}else {setIndices([index]);isSelected=true;}setChangeCallbackTriggerer(changeCallbackTriggerer+1);if(activeIndex!==index){setActiveIndex(index);}if(properties!=null&&properties.closeOnSelection&&selectionType!=='multiple'){close();}return isSelected;};var onTriggerClick=function onTriggerClick(){if(isOpen){close();}else {setIsOpen(true);}};var onOptionChange=function onOptionChange(actionType,index){setActiveTagIndex(-1);var newIndex=index!=null?index:activeIndex;var updatedIndex;var hasAutoComplete=rest.hasAutoCompleteInBottomSheetHeader||dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete;if(hasAutoComplete&&filteredValues.length>0){var filteredIndexes=filteredValues.map(function(filteredValue){return options.findIndex(function(option){return option.value===filteredValue;});}).sort(function(a,b){return a-b;});updatedIndex=filteredIndexes[getUpdatedIndex({currentIndex:filteredIndexes.indexOf(newIndex),maxIndex:filteredIndexes.length-1,actionType:actionType})];}else {updatedIndex=getUpdatedIndex({currentIndex:newIndex,maxIndex:options.length-1,actionType:actionType});}setActiveIndex(updatedIndex);var optionValues=options.map(function(option){return option.value;});ensureScrollVisiblity(updatedIndex,rest.actionListItemRef.current,optionValues);};var onOptionClick=function onOptionClick(e,index){var actionType=getActionFromKey(e,isOpen,dropdownTriggerer);if(typeof actionType==='number'){onOptionChange(actionType,index);}selectOption(index);if(!isReactNative()){var _rest$triggererRef$cu;(_rest$triggererRef$cu=rest.triggererRef.current)==null?void 0:_rest$triggererRef$cu.focus();}};var onComboType=function onComboType(letter,actionType){setIsOpen(true);if(rest.hasAutoCompleteInBottomSheetHeader||dropdownTriggerer===dropdownComponentIds.triggers.AutoComplete){return;}if(typeof searchTimeout==='number'){window.clearTimeout(searchTimeout);}searchTimeout=window.setTimeout(function(){searchString='';},500);searchString=searchString+letter;var optionTitles=options.map(function(option){return option.title;});var searchIndex=getIndexByLetter(optionTitles,searchString,activeIndex+1);if(searchIndex>=0){onOptionChange(actionType,searchIndex);}else {window.clearTimeout(searchTimeout);searchString='';}};var onTriggerKeydown=function onTriggerKeydown(e){if(!isKeydownPressed&&![' ','Enter','Escape','Meta'].includes(e.event.key)){setIsKeydownPressed(true);}var actionType=getActionFromKey(e.event,isOpen,dropdownTriggerer);if(actionType){performAction(actionType,e,{setIsOpen:setIsOpen,close:close,onOptionChange:onOptionChange,onComboType:onComboType,selectCurrentOption:function selectCurrentOption(){var _options$activeIndex$,_options$activeIndex;if(activeIndex<0){return;}var isSelected=selectOption(activeIndex);if(rest.hasFooterAction&&!isReactNative()){var _rest$triggererRef$cu2;(_rest$triggererRef$cu2=rest.triggererRef.current)==null?void 0:_rest$triggererRef$cu2.focus();}(_options$activeIndex$=(_options$activeIndex=options[activeIndex]).onClickTrigger)==null?void 0:_options$activeIndex$.call(_options$activeIndex,isSelected);}});}};return Object.assign({isOpen:isOpen,setIsOpen:setIsOpen,close:close,selectedIndices:selectedIndices,setSelectedIndices:setSelectedIndices,filteredValues:filteredValues,removeOption:removeOption,setControlledValueIndices:setControlledValueIndices,onTriggerClick:onTriggerClick,onTriggerKeydown:onTriggerKeydown,onOptionClick:onOptionClick,activeIndex:activeIndex,setActiveIndex:setActiveIndex,activeTagIndex:activeTagIndex,setActiveTagIndex:setActiveTagIndex,visibleTagsCountRef:visibleTagsCountRef,isKeydownPressed:isKeydownPressed,setIsKeydownPressed:setIsKeydownPressed,changeCallbackTriggerer:changeCallbackTriggerer,setChangeCallbackTriggerer:setChangeCallbackTriggerer,isControlled:isControlled,options:options,value:makeInputValue(selectedIndices,options),displayValue:makeInputDisplayValue(selectedIndices,options),selectionType:selectionType,dropdownTriggerer:dropdownTriggerer},rest);};
|
|
12
12
|
|
|
13
13
|
export { DropdownContext, useDropdown };
|
|
14
14
|
//# sourceMappingURL=useDropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDropdown.js","sources":["../../../../../src/components/Dropdown/useDropdown.ts"],"sourcesContent":["import React from 'react';\n\nimport {\n ensureScrollVisiblity,\n getActionFromKey,\n getIndexByLetter,\n getUpdatedIndex,\n makeInputDisplayValue,\n makeInputValue,\n performAction,\n} from './dropdownUtils';\nimport type { SelectActionsType } from './dropdownUtils';\nimport type { DropdownProps } from './types';\n\nimport { dropdownComponentIds } from './dropdownComponentIds';\nimport type { FormInputHandleOnKeyDownEvent } from '~components/Form/FormTypes';\nimport { isReactNative } from '~utils';\nimport type { ContainerElementType } from '~utils/types';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\n\ntype OptionsType = {\n title: string;\n value: string;\n onClickTrigger?: (isSelected: boolean) => void;\n}[];\n\ntype DropdownContextType = {\n isOpen: boolean;\n setIsOpen: (isOpen: boolean) => void;\n close: () => void;\n /**\n * contains the indexes of selected items\n */\n selectedIndices: number[];\n setSelectedIndices: (value: number[]) => void;\n /**\n * contains the indexes of selected items during controlled selection\n */\n controlledValueIndices: number[];\n setControlledValueIndices: (value: number[]) => void;\n /**\n * contains information about all the options inside actionlist\n */\n options: OptionsType;\n setOptions: (value: OptionsType) => void;\n\n /**\n * Filtered values for AutoComplete Inputs\n */\n filteredValues: string[];\n setFilteredValues: (values: string[]) => void;\n\n /** Currently active (focussed) index */\n activeIndex: number;\n setActiveIndex: (value: number) => void;\n\n /** Currently active (focussed) tag */\n activeTagIndex: number;\n setActiveTagIndex: (value: number) => void;\n\n /**\n * Sometimes we want to ignore the blur event to keep dropdown open but not ignore the blur animation from selectinput\n * E.g. When someone clicks on Footer, we just want to ignore the blur event and not the blur animation\n */\n shouldIgnoreBlurAnimation: boolean;\n setShouldIgnoreBlurAnimation: (value: boolean) => void;\n /** Tells you if keyboard was used. Its false by default and turns into true when keydown is called */\n isKeydownPressed: boolean;\n setIsKeydownPressed: (value: boolean) => void;\n /** common baseId which is prepended to multiple other ids inside this dropdown */\n dropdownBaseId: string;\n /** Which element has triggered the dropdown */\n dropdownTriggerer?: 'SelectInput' | 'DropdownButton' | 'AutoComplete' | 'DropdownLink';\n /** ref of triggerer. Used to call focus in certain places */\n triggererRef: React.MutableRefObject<HTMLButtonElement | null>;\n triggererWrapperRef: React.MutableRefObject<ContainerElementType | null>;\n actionListItemRef: React.RefObject<HTMLDivElement | null>;\n isTagDismissedRef: React.RefObject<{ value: boolean } | null>;\n visibleTagsCountRef: React.RefObject<{ value: number } | null>;\n\n selectionType?: DropdownProps['selectionType'];\n /** whether footer has an action item.\n * certain a11y behaviour changes happen here\n * E.g. tabbing moves focus to that action instead of outside\n */\n hasFooterAction: boolean;\n setHasFooterAction: (value: boolean) => void;\n\n /**\n * Apart from dropdownTriggerer prop, we also set this boolean because in BottomSheet, the initial trigger can be Select but also have autocomplete inside of it\n */\n hasAutoCompleteInBottomSheetHeader: boolean;\n setHasAutoCompleteInBottomSheetHeader: (value: boolean) => void;\n\n /**\n * A value that can be used in dependency array to know when Dropdown value is changed.\n *\n * E.g.\n * ```ts\n * useEffect(() => {\n * console.log('Uncontrolled value change');\n * }, [changeCallbackTriggerer])\n * ```\n */\n changeCallbackTriggerer: number;\n setChangeCallbackTriggerer: (changeCallbackTriggerer: number) => void;\n\n /**\n * true when SelectInput has `value` prop (when it is controlled)\n */\n isControlled: boolean;\n setIsControlled: (isControlled: boolean) => void;\n};\n\nconst DropdownContext = React.createContext<DropdownContextType>({\n isOpen: false,\n setIsOpen: noop,\n close: noop,\n selectedIndices: [],\n setSelectedIndices: noop,\n controlledValueIndices: [],\n setControlledValueIndices: noop,\n options: [],\n setOptions: noop,\n filteredValues: [],\n setFilteredValues: noop,\n activeIndex: -1,\n setActiveIndex: noop,\n activeTagIndex: -1,\n setActiveTagIndex: noop,\n shouldIgnoreBlurAnimation: false,\n setShouldIgnoreBlurAnimation: noop,\n hasFooterAction: false,\n setHasFooterAction: noop,\n hasAutoCompleteInBottomSheetHeader: false,\n setHasAutoCompleteInBottomSheetHeader: noop,\n isKeydownPressed: false,\n setIsKeydownPressed: noop,\n changeCallbackTriggerer: 0,\n setChangeCallbackTriggerer: noop,\n isControlled: false,\n setIsControlled: noop,\n dropdownBaseId: '',\n actionListItemRef: {\n current: null,\n },\n triggererRef: {\n current: null,\n },\n isTagDismissedRef: {\n current: null,\n },\n visibleTagsCountRef: {\n current: null,\n },\n triggererWrapperRef: {\n current: null,\n },\n});\n\nlet searchTimeout: number;\nlet searchString = '';\n\ntype UseDropdownReturnValue = DropdownContextType & {\n /**\n * Click event on combobox. Toggles the dropdown\n */\n onTriggerClick: () => void;\n\n /**\n * Keydown event of combobox. Handles most of the keyboard accessibility of dropdown\n */\n onTriggerKeydown: FormInputHandleOnKeyDownEvent | undefined;\n\n /**\n * Handles the click even on option.\n *\n * Contains the logic that selects the option, moves the focus, etc\n */\n onOptionClick: (\n e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>,\n index: number,\n ) => void;\n\n /**\n * Removes the option with given optionsIndex\n */\n removeOption: (index: number) => void;\n\n /**\n * value that is used during form submissions\n */\n value: string;\n /**\n * This is the value that is displayed inside select after selection\n */\n displayValue: string;\n};\n\n/**\n * Handles almost all the functionality of dropdown.\n *\n * Returns the values from DropdownContext along with some helper functions and event handlers\n *\n */\nconst useDropdown = (): UseDropdownReturnValue => {\n const {\n isOpen,\n setIsOpen,\n close,\n selectedIndices,\n setSelectedIndices,\n activeIndex,\n setActiveIndex,\n activeTagIndex,\n setActiveTagIndex,\n visibleTagsCountRef,\n isKeydownPressed,\n setIsKeydownPressed,\n options,\n selectionType,\n changeCallbackTriggerer,\n setChangeCallbackTriggerer,\n isControlled,\n setControlledValueIndices,\n filteredValues,\n dropdownTriggerer,\n ...rest\n } = React.useContext(DropdownContext);\n\n type SelectOptionType = (\n index: number,\n properties?: {\n closeOnSelection?: boolean;\n },\n ) => boolean;\n\n const setIndices = (indices: number[]): void => {\n if (isControlled) {\n setControlledValueIndices(indices);\n } else {\n setSelectedIndices(indices);\n }\n };\n\n const removeOption = (index: number): void => {\n // remove existing item\n const existingItemIndex = selectedIndices.indexOf(index);\n if (existingItemIndex < 0) {\n return;\n }\n\n setIndices([\n ...selectedIndices.slice(0, existingItemIndex),\n ...selectedIndices.slice(existingItemIndex + 1),\n ]);\n };\n\n /**\n * Marks the given index as selected.\n *\n * In single select, it also closes the menu.\n * In multiselect, it keeps the menu open for more selections\n */\n const selectOption: SelectOptionType = (\n index,\n properties = {\n closeOnSelection: true,\n },\n ) => {\n let isSelected = false;\n\n if (index < 0 || index > options.length - 1) {\n return isSelected;\n }\n\n if (selectionType === 'multiple') {\n if (selectedIndices.includes(index)) {\n removeOption(index);\n isSelected = false;\n } else {\n setIndices([...selectedIndices, index]);\n isSelected = true;\n }\n } else {\n setIndices([index]);\n isSelected = true;\n }\n\n // Triggers `onChange` on SelectInput\n setChangeCallbackTriggerer(changeCallbackTriggerer + 1);\n\n if (activeIndex !== index) {\n setActiveIndex(index);\n }\n\n if (properties?.closeOnSelection && selectionType !== 'multiple') {\n close();\n }\n\n return isSelected;\n };\n\n /**\n * Click listener for combobox (or any triggerer of the dropdown)\n */\n const onTriggerClick = (): void => {\n if (isOpen) {\n close();\n } else {\n setIsOpen(true);\n }\n };\n\n /**\n * Function that we call when we want to move focus from one option to other\n */\n const onOptionChange = (actionType: SelectActionsType, index?: number): void => {\n setActiveTagIndex(-1);\n const newIndex = index ?? activeIndex;\n let updatedIndex: number;\n const hasAutoComplete =\n rest.hasAutoCompleteInBottomSheetHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n if (hasAutoComplete && filteredValues.length > 0) {\n // When its autocomplete, we don't loop over all options. We only loop on filtered options\n\n const filteredIndexes = filteredValues\n .map((filteredValue) => options.findIndex((option) => option.value === filteredValue))\n .sort();\n\n updatedIndex =\n filteredIndexes[\n getUpdatedIndex({\n currentIndex: filteredIndexes.indexOf(newIndex),\n maxIndex: filteredIndexes.length - 1,\n actionType,\n })\n ];\n } else {\n updatedIndex = getUpdatedIndex({\n currentIndex: newIndex,\n maxIndex: options.length - 1,\n actionType,\n });\n }\n setActiveIndex(updatedIndex);\n\n const optionValues = options.map((option) => option.value);\n ensureScrollVisiblity(updatedIndex, rest.actionListItemRef.current, optionValues);\n };\n\n /**\n * Click handler when user clicks on any particular option.\n *\n * It\n * - changes the option focus\n * - selects that option\n * - moves focus to combobox\n */\n const onOptionClick = (\n e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>,\n index: number,\n ): void => {\n const actionType = getActionFromKey(e, isOpen, dropdownTriggerer);\n if (typeof actionType === 'number') {\n onOptionChange(actionType, index);\n }\n selectOption(index);\n if (!isReactNative()) {\n rest.triggererRef.current?.focus();\n }\n };\n\n /**\n * Function we call to handle the typeahead.\n *\n * It takes a letter, stores that letter in searchString (and clears it after timeout) to maintain a word\n *\n * Then searches for that word in options and moves focus there.\n */\n const onComboType = (letter: string, actionType: SelectActionsType): void => {\n // open the listbox if it is closed\n setIsOpen(true);\n\n if (\n rest.hasAutoCompleteInBottomSheetHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete\n ) {\n return;\n }\n\n if (typeof searchTimeout === 'number') {\n window.clearTimeout(searchTimeout);\n }\n\n searchTimeout = window.setTimeout(() => {\n searchString = '';\n }, 500);\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n searchString = searchString + letter;\n const optionTitles = options.map((option) => option.title);\n const searchIndex = getIndexByLetter(optionTitles, searchString, activeIndex + 1);\n\n // if a match was found, go to it\n if (searchIndex >= 0) {\n onOptionChange(actionType, searchIndex);\n }\n // if no matches, clear the timeout and search string\n else {\n window.clearTimeout(searchTimeout);\n searchString = '';\n }\n };\n\n /**\n * Keydown event of combobox. Handles most of the keyboard accessibility of dropdown\n */\n const onTriggerKeydown = (e: {\n event: React.KeyboardEvent<HTMLInputElement | HTMLButtonElement>;\n }): void => {\n if (!isKeydownPressed && ![' ', 'Enter', 'Escape', 'Meta'].includes(e.event.key)) {\n // When keydown is not already pressed and its not Enter, Space, Command, or Escape key (those are generic keys and we only want to handle arrow keys or home buttons etc)\n setIsKeydownPressed(true);\n }\n\n const actionType = getActionFromKey(e.event, isOpen, dropdownTriggerer);\n\n if (actionType) {\n performAction(actionType, e, {\n setIsOpen,\n close,\n onOptionChange,\n onComboType,\n selectCurrentOption: () => {\n if (activeIndex < 0) {\n return;\n }\n\n const isSelected = selectOption(activeIndex);\n if (rest.hasFooterAction && !isReactNative()) {\n rest.triggererRef.current?.focus();\n }\n\n options[activeIndex].onClickTrigger?.(isSelected);\n },\n });\n }\n };\n\n return {\n isOpen,\n setIsOpen,\n close,\n selectedIndices,\n setSelectedIndices,\n filteredValues,\n removeOption,\n setControlledValueIndices,\n onTriggerClick,\n onTriggerKeydown,\n onOptionClick,\n activeIndex,\n setActiveIndex,\n activeTagIndex,\n setActiveTagIndex,\n visibleTagsCountRef,\n isKeydownPressed,\n setIsKeydownPressed,\n changeCallbackTriggerer,\n setChangeCallbackTriggerer,\n isControlled,\n options,\n value: makeInputValue(selectedIndices, options),\n displayValue: makeInputDisplayValue(selectedIndices, options),\n selectionType,\n dropdownTriggerer,\n ...rest,\n };\n};\n\nexport type { DropdownContextType, OptionsType };\nexport { useDropdown, DropdownContext };\n"],"names":["noop","DropdownContext","React","createContext","isOpen","setIsOpen","close","selectedIndices","setSelectedIndices","controlledValueIndices","setControlledValueIndices","options","setOptions","filteredValues","setFilteredValues","activeIndex","setActiveIndex","activeTagIndex","setActiveTagIndex","shouldIgnoreBlurAnimation","setShouldIgnoreBlurAnimation","hasFooterAction","setHasFooterAction","hasAutoCompleteInBottomSheetHeader","setHasAutoCompleteInBottomSheetHeader","isKeydownPressed","setIsKeydownPressed","changeCallbackTriggerer","setChangeCallbackTriggerer","isControlled","setIsControlled","dropdownBaseId","actionListItemRef","current","triggererRef","isTagDismissedRef","visibleTagsCountRef","triggererWrapperRef","searchTimeout","searchString","useDropdown","_React$useContext","useContext","selectionType","dropdownTriggerer","rest","_objectWithoutProperties","_excluded","setIndices","indices","removeOption","index","existingItemIndex","indexOf","concat","_toConsumableArray","slice","selectOption","properties","arguments","length","undefined","closeOnSelection","isSelected","includes","onTriggerClick","onOptionChange","actionType","newIndex","updatedIndex","hasAutoComplete","dropdownComponentIds","triggers","AutoComplete","filteredIndexes","map","filteredValue","findIndex","option","value","sort","getUpdatedIndex","currentIndex","maxIndex","optionValues","ensureScrollVisiblity","onOptionClick","e","getActionFromKey","isReactNative","_rest$triggererRef$cu","focus","onComboType","letter","window","clearTimeout","setTimeout","optionTitles","title","searchIndex","getIndexByLetter","onTriggerKeydown","event","key","performAction","selectCurrentOption","_options$activeIndex$","_options$activeIndex","_rest$triggererRef$cu2","onClickTrigger","call","Object","assign","makeInputValue","displayValue","makeInputDisplayValue"],"mappings":";;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,QAAA,CAAA,WAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,oBAAA,CAAA,aAAA,CAAA,gBAAA,CAAA,gBAAA,CAAA,mBAAA,CAAA,qBAAA,CAAA,kBAAA,CAAA,qBAAA,CAAA,SAAA,CAAA,eAAA,CAAA,yBAAA,CAAA,4BAAA,CAAA,cAAA,CAAA,2BAAA,CAAA,gBAAA,CAAA,mBAAA,CAAA,CAoBA,IAAMA,IAAI,CAAG,SAAPA,IAAIA,EAAe,EAAE,CAgGrB,IAAAC,eAAe,CAAGC,cAAK,CAACC,aAAa,CAAsB,CAC/DC,MAAM,CAAE,KAAK,CACbC,SAAS,CAAEL,IAAI,CACfM,KAAK,CAAEN,IAAI,CACXO,eAAe,CAAE,EAAE,CACnBC,kBAAkB,CAAER,IAAI,CACxBS,sBAAsB,CAAE,EAAE,CAC1BC,yBAAyB,CAAEV,IAAI,CAC/BW,OAAO,CAAE,EAAE,CAC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AnCH,qBAAA,CAAAI,IAAA,CAAAH,oBAAA,CAAsC5C,UAAU,CAAC,CACnD,CACF,CAAC,CAAC,CACJ,CACF,CAAC,CAED,OAAAgD,MAAA,CAAAC,MAAA,EACE5G,MAAM,CAANA,MAAM,CACNC,SAAS,CAATA,SAAS,CACTC,KAAK,CAALA,KAAK,CACLC,eAAe,CAAfA,eAAe,CACfC,kBAAkB,CAAlBA,kBAAkB,CAClBK,cAAc,CAAdA,cAAc,CACdqC,YAAY,CAAZA,YAAY,CACZxC,yBAAyB,CAAzBA,yBAAyB,CACzBuD,cAAc,CAAdA,cAAc,CACdoC,gBAAgB,CAAhBA,gBAAgB,CAChBf,aAAa,CAAbA,aAAa,CACbvE,WAAW,CAAXA,WAAW,CACXC,cAAc,CAAdA,cAAc,CACdC,cAAc,CAAdA,cAAc,CACdC,iBAAiB,CAAjBA,iBAAiB,CACjBkB,mBAAmB,CAAnBA,mBAAmB,CACnBX,gBAAgB,CAAhBA,gBAAgB,CAChBC,mBAAmB,CAAnBA,mBAAmB,CACnBC,uBAAuB,CAAvBA,uBAAuB,CACvBC,0BAA0B,CAA1BA,0BAA0B,CAC1BC,YAAY,CAAZA,YAAY,CACZlB,OAAO,CAAPA,OAAO,CACPoE,KAAK,CAAEkC,cAAc,CAAC1G,eAAe,CAAEI,OAAO,CAAC,CAC/CuG,YAAY,CAAEC,qBAAqB,CAAC5G,eAAe,CAAEI,OAAO,CAAC,CAC7DgC,aAAa,CAAbA,aAAa,CACbC,iBAAiB,CAAjBA,iBAAiB,CAAA,CACdC,IAAI,CAEX,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"useDropdown.js","sources":["../../../../../src/components/Dropdown/useDropdown.ts"],"sourcesContent":["import React from 'react';\n\nimport {\n ensureScrollVisiblity,\n getActionFromKey,\n getIndexByLetter,\n getUpdatedIndex,\n makeInputDisplayValue,\n makeInputValue,\n performAction,\n} from './dropdownUtils';\nimport type { SelectActionsType } from './dropdownUtils';\nimport type { DropdownProps } from './types';\n\nimport { dropdownComponentIds } from './dropdownComponentIds';\nimport type { FormInputHandleOnKeyDownEvent } from '~components/Form/FormTypes';\nimport { isReactNative } from '~utils';\nimport type { ContainerElementType } from '~utils/types';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\n\ntype OptionsType = {\n title: string;\n value: string;\n onClickTrigger?: (isSelected: boolean) => void;\n}[];\n\ntype DropdownContextType = {\n isOpen: boolean;\n setIsOpen: (isOpen: boolean) => void;\n close: () => void;\n /**\n * contains the indexes of selected items\n */\n selectedIndices: number[];\n setSelectedIndices: (value: number[]) => void;\n /**\n * contains the indexes of selected items during controlled selection\n */\n controlledValueIndices: number[];\n setControlledValueIndices: (value: number[]) => void;\n /**\n * contains information about all the options inside actionlist\n */\n options: OptionsType;\n setOptions: (value: OptionsType) => void;\n\n /**\n * Filtered values for AutoComplete Inputs\n */\n filteredValues: string[];\n setFilteredValues: (values: string[]) => void;\n\n /** Currently active (focussed) index */\n activeIndex: number;\n setActiveIndex: (value: number) => void;\n\n /** Currently active (focussed) tag */\n activeTagIndex: number;\n setActiveTagIndex: (value: number) => void;\n\n /**\n * Sometimes we want to ignore the blur event to keep dropdown open but not ignore the blur animation from selectinput\n * E.g. When someone clicks on Footer, we just want to ignore the blur event and not the blur animation\n */\n shouldIgnoreBlurAnimation: boolean;\n setShouldIgnoreBlurAnimation: (value: boolean) => void;\n /** Tells you if keyboard was used. Its false by default and turns into true when keydown is called */\n isKeydownPressed: boolean;\n setIsKeydownPressed: (value: boolean) => void;\n /** common baseId which is prepended to multiple other ids inside this dropdown */\n dropdownBaseId: string;\n /** Which element has triggered the dropdown */\n dropdownTriggerer?: 'SelectInput' | 'DropdownButton' | 'AutoComplete' | 'DropdownLink';\n /** ref of triggerer. Used to call focus in certain places */\n triggererRef: React.MutableRefObject<HTMLButtonElement | null>;\n triggererWrapperRef: React.MutableRefObject<ContainerElementType | null>;\n actionListItemRef: React.RefObject<HTMLDivElement | null>;\n isTagDismissedRef: React.RefObject<{ value: boolean } | null>;\n visibleTagsCountRef: React.RefObject<{ value: number } | null>;\n\n selectionType?: DropdownProps['selectionType'];\n /** whether footer has an action item.\n * certain a11y behaviour changes happen here\n * E.g. tabbing moves focus to that action instead of outside\n */\n hasFooterAction: boolean;\n setHasFooterAction: (value: boolean) => void;\n\n /**\n * Apart from dropdownTriggerer prop, we also set this boolean because in BottomSheet, the initial trigger can be Select but also have autocomplete inside of it\n */\n hasAutoCompleteInBottomSheetHeader: boolean;\n setHasAutoCompleteInBottomSheetHeader: (value: boolean) => void;\n\n /**\n * A value that can be used in dependency array to know when Dropdown value is changed.\n *\n * E.g.\n * ```ts\n * useEffect(() => {\n * console.log('Uncontrolled value change');\n * }, [changeCallbackTriggerer])\n * ```\n */\n changeCallbackTriggerer: number;\n setChangeCallbackTriggerer: (changeCallbackTriggerer: number) => void;\n\n /**\n * true when SelectInput has `value` prop (when it is controlled)\n */\n isControlled: boolean;\n setIsControlled: (isControlled: boolean) => void;\n};\n\nconst DropdownContext = React.createContext<DropdownContextType>({\n isOpen: false,\n setIsOpen: noop,\n close: noop,\n selectedIndices: [],\n setSelectedIndices: noop,\n controlledValueIndices: [],\n setControlledValueIndices: noop,\n options: [],\n setOptions: noop,\n filteredValues: [],\n setFilteredValues: noop,\n activeIndex: -1,\n setActiveIndex: noop,\n activeTagIndex: -1,\n setActiveTagIndex: noop,\n shouldIgnoreBlurAnimation: false,\n setShouldIgnoreBlurAnimation: noop,\n hasFooterAction: false,\n setHasFooterAction: noop,\n hasAutoCompleteInBottomSheetHeader: false,\n setHasAutoCompleteInBottomSheetHeader: noop,\n isKeydownPressed: false,\n setIsKeydownPressed: noop,\n changeCallbackTriggerer: 0,\n setChangeCallbackTriggerer: noop,\n isControlled: false,\n setIsControlled: noop,\n dropdownBaseId: '',\n actionListItemRef: {\n current: null,\n },\n triggererRef: {\n current: null,\n },\n isTagDismissedRef: {\n current: null,\n },\n visibleTagsCountRef: {\n current: null,\n },\n triggererWrapperRef: {\n current: null,\n },\n});\n\nlet searchTimeout: number;\nlet searchString = '';\n\ntype UseDropdownReturnValue = DropdownContextType & {\n /**\n * Click event on combobox. Toggles the dropdown\n */\n onTriggerClick: () => void;\n\n /**\n * Keydown event of combobox. Handles most of the keyboard accessibility of dropdown\n */\n onTriggerKeydown: FormInputHandleOnKeyDownEvent | undefined;\n\n /**\n * Handles the click even on option.\n *\n * Contains the logic that selects the option, moves the focus, etc\n */\n onOptionClick: (\n e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>,\n index: number,\n ) => void;\n\n /**\n * Removes the option with given optionsIndex\n */\n removeOption: (index: number) => void;\n\n /**\n * value that is used during form submissions\n */\n value: string;\n /**\n * This is the value that is displayed inside select after selection\n */\n displayValue: string;\n};\n\n/**\n * Handles almost all the functionality of dropdown.\n *\n * Returns the values from DropdownContext along with some helper functions and event handlers\n *\n */\nconst useDropdown = (): UseDropdownReturnValue => {\n const {\n isOpen,\n setIsOpen,\n close,\n selectedIndices,\n setSelectedIndices,\n activeIndex,\n setActiveIndex,\n activeTagIndex,\n setActiveTagIndex,\n visibleTagsCountRef,\n isKeydownPressed,\n setIsKeydownPressed,\n options,\n selectionType,\n changeCallbackTriggerer,\n setChangeCallbackTriggerer,\n isControlled,\n setControlledValueIndices,\n filteredValues,\n dropdownTriggerer,\n ...rest\n } = React.useContext(DropdownContext);\n\n type SelectOptionType = (\n index: number,\n properties?: {\n closeOnSelection?: boolean;\n },\n ) => boolean;\n\n const setIndices = (indices: number[]): void => {\n if (isControlled) {\n setControlledValueIndices(indices);\n } else {\n setSelectedIndices(indices);\n }\n };\n\n const removeOption = (index: number): void => {\n // remove existing item\n const existingItemIndex = selectedIndices.indexOf(index);\n if (existingItemIndex < 0) {\n return;\n }\n\n setIndices([\n ...selectedIndices.slice(0, existingItemIndex),\n ...selectedIndices.slice(existingItemIndex + 1),\n ]);\n };\n\n /**\n * Marks the given index as selected.\n *\n * In single select, it also closes the menu.\n * In multiselect, it keeps the menu open for more selections\n */\n const selectOption: SelectOptionType = (\n index,\n properties = {\n closeOnSelection: true,\n },\n ) => {\n let isSelected = false;\n\n if (index < 0 || index > options.length - 1) {\n return isSelected;\n }\n\n if (selectionType === 'multiple') {\n if (selectedIndices.includes(index)) {\n removeOption(index);\n isSelected = false;\n } else {\n setIndices([...selectedIndices, index]);\n isSelected = true;\n }\n } else {\n setIndices([index]);\n isSelected = true;\n }\n\n // Triggers `onChange` on SelectInput\n setChangeCallbackTriggerer(changeCallbackTriggerer + 1);\n\n if (activeIndex !== index) {\n setActiveIndex(index);\n }\n\n if (properties?.closeOnSelection && selectionType !== 'multiple') {\n close();\n }\n\n return isSelected;\n };\n\n /**\n * Click listener for combobox (or any triggerer of the dropdown)\n */\n const onTriggerClick = (): void => {\n if (isOpen) {\n close();\n } else {\n setIsOpen(true);\n }\n };\n\n /**\n * Function that we call when we want to move focus from one option to other\n */\n const onOptionChange = (actionType: SelectActionsType, index?: number): void => {\n setActiveTagIndex(-1);\n const newIndex = index ?? activeIndex;\n let updatedIndex: number;\n const hasAutoComplete =\n rest.hasAutoCompleteInBottomSheetHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n if (hasAutoComplete && filteredValues.length > 0) {\n // When its autocomplete, we don't loop over all options. We only loop on filtered options\n\n const filteredIndexes = filteredValues\n .map((filteredValue) => options.findIndex((option) => option.value === filteredValue))\n .sort((a, b) => a - b);\n\n updatedIndex =\n filteredIndexes[\n getUpdatedIndex({\n currentIndex: filteredIndexes.indexOf(newIndex),\n maxIndex: filteredIndexes.length - 1,\n actionType,\n })\n ];\n } else {\n updatedIndex = getUpdatedIndex({\n currentIndex: newIndex,\n maxIndex: options.length - 1,\n actionType,\n });\n }\n setActiveIndex(updatedIndex);\n\n const optionValues = options.map((option) => option.value);\n ensureScrollVisiblity(updatedIndex, rest.actionListItemRef.current, optionValues);\n };\n\n /**\n * Click handler when user clicks on any particular option.\n *\n * It\n * - changes the option focus\n * - selects that option\n * - moves focus to combobox\n */\n const onOptionClick = (\n e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>,\n index: number,\n ): void => {\n const actionType = getActionFromKey(e, isOpen, dropdownTriggerer);\n if (typeof actionType === 'number') {\n onOptionChange(actionType, index);\n }\n selectOption(index);\n if (!isReactNative()) {\n rest.triggererRef.current?.focus();\n }\n };\n\n /**\n * Function we call to handle the typeahead.\n *\n * It takes a letter, stores that letter in searchString (and clears it after timeout) to maintain a word\n *\n * Then searches for that word in options and moves focus there.\n */\n const onComboType = (letter: string, actionType: SelectActionsType): void => {\n // open the listbox if it is closed\n setIsOpen(true);\n\n if (\n rest.hasAutoCompleteInBottomSheetHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete\n ) {\n return;\n }\n\n if (typeof searchTimeout === 'number') {\n window.clearTimeout(searchTimeout);\n }\n\n searchTimeout = window.setTimeout(() => {\n searchString = '';\n }, 500);\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n searchString = searchString + letter;\n const optionTitles = options.map((option) => option.title);\n const searchIndex = getIndexByLetter(optionTitles, searchString, activeIndex + 1);\n\n // if a match was found, go to it\n if (searchIndex >= 0) {\n onOptionChange(actionType, searchIndex);\n }\n // if no matches, clear the timeout and search string\n else {\n window.clearTimeout(searchTimeout);\n searchString = '';\n }\n };\n\n /**\n * Keydown event of combobox. Handles most of the keyboard accessibility of dropdown\n */\n const onTriggerKeydown = (e: {\n event: React.KeyboardEvent<HTMLInputElement | HTMLButtonElement>;\n }): void => {\n if (!isKeydownPressed && ![' ', 'Enter', 'Escape', 'Meta'].includes(e.event.key)) {\n // When keydown is not already pressed and its not Enter, Space, Command, or Escape key (those are generic keys and we only want to handle arrow keys or home buttons etc)\n setIsKeydownPressed(true);\n }\n\n const actionType = getActionFromKey(e.event, isOpen, dropdownTriggerer);\n\n if (actionType) {\n performAction(actionType, e, {\n setIsOpen,\n close,\n onOptionChange,\n onComboType,\n selectCurrentOption: () => {\n if (activeIndex < 0) {\n return;\n }\n\n const isSelected = selectOption(activeIndex);\n if (rest.hasFooterAction && !isReactNative()) {\n rest.triggererRef.current?.focus();\n }\n\n options[activeIndex].onClickTrigger?.(isSelected);\n },\n });\n }\n };\n\n return {\n isOpen,\n setIsOpen,\n close,\n selectedIndices,\n setSelectedIndices,\n filteredValues,\n removeOption,\n setControlledValueIndices,\n onTriggerClick,\n onTriggerKeydown,\n onOptionClick,\n activeIndex,\n setActiveIndex,\n activeTagIndex,\n setActiveTagIndex,\n visibleTagsCountRef,\n isKeydownPressed,\n setIsKeydownPressed,\n changeCallbackTriggerer,\n setChangeCallbackTriggerer,\n isControlled,\n options,\n value: makeInputValue(selectedIndices, options),\n displayValue: makeInputDisplayValue(selectedIndices, options),\n selectionType,\n dropdownTriggerer,\n ...rest,\n };\n};\n\nexport type { DropdownContextType, OptionsType };\nexport { useDropdown, DropdownContext };\n"],"names":["noop","DropdownContext","React","createContext","isOpen","setIsOpen","close","selectedIndices","setSelectedIndices","controlledValueIndices","setControlledValueIndices","options","setOptions","filteredValues","setFilteredValues","activeIndex","setActiveIndex","activeTagIndex","setActiveTagIndex","shouldIgnoreBlurAnimation","setShouldIgnoreBlurAnimation","hasFooterAction","setHasFooterAction","hasAutoCompleteInBottomSheetHeader","setHasAutoCompleteInBottomSheetHeader","isKeydownPressed","setIsKeydownPressed","changeCallbackTriggerer","setChangeCallbackTriggerer","isControlled","setIsControlled","dropdownBaseId","actionListItemRef","current","triggererRef","isTagDismissedRef","visibleTagsCountRef","triggererWrapperRef","searchTimeout","searchString","useDropdown","_React$useContext","useContext","selectionType","dropdownTriggerer","rest","_objectWithoutProperties","_excluded","setIndices","indices","removeOption","index","existingItemIndex","indexOf","concat","_toConsumableArray","slice","selectOption","properties","arguments","length","undefined","closeOnSelection","isSelected","includes","onTriggerClick","onOptionChange","actionType","newIndex","updatedIndex","hasAutoComplete","dropdownComponentIds","triggers","AutoComplete","filteredIndexes","map","filteredValue","findIndex","option","value","sort","a","b","getUpdatedIndex","currentIndex","maxIndex","optionValues","ensureScrollVisiblity","onOptionClick","e","getActionFromKey","isReactNative","_rest$triggererRef$cu","focus","onComboType","letter","window","clearTimeout","setTimeout","optionTitles","title","searchIndex","getIndexByLetter","onTriggerKeydown","event","key","performAction","selectCurrentOption","_options$activeIndex$","_options$activeIndex","_rest$triggererRef$cu2","onClickTrigger","call","Object","assign","makeInputValue","displayValue","makeInputDisplayValue"],"mappings":";;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,QAAA,CAAA,WAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,oBAAA,CAAA,aAAA,CAAA,gBAAA,CAAA,gBAAA,CAAA,mBAAA,CAAA,qBAAA,CAAA,kBAAA,CAAA,qBAAA,CAAA,SAAA,CAAA,eAAA,CAAA,yBAAA,CAAA,4BAAA,CAAA,cAAA,CAAA,2BAAA,CAAA,gBAAA,CAAA,mBAAA,CAAA,CAoBA,IAAMA,IAAI,CAAG,SAAPA,IAAIA,EAAe,EAAE,CAgGrB,IAAAC,eAAe,CAAGC,cAAK,CAACC,aAAa,CAAsB,CAC/DC,MAAM,CAAE,KAAK,CACbC,SAAS,CAAEL,IAAI,CACfM,KAAK,CAAEN,IAAI,CACXO,eAAe,CAAE,EAAE,CACnBC,kBAAkB,CAAER,IAAI,CACxBS,sBAAsB,CAAE,EAAE,CAC1BC,yBAAyB,CAAEV,IAAI,CAC/BW,OAAO,CAAE,EAAE,CACXC,UAAU,CAAEZ,IAAI,CAChBa,cAAc,CAAE,EAAE,CAClBC,iBAAiB,CAAEd,IAAI,CACvBe,WAAW,CAAE,CAAC,CAAC,CACfC,cAAc,CAAEhB,IAAI,CACpBiB,cAAc,CAAE,CAAC,CAAC,CAClBC,iBAAiB,CAAElB,IAAI,CACvBmB,yBAAyB,CAAE,KAAK,CAChCC,4BAA4B,CAAEpB,IAAI,CAClCqB,eAAe,CAAE,KAAK,CACtBC,kBAAkB,CAAEtB,IAAI,CACxBuB,kCAAkC,CAA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qC,YAAY,CAAZA,YAAY,CACZxC,yBAAyB,CAAzBA,yBAAyB,CACzBuD,cAAc,CAAdA,cAAc,CACdsC,gBAAgB,CAAhBA,gBAAgB,CAChBf,aAAa,CAAbA,aAAa,CACbzE,WAAW,CAAXA,WAAW,CACXC,cAAc,CAAdA,cAAc,CACdC,cAAc,CAAdA,cAAc,CACdC,iBAAiB,CAAjBA,iBAAiB,CACjBkB,mBAAmB,CAAnBA,mBAAmB,CACnBX,gBAAgB,CAAhBA,gBAAgB,CAChBC,mBAAmB,CAAnBA,mBAAmB,CACnBC,uBAAuB,CAAvBA,uBAAuB,CACvBC,0BAA0B,CAA1BA,0BAA0B,CAC1BC,YAAY,CAAZA,YAAY,CACZlB,OAAO,CAAPA,OAAO,CACPoE,KAAK,CAAEoC,cAAc,CAAC5G,eAAe,CAAEI,OAAO,CAAC,CAC/CyG,YAAY,CAAEC,qBAAqB,CAAC9G,eAAe,CAAEI,OAAO,CAAC,CAC7DgC,aAAa,CAAbA,aAAa,CACbC,iBAAiB,CAAjBA,iBAAiB,CAAA,CACdC,IAAI,CAEX,CAAA;;;;"}
|
|
@@ -16,6 +16,7 @@ export { BreadcrumbItem } from './Breadcrumb/BreadcrumbItem.native.js';
|
|
|
16
16
|
export { Box } from './Box/Box.js';
|
|
17
17
|
export { default as Button } from './Button/Button/Button.js';
|
|
18
18
|
export { IconButton } from './Button/IconButton/IconButton.js';
|
|
19
|
+
export { ButtonGroup } from './ButtonGroup/ButtonGroup.native.js';
|
|
19
20
|
export { Card, CardBody, ComponentIds } from './Card/Card.js';
|
|
20
21
|
export { CardHeader, CardHeaderAmount, CardHeaderBadge, CardHeaderCounter, CardHeaderIcon, CardHeaderIconButton, CardHeaderLeading, CardHeaderLink, CardHeaderText, CardHeaderTrailing } from './Card/CardHeader.js';
|
|
21
22
|
export { CardFooter, CardFooterLeading, CardFooterTrailing } from './Card/CardFooter.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',Badge:'badge',Box:'box',BaseBox:'base-box',BaseText:'base-text',Button:'button',Breadcrumb:'breadcrumb',BreadcrumbItem:'breadcrumb-item',Carousel:'carousel',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',FileUpload:'file-upload',FileUploadItem:'file-upload-item',FileUploadLabel:'file-upload-label',Icon:'icon',IconButton:'icon-button',Indicator:'indicator',Link:'link',List:'list',ListItem:'list-item',ListItemCode:'list-item-code',ListItemLink:'list-item-link',ListItemText:'list-item-text',OTPInput:'otp-input',PasswordInput:'password-input',TextArea:'textarea',TextInput:'textinput',Toast:'toast',ToastContainer:'toast-container',ProgressBar:'progress-bar',Radio:'radio',RadioGroup:'radio-group',RadioLabel:'radio-label',SkipNav:'skipnav',Spinner:'spinner',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',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',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',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'};
|
|
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',Badge:'badge',Box:'box',BaseBox:'base-box',BaseText:'base-text',Button:'button',ButtonGroup:'button-group',Breadcrumb:'breadcrumb',BreadcrumbItem:'breadcrumb-item',Carousel:'carousel',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',FileUpload:'file-upload',FileUploadItem:'file-upload-item',FileUploadLabel:'file-upload-label',Icon:'icon',IconButton:'icon-button',Indicator:'indicator',Link:'link',List:'list',ListItem:'list-item',ListItemCode:'list-item-code',ListItemLink:'list-item-link',ListItemText:'list-item-text',OTPInput:'otp-input',PasswordInput:'password-input',TextArea:'textarea',TextInput:'textinput',Toast:'toast',ToastContainer:'toast-container',ProgressBar:'progress-bar',Radio:'radio',RadioGroup:'radio-group',RadioLabel:'radio-label',SkipNav:'skipnav',Spinner:'spinner',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',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',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',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'};
|
|
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 Badge: 'badge',\n Box: 'box',\n BaseBox: 'base-box',\n BaseText: 'base-text',\n Button: 'button',\n Breadcrumb: 'breadcrumb',\n BreadcrumbItem: 'breadcrumb-item',\n Carousel: 'carousel',\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 FileUpload: 'file-upload',\n FileUploadItem: 'file-upload-item',\n FileUploadLabel: 'file-upload-label',\n Icon: 'icon',\n IconButton: 'icon-button',\n Indicator: 'indicator',\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 OTPInput: 'otp-input',\n PasswordInput: 'password-input',\n TextArea: 'textarea',\n TextInput: 'textinput',\n Toast: 'toast',\n ToastContainer: 'toast-container',\n ProgressBar: 'progress-bar',\n Radio: 'radio',\n RadioGroup: 'radio-group',\n RadioLabel: 'radio-label',\n SkipNav: 'skipnav',\n Spinner: 'spinner',\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 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 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 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} as const;\n"],"names":["MetaConstants","Accordion","AccordionButton","AccordionItem","AccordionItemHeader","AccordionItemBody","ActionList","ActionListItem","ActionListSection","Alert","Amount","AutoComplete","Badge","Box","BaseBox","BaseText","Button","Breadcrumb","BreadcrumbItem","Carousel","Checkbox","CheckboxGroup","CheckboxLabel","Chip","ChipGroup","ChipLabel","Code","Component","Counter","Display","Divider","Drawer","Dropdown","DropdownOverlay","DropdownFooter","DropdownHeader","FileUpload","FileUploadItem","FileUploadLabel","Icon","IconButton","Indicator","Link","List","ListItem","ListItemCode","ListItemLink","ListItemText","OTPInput","PasswordInput","TextArea","TextInput","Toast","ToastContainer","ProgressBar","Radio","RadioGroup","RadioLabel","SkipNav","Spinner","SelectInput","Tag","Tooltip","TooltipInteractiveWrapper","Tabs","TabList","TabItem","TabPanel","TabIndicator","Table","TableBody","TableRow","TableCell","TableHeader","TableHeaderRow","TableHeaderCell","TableFooter","TableFooterRow","TableFooterCell","TableElement","TourPopover","TourMask","Popover","PopoverInteractiveWrapper","BottomSheet","BottomSheetBody","BottomSheetHeader","BottomSheetFooter","BottomSheetGrabHandle","Card","CardBody","CardHeader","CardFooter","Collapsible","CollapsibleBody","CollapsibleButton","CollapsibleLink","Modal","ModalBody","ModalHeader","ModalFooter","ModalBackdrop","ModalScrollOverlay","VisuallyHidden","FormLabel","Switch","SwitchLabel","StyledBaseInput","Skeleton"],"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,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AM,CAAE,QAAQ,CAChBC,WAAW,CAAE,cAAc,CAC3BC,eAAe,CAAE,mBAAmB,CACpCC,QAAQ,CAAE,UACZ;;;;"}
|
|
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 Badge: 'badge',\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 Carousel: 'carousel',\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 FileUpload: 'file-upload',\n FileUploadItem: 'file-upload-item',\n FileUploadLabel: 'file-upload-label',\n Icon: 'icon',\n IconButton: 'icon-button',\n Indicator: 'indicator',\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 OTPInput: 'otp-input',\n PasswordInput: 'password-input',\n TextArea: 'textarea',\n TextInput: 'textinput',\n Toast: 'toast',\n ToastContainer: 'toast-container',\n ProgressBar: 'progress-bar',\n Radio: 'radio',\n RadioGroup: 'radio-group',\n RadioLabel: 'radio-label',\n SkipNav: 'skipnav',\n Spinner: 'spinner',\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 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 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 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} as const;\n"],"names":["MetaConstants","Accordion","AccordionButton","AccordionItem","AccordionItemHeader","AccordionItemBody","ActionList","ActionListItem","ActionListSection","Alert","Amount","AutoComplete","Badge","Box","BaseBox","BaseText","Button","ButtonGroup","Breadcrumb","BreadcrumbItem","Carousel","Checkbox","CheckboxGroup","CheckboxLabel","Chip","ChipGroup","ChipLabel","Code","Component","Counter","Display","Divider","Drawer","Dropdown","DropdownOverlay","DropdownFooter","DropdownHeader","FileUpload","FileUploadItem","FileUploadLabel","Icon","IconButton","Indicator","Link","List","ListItem","ListItemCode","ListItemLink","ListItemText","OTPInput","PasswordInput","TextArea","TextInput","Toast","ToastContainer","ProgressBar","Radio","RadioGroup","RadioLabel","SkipNav","Spinner","SelectInput","Tag","Tooltip","TooltipInteractiveWrapper","Tabs","TabList","TabItem","TabPanel","TabIndicator","Table","TableBody","TableRow","TableCell","TableHeader","TableHeaderRow","TableHeaderCell","TableFooter","TableFooterRow","TableFooterCell","TableElement","TourPopover","TourMask","Popover","PopoverInteractiveWrapper","BottomSheet","BottomSheetBody","BottomSheetHeader","BottomSheetFooter","BottomSheetGrabHandle","Card","CardBody","CardHeader","CardFooter","Collapsible","CollapsibleBody","CollapsibleButton","CollapsibleLink","Modal","ModalBody","ModalHeader","ModalFooter","ModalBackdrop","ModalScrollOverlay","VisuallyHidden","FormLabel","Switch","SwitchLabel","StyledBaseInput","Skeleton"],"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,KAAK,CAAE,OAAO,CACdC,GAAG,CAAE,KAAK,CACVC,OAAO,CAAE,UAAU,CACnBC,QAAQ,CAAE,WAAW,CACrBC,MAAM,CAAE,QAAQ,CAChBC,WAAW,CAAE,cAAc,CAC3BC,UAAU,CAAE,YAAY,CACxBC,cAAc,CAAE,iBAAiB,CACjCC,QAAQ,C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ButBetter/get.js';
|
|
3
|
+
import '../../Box/BaseBox/index.js';
|
|
4
|
+
import { BaseBox } from '../../Box/BaseBox/BaseBox.web.js';
|
|
5
|
+
|
|
6
|
+
var AnimatedButtonContent = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
7
|
+
displayName: "AnimatedButtonContentweb__AnimatedButtonContent",
|
|
8
|
+
componentId: "sc-1fkx0t6-0"
|
|
9
|
+
})(function (props) {
|
|
10
|
+
return {
|
|
11
|
+
transform: "scale(".concat(props.isPressed ? '0.95' : '1', ")"),
|
|
12
|
+
transitionDuration: getIn(props.theme.motion, props.motionEasing),
|
|
13
|
+
transitionTimingFunction: getIn(props.theme.motion, props.motionDuration)
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export { AnimatedButtonContent as default };
|
|
18
|
+
//# sourceMappingURL=AnimatedButtonContent.web.js.map
|
package/build/lib/web/development/components/Button/BaseButton/AnimatedButtonContent.web.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnimatedButtonContent.web.js","sources":["../../../../../../../src/components/Button/BaseButton/AnimatedButtonContent.web.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport type { AnimatedButtonContentProps } from './types';\nimport getIn from '~utils/lodashButBetter/get';\nimport BaseBox from '~components/Box/BaseBox';\n\nconst AnimatedButtonContent = styled(BaseBox)<AnimatedButtonContentProps>((props) => {\n return {\n transform: `scale(${props.isPressed ? '0.95' : '1'})`,\n transitionDuration: getIn(props.theme.motion, props.motionEasing),\n transitionTimingFunction: getIn(props.theme.motion, props.motionDuration),\n };\n});\n\nexport default AnimatedButtonContent;\n"],"names":["AnimatedButtonContent","styled","BaseBox","withConfig","displayName","componentId","props","transform","concat","isPressed","transitionDuration","getIn","theme","motion","motionEasing","transitionTimingFunction","motionDuration"],"mappings":";;;;;AAKA,IAAMA,qBAAqB,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,iDAAA;EAAAC,WAAA,EAAA,cAAA;AAAA,CAA6B,CAAA,CAAA,UAACC,KAAK,EAAK;EACnF,OAAO;IACLC,SAAS,EAAA,QAAA,CAAAC,MAAA,CAAWF,KAAK,CAACG,SAAS,GAAG,MAAM,GAAG,GAAG,EAAG,GAAA,CAAA;AACrDC,IAAAA,kBAAkB,EAAEC,KAAK,CAACL,KAAK,CAACM,KAAK,CAACC,MAAM,EAAEP,KAAK,CAACQ,YAAY,CAAC;IACjEC,wBAAwB,EAAEJ,KAAK,CAACL,KAAK,CAACM,KAAK,CAACC,MAAM,EAAEP,KAAK,CAACU,cAAc,CAAA;GACzE,CAAA;AACH,CAAC;;;;"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
2
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
4
|
import React__default from 'react';
|
|
4
5
|
import styled from 'styled-components';
|
|
5
6
|
import StyledBaseButton from './StyledBaseButton.web.js';
|
|
6
|
-
import { backgroundColor, textColor, buttonIconOnlySizeToIconSizeMap, buttonSizeToIconSizeMap, buttonSizeToSpinnerSizeMap, minHeight,
|
|
7
|
+
import { backgroundColor, textColor, buttonIconOnlySizeToIconSizeMap, buttonSizeToIconSizeMap, buttonSizeToSpinnerSizeMap, minHeight, buttonIconOnlyHeightWidth, buttonIconPadding, buttonPadding, typography } from './buttonTokens.js';
|
|
8
|
+
import AnimatedButtonContent from './AnimatedButtonContent.web.js';
|
|
7
9
|
import getIn from '../../../utils/lodashButBetter/get.js';
|
|
8
10
|
import '../../../utils/index.js';
|
|
11
|
+
import { useButtonGroupContext } from '../../ButtonGroup/ButtonGroupContext.js';
|
|
9
12
|
import '../../Box/styledProps/index.js';
|
|
10
13
|
import '../../Typography/BaseText/index.js';
|
|
11
14
|
import '../../BladeProvider/index.js';
|
|
@@ -21,7 +24,7 @@ import '../../../utils/makeSpace/index.js';
|
|
|
21
24
|
import '../../../utils/metaAttribute/index.js';
|
|
22
25
|
import '../../../utils/getStringChildren/index.js';
|
|
23
26
|
import '../../../utils/logger/index.js';
|
|
24
|
-
import {
|
|
27
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
25
28
|
import { isReactNative } from '../../../utils/platform/isReactNative.js';
|
|
26
29
|
import { throwBladeError } from '../../../utils/logger/logger.js';
|
|
27
30
|
import { makeSize } from '../../../utils/makeSize/makeSize.js';
|
|
@@ -101,7 +104,7 @@ var getProps = function getProps(_ref3) {
|
|
|
101
104
|
if (variant === 'tertiary' && color !== 'primary' && color !== 'white') {
|
|
102
105
|
throwBladeError({
|
|
103
106
|
moduleName: 'BaseButton',
|
|
104
|
-
message: "Tertiary variant can only be used with color: \"
|
|
107
|
+
message: "Tertiary variant can only be used with color: \"primary\" or \"white\" but received \"".concat(color, "\"")
|
|
105
108
|
});
|
|
106
109
|
}
|
|
107
110
|
var isIconOnly = hasIcon && (!children || (children === null || children === void 0 ? void 0 : children.trim().length) === 0);
|
|
@@ -111,6 +114,8 @@ var getProps = function getProps(_ref3) {
|
|
|
111
114
|
fontSize: buttonTypographyTokens.fonts.size[size],
|
|
112
115
|
lineHeight: buttonTypographyTokens.lineHeights[size],
|
|
113
116
|
minHeight: makeSize(minHeight[size]),
|
|
117
|
+
height: isIconOnly ? buttonIconOnlyHeightWidth[size] : undefined,
|
|
118
|
+
width: isIconOnly ? buttonIconOnlyHeightWidth[size] : undefined,
|
|
114
119
|
iconPadding: hasIcon && children !== null && children !== void 0 && children.trim() ? "spacing.".concat(buttonIconPadding[size]) : undefined,
|
|
115
120
|
iconColor: getTextColorToken({
|
|
116
121
|
property: 'icon',
|
|
@@ -124,10 +129,10 @@ var getProps = function getProps(_ref3) {
|
|
|
124
129
|
color: color,
|
|
125
130
|
state: 'default'
|
|
126
131
|
}),
|
|
127
|
-
buttonPaddingTop: isIconOnly ? makeSpace(
|
|
128
|
-
buttonPaddingBottom: isIconOnly ? makeSpace(
|
|
129
|
-
buttonPaddingLeft: isIconOnly ? makeSpace(
|
|
130
|
-
buttonPaddingRight: isIconOnly ? makeSpace(
|
|
132
|
+
buttonPaddingTop: isIconOnly ? makeSpace(0) : makeSpace(theme.spacing[buttonPadding[size].top]),
|
|
133
|
+
buttonPaddingBottom: isIconOnly ? makeSpace(0) : makeSpace(theme.spacing[buttonPadding[size].bottom]),
|
|
134
|
+
buttonPaddingLeft: isIconOnly ? makeSpace(0) : makeSpace(theme.spacing[buttonPadding[size].left]),
|
|
135
|
+
buttonPaddingRight: isIconOnly ? makeSpace(0) : makeSpace(theme.spacing[buttonPadding[size].right]),
|
|
131
136
|
text: size === 'xsmall' ? children === null || children === void 0 ? void 0 : children.trim().toUpperCase() : children === null || children === void 0 ? void 0 : children.trim(),
|
|
132
137
|
defaultBackgroundColor: getIn(theme.colors, getBackgroundColorToken({
|
|
133
138
|
property: 'background',
|
|
@@ -215,6 +220,7 @@ var ButtonContent = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
215
220
|
};
|
|
216
221
|
});
|
|
217
222
|
var _BaseButton = function _BaseButton(_ref5, ref) {
|
|
223
|
+
var _buttonGroupProps$isD, _buttonGroupProps$siz, _buttonGroupProps$var, _buttonGroupProps$col, _buttonGroupProps$isF;
|
|
218
224
|
var href = _ref5.href,
|
|
219
225
|
target = _ref5.target,
|
|
220
226
|
rel = _ref5.rel,
|
|
@@ -235,7 +241,7 @@ var _BaseButton = function _BaseButton(_ref5, ref) {
|
|
|
235
241
|
isLoading = _ref5$isLoading === void 0 ? false : _ref5$isLoading,
|
|
236
242
|
onClick = _ref5.onClick,
|
|
237
243
|
onBlur = _ref5.onBlur,
|
|
238
|
-
|
|
244
|
+
_onKeyDown = _ref5.onKeyDown,
|
|
239
245
|
_ref5$type = _ref5.type,
|
|
240
246
|
type = _ref5$type === void 0 ? 'button' : _ref5$type,
|
|
241
247
|
children = _ref5.children,
|
|
@@ -246,15 +252,20 @@ var _BaseButton = function _BaseButton(_ref5, ref) {
|
|
|
246
252
|
onPointerDown = _ref5.onPointerDown,
|
|
247
253
|
onPointerEnter = _ref5.onPointerEnter,
|
|
248
254
|
accessibilityProps = _ref5.accessibilityProps,
|
|
249
|
-
|
|
250
|
-
|
|
255
|
+
_onTouchEnd = _ref5.onTouchEnd,
|
|
256
|
+
_onTouchStart = _ref5.onTouchStart,
|
|
251
257
|
rest = _objectWithoutProperties(_ref5, _excluded);
|
|
252
258
|
var _useTheme = useTheme(),
|
|
253
259
|
theme = _useTheme.theme;
|
|
260
|
+
var buttonGroupProps = useButtonGroupContext();
|
|
261
|
+
var _React$useState = React__default.useState(false),
|
|
262
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
263
|
+
isPressed = _React$useState2[0],
|
|
264
|
+
setIsPressed = _React$useState2[1];
|
|
254
265
|
var isLink = Boolean(href);
|
|
255
266
|
var childrenString = getStringFromReactText(children);
|
|
256
267
|
// Button cannot be disabled when its rendered as Link
|
|
257
|
-
var disabled = isLoading || isDisabled && !isLink;
|
|
268
|
+
var disabled = (_buttonGroupProps$isD = buttonGroupProps.isDisabled) !== null && _buttonGroupProps$isD !== void 0 ? _buttonGroupProps$isD : isLoading || isDisabled && !isLink;
|
|
258
269
|
if (true) {
|
|
259
270
|
if (!Icon && !(childrenString !== null && childrenString !== void 0 && childrenString.trim())) {
|
|
260
271
|
throwBladeError({
|
|
@@ -272,15 +283,17 @@ var _BaseButton = function _BaseButton(_ref5, ref) {
|
|
|
272
283
|
buttonTypographyTokens: typography,
|
|
273
284
|
children: childrenString,
|
|
274
285
|
isDisabled: disabled,
|
|
275
|
-
size: size,
|
|
276
|
-
variant: variant,
|
|
286
|
+
size: (_buttonGroupProps$siz = buttonGroupProps.size) !== null && _buttonGroupProps$siz !== void 0 ? _buttonGroupProps$siz : size,
|
|
287
|
+
variant: (_buttonGroupProps$var = buttonGroupProps.variant) !== null && _buttonGroupProps$var !== void 0 ? _buttonGroupProps$var : variant,
|
|
277
288
|
theme: theme,
|
|
278
|
-
color: color,
|
|
289
|
+
color: (_buttonGroupProps$col = buttonGroupProps.color) !== null && _buttonGroupProps$col !== void 0 ? _buttonGroupProps$col : color,
|
|
279
290
|
hasIcon: Boolean(Icon)
|
|
280
291
|
}),
|
|
281
292
|
defaultBorderColor = _getProps.defaultBorderColor,
|
|
282
293
|
defaultBackgroundColor = _getProps.defaultBackgroundColor,
|
|
283
294
|
minHeight = _getProps.minHeight,
|
|
295
|
+
height = _getProps.height,
|
|
296
|
+
width = _getProps.width,
|
|
284
297
|
buttonPaddingTop = _getProps.buttonPaddingTop,
|
|
285
298
|
buttonPaddingBottom = _getProps.buttonPaddingBottom,
|
|
286
299
|
buttonPaddingLeft = _getProps.buttonPaddingLeft,
|
|
@@ -306,7 +319,27 @@ var _BaseButton = function _BaseButton(_ref5, ref) {
|
|
|
306
319
|
return getRenderElement(href);
|
|
307
320
|
}, [href]);
|
|
308
321
|
var defaultRel = target === '_blank' ? 'noreferrer noopener' : undefined;
|
|
309
|
-
|
|
322
|
+
var handlePointerPressedIn = React__default.useCallback(function () {
|
|
323
|
+
if (disabled) return;
|
|
324
|
+
setIsPressed(true);
|
|
325
|
+
}, [disabled]);
|
|
326
|
+
var handlePointerPressedOut = React__default.useCallback(function () {
|
|
327
|
+
if (disabled) return;
|
|
328
|
+
setIsPressed(false);
|
|
329
|
+
}, [disabled]);
|
|
330
|
+
var handleKeyboardPressedIn = React__default.useCallback(function (e) {
|
|
331
|
+
if (disabled) return;
|
|
332
|
+
if (e.key === ' ' || e.key === 'Enter') {
|
|
333
|
+
setIsPressed(true);
|
|
334
|
+
}
|
|
335
|
+
}, [disabled]);
|
|
336
|
+
var handleKeyboardPressedOut = React__default.useCallback(function (e) {
|
|
337
|
+
if (disabled) return;
|
|
338
|
+
if (e.key === ' ' || e.key === 'Enter') {
|
|
339
|
+
setIsPressed(false);
|
|
340
|
+
}
|
|
341
|
+
}, [disabled]);
|
|
342
|
+
return /*#__PURE__*/jsx(StyledBaseButton, _objectSpread(_objectSpread(_objectSpread({
|
|
310
343
|
ref: ref
|
|
311
344
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error
|
|
312
345
|
// @ts-ignore: On React Native it will always be undefined but TS doesn't understand that
|
|
@@ -333,86 +366,109 @@ var _BaseButton = function _BaseButton(_ref5, ref) {
|
|
|
333
366
|
focusRingColor: focusRingColor,
|
|
334
367
|
hoverBorderColor: hoverBorderColor,
|
|
335
368
|
hoverBackgroundColor: hoverBackgroundColor,
|
|
336
|
-
isFullWidth: isFullWidth,
|
|
369
|
+
isFullWidth: (_buttonGroupProps$isF = buttonGroupProps.isFullWidth) !== null && _buttonGroupProps$isF !== void 0 ? _buttonGroupProps$isF : isFullWidth,
|
|
337
370
|
onClick: onClick,
|
|
338
371
|
onBlur: onBlur,
|
|
339
372
|
onFocus: onFocus,
|
|
340
373
|
onMouseLeave: onMouseLeave,
|
|
341
374
|
onMouseMove: onMouseMove,
|
|
342
375
|
onPointerDown: onPointerDown,
|
|
343
|
-
onPointerEnter: onPointerEnter
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
376
|
+
onPointerEnter: onPointerEnter
|
|
377
|
+
// Setting type for web fails it on native typecheck and vice versa
|
|
378
|
+
,
|
|
379
|
+
onKeyDown: function onKeyDown(event) {
|
|
380
|
+
handleKeyboardPressedIn(event);
|
|
381
|
+
_onKeyDown === null || _onKeyDown === void 0 ? void 0 : _onKeyDown(event);
|
|
382
|
+
},
|
|
383
|
+
onTouchStart: function onTouchStart(event) {
|
|
384
|
+
handlePointerPressedIn();
|
|
385
|
+
_onTouchStart === null || _onTouchStart === void 0 ? void 0 : _onTouchStart(event);
|
|
386
|
+
},
|
|
387
|
+
onTouchEnd: function onTouchEnd(event) {
|
|
388
|
+
handlePointerPressedOut();
|
|
389
|
+
_onTouchEnd === null || _onTouchEnd === void 0 ? void 0 : _onTouchEnd(event);
|
|
390
|
+
},
|
|
347
391
|
type: type,
|
|
348
392
|
borderWidth: borderWidth,
|
|
349
393
|
borderRadius: borderRadius,
|
|
350
394
|
motionDuration: motionDuration,
|
|
351
|
-
motionEasing: motionEasing
|
|
395
|
+
motionEasing: motionEasing,
|
|
396
|
+
height: height,
|
|
397
|
+
width: width,
|
|
398
|
+
isPressed: isPressed,
|
|
399
|
+
onMouseDown: handlePointerPressedIn,
|
|
400
|
+
onMouseUp: handlePointerPressedOut,
|
|
401
|
+
onMouseOut: handlePointerPressedOut,
|
|
402
|
+
onKeyUp: handleKeyboardPressedOut
|
|
352
403
|
}, metaAttribute({
|
|
353
404
|
name: MetaConstants.Button,
|
|
354
405
|
testID: testID
|
|
355
406
|
})), getStyledProps(rest)), {}, {
|
|
356
|
-
children:
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
top: "0px",
|
|
362
|
-
left: "0px",
|
|
363
|
-
bottom: "0px",
|
|
364
|
-
right: "0px",
|
|
365
|
-
zIndex: 1,
|
|
366
|
-
children: /*#__PURE__*/jsx(BaseSpinner, {
|
|
367
|
-
accessibilityLabel: "Loading",
|
|
368
|
-
size: spinnerSize,
|
|
369
|
-
color: color
|
|
370
|
-
})
|
|
371
|
-
}) : null, /*#__PURE__*/jsxs(ButtonContent, {
|
|
372
|
-
display: "flex",
|
|
373
|
-
flexDirection: "row",
|
|
374
|
-
alignItems: "center",
|
|
375
|
-
justifyContent: "center",
|
|
376
|
-
flex: 1,
|
|
377
|
-
isHidden: isLoading,
|
|
378
|
-
zIndex: 1,
|
|
379
|
-
children: [Icon && iconPosition == 'left' ? /*#__PURE__*/jsx(BaseBox, {
|
|
380
|
-
paddingRight: iconPadding,
|
|
407
|
+
children: /*#__PURE__*/jsxs(AnimatedButtonContent, {
|
|
408
|
+
motionDuration: motionDuration,
|
|
409
|
+
motionEasing: motionEasing,
|
|
410
|
+
isPressed: isPressed,
|
|
411
|
+
children: [isLoading ? /*#__PURE__*/jsx(BaseBox, {
|
|
381
412
|
display: "flex",
|
|
382
413
|
justifyContent: "center",
|
|
383
414
|
alignItems: "center",
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
415
|
+
position: "absolute",
|
|
416
|
+
top: "0px",
|
|
417
|
+
left: "0px",
|
|
418
|
+
bottom: "0px",
|
|
419
|
+
right: "0px",
|
|
420
|
+
zIndex: 1,
|
|
421
|
+
children: /*#__PURE__*/jsx(BaseSpinner, {
|
|
422
|
+
accessibilityLabel: "Loading",
|
|
423
|
+
size: spinnerSize,
|
|
424
|
+
color: color
|
|
387
425
|
})
|
|
388
|
-
}) : null,
|
|
389
|
-
lineHeight: lineHeight,
|
|
390
|
-
fontSize: fontSize
|
|
391
|
-
// figma and web have different font-smoothing properties
|
|
392
|
-
// which causes web version of button text to look much bolder
|
|
393
|
-
// than figma version. To fix this we are changing font-weight from 600 to 500
|
|
394
|
-
// https://forum.figma.com/t/why-does-a-font-weight-in-figma-seem-lighter-than-the-same-weight-in-the-browser/2207
|
|
395
|
-
,
|
|
396
|
-
fontWeight: "medium",
|
|
397
|
-
textAlign: "center",
|
|
398
|
-
color: textColor,
|
|
399
|
-
children: text
|
|
400
|
-
}) : null, Icon && iconPosition == 'right' ? /*#__PURE__*/jsx(BaseBox, {
|
|
401
|
-
paddingLeft: iconPadding,
|
|
426
|
+
}) : null, /*#__PURE__*/jsxs(ButtonContent, {
|
|
402
427
|
display: "flex",
|
|
403
|
-
|
|
428
|
+
flexDirection: "row",
|
|
404
429
|
alignItems: "center",
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
430
|
+
justifyContent: "center",
|
|
431
|
+
flex: 1,
|
|
432
|
+
isHidden: isLoading,
|
|
433
|
+
zIndex: 1,
|
|
434
|
+
children: [Icon && iconPosition == 'left' ? /*#__PURE__*/jsx(BaseBox, {
|
|
435
|
+
paddingRight: iconPadding,
|
|
436
|
+
display: "flex",
|
|
437
|
+
justifyContent: "center",
|
|
438
|
+
alignItems: "center",
|
|
439
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
440
|
+
size: iconSize,
|
|
441
|
+
color: iconColor
|
|
442
|
+
})
|
|
443
|
+
}) : null, text ? /*#__PURE__*/jsx(BaseText, {
|
|
444
|
+
lineHeight: lineHeight,
|
|
445
|
+
fontSize: fontSize
|
|
446
|
+
// figma and web have different font-smoothing properties
|
|
447
|
+
// which causes web version of button text to look much bolder
|
|
448
|
+
// than figma version. To fix this we are changing font-weight from 600 to 500
|
|
449
|
+
// https://forum.figma.com/t/why-does-a-font-weight-in-figma-seem-lighter-than-the-same-weight-in-the-browser/2207
|
|
450
|
+
,
|
|
451
|
+
fontWeight: "medium",
|
|
452
|
+
textAlign: "center",
|
|
453
|
+
color: textColor,
|
|
454
|
+
children: text
|
|
455
|
+
}) : null, Icon && iconPosition == 'right' ? /*#__PURE__*/jsx(BaseBox, {
|
|
456
|
+
paddingLeft: iconPadding,
|
|
457
|
+
display: "flex",
|
|
458
|
+
justifyContent: "center",
|
|
459
|
+
alignItems: "center",
|
|
460
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
461
|
+
size: iconSize,
|
|
462
|
+
color: iconColor
|
|
463
|
+
})
|
|
464
|
+
}) : null]
|
|
465
|
+
})]
|
|
466
|
+
})
|
|
411
467
|
}));
|
|
412
468
|
};
|
|
413
469
|
var BaseButton = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/React__default.forwardRef(_BaseButton), {
|
|
414
470
|
displayName: 'BaseButton'
|
|
415
471
|
});
|
|
416
472
|
|
|
417
|
-
export { BaseButton as default };
|
|
473
|
+
export { BaseButton as default, getBackgroundColorToken };
|
|
418
474
|
//# sourceMappingURL=BaseButton.js.map
|