@hero-design/rn-work-uikit 1.2.0-alpha.2 → 1.2.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/CHANGELOG.md CHANGED
@@ -1,40 +1,29 @@
1
1
  # @hero-design/rn-work-uikit
2
2
 
3
- ## 1.2.0-alpha.2
4
-
5
- ### Minor Changes
6
-
7
- - [#3988](https://github.com/Thinkei/hero-design/pull/3988) [`d0104932d0ca5f4b2bdf9cb2ccf572db4a12bf8e`](https://github.com/Thinkei/hero-design/commit/d0104932d0ca5f4b2bdf9cb2ccf572db4a12bf8e) Thanks [@ttkien](https://github.com/ttkien)! - [TextInput] add TextInput for Work
8
-
9
- - [`ef1eea9cfb01728a6c49985a15928e349fe06e9d`](https://github.com/Thinkei/hero-design/commit/ef1eea9cfb01728a6c49985a15928e349fe06e9d) Thanks [@TanNguyenEH](https://github.com/TanNguyenEH)! - [TextInput.Group] Add component
3
+ ## 1.2.1
10
4
 
11
5
  ### Patch Changes
12
6
 
13
- - [`ef1eea9cfb01728a6c49985a15928e349fe06e9d`](https://github.com/Thinkei/hero-design/commit/ef1eea9cfb01728a6c49985a15928e349fe06e9d) Thanks [@TanNguyenEH](https://github.com/TanNguyenEH)! - [TextInput]
14
-
15
- - Fix issue when label is empty, should show TextInput placeholder
16
- - Remove un-neccessary animation of TextInput row
17
-
18
- - [`5522767922928d3fb431f77e8e4853e552010278`](https://github.com/Thinkei/hero-design/commit/5522767922928d3fb431f77e8e4853e552010278) Thanks [@ttkien](https://github.com/ttkien)! - add assets from rn
7
+ - [#4007](https://github.com/Thinkei/hero-design/pull/4007) [`be4d27a22908e6e5b9dfd429f21dfbdfadaf4949`](https://github.com/Thinkei/hero-design/commit/be4d27a22908e6e5b9dfd429f21dfbdfadaf4949) Thanks [@cuongnguyeneh](https://github.com/cuongnguyeneh)! - [TextInput] Update testId of native input
19
8
 
20
- - Updated dependencies [[`ef1eea9cfb01728a6c49985a15928e349fe06e9d`](https://github.com/Thinkei/hero-design/commit/ef1eea9cfb01728a6c49985a15928e349fe06e9d), [`ef1eea9cfb01728a6c49985a15928e349fe06e9d`](https://github.com/Thinkei/hero-design/commit/ef1eea9cfb01728a6c49985a15928e349fe06e9d), [`ef1eea9cfb01728a6c49985a15928e349fe06e9d`](https://github.com/Thinkei/hero-design/commit/ef1eea9cfb01728a6c49985a15928e349fe06e9d)]:
21
- - @hero-design/rn@8.102.0-alpha.0
9
+ - Updated dependencies [[`7e0859459ea48c43c9edcc01a64c80ab715b4d15`](https://github.com/Thinkei/hero-design/commit/7e0859459ea48c43c9edcc01a64c80ab715b4d15)]:
10
+ - @hero-design/rn@8.102.1
22
11
 
23
- ## 1.2.0-alpha.1
12
+ ## 1.2.0
24
13
 
25
14
  ### Minor Changes
26
15
 
27
16
  - [#3988](https://github.com/Thinkei/hero-design/pull/3988) [`d0104932d0ca5f4b2bdf9cb2ccf572db4a12bf8e`](https://github.com/Thinkei/hero-design/commit/d0104932d0ca5f4b2bdf9cb2ccf572db4a12bf8e) Thanks [@ttkien](https://github.com/ttkien)! - [TextInput] add TextInput for Work
28
17
 
29
- ### Patch Changes
30
-
31
- - [`5522767922928d3fb431f77e8e4853e552010278`](https://github.com/Thinkei/hero-design/commit/5522767922928d3fb431f77e8e4853e552010278) Thanks [@ttkien](https://github.com/ttkien)! - add assets from rn
18
+ - [#3999](https://github.com/Thinkei/hero-design/pull/3999) [`28a6ab3090ec7d2a596de5c5838072b12f5c6104`](https://github.com/Thinkei/hero-design/commit/28a6ab3090ec7d2a596de5c5838072b12f5c6104) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - [TextInput.Group] Add component
32
19
 
33
- ## 1.2.0-alpha.0
34
-
35
- ### Minor Changes
20
+ ### Patch Changes
36
21
 
37
- - [#3988](https://github.com/Thinkei/hero-design/pull/3988) [`d0104932d0ca5f4b2bdf9cb2ccf572db4a12bf8e`](https://github.com/Thinkei/hero-design/commit/d0104932d0ca5f4b2bdf9cb2ccf572db4a12bf8e) Thanks [@ttkien](https://github.com/ttkien)! - [TextInput] add TextInput for Work
22
+ - [#3998](https://github.com/Thinkei/hero-design/pull/3998) [`7d043a147897938f2c6d59b7716be72dfc40d168`](https://github.com/Thinkei/hero-design/commit/7d043a147897938f2c6d59b7716be72dfc40d168) Thanks [@ttkien](https://github.com/ttkien)! - [TextInput]
23
+ - Fix issue when label is empty, should show TextInput placeholder
24
+ - Remove un-neccessary animation of TextInput row
25
+ - Updated dependencies [[`7d043a147897938f2c6d59b7716be72dfc40d168`](https://github.com/Thinkei/hero-design/commit/7d043a147897938f2c6d59b7716be72dfc40d168), [`28a6ab3090ec7d2a596de5c5838072b12f5c6104`](https://github.com/Thinkei/hero-design/commit/28a6ab3090ec7d2a596de5c5838072b12f5c6104), [`849b412c2d217b636342dcd42ce0f4553c446762`](https://github.com/Thinkei/hero-design/commit/849b412c2d217b636342dcd42ce0f4553c446762), [`ffaa510e9dec7177e29a3afe1b2d07c012d14fd8`](https://github.com/Thinkei/hero-design/commit/ffaa510e9dec7177e29a3afe1b2d07c012d14fd8)]:
26
+ - @hero-design/rn@8.102.0
38
27
 
39
28
  ## 1.1.0
40
29
 
package/lib/index.js CHANGED
@@ -1682,7 +1682,7 @@ data.forEach(function(series){series.data.forEach(function(value,idx){if(typeof
1682
1682
  var yMax=React__default.useMemo(function(){return Math.max.apply(Math,_toConsumableArray(xLabels.map(function(_,xIdx){return data.reduce(function(sum,series){var _series$data$xIdx;return sum+((_series$data$xIdx=series.data[xIdx])!==null&&_series$data$xIdx!==void 0?_series$data$xIdx:0);},0);})));},[data,xLabels]);var niceValues=React__default.useMemo(function(){var maxDataValue=yMax;var minDataValue=0;return createNiceScale(minDataValue,maxDataValue);},[data]);var yAxisStep=(_yAxisConfig$step=yAxisConfig===null||yAxisConfig===void 0?void 0:yAxisConfig.step)!==null&&_yAxisConfig$step!==void 0?_yAxisConfig$step:niceValues.tickSpacing;var yAxisInterval=(_yAxisConfig$tick$int=yAxisConfig===null||yAxisConfig===void 0||(_yAxisConfig$tick=yAxisConfig.tick)===null||_yAxisConfig$tick===void 0?void 0:_yAxisConfig$tick.interval)!==null&&_yAxisConfig$tick$int!==void 0?_yAxisConfig$tick$int:yAxisStep;var calculatedYAxisConfig=React__default.useMemo(function(){var _yAxisConfig$maxValue,_yAxisConfig$step2;return _objectSpread2(_objectSpread2({},yAxisConfig),{},{maxValue:(_yAxisConfig$maxValue=yAxisConfig===null||yAxisConfig===void 0?void 0:yAxisConfig.maxValue)!==null&&_yAxisConfig$maxValue!==void 0?_yAxisConfig$maxValue:niceValues.niceMax,minValue:0,step:(_yAxisConfig$step2=yAxisConfig===null||yAxisConfig===void 0?void 0:yAxisConfig.step)!==null&&_yAxisConfig$step2!==void 0?_yAxisConfig$step2:niceValues.tickSpacing,tick:{interval:yAxisInterval}});},[yAxisConfig,niceValues,yAxisInterval]);var calculatedXAxisConfig=React__default.useMemo(function(){return _objectSpread2(_objectSpread2({},xAxisConfig),{},{labels:xLabels});},[xAxisConfig,xLabels]);return/*#__PURE__*/React__default__namespace.default.createElement(StyledColumnChartWrapper,{style:style,testID:testID,onLayout:onLayout},dimensions&&/*#__PURE__*/React__default__namespace.default.createElement(ChartFrame,{isEmpty:data.length===0,xAxisConfig:calculatedXAxisConfig,yAxisConfig:calculatedYAxisConfig,headerConfig:headerConfig,width:dimensions.width,height:dimensions.height,hideXAxisGrid:true,emptyText:emptyText,renderContent:function renderContent(_ref2){var coordinates=_ref2.coordinates;return/*#__PURE__*/React__default__namespace.default.createElement(ColumnChartContent$1,{coordinates:coordinates,data:data,xAxisConfig:calculatedXAxisConfig,yAxisConfig:calculatedYAxisConfig,onBarPress:onBarPress,colorScale:colorScale});}}));};var Chart={Column:ColumnChart,Line:LineChart,SelectAction:SingleSelect$1};var StyledChipWrapper=index$b(reactNative.TouchableOpacity)(function(_ref){var themeVariant=_ref.themeVariant,themeSelected=_ref.themeSelected,theme=_ref.theme;var getShadowStyles=function getShadowStyles(){switch(themeVariant){case'compact':case'filter':return _objectSpread2({},theme.__hd__.chip.shadows.filledWrapper);case'selection':case'compact-outlined':return undefined;}};var getBorderStyles=function getBorderStyles(){switch(themeVariant){case'selection':case'compact-outlined':{return {borderColor:themeSelected?theme.__hd__.chip.colors.outlinedSelectedBorder:theme.__hd__.chip.colors.outlinedDefaultBorder,borderWidth:theme.__hd__.chip.borderWidths.outlinedDefaultBorder};}case'compact':case'filter':{return {borderColor:theme.__hd__.chip.colors.wrapperSelectedBorder};}}};var getBackgroundStyles=function getBackgroundStyles(){if(themeSelected){switch(themeVariant){case'selection':case'compact-outlined':{return {backgroundColor:themeSelected?theme.__hd__.chip.colors.outlinedSelectedBackground:theme.__hd__.chip.colors.outlinedDefaultBackground};}case'filter':case'compact':{return {backgroundColor:theme.__hd__.chip.colors.secondaryBackground};}}}else {switch(themeVariant){case'selection':case'compact-outlined':{return {backgroundColor:theme.__hd__.chip.colors.outlinedDefaultBackground};}case'filter':case'compact':{return {backgroundColor:theme.__hd__.chip.colors.filledBackground};}}}};var getPaddingStyles=function getPaddingStyles(){switch(themeVariant){case'compact':case'compact-outlined':{return {paddingHorizontal:theme.__hd__.chip.space.compactWrapperHorizontalPadding,paddingVertical:theme.__hd__.chip.space.compactWrapperVerticalPadding};}default:{return {paddingHorizontal:theme.__hd__.chip.space.wrapperHorizontalPadding,paddingVertical:theme.__hd__.chip.space.wrapperVerticalPadding};}}};return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({alignSelf:'flex-start',flexDirection:'row',alignItems:'center',justifyContent:'center',borderRadius:theme.__hd__.chip.radii.wrapper},getShadowStyles()),getBorderStyles()),getPaddingStyles()),getBackgroundStyles());});var StyledChipIcon=index$b(Icon)(function(_ref2){var theme=_ref2.theme;return {fontSize:theme.__hd__.chip.fontSizes.icon};});var _excluded$s=["label","variant","selected","icon","onPress","showSelectedIcon"];var getChipLabel=function getChipLabel(label){if(typeof label==='string'){return/*#__PURE__*/React__default__namespace.default.createElement(Typography.Body,{variant:"small"},label);}return label;};var getChipVariant=function getChipVariant(){var variant=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'selection';switch(variant){case'selection':case'filter':case'compact':case'compact-outlined':return variant;case'outlined':return 'selection';case'filled':return 'filter';}};var Chip=function Chip(_ref){var label=_ref.label,_ref$variant=_ref.variant,variant=_ref$variant===void 0?'selection':_ref$variant,_ref$selected=_ref.selected,selected=_ref$selected===void 0?false:_ref$selected,icon=_ref.icon,onPress=_ref.onPress,_ref$showSelectedIcon=_ref.showSelectedIcon,showSelectedIcon=_ref$showSelectedIcon===void 0?true:_ref$showSelectedIcon,otherProps=_objectWithoutProperties(_ref,_excluded$s);useDeprecation('Chip variant `outlined` and `filled` are deprecated.',variant==='outlined'||variant==='filled');var renamedVariant=getChipVariant(variant);var shouldShowSelectedIcon=(renamedVariant==='selection'||renamedVariant==='compact-outlined')&&selected&&showSelectedIcon;var chipLabel=React__default.useMemo(function(){return getChipLabel(label);},[label]);return/*#__PURE__*/React__default__namespace.default.createElement(StyledChipWrapper,_extends$1({onPress:onPress,themeVariant:renamedVariant,themeSelected:selected},otherProps),icon&&/*#__PURE__*/React__default__namespace.default.createElement(Box,{marginRight:"small"},/*#__PURE__*/React__default__namespace.default.createElement(StyledChipIcon,{icon:icon,testID:"chip-icon-".concat(icon)})),chipLabel,shouldShowSelectedIcon&&/*#__PURE__*/React__default__namespace.default.createElement(Box,{marginLeft:"small"},/*#__PURE__*/React__default__namespace.default.createElement(StyledChipIcon,{icon:"cancel",testID:"selected-chip-icon-cancel"})));};var StyledWrapper$8=index$b(reactNative.TouchableOpacity)(function(_ref){var theme=_ref.theme,themeState=_ref.themeState;return {flexDirection:'row',borderRadius:theme.__hd__.checkbox.radii.wrapper,borderWidth:theme.__hd__.checkbox.borderWidths.wrapper,padding:theme.__hd__.checkbox.space.wrapperPadding,borderColor:theme.__hd__.checkbox.colors.borders[themeState]};});var StyledDescription$1=index$b(Typography.Body)(function(_ref2){var theme=_ref2.theme;return {paddingRight:theme.__hd__.checkbox.space.iconDescriptionPadding,flex:1};});var StyledCheckboxContainer=index$b(reactNative.View)(function(_ref3){var theme=_ref3.theme;return {height:theme.__hd__.checkbox.sizes.icon,width:theme.__hd__.checkbox.sizes.icon,overflow:'hidden'};});var StyledCheckbox=index$b(reactNative.View)(function(_ref4){var theme=_ref4.theme,themeState=_ref4.themeState;return {flex:1,borderRadius:theme.__hd__.checkbox.radii.icon,borderWidth:theme.__hd__.checkbox.borderWidths.icon,borderColor:theme.__hd__.checkbox.colors.checkboxBorder[themeState]};});var StyledCheckMark=index$b(Icon)(function(_ref5){var theme=_ref5.theme,themeState=_ref5.themeState;return {position:'absolute',top:theme.__hd__.checkbox.space.iconTop,color:theme.__hd__.checkbox.colors.checkboxBorder[themeState]};});var getThemeState=function getThemeState(_ref){var disabled=_ref.disabled,readonly=_ref.readonly,checked=_ref.checked;if(disabled){return 'disabled';}if(readonly){return 'readonly';}if(checked){return 'checked';}return 'default';};var Checkbox=function Checkbox(_ref2){var checked=_ref2.checked,description=_ref2.description,_ref2$withBorder=_ref2.withBorder,withBorder=_ref2$withBorder===void 0?false:_ref2$withBorder,_ref2$disabled=_ref2.disabled,disabled=_ref2$disabled===void 0?false:_ref2$disabled,onPress=_ref2.onPress,style=_ref2.style,testID=_ref2.testID,_ref2$readonly=_ref2.readonly,readonly=_ref2$readonly===void 0?false:_ref2$readonly;useDeprecation("Checkbox's withBorder prop will be removed in the next major release, all checkboxes will have border by default. Please remove it.",withBorder===true);var themeState=getThemeState({disabled:disabled,readonly:readonly,checked:checked});return/*#__PURE__*/React__default__namespace.default.createElement(StyledWrapper$8,{onPress:onPress,disabled:disabled||readonly,themeState:themeState,style:style,testID:testID},!!description&&/*#__PURE__*/React__default__namespace.default.createElement(StyledDescription$1,{intent:disabled?'subdued':'body',variant:"small"},description),/*#__PURE__*/React__default__namespace.default.createElement(StyledCheckboxContainer,null,checked&&/*#__PURE__*/React__default__namespace.default.createElement(StyledCheckMark,{icon:"box-check",testID:"check-mark",themeState:themeState}),/*#__PURE__*/React__default__namespace.default.createElement(StyledCheckbox,{themeState:themeState})));};var StyledContainer$6=index$b(reactNative.View)(function(_ref){var theme=_ref.theme;return {width:'100%',marginTop:theme.__hd__.textInput.space.containerMarginTop};});var StyledLabelContainerInsideTextInput=index$b(reactNative.Animated.View)(function(_ref2){var themeVariant=_ref2.themeVariant,themeHasPrefix=_ref2.themeHasPrefix,theme=_ref2.theme;return {flexDirection:'row',alignItems:themeVariant==='text'?'center':'flex-start',position:'absolute',zIndex:1,left:themeHasPrefix?theme.space.xxlarge:theme.space.medium+theme.space.small,right:theme.space.medium,top:-theme.__hd__.textInput.space.labelTop};});var StyledLabelInsideTextInput=index$b(reactNative.View)(function(_ref3){var theme=_ref3.theme,themeState=_ref3.themeState;return {textAlignVertical:'center',alignContent:'center',alignItems:'center',color:theme.__hd__.textInput.colors.labelsInsideTextInput[themeState],marginTop:theme.__hd__.textInput.space.labelInsideTextInputMarginTop,flexDirection:'row'};});var StyledAsteriskLabelInsideTextInput=index$b(Typography.Body)(function(_ref4){var theme=_ref4.theme,themeState=_ref4.themeState;return {color:theme.__hd__.textInput.colors.asterisks[themeState]};});var StyledErrorContainer$2=index$b(reactNative.View)(function(_ref5){var theme=_ref5.theme;return {marginRight:theme.__hd__.textInput.space.errorContainerMarginRight,flexDirection:'row',alignItems:'center',flex:1,flexGrow:4};});var StyledError$1=index$b(Typography.Caption)(function(_ref6){var theme=_ref6.theme;return {color:theme.__hd__.textInput.colors.error,marginLeft:theme.__hd__.textInput.space.errorMarginLeft};});var StyledMaxLengthMessage=index$b(Typography.Caption)(function(_ref7){var theme=_ref7.theme,themeState=_ref7.themeState;return {color:theme.__hd__.textInput.colors.maxLengthLabels[themeState],flex:1,flexGrow:1,textAlign:'right'};});var StyledHelperText$1=Typography.Caption;var StyledTextInput$1=index$b(reactNative.TextInput)(function(_ref8){var theme=_ref8.theme,themeVariant=_ref8.themeVariant;return {textAlignVertical:themeVariant==='text'?'center':'top',fontSize:theme.__hd__.textInput.fontSizes.text,alignSelf:'stretch',flexGrow:2,marginHorizontal:theme.__hd__.textInput.space.inputHorizontalMargin,paddingVertical:0,maxHeight:theme.__hd__.textInput.sizes.textInputMaxHeight,height:themeVariant==='text'?undefined:theme.__hd__.textInput.sizes.textareaHeight,fontFamily:theme.__hd__.textInput.fonts.text};});var StyledBorderBackDrop=index$b(reactNative.View)(function(_ref9){var _theme$__hd__$textInp;var theme=_ref9.theme,themeFocused=_ref9.themeFocused,themeState=_ref9.themeState;return _objectSpread2(_objectSpread2({},reactNative.StyleSheet.absoluteFillObject),{},{borderWidth:themeFocused?theme.__hd__.textInput.borderWidths.container.focused:theme.__hd__.textInput.borderWidths.container.normal,borderRadius:theme.__hd__.textInput.radii.container,borderColor:(_theme$__hd__$textInp=theme.__hd__.textInput.colors.borders[themeState])!==null&&_theme$__hd__$textInp!==void 0?_theme$__hd__$textInp:theme.__hd__.textInput.colors.borders["default"]});});var StyledTextInputContainer=index$b(reactNative.View)(function(_ref10){var theme=_ref10.theme;return {flexDirection:'row',alignItems:'center',padding:theme.__hd__.textInput.space.containerPadding,backgroundColor:theme.__hd__.textInput.colors.containerBackground,borderRadius:theme.__hd__.textInput.radii.container};});var StyledTextInputAndLabelContainer=index$b(reactNative.View)(function(){return {flexDirection:'row',alignItems:'center',alignSelf:'stretch',flexGrow:2,flexShrink:1};});var StyledErrorAndHelpTextContainer=index$b(reactNative.View)(function(_ref11){var theme=_ref11.theme;return {paddingHorizontal:theme.__hd__.textInput.space.errorAndHelpTextContainerHorizontalPadding,minHeight:theme.__hd__.textInput.sizes.errorAndHelpTextContainerHeight,paddingTop:theme.__hd__.textInput.space.errorAndHelpTextContainerPaddingTop};});var StyledErrorAndMaxLengthContainer=index$b(reactNative.View)(function(){return {flexDirection:'row',justifyContent:'space-between',alignItems:'flex-start'};});var _excluded$r=["label","prefix","suffix","style","textStyle","testID","accessibilityLabelledBy","error","required","editable","disabled","loading","maxLength","hideCharacterCount","helpText","value","defaultValue","renderInputValue","allowFontScaling","variant"];var getState$3=function getState(_ref){var disabled=_ref.disabled,error=_ref.error,editable=_ref.editable,loading=_ref.loading,isEmptyValue=_ref.isEmptyValue;if(disabled){return 'disabled';}if(error){return 'error';}if(!editable||loading){return 'readonly';}if(!isEmptyValue){return 'filled';}return 'default';};// Fix issue: Placeholder is not shown on iOS when multiline is true
1683
1683
  // https://github.com/callstack/react-native-paper/pull/3331
1684
1684
  var EMPTY_PLACEHOLDER_VALUE$1=' ';var LABEL_ANIMATION_DURATION$1=150;var renderErrorOrHelpText=function renderErrorOrHelpText(_ref2){var error=_ref2.error,helpText=_ref2.helpText;return error?/*#__PURE__*/React__default__namespace.default.createElement(StyledErrorContainer$2,null,/*#__PURE__*/React__default__namespace.default.createElement(Icon,{testID:"input-error-icon",icon:"circle-info",size:"xsmall",intent:"danger"}),/*#__PURE__*/React__default__namespace.default.createElement(StyledError$1,{testID:"input-error-message"},error)):!!helpText&&/*#__PURE__*/React__default__namespace.default.createElement(StyledHelperText$1,null,helpText);};var renderInput$1=function renderInput(_ref3){var variant=_ref3.variant,nativeInputProps=_ref3.nativeInputProps,renderInputValue=_ref3.renderInputValue,ref=_ref3.ref,theme=_ref3.theme;return renderInputValue?renderInputValue(nativeInputProps):/*#__PURE__*/React__default__namespace.default.createElement(StyledTextInput$1,_extends$1({},nativeInputProps,{themeVariant:variant,multiline:variant==='textarea'||nativeInputProps.multiline,ref:ref,placeholderTextColor:theme.__hd__.textInput.colors.placeholder}));};var renderSuffix$1=function renderSuffix(_ref4){var state=_ref4.state,loading=_ref4.loading,suffix=_ref4.suffix;var actualSuffix=loading?'loading':suffix;return typeof actualSuffix==='string'?/*#__PURE__*/React__default__namespace.default.createElement(Icon,{intent:state==='disabled'?'disabled-text':'text',testID:"input-suffix",icon:actualSuffix,spin:actualSuffix==='loading',size:"medium"}):suffix;};var renderPrefix$1=function renderPrefix(_ref5){var state=_ref5.state,prefix=_ref5.prefix;return typeof prefix==='string'?/*#__PURE__*/React__default__namespace.default.createElement(Icon,{intent:state==='disabled'?'disabled-text':'text',testID:"input-prefix",icon:prefix,size:"xsmall"}):prefix;};var renderMaxLengthMessage=function renderMaxLengthMessage(_ref6){var maxLength=_ref6.maxLength,state=_ref6.state,currentLength=_ref6.currentLength,hideCharacterCount=_ref6.hideCharacterCount;var shouldShowMaxLength=maxLength!==undefined&&!hideCharacterCount;return shouldShowMaxLength&&/*#__PURE__*/React__default__namespace.default.createElement(StyledMaxLengthMessage,{themeState:state},currentLength,"/",maxLength);};var getDisplayText=function getDisplayText(value,defaultValue){var _ref7;return (_ref7=value!==undefined?value:defaultValue)!==null&&_ref7!==void 0?_ref7:'';};var TextInput$1=/*#__PURE__*/React__default.forwardRef(function(_ref8,ref){var label=_ref8.label,prefix=_ref8.prefix,suffix=_ref8.suffix,style=_ref8.style,textStyle=_ref8.textStyle,testID=_ref8.testID,accessibilityLabelledBy=_ref8.accessibilityLabelledBy,error=_ref8.error,required=_ref8.required,_ref8$editable=_ref8.editable,editable=_ref8$editable===void 0?true:_ref8$editable,_ref8$disabled=_ref8.disabled,disabled=_ref8$disabled===void 0?false:_ref8$disabled,_ref8$loading=_ref8.loading,loading=_ref8$loading===void 0?false:_ref8$loading,maxLength=_ref8.maxLength,_ref8$hideCharacterCo=_ref8.hideCharacterCount,hideCharacterCount=_ref8$hideCharacterCo===void 0?false:_ref8$hideCharacterCo,helpText=_ref8.helpText,value=_ref8.value,defaultValue=_ref8.defaultValue,renderInputValue=_ref8.renderInputValue,_ref8$allowFontScalin=_ref8.allowFontScaling,allowFontScaling=_ref8$allowFontScalin===void 0?false:_ref8$allowFontScalin,_ref8$variant=_ref8.variant,variant=_ref8$variant===void 0?'text':_ref8$variant,nativeProps=_objectWithoutProperties(_ref8,_excluded$r);var displayText=getDisplayText(value,defaultValue);var isEmptyValue=displayText.length===0;var _React$useState=React__default__namespace.default.useState({height:0,width:0}),_React$useState2=_slicedToArray(_React$useState,2),inputSize=_React$useState2[0],setInputSize=_React$useState2[1];var _React$useState3=React__default__namespace.default.useState(false),_React$useState4=_slicedToArray(_React$useState3,2),isFocused=_React$useState4[0],setIsFocused=_React$useState4[1];var state=getState$3({disabled:disabled,error:error,editable:editable,loading:loading,isFocused:isFocused,isEmptyValue:isEmptyValue});var theme=useTheme();var focusAnimation=React__default.useRef(new reactNative.Animated.Value(0)).current;React__default.useEffect(function(){reactNative.Animated.timing(focusAnimation,{toValue:isFocused||!isEmptyValue?1:0,duration:LABEL_ANIMATION_DURATION$1,easing:reactNative.Easing.bezier(0.4,0,0.2,1),useNativeDriver:true}).start();},[focusAnimation,isEmptyValue,isFocused]);var onLayout=React__default.useCallback(function(event){var _event$nativeEvent$la=event.nativeEvent.layout,height=_event$nativeEvent$la.height,width=_event$nativeEvent$la.width;setInputSize(function(prev){return _objectSpread2(_objectSpread2({},prev),{},{height:height,width:width});});},[]);var innerTextInput=React__default__namespace.default.useRef();React__default__namespace.default.useImperativeHandle(ref,function(){return {// we don't expose this method, it's for testing https://medium.com/developer-rants/how-to-test-useref-without-mocking-useref-699165f4994e
1685
- getNativeTextInputRef:function getNativeTextInputRef(){return innerTextInput.current;},focus:function focus(){var _innerTextInput$curre;(_innerTextInput$curre=innerTextInput.current)===null||_innerTextInput$curre===void 0||_innerTextInput$curre.focus();},clear:function clear(){var _innerTextInput$curre2;return (_innerTextInput$curre2=innerTextInput.current)===null||_innerTextInput$curre2===void 0?void 0:_innerTextInput$curre2.clear();},setNativeProps:function setNativeProps(args){var _innerTextInput$curre3;return (_innerTextInput$curre3=innerTextInput.current)===null||_innerTextInput$curre3===void 0?void 0:_innerTextInput$curre3.setNativeProps(args);},isFocused:function isFocused(){var _innerTextInput$curre4;return ((_innerTextInput$curre4=innerTextInput.current)===null||_innerTextInput$curre4===void 0?void 0:_innerTextInput$curre4.isFocused())||false;},blur:function blur(){var _innerTextInput$curre5;return (_innerTextInput$curre5=innerTextInput.current)===null||_innerTextInput$curre5===void 0?void 0:_innerTextInput$curre5.blur();}};},[innerTextInput]);var _useMemo=React__default.useMemo(function(){if(!textStyle){return {};}var flattenTextStyle=reactNative.StyleSheet.flatten(textStyle);var borderKeys=Object.keys(flattenTextStyle).filter(function(key){return key.startsWith('border');});return {borderStyle:pick(borderKeys,flattenTextStyle),textStyleWithoutBorderStyle:omit(borderKeys,flattenTextStyle)};},[textStyle]),borderStyle=_useMemo.borderStyle,textStyleWithoutBorderStyle=_useMemo.textStyleWithoutBorderStyle;var _useMemo2=React__default.useMemo(function(){var _flattenTextStyle$bac;if(!style){return {backgroundColor:theme.__hd__.textInput.colors.containerBackground};}var flattenTextStyle=reactNative.StyleSheet.flatten(style);return {backgroundColor:(_flattenTextStyle$bac=flattenTextStyle.backgroundColor)!==null&&_flattenTextStyle$bac!==void 0?_flattenTextStyle$bac:theme.__hd__.textInput.colors.containerBackground,styleWithoutBackgroundColor:omit(['backgroundColor'],flattenTextStyle)};},[style,theme]),backgroundColor=_useMemo2.backgroundColor,styleWithoutBackgroundColor=_useMemo2.styleWithoutBackgroundColor;var nativeInputProps=_objectSpread2(_objectSpread2({style:reactNative.StyleSheet.flatten([{backgroundColor:backgroundColor,color:theme.__hd__.textInput.colors.text},textStyleWithoutBorderStyle]),testID:'text-input',accessibilityState:{disabled:state==='disabled'||state==='readonly'},// eslint-disable-next-line @typescript-eslint/ban-ts-comment
1685
+ getNativeTextInputRef:function getNativeTextInputRef(){return innerTextInput.current;},focus:function focus(){var _innerTextInput$curre;(_innerTextInput$curre=innerTextInput.current)===null||_innerTextInput$curre===void 0||_innerTextInput$curre.focus();},clear:function clear(){var _innerTextInput$curre2;return (_innerTextInput$curre2=innerTextInput.current)===null||_innerTextInput$curre2===void 0?void 0:_innerTextInput$curre2.clear();},setNativeProps:function setNativeProps(args){var _innerTextInput$curre3;return (_innerTextInput$curre3=innerTextInput.current)===null||_innerTextInput$curre3===void 0?void 0:_innerTextInput$curre3.setNativeProps(args);},isFocused:function isFocused(){var _innerTextInput$curre4;return ((_innerTextInput$curre4=innerTextInput.current)===null||_innerTextInput$curre4===void 0?void 0:_innerTextInput$curre4.isFocused())||false;},blur:function blur(){var _innerTextInput$curre5;return (_innerTextInput$curre5=innerTextInput.current)===null||_innerTextInput$curre5===void 0?void 0:_innerTextInput$curre5.blur();}};},[innerTextInput]);var _useMemo=React__default.useMemo(function(){if(!textStyle){return {};}var flattenTextStyle=reactNative.StyleSheet.flatten(textStyle);var borderKeys=Object.keys(flattenTextStyle).filter(function(key){return key.startsWith('border');});return {borderStyle:pick(borderKeys,flattenTextStyle),textStyleWithoutBorderStyle:omit(borderKeys,flattenTextStyle)};},[textStyle]),borderStyle=_useMemo.borderStyle,textStyleWithoutBorderStyle=_useMemo.textStyleWithoutBorderStyle;var _useMemo2=React__default.useMemo(function(){var _flattenTextStyle$bac;if(!style){return {backgroundColor:theme.__hd__.textInput.colors.containerBackground};}var flattenTextStyle=reactNative.StyleSheet.flatten(style);return {backgroundColor:(_flattenTextStyle$bac=flattenTextStyle.backgroundColor)!==null&&_flattenTextStyle$bac!==void 0?_flattenTextStyle$bac:theme.__hd__.textInput.colors.containerBackground,styleWithoutBackgroundColor:omit(['backgroundColor'],flattenTextStyle)};},[style,theme]),backgroundColor=_useMemo2.backgroundColor,styleWithoutBackgroundColor=_useMemo2.styleWithoutBackgroundColor;var nativeInputTestIDSuffix=testID?"-".concat(testID):'';var nativeInputProps=_objectSpread2(_objectSpread2({style:reactNative.StyleSheet.flatten([{backgroundColor:backgroundColor,color:theme.__hd__.textInput.colors.text},textStyleWithoutBorderStyle]),testID:"text-input".concat(nativeInputTestIDSuffix),accessibilityState:{disabled:state==='disabled'||state==='readonly'},// eslint-disable-next-line @typescript-eslint/ban-ts-comment
1686
1686
  // @ts-ignore
1687
1687
  accessibilityLabelledBy:accessibilityLabelledBy,allowFontScaling:allowFontScaling},nativeProps),{},{onFocus:function onFocus(event){var _nativeProps$onFocus;setIsFocused(true);(_nativeProps$onFocus=nativeProps.onFocus)===null||_nativeProps$onFocus===void 0||_nativeProps$onFocus.call(nativeProps,event);},onBlur:function onBlur(event){var _nativeProps$onBlur;setIsFocused(false);(_nativeProps$onBlur=nativeProps.onBlur)===null||_nativeProps$onBlur===void 0||_nativeProps$onBlur.call(nativeProps,event);},editable:editable,maxLength:maxLength,value:value,onChangeText:function onChangeText(text){var _nativeProps$onChange;(_nativeProps$onChange=nativeProps.onChangeText)===null||_nativeProps$onChange===void 0||_nativeProps$onChange.call(nativeProps,text);},defaultValue:defaultValue,placeholder:isFocused||label===undefined?nativeProps.placeholder:EMPTY_PLACEHOLDER_VALUE$1});return/*#__PURE__*/React__default__namespace.default.createElement(StyledContainer$6,{style:styleWithoutBackgroundColor,pointerEvents:state==='disabled'||state==='readonly'?'none':'auto',testID:testID},/*#__PURE__*/React__default__namespace.default.createElement(StyledTextInputContainer,{onLayout:onLayout},/*#__PURE__*/React__default__namespace.default.createElement(StyledBorderBackDrop,{themeFocused:isFocused,themeState:state,testID:"text-input-border",style:[{backgroundColor:backgroundColor},borderStyle]}),/*#__PURE__*/React__default__namespace.default.createElement(reactNative.View,null,renderPrefix$1({state:state,prefix:prefix})),/*#__PURE__*/React__default__namespace.default.createElement(StyledLabelContainerInsideTextInput,{themeHasPrefix:!!prefix,themeVariant:variant,pointerEvents:"none",style:[{transformOrigin:'left top'},{transform:[{translateY:focusAnimation.interpolate({inputRange:[0,1],outputRange:[variant!=='textarea'?inputSize.height/2:theme.space.large,theme.space.xsmall]})},{scale:focusAnimation.interpolate({inputRange:[0,1],outputRange:[1,0.75]})}]}]},!!label&&/*#__PURE__*/React__default__namespace.default.createElement(StyledLabelInsideTextInput,{style:{backgroundColor:backgroundColor},nativeID:accessibilityLabelledBy,testID:"input-label",themeState:state},required&&/*#__PURE__*/React__default__namespace.default.createElement(StyledAsteriskLabelInsideTextInput,{style:{backgroundColor:backgroundColor},themeState:state,testID:"input-label-asterisk"},"*"),/*#__PURE__*/React__default__namespace.default.createElement(Typography.Body,{numberOfLines:1},label))),/*#__PURE__*/React__default__namespace.default.createElement(StyledTextInputAndLabelContainer,null,renderInput$1({variant:variant,nativeInputProps:nativeInputProps,renderInputValue:renderInputValue,ref:function ref(rnTextInputRef){innerTextInput.current=rnTextInputRef;},theme:theme})),renderSuffix$1({state:state,loading:loading,suffix:suffix})),/*#__PURE__*/React__default__namespace.default.createElement(StyledErrorAndHelpTextContainer,null,/*#__PURE__*/React__default__namespace.default.createElement(StyledErrorAndMaxLengthContainer,null,renderErrorOrHelpText({error:error,helpText:helpText}),renderMaxLengthMessage({state:state,currentLength:displayText.length,maxLength:maxLength,hideCharacterCount:hideCharacterCount}))));});var AndroidDatePickerDialog=function AndroidDatePickerDialog(_ref){var open=_ref.open,onClose=_ref.onClose,value=_ref.value,minDate=_ref.minDate,maxDate=_ref.maxDate,_onChange=_ref.onChange,testID=_ref.testID,_ref$variant=_ref.variant,variant=_ref$variant===void 0?'default':_ref$variant;var theme=useTheme();if(!open)return null;var pickerInitValue=value||new Date();return/*#__PURE__*/React__default__namespace.default.createElement(Box,{testID:testID},open&&variant==='month-year'?/*#__PURE__*/React__default__namespace.default.createElement(Box,{testID:testID},/*#__PURE__*/React__default__namespace.default.createElement(reactNativeMonthYearPicker.MonthYearPickerDialogueAndroid,{themeVariant:theme.themeMode==='dark'?'dark':'light',value:value,minimumDate:minDate,maximumDate:maxDate,onChange:function onChange(action,date){onClose();if(action==='dateSetAction'&&!!date){_onChange(date);}}})):null,open&&variant==='default'?/*#__PURE__*/React__default__namespace.default.createElement(DateTimePicker__default.default,{testID:"datePickerAndroid",mode:"date",value:pickerInitValue,minimumDate:minDate,maximumDate:maxDate,display:"default",onChange:function onChange(_,date){onClose();if(date){_onChange(date);}}}):null);};var getDateValue=function getDateValue(value,minDate,maxDate){if(minDate&&value<minDate){return minDate;}if(maxDate&&value>maxDate){return maxDate;}return value;};var useCalculateDate=function useCalculateDate(_ref){var maxDate=_ref.maxDate,minDate=_ref.minDate,onChange=_ref.onChange,value=_ref.value;React__default.useEffect(function(){var newDate=getDateValue(value||new Date(),minDate,maxDate);if(value&&newDate.toDateString()!==value.toDateString()){onChange(newDate);}},[maxDate,minDate,value]);};var locale$3={lang:'en-AU',dateTimeFormats:{fullDate:'dd/MM/yyyy'}};var LocaleContext=/*#__PURE__*/React__default.createContext(locale$3);var useLocale=function useLocale(){var context=React__default.useContext(LocaleContext);if(!context)return locale$3;return context;};var useDateTimeFormat=function useDateTimeFormat(){var _useLocale=useLocale(),dateTimeFormats=_useLocale.dateTimeFormats;var localizeDateTime=React__default.useCallback(function(key){return dateTimeFormats===null||dateTimeFormats===void 0?void 0:dateTimeFormats[key];},[dateTimeFormats]);return {localizeDateTime:localizeDateTime};};var locale$2={lang:'en-CA',dateTimeFormats:{fullDate:'MMM dd, yyyy'}};var locales={'en-AU':locale$3,'en-CA':locale$2};// Function to get the date format based on the displayFormat and locale,
1688
1688
  // if no displayFormat or locale is provided, use the default fullDate format
@@ -1788,8 +1788,7 @@ React__default.useEffect(function(){reactNative.Animated.timing(progressAnimated
1788
1788
  outputRange:[999,0],extrapolate:'clamp'});return/*#__PURE__*/React__default__namespace.default.createElement(StyledWrapper$5,_extends$1({},nativeProps,{testID:testID,style:style,themeIntent:intent}),/*#__PURE__*/React__default__namespace.default.createElement(StyledInner,{themeIntent:intent,onLayout:function onLayout(_ref2){var nativeEvent=_ref2.nativeEvent;return setWidth(nativeEvent.layout.width);},style:{transform:[{translateX:interpolateTranslateX}],borderTopRightRadius:interpolateBorderRadius,borderBottomRightRadius:interpolateBorderRadius}}));};var StyledStepContainer=index$b(Box)({display:'flex',flexDirection:'row',justifyContent:'space-between',alignItems:'center'});var StyledStep=index$b(Box)(function(_ref){var theme=_ref.theme,themeState=_ref.themeState,themeWidth=_ref.themeWidth;return {height:theme.__hd__.progress.sizes.stepHeight,borderRadius:theme.__hd__.progress.radii["default"],backgroundColor:theme.__hd__.progress.colors.step[themeState],width:themeWidth};});var StyledSingleStepContainer=index$b(Box)(function(_ref2){var theme=_ref2.theme;return {height:theme.__hd__.progress.sizes.stepHeight,borderRadius:theme.__hd__.progress.radii["default"],backgroundColor:theme.__hd__.progress.colors.step.incomplete,width:'100%',position:'relative'};});var StyledSingleStep=index$b(Box)(function(_ref3){var theme=_ref3.theme,themeState=_ref3.themeState;return {height:theme.__hd__.progress.sizes.stepHeight,borderRadius:theme.__hd__.progress.radii["default"],backgroundColor:theme.__hd__.progress.colors.step.complete,width:themeState==='complete'?'100%':'70%',position:'absolute',top:0,left:0,bottom:0,right:0};});var _excluded$h=["steps","current","onLayout"];var getStepState=function getStepState(current,index){if(index<current){return 'complete';}if(index===current){return 'current';}return 'incomplete';};var ProgressStep=function ProgressStep(_ref){var steps=_ref.steps,current=_ref.current,onLayout=_ref.onLayout,props=_objectWithoutProperties(_ref,_excluded$h);var theme=useTheme$1();var _React$useState=React__default__namespace.default.useState(0),_React$useState2=_slicedToArray(_React$useState,2),containerWidth=_React$useState2[0],setContainerWidth=_React$useState2[1];var onContainerLayout=function onContainerLayout(event){setContainerWidth(event.nativeEvent.layout.width);onLayout===null||onLayout===void 0||onLayout(event);};// Calculate the width for each step
1789
1789
  var stepWidth=React__default.useMemo(function(){var width=0;if(containerWidth>0){width=(containerWidth-(steps-1)*theme.__hd__.progress.space.stepGap)/steps;}return width;},[containerWidth,steps,theme]);if(steps===1){return/*#__PURE__*/React__default__namespace.default.createElement(StyledSingleStepContainer,props,/*#__PURE__*/React__default__namespace.default.createElement(StyledSingleStep,{themeState:current>=steps?'complete':'incomplete'}));}return/*#__PURE__*/React__default__namespace.default.createElement(StyledStepContainer,_extends$1({},props,{onLayout:onContainerLayout}),Array.from({length:steps}).map(function(_,index){return/*#__PURE__*/React__default__namespace.default.createElement(StyledStep,{themeState:getStepState(current-1,index),themeWidth:stepWidth});}));};var Progress={Circle:ProgressCircle,Bar:ProgressBar,Step:ProgressStep};var Slider$2=function Slider(_ref){var _ref$minimumValue=_ref.minimumValue,minimumValue=_ref$minimumValue===void 0?0:_ref$minimumValue,_ref$maximumValue=_ref.maximumValue,maximumValue=_ref$maximumValue===void 0?1:_ref$maximumValue,_ref$step=_ref.step,step=_ref$step===void 0?0:_ref$step,_ref$value=_ref.value,value=_ref$value===void 0?0:_ref$value,onValueChange=_ref.onValueChange,onSlidingStart=_ref.onSlidingStart,onSlidingComplete=_ref.onSlidingComplete,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,style=_ref.style,testID=_ref.testID;var theme=useTheme();return/*#__PURE__*/React__default__namespace.default.createElement(RnSlider__default.default,{minimumValue:minimumValue,maximumValue:maximumValue,step:step,value:value,onValueChange:onValueChange,onSlidingStart:onSlidingStart,onSlidingComplete:onSlidingComplete,disabled:disabled,minimumTrackTintColor:theme.__hd__.slider.colors.minimumTrackTint,thumbTintColor:theme.__hd__.slider.colors.thumbTint,maximumTrackTintColor:theme.__hd__.slider.colors.maximumTrackTint,style:style,testID:testID});};var StyledMarker=index$b(reactNative.View)(function(_ref){var themeDisabled=_ref.themeDisabled,theme=_ref.theme;return _objectSpread2({height:theme.__hd__.slider.sizes.markerHeight,width:theme.__hd__.slider.sizes.markerWidth,borderRadius:theme.__hd__.slider.radii.marker,backgroundColor:themeDisabled?theme.__hd__.slider.colors.disabledThumbTint:theme.__hd__.slider.colors.thumbTint},theme.__hd__.slider.shadows.marker);});var Slider$1=function Slider(_ref){var minimumValue=_ref.minimumValue,maximumValue=_ref.maximumValue,_ref$step=_ref.step,step=_ref$step===void 0?1:_ref$step,value=_ref.value,onValueChange=_ref.onValueChange,onSlidingStart=_ref.onSlidingStart,onSlidingComplete=_ref.onSlidingComplete,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,style=_ref.style,testID=_ref.testID,_ref$allowOverlap=_ref.allowOverlap,allowOverlap=_ref$allowOverlap===void 0?false:_ref$allowOverlap;var theme=useTheme();var handleTwoWaySliderChange=React__default__namespace.default.useCallback(function(values){if(onValueChange){onValueChange({start:values[0],end:values[1]});}},[onValueChange]);var _useState=React__default.useState({width:0,height:0}),_useState2=_slicedToArray(_useState,2),layoutSize=_useState2[0],setLayoutSize=_useState2[1];var nativeValue=React__default.useMemo(function(){var _value$start,_value$end;return [(_value$start=value===null||value===void 0?void 0:value.start)!==null&&_value$start!==void 0?_value$start:minimumValue,(_value$end=value===null||value===void 0?void 0:value.end)!==null&&_value$end!==void 0?_value$end:maximumValue];},[value===null||value===void 0?void 0:value.start,value===null||value===void 0?void 0:value.end,minimumValue,maximumValue]);var _theme$__hd__$slider$=theme.__hd__.slider.colors,trackBackground=_theme$__hd__$slider$.trackBackground,disabledTrackBackground=_theme$__hd__$slider$.disabledTrackBackground,thumbTint=_theme$__hd__$slider$.thumbTint,disabledThumbTint=_theme$__hd__$slider$.disabledThumbTint;var trackHeight=theme.__hd__.slider.sizes.trackHeight;// Define styles for disabled and enabled states
1790
1790
  var disabledStyles={track:{backgroundColor:disabledTrackBackground,height:trackHeight},selected:{backgroundColor:disabledThumbTint}};var enabledStyles={track:{backgroundColor:trackBackground,height:trackHeight},selected:{backgroundColor:thumbTint}};// Use styles based on the `disabled` state
1791
- var trackStyle=disabled?disabledStyles.track:enabledStyles.track;var selectedStyle=disabled?disabledStyles.selected:enabledStyles.selected;var handleOnValueChangeStart=React__default.useCallback(function(){if(onSlidingStart){onSlidingStart();}},[onSlidingStart]);var handleOnValueChangeFinish=React__default.useCallback(function(values){if(onSlidingComplete){onSlidingComplete({start:values[0],end:values[1]});}},[onSlidingComplete]);var onLayoutCallback=React__default.useCallback(function(event){setLayoutSize({width:event.nativeEvent.layout.width,height:event.nativeEvent.layout.height});},[]);var CustomMarker=React__default.useMemo(function(){return function(){return/*#__PURE__*/React__default__namespace.default.createElement(StyledMarker,{themeDisabled:disabled});};},[disabled]);return/*#__PURE__*/React__default__namespace.default.createElement(reactNative.View,{onLayout:onLayoutCallback,style:style,testID:testID,accessibilityState:{disabled:disabled}},/*#__PURE__*/React__default__namespace.default.createElement(MultiSlider__default.default,{values:nativeValue,onValuesChange:handleTwoWaySliderChange,onValuesChangeStart:handleOnValueChangeStart,onValuesChangeFinish:handleOnValueChangeFinish,sliderLength:layoutSize.width,min:minimumValue,max:maximumValue,step:step,enabledOne:!disabled,enabledTwo:!disabled,allowOverlap:allowOverlap,trackStyle:trackStyle,selectedStyle:selectedStyle,customMarker:CustomMarker}));};var Slider=Slider$2;Slider.Range=Slider$1;var StyledView$1=index$b(reactNative.View)();var StyledSpinnerContainer=index$b(reactNative.View)({height:'100%',justifyContent:'center',alignItems:'center'});var StyledSpinnerRow=index$b(reactNative.View)(function(_ref){var themePosition=_ref.themePosition,_ref$themeSize=_ref.themeSize,themeSize=_ref$themeSize===void 0?'medium':_ref$themeSize,theme=_ref.theme;return {flexDirection:'row',marginBottom:themePosition==='top'?theme.__hd__.spinner.space.spinnerDotPadding[themeSize]:0};});var StyledSpinnerDot=index$b(reactNative.View)(function(_ref2){var themePosition=_ref2.themePosition,themeSize=_ref2.themeSize,themeIntent=_ref2.themeIntent,theme=_ref2.theme;var themeStyling=function themeStyling(){var backgroundColor=theme.__hd__.spinner.colors.dot[themeIntent];var dotPadding=theme.__hd__.spinner.space.spinnerDotPadding[themeSize];switch(themePosition){case'topLeft':return {backgroundColor:backgroundColor,opacity:0.9};case'topRight':return {marginLeft:dotPadding,backgroundColor:backgroundColor,opacity:0.675};case'bottomLeft':return {backgroundColor:backgroundColor,opacity:0.45};case'bottomRight':return {marginLeft:dotPadding,backgroundColor:backgroundColor,opacity:0.225};}};return _objectSpread2({height:scale(theme.__hd__.spinner.space.spinnerDot[themeSize]),width:scale(theme.__hd__.spinner.space.spinnerDot[themeSize]),borderRadius:theme.__hd__.spinner.radii["default"]},themeStyling());});var AnimatedRow=reactNative.Animated.createAnimatedComponent(StyledSpinnerRow);var AnimatedDot=reactNative.Animated.createAnimatedComponent(StyledSpinnerDot);var AnimatedSpinner=function AnimatedSpinner(_ref){var size=_ref.size,intent=_ref.intent;var rotateAnimation=React__default.useRef(new reactNative.Animated.Value(0));React__default.useLayoutEffect(function(){var animation=reactNative.Animated.loop(reactNative.Animated.timing(rotateAnimation.current,{toValue:1,duration:1200,easing:reactNative.Easing.linear,useNativeDriver:reactNative.Platform.OS!=='web'}));animation.start();return function(){animation.stop();};},[]);var interpolatedRotateAnimation=rotateAnimation.current.interpolate({inputRange:[0,1],outputRange:['0deg','360deg']});var rowProps={themeSize:size};var dotProps={themeSize:size,themeIntent:intent};return/*#__PURE__*/React__default__namespace.default.createElement(reactNative.Animated.View,{style:reactNative.StyleSheet.flatten([{transform:[{rotate:interpolatedRotateAnimation}]}])},/*#__PURE__*/React__default__namespace.default.createElement(AnimatedRow,_extends$1({themePosition:"top"},rowProps),/*#__PURE__*/React__default__namespace.default.createElement(AnimatedDot,_extends$1({themePosition:"topLeft"},dotProps)),/*#__PURE__*/React__default__namespace.default.createElement(AnimatedDot,_extends$1({themePosition:"topRight"},dotProps))),/*#__PURE__*/React__default__namespace.default.createElement(AnimatedRow,_extends$1({themePosition:"bottom"},rowProps),/*#__PURE__*/React__default__namespace.default.createElement(AnimatedDot,_extends$1({themePosition:"bottomLeft"},dotProps)),/*#__PURE__*/React__default__namespace.default.createElement(AnimatedDot,_extends$1({themePosition:"bottomRight"},dotProps))));};var _excluded$g=["testID","size","intent"];var Spinner=function Spinner(_ref){var testID=_ref.testID,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,_ref$intent=_ref.intent,intent=_ref$intent===void 0?'primary':_ref$intent,nativeProps=_objectWithoutProperties(_ref,_excluded$g);return/*#__PURE__*/React__default__namespace.default.createElement(StyledView$1,nativeProps,/*#__PURE__*/React__default__namespace.default.createElement(StyledSpinnerContainer,{testID:testID},/*#__PURE__*/React__default__namespace.default.createElement(AnimatedSpinner,{size:size,intent:intent})));};var StyledRectButton=index$b(reactNative.TouchableOpacity)(function(_ref){var theme=_ref.theme,themeIntent=_ref.themeIntent;return {flex:1,backgroundColor:theme.__hd__.swipeable.colors[themeIntent]};});var SwipeableAction=function SwipeableAction(_ref){var _ref$intent=_ref.intent,intent=_ref$intent===void 0?'primary':_ref$intent,onPress=_ref.onPress,style=_ref.style,children=_ref.children,testID=_ref.testID;return/*#__PURE__*/React__default__namespace.default.createElement(StyledRectButton,{onPress:onPress,themeIntent:intent,style:style,testID:testID},children);};var _excluded$f=["children","state","onStateChange","leftActions","leftActionsWidth","rightActions","rightActionsWidth","variant"];var renderActions=function renderActions(actions,width,progress,direction){var trans=progress.interpolate({inputRange:[0,1],outputRange:direction==='left'?[-width,0]:[width,0],extrapolate:'clamp'});return/*#__PURE__*/React__default__namespace.default.createElement(reactNative.Animated.View,{style:{width:width,flexDirection:'row',transform:[{translateX:trans}],zIndex:-99,position:'relative'}},actions);};var Swipeable=function Swipeable(_ref){var children=_ref.children,state=_ref.state,onStateChange=_ref.onStateChange,leftActions=_ref.leftActions,leftActionsWidth=_ref.leftActionsWidth,rightActions=_ref.rightActions,rightActionsWidth=_ref.rightActionsWidth,_ref$variant=_ref.variant,variant=_ref$variant===void 0?'card':_ref$variant,swipeableProps=_objectWithoutProperties(_ref,_excluded$f);var theme=useTheme();var _useWindowDimensions=reactNative.useWindowDimensions(),width=_useWindowDimensions.width;var swipeableRef=React__default.useRef(null);var _React$useState=React__default__namespace.default.useState(0),_React$useState2=_slicedToArray(_React$useState,2),containerWidth=_React$useState2[0],setContainerWidth=_React$useState2[1];var renderLeftActions=React__default.useCallback(function(progress){return renderActions(leftActions,leftActionsWidth||width,progress,'left');},[leftActions,leftActionsWidth,width]);var renderRightActions=React__default.useCallback(function(progress){return renderActions(rightActions,rightActionsWidth||width,progress,'right');},[rightActions,rightActionsWidth,width]);React__default.useEffect(function(){if(swipeableRef.current===null)return;switch(state){case'leftOpen':swipeableRef.current.openLeft();break;case'rightOpen':swipeableRef.current.openRight();break;case'closed':swipeableRef.current.close();break;}},[state]);return/*#__PURE__*/React__default__namespace.default.createElement(reactNativeGestureHandler.GestureHandlerRootView,null,/*#__PURE__*/React__default__namespace.default.createElement(Box,{onLayout:function onLayout(e){return setContainerWidth(e.nativeEvent.layout.width);}},/*#__PURE__*/React__default__namespace.default.createElement(reactNativeGestureHandler.Swipeable,_extends$1({},swipeableProps,{ref:swipeableRef},leftActions!==undefined&&{renderLeftActions:renderLeftActions},rightActions!==undefined&&{renderRightActions:renderRightActions},{onSwipeableLeftOpen:function onSwipeableLeftOpen(){return onStateChange===null||onStateChange===void 0?void 0:onStateChange('leftOpen');},onSwipeableRightOpen:function onSwipeableRightOpen(){return onStateChange===null||onStateChange===void 0?void 0:onStateChange('rightOpen');},onSwipeableClose:function onSwipeableClose(){return onStateChange===null||onStateChange===void 0?void 0:onStateChange('closed');},containerStyle:{borderRadius:variant==='card'?theme.__hd__.swipeable.radii.swipeableContainer:0},childrenContainerStyle:{backgroundColor:theme.__hd__.swipeable.colors.defaultContainerBackground,position:'relative',width:containerWidth+theme.__hd__.swipeable.space.containerExtraWidth,borderRadius:theme.__hd__.swipeable.radii.swipeableContainer}}),children)));};var index$5=Object.assign(Swipeable,{Action:SwipeableAction,Content:reactNativeGestureHandler.RectButton});var Circle=index$b(reactNative.View)(function(_ref){var theme=_ref.theme;return {height:theme.__hd__.radio.sizes.circle,width:theme.__hd__.radio.sizes.circle,borderRadius:theme.radii.rounded,borderWidth:theme.__hd__.radio.borderWidths.circle,borderColor:theme.__hd__.radio.colors.circle,alignItems:'center',justifyContent:'center'};});var InnerCircle=index$b(reactNative.View)(function(_ref2){var theme=_ref2.theme;return {height:theme.__hd__.radio.sizes.innerCircle,width:theme.__hd__.radio.sizes.innerCircle,borderRadius:theme.radii.rounded,backgroundColor:theme.__hd__.radio.colors.circle};});var Spacer=index$b(reactNative.View)(function(_ref3){var theme=_ref3.theme,themeIntent=_ref3.themeIntent;return {marginTop:themeIntent==='light'?theme.__hd__.radio.space.groupTopMarginSmall:theme.__hd__.radio.space.groupTopMarginMedium};});var StyledRadio=index$b(List$1.Item)(function(_ref4){var theme=_ref4.theme,themeIntent=_ref4.themeIntent,themeChecked=_ref4.themeChecked;return {backgroundColor:themeChecked?theme.__hd__.radio.colors.checked:theme.__hd__.radio.colors.intents[themeIntent]};});var RadioCircle=function RadioCircle(_ref){var checked=_ref.checked,text=_ref.text;return/*#__PURE__*/React__default__namespace.default.createElement(Circle,null,checked&&/*#__PURE__*/React__default__namespace.default.createElement(InnerCircle,{testID:"".concat(text,"-selected-circle")}));};var Radio=function Radio(_ref2){var text=_ref2.text,_ref2$checked=_ref2.checked,checked=_ref2$checked===void 0?false:_ref2$checked,onPress=_ref2.onPress,style=_ref2.style,subText=_ref2.subText,testID=_ref2.testID,_ref2$inactiveIntent=_ref2.inactiveIntent,inactiveIntent=_ref2$inactiveIntent===void 0?'light':_ref2$inactiveIntent,children=_ref2.children,prefix=_ref2.prefix;return/*#__PURE__*/React__default__namespace.default.createElement(StyledRadio,{onPress:onPress,selected:checked,title:text,subtitle:subText,prefix:prefix,suffix:/*#__PURE__*/React__default__namespace.default.createElement(RadioCircle,{checked:checked,text:text}),style:style,testID:testID,themeIntent:inactiveIntent,themeChecked:checked},children);};function getKey(option,index,keyExtractor){var key='';if(keyExtractor!==undefined){key=keyExtractor(option,index);}else if(option.key!==undefined){key=option.key;}else {key=index;}return key;}var RadioGroup=function RadioGroup(_ref){var value=_ref.value,_onPress=_ref.onPress,options=_ref.options,keyExtractor=_ref.keyExtractor,style=_ref.style,testID=_ref.testID,_ref$inactiveIntent=_ref.inactiveIntent,inactiveIntent=_ref$inactiveIntent===void 0?'light':_ref$inactiveIntent;return/*#__PURE__*/React__default__namespace.default.createElement(reactNative.View,{style:style,testID:testID},options.map(function(option,index){return/*#__PURE__*/React__default__namespace.default.createElement(React__default__namespace.default.Fragment,{key:getKey(option,index,keyExtractor)},index!==0&&/*#__PURE__*/React__default__namespace.default.createElement(Spacer,{themeIntent:inactiveIntent}),/*#__PURE__*/React__default__namespace.default.createElement(Radio,{text:option.text,subText:option.subText,checked:option.value===value,onPress:function onPress(){return _onPress(option.value);},inactiveIntent:inactiveIntent,prefix:option.prefix},option.children));}));};var CompoundRadio={Group:RadioGroup};var StyledHeading=index$b(reactNative.View)(function(_ref){var theme=_ref.theme,themeSize=_ref.themeSize;return {paddingVertical:theme.__hd__.sectionHeading.space.headingVerticalPadding,paddingHorizontal:theme.__hd__.sectionHeading.space.headingHorizontalPadding,backgroundColor:themeSize==='medium'?theme.__hd__.sectionHeading.colors.background:theme.__hd__.sectionHeading.colors.backgroundSmall,marginBottom:theme.__hd__.sectionHeading.space.headingMarginBottom,display:'flex',flexDirection:'row',alignContent:'center',justifyContent:'space-between'};});var StyledIconWrapper$2=index$b(reactNative.View)(function(_ref2){var theme=_ref2.theme;return {marginRight:theme.__hd__.sectionHeading.space.iconMarginRight};});var StyledWrapper$4=index$b(reactNative.View)(function(){return {display:'flex',flexDirection:'row',alignItems:'center'};});var ICON_SIZE_MAP={small:'small',medium:'medium'};var ICON_INTENT_MAP={body:'text',subdued:'text',primary:'primary'};var SectionHeading=function SectionHeading(_ref){var icon=_ref.icon,text=_ref.text,rightChildren=_ref.rightChildren,_ref$fontSize=_ref.fontSize,fontSize=_ref$fontSize===void 0?'large':_ref$fontSize,_ref$intent=_ref.intent,intent=_ref$intent===void 0?'body':_ref$intent,_ref$fontWeight=_ref.fontWeight,fontWeight=_ref$fontWeight===void 0?'regular':_ref$fontWeight,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,style=_ref.style,testID=_ref.testID;useDeprecation("SectionHeading's fontSize prop is deprecated and will be removed in the next major release, please remove it.",fontSize!==undefined);useDeprecation("SectionHeading's fontWeight prop is deprecated and will be removed in the next major release, please remove it.",fontWeight!==undefined);return/*#__PURE__*/React__default__namespace.default.createElement(StyledHeading,{themeSize:size,style:style,testID:testID},/*#__PURE__*/React__default__namespace.default.createElement(StyledWrapper$4,null,/*#__PURE__*/React__default__namespace.default.createElement(StyledIconWrapper$2,null,icon!==undefined&&(typeof icon==='string'?/*#__PURE__*/React__default__namespace.default.createElement(Icon,{icon:icon,size:ICON_SIZE_MAP[size],intent:ICON_INTENT_MAP[intent]}):(/*#__PURE__*/React__default__namespace.default.cloneElement(icon,_objectSpread2({size:ICON_SIZE_MAP[size],intent:ICON_INTENT_MAP[intent]},icon.props))))),size==='small'?/*#__PURE__*/React__default__namespace.default.createElement(Typography.Caption,{intent:intent},text):/*#__PURE__*/React__default__namespace.default.createElement(Typography.Body,{variant:"small",intent:intent},text)),rightChildren);};var Footer=function Footer(_ref){var label=_ref.label,onPress=_ref.onPress;return/*#__PURE__*/React__default__namespace.default.createElement(CompoundButton,{variant:"text",text:label,onPress:onPress});};var isSections=function isSections(options){var firstOption=options[0];return firstOption!==undefined&&firstOption.category!==undefined;};var toSections=function toSections(options){if(isSections(options)){return options;}return [{category:'',data:options}];};var toFlatOptions=function toFlatOptions(options){if(isSections(options)){return options.flatMap(function(opt){return opt.data;});}return options;};var getScrollParams=function getScrollParams(value,sections){var itemIndex=-1;var sectionIndex=sections.findIndex(function(section){itemIndex=section.data.findIndex(function(opt){return opt.value===value;});return itemIndex!==-1;});return {sectionIndex:sectionIndex<0?0:sectionIndex,itemIndex:itemIndex<0?0:itemIndex};};var SectionSpacer=index$b(reactNative.View)(function(_ref){var theme=_ref.theme;return {marginTop:theme.__hd__.select.space.sectionSpacing};});var OptionSpacer=index$b(reactNative.View)(function(_ref2){var theme=_ref2.theme;return {marginTop:theme.__hd__.select.space.optionSpacing};});var StyledSearchBar=index$b(reactNative.View)(function(_ref3){var theme=_ref3.theme;return {marginTop:theme.__hd__.select.space.searchBarMarginTopSpacing,paddingHorizontal:theme.__hd__.select.space.searchBarHorizontalSpacing,paddingBottom:theme.__hd__.select.space.searchBarBottomSpacing};});var StyledSectionList=index$b(reactNative.SectionList)(function(_ref4){var theme=_ref4.theme;return {paddingHorizontal:theme.__hd__.select.space.optionListHorizontalPadding};});var _excluded$e=["keyExtractor","loading","onEndReached","onQueryChange","sections","renderItem","sectionListRef"];var BaseOptionList=function BaseOptionList(_ref){var keyExtractor=_ref.keyExtractor,loading=_ref.loading,onEndReached=_ref.onEndReached,onQueryChange=_ref.onQueryChange,sections=_ref.sections,renderItem=_ref.renderItem,sectionListRef=_ref.sectionListRef,rest=_objectWithoutProperties(_ref,_excluded$e);var theme=useTheme$1();var _useState=React__default.useState(false),_useState2=_slicedToArray(_useState,2),onEndReachedCalled=_useState2[0],setOnEndReachedCalled=_useState2[1];return/*#__PURE__*/React__default__namespace.default.createElement(StyledSectionList,_extends$1({ref:sectionListRef,style:_objectSpread2({},onQueryChange?{height:reactNative.Dimensions.get('screen').height}:{}),sections:sections,keyExtractor:keyExtractor,onEndReachedThreshold:0.1,onEndReached:function onEndReached(){return setOnEndReachedCalled(true);},onMomentumScrollBegin:function onMomentumScrollBegin(){if(onEndReached&&onEndReachedCalled&&!loading)onEndReached();setOnEndReachedCalled(false);},ListFooterComponent:loading?/*#__PURE__*/React__default__namespace.default.createElement(reactNative.View,{style:{display:'flex',alignItems:'center',height:theme.space.xxxxlarge}},/*#__PURE__*/React__default__namespace.default.createElement(Spinner,null)):null,renderSectionHeader:function renderSectionHeader(_ref2){var category=_ref2.section.category;return category!==''?/*#__PURE__*/React__default__namespace.default.createElement(SectionHeading,{text:category,style:{marginBottom:0}}):null;},renderItem:renderItem,ItemSeparatorComponent:OptionSpacer,SectionSeparatorComponent:SectionSpacer},rest));};var Option$2=function Option(_ref){var text=_ref.text,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,selected=_ref.selected,onPress=_ref.onPress,_ref$highlighted=_ref.highlighted,highlighted=_ref$highlighted===void 0?false:_ref$highlighted;var theme=useTheme();var props={selected:selected,disabled:disabled,onPress:onPress,title:text,suffix:selected===true?/*#__PURE__*/React__default__namespace.default.createElement(Icon,{testID:typeof text==='string'?"selected-icon-".concat(text):undefined,icon:"checkmark",intent:disabled?'disabled-text':'primary',size:"small",style:{marginRight:theme.__hd__.select.space.suffixMarginRight}}):undefined};return highlighted===true?/*#__PURE__*/React__default__namespace.default.createElement(List$1.Item,props):/*#__PURE__*/React__default__namespace.default.createElement(List$1.BasicItem,props);};var isOptionSelected=function isOptionSelected(value,option){if(!value||!option||option.value===null||option.value===undefined){return false;}if(_typeof$1(option.value)!=='object'){return value.includes(option.value);}return value.some(function(v){return _deepCompareValue(v,option.value);});};var _excluded$d=["keyExtractor","loading","onEndReached","onPress","onQueryChange","sections","renderOption","value","sectionListRef"];var OptionList$1=function OptionList(_ref){var keyExtractor=_ref.keyExtractor,loading=_ref.loading,onEndReached=_ref.onEndReached,onPress=_ref.onPress,onQueryChange=_ref.onQueryChange,sections=_ref.sections,renderOption=_ref.renderOption,value=_ref.value,sectionListRef=_ref.sectionListRef,rest=_objectWithoutProperties(_ref,_excluded$d);var renderItem=function renderItem(info){var item=info.item;var selected=isOptionSelected(value,item);var onItemPress=function onItemPress(){if(isOptionSelected(value,item)){onPress(value.filter(function(val){return !_deepCompareValue(val,item.value);}));}else {onPress([].concat(_toConsumableArray(value),[item.value]));}};return renderOption?renderOption(_objectSpread2(_objectSpread2({},info),{},{selected:selected,onPress:onItemPress})):/*#__PURE__*/React__default__namespace.default.createElement(Option$2,{selected:selected,text:item.text,disabled:item.disabled,onPress:onItemPress,highlighted:item.highlighted});};return/*#__PURE__*/React__default__namespace.default.createElement(BaseOptionList,_extends$1({keyExtractor:keyExtractor,loading:loading,onEndReached:onEndReached,onQueryChange:onQueryChange,sections:sections,renderItem:renderItem,sectionListRef:sectionListRef},rest));};function MultiSelect(_ref){var footerLabel=_ref.footerLabel,label=_ref.label,_ref$loading=_ref.loading,loading=_ref$loading===void 0?false:_ref$loading,inputProps=_ref.inputProps,onConfirm=_ref.onConfirm,onDismiss=_ref.onDismiss,onEndReached=_ref.onEndReached,onQueryChange=_ref.onQueryChange,options=_ref.options,renderOption=_ref.renderOption,renderSelectedValue=_ref.renderSelectedValue,query=_ref.query,error=_ref.error,_ref$editable=_ref.editable,editable=_ref$editable===void 0?true:_ref$editable,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,required=_ref.required,style=_ref.style,testID=_ref.testID,value=_ref.value,_ref$supportedOrienta=_ref.supportedOrientations,supportedOrientations=_ref$supportedOrienta===void 0?['portrait']:_ref$supportedOrienta,_ref$bottomSheetConfi=_ref.bottomSheetConfig,bottomSheetConfig=_ref$bottomSheetConfi===void 0?{}:_ref$bottomSheetConfi;var _useKeyboard=useKeyboard(),isKeyboardVisible=_useKeyboard.isKeyboardVisible,keyboardHeight=_useKeyboard.keyboardHeight;var _useState=React__default.useState(false),_useState2=_slicedToArray(_useState,2),open=_useState2[0],setOpen=_useState2[1];var _useState3=React__default.useState(value),_useState4=_slicedToArray(_useState3,2),selectingValue=_useState4[0],setSelectingValue=_useState4[1];var sectionListRef=React__default.useRef(null);var sections=toSections(options);var flatOptions=toFlatOptions(options);var displayedValue=flatOptions.filter(function(opt){return isOptionSelected(value,opt);}).map(function(opt){return opt.text;}).join(', ');var rawValue=value.length>0?value.join(', '):'';var bottomSheetVariant=bottomSheetConfig.variant,bottomSheetHeader=bottomSheetConfig.header;React__default.useEffect(function(){setSelectingValue(value);},[open,value]);return/*#__PURE__*/React__default__namespace.default.createElement(React__default__namespace.default.Fragment,null,/*#__PURE__*/React__default__namespace.default.createElement(reactNative.View,{pointerEvents:!editable||disabled||inputProps!==null&&inputProps!==void 0&&inputProps.loading?'none':'auto'},/*#__PURE__*/React__default__namespace.default.createElement(reactNative.TouchableOpacity,{onPress:function onPress(){return setOpen(true);}},/*#__PURE__*/React__default__namespace.default.createElement(reactNative.View,{pointerEvents:"none"},/*#__PURE__*/React__default__namespace.default.createElement(TextInput$1,_extends$1({},inputProps,{label:label,value:renderSelectedValue?rawValue:displayedValue,suffix:"arrow-down",multiline:true,error:error,editable:editable,disabled:disabled,required:required,pointerEvents:"none",style:style,testID:testID,renderInputValue:renderSelectedValue!==undefined&&(rawValue===null||rawValue===void 0?void 0:rawValue.length)>0?function(props){return renderSelectedValue(value,props);}:undefined}))))),/*#__PURE__*/React__default__namespace.default.createElement(BottomSheet$1,{variant:bottomSheetVariant||'fixed',open:open,onRequestClose:function onRequestClose(){onDismiss===null||onDismiss===void 0||onDismiss();setOpen(false);},header:bottomSheetHeader||label,style:{paddingBottom:isKeyboardVisible?keyboardHeight:0},footer:typeof footerLabel==='string'?/*#__PURE__*/React__default__namespace.default.createElement(Footer,{label:footerLabel,onPress:function onPress(){setOpen(false);onConfirm(selectingValue);}}):/*#__PURE__*/React__default__namespace.default.createElement(Box,{flex:1,flexDirection:"row",justifyContent:"flex-end"},footerLabel({value:selectingValue,closeModal:function closeModal(){return setOpen(false);}})),onAnimationEnd:function onAnimationEnd(){if(open===true){var _sectionListRef$curre;var scrollParams=getScrollParams(value===null||value===void 0?void 0:value[0],sections);(_sectionListRef$curre=sectionListRef.current)===null||_sectionListRef$curre===void 0||_sectionListRef$curre.scrollToLocation(scrollParams);}},supportedOrientations:supportedOrientations},onQueryChange&&/*#__PURE__*/React__default__namespace.default.createElement(StyledSearchBar,null,/*#__PURE__*/React__default__namespace.default.createElement(TextInput$1,{editable:true,placeholder:"Search",suffix:"search-outlined",onChangeText:onQueryChange,value:query})),/*#__PURE__*/React__default__namespace.default.createElement(OptionList$1,{onQueryChange:onQueryChange,onEndReached:onEndReached,loading:loading,sections:sections,renderOption:renderOption,value:selectingValue,onPress:setSelectingValue,sectionListRef:sectionListRef,onScrollToIndexFailed:function onScrollToIndexFailed(info){setTimeout(function(){var scrollParams=getScrollParams(value===null||value===void 0?void 0:value[0],sections);if(scrollParams.itemIndex<info.highestMeasuredFrameIndex){var _sectionListRef$curre2;(_sectionListRef$curre2=sectionListRef.current)===null||_sectionListRef$curre2===void 0||_sectionListRef$curre2.scrollToLocation(scrollParams);}},500);}})));}var Option$1=function Option(_ref){var text=_ref.text,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,selected=_ref.selected,onPress=_ref.onPress,_ref$highlighted=_ref.highlighted,highlighted=_ref$highlighted===void 0?false:_ref$highlighted;var props={selected:selected,disabled:disabled,onPress:onPress,title:text};return highlighted===true?/*#__PURE__*/React__default__namespace.default.createElement(List$1.Item,props):/*#__PURE__*/React__default__namespace.default.createElement(List$1.BasicItem,props);};var StyledOptionList=index$b(BaseOptionList)(function(_ref){var theme=_ref.theme;return {paddingBottom:theme.__hd__.select.space.singleSelectContentPaddingBottom};});var _excluded$c=["keyExtractor","loading","onEndReached","onPress","onQueryChange","sections","renderOption","value","sectionListRef"];var OptionList=function OptionList(_ref){var keyExtractor=_ref.keyExtractor,loading=_ref.loading,onEndReached=_ref.onEndReached,onPress=_ref.onPress,onQueryChange=_ref.onQueryChange,sections=_ref.sections,renderOption=_ref.renderOption,value=_ref.value,sectionListRef=_ref.sectionListRef,rest=_objectWithoutProperties(_ref,_excluded$c);var renderItem=function renderItem(info){var item=info.item;var selected=_deepCompareValue(item.value,value);var onItemPress=function onItemPress(){if(value===item.value){onPress(null);}else {onPress(item.value);}};return renderOption?renderOption(_objectSpread2(_objectSpread2({},info),{},{selected:selected,onPress:onItemPress})):/*#__PURE__*/React__default__namespace.default.createElement(Option$1,{selected:selected,text:item.text,disabled:item.disabled,onPress:onItemPress,highlighted:item.highlighted});};return/*#__PURE__*/React__default__namespace.default.createElement(StyledOptionList,_extends$1({keyExtractor:keyExtractor,loading:loading,onEndReached:onEndReached,onQueryChange:onQueryChange,sections:sections,renderItem:renderItem,sectionListRef:sectionListRef,style:_objectSpread2({},onQueryChange?{height:reactNative.Dimensions.get('screen').height}:{})},rest));};var SingleSelect=function SingleSelect(_ref){var _flatOptions$find;var label=_ref.label,_ref$loading=_ref.loading,loading=_ref$loading===void 0?false:_ref$loading,inputProps=_ref.inputProps,onConfirm=_ref.onConfirm,onDismiss=_ref.onDismiss,onEndReached=_ref.onEndReached,onQueryChange=_ref.onQueryChange,options=_ref.options,renderOption=_ref.renderOption,renderSelectedValue=_ref.renderSelectedValue,query=_ref.query,error=_ref.error,_ref$editable=_ref.editable,editable=_ref$editable===void 0?true:_ref$editable,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,required=_ref.required,style=_ref.style,testID=_ref.testID,value=_ref.value,_ref$supportedOrienta=_ref.supportedOrientations,supportedOrientations=_ref$supportedOrienta===void 0?['portrait']:_ref$supportedOrienta,_ref$bottomSheetConfi=_ref.bottomSheetConfig,bottomSheetConfig=_ref$bottomSheetConfi===void 0?{}:_ref$bottomSheetConfi;var _useKeyboard=useKeyboard(),isKeyboardVisible=_useKeyboard.isKeyboardVisible,keyboardHeight=_useKeyboard.keyboardHeight;var _useState=React__default.useState(false),_useState2=_slicedToArray(_useState,2),open=_useState2[0],setOpen=_useState2[1];var sectionListRef=React__default.useRef(null);var sections=toSections(options);var flatOptions=toFlatOptions(options);var displayedValue=(_flatOptions$find=flatOptions.find(function(opt){return _deepCompareValue(opt.value,value);}))===null||_flatOptions$find===void 0?void 0:_flatOptions$find.text;var rawValue=value?String(value):undefined;var bottomSheetVariant=bottomSheetConfig.variant,bottomSheetHeader=bottomSheetConfig.header;return/*#__PURE__*/React__default__namespace.default.createElement(React__default__namespace.default.Fragment,null,/*#__PURE__*/React__default__namespace.default.createElement(reactNative.View,{pointerEvents:!editable||disabled||inputProps!==null&&inputProps!==void 0&&inputProps.loading?'none':'auto'},/*#__PURE__*/React__default__namespace.default.createElement(reactNative.TouchableOpacity,{onPress:function onPress(){return setOpen(true);}},/*#__PURE__*/React__default__namespace.default.createElement(reactNative.View,{pointerEvents:"none"},/*#__PURE__*/React__default__namespace.default.createElement(TextInput$1,_extends$1({},inputProps,{label:label,value:renderSelectedValue?rawValue:displayedValue,suffix:"arrow-down",multiline:true,error:error,editable:editable,disabled:disabled,required:required,pointerEvents:"none",style:style,testID:testID,renderInputValue:renderSelectedValue!==undefined&&!!rawValue?function(props){return renderSelectedValue(value,props);}:undefined}))))),/*#__PURE__*/React__default__namespace.default.createElement(BottomSheet$1,{variant:bottomSheetVariant||'fixed',open:open,onRequestClose:function onRequestClose(){onDismiss===null||onDismiss===void 0||onDismiss();setOpen(false);},header:bottomSheetHeader||label,style:{paddingBottom:isKeyboardVisible?keyboardHeight:0},onAnimationEnd:function onAnimationEnd(){if(open===true){var _sectionListRef$curre;var scrollParams=getScrollParams(value,sections);(_sectionListRef$curre=sectionListRef.current)===null||_sectionListRef$curre===void 0||_sectionListRef$curre.scrollToLocation(scrollParams);}},supportedOrientations:supportedOrientations},onQueryChange&&/*#__PURE__*/React__default__namespace.default.createElement(StyledSearchBar,null,/*#__PURE__*/React__default__namespace.default.createElement(TextInput$1,{editable:true,placeholder:"Search",suffix:"search-outlined",onChangeText:onQueryChange,value:query})),/*#__PURE__*/React__default__namespace.default.createElement(OptionList,{onQueryChange:onQueryChange,onEndReached:onEndReached,loading:loading,sections:sections,renderOption:renderOption,value:value,onPress:function onPress(selectedValue){// setOpen(false);
1792
- onConfirm(selectedValue);},sectionListRef:sectionListRef,onScrollToIndexFailed:function onScrollToIndexFailed(info){setTimeout(function(){var scrollParams=getScrollParams(value,sections);if(scrollParams.itemIndex<info.highestMeasuredFrameIndex){var _sectionListRef$curre2;(_sectionListRef$curre2=sectionListRef.current)===null||_sectionListRef$curre2===void 0||_sectionListRef$curre2.scrollToLocation(scrollParams);}},500);}})));};var index$4=Object.assign(SingleSelect,{Multi:MultiSelect});var StyledContainer$1=index$b(Box)(function(_ref){var theme=_ref.theme,themeIntent=_ref.themeIntent,themeVariant=_ref.themeVariant;return {backgroundColor:themeIntent==='light'?theme.__hd__.skeleton.colors.lightBackground:theme.__hd__.skeleton.colors.darkBackground,borderRadius:theme.__hd__.skeleton.radii[themeVariant]};});var StyledGradientContainer=index$b(Box)(function(_ref2){var theme=_ref2.theme,themeVariant=_ref2.themeVariant;return {overflow:'hidden',borderRadius:theme.__hd__.skeleton.radii[themeVariant]};});var _excluded$b=["intent","variant","style","onLayout"];var AnimatedLinearGradient=reactNative.Animated.createAnimatedComponent(LinearGradient__default.default);var gradientPositions={start:{x:0,y:0},end:{x:1,y:0}};var getGradientColors=function getGradientColors(theme,intent){switch(intent){case'light':{return [theme.__hd__.skeleton.colors.lightGradientStart,theme.__hd__.skeleton.colors.lightGradientEnd,theme.__hd__.skeleton.colors.lightGradientStart];}case'dark':{return [theme.__hd__.skeleton.colors.darkGradientStart,theme.__hd__.skeleton.colors.darkGradientEnd,theme.__hd__.skeleton.colors.darkGradientStart];}}};var Skeleton=function Skeleton(_ref){var _StyleSheet$flatten;var _ref$intent=_ref.intent,intent=_ref$intent===void 0?'light':_ref$intent,_ref$variant=_ref.variant,variant=_ref$variant===void 0?'rounded':_ref$variant,style=_ref.style,onLayout=_ref.onLayout,props=_objectWithoutProperties(_ref,_excluded$b);var theme=useTheme();var colors=React__default.useMemo(function(){return getGradientColors(theme,intent);},[theme,intent]);var _useState=React__default.useState(Number((_StyleSheet$flatten=reactNative.StyleSheet.flatten(style))===null||_StyleSheet$flatten===void 0?void 0:_StyleSheet$flatten.width)||0),_useState2=_slicedToArray(_useState,2),containerWidth=_useState2[0],setContainerWidth=_useState2[1];var _useState3=React__default.useState(false),_useState4=_slicedToArray(_useState3,2),shouldStartAnimation=_useState4[0],setShouldStartAnimation=_useState4[1];var animatedValue=React__default.useRef(new reactNative.Animated.Value(0)).current;React__default.useEffect(function(){if(shouldStartAnimation){reactNative.Animated.loop(reactNative.Animated.timing(animatedValue,{toValue:1,duration:1000,easing:reactNative.Easing.linear,useNativeDriver:reactNative.Platform.OS==='ios'||reactNative.Platform.OS==='android'})).start();}},[shouldStartAnimation]);var translateX=animatedValue.interpolate({inputRange:[0,1],outputRange:[-containerWidth,containerWidth]});var onContainerLayout=React__default.useCallback(function(e){var width=e.nativeEvent.layout.width;setContainerWidth(width);if(!shouldStartAnimation){setShouldStartAnimation(true);}onLayout===null||onLayout===void 0||onLayout(e);},[]);return/*#__PURE__*/React__default__namespace.default.createElement(StyledContainer$1,_extends$1({style:style,themeVariant:variant,themeIntent:intent,onLayout:onContainerLayout},props),/*#__PURE__*/React__default__namespace.default.createElement(StyledGradientContainer,{themeVariant:variant},/*#__PURE__*/React__default__namespace.default.createElement(AnimatedLinearGradient,{start:gradientPositions.start,end:gradientPositions.end,style:{width:'100%',height:'100%',transform:[{translateX:translateX}]},colors:colors})));};var StyledSuccessContainer=index$b(reactNative.View)(function(_ref){var theme=_ref.theme,themeVariant=_ref.themeVariant;return {display:'flex',flex:1,flexDirection:'column',backgroundColor:themeVariant==='in-page'?theme.__hd__.success.colors.inPageBackground:theme.__hd__.success.colors.fullScreenBackground};});var StyledSuccessImage=index$b(Image)(function(_ref2){var theme=_ref2.theme;return {marginBottom:theme.__hd__.success.space.imageMarginBottom,width:theme.__hd__.success.sizes.image,height:theme.__hd__.success.sizes.image,resizeMode:'contain'};});var StyledSuccessContent=index$b(reactNative.View)(function(_ref3){var theme=_ref3.theme;return {display:'flex',flex:1,flexDirection:'column',justifyContent:'center',alignItems:'center',padding:theme.__hd__.success.space.wrapperPadding};});var StyledSuccessImageContainer=index$b(reactNative.View)(function(_ref4){var theme=_ref4.theme;return {marginBottom:theme.__hd__.success.space.imageMarginBottom,width:theme.__hd__.success.sizes.image,height:theme.__hd__.success.sizes.image,alignItems:'center'};});var StyledSuccessTitle=index$b(Typography.Title)(function(_ref5){var theme=_ref5.theme;return {textAlign:'center',marginBottom:theme.__hd__.success.space.titleMarginBottom,color:theme.__hd__.success.colors.title};});var StyledSuccessDescription=index$b(Typography.Body)(function(_ref6){var theme=_ref6.theme;return {textAlign:'center',color:theme.__hd__.success.colors.description};});var StyledSuccessButtonContainer=index$b(reactNative.View)(function(_ref7){var theme=_ref7.theme;return {display:'flex',flexDirection:'column',justifyContent:'center',alignItems:'center',paddingHorizontal:theme.__hd__.success.space.button.wrapperHorizontalPadding,paddingVertical:theme.__hd__.success.space.button.wrapperVerticalPadding};});var StyledSuccessButtonPrimary=index$b(CompoundButton)(function(_ref8){var theme=_ref8.theme;return {padding:theme.__hd__.success.space.button.padding};});var StyledSuccessModal=index$b(ModalWrapper)({height:'100%',width:'100%'});var _excluded$a=["variant","title","description","image","testID","ctaText","onCtaPress","secondaryCtaText","onSecondaryCtaPress","icon"];var renderImage=function renderImage(image){if(/*#__PURE__*/React__default.isValidElement(image)){return/*#__PURE__*/React__default__namespace.default.cloneElement(image,{testID:'success-image'});}return/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessImage,{source:typeof image==='string'?{uri:image}:image,testID:"success-image"});};var renderImageOrIcon=function renderImageOrIcon(_ref){var image=_ref.image,icon=_ref.icon;if(icon){return/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessImageContainer,null,/*#__PURE__*/React__default__namespace.default.createElement(StatusIcon,{icon:icon,testID:"success-icon"}));}if(image){return/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessImageContainer,null,renderImage(image));}return null;};var SuccessPage=function SuccessPage(_ref2){var _ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'in-page':_ref2$variant,title=_ref2.title,description=_ref2.description,image=_ref2.image,testID=_ref2.testID,ctaText=_ref2.ctaText,_ref2$onCtaPress=_ref2.onCtaPress,onCtaPress=_ref2$onCtaPress===void 0?noop$2:_ref2$onCtaPress,secondaryCtaText=_ref2.secondaryCtaText,onSecondaryCtaPress=_ref2.onSecondaryCtaPress,icon=_ref2.icon,nativeProps=_objectWithoutProperties(_ref2,_excluded$a);var showSecondaryButton=secondaryCtaText&&onSecondaryCtaPress;return/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessContainer,_extends$1({testID:testID,themeVariant:variant},nativeProps),/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessContent,null,renderImageOrIcon({image:image,icon:icon}),/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessTitle,{level:"h4",typeface:"playful"},title),typeof description==='string'?/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessDescription,null,description):description),!!ctaText&&/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessButtonContainer,null,/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessButtonPrimary,{text:ctaText,onPress:onCtaPress}),!!showSecondaryButton&&/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessButtonPrimary,{variant:"text",text:secondaryCtaText,onPress:onSecondaryCtaPress})));};/**
1791
+ var trackStyle=disabled?disabledStyles.track:enabledStyles.track;var selectedStyle=disabled?disabledStyles.selected:enabledStyles.selected;var handleOnValueChangeStart=React__default.useCallback(function(){if(onSlidingStart){onSlidingStart();}},[onSlidingStart]);var handleOnValueChangeFinish=React__default.useCallback(function(values){if(onSlidingComplete){onSlidingComplete({start:values[0],end:values[1]});}},[onSlidingComplete]);var onLayoutCallback=React__default.useCallback(function(event){setLayoutSize({width:event.nativeEvent.layout.width,height:event.nativeEvent.layout.height});},[]);var CustomMarker=React__default.useMemo(function(){return function(){return/*#__PURE__*/React__default__namespace.default.createElement(StyledMarker,{themeDisabled:disabled});};},[disabled]);return/*#__PURE__*/React__default__namespace.default.createElement(reactNative.View,{onLayout:onLayoutCallback,style:style,testID:testID,accessibilityState:{disabled:disabled}},/*#__PURE__*/React__default__namespace.default.createElement(MultiSlider__default.default,{values:nativeValue,onValuesChange:handleTwoWaySliderChange,onValuesChangeStart:handleOnValueChangeStart,onValuesChangeFinish:handleOnValueChangeFinish,sliderLength:layoutSize.width,min:minimumValue,max:maximumValue,step:step,enabledOne:!disabled,enabledTwo:!disabled,allowOverlap:allowOverlap,trackStyle:trackStyle,selectedStyle:selectedStyle,customMarker:CustomMarker}));};var Slider=Slider$2;Slider.Range=Slider$1;var StyledView$1=index$b(reactNative.View)();var StyledSpinnerContainer=index$b(reactNative.View)({height:'100%',justifyContent:'center',alignItems:'center'});var StyledSpinnerRow=index$b(reactNative.View)(function(_ref){var themePosition=_ref.themePosition,_ref$themeSize=_ref.themeSize,themeSize=_ref$themeSize===void 0?'medium':_ref$themeSize,theme=_ref.theme;return {flexDirection:'row',marginBottom:themePosition==='top'?theme.__hd__.spinner.space.spinnerDotPadding[themeSize]:0};});var StyledSpinnerDot=index$b(reactNative.View)(function(_ref2){var themePosition=_ref2.themePosition,themeSize=_ref2.themeSize,themeIntent=_ref2.themeIntent,theme=_ref2.theme;var themeStyling=function themeStyling(){var backgroundColor=theme.__hd__.spinner.colors.dot[themeIntent];var dotPadding=theme.__hd__.spinner.space.spinnerDotPadding[themeSize];switch(themePosition){case'topLeft':return {backgroundColor:backgroundColor,opacity:0.9};case'topRight':return {marginLeft:dotPadding,backgroundColor:backgroundColor,opacity:0.675};case'bottomLeft':return {backgroundColor:backgroundColor,opacity:0.45};case'bottomRight':return {marginLeft:dotPadding,backgroundColor:backgroundColor,opacity:0.225};}};return _objectSpread2({height:scale(theme.__hd__.spinner.space.spinnerDot[themeSize]),width:scale(theme.__hd__.spinner.space.spinnerDot[themeSize]),borderRadius:theme.__hd__.spinner.radii["default"]},themeStyling());});var AnimatedRow=reactNative.Animated.createAnimatedComponent(StyledSpinnerRow);var AnimatedDot=reactNative.Animated.createAnimatedComponent(StyledSpinnerDot);var AnimatedSpinner=function AnimatedSpinner(_ref){var size=_ref.size,intent=_ref.intent;var rotateAnimation=React__default.useRef(new reactNative.Animated.Value(0));React__default.useLayoutEffect(function(){var animation=reactNative.Animated.loop(reactNative.Animated.timing(rotateAnimation.current,{toValue:1,duration:1200,easing:reactNative.Easing.linear,useNativeDriver:reactNative.Platform.OS!=='web'}));animation.start();return function(){animation.stop();};},[]);var interpolatedRotateAnimation=rotateAnimation.current.interpolate({inputRange:[0,1],outputRange:['0deg','360deg']});var rowProps={themeSize:size};var dotProps={themeSize:size,themeIntent:intent};return/*#__PURE__*/React__default__namespace.default.createElement(reactNative.Animated.View,{style:reactNative.StyleSheet.flatten([{transform:[{rotate:interpolatedRotateAnimation}]}])},/*#__PURE__*/React__default__namespace.default.createElement(AnimatedRow,_extends$1({themePosition:"top"},rowProps),/*#__PURE__*/React__default__namespace.default.createElement(AnimatedDot,_extends$1({themePosition:"topLeft"},dotProps)),/*#__PURE__*/React__default__namespace.default.createElement(AnimatedDot,_extends$1({themePosition:"topRight"},dotProps))),/*#__PURE__*/React__default__namespace.default.createElement(AnimatedRow,_extends$1({themePosition:"bottom"},rowProps),/*#__PURE__*/React__default__namespace.default.createElement(AnimatedDot,_extends$1({themePosition:"bottomLeft"},dotProps)),/*#__PURE__*/React__default__namespace.default.createElement(AnimatedDot,_extends$1({themePosition:"bottomRight"},dotProps))));};var _excluded$g=["testID","size","intent"];var Spinner=function Spinner(_ref){var testID=_ref.testID,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,_ref$intent=_ref.intent,intent=_ref$intent===void 0?'primary':_ref$intent,nativeProps=_objectWithoutProperties(_ref,_excluded$g);return/*#__PURE__*/React__default__namespace.default.createElement(StyledView$1,nativeProps,/*#__PURE__*/React__default__namespace.default.createElement(StyledSpinnerContainer,{testID:testID},/*#__PURE__*/React__default__namespace.default.createElement(AnimatedSpinner,{size:size,intent:intent})));};var StyledRectButton=index$b(reactNative.TouchableOpacity)(function(_ref){var theme=_ref.theme,themeIntent=_ref.themeIntent;return {flex:1,backgroundColor:theme.__hd__.swipeable.colors[themeIntent]};});var SwipeableAction=function SwipeableAction(_ref){var _ref$intent=_ref.intent,intent=_ref$intent===void 0?'primary':_ref$intent,onPress=_ref.onPress,style=_ref.style,children=_ref.children,testID=_ref.testID;return/*#__PURE__*/React__default__namespace.default.createElement(StyledRectButton,{onPress:onPress,themeIntent:intent,style:style,testID:testID},children);};var _excluded$f=["children","state","onStateChange","leftActions","leftActionsWidth","rightActions","rightActionsWidth","variant"];var renderActions=function renderActions(actions,width,progress,direction){var trans=progress.interpolate({inputRange:[0,1],outputRange:direction==='left'?[-width,0]:[width,0],extrapolate:'clamp'});return/*#__PURE__*/React__default__namespace.default.createElement(reactNative.Animated.View,{style:{width:width,flexDirection:'row',transform:[{translateX:trans}],zIndex:-99,position:'relative'}},actions);};var Swipeable=function Swipeable(_ref){var children=_ref.children,state=_ref.state,onStateChange=_ref.onStateChange,leftActions=_ref.leftActions,leftActionsWidth=_ref.leftActionsWidth,rightActions=_ref.rightActions,rightActionsWidth=_ref.rightActionsWidth,_ref$variant=_ref.variant,variant=_ref$variant===void 0?'card':_ref$variant,swipeableProps=_objectWithoutProperties(_ref,_excluded$f);var theme=useTheme();var _useWindowDimensions=reactNative.useWindowDimensions(),width=_useWindowDimensions.width;var swipeableRef=React__default.useRef(null);var _React$useState=React__default__namespace.default.useState(0),_React$useState2=_slicedToArray(_React$useState,2),containerWidth=_React$useState2[0],setContainerWidth=_React$useState2[1];var renderLeftActions=React__default.useCallback(function(progress){return renderActions(leftActions,leftActionsWidth||width,progress,'left');},[leftActions,leftActionsWidth,width]);var renderRightActions=React__default.useCallback(function(progress){return renderActions(rightActions,rightActionsWidth||width,progress,'right');},[rightActions,rightActionsWidth,width]);React__default.useEffect(function(){if(swipeableRef.current===null)return;switch(state){case'leftOpen':swipeableRef.current.openLeft();break;case'rightOpen':swipeableRef.current.openRight();break;case'closed':swipeableRef.current.close();break;}},[state]);return/*#__PURE__*/React__default__namespace.default.createElement(reactNativeGestureHandler.GestureHandlerRootView,null,/*#__PURE__*/React__default__namespace.default.createElement(Box,{onLayout:function onLayout(e){return setContainerWidth(e.nativeEvent.layout.width);}},/*#__PURE__*/React__default__namespace.default.createElement(reactNativeGestureHandler.Swipeable,_extends$1({},swipeableProps,{ref:swipeableRef},leftActions!==undefined&&{renderLeftActions:renderLeftActions},rightActions!==undefined&&{renderRightActions:renderRightActions},{onSwipeableLeftOpen:function onSwipeableLeftOpen(){return onStateChange===null||onStateChange===void 0?void 0:onStateChange('leftOpen');},onSwipeableRightOpen:function onSwipeableRightOpen(){return onStateChange===null||onStateChange===void 0?void 0:onStateChange('rightOpen');},onSwipeableClose:function onSwipeableClose(){return onStateChange===null||onStateChange===void 0?void 0:onStateChange('closed');},containerStyle:{borderRadius:variant==='card'?theme.__hd__.swipeable.radii.swipeableContainer:0},childrenContainerStyle:{backgroundColor:theme.__hd__.swipeable.colors.defaultContainerBackground,position:'relative',width:containerWidth+theme.__hd__.swipeable.space.containerExtraWidth,borderRadius:theme.__hd__.swipeable.radii.swipeableContainer}}),children)));};var index$5=Object.assign(Swipeable,{Action:SwipeableAction,Content:reactNativeGestureHandler.RectButton});var Circle=index$b(reactNative.View)(function(_ref){var theme=_ref.theme;return {height:theme.__hd__.radio.sizes.circle,width:theme.__hd__.radio.sizes.circle,borderRadius:theme.radii.rounded,borderWidth:theme.__hd__.radio.borderWidths.circle,borderColor:theme.__hd__.radio.colors.circle,alignItems:'center',justifyContent:'center'};});var InnerCircle=index$b(reactNative.View)(function(_ref2){var theme=_ref2.theme;return {height:theme.__hd__.radio.sizes.innerCircle,width:theme.__hd__.radio.sizes.innerCircle,borderRadius:theme.radii.rounded,backgroundColor:theme.__hd__.radio.colors.circle};});var Spacer=index$b(reactNative.View)(function(_ref3){var theme=_ref3.theme,themeIntent=_ref3.themeIntent;return {marginTop:themeIntent==='light'?theme.__hd__.radio.space.groupTopMarginSmall:theme.__hd__.radio.space.groupTopMarginMedium};});var StyledRadio=index$b(List$1.Item)(function(_ref4){var theme=_ref4.theme,themeIntent=_ref4.themeIntent,themeChecked=_ref4.themeChecked;return {backgroundColor:themeChecked?theme.__hd__.radio.colors.checked:theme.__hd__.radio.colors.intents[themeIntent]};});var RadioCircle=function RadioCircle(_ref){var checked=_ref.checked,text=_ref.text;return/*#__PURE__*/React__default__namespace.default.createElement(Circle,null,checked&&/*#__PURE__*/React__default__namespace.default.createElement(InnerCircle,{testID:"".concat(text,"-selected-circle")}));};var Radio=function Radio(_ref2){var text=_ref2.text,_ref2$checked=_ref2.checked,checked=_ref2$checked===void 0?false:_ref2$checked,onPress=_ref2.onPress,style=_ref2.style,subText=_ref2.subText,testID=_ref2.testID,_ref2$inactiveIntent=_ref2.inactiveIntent,inactiveIntent=_ref2$inactiveIntent===void 0?'light':_ref2$inactiveIntent,children=_ref2.children,prefix=_ref2.prefix;return/*#__PURE__*/React__default__namespace.default.createElement(StyledRadio,{onPress:onPress,selected:checked,title:text,subtitle:subText,prefix:prefix,suffix:/*#__PURE__*/React__default__namespace.default.createElement(RadioCircle,{checked:checked,text:text}),style:style,testID:testID,themeIntent:inactiveIntent,themeChecked:checked},children);};function getKey(option,index,keyExtractor){var key='';if(keyExtractor!==undefined){key=keyExtractor(option,index);}else if(option.key!==undefined){key=option.key;}else {key=index;}return key;}var RadioGroup=function RadioGroup(_ref){var value=_ref.value,_onPress=_ref.onPress,options=_ref.options,keyExtractor=_ref.keyExtractor,style=_ref.style,testID=_ref.testID,_ref$inactiveIntent=_ref.inactiveIntent,inactiveIntent=_ref$inactiveIntent===void 0?'light':_ref$inactiveIntent;return/*#__PURE__*/React__default__namespace.default.createElement(reactNative.View,{style:style,testID:testID},options.map(function(option,index){return/*#__PURE__*/React__default__namespace.default.createElement(React__default__namespace.default.Fragment,{key:getKey(option,index,keyExtractor)},index!==0&&/*#__PURE__*/React__default__namespace.default.createElement(Spacer,{themeIntent:inactiveIntent}),/*#__PURE__*/React__default__namespace.default.createElement(Radio,{text:option.text,subText:option.subText,checked:option.value===value,onPress:function onPress(){return _onPress(option.value);},inactiveIntent:inactiveIntent,prefix:option.prefix},option.children));}));};var CompoundRadio={Group:RadioGroup};var StyledHeading=index$b(reactNative.View)(function(_ref){var theme=_ref.theme,themeSize=_ref.themeSize;return {paddingVertical:theme.__hd__.sectionHeading.space.headingVerticalPadding,paddingHorizontal:theme.__hd__.sectionHeading.space.headingHorizontalPadding,backgroundColor:themeSize==='medium'?theme.__hd__.sectionHeading.colors.background:theme.__hd__.sectionHeading.colors.backgroundSmall,marginBottom:theme.__hd__.sectionHeading.space.headingMarginBottom,display:'flex',flexDirection:'row',alignContent:'center',justifyContent:'space-between'};});var StyledIconWrapper$2=index$b(reactNative.View)(function(_ref2){var theme=_ref2.theme;return {marginRight:theme.__hd__.sectionHeading.space.iconMarginRight};});var StyledWrapper$4=index$b(reactNative.View)(function(){return {display:'flex',flexDirection:'row',alignItems:'center'};});var ICON_SIZE_MAP={small:'small',medium:'medium'};var ICON_INTENT_MAP={body:'text',subdued:'text',primary:'primary'};var SectionHeading=function SectionHeading(_ref){var icon=_ref.icon,text=_ref.text,rightChildren=_ref.rightChildren,_ref$fontSize=_ref.fontSize,fontSize=_ref$fontSize===void 0?'large':_ref$fontSize,_ref$intent=_ref.intent,intent=_ref$intent===void 0?'body':_ref$intent,_ref$fontWeight=_ref.fontWeight,fontWeight=_ref$fontWeight===void 0?'regular':_ref$fontWeight,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,style=_ref.style,testID=_ref.testID;useDeprecation("SectionHeading's fontSize prop is deprecated and will be removed in the next major release, please remove it.",fontSize!==undefined);useDeprecation("SectionHeading's fontWeight prop is deprecated and will be removed in the next major release, please remove it.",fontWeight!==undefined);return/*#__PURE__*/React__default__namespace.default.createElement(StyledHeading,{themeSize:size,style:style,testID:testID},/*#__PURE__*/React__default__namespace.default.createElement(StyledWrapper$4,null,/*#__PURE__*/React__default__namespace.default.createElement(StyledIconWrapper$2,null,icon!==undefined&&(typeof icon==='string'?/*#__PURE__*/React__default__namespace.default.createElement(Icon,{icon:icon,size:ICON_SIZE_MAP[size],intent:ICON_INTENT_MAP[intent]}):(/*#__PURE__*/React__default__namespace.default.cloneElement(icon,_objectSpread2({size:ICON_SIZE_MAP[size],intent:ICON_INTENT_MAP[intent]},icon.props))))),size==='small'?/*#__PURE__*/React__default__namespace.default.createElement(Typography.Caption,{intent:intent},text):/*#__PURE__*/React__default__namespace.default.createElement(Typography.Body,{variant:"small",intent:intent},text)),rightChildren);};var Footer=function Footer(_ref){var label=_ref.label,onPress=_ref.onPress;return/*#__PURE__*/React__default__namespace.default.createElement(CompoundButton,{variant:"text",text:label,onPress:onPress});};var isSections=function isSections(options){var firstOption=options[0];return firstOption!==undefined&&firstOption.category!==undefined;};var toSections=function toSections(options){if(isSections(options)){return options;}return [{category:'',data:options}];};var toFlatOptions=function toFlatOptions(options){if(isSections(options)){return options.flatMap(function(opt){return opt.data;});}return options;};var getScrollParams=function getScrollParams(value,sections){var itemIndex=-1;var sectionIndex=sections.findIndex(function(section){itemIndex=section.data.findIndex(function(opt){return opt.value===value;});return itemIndex!==-1;});return {sectionIndex:sectionIndex<0?0:sectionIndex,itemIndex:itemIndex<0?0:itemIndex};};var SectionSpacer=index$b(reactNative.View)(function(_ref){var theme=_ref.theme;return {marginTop:theme.__hd__.select.space.sectionSpacing};});var OptionSpacer=index$b(reactNative.View)(function(_ref2){var theme=_ref2.theme;return {marginTop:theme.__hd__.select.space.optionSpacing};});var StyledSearchBar=index$b(reactNative.View)(function(_ref3){var theme=_ref3.theme;return {marginTop:theme.__hd__.select.space.searchBarMarginTopSpacing,paddingHorizontal:theme.__hd__.select.space.searchBarHorizontalSpacing,paddingBottom:theme.__hd__.select.space.searchBarBottomSpacing};});var StyledSectionList=index$b(reactNative.SectionList)(function(_ref4){var theme=_ref4.theme;return {paddingHorizontal:theme.__hd__.select.space.optionListHorizontalPadding};});var _excluded$e=["keyExtractor","loading","onEndReached","onQueryChange","sections","renderItem","sectionListRef"];var BaseOptionList=function BaseOptionList(_ref){var keyExtractor=_ref.keyExtractor,loading=_ref.loading,onEndReached=_ref.onEndReached,onQueryChange=_ref.onQueryChange,sections=_ref.sections,renderItem=_ref.renderItem,sectionListRef=_ref.sectionListRef,rest=_objectWithoutProperties(_ref,_excluded$e);var theme=useTheme$1();var _useState=React__default.useState(false),_useState2=_slicedToArray(_useState,2),onEndReachedCalled=_useState2[0],setOnEndReachedCalled=_useState2[1];return/*#__PURE__*/React__default__namespace.default.createElement(StyledSectionList,_extends$1({ref:sectionListRef,style:_objectSpread2({},onQueryChange?{height:reactNative.Dimensions.get('screen').height}:{}),sections:sections,keyExtractor:keyExtractor,onEndReachedThreshold:0.1,onEndReached:function onEndReached(){return setOnEndReachedCalled(true);},onMomentumScrollBegin:function onMomentumScrollBegin(){if(onEndReached&&onEndReachedCalled&&!loading)onEndReached();setOnEndReachedCalled(false);},ListFooterComponent:loading?/*#__PURE__*/React__default__namespace.default.createElement(reactNative.View,{style:{display:'flex',alignItems:'center',height:theme.space.xxxxlarge}},/*#__PURE__*/React__default__namespace.default.createElement(Spinner,null)):null,renderSectionHeader:function renderSectionHeader(_ref2){var category=_ref2.section.category;return category!==''?/*#__PURE__*/React__default__namespace.default.createElement(SectionHeading,{text:category,style:{marginBottom:0}}):null;},renderItem:renderItem,ItemSeparatorComponent:OptionSpacer,SectionSeparatorComponent:SectionSpacer},rest));};var Option$2=function Option(_ref){var text=_ref.text,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,selected=_ref.selected,onPress=_ref.onPress,_ref$highlighted=_ref.highlighted,highlighted=_ref$highlighted===void 0?false:_ref$highlighted;var theme=useTheme();var props={selected:selected,disabled:disabled,onPress:onPress,title:text,suffix:selected===true?/*#__PURE__*/React__default__namespace.default.createElement(Icon,{testID:typeof text==='string'?"selected-icon-".concat(text):undefined,icon:"checkmark",intent:disabled?'disabled-text':'primary',size:"small",style:{marginRight:theme.__hd__.select.space.suffixMarginRight}}):undefined};return highlighted===true?/*#__PURE__*/React__default__namespace.default.createElement(List$1.Item,props):/*#__PURE__*/React__default__namespace.default.createElement(List$1.BasicItem,props);};var isOptionSelected=function isOptionSelected(value,option){if(!value||!option||option.value===null||option.value===undefined){return false;}if(_typeof$1(option.value)!=='object'){return value.includes(option.value);}return value.some(function(v){return _deepCompareValue(v,option.value);});};var _excluded$d=["keyExtractor","loading","onEndReached","onPress","onQueryChange","sections","renderOption","value","sectionListRef"];var OptionList$1=function OptionList(_ref){var keyExtractor=_ref.keyExtractor,loading=_ref.loading,onEndReached=_ref.onEndReached,onPress=_ref.onPress,onQueryChange=_ref.onQueryChange,sections=_ref.sections,renderOption=_ref.renderOption,value=_ref.value,sectionListRef=_ref.sectionListRef,rest=_objectWithoutProperties(_ref,_excluded$d);var renderItem=function renderItem(info){var item=info.item;var selected=isOptionSelected(value,item);var onItemPress=function onItemPress(){if(isOptionSelected(value,item)){onPress(value.filter(function(val){return !_deepCompareValue(val,item.value);}));}else {onPress([].concat(_toConsumableArray(value),[item.value]));}};return renderOption?renderOption(_objectSpread2(_objectSpread2({},info),{},{selected:selected,onPress:onItemPress})):/*#__PURE__*/React__default__namespace.default.createElement(Option$2,{selected:selected,text:item.text,disabled:item.disabled,onPress:onItemPress,highlighted:item.highlighted});};return/*#__PURE__*/React__default__namespace.default.createElement(BaseOptionList,_extends$1({keyExtractor:keyExtractor,loading:loading,onEndReached:onEndReached,onQueryChange:onQueryChange,sections:sections,renderItem:renderItem,sectionListRef:sectionListRef},rest));};function MultiSelect(_ref){var footerLabel=_ref.footerLabel,label=_ref.label,_ref$loading=_ref.loading,loading=_ref$loading===void 0?false:_ref$loading,inputProps=_ref.inputProps,onConfirm=_ref.onConfirm,onDismiss=_ref.onDismiss,onEndReached=_ref.onEndReached,onQueryChange=_ref.onQueryChange,options=_ref.options,renderOption=_ref.renderOption,renderSelectedValue=_ref.renderSelectedValue,query=_ref.query,error=_ref.error,_ref$editable=_ref.editable,editable=_ref$editable===void 0?true:_ref$editable,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,required=_ref.required,style=_ref.style,testID=_ref.testID,value=_ref.value,_ref$supportedOrienta=_ref.supportedOrientations,supportedOrientations=_ref$supportedOrienta===void 0?['portrait']:_ref$supportedOrienta,_ref$bottomSheetConfi=_ref.bottomSheetConfig,bottomSheetConfig=_ref$bottomSheetConfi===void 0?{}:_ref$bottomSheetConfi;var _useKeyboard=useKeyboard(),isKeyboardVisible=_useKeyboard.isKeyboardVisible,keyboardHeight=_useKeyboard.keyboardHeight;var _useState=React__default.useState(false),_useState2=_slicedToArray(_useState,2),open=_useState2[0],setOpen=_useState2[1];var _useState3=React__default.useState(value),_useState4=_slicedToArray(_useState3,2),selectingValue=_useState4[0],setSelectingValue=_useState4[1];var sectionListRef=React__default.useRef(null);var sections=toSections(options);var flatOptions=toFlatOptions(options);var displayedValue=flatOptions.filter(function(opt){return isOptionSelected(value,opt);}).map(function(opt){return opt.text;}).join(', ');var rawValue=value.length>0?value.join(', '):'';var bottomSheetVariant=bottomSheetConfig.variant,bottomSheetHeader=bottomSheetConfig.header;React__default.useEffect(function(){setSelectingValue(value);},[open,value]);return/*#__PURE__*/React__default__namespace.default.createElement(React__default__namespace.default.Fragment,null,/*#__PURE__*/React__default__namespace.default.createElement(reactNative.View,{pointerEvents:!editable||disabled||inputProps!==null&&inputProps!==void 0&&inputProps.loading?'none':'auto'},/*#__PURE__*/React__default__namespace.default.createElement(reactNative.TouchableOpacity,{onPress:function onPress(){return setOpen(true);}},/*#__PURE__*/React__default__namespace.default.createElement(reactNative.View,{pointerEvents:"none"},/*#__PURE__*/React__default__namespace.default.createElement(TextInput$1,_extends$1({},inputProps,{label:label,value:renderSelectedValue?rawValue:displayedValue,suffix:"arrow-down",multiline:true,error:error,editable:editable,disabled:disabled,required:required,pointerEvents:"none",style:style,testID:testID,renderInputValue:renderSelectedValue!==undefined&&(rawValue===null||rawValue===void 0?void 0:rawValue.length)>0?function(props){return renderSelectedValue(value,props);}:undefined}))))),/*#__PURE__*/React__default__namespace.default.createElement(BottomSheet$1,{variant:bottomSheetVariant||'fixed',open:open,onRequestClose:function onRequestClose(){onDismiss===null||onDismiss===void 0||onDismiss();setOpen(false);},header:bottomSheetHeader||label,style:{paddingBottom:isKeyboardVisible?keyboardHeight:0},footer:typeof footerLabel==='string'?/*#__PURE__*/React__default__namespace.default.createElement(Footer,{label:footerLabel,onPress:function onPress(){setOpen(false);onConfirm(selectingValue);}}):/*#__PURE__*/React__default__namespace.default.createElement(Box,{flex:1,flexDirection:"row",justifyContent:"flex-end"},footerLabel({value:selectingValue,closeModal:function closeModal(){return setOpen(false);}})),onAnimationEnd:function onAnimationEnd(){if(open===true){var _sectionListRef$curre;var scrollParams=getScrollParams(value===null||value===void 0?void 0:value[0],sections);(_sectionListRef$curre=sectionListRef.current)===null||_sectionListRef$curre===void 0||_sectionListRef$curre.scrollToLocation(scrollParams);}},supportedOrientations:supportedOrientations},onQueryChange&&/*#__PURE__*/React__default__namespace.default.createElement(StyledSearchBar,null,/*#__PURE__*/React__default__namespace.default.createElement(TextInput$1,{editable:true,placeholder:"Search",suffix:"search-outlined",onChangeText:onQueryChange,value:query})),/*#__PURE__*/React__default__namespace.default.createElement(OptionList$1,{onQueryChange:onQueryChange,onEndReached:onEndReached,loading:loading,sections:sections,renderOption:renderOption,value:selectingValue,onPress:setSelectingValue,sectionListRef:sectionListRef,onScrollToIndexFailed:function onScrollToIndexFailed(info){setTimeout(function(){var scrollParams=getScrollParams(value===null||value===void 0?void 0:value[0],sections);if(scrollParams.itemIndex<info.highestMeasuredFrameIndex){var _sectionListRef$curre2;(_sectionListRef$curre2=sectionListRef.current)===null||_sectionListRef$curre2===void 0||_sectionListRef$curre2.scrollToLocation(scrollParams);}},500);}})));}var Option$1=function Option(_ref){var text=_ref.text,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,selected=_ref.selected,onPress=_ref.onPress,_ref$highlighted=_ref.highlighted,highlighted=_ref$highlighted===void 0?false:_ref$highlighted;var props={selected:selected,disabled:disabled,onPress:onPress,title:text};return highlighted===true?/*#__PURE__*/React__default__namespace.default.createElement(List$1.Item,props):/*#__PURE__*/React__default__namespace.default.createElement(List$1.BasicItem,props);};var StyledOptionList=index$b(BaseOptionList)(function(_ref){var theme=_ref.theme;return {paddingBottom:theme.__hd__.select.space.singleSelectContentPaddingBottom};});var _excluded$c=["keyExtractor","loading","onEndReached","onPress","onQueryChange","sections","renderOption","value","sectionListRef"];var OptionList=function OptionList(_ref){var keyExtractor=_ref.keyExtractor,loading=_ref.loading,onEndReached=_ref.onEndReached,onPress=_ref.onPress,onQueryChange=_ref.onQueryChange,sections=_ref.sections,renderOption=_ref.renderOption,value=_ref.value,sectionListRef=_ref.sectionListRef,rest=_objectWithoutProperties(_ref,_excluded$c);var renderItem=function renderItem(info){var item=info.item;var selected=_deepCompareValue(item.value,value);var onItemPress=function onItemPress(){if(value===item.value){onPress(null);}else {onPress(item.value);}};return renderOption?renderOption(_objectSpread2(_objectSpread2({},info),{},{selected:selected,onPress:onItemPress})):/*#__PURE__*/React__default__namespace.default.createElement(Option$1,{selected:selected,text:item.text,disabled:item.disabled,onPress:onItemPress,highlighted:item.highlighted});};return/*#__PURE__*/React__default__namespace.default.createElement(StyledOptionList,_extends$1({keyExtractor:keyExtractor,loading:loading,onEndReached:onEndReached,onQueryChange:onQueryChange,sections:sections,renderItem:renderItem,sectionListRef:sectionListRef,style:_objectSpread2({},onQueryChange?{height:reactNative.Dimensions.get('screen').height}:{})},rest));};var SingleSelect=function SingleSelect(_ref){var _flatOptions$find;var label=_ref.label,_ref$loading=_ref.loading,loading=_ref$loading===void 0?false:_ref$loading,inputProps=_ref.inputProps,onConfirm=_ref.onConfirm,onDismiss=_ref.onDismiss,onEndReached=_ref.onEndReached,onQueryChange=_ref.onQueryChange,options=_ref.options,renderOption=_ref.renderOption,renderSelectedValue=_ref.renderSelectedValue,query=_ref.query,error=_ref.error,_ref$editable=_ref.editable,editable=_ref$editable===void 0?true:_ref$editable,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,required=_ref.required,style=_ref.style,testID=_ref.testID,value=_ref.value,_ref$supportedOrienta=_ref.supportedOrientations,supportedOrientations=_ref$supportedOrienta===void 0?['portrait']:_ref$supportedOrienta,_ref$bottomSheetConfi=_ref.bottomSheetConfig,bottomSheetConfig=_ref$bottomSheetConfi===void 0?{}:_ref$bottomSheetConfi;var _useKeyboard=useKeyboard(),isKeyboardVisible=_useKeyboard.isKeyboardVisible,keyboardHeight=_useKeyboard.keyboardHeight;var _useState=React__default.useState(false),_useState2=_slicedToArray(_useState,2),open=_useState2[0],setOpen=_useState2[1];var sectionListRef=React__default.useRef(null);var sections=toSections(options);var flatOptions=toFlatOptions(options);var displayedValue=(_flatOptions$find=flatOptions.find(function(opt){return _deepCompareValue(opt.value,value);}))===null||_flatOptions$find===void 0?void 0:_flatOptions$find.text;var rawValue=value?String(value):undefined;var bottomSheetVariant=bottomSheetConfig.variant,bottomSheetHeader=bottomSheetConfig.header;return/*#__PURE__*/React__default__namespace.default.createElement(React__default__namespace.default.Fragment,null,/*#__PURE__*/React__default__namespace.default.createElement(reactNative.View,{pointerEvents:!editable||disabled||inputProps!==null&&inputProps!==void 0&&inputProps.loading?'none':'auto'},/*#__PURE__*/React__default__namespace.default.createElement(reactNative.TouchableOpacity,{onPress:function onPress(){return setOpen(true);}},/*#__PURE__*/React__default__namespace.default.createElement(reactNative.View,{pointerEvents:"none"},/*#__PURE__*/React__default__namespace.default.createElement(TextInput$1,_extends$1({},inputProps,{label:label,value:renderSelectedValue?rawValue:displayedValue,suffix:"arrow-down",multiline:true,error:error,editable:editable,disabled:disabled,required:required,pointerEvents:"none",style:style,testID:testID,renderInputValue:renderSelectedValue!==undefined&&!!rawValue?function(props){return renderSelectedValue(value,props);}:undefined}))))),/*#__PURE__*/React__default__namespace.default.createElement(BottomSheet$1,{variant:bottomSheetVariant||'fixed',open:open,onRequestClose:function onRequestClose(){onDismiss===null||onDismiss===void 0||onDismiss();setOpen(false);},header:bottomSheetHeader||label,style:{paddingBottom:isKeyboardVisible?keyboardHeight:0},onAnimationEnd:function onAnimationEnd(){if(open===true){var _sectionListRef$curre;var scrollParams=getScrollParams(value,sections);(_sectionListRef$curre=sectionListRef.current)===null||_sectionListRef$curre===void 0||_sectionListRef$curre.scrollToLocation(scrollParams);}},supportedOrientations:supportedOrientations},onQueryChange&&/*#__PURE__*/React__default__namespace.default.createElement(StyledSearchBar,null,/*#__PURE__*/React__default__namespace.default.createElement(TextInput$1,{editable:true,placeholder:"Search",suffix:"search-outlined",onChangeText:onQueryChange,value:query})),/*#__PURE__*/React__default__namespace.default.createElement(OptionList,{onQueryChange:onQueryChange,onEndReached:onEndReached,loading:loading,sections:sections,renderOption:renderOption,value:value,onPress:function onPress(selectedValue){setOpen(false);onConfirm(selectedValue);},sectionListRef:sectionListRef,onScrollToIndexFailed:function onScrollToIndexFailed(info){setTimeout(function(){var scrollParams=getScrollParams(value,sections);if(scrollParams.itemIndex<info.highestMeasuredFrameIndex){var _sectionListRef$curre2;(_sectionListRef$curre2=sectionListRef.current)===null||_sectionListRef$curre2===void 0||_sectionListRef$curre2.scrollToLocation(scrollParams);}},500);}})));};var index$4=Object.assign(SingleSelect,{Multi:MultiSelect});var StyledContainer$1=index$b(Box)(function(_ref){var theme=_ref.theme,themeIntent=_ref.themeIntent,themeVariant=_ref.themeVariant;return {backgroundColor:themeIntent==='light'?theme.__hd__.skeleton.colors.lightBackground:theme.__hd__.skeleton.colors.darkBackground,borderRadius:theme.__hd__.skeleton.radii[themeVariant]};});var StyledGradientContainer=index$b(Box)(function(_ref2){var theme=_ref2.theme,themeVariant=_ref2.themeVariant;return {overflow:'hidden',borderRadius:theme.__hd__.skeleton.radii[themeVariant]};});var _excluded$b=["intent","variant","style","onLayout"];var AnimatedLinearGradient=reactNative.Animated.createAnimatedComponent(LinearGradient__default.default);var gradientPositions={start:{x:0,y:0},end:{x:1,y:0}};var getGradientColors=function getGradientColors(theme,intent){switch(intent){case'light':{return [theme.__hd__.skeleton.colors.lightGradientStart,theme.__hd__.skeleton.colors.lightGradientEnd,theme.__hd__.skeleton.colors.lightGradientStart];}case'dark':{return [theme.__hd__.skeleton.colors.darkGradientStart,theme.__hd__.skeleton.colors.darkGradientEnd,theme.__hd__.skeleton.colors.darkGradientStart];}}};var Skeleton=function Skeleton(_ref){var _StyleSheet$flatten;var _ref$intent=_ref.intent,intent=_ref$intent===void 0?'light':_ref$intent,_ref$variant=_ref.variant,variant=_ref$variant===void 0?'rounded':_ref$variant,style=_ref.style,onLayout=_ref.onLayout,props=_objectWithoutProperties(_ref,_excluded$b);var theme=useTheme();var colors=React__default.useMemo(function(){return getGradientColors(theme,intent);},[theme,intent]);var _useState=React__default.useState(Number((_StyleSheet$flatten=reactNative.StyleSheet.flatten(style))===null||_StyleSheet$flatten===void 0?void 0:_StyleSheet$flatten.width)||0),_useState2=_slicedToArray(_useState,2),containerWidth=_useState2[0],setContainerWidth=_useState2[1];var _useState3=React__default.useState(false),_useState4=_slicedToArray(_useState3,2),shouldStartAnimation=_useState4[0],setShouldStartAnimation=_useState4[1];var animatedValue=React__default.useRef(new reactNative.Animated.Value(0)).current;React__default.useEffect(function(){if(shouldStartAnimation){reactNative.Animated.loop(reactNative.Animated.timing(animatedValue,{toValue:1,duration:1000,easing:reactNative.Easing.linear,useNativeDriver:reactNative.Platform.OS==='ios'||reactNative.Platform.OS==='android'})).start();}},[shouldStartAnimation]);var translateX=animatedValue.interpolate({inputRange:[0,1],outputRange:[-containerWidth,containerWidth]});var onContainerLayout=React__default.useCallback(function(e){var width=e.nativeEvent.layout.width;setContainerWidth(width);if(!shouldStartAnimation){setShouldStartAnimation(true);}onLayout===null||onLayout===void 0||onLayout(e);},[]);return/*#__PURE__*/React__default__namespace.default.createElement(StyledContainer$1,_extends$1({style:style,themeVariant:variant,themeIntent:intent,onLayout:onContainerLayout},props),/*#__PURE__*/React__default__namespace.default.createElement(StyledGradientContainer,{themeVariant:variant},/*#__PURE__*/React__default__namespace.default.createElement(AnimatedLinearGradient,{start:gradientPositions.start,end:gradientPositions.end,style:{width:'100%',height:'100%',transform:[{translateX:translateX}]},colors:colors})));};var StyledSuccessContainer=index$b(reactNative.View)(function(_ref){var theme=_ref.theme,themeVariant=_ref.themeVariant;return {display:'flex',flex:1,flexDirection:'column',backgroundColor:themeVariant==='in-page'?theme.__hd__.success.colors.inPageBackground:theme.__hd__.success.colors.fullScreenBackground};});var StyledSuccessImage=index$b(Image)(function(_ref2){var theme=_ref2.theme;return {marginBottom:theme.__hd__.success.space.imageMarginBottom,width:theme.__hd__.success.sizes.image,height:theme.__hd__.success.sizes.image,resizeMode:'contain'};});var StyledSuccessContent=index$b(reactNative.View)(function(_ref3){var theme=_ref3.theme;return {display:'flex',flex:1,flexDirection:'column',justifyContent:'center',alignItems:'center',padding:theme.__hd__.success.space.wrapperPadding};});var StyledSuccessImageContainer=index$b(reactNative.View)(function(_ref4){var theme=_ref4.theme;return {marginBottom:theme.__hd__.success.space.imageMarginBottom,width:theme.__hd__.success.sizes.image,height:theme.__hd__.success.sizes.image,alignItems:'center'};});var StyledSuccessTitle=index$b(Typography.Title)(function(_ref5){var theme=_ref5.theme;return {textAlign:'center',marginBottom:theme.__hd__.success.space.titleMarginBottom,color:theme.__hd__.success.colors.title};});var StyledSuccessDescription=index$b(Typography.Body)(function(_ref6){var theme=_ref6.theme;return {textAlign:'center',color:theme.__hd__.success.colors.description};});var StyledSuccessButtonContainer=index$b(reactNative.View)(function(_ref7){var theme=_ref7.theme;return {display:'flex',flexDirection:'column',justifyContent:'center',alignItems:'center',paddingHorizontal:theme.__hd__.success.space.button.wrapperHorizontalPadding,paddingVertical:theme.__hd__.success.space.button.wrapperVerticalPadding};});var StyledSuccessButtonPrimary=index$b(CompoundButton)(function(_ref8){var theme=_ref8.theme;return {padding:theme.__hd__.success.space.button.padding};});var StyledSuccessModal=index$b(ModalWrapper)({height:'100%',width:'100%'});var _excluded$a=["variant","title","description","image","testID","ctaText","onCtaPress","secondaryCtaText","onSecondaryCtaPress","icon"];var renderImage=function renderImage(image){if(/*#__PURE__*/React__default.isValidElement(image)){return/*#__PURE__*/React__default__namespace.default.cloneElement(image,{testID:'success-image'});}return/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessImage,{source:typeof image==='string'?{uri:image}:image,testID:"success-image"});};var renderImageOrIcon=function renderImageOrIcon(_ref){var image=_ref.image,icon=_ref.icon;if(icon){return/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessImageContainer,null,/*#__PURE__*/React__default__namespace.default.createElement(StatusIcon,{icon:icon,testID:"success-icon"}));}if(image){return/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessImageContainer,null,renderImage(image));}return null;};var SuccessPage=function SuccessPage(_ref2){var _ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'in-page':_ref2$variant,title=_ref2.title,description=_ref2.description,image=_ref2.image,testID=_ref2.testID,ctaText=_ref2.ctaText,_ref2$onCtaPress=_ref2.onCtaPress,onCtaPress=_ref2$onCtaPress===void 0?noop$2:_ref2$onCtaPress,secondaryCtaText=_ref2.secondaryCtaText,onSecondaryCtaPress=_ref2.onSecondaryCtaPress,icon=_ref2.icon,nativeProps=_objectWithoutProperties(_ref2,_excluded$a);var showSecondaryButton=secondaryCtaText&&onSecondaryCtaPress;return/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessContainer,_extends$1({testID:testID,themeVariant:variant},nativeProps),/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessContent,null,renderImageOrIcon({image:image,icon:icon}),/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessTitle,{level:"h4",typeface:"playful"},title),typeof description==='string'?/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessDescription,null,description):description),!!ctaText&&/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessButtonContainer,null,/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessButtonPrimary,{text:ctaText,onPress:onCtaPress}),!!showSecondaryButton&&/*#__PURE__*/React__default__namespace.default.createElement(StyledSuccessButtonPrimary,{variant:"text",text:secondaryCtaText,onPress:onSecondaryCtaPress})));};/**
1793
1792
  * Renders success page
1794
1793
  *
1795
1794
  * @param {SuccessProps} props
@@ -2757,12 +2756,13 @@ var InternalTextInput = /*#__PURE__*/React__default.forwardRef(function (_ref2,
2757
2756
  Object.keys(borderStyles).forEach(function (key) {
2758
2757
  delete textInputStyle[key];
2759
2758
  });
2759
+ var nativeInputTestIDSuffix = testID ? "-".concat(testID) : '';
2760
2760
  var nativeInputProps = _objectSpread2$1(_objectSpread2$1({
2761
2761
  style: reactNative.StyleSheet.flatten([{
2762
2762
  backgroundColor: backgroundColor,
2763
2763
  color: theme.__hd__.textInput.colors.text
2764
2764
  }, textInputStyle]),
2765
- testID: 'text-input',
2765
+ testID: "text-input".concat(nativeInputTestIDSuffix),
2766
2766
  accessibilityState: {
2767
2767
  disabled: state === 'disabled' || state === 'readonly'
2768
2768
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn-work-uikit",
3
- "version": "1.2.0-alpha.2",
3
+ "version": "1.2.1",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -23,7 +23,7 @@
23
23
  "@emotion/native": "^11.9.3",
24
24
  "@emotion/primitives-core": "11.0.0",
25
25
  "@emotion/react": "^11.9.3",
26
- "@hero-design/rn": "^8.102.0-alpha.0"
26
+ "@hero-design/rn": "^8.102.1"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "@hero-design/react-native-month-year-picker": "^8.43.1",
@@ -133,7 +133,7 @@ exports[`first test to ensure configure correctly should render TextInput with p
133
133
  ],
134
134
  ]
135
135
  }
136
- testID="text-input"
136
+ testID="text-input-text-input"
137
137
  themeVariant="text"
138
138
  value="test value"
139
139
  />
@@ -510,7 +510,7 @@ exports[`TextInputGroup should render: xxx 1`] = `
510
510
  ],
511
511
  ]
512
512
  }
513
- testID="text-input"
513
+ testID="text-input-text-input-2"
514
514
  themeVariant="text"
515
515
  value="Text Input 2"
516
516
  />
@@ -59,7 +59,7 @@ describe('TextInput', () => {
59
59
  expect(queryAllByTestId('input-label')).toHaveLength(0);
60
60
 
61
61
  // Input elements should still be present but hidden until interaction
62
- expect(queryByTestId('text-input')).toBeTruthy();
62
+ expect(queryByTestId('text-input-idle-text-input')).toBeTruthy();
63
63
  expect(queryByTestId('input-prefix')).toBeTruthy();
64
64
  });
65
65
 
@@ -664,7 +664,7 @@ describe('TextInput', () => {
664
664
 
665
665
  // 1. Get both the container and the actual input field
666
666
  const container = getByTestId('email-input-container');
667
- const textInput = getByTestId('text-input');
667
+ const textInput = getByTestId('text-input-email-input-container');
668
668
 
669
669
  // 2. Focus the component by interacting with the container
670
670
  fireEvent(container, 'focus');
@@ -234,6 +234,8 @@ export const InternalTextInput = forwardRef<
234
234
  delete textInputStyle[key as keyof typeof textInputStyle];
235
235
  });
236
236
 
237
+ const nativeInputTestIDSuffix = testID ? `-${testID}` : '';
238
+
237
239
  const nativeInputProps: NativeTextInputProps = {
238
240
  style: StyleSheet.flatten([
239
241
  {
@@ -242,7 +244,7 @@ export const InternalTextInput = forwardRef<
242
244
  },
243
245
  textInputStyle,
244
246
  ]),
245
- testID: 'text-input',
247
+ testID: `text-input${nativeInputTestIDSuffix}`,
246
248
  accessibilityState: {
247
249
  disabled: state === 'disabled' || state === 'readonly',
248
250
  },