@razorpay/blade 5.0.1 → 5.1.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 +8 -0
- package/build/components/index.d.ts +7 -5
- package/build/components/index.native.d.ts +7 -5
- package/build/components/index.native.js +5 -5
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.web.js +29 -31
- package/build/components/index.web.js.map +1 -1
- package/build/css/bankingThemeDarkDesktop.css +1 -1
- package/build/css/bankingThemeDarkMobile.css +1 -1
- package/build/css/bankingThemeLightDesktop.css +1 -1
- package/build/css/bankingThemeLightMobile.css +1 -1
- package/build/css/paymentThemeDarkDesktop.css +1 -1
- package/build/css/paymentThemeDarkMobile.css +1 -1
- package/build/css/paymentThemeLightDesktop.css +1 -1
- package/build/css/paymentThemeLightMobile.css +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @razorpay/blade
|
|
2
2
|
|
|
3
|
+
## 5.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d4b981e: fix: show `Spinner` on `TextInput` when `isLoading=true`
|
|
8
|
+
- Adds spinner when `isLoading: true` is passed to `TextInput`. This was a long pending TODO
|
|
9
|
+
- Update Spinner sizes after the design was updated \* This doesn't need any code mod since there are 9 instances of spinner being used with default variant i.e medium
|
|
10
|
+
|
|
3
11
|
## 5.0.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -1896,7 +1896,8 @@ declare type RadioGroupProps = {
|
|
|
1896
1896
|
};
|
|
1897
1897
|
declare const RadioGroup: ({ children, label, helpText, isDisabled, necessityIndicator, labelPosition, validationState, errorText, name, defaultValue, onChange, value, size, }: RadioGroupProps) => React__default.ReactElement;
|
|
1898
1898
|
|
|
1899
|
-
declare type
|
|
1899
|
+
declare type BaseSpinnerProps = {
|
|
1900
|
+
intent?: Feedback;
|
|
1900
1901
|
/**
|
|
1901
1902
|
* Sets the label of the spinner.
|
|
1902
1903
|
*
|
|
@@ -1919,14 +1920,15 @@ declare type SpinnerProps = {
|
|
|
1919
1920
|
*
|
|
1920
1921
|
* @default 'medium'
|
|
1921
1922
|
*/
|
|
1922
|
-
size?: '
|
|
1923
|
+
size?: 'medium' | 'large' | 'xlarge';
|
|
1923
1924
|
/**
|
|
1924
|
-
* Sets the aria-label for web & accessibilityLabel
|
|
1925
|
+
* Sets the aria-label for web & accessibilityLabel react-native.
|
|
1925
1926
|
*
|
|
1926
|
-
* @default 'Loading'
|
|
1927
1927
|
*/
|
|
1928
|
-
accessibilityLabel
|
|
1928
|
+
accessibilityLabel: string;
|
|
1929
1929
|
};
|
|
1930
|
+
|
|
1931
|
+
declare type SpinnerProps = Omit<BaseSpinnerProps, 'intent'>;
|
|
1930
1932
|
declare const Spinner: ({ label, labelPosition, accessibilityLabel, contrast, size, }: SpinnerProps) => React.ReactElement;
|
|
1931
1933
|
|
|
1932
1934
|
declare type SkipNavLinkProps = {
|
|
@@ -1887,7 +1887,8 @@ declare type RadioGroupProps = {
|
|
|
1887
1887
|
};
|
|
1888
1888
|
declare const RadioGroup: ({ children, label, helpText, isDisabled, necessityIndicator, labelPosition, validationState, errorText, name, defaultValue, onChange, value, size, }: RadioGroupProps) => React__default.ReactElement;
|
|
1889
1889
|
|
|
1890
|
-
declare type
|
|
1890
|
+
declare type BaseSpinnerProps = {
|
|
1891
|
+
intent?: Feedback;
|
|
1891
1892
|
/**
|
|
1892
1893
|
* Sets the label of the spinner.
|
|
1893
1894
|
*
|
|
@@ -1910,14 +1911,15 @@ declare type SpinnerProps = {
|
|
|
1910
1911
|
*
|
|
1911
1912
|
* @default 'medium'
|
|
1912
1913
|
*/
|
|
1913
|
-
size?: '
|
|
1914
|
+
size?: 'medium' | 'large' | 'xlarge';
|
|
1914
1915
|
/**
|
|
1915
|
-
* Sets the aria-label for web & accessibilityLabel
|
|
1916
|
+
* Sets the aria-label for web & accessibilityLabel react-native.
|
|
1916
1917
|
*
|
|
1917
|
-
* @default 'Loading'
|
|
1918
1918
|
*/
|
|
1919
|
-
accessibilityLabel
|
|
1919
|
+
accessibilityLabel: string;
|
|
1920
1920
|
};
|
|
1921
|
+
|
|
1922
|
+
declare type SpinnerProps = Omit<BaseSpinnerProps, 'intent'>;
|
|
1921
1923
|
declare const Spinner: ({ label, labelPosition, accessibilityLabel, contrast, size, }: SpinnerProps) => React.ReactElement;
|
|
1922
1924
|
|
|
1923
1925
|
declare type SkipNavLinkProps = {
|
|
@@ -3341,11 +3341,11 @@ var getBaseButtonStyles=function getBaseButtonStyles(_ref){var defaultBorderColo
|
|
|
3341
3341
|
|
|
3342
3342
|
var StyledPressable=styled(Animated.createAnimatedComponent(Pressable))(function(props){return _extends({},getBaseButtonStyles(props),{alignSelf:'center'});});var StyledBaseButton=function StyledBaseButton(_ref){var onClick=_ref.onClick,_children=_ref.children,minHeight=_ref.minHeight,buttonPaddingTop=_ref.buttonPaddingTop,buttonPaddingBottom=_ref.buttonPaddingBottom,buttonPaddingLeft=_ref.buttonPaddingLeft,buttonPaddingRight=_ref.buttonPaddingRight,isFullWidth=_ref.isFullWidth,disabled=_ref.disabled,defaultBackgroundColor=_ref.defaultBackgroundColor,defaultBorderColor=_ref.defaultBorderColor,hoverBackgroundColor=_ref.hoverBackgroundColor,activeBackgroundColor=_ref.activeBackgroundColor,focusBackgroundColor=_ref.focusBackgroundColor,focusRingColor=_ref.focusRingColor,hoverBorderColor=_ref.hoverBorderColor,activeBorderColor=_ref.activeBorderColor,focusBorderColor=_ref.focusBorderColor,borderWidth=_ref.borderWidth,borderRadius=_ref.borderRadius,motionDuration=_ref.motionDuration,motionEasing=_ref.motionEasing,isLoading=_ref.isLoading,accessibilityProps=_ref.accessibilityProps;var _useTheme=useTheme(),theme=_useTheme.theme;var isPressed=useSharedValue(false);var duration=get_1(theme.motion,motionDuration);var easing=get_1(theme.motion,motionEasing);var animatedStyles=useAnimatedStyle(function(){var _f=function _f(){return {backgroundColor:withTiming(isPressed.value?activeBackgroundColor:defaultBackgroundColor,{duration:duration,easing:easing}),borderColor:withTiming(isPressed.value?activeBorderColor:defaultBorderColor,{duration:duration,easing:easing})};};_f._closure={withTiming:withTiming,isPressed:isPressed,activeBackgroundColor:activeBackgroundColor,defaultBackgroundColor:defaultBackgroundColor,duration:duration,easing:easing,activeBorderColor:activeBorderColor,defaultBorderColor:defaultBorderColor};_f.asString="function _f(){const{withTiming,isPressed,activeBackgroundColor,defaultBackgroundColor,duration,easing,activeBorderColor,defaultBorderColor}=jsThis._closure;{return{backgroundColor:withTiming(isPressed.value?activeBackgroundColor:defaultBackgroundColor,{duration:duration,easing:easing}),borderColor:withTiming(isPressed.value?activeBorderColor:defaultBorderColor,{duration:duration,easing:easing})};}}";_f.__workletHash=6870832376373;_f.__location="/home/runner/work/blade/blade/packages/blade/src/components/Button/BaseButton/StyledBaseButton.native.tsx (46:42)";_f.__optimalization=2;global.__reanimatedWorkletInit(_f);return _f;}());return jsx(StyledPressable,_extends({},accessibilityProps,{isLoading:isLoading,onPress:onClick,style:animatedStyles,minHeight:minHeight,buttonPaddingTop:buttonPaddingTop,buttonPaddingBottom:buttonPaddingBottom,buttonPaddingLeft:buttonPaddingLeft,buttonPaddingRight:buttonPaddingRight,isFullWidth:isFullWidth,disabled:disabled,defaultBackgroundColor:defaultBackgroundColor,defaultBorderColor:defaultBorderColor,hoverBackgroundColor:hoverBackgroundColor,activeBackgroundColor:activeBackgroundColor,focusBackgroundColor:focusBackgroundColor,focusRingColor:focusRingColor,hoverBorderColor:hoverBorderColor,activeBorderColor:activeBorderColor,focusBorderColor:focusBorderColor,borderWidth:borderWidth,borderRadius:borderRadius,motionDuration:motionDuration,motionEasing:motionEasing,children:function children(_ref2){var pressed=_ref2.pressed;isPressed.value=pressed;return _children;}}));};
|
|
3343
3343
|
|
|
3344
|
-
var typography={fonts:{size:{xsmall:75,small:75,medium:100,large:200}},lineHeights:{xsmall:'s',small:'s',medium:'l',large:'m'}};var minHeight={xsmall:28,small:32,medium:36,large:48};var buttonPadding={xsmall:{top:0,bottom:0,left:3,right:3},small:{top:0,bottom:0,left:4,right:4},medium:{top:0,bottom:0,left:6,right:6},large:{top:0,bottom:0,left:6,right:6}};var buttonIconOnlyPadding={xsmall:{top:0,bottom:0,left:4,right:4},small:{top:0,bottom:0,left:3,right:3},medium:{top:0,bottom:0,left:3,right:3},large:{top:0,bottom:0,left:4,right:4}};var buttonSizeToIconSizeMap={xsmall:'small',small:'small',medium:'medium',large:'medium'};var buttonIconOnlySizeToIconSizeMap={xsmall:'medium',small:'medium',medium:'large',large:'xlarge'};var buttonSizeToSpinnerSizeMap={xsmall:'
|
|
3344
|
+
var typography={fonts:{size:{xsmall:75,small:75,medium:100,large:200}},lineHeights:{xsmall:'s',small:'s',medium:'l',large:'m'}};var minHeight={xsmall:28,small:32,medium:36,large:48};var buttonPadding={xsmall:{top:0,bottom:0,left:3,right:3},small:{top:0,bottom:0,left:4,right:4},medium:{top:0,bottom:0,left:6,right:6},large:{top:0,bottom:0,left:6,right:6}};var buttonIconOnlyPadding={xsmall:{top:0,bottom:0,left:4,right:4},small:{top:0,bottom:0,left:3,right:3},medium:{top:0,bottom:0,left:3,right:3},large:{top:0,bottom:0,left:4,right:4}};var buttonSizeToIconSizeMap={xsmall:'small',small:'small',medium:'medium',large:'medium'};var buttonIconOnlySizeToIconSizeMap={xsmall:'medium',small:'medium',medium:'large',large:'xlarge'};var buttonSizeToSpinnerSizeMap={xsmall:'medium',small:'large',medium:'large',large:'xlarge'};var textPadding={xsmall:2,small:2,medium:3,large:3};
|
|
3345
3345
|
|
|
3346
3346
|
function announce(message){AccessibilityInfo.announceForAccessibility(message);}function clearAnnouncer(_assertiveness){console.warn('[Blade LiveAnnouncer]: clearAnnouncer is not needed in react-native');}function destroyAnnouncer(){console.warn('[Blade LiveAnnouncer]: destroyAnnouncer is not needed in react-native');}
|
|
3347
3347
|
|
|
3348
|
-
var dimensions={
|
|
3348
|
+
var dimensions={medium:16,large:20,xlarge:24};var motion={duration:'duration.2xgentle',easing:'easing.standard.attentive'};
|
|
3349
3349
|
|
|
3350
3350
|
var SpinnerIcon=function SpinnerIcon(_ref){var dimensions=_ref.dimensions,color=_ref.color;return jsxs(Svg,{width:dimensions,height:dimensions,viewBox:"0 0 24 24",fill:"none",children:[jsx(Path,{fillOpacity:0.2,d:"M24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12ZM3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12Z",fill:color}),jsx(Path,{d:"M24 12C24 13.8937 23.5518 15.7606 22.6921 17.4479C21.8324 19.1352 20.5855 20.5951 19.0534 21.7082C17.5214 22.8213 15.7476 23.556 13.8772 23.8523C12.0068 24.1485 10.0928 23.9979 8.29181 23.4127L9.21886 20.5595C10.5696 20.9984 12.0051 21.1114 13.4079 20.8892C14.8107 20.667 16.141 20.116 17.2901 19.2812C18.4391 18.4463 19.3743 17.3514 20.0191 16.0859C20.6639 14.8204 21 13.4203 21 12H24Z",fill:color}),jsx(Path,{d:"M-1.33514e-05 12C-1.33514e-05 10.1063 0.448176 8.23944 1.30791 6.55211C2.16764 4.86479 3.41451 3.4049 4.94656 2.2918C6.47862 1.17869 8.25236 0.443983 10.1228 0.147739C11.9932 -0.148504 13.9072 0.00212896 15.7082 0.587322L14.7811 3.44049C13.4304 3.0016 11.9949 2.88862 10.5921 3.11081C9.18927 3.33299 7.85896 3.88402 6.70992 4.71885C5.56088 5.55367 4.62573 6.64859 3.98093 7.91409C3.33613 9.17958 2.99999 10.5797 2.99999 12H-1.33514e-05Z",fill:color})]});};
|
|
3351
3351
|
|
|
@@ -3471,7 +3471,9 @@ var autoCompleteSuggestionTypeValues=['none','name','email','username','password
|
|
|
3471
3471
|
|
|
3472
3472
|
var CharacterCounter=function CharacterCounter(_ref){var currentCount=_ref.currentCount,maxCount=_ref.maxCount;return jsxs(Text,{variant:"caption",weight:"regular",type:"muted",children:[currentCount,"/",maxCount]});};
|
|
3473
3473
|
|
|
3474
|
-
var
|
|
3474
|
+
var Spinner=function Spinner(_ref){var _ref2;var label=_ref.label,labelPosition=_ref.labelPosition,accessibilityLabel=_ref.accessibilityLabel,_ref$contrast=_ref.contrast,contrast=_ref$contrast===void 0?'low':_ref$contrast,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size;return jsx(BaseSpinner,{label:label,labelPosition:labelPosition,accessibilityLabel:(_ref2=accessibilityLabel!=null?accessibilityLabel:label)!=null?_ref2:'Loading',contrast:contrast,size:size});};
|
|
3475
|
+
|
|
3476
|
+
var getKeyboardAndAutocompleteProps=function getKeyboardAndAutocompleteProps(_ref){var _ref$type=_ref.type,type=_ref$type===void 0?'text':_ref$type,keyboardReturnKeyType=_ref.keyboardReturnKeyType,autoCompleteSuggestionType=_ref.autoCompleteSuggestionType;var keyboardAndAutocompleteProps={type:type,keyboardType:'text',keyboardReturnKeyType:'default',autoCompleteSuggestionType:'none'};var keyboardConfigMap={text:{keyboardType:'text',keyboardReturnKeyType:'default',autoCompleteSuggestionType:'none'},telephone:{keyboardType:'telephone',keyboardReturnKeyType:'done',autoCompleteSuggestionType:'telephone'},email:{keyboardType:'email',keyboardReturnKeyType:'done',autoCompleteSuggestionType:'email'},url:{keyboardType:'url',keyboardReturnKeyType:'go',autoCompleteSuggestionType:'none'},numeric:{keyboardType:'decimal',keyboardReturnKeyType:'done',autoCompleteSuggestionType:'none'},search:{keyboardType:'search',keyboardReturnKeyType:'search',autoCompleteSuggestionType:'none'}};var keyboardConfig=keyboardConfigMap[type];keyboardAndAutocompleteProps.keyboardType=keyboardConfig.keyboardType;keyboardAndAutocompleteProps.keyboardReturnKeyType=keyboardReturnKeyType!=null?keyboardReturnKeyType:keyboardConfig.keyboardReturnKeyType;keyboardAndAutocompleteProps.autoCompleteSuggestionType=autoCompleteSuggestionType!=null?autoCompleteSuggestionType:keyboardConfig.autoCompleteSuggestionType;if(type==='numeric'){keyboardAndAutocompleteProps.type='text';}if(type==='search'){keyboardAndAutocompleteProps.type='text';}return keyboardAndAutocompleteProps;};var isReactNative$2=function isReactNative(_textInputRef){return getPlatformType()==='react-native';};var TextInput=function TextInput(_ref2){var _Boolean;var label=_ref2.label,_ref2$labelPosition=_ref2.labelPosition,labelPosition=_ref2$labelPosition===void 0?'top':_ref2$labelPosition,placeholder=_ref2.placeholder,_ref2$type=_ref2.type,type=_ref2$type===void 0?'text':_ref2$type,defaultValue=_ref2.defaultValue,name=_ref2.name,value=_ref2.value,maxCharacters=_ref2.maxCharacters,_onChange=_ref2.onChange,onBlur=_ref2.onBlur,isDisabled=_ref2.isDisabled,necessityIndicator=_ref2.necessityIndicator,validationState=_ref2.validationState,errorText=_ref2.errorText,helpText=_ref2.helpText,successText=_ref2.successText,isRequired=_ref2.isRequired,icon=_ref2.icon,prefix=_ref2.prefix,showClearButton=_ref2.showClearButton,onClearButtonClick=_ref2.onClearButtonClick,isLoading=_ref2.isLoading,suffix=_ref2.suffix,autoFocus=_ref2.autoFocus,keyboardReturnKeyType=_ref2.keyboardReturnKeyType,autoCompleteSuggestionType=_ref2.autoCompleteSuggestionType;var textInputRef=React__default.useRef(null);var _useState=useState((_Boolean=Boolean(defaultValue!=null?defaultValue:value))!=null?_Boolean:false),_useState2=_slicedToArray(_useState,2),shouldShowClearButton=_useState2[0],setShouldShowClearButton=_useState2[1];var renderInteractionElement=function renderInteractionElement(){if(isLoading){return jsx(Spinner,{accessibilityLabel:"Loading Content"});}if(shouldShowClearButton){return jsx(IconButton,{size:"medium",icon:CloseIcon,onClick:function onClick(){var _textInputRef$current;if(isEmpty_1(value)&&textInputRef.current){if(isReactNative$2(textInputRef.current)){textInputRef.current.clear();textInputRef.current.focus();}else if(textInputRef.current instanceof HTMLInputElement){textInputRef.current.value='';textInputRef.current.focus();}}onClearButtonClick==null?void 0:onClearButtonClick();textInputRef==null?void 0:(_textInputRef$current=textInputRef.current)==null?void 0:_textInputRef$current.focus();setShouldShowClearButton(false);},accessibilityLabel:"Clear Input Content"});}return null;};return jsx(BaseInput,_extends({id:"textinput",ref:textInputRef,label:label,labelPosition:labelPosition,placeholder:placeholder,defaultValue:defaultValue,value:value,name:name,maxCharacters:maxCharacters,onChange:function onChange(_ref3){var name=_ref3.name,value=_ref3.value;if(showClearButton&&value!=null&&value.length){setShouldShowClearButton(true);}if(shouldShowClearButton&&!(value!=null&&value.length)){setShouldShowClearButton(false);}_onChange==null?void 0:_onChange({name:name,value:value});},onBlur:onBlur,isDisabled:isDisabled,necessityIndicator:necessityIndicator,isRequired:isRequired,leadingIcon:icon,prefix:prefix,interactionElement:renderInteractionElement(),suffix:suffix,validationState:validationState,errorText:errorText,helpText:helpText,successText:successText,trailingFooterSlot:function trailingFooterSlot(value){var _value$length;return maxCharacters?jsx(Box,{marginTop:"spacing.2",marginRight:"spacing.1",children:jsx(CharacterCounter,{currentCount:(_value$length=value==null?void 0:value.length)!=null?_value$length:0,maxCount:maxCharacters})}):null;},autoFocus:autoFocus},getKeyboardAndAutocompleteProps({type:type,keyboardReturnKeyType:keyboardReturnKeyType,autoCompleteSuggestionType:autoCompleteSuggestionType})));};
|
|
3475
3477
|
|
|
3476
3478
|
var PasswordInput=function PasswordInput(_ref){var label=_ref.label,_ref$labelPosition=_ref.labelPosition,labelPosition=_ref$labelPosition===void 0?'top':_ref$labelPosition,_ref$showRevealButton=_ref.showRevealButton,showRevealButton=_ref$showRevealButton===void 0?true:_ref$showRevealButton,maxCharacters=_ref.maxCharacters,validationState=_ref.validationState,errorText=_ref.errorText,successText=_ref.successText,helpText=_ref.helpText,_ref$isDisabled=_ref.isDisabled,isDisabled=_ref$isDisabled===void 0?false:_ref$isDisabled,defaultValue=_ref.defaultValue,placeholder=_ref.placeholder,_ref$isRequired=_ref.isRequired,isRequired=_ref$isRequired===void 0?false:_ref$isRequired,_ref$necessityIndicat=_ref.necessityIndicator,necessityIndicator=_ref$necessityIndicat===void 0?'none':_ref$necessityIndicat,value=_ref.value,onChange=_ref.onChange,onFocus=_ref.onFocus,onBlur=_ref.onBlur,name=_ref.name,_ref$autoFocus=_ref.autoFocus,autoFocus=_ref$autoFocus===void 0?false:_ref$autoFocus,_ref$keyboardReturnKe=_ref.keyboardReturnKeyType,keyboardReturnKeyType=_ref$keyboardReturnKe===void 0?'done':_ref$keyboardReturnKe,autoCompleteSuggestionType=_ref.autoCompleteSuggestionType;var _useState=useState(false),_useState2=_slicedToArray(_useState,2),isRevealed=_useState2[0],setIsRevealed=_useState2[1];var isEnabled=!isDisabled;var isRevealedAndEnabled=isRevealed&&isEnabled;var toggleIsRevealed=function toggleIsRevealed(){return setIsRevealed(function(revealed){return !revealed;});};var accessibilityLabel=isRevealedAndEnabled?'Hide password':'Show password';var type=isRevealedAndEnabled?'text':'password';var revealButtonIcon=isRevealedAndEnabled?EyeOffIcon:EyeIcon;var revealButton=showRevealButton&&!isDisabled?jsx(IconButton,{size:"medium",icon:revealButtonIcon,onClick:toggleIsRevealed,accessibilityLabel:accessibilityLabel}):null;var trailingFooterSlot=function trailingFooterSlot(value){var _value$length;return maxCharacters?jsx(Box,{marginTop:"spacing.2",marginRight:"spacing.1",children:jsx(CharacterCounter,{currentCount:(_value$length=value==null?void 0:value.length)!=null?_value$length:0,maxCount:maxCharacters})}):null;};return jsx(BaseInput,{id:"password-field",label:label,labelPosition:labelPosition,type:type,interactionElement:revealButton,trailingFooterSlot:trailingFooterSlot,maxCharacters:maxCharacters,validationState:validationState,errorText:errorText,successText:successText,helpText:helpText,isDisabled:isDisabled,defaultValue:defaultValue,placeholder:placeholder,isRequired:isRequired,necessityIndicator:necessityIndicator,value:value,onChange:onChange,onBlur:onBlur,onFocus:onFocus,name:name,autoFocus:autoFocus,autoCompleteSuggestionType:autoCompleteSuggestionType,keyboardReturnKeyType:keyboardReturnKeyType});};
|
|
3477
3479
|
|
|
@@ -3505,8 +3507,6 @@ var useRadioGroup=function useRadioGroup(_ref){var value=_ref.value,defaultValue
|
|
|
3505
3507
|
|
|
3506
3508
|
var RadioGroup=function RadioGroup(_ref){var children=_ref.children,label=_ref.label,helpText=_ref.helpText,_ref$isDisabled=_ref.isDisabled,isDisabled=_ref$isDisabled===void 0?false:_ref$isDisabled,_ref$necessityIndicat=_ref.necessityIndicator,necessityIndicator=_ref$necessityIndicat===void 0?'none':_ref$necessityIndicat,_ref$labelPosition=_ref.labelPosition,labelPosition=_ref$labelPosition===void 0?'top':_ref$labelPosition,_ref$validationState=_ref.validationState,validationState=_ref$validationState===void 0?'none':_ref$validationState,errorText=_ref.errorText,name=_ref.name,defaultValue=_ref.defaultValue,onChange=_ref.onChange,value=_ref.value,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size;var _useRadioGroup=useRadioGroup({defaultValue:defaultValue,isDisabled:isDisabled,labelPosition:labelPosition,name:name,onChange:onChange,validationState:validationState,value:value,size:size}),contextValue=_useRadioGroup.contextValue,ids=_useRadioGroup.ids;var _useTheme=useTheme(),theme=_useTheme.theme;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var showError=validationState==='error'&&errorText;var showHelpText=!showError&&helpText;var accessibilityText=","+(showError?errorText:'')+" "+(showHelpText?helpText:'');var isReactNative=getPlatformType()==='react-native';var gap=radioSizes.group.gap[size][matchedDeviceType];var childCount=React__default.Children.count(children);return jsx(RadioGroupProvider,{value:contextValue,children:jsxs(SelectorGroupField,{position:labelPosition,labelledBy:ids.labelId,accessibilityRole:isReactNative?'radiogroup':'group',children:[jsx(FormLabel,{as:"span",necessityIndicator:necessityIndicator,position:labelPosition,id:ids.labelId,accessibilityText:accessibilityText,children:label}),jsxs(Box,{children:[jsx(Box,{display:"flex",flexDirection:"column",children:React__default.Children.map(children,function(child,index){return jsx(Box,{marginBottom:index===childCount-1?0:gap,children:child},index);})}),jsx(FormHint,{type:validationState==='error'?'error':'help',errorText:errorText,helpText:helpText})]})]})});};
|
|
3507
3509
|
|
|
3508
|
-
var Spinner=function Spinner(_ref){var _ref2;var label=_ref.label,labelPosition=_ref.labelPosition,accessibilityLabel=_ref.accessibilityLabel,_ref$contrast=_ref.contrast,contrast=_ref$contrast===void 0?'low':_ref$contrast,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size;return jsx(BaseSpinner,{label:label,labelPosition:labelPosition,accessibilityLabel:(_ref2=accessibilityLabel!=null?accessibilityLabel:label)!=null?_ref2:'Loading',contrast:contrast,size:size});};
|
|
3509
|
-
|
|
3510
3510
|
var SkipNavLink=function SkipNavLink(_props){throw new Error('[Blade: SkipNav]: SkipNavLink is not available on React Native');};var SkipNavContent=function SkipNavContent(_props){throw new Error('[Blade: SkipNav]: SkipNavContent is not available on React Native');};
|
|
3511
3511
|
|
|
3512
3512
|
export { Alert, AlertTriangleIcon as AlertOctagonIcon, AlertTriangleIcon$1 as AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, ArrowUpRightIcon, Badge, BladeProvider, Button, CheckCircleIcon, CheckIcon, Checkbox, CheckboxGroup, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, Code, Counter, CreditCardIcon, DollarIcon, DownloadIcon, EditIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileTextIcon, Heading, HelpCircleIcon, HistoryIcon, HomeIcon, IconButton, Indicator, InfoIcon, Link, LinkIcon, LockIcon, MinusIcon, OTPInput, PasswordInput, PauseIcon, PlusIcon, Radio, RadioGroup, RefreshLeftIcon, RotateCounterClockWiseIcon, RupeeIcon, SearchIcon, SettingsIcon, SkipNavContent, SkipNavLink, SlashIcon, Spinner, Text, TextArea, TextInput, Title, TrashIcon, TrendingDownIcon, TrendingUpIcon, UsersIcon, VisuallyHidden, announce, clearAnnouncer, destroyAnnouncer, getTextProps, screenReaderStyles, useTheme };
|