@hero-design/rn-work-uikit 1.2.0-alpha.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -25
- package/lib/index.js +1 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,40 +1,20 @@
|
|
|
1
1
|
# @hero-design/rn-work-uikit
|
|
2
2
|
|
|
3
|
-
## 1.2.0
|
|
3
|
+
## 1.2.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
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
8
|
|
|
9
|
-
- [`
|
|
9
|
+
- [#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
|
|
10
10
|
|
|
11
11
|
### Patch Changes
|
|
12
12
|
|
|
13
|
-
- [`
|
|
14
|
-
|
|
13
|
+
- [#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]
|
|
15
14
|
- Fix issue when label is empty, should show TextInput placeholder
|
|
16
15
|
- Remove un-neccessary animation of TextInput row
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
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
|
|
22
|
-
|
|
23
|
-
## 1.2.0-alpha.1
|
|
24
|
-
|
|
25
|
-
### Minor Changes
|
|
26
|
-
|
|
27
|
-
- [#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
|
-
|
|
29
|
-
### Patch Changes
|
|
30
|
-
|
|
31
|
-
- [`5522767922928d3fb431f77e8e4853e552010278`](https://github.com/Thinkei/hero-design/commit/5522767922928d3fb431f77e8e4853e552010278) Thanks [@ttkien](https://github.com/ttkien)! - add assets from rn
|
|
32
|
-
|
|
33
|
-
## 1.2.0-alpha.0
|
|
34
|
-
|
|
35
|
-
### Minor Changes
|
|
36
|
-
|
|
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
|
|
16
|
+
- 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)]:
|
|
17
|
+
- @hero-design/rn@8.102.0
|
|
38
18
|
|
|
39
19
|
## 1.1.0
|
|
40
20
|
|
package/lib/index.js
CHANGED
|
@@ -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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn-work-uikit",
|
|
3
|
-
"version": "1.2.0
|
|
3
|
+
"version": "1.2.0",
|
|
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
|
|
26
|
+
"@hero-design/rn": "^8.102.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@hero-design/react-native-month-year-picker": "^8.43.1",
|