@razorpay/blade 11.21.6 → 11.21.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/native/components/Spinner/BaseSpinner/BaseSpinner.js +1 -1
- package/build/lib/native/components/Spinner/BaseSpinner/BaseSpinner.js.map +1 -1
- package/build/lib/web/development/components/Spinner/BaseSpinner/BaseSpinner.js +1 -1
- package/build/lib/web/development/components/Spinner/BaseSpinner/BaseSpinner.js.map +1 -1
- package/build/lib/web/production/components/Spinner/BaseSpinner/BaseSpinner.js +1 -1
- package/build/lib/web/production/components/Spinner/BaseSpinner/BaseSpinner.js.map +1 -1
- package/package.json +1 -1
|
@@ -24,7 +24,7 @@ import { Text } from '../../Typography/Text/Text.js';
|
|
|
24
24
|
import '../../Typography/Code/Code.js';
|
|
25
25
|
import { makeAccessible } from '../../../utils/makeAccessible/makeAccessible.native.js';
|
|
26
26
|
|
|
27
|
-
var _excluded=["label","labelPosition","accessibilityLabel","color","size","testID"];var getColor=function getColor(_ref){var color=_ref.color,theme=_ref.theme;if(color&&color==='white'){return getIn(theme.colors,'
|
|
27
|
+
var _excluded=["label","labelPosition","accessibilityLabel","color","size","testID"];var getColor=function getColor(_ref){var color=_ref.color,theme=_ref.theme;if(color&&color==='white'){return getIn(theme.colors,'interactive.icon.staticWhite.subtle');}if(color&&color!=='primary'){return getIn(theme.colors,`feedback.background.${color}.intense`);}return getIn(theme.colors,'surface.background.primary.intense');};var BaseSpinner=function BaseSpinner(_ref2){var label=_ref2.label,_ref2$labelPosition=_ref2.labelPosition,labelPosition=_ref2$labelPosition===void 0?'right':_ref2$labelPosition,accessibilityLabel=_ref2.accessibilityLabel,_ref2$color=_ref2.color,color=_ref2$color===void 0?'neutral':_ref2$color,_ref2$size=_ref2.size,size=_ref2$size===void 0?'medium':_ref2$size,testID=_ref2.testID,styledProps=_objectWithoutProperties(_ref2,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;return jsx(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.Spinner,testID:testID}),getStyledProps(styledProps),{children:jsxs(BaseBox,Object.assign({display:"flex",alignItems:"center",flexDirection:labelPosition==='right'?'row':'column'},makeAccessible({label:accessibilityLabel,role:'progressbar'}),{children:[jsx(SpinningBox,{children:jsx(SpinnerIcon,{dimensions:makeSize(dimensions[size]),color:getColor({color:color,theme:theme})})}),label&&label.trim().length>0?jsx(BaseBox,{marginLeft:labelPosition==='right'?'spacing.3':'spacing.0',marginTop:labelPosition==='bottom'?'spacing.3':'spacing.0',children:jsx(Text,{variant:"body",weight:"regular",size:"small",color:"surface.text.gray.muted",children:label})}):null]}))}));};
|
|
28
28
|
|
|
29
29
|
export { BaseSpinner };
|
|
30
30
|
//# sourceMappingURL=BaseSpinner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseSpinner.js","sources":["../../../../../../src/components/Spinner/BaseSpinner/BaseSpinner.tsx"],"sourcesContent":["import React from 'react';\nimport { dimensions } from './spinnerTokens';\nimport SpinnerIcon from './SpinnerIcon';\nimport { SpinningBox } from './SpinningBox';\nimport getIn from '~utils/lodashButBetter/get';\nimport type { Theme } from '~components/BladeProvider';\nimport { useTheme } from '~components/BladeProvider';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport type { TestID } from '~utils/types';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\n\ntype BaseSpinnerProps = {\n /**\n * Sets the color of the spinner.\n *\n * @default 'default'\n */\n color?: 'primary' | 'white' | FeedbackColors;\n /**\n * Sets the label of the spinner.\n *\n * @default 'right'\n */\n label?: string;\n /**\n * Sets the label of the spinner.\n *\n */\n labelPosition?: 'right' | 'bottom';\n /**\n * Sets the size of the spinner.\n *\n * @default 'medium'\n */\n size?: 'medium' | 'large' | 'xlarge';\n /**\n * Sets the aria-label for web & accessibilityLabel react-native.\n *\n */\n accessibilityLabel: string;\n} & TestID &\n StyledPropsBlade;\n\nconst getColor = ({ color, theme }: { color: BaseSpinnerProps['color']; theme: Theme }): string => {\n if (color && color === 'white') {\n return getIn(theme.colors, '
|
|
1
|
+
{"version":3,"file":"BaseSpinner.js","sources":["../../../../../../src/components/Spinner/BaseSpinner/BaseSpinner.tsx"],"sourcesContent":["import React from 'react';\nimport { dimensions } from './spinnerTokens';\nimport SpinnerIcon from './SpinnerIcon';\nimport { SpinningBox } from './SpinningBox';\nimport getIn from '~utils/lodashButBetter/get';\nimport type { Theme } from '~components/BladeProvider';\nimport { useTheme } from '~components/BladeProvider';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport type { TestID } from '~utils/types';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\n\ntype BaseSpinnerProps = {\n /**\n * Sets the color of the spinner.\n *\n * @default 'default'\n */\n color?: 'primary' | 'white' | FeedbackColors;\n /**\n * Sets the label of the spinner.\n *\n * @default 'right'\n */\n label?: string;\n /**\n * Sets the label of the spinner.\n *\n */\n labelPosition?: 'right' | 'bottom';\n /**\n * Sets the size of the spinner.\n *\n * @default 'medium'\n */\n size?: 'medium' | 'large' | 'xlarge';\n /**\n * Sets the aria-label for web & accessibilityLabel react-native.\n *\n */\n accessibilityLabel: string;\n} & TestID &\n StyledPropsBlade;\n\nconst getColor = ({ color, theme }: { color: BaseSpinnerProps['color']; theme: Theme }): string => {\n if (color && color === 'white') {\n return getIn(theme.colors, 'interactive.icon.staticWhite.subtle');\n }\n if (color && color !== 'primary') {\n return getIn(theme.colors, `feedback.background.${color}.intense`);\n }\n return getIn(theme.colors, 'surface.background.primary.intense');\n};\n\nconst BaseSpinner = ({\n label,\n labelPosition = 'right',\n accessibilityLabel,\n color = 'neutral',\n size = 'medium',\n testID,\n ...styledProps\n}: BaseSpinnerProps): React.ReactElement => {\n const { theme } = useTheme();\n return (\n <BaseBox\n {...metaAttribute({ name: MetaConstants.Spinner, testID })}\n {...getStyledProps(styledProps)}\n >\n <BaseBox\n display=\"flex\"\n alignItems=\"center\"\n flexDirection={labelPosition === 'right' ? 'row' : 'column'}\n {...makeAccessible({\n label: accessibilityLabel,\n role: 'progressbar',\n })}\n >\n <SpinningBox>\n <SpinnerIcon dimensions={makeSize(dimensions[size])} color={getColor({ color, theme })} />\n </SpinningBox>\n {label && label.trim().length > 0 ? (\n <BaseBox\n marginLeft={labelPosition === 'right' ? 'spacing.3' : 'spacing.0'}\n marginTop={labelPosition === 'bottom' ? 'spacing.3' : 'spacing.0'}\n >\n <Text variant=\"body\" weight=\"regular\" size=\"small\" color=\"surface.text.gray.muted\">\n {label}\n </Text>\n </BaseBox>\n ) : null}\n </BaseBox>\n </BaseBox>\n );\n};\n\nexport type { BaseSpinnerProps };\nexport { BaseSpinner };\n"],"names":["getColor","_ref","color","theme","getIn","colors","BaseSpinner","_ref2","label","_ref2$labelPosition","labelPosition","accessibilityLabel","_ref2$color","_ref2$size","size","testID","styledProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","_jsx","BaseBox","Object","assign","metaAttribute","name","MetaConstants","Spinner","getStyledProps","children","_jsxs","display","alignItems","flexDirection","makeAccessible","role","SpinningBox","SpinnerIcon","dimensions","makeSize","trim","length","marginLeft","marginTop","Text","variant","weight"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;qFAiDA,IAAMA,QAAQ,CAAG,SAAXA,QAAQA,CAAAC,IAAA,CAAqF,KAA/EC,KAAK,CAAAD,IAAA,CAALC,KAAK,CAAEC,KAAK,CAAAF,IAAA,CAALE,K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AO,CAAAC,MAAA,CAAAC,MAAA,EACNQ,OAAO,CAAC,MAAM,CACdC,UAAU,CAAC,QAAQ,CACnBC,aAAa,CAAExB,aAAa,GAAK,OAAO,CAAG,KAAK,CAAG,QAAS,CACxDyB,CAAAA,cAAc,CAAC,CACjB3B,KAAK,CAAEG,kBAAkB,CACzByB,IAAI,CAAE,aACR,CAAC,CAAC,CAAAN,CAAAA,QAAA,EAEFT,GAAA,CAACgB,WAAW,CAAAP,CAAAA,QAAA,CACVT,GAAA,CAACiB,WAAW,CAAA,CAACC,UAAU,CAAEC,QAAQ,CAACD,UAAU,CAACzB,IAAI,CAAC,CAAE,CAACZ,KAAK,CAAEF,QAAQ,CAAC,CAAEE,KAAK,CAALA,KAAK,CAAEC,KAAK,CAALA,KAAM,CAAC,CAAE,CAAE,CAAC,CAC/E,CAAC,CACbK,KAAK,EAAIA,KAAK,CAACiC,IAAI,EAAE,CAACC,MAAM,CAAG,CAAC,CAC/BrB,GAAA,CAACC,OAAO,EACNqB,UAAU,CAAEjC,aAAa,GAAK,OAAO,CAAG,WAAW,CAAG,WAAY,CAClEkC,SAAS,CAAElC,aAAa,GAAK,QAAQ,CAAG,WAAW,CAAG,WAAY,CAAAoB,QAAA,CAElET,GAAA,CAACwB,IAAI,EAACC,OAAO,CAAC,MAAM,CAACC,MAAM,CAAC,SAAS,CAACjC,IAAI,CAAC,OAAO,CAACZ,KAAK,CAAC,yBAAyB,CAAA4B,QAAA,CAC/EtB,KAAK,CACF,CAAC,CACA,CAAC,CACR,IAAI,GACD,CAAC,CAAA,CACH,CAAC,CAEd;;;;"}
|
|
@@ -29,7 +29,7 @@ var getColor = function getColor(_ref) {
|
|
|
29
29
|
var color = _ref.color,
|
|
30
30
|
theme = _ref.theme;
|
|
31
31
|
if (color && color === 'white') {
|
|
32
|
-
return getIn(theme.colors, '
|
|
32
|
+
return getIn(theme.colors, 'interactive.icon.staticWhite.subtle');
|
|
33
33
|
}
|
|
34
34
|
if (color && color !== 'primary') {
|
|
35
35
|
return getIn(theme.colors, "feedback.background.".concat(color, ".intense"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseSpinner.js","sources":["../../../../../../../src/components/Spinner/BaseSpinner/BaseSpinner.tsx"],"sourcesContent":["import React from 'react';\nimport { dimensions } from './spinnerTokens';\nimport SpinnerIcon from './SpinnerIcon';\nimport { SpinningBox } from './SpinningBox';\nimport getIn from '~utils/lodashButBetter/get';\nimport type { Theme } from '~components/BladeProvider';\nimport { useTheme } from '~components/BladeProvider';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport type { TestID } from '~utils/types';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\n\ntype BaseSpinnerProps = {\n /**\n * Sets the color of the spinner.\n *\n * @default 'default'\n */\n color?: 'primary' | 'white' | FeedbackColors;\n /**\n * Sets the label of the spinner.\n *\n * @default 'right'\n */\n label?: string;\n /**\n * Sets the label of the spinner.\n *\n */\n labelPosition?: 'right' | 'bottom';\n /**\n * Sets the size of the spinner.\n *\n * @default 'medium'\n */\n size?: 'medium' | 'large' | 'xlarge';\n /**\n * Sets the aria-label for web & accessibilityLabel react-native.\n *\n */\n accessibilityLabel: string;\n} & TestID &\n StyledPropsBlade;\n\nconst getColor = ({ color, theme }: { color: BaseSpinnerProps['color']; theme: Theme }): string => {\n if (color && color === 'white') {\n return getIn(theme.colors, '
|
|
1
|
+
{"version":3,"file":"BaseSpinner.js","sources":["../../../../../../../src/components/Spinner/BaseSpinner/BaseSpinner.tsx"],"sourcesContent":["import React from 'react';\nimport { dimensions } from './spinnerTokens';\nimport SpinnerIcon from './SpinnerIcon';\nimport { SpinningBox } from './SpinningBox';\nimport getIn from '~utils/lodashButBetter/get';\nimport type { Theme } from '~components/BladeProvider';\nimport { useTheme } from '~components/BladeProvider';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport type { TestID } from '~utils/types';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\n\ntype BaseSpinnerProps = {\n /**\n * Sets the color of the spinner.\n *\n * @default 'default'\n */\n color?: 'primary' | 'white' | FeedbackColors;\n /**\n * Sets the label of the spinner.\n *\n * @default 'right'\n */\n label?: string;\n /**\n * Sets the label of the spinner.\n *\n */\n labelPosition?: 'right' | 'bottom';\n /**\n * Sets the size of the spinner.\n *\n * @default 'medium'\n */\n size?: 'medium' | 'large' | 'xlarge';\n /**\n * Sets the aria-label for web & accessibilityLabel react-native.\n *\n */\n accessibilityLabel: string;\n} & TestID &\n StyledPropsBlade;\n\nconst getColor = ({ color, theme }: { color: BaseSpinnerProps['color']; theme: Theme }): string => {\n if (color && color === 'white') {\n return getIn(theme.colors, 'interactive.icon.staticWhite.subtle');\n }\n if (color && color !== 'primary') {\n return getIn(theme.colors, `feedback.background.${color}.intense`);\n }\n return getIn(theme.colors, 'surface.background.primary.intense');\n};\n\nconst BaseSpinner = ({\n label,\n labelPosition = 'right',\n accessibilityLabel,\n color = 'neutral',\n size = 'medium',\n testID,\n ...styledProps\n}: BaseSpinnerProps): React.ReactElement => {\n const { theme } = useTheme();\n return (\n <BaseBox\n {...metaAttribute({ name: MetaConstants.Spinner, testID })}\n {...getStyledProps(styledProps)}\n >\n <BaseBox\n display=\"flex\"\n alignItems=\"center\"\n flexDirection={labelPosition === 'right' ? 'row' : 'column'}\n {...makeAccessible({\n label: accessibilityLabel,\n role: 'progressbar',\n })}\n >\n <SpinningBox>\n <SpinnerIcon dimensions={makeSize(dimensions[size])} color={getColor({ color, theme })} />\n </SpinningBox>\n {label && label.trim().length > 0 ? (\n <BaseBox\n marginLeft={labelPosition === 'right' ? 'spacing.3' : 'spacing.0'}\n marginTop={labelPosition === 'bottom' ? 'spacing.3' : 'spacing.0'}\n >\n <Text variant=\"body\" weight=\"regular\" size=\"small\" color=\"surface.text.gray.muted\">\n {label}\n </Text>\n </BaseBox>\n ) : null}\n </BaseBox>\n </BaseBox>\n );\n};\n\nexport type { BaseSpinnerProps };\nexport { BaseSpinner };\n"],"names":["getColor","_ref","color","theme","getIn","colors","concat","BaseSpinner","_ref2","label","_ref2$labelPosition","labelPosition","accessibilityLabel","_ref2$color","_ref2$size","size","testID","styledProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","_jsx","BaseBox","_objectSpread","metaAttribute","name","MetaConstants","Spinner","getStyledProps","children","_jsxs","display","alignItems","flexDirection","makeAccessible","role","SpinningBox","SpinnerIcon","dimensions","makeSize","trim","length","marginLeft","marginTop","Text","variant","weight"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAMA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAAqF;AAAA,EAAA,IAA/EC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK,CAAA;AAC9B,EAAA,IAAID,KAAK,IAAIA,KAAK,KAAK,OAAO,EAAE;AAC9B,IAAA,OAAOE,KAAK,CAACD,KAAK,CAACE,MAAM,EAAE,qCAAqC,CAAC,CAAA;AACnE,GAAA;AACA,EAAA,IAAIH,KAAK,IAAIA,KAAK,KAAK,SAAS,EAAE;IAChC,OAAOE,KAAK,CAACD,KAAK,CAACE,MAAM,yBAAAC,MAAA,CAAyBJ,KAAK,EAAA,UAAA,CAAU,CAAC,CAAA;AACpE,GAAA;AACA,EAAA,OAAOE,KAAK,CAACD,KAAK,CAACE,MAAM,EAAE,oCAAoC,CAAC,CAAA;AAClE,CAAC,CAAA;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AAA,KAAK,EAAEG,kBAAkB;AACzBwB,MAAAA,IAAI,EAAE,aAAA;AACR,KAAC,CAAC,CAAA,EAAA,EAAA,EAAA;MAAAN,QAAA,EAAA,cAEFR,GAAA,CAACe,WAAW,EAAA;QAAAP,QAAA,eACVR,GAAA,CAACgB,WAAW,EAAA;AAACC,UAAAA,UAAU,EAAEC,QAAQ,CAACD,UAAU,CAACxB,IAAI,CAAC,CAAE;UAACb,KAAK,EAAEF,QAAQ,CAAC;AAAEE,YAAAA,KAAK,EAALA,KAAK;AAAEC,YAAAA,KAAK,EAALA,KAAAA;WAAO,CAAA;SAAI,CAAA;AAAC,OAC/E,CAAC,EACbM,KAAK,IAAIA,KAAK,CAACgC,IAAI,EAAE,CAACC,MAAM,GAAG,CAAC,gBAC/BpB,GAAA,CAACC,OAAO,EAAA;AACNoB,QAAAA,UAAU,EAAEhC,aAAa,KAAK,OAAO,GAAG,WAAW,GAAG,WAAY;AAClEiC,QAAAA,SAAS,EAAEjC,aAAa,KAAK,QAAQ,GAAG,WAAW,GAAG,WAAY;QAAAmB,QAAA,eAElER,GAAA,CAACuB,IAAI,EAAA;AAACC,UAAAA,OAAO,EAAC,MAAM;AAACC,UAAAA,MAAM,EAAC,SAAS;AAAChC,UAAAA,IAAI,EAAC,OAAO;AAACb,UAAAA,KAAK,EAAC,yBAAyB;AAAA4B,UAAAA,QAAA,EAC/ErB,KAAAA;SACG,CAAA;OACC,CAAC,GACR,IAAI,CAAA;KACD,CAAA,CAAA;AAAC,GAAA,CACH,CAAC,CAAA;AAEd;;;;"}
|
|
@@ -29,7 +29,7 @@ var getColor = function getColor(_ref) {
|
|
|
29
29
|
var color = _ref.color,
|
|
30
30
|
theme = _ref.theme;
|
|
31
31
|
if (color && color === 'white') {
|
|
32
|
-
return getIn(theme.colors, '
|
|
32
|
+
return getIn(theme.colors, 'interactive.icon.staticWhite.subtle');
|
|
33
33
|
}
|
|
34
34
|
if (color && color !== 'primary') {
|
|
35
35
|
return getIn(theme.colors, "feedback.background.".concat(color, ".intense"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseSpinner.js","sources":["../../../../../../../src/components/Spinner/BaseSpinner/BaseSpinner.tsx"],"sourcesContent":["import React from 'react';\nimport { dimensions } from './spinnerTokens';\nimport SpinnerIcon from './SpinnerIcon';\nimport { SpinningBox } from './SpinningBox';\nimport getIn from '~utils/lodashButBetter/get';\nimport type { Theme } from '~components/BladeProvider';\nimport { useTheme } from '~components/BladeProvider';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport type { TestID } from '~utils/types';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\n\ntype BaseSpinnerProps = {\n /**\n * Sets the color of the spinner.\n *\n * @default 'default'\n */\n color?: 'primary' | 'white' | FeedbackColors;\n /**\n * Sets the label of the spinner.\n *\n * @default 'right'\n */\n label?: string;\n /**\n * Sets the label of the spinner.\n *\n */\n labelPosition?: 'right' | 'bottom';\n /**\n * Sets the size of the spinner.\n *\n * @default 'medium'\n */\n size?: 'medium' | 'large' | 'xlarge';\n /**\n * Sets the aria-label for web & accessibilityLabel react-native.\n *\n */\n accessibilityLabel: string;\n} & TestID &\n StyledPropsBlade;\n\nconst getColor = ({ color, theme }: { color: BaseSpinnerProps['color']; theme: Theme }): string => {\n if (color && color === 'white') {\n return getIn(theme.colors, '
|
|
1
|
+
{"version":3,"file":"BaseSpinner.js","sources":["../../../../../../../src/components/Spinner/BaseSpinner/BaseSpinner.tsx"],"sourcesContent":["import React from 'react';\nimport { dimensions } from './spinnerTokens';\nimport SpinnerIcon from './SpinnerIcon';\nimport { SpinningBox } from './SpinningBox';\nimport getIn from '~utils/lodashButBetter/get';\nimport type { Theme } from '~components/BladeProvider';\nimport { useTheme } from '~components/BladeProvider';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport type { TestID } from '~utils/types';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\n\ntype BaseSpinnerProps = {\n /**\n * Sets the color of the spinner.\n *\n * @default 'default'\n */\n color?: 'primary' | 'white' | FeedbackColors;\n /**\n * Sets the label of the spinner.\n *\n * @default 'right'\n */\n label?: string;\n /**\n * Sets the label of the spinner.\n *\n */\n labelPosition?: 'right' | 'bottom';\n /**\n * Sets the size of the spinner.\n *\n * @default 'medium'\n */\n size?: 'medium' | 'large' | 'xlarge';\n /**\n * Sets the aria-label for web & accessibilityLabel react-native.\n *\n */\n accessibilityLabel: string;\n} & TestID &\n StyledPropsBlade;\n\nconst getColor = ({ color, theme }: { color: BaseSpinnerProps['color']; theme: Theme }): string => {\n if (color && color === 'white') {\n return getIn(theme.colors, 'interactive.icon.staticWhite.subtle');\n }\n if (color && color !== 'primary') {\n return getIn(theme.colors, `feedback.background.${color}.intense`);\n }\n return getIn(theme.colors, 'surface.background.primary.intense');\n};\n\nconst BaseSpinner = ({\n label,\n labelPosition = 'right',\n accessibilityLabel,\n color = 'neutral',\n size = 'medium',\n testID,\n ...styledProps\n}: BaseSpinnerProps): React.ReactElement => {\n const { theme } = useTheme();\n return (\n <BaseBox\n {...metaAttribute({ name: MetaConstants.Spinner, testID })}\n {...getStyledProps(styledProps)}\n >\n <BaseBox\n display=\"flex\"\n alignItems=\"center\"\n flexDirection={labelPosition === 'right' ? 'row' : 'column'}\n {...makeAccessible({\n label: accessibilityLabel,\n role: 'progressbar',\n })}\n >\n <SpinningBox>\n <SpinnerIcon dimensions={makeSize(dimensions[size])} color={getColor({ color, theme })} />\n </SpinningBox>\n {label && label.trim().length > 0 ? (\n <BaseBox\n marginLeft={labelPosition === 'right' ? 'spacing.3' : 'spacing.0'}\n marginTop={labelPosition === 'bottom' ? 'spacing.3' : 'spacing.0'}\n >\n <Text variant=\"body\" weight=\"regular\" size=\"small\" color=\"surface.text.gray.muted\">\n {label}\n </Text>\n </BaseBox>\n ) : null}\n </BaseBox>\n </BaseBox>\n );\n};\n\nexport type { BaseSpinnerProps };\nexport { BaseSpinner };\n"],"names":["getColor","_ref","color","theme","getIn","colors","concat","BaseSpinner","_ref2","label","_ref2$labelPosition","labelPosition","accessibilityLabel","_ref2$color","_ref2$size","size","testID","styledProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","_jsx","BaseBox","_objectSpread","metaAttribute","name","MetaConstants","Spinner","getStyledProps","children","_jsxs","display","alignItems","flexDirection","makeAccessible","role","SpinningBox","SpinnerIcon","dimensions","makeSize","trim","length","marginLeft","marginTop","Text","variant","weight"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAMA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAAqF;AAAA,EAAA,IAA/EC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK,CAAA;AAC9B,EAAA,IAAID,KAAK,IAAIA,KAAK,KAAK,OAAO,EAAE;AAC9B,IAAA,OAAOE,KAAK,CAACD,KAAK,CAACE,MAAM,EAAE,qCAAqC,CAAC,CAAA;AACnE,GAAA;AACA,EAAA,IAAIH,KAAK,IAAIA,KAAK,KAAK,SAAS,EAAE;IAChC,OAAOE,KAAK,CAACD,KAAK,CAACE,MAAM,yBAAAC,MAAA,CAAyBJ,KAAK,EAAA,UAAA,CAAU,CAAC,CAAA;AACpE,GAAA;AACA,EAAA,OAAOE,KAAK,CAACD,KAAK,CAACE,MAAM,EAAE,oCAAoC,CAAC,CAAA;AAClE,CAAC,CAAA;AAED,IAAME,WAAW,GAAG,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