@razorpay/blade 12.120.0 → 12.121.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/build/lib/native/components/Button/BaseButton/BaseButton.js +2 -2
  2. package/build/lib/native/components/Button/BaseButton/BaseButton.js.map +1 -1
  3. package/build/lib/native/components/Button/BaseButton/buttonTokens.js +1 -1
  4. package/build/lib/native/components/Button/BaseButton/buttonTokens.js.map +1 -1
  5. package/build/lib/native/components/FloatingActionButton/FloatingActionButton.js +1 -1
  6. package/build/lib/native/components/FloatingActionButton/FloatingActionButton.js.map +1 -1
  7. package/build/lib/native/components/Input/ColorInput/ColorSwatch.native.js +2 -1
  8. package/build/lib/native/components/Input/ColorInput/ColorSwatch.native.js.map +1 -1
  9. package/build/lib/native/components/Input/OTPInput/OTPInput.js.map +1 -1
  10. package/build/lib/native/components/Spinner/BaseSpinner/BaseSpinner.js +1 -1
  11. package/build/lib/native/components/Spinner/BaseSpinner/BaseSpinner.js.map +1 -1
  12. package/build/lib/native/components/Spinner/Spinner/Spinner.js.map +1 -1
  13. package/build/lib/web/development/_virtual/flatten.js +1 -1
  14. package/build/lib/web/development/_virtual/flatten3.js +1 -1
  15. package/build/lib/web/development/components/Button/BaseButton/BaseButton.js +23 -31
  16. package/build/lib/web/development/components/Button/BaseButton/BaseButton.js.map +1 -1
  17. package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js +8 -18
  18. package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js.map +1 -1
  19. package/build/lib/web/development/components/FloatingActionButton/FloatingActionButton.js +1 -1
  20. package/build/lib/web/development/components/FloatingActionButton/FloatingActionButton.js.map +1 -1
  21. package/build/lib/web/development/components/Input/ColorInput/ColorInput.web.js +1 -0
  22. package/build/lib/web/development/components/Input/ColorInput/ColorInput.web.js.map +1 -1
  23. package/build/lib/web/development/components/Input/ColorInput/ColorSwatch.web.js +18 -5
  24. package/build/lib/web/development/components/Input/ColorInput/ColorSwatch.web.js.map +1 -1
  25. package/build/lib/web/development/components/Input/ColorInput/StyledColorInput.js +6 -3
  26. package/build/lib/web/development/components/Input/ColorInput/StyledColorInput.js.map +1 -1
  27. package/build/lib/web/development/components/Input/OTPInput/OTPInput.js.map +1 -1
  28. package/build/lib/web/development/components/Spinner/BaseSpinner/BaseSpinner.js +5 -0
  29. package/build/lib/web/development/components/Spinner/BaseSpinner/BaseSpinner.js.map +1 -1
  30. package/build/lib/web/development/components/Spinner/Spinner/Spinner.js.map +1 -1
  31. package/build/lib/web/development/node_modules/es-toolkit/dist/array/flatten.js +1 -1
  32. package/build/lib/web/development/node_modules/es-toolkit/dist/compat/array/flatten.js +1 -1
  33. package/build/lib/web/development/node_modules/es-toolkit/dist/compat/array/sortBy.js +2 -2
  34. package/build/lib/web/development/node_modules/es-toolkit/dist/compat/object/omit.js +2 -2
  35. package/build/lib/web/production/_virtual/cloneDeep.js +1 -1
  36. package/build/lib/web/production/_virtual/cloneDeep3.js +1 -1
  37. package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +23 -31
  38. package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
  39. package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js +8 -18
  40. package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js.map +1 -1
  41. package/build/lib/web/production/components/FloatingActionButton/FloatingActionButton.js +1 -1
  42. package/build/lib/web/production/components/FloatingActionButton/FloatingActionButton.js.map +1 -1
  43. package/build/lib/web/production/components/Input/ColorInput/ColorInput.web.js +1 -0
  44. package/build/lib/web/production/components/Input/ColorInput/ColorInput.web.js.map +1 -1
  45. package/build/lib/web/production/components/Input/ColorInput/ColorSwatch.web.js +18 -5
  46. package/build/lib/web/production/components/Input/ColorInput/ColorSwatch.web.js.map +1 -1
  47. package/build/lib/web/production/components/Input/ColorInput/StyledColorInput.js +6 -3
  48. package/build/lib/web/production/components/Input/ColorInput/StyledColorInput.js.map +1 -1
  49. package/build/lib/web/production/components/Input/OTPInput/OTPInput.js.map +1 -1
  50. package/build/lib/web/production/components/Spinner/BaseSpinner/BaseSpinner.js +5 -0
  51. package/build/lib/web/production/components/Spinner/BaseSpinner/BaseSpinner.js.map +1 -1
  52. package/build/lib/web/production/components/Spinner/Spinner/Spinner.js.map +1 -1
  53. package/build/lib/web/production/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +1 -1
  54. package/build/lib/web/production/node_modules/es-toolkit/dist/compat/predicate/matches.js +2 -2
  55. package/build/lib/web/production/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js +2 -2
  56. package/build/lib/web/production/node_modules/es-toolkit/dist/object/cloneDeep.js +1 -1
  57. package/build/types/components/index.d.ts +7 -12
  58. package/build/types/components/index.native.d.ts +7 -12
  59. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"buttonTokens.js","sources":["../../../../../../src/components/Button/BaseButton/buttonTokens.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport type { BaseButtonProps } from './BaseButton';\nimport type { Theme } from '~components/BladeProvider';\nimport type { IconSize } from '~components/Icons';\nimport type { SpinnerProps } from '~components/Spinner';\nimport type { Size } from '~tokens/global';\nimport { size } from '~tokens/global';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport { makeSize } from '~utils';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\n\nexport type ButtonMinHeight = Size[28] | Size[32] | Size[36] | Size[48];\n\nexport type ButtonTypography = {\n fonts: {\n size: Record<NonNullable<BaseButtonProps['size']>, keyof Theme['typography']['fonts']['size']>;\n };\n lineHeights: Record<\n NonNullable<BaseButtonProps['size']>,\n keyof Theme['typography']['lineHeights']\n >;\n};\n\nconst backgroundGradient = (color: FeedbackColors | 'primary') => {\n return {\n base: {\n primary: {\n default: `interactive.background.${color}.default`,\n highlighted: `interactive.background.${color}.highlighted`,\n disabled: `interactive.background.${color}.disabled`,\n },\n secondary: {\n default: 'surface.background.gray.intense',\n highlighted: 'surface.background.gray.intense',\n disabled: 'interactive.background.staticWhite.ghost',\n },\n tertiary: {\n default: 'surface.background.gray.intense',\n highlighted: 'surface.background.gray.intense',\n disabled: 'interactive.background.staticWhite.ghost',\n },\n transparent: {\n default: 'transparent',\n highlighted: 'interactive.background.gray.faded',\n disabled: 'interactive.background.gray.disabled',\n },\n },\n white: {\n primary: {\n default: 'interactive.background.staticWhite.default',\n highlighted: 'interactive.background.staticWhite.highlighted',\n disabled: 'interactive.background.staticWhite.disabled',\n },\n secondary: {\n default: 'interactive.background.staticWhite.faded',\n highlighted: 'interactive.background.staticBlack.faded',\n disabled: 'interactive.background.gray.disabled',\n },\n tertiary: {\n default: 'interactive.background.staticWhite.faded',\n highlighted: 'interactive.background.staticBlack.faded',\n disabled: 'interactive.background.gray.disabled',\n },\n },\n // Only the `primary` emphasis exists in the design for the black color, which\n // is currently used by FloatingActionButton and is not exposed on `Button`.\n black: {\n primary: {\n default: 'interactive.background.staticBlack.default',\n highlighted: 'interactive.background.staticBlack.highlighted',\n disabled: 'interactive.background.staticBlack.fadedHighlighted',\n },\n },\n } as const;\n};\n\ntype BoxShadowValue = {\n y: number;\n blur: number;\n spread: number;\n color: DotNotationToken<Theme['colors']>;\n};\n\ntype ButtonBoxShadow = BoxShadowValue[];\n\n/**\n * Box-shadow tokens for buttons (includes border + 3D effects)\n * Each shadow is: inset 0 {y}px {blur}px {spread}px {color}\n */\nconst boxShadow = (\n color: FeedbackColors | 'primary',\n): {\n base: Record<\n 'primary' | 'secondary' | 'tertiary' | 'transparent',\n Record<'default' | 'highlighted' | 'disabled', ButtonBoxShadow>\n >;\n white: Record<\n 'primary' | 'secondary' | 'tertiary',\n Record<'default' | 'highlighted' | 'disabled', ButtonBoxShadow>\n >;\n black: Record<'primary', Record<'default' | 'highlighted' | 'disabled', ButtonBoxShadow>>;\n} => {\n return {\n base: {\n primary: {\n default: [\n { y: -1.5, blur: 0, spread: 0, color: `interactive.border.${color}.highlighted` },\n { y: 0, blur: 0, spread: 0.5, color: `interactive.border.${color}.default` },\n { y: 1.5, blur: 0, spread: 0, color: 'interactive.border.staticWhite.faded' },\n { y: -2, blur: 0, spread: 0, color: 'interactive.border.staticWhite.faded' },\n ],\n highlighted: [\n { y: -1.5, blur: 0, spread: 0, color: `interactive.border.${color}.highlighted` },\n { y: 0, blur: 0, spread: 0.5, color: `interactive.border.${color}.highlighted` },\n { y: 1.5, blur: 0, spread: 0, color: 'interactive.border.staticWhite.faded' },\n { y: -2, blur: 0, spread: 0, color: 'interactive.border.staticWhite.faded' },\n ],\n disabled: [],\n },\n secondary: {\n default: [\n { y: -1, blur: 0.5, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.default' },\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.gray.default' },\n ],\n highlighted: [\n { y: -1, blur: 0.5, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.highlighted' },\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.gray.default' },\n ],\n disabled: [{ y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.disabled' }],\n },\n tertiary: {\n default: [\n { y: -1, blur: 0.5, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.default' },\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.gray.default' },\n ],\n highlighted: [\n { y: -1, blur: 0.5, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.highlighted' },\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.gray.default' },\n ],\n disabled: [{ y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.disabled' }],\n },\n transparent: {\n default: [],\n highlighted: [],\n disabled: [],\n },\n },\n white: {\n primary: {\n default: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n {\n y: 0,\n blur: 0,\n spread: 0.5,\n color: 'interactive.border.staticBlack.fadedHighlighted',\n },\n ],\n highlighted: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n {\n y: 0,\n blur: 0,\n spread: 0.5,\n color: 'interactive.border.staticBlack.fadedHighlighted',\n },\n ],\n disabled: [],\n },\n secondary: {\n default: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.highlighted' },\n ],\n highlighted: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.highlighted' },\n ],\n disabled: [{ y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.disabled' }],\n },\n tertiary: {\n default: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.highlighted' },\n ],\n highlighted: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.highlighted' },\n ],\n disabled: [{ y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.disabled' }],\n },\n },\n black: {\n primary: {\n default: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.highlighted' },\n { y: 0, blur: 0, spread: 0.5, color: 'interactive.border.staticBlack.highlighted' },\n { y: 1.5, blur: 0, spread: 0, color: 'interactive.border.staticWhite.fadedHighlighted' },\n { y: -2, blur: 0, spread: 0, color: 'interactive.border.staticWhite.fadedHighlighted' },\n ],\n highlighted: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.highlighted' },\n { y: 0, blur: 0, spread: 0.5, color: 'interactive.border.staticBlack.highlighted' },\n { y: 1.5, blur: 0, spread: 0, color: 'interactive.border.staticWhite.fadedHighlighted' },\n { y: -2, blur: 0, spread: 0, color: 'interactive.border.staticWhite.fadedHighlighted' },\n ],\n disabled: [],\n },\n },\n };\n};\n\nconst textColor = (property: 'icon' | 'text') => {\n return {\n base: {\n primary: {\n default: `interactive.${property}.onPrimary.normal`,\n highlighted: `interactive.${property}.onPrimary.normal`,\n disabled: `interactive.${property}.primary.disabled`,\n },\n secondary: {\n default: `interactive.${property}.gray.normal`,\n highlighted: `interactive.${property}.gray.normal`,\n disabled: `interactive.${property}.gray.disabled`,\n },\n tertiary: {\n default: `interactive.${property}.gray.normal`,\n highlighted: `interactive.${property}.gray.normal`,\n disabled: `interactive.${property}.gray.disabled`,\n },\n },\n white: {\n primary: {\n default: `interactive.${property}.staticBlack.muted`,\n highlighted: `interactive.${property}.staticBlack.muted`,\n disabled: `interactive.${property}.staticBlack.disabled`,\n },\n secondary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.staticWhite.disabled`,\n },\n tertiary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.staticWhite.disabled`,\n },\n },\n black: {\n primary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.staticWhite.disabled`,\n },\n },\n transparent: {\n tertiary: {\n default: property === 'icon' ? 'interactive.icon.gray.muted' : 'surface.text.gray.normal',\n highlighted:\n property === 'icon' ? 'interactive.icon.gray.subtle' : 'surface.text.gray.normal',\n disabled: `interactive.${property}.gray.disabled`,\n },\n },\n\n color: (color: FeedbackColors) => {\n return {\n primary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.${color}.disabled`,\n },\n secondary: {\n default: `interactive.${property}.${color}.normal`,\n highlighted: `interactive.${property}.${color}.normal`,\n disabled: `interactive.${property}.${color}.disabled`,\n },\n } as const;\n },\n } as const;\n};\n\nconst typography: ButtonTypography = {\n fonts: {\n size: {\n xsmall: 75,\n small: 75,\n medium: 100,\n large: 200,\n },\n },\n lineHeights: {\n xsmall: 75,\n small: 75,\n medium: 100,\n large: 200,\n },\n};\n\nconst minHeight: Record<NonNullable<BaseButtonProps['size']>, ButtonMinHeight> = {\n xsmall: size[28],\n small: size[32],\n medium: size[36],\n large: size[48],\n};\n\nconst buttonPadding: Record<\n NonNullable<BaseButtonProps['size']>,\n Record<'top' | 'bottom' | 'left' | 'right', keyof Theme['spacing']>\n> = {\n xsmall: {\n top: 0,\n bottom: 0,\n left: 3,\n right: 3,\n },\n small: {\n top: 0,\n bottom: 0,\n left: 3,\n right: 3,\n },\n medium: {\n top: 0,\n bottom: 0,\n left: 4,\n right: 4,\n },\n large: {\n top: 0,\n bottom: 0,\n left: 5,\n right: 5,\n },\n};\n\nconst buttonBorderRadius = {\n xsmall: 'small',\n small: 'small',\n medium: 'small',\n large: 'medium',\n} as const;\n\nconst buttonIconOnlyHeightWidth = {\n xsmall: makeSize(size['28']),\n small: makeSize(size['32']),\n medium: makeSize(size['36']),\n large: makeSize(size['48']),\n} as const;\n\nconst buttonSizeToIconSizeMap: Record<NonNullable<BaseButtonProps['size']>, IconSize> = {\n xsmall: 'small',\n small: 'small',\n medium: 'medium',\n large: 'medium',\n};\n\nconst buttonIconOnlySizeToIconSizeMap: Record<NonNullable<BaseButtonProps['size']>, IconSize> = {\n xsmall: 'medium',\n small: 'medium',\n medium: 'medium',\n large: 'medium',\n};\n\nconst buttonSizeToSpinnerSizeMap: Record<\n NonNullable<BaseButtonProps['size']>,\n SpinnerProps['size']\n> = {\n xsmall: 'medium',\n small: 'medium',\n medium: 'medium',\n large: 'large',\n};\n\n/**\n * Spinner color mapping based on button variant and color\n */\nconst spinnerColor = {\n base: {\n primary: 'primary',\n secondary: 'neutral',\n tertiary: 'neutral',\n transparent: 'primary',\n },\n white: {\n primary: 'white',\n secondary: 'white',\n tertiary: 'white',\n },\n black: {\n primary: 'white',\n },\n positive: {\n primary: 'positive',\n secondary: 'positive',\n },\n negative: {\n primary: 'negative',\n secondary: 'negative',\n },\n notice: {\n primary: 'notice',\n secondary: 'notice',\n },\n information: {\n primary: 'information',\n secondary: 'information',\n },\n neutral: {\n primary: 'neutral',\n secondary: 'neutral',\n },\n} as const;\n\nexport {\n boxShadow,\n backgroundGradient,\n textColor,\n spinnerColor,\n typography,\n minHeight,\n buttonSizeToIconSizeMap,\n buttonIconOnlySizeToIconSizeMap,\n buttonSizeToSpinnerSizeMap,\n buttonPadding,\n buttonIconOnlyHeightWidth,\n buttonBorderRadius,\n};\n\nexport type { ButtonBoxShadow };\n"],"names":["backgroundGradient","color","base","primary","default","highlighted","disabled","secondary","tertiary","transparent","white","black","boxShadow","y","blur","spread","textColor","property","typography","fonts","size","xsmall","small","medium","large","lineHeights","minHeight","buttonPadding","top","bottom","left","right","buttonBorderRadius","buttonIconOnlyHeightWidth","makeSize","buttonSizeToIconSizeMap","buttonIconOnlySizeToIconSizeMap","buttonSizeToSpinnerSizeMap","spinnerColor","positive","negative","notice","information","neutral"],"mappings":";;;;;AAuBM,IAAAA,kBAAkB,CAAG,SAArBA,kBAAkBA,CAAIC,KAAiC,CAAK,CAChE,OAAO,CACLC,IAAI,CAAE,CACJC,OAAO,CAAE,CACPC,OAAO,CAAE,CAAA,uBAAA,EAA0BH,KAAK,CAAU,QAAA,CAAA,CAClDI,WAAW,CAAE,CAA0BJ,uBAAAA,EAAAA,KAAK,cAAc,CAC1DK,QAAQ,CAAE,CAAA,uBAAA,EAA0BL,KAAK,CAAA,SAAA,CAC3C,CAAC,CACDM,SAAS,CAAE,CACTH,OAAO,CAAE,iCAAiC,CAC1CC,WAAW,CAAE,iCAAiC,CAC9CC,QAAQ,CAAE,0CACZ,CAAC,CACDE,QAAQ,CAAE,CACRJ,OAAO,CAAE,iCAAiC,CAC1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AAE,QAAQ,CAChBC,KAAK,CAAE,QACT,EAEM,IAAAa,0BAGL,CAAG,CACFhB,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,QAAQ,CACfC,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,OACT,EAKM,IAAAc,YAAY,CAAG,CACnBpC,IAAI,CAAE,CACJC,OAAO,CAAE,SAAS,CAClBI,SAAS,CAAE,SAAS,CACpBC,QAAQ,CAAE,SAAS,CACnBC,WAAW,CAAE,SACf,CAAC,CACDC,KAAK,CAAE,CACLP,OAAO,CAAE,OAAO,CAChBI,SAAS,CAAE,OAAO,CAClBC,QAAQ,CAAE,OACZ,CAAC,CACDG,KAAK,CAAE,CACLR,OAAO,CAAE,OACX,CAAC,CACDoC,QAAQ,CAAE,CACRpC,OAAO,CAAE,UAAU,CACnBI,SAAS,CAAE,UACb,CAAC,CACDiC,QAAQ,CAAE,CACRrC,OAAO,CAAE,UAAU,CACnBI,SAAS,CAAE,UACb,CAAC,CACDkC,MAAM,CAAE,CACNtC,OAAO,CAAE,QAAQ,CACjBI,SAAS,CAAE,QACb,CAAC,CACDmC,WAAW,CAAE,CACXvC,OAAO,CAAE,aAAa,CACtBI,SAAS,CAAE,aACb,CAAC,CACDoC,OAAO,CAAE,CACPxC,OAAO,CAAE,SAAS,CAClBI,SAAS,CAAE,SACb,CACF;;;;"}
1
+ {"version":3,"file":"buttonTokens.js","sources":["../../../../../../src/components/Button/BaseButton/buttonTokens.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport type { BaseButtonProps } from './BaseButton';\nimport type { Theme } from '~components/BladeProvider';\nimport type { IconSize } from '~components/Icons';\nimport type { SpinnerProps } from '~components/Spinner';\nimport type { Size } from '~tokens/global';\nimport { size } from '~tokens/global';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport { makeSize } from '~utils';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\n\nexport type ButtonMinHeight = Size[28] | Size[32] | Size[36] | Size[48];\n\nexport type ButtonTypography = {\n fonts: {\n size: Record<NonNullable<BaseButtonProps['size']>, keyof Theme['typography']['fonts']['size']>;\n };\n lineHeights: Record<\n NonNullable<BaseButtonProps['size']>,\n keyof Theme['typography']['lineHeights']\n >;\n};\n\nconst backgroundGradient = (color: FeedbackColors | 'primary') => {\n return {\n base: {\n primary: {\n default: `interactive.background.${color}.default`,\n highlighted: `interactive.background.${color}.highlighted`,\n disabled: `interactive.background.${color}.disabled`,\n },\n secondary: {\n default: 'surface.background.gray.intense',\n highlighted: 'surface.background.gray.intense',\n disabled: 'interactive.background.staticWhite.ghost',\n },\n tertiary: {\n default: 'surface.background.gray.intense',\n highlighted: 'surface.background.gray.intense',\n disabled: 'interactive.background.staticWhite.ghost',\n },\n transparent: {\n default: 'transparent',\n highlighted: 'interactive.background.gray.faded',\n disabled: 'interactive.background.gray.disabled',\n },\n },\n white: {\n primary: {\n default: 'interactive.background.staticWhite.default',\n highlighted: 'interactive.background.staticWhite.highlighted',\n disabled: 'interactive.background.staticWhite.disabled',\n },\n secondary: {\n default: 'interactive.background.staticWhite.faded',\n highlighted: 'interactive.background.staticBlack.faded',\n disabled: 'interactive.background.gray.disabled',\n },\n tertiary: {\n default: 'interactive.background.staticWhite.faded',\n highlighted: 'interactive.background.staticBlack.faded',\n disabled: 'interactive.background.gray.disabled',\n },\n },\n } as const;\n};\n\ntype BoxShadowValue = {\n y: number;\n blur: number;\n spread: number;\n color: DotNotationToken<Theme['colors']>;\n};\n\ntype ButtonBoxShadow = BoxShadowValue[];\n\n/**\n * Box-shadow tokens for buttons (includes border + 3D effects)\n * Each shadow is: inset 0 {y}px {blur}px {spread}px {color}\n */\nconst boxShadow = (\n color: FeedbackColors | 'primary',\n): {\n base: Record<\n 'primary' | 'secondary' | 'tertiary' | 'transparent',\n Record<'default' | 'highlighted' | 'disabled', ButtonBoxShadow>\n >;\n white: Record<\n 'primary' | 'secondary' | 'tertiary',\n Record<'default' | 'highlighted' | 'disabled', ButtonBoxShadow>\n >;\n neutral: Record<'primary', Record<'default' | 'highlighted' | 'disabled', ButtonBoxShadow>>;\n} => {\n return {\n base: {\n primary: {\n default: [\n { y: -1.5, blur: 0, spread: 0, color: `interactive.border.${color}.highlighted` },\n { y: 0, blur: 0, spread: 0.5, color: `interactive.border.${color}.default` },\n { y: 1.5, blur: 0, spread: 0, color: 'interactive.border.staticWhite.faded' },\n { y: -2, blur: 0, spread: 0, color: 'interactive.border.staticWhite.faded' },\n ],\n highlighted: [\n { y: -1.5, blur: 0, spread: 0, color: `interactive.border.${color}.highlighted` },\n { y: 0, blur: 0, spread: 0.5, color: `interactive.border.${color}.highlighted` },\n { y: 1.5, blur: 0, spread: 0, color: 'interactive.border.staticWhite.faded' },\n { y: -2, blur: 0, spread: 0, color: 'interactive.border.staticWhite.faded' },\n ],\n disabled: [],\n },\n secondary: {\n default: [\n { y: -1, blur: 0.5, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.default' },\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.gray.default' },\n ],\n highlighted: [\n { y: -1, blur: 0.5, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.highlighted' },\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.gray.default' },\n ],\n disabled: [{ y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.disabled' }],\n },\n tertiary: {\n default: [\n { y: -1, blur: 0.5, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.default' },\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.gray.default' },\n ],\n highlighted: [\n { y: -1, blur: 0.5, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.highlighted' },\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.gray.default' },\n ],\n disabled: [{ y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.disabled' }],\n },\n transparent: {\n default: [],\n highlighted: [],\n disabled: [],\n },\n },\n white: {\n primary: {\n default: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n {\n y: 0,\n blur: 0,\n spread: 0.5,\n color: 'interactive.border.staticBlack.fadedHighlighted',\n },\n ],\n highlighted: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n {\n y: 0,\n blur: 0,\n spread: 0.5,\n color: 'interactive.border.staticBlack.fadedHighlighted',\n },\n ],\n disabled: [],\n },\n secondary: {\n default: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.highlighted' },\n ],\n highlighted: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.highlighted' },\n ],\n disabled: [{ y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.disabled' }],\n },\n tertiary: {\n default: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.highlighted' },\n ],\n highlighted: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.highlighted' },\n ],\n disabled: [{ y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.disabled' }],\n },\n },\n neutral: {\n primary: {\n default: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.highlighted' },\n { y: 0, blur: 0, spread: 0.5, color: 'interactive.border.staticBlack.highlighted' },\n { y: 1.5, blur: 0, spread: 0, color: 'interactive.border.staticWhite.fadedHighlighted' },\n { y: -2, blur: 0, spread: 0, color: 'interactive.border.staticWhite.fadedHighlighted' },\n ],\n highlighted: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.highlighted' },\n { y: 0, blur: 0, spread: 0.5, color: 'interactive.border.staticBlack.highlighted' },\n { y: 1.5, blur: 0, spread: 0, color: 'interactive.border.staticWhite.fadedHighlighted' },\n { y: -2, blur: 0, spread: 0, color: 'interactive.border.staticWhite.fadedHighlighted' },\n ],\n disabled: [],\n },\n },\n };\n};\n\nconst textColor = (property: 'icon' | 'text') => {\n return {\n base: {\n primary: {\n default: `interactive.${property}.onPrimary.normal`,\n highlighted: `interactive.${property}.onPrimary.normal`,\n disabled: `interactive.${property}.primary.disabled`,\n },\n secondary: {\n default: `interactive.${property}.gray.normal`,\n highlighted: `interactive.${property}.gray.normal`,\n disabled: `interactive.${property}.gray.disabled`,\n },\n tertiary: {\n default: `interactive.${property}.gray.normal`,\n highlighted: `interactive.${property}.gray.normal`,\n disabled: `interactive.${property}.gray.disabled`,\n },\n },\n white: {\n primary: {\n default: `interactive.${property}.staticBlack.muted`,\n highlighted: `interactive.${property}.staticBlack.muted`,\n disabled: `interactive.${property}.staticBlack.disabled`,\n },\n secondary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.staticWhite.disabled`,\n },\n tertiary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.staticWhite.disabled`,\n },\n },\n neutral: {\n primary: {\n default: `interactive.${property}.onNeutral.normal`,\n highlighted: `interactive.${property}.onNeutral.normal`,\n disabled: `interactive.${property}.onNeutral.disabled`,\n },\n },\n transparent: {\n tertiary: {\n default: property === 'icon' ? 'interactive.icon.gray.muted' : 'surface.text.gray.normal',\n highlighted:\n property === 'icon' ? 'interactive.icon.gray.subtle' : 'surface.text.gray.normal',\n disabled: `interactive.${property}.gray.disabled`,\n },\n },\n\n color: (color: FeedbackColors) => {\n return {\n primary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.${color}.disabled`,\n },\n secondary: {\n default: `interactive.${property}.${color}.normal`,\n highlighted: `interactive.${property}.${color}.normal`,\n disabled: `interactive.${property}.${color}.disabled`,\n },\n } as const;\n },\n } as const;\n};\n\nconst typography: ButtonTypography = {\n fonts: {\n size: {\n xsmall: 75,\n small: 75,\n medium: 100,\n large: 200,\n },\n },\n lineHeights: {\n xsmall: 75,\n small: 75,\n medium: 100,\n large: 200,\n },\n};\n\nconst minHeight: Record<NonNullable<BaseButtonProps['size']>, ButtonMinHeight> = {\n xsmall: size[28],\n small: size[32],\n medium: size[36],\n large: size[48],\n};\n\nconst buttonPadding: Record<\n NonNullable<BaseButtonProps['size']>,\n Record<'top' | 'bottom' | 'left' | 'right', keyof Theme['spacing']>\n> = {\n xsmall: {\n top: 0,\n bottom: 0,\n left: 3,\n right: 3,\n },\n small: {\n top: 0,\n bottom: 0,\n left: 3,\n right: 3,\n },\n medium: {\n top: 0,\n bottom: 0,\n left: 4,\n right: 4,\n },\n large: {\n top: 0,\n bottom: 0,\n left: 5,\n right: 5,\n },\n};\n\nconst buttonBorderRadius = {\n xsmall: 'small',\n small: 'small',\n medium: 'small',\n large: 'medium',\n} as const;\n\nconst buttonIconOnlyHeightWidth = {\n xsmall: makeSize(size['28']),\n small: makeSize(size['32']),\n medium: makeSize(size['36']),\n large: makeSize(size['48']),\n} as const;\n\nconst buttonSizeToIconSizeMap: Record<NonNullable<BaseButtonProps['size']>, IconSize> = {\n xsmall: 'small',\n small: 'small',\n medium: 'medium',\n large: 'medium',\n};\n\nconst buttonIconOnlySizeToIconSizeMap: Record<NonNullable<BaseButtonProps['size']>, IconSize> = {\n xsmall: 'medium',\n small: 'medium',\n medium: 'medium',\n large: 'medium',\n};\n\nconst buttonSizeToSpinnerSizeMap: Record<\n NonNullable<BaseButtonProps['size']>,\n SpinnerProps['size']\n> = {\n xsmall: 'medium',\n small: 'medium',\n medium: 'medium',\n large: 'large',\n};\n\n/**\n * Spinner color mapping based on button variant and color\n */\nconst spinnerColor = {\n base: {\n primary: 'primary',\n secondary: 'neutral',\n tertiary: 'neutral',\n transparent: 'primary',\n },\n white: {\n primary: 'white',\n secondary: 'white',\n tertiary: 'white',\n },\n positive: {\n primary: 'positive',\n secondary: 'positive',\n },\n negative: {\n primary: 'negative',\n secondary: 'negative',\n },\n notice: {\n primary: 'notice',\n secondary: 'notice',\n },\n information: {\n primary: 'information',\n secondary: 'information',\n },\n neutral: {\n // The primary emphasis renders content on a filled neutral surface, so the\n // spinner follows the same inverted treatment as the label.\n primary: 'onNeutral',\n secondary: 'neutral',\n },\n} as const;\n\nexport {\n boxShadow,\n backgroundGradient,\n textColor,\n spinnerColor,\n typography,\n minHeight,\n buttonSizeToIconSizeMap,\n buttonIconOnlySizeToIconSizeMap,\n buttonSizeToSpinnerSizeMap,\n buttonPadding,\n buttonIconOnlyHeightWidth,\n buttonBorderRadius,\n};\n\nexport type { ButtonBoxShadow };\n"],"names":["backgroundGradient","color","base","primary","default","highlighted","disabled","secondary","tertiary","transparent","white","boxShadow","y","blur","spread","neutral","textColor","property","typography","fonts","size","xsmall","small","medium","large","lineHeights","minHeight","buttonPadding","top","bottom","left","right","buttonBorderRadius","buttonIconOnlyHeightWidth","makeSize","buttonSizeToIconSizeMap","buttonIconOnlySizeToIconSizeMap","buttonSizeToSpinnerSizeMap","spinnerColor","positive","negative","notice","information"],"mappings":";;;;;AAuBM,IAAAA,kBAAkB,CAAG,SAArBA,kBAAkBA,CAAIC,KAAiC,CAAK,CAChE,OAAO,CACLC,IAAI,CAAE,CACJC,OAAO,CAAE,CACPC,OAAO,CAAE,0BAA0BH,KAAK,CAAA,QAAA,CAAU,CAClDI,WAAW,CAAE,CAAA,uBAAA,EAA0BJ,KAAK,CAAc,YAAA,CAAA,CAC1DK,QAAQ,CAAE,CAA0BL,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AG,CAC9Ff,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,QAAQ,CACfC,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,QACT,EAEM,IAAAa,0BAGL,CAAG,CACFhB,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,QAAQ,CACfC,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,OACT,EAKM,IAAAc,YAAY,CAAG,CACnBpC,IAAI,CAAE,CACJC,OAAO,CAAE,SAAS,CAClBI,SAAS,CAAE,SAAS,CACpBC,QAAQ,CAAE,SAAS,CACnBC,WAAW,CAAE,SACf,CAAC,CACDC,KAAK,CAAE,CACLP,OAAO,CAAE,OAAO,CAChBI,SAAS,CAAE,OAAO,CAClBC,QAAQ,CAAE,OACZ,CAAC,CACD+B,QAAQ,CAAE,CACRpC,OAAO,CAAE,UAAU,CACnBI,SAAS,CAAE,UACb,CAAC,CACDiC,QAAQ,CAAE,CACRrC,OAAO,CAAE,UAAU,CACnBI,SAAS,CAAE,UACb,CAAC,CACDkC,MAAM,CAAE,CACNtC,OAAO,CAAE,QAAQ,CACjBI,SAAS,CAAE,QACb,CAAC,CACDmC,WAAW,CAAE,CACXvC,OAAO,CAAE,aAAa,CACtBI,SAAS,CAAE,aACb,CAAC,CACDQ,OAAO,CAAE,CAGPZ,OAAO,CAAE,WAAW,CACpBI,SAAS,CAAE,SACb,CACF;;;;"}
@@ -8,7 +8,7 @@ import { jsx } from 'react/jsx-runtime';
8
8
  import BaseButton from '../Button/BaseButton/BaseButton.js';
9
9
  import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
10
10
 
11
- var _excluded=["children","icon","color","placement","offset","zIndex","isDisabled","isLoading","href","target","rel","type","accessibilityLabel","onClick","onBlur","onFocus","onMouseLeave","onMouseMove","onMouseDown","onPointerDown","onPointerEnter","onTouchStart","onTouchEnd","testID"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/FloatingActionButton/FloatingActionButton.tsx";var colorToSpinnerColor={primary:'white',black:'white',white:'neutral'};var _FloatingActionButton=function _FloatingActionButton(_ref,ref){var children=_ref.children,icon=_ref.icon,_ref$color=_ref.color,color=_ref$color===void 0?'primary':_ref$color,_ref$placement=_ref.placement,placement=_ref$placement===void 0?'bottom-end':_ref$placement,_ref$offset=_ref.offset,offset=_ref$offset===void 0?'spacing.5':_ref$offset,_ref$zIndex=_ref.zIndex,zIndex=_ref$zIndex===void 0?componentZIndices.fab:_ref$zIndex,_ref$isDisabled=_ref.isDisabled,isDisabled=_ref$isDisabled===void 0?false:_ref$isDisabled,_ref$isLoading=_ref.isLoading,isLoading=_ref$isLoading===void 0?false:_ref$isLoading,href=_ref.href,target=_ref.target,rel=_ref.rel,_ref$type=_ref.type,type=_ref$type===void 0?'button':_ref$type,accessibilityLabel=_ref.accessibilityLabel,onClick=_ref.onClick,onBlur=_ref.onBlur,onFocus=_ref.onFocus,onMouseLeave=_ref.onMouseLeave,onMouseMove=_ref.onMouseMove,onMouseDown=_ref.onMouseDown,onPointerDown=_ref.onPointerDown,onPointerEnter=_ref.onPointerEnter,onTouchStart=_ref.onTouchStart,onTouchEnd=_ref.onTouchEnd,testID=_ref.testID,rest=_objectWithoutProperties(_ref,_excluded);return jsx(FloatingActionButtonContainer,Object.assign({placement:placement,offset:offset,zIndex:zIndex,testID:testID},rest,{children:jsx(BaseButton,{ref:ref,icon:icon,variant:"primary",color:color,size:"large",_borderRadius:"max",_iconSize:"xlarge",_spinnerColor:colorToSpinnerColor[color],accessibilityProps:{label:accessibilityLabel},href:href,target:target,rel:rel,type:type,isDisabled:isDisabled,isLoading:isLoading,onClick:onClick,onBlur:onBlur,onFocus:onFocus,onMouseLeave:onMouseLeave,onMouseMove:onMouseMove,onMouseDown:onMouseDown,onPointerDown:onPointerDown,onPointerEnter:onPointerEnter,onTouchStart:onTouchStart,onTouchEnd:onTouchEnd,children:children})}));};var FloatingActionButton=assignWithoutSideEffects(React__default.forwardRef(_FloatingActionButton),{displayName:'FloatingActionButton',componentId:'FloatingActionButton'});
11
+ var _excluded=["children","icon","color","placement","offset","zIndex","isDisabled","isLoading","href","target","rel","type","accessibilityLabel","onClick","onBlur","onFocus","onMouseLeave","onMouseMove","onMouseDown","onPointerDown","onPointerEnter","onTouchStart","onTouchEnd","testID"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/FloatingActionButton/FloatingActionButton.tsx";var colorToSpinnerColor={primary:'white',neutral:'onNeutral',white:'neutral'};var _FloatingActionButton=function _FloatingActionButton(_ref,ref){var children=_ref.children,icon=_ref.icon,_ref$color=_ref.color,color=_ref$color===void 0?'primary':_ref$color,_ref$placement=_ref.placement,placement=_ref$placement===void 0?'bottom-end':_ref$placement,_ref$offset=_ref.offset,offset=_ref$offset===void 0?'spacing.5':_ref$offset,_ref$zIndex=_ref.zIndex,zIndex=_ref$zIndex===void 0?componentZIndices.fab:_ref$zIndex,_ref$isDisabled=_ref.isDisabled,isDisabled=_ref$isDisabled===void 0?false:_ref$isDisabled,_ref$isLoading=_ref.isLoading,isLoading=_ref$isLoading===void 0?false:_ref$isLoading,href=_ref.href,target=_ref.target,rel=_ref.rel,_ref$type=_ref.type,type=_ref$type===void 0?'button':_ref$type,accessibilityLabel=_ref.accessibilityLabel,onClick=_ref.onClick,onBlur=_ref.onBlur,onFocus=_ref.onFocus,onMouseLeave=_ref.onMouseLeave,onMouseMove=_ref.onMouseMove,onMouseDown=_ref.onMouseDown,onPointerDown=_ref.onPointerDown,onPointerEnter=_ref.onPointerEnter,onTouchStart=_ref.onTouchStart,onTouchEnd=_ref.onTouchEnd,testID=_ref.testID,rest=_objectWithoutProperties(_ref,_excluded);return jsx(FloatingActionButtonContainer,Object.assign({placement:placement,offset:offset,zIndex:zIndex,testID:testID},rest,{children:jsx(BaseButton,{ref:ref,icon:icon,variant:"primary",color:color,size:"large",_borderRadius:"max",_iconSize:"xlarge",_spinnerColor:colorToSpinnerColor[color],accessibilityProps:{label:accessibilityLabel},href:href,target:target,rel:rel,type:type,isDisabled:isDisabled,isLoading:isLoading,onClick:onClick,onBlur:onBlur,onFocus:onFocus,onMouseLeave:onMouseLeave,onMouseMove:onMouseMove,onMouseDown:onMouseDown,onPointerDown:onPointerDown,onPointerEnter:onPointerEnter,onTouchStart:onTouchStart,onTouchEnd:onTouchEnd,children:children})}));};var FloatingActionButton=assignWithoutSideEffects(React__default.forwardRef(_FloatingActionButton),{displayName:'FloatingActionButton',componentId:'FloatingActionButton'});
12
12
 
13
13
  export { FloatingActionButton };
14
14
  //# sourceMappingURL=FloatingActionButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FloatingActionButton.js","sources":["../../../../../src/components/FloatingActionButton/FloatingActionButton.tsx"],"sourcesContent":["import React from 'react';\nimport { FloatingActionButtonContainer } from './FloatingActionButtonContainer';\nimport type { FloatingActionButtonProps } from './types';\nimport BaseButton from '~components/Button/BaseButton';\nimport { componentZIndices } from '~utils/componentZIndices';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { BladeElementRef } from '~utils/types';\n\n/**\n * The shared spinner map would render a white spinner on the white button, where\n * it is invisible.\n */\nconst colorToSpinnerColor = {\n primary: 'white',\n black: 'white',\n white: 'neutral',\n} as const;\n\n/**\n * ### FloatingActionButton component\n *\n * A persistent, elevated button anchored to the bottom of the viewport, used for the single most important action on a screen.\n *\n * ---\n *\n * #### Usage\n *\n * ```jsx\n * <FloatingActionButton icon={PlusIcon} onClick={() => createPayment()}>\n * Create payment\n * </FloatingActionButton>\n *\n * // icon-only, accessibilityLabel is required\n * <FloatingActionButton\n * icon={PlusIcon}\n * accessibilityLabel=\"Create payment\"\n * onClick={() => createPayment()}\n * />\n * ```\n *\n * Checkout {@link https://blade.razorpay.com/?path=/docs/components-floatingactionbutton--docs FloatingActionButton Documentation}\n */\nconst _FloatingActionButton: React.ForwardRefRenderFunction<\n BladeElementRef,\n FloatingActionButtonProps\n> = (\n {\n children,\n icon,\n color = 'primary',\n placement = 'bottom-end',\n offset = 'spacing.5',\n zIndex = componentZIndices.fab,\n isDisabled = false,\n isLoading = false,\n href,\n target,\n rel,\n type = 'button',\n accessibilityLabel,\n onClick,\n onBlur,\n onFocus,\n onMouseLeave,\n onMouseMove,\n onMouseDown,\n onPointerDown,\n onPointerEnter,\n onTouchStart,\n onTouchEnd,\n testID,\n ...rest\n },\n ref,\n) => {\n return (\n <FloatingActionButtonContainer\n placement={placement}\n offset={offset}\n zIndex={zIndex}\n testID={testID}\n {...rest}\n >\n <BaseButton\n ref={ref}\n icon={icon}\n variant=\"primary\"\n color={color}\n size=\"large\"\n _borderRadius=\"max\"\n _iconSize=\"xlarge\"\n _spinnerColor={colorToSpinnerColor[color]}\n accessibilityProps={{ label: accessibilityLabel }}\n href={href}\n target={target}\n rel={rel}\n type={type}\n isDisabled={isDisabled}\n isLoading={isLoading}\n onClick={onClick}\n onBlur={onBlur}\n onFocus={onFocus}\n onMouseLeave={onMouseLeave}\n onMouseMove={onMouseMove}\n onMouseDown={onMouseDown}\n onPointerDown={onPointerDown}\n onPointerEnter={onPointerEnter}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n >\n {children}\n </BaseButton>\n </FloatingActionButtonContainer>\n );\n};\n\nconst FloatingActionButton = assignWithoutSideEffects(React.forwardRef(_FloatingActionButton), {\n displayName: 'FloatingActionButton',\n componentId: 'FloatingActionButton',\n});\n\nexport { FloatingActionButton };\n"],"names":["colorToSpinnerColor","primary","black","white","_FloatingActionButton","_ref","ref","children","icon","_ref$color","color","_ref$placement","placement","_ref$offset","offset","_ref$zIndex","zIndex","componentZIndices","fab","_ref$isDisabled","isDisabled","_ref$isLoading","isLoading","href","target","rel","_ref$type","type","accessibilityLabel","onClick","onBlur","onFocus","onMouseLeave","onMouseMove","onMouseDown","onPointerDown","onPointerEnter","onTouchStart","onTouchEnd","testID","rest","_objectWithoutProperties","_excluded","_jsx","FloatingActionButtonContainer","Object","assign","BaseButton","variant","size","_borderRadius","_iconSize","_spinnerColor","accessibilityProps","label","FloatingActionButton","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;8aAYA,IAAMA,mBAAmB,CAAG,CAC1BC,OAAO,CAAE,OAAO,CAChBC,KAAK,CAAE,OAAO,CACdC,KAAK,CAAE,SACT,CAAU,CA0BV,IAAMC,qBAGL,CAAG,SAHEA,qBAGLA,CAAAC,IAAA,CA4BCC,GAAG,CACA,KA3BDC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CACRC,IAAI,CAAAH,IAAA,CAAJG,IAAI,CAAAC,UAAA,CAAAJ,IAAA,CACJK,KAAK,CAALA,KAAK,CAAAD,UAAA,GAAA,KAAA,CAAA,CAAG,SAAS,CAAAA,UAAA,CAAAE,cAAA,CAAAN,IAAA,CACjBO,SAAS,CAATA,SAAS,CAAAD,cAAA,GAAA,KAAA,CAAA,CAAG,YAAY,CAAAA,cAAA,CAAAE,WAAA,CAAAR,IAAA,CACxBS,MAAM,CAANA,MAAM,CAAAD,WAAA,GAAA,KAAA,CAAA,CAAG,WAAW,CAAAA,WAAA,CAAAE,WAAA,CAAAV,IAAA,CACpBW,MAAM,CAANA,MAAM,CAAAD,WAAA,GAAGE,KAAAA,CAAAA,CAAAA,iBAAiB,CAACC,GAAG,CAAAH,WAAA,CAAAI,eAAA,CAAAd,IAAA,CAC9Be,UAAU,CAAVA,UAAU,CAAAD,eAAA,GAAG,KAAA,CAAA,CAAA,KAAK,CAAAA,eAAA,CAAAE,cAAA,CAAAhB,IAAA,CAClBiB,SAAS,CAATA,SAAS,CAAAD,cAAA,GAAG,KAAA,CAAA,CAAA,KAAK,CAAAA,cAAA,CACjBE,IAAI,CAAAlB,IAAA,CAAJkB,IAAI,CACJC,MAAM,CAAAnB,IAAA,CAANmB,MAAM,CACNC,GAAG,CAAApB,IAAA,CAAHoB,GAAG,CAAAC,SAAA,CAAArB,IAAA,CACHsB,IAAI,CAAJA,IAAI,CAAAD,SAAA,GAAA,K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P,UAAU,CAAEA,UAAW,CACvBE,SAAS,CAAEA,SAAU,CACrBO,OAAO,CAAEA,OAAQ,CACjBC,MAAM,CAAEA,MAAO,CACfC,OAAO,CAAEA,OAAQ,CACjBC,YAAY,CAAEA,YAAa,CAC3BC,WAAW,CAAEA,WAAY,CACzBC,WAAW,CAAEA,WAAY,CACzBC,aAAa,CAAEA,aAAc,CAC7BC,cAAc,CAAEA,cAAe,CAC/BC,YAAY,CAAEA,YAAa,CAC3BC,UAAU,CAAEA,UAAW,CAAA/B,QAAA,CAEtBA,QAAQ,CACC,CAAC,CACgB,CAAA,CAAC,CAEpC,CAAC,CAEK,IAAAgD,oBAAoB,CAAGC,wBAAwB,CAACC,cAAK,CAACC,UAAU,CAACtD,qBAAqB,CAAC,CAAE,CAC7FuD,WAAW,CAAE,sBAAsB,CACnCC,WAAW,CAAE,sBACf,CAAC;;;;"}
1
+ {"version":3,"file":"FloatingActionButton.js","sources":["../../../../../src/components/FloatingActionButton/FloatingActionButton.tsx"],"sourcesContent":["import React from 'react';\nimport { FloatingActionButtonContainer } from './FloatingActionButtonContainer';\nimport type { FloatingActionButtonProps } from './types';\nimport BaseButton from '~components/Button/BaseButton';\nimport { componentZIndices } from '~utils/componentZIndices';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { BladeElementRef } from '~utils/types';\n\n/**\n * The shared spinner map would render a white spinner on the white button, where\n * it is invisible.\n */\nconst colorToSpinnerColor = {\n primary: 'white',\n neutral: 'onNeutral',\n white: 'neutral',\n} as const;\n\n/**\n * ### FloatingActionButton component\n *\n * A persistent, elevated button anchored to the bottom of the viewport, used for the single most important action on a screen.\n *\n * ---\n *\n * #### Usage\n *\n * ```jsx\n * <FloatingActionButton icon={PlusIcon} onClick={() => createPayment()}>\n * Create payment\n * </FloatingActionButton>\n *\n * // icon-only, accessibilityLabel is required\n * <FloatingActionButton\n * icon={PlusIcon}\n * accessibilityLabel=\"Create payment\"\n * onClick={() => createPayment()}\n * />\n * ```\n *\n * Checkout {@link https://blade.razorpay.com/?path=/docs/components-floatingactionbutton--docs FloatingActionButton Documentation}\n */\nconst _FloatingActionButton: React.ForwardRefRenderFunction<\n BladeElementRef,\n FloatingActionButtonProps\n> = (\n {\n children,\n icon,\n color = 'primary',\n placement = 'bottom-end',\n offset = 'spacing.5',\n zIndex = componentZIndices.fab,\n isDisabled = false,\n isLoading = false,\n href,\n target,\n rel,\n type = 'button',\n accessibilityLabel,\n onClick,\n onBlur,\n onFocus,\n onMouseLeave,\n onMouseMove,\n onMouseDown,\n onPointerDown,\n onPointerEnter,\n onTouchStart,\n onTouchEnd,\n testID,\n ...rest\n },\n ref,\n) => {\n return (\n <FloatingActionButtonContainer\n placement={placement}\n offset={offset}\n zIndex={zIndex}\n testID={testID}\n {...rest}\n >\n <BaseButton\n ref={ref}\n icon={icon}\n variant=\"primary\"\n color={color}\n size=\"large\"\n _borderRadius=\"max\"\n _iconSize=\"xlarge\"\n _spinnerColor={colorToSpinnerColor[color]}\n accessibilityProps={{ label: accessibilityLabel }}\n href={href}\n target={target}\n rel={rel}\n type={type}\n isDisabled={isDisabled}\n isLoading={isLoading}\n onClick={onClick}\n onBlur={onBlur}\n onFocus={onFocus}\n onMouseLeave={onMouseLeave}\n onMouseMove={onMouseMove}\n onMouseDown={onMouseDown}\n onPointerDown={onPointerDown}\n onPointerEnter={onPointerEnter}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n >\n {children}\n </BaseButton>\n </FloatingActionButtonContainer>\n );\n};\n\nconst FloatingActionButton = assignWithoutSideEffects(React.forwardRef(_FloatingActionButton), {\n displayName: 'FloatingActionButton',\n componentId: 'FloatingActionButton',\n});\n\nexport { FloatingActionButton };\n"],"names":["colorToSpinnerColor","primary","neutral","white","_FloatingActionButton","_ref","ref","children","icon","_ref$color","color","_ref$placement","placement","_ref$offset","offset","_ref$zIndex","zIndex","componentZIndices","fab","_ref$isDisabled","isDisabled","_ref$isLoading","isLoading","href","target","rel","_ref$type","type","accessibilityLabel","onClick","onBlur","onFocus","onMouseLeave","onMouseMove","onMouseDown","onPointerDown","onPointerEnter","onTouchStart","onTouchEnd","testID","rest","_objectWithoutProperties","_excluded","_jsx","FloatingActionButtonContainer","Object","assign","BaseButton","variant","size","_borderRadius","_iconSize","_spinnerColor","accessibilityProps","label","FloatingActionButton","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;8aAYA,IAAMA,mBAAmB,CAAG,CAC1BC,OAAO,CAAE,OAAO,CAChBC,OAAO,CAAE,WAAW,CACpBC,KAAK,CAAE,SACT,CAAU,CA0BV,IAAMC,qBAGL,CAAG,SAHEA,qBAGLA,CAAAC,IAAA,CA4BCC,GAAG,CACA,KA3BDC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CACRC,IAAI,CAAAH,IAAA,CAAJG,IAAI,CAAAC,UAAA,CAAAJ,IAAA,CACJK,KAAK,CAALA,KAAK,CAAAD,UAAA,GAAA,KAAA,CAAA,CAAG,SAAS,CAAAA,UAAA,CAAAE,cAAA,CAAAN,IAAA,CACjBO,SAAS,CAATA,SAAS,CAAAD,cAAA,GAAA,KAAA,CAAA,CAAG,YAAY,CAAAA,cAAA,CAAAE,WAAA,CAAAR,IAAA,CACxBS,MAAM,CAANA,MAAM,CAAAD,WAAA,GAAA,KAAA,CAAA,CAAG,WAAW,CAAAA,WAAA,CAAAE,WAAA,CAAAV,IAAA,CACpBW,MAAM,CAANA,MAAM,CAAAD,WAAA,GAAGE,KAAAA,CAAAA,CAAAA,iBAAiB,CAACC,GAAG,CAAAH,WAAA,CAAAI,eAAA,CAAAd,IAAA,CAC9Be,UAAU,CAAVA,UAAU,CAAAD,eAAA,GAAG,KAAA,CAAA,CAAA,KAAK,CAAAA,eAAA,CAAAE,cAAA,CAAAhB,IAAA,CAClBiB,SAAS,CAATA,SAAS,CAAAD,cAAA,GAAG,KAAA,CAAA,CAAA,KAAK,CAAAA,cAAA,CACjBE,IAAI,CAAAlB,IAAA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E,CAC1C2C,kBAAkB,CAAE,CAAEC,KAAK,CAAE1B,kBAAmB,CAAE,CAClDL,IAAI,CAAEA,IAAK,CACXC,MAAM,CAAEA,MAAO,CACfC,GAAG,CAAEA,GAAI,CACTE,IAAI,CAAEA,IAAK,CACXP,UAAU,CAAEA,UAAW,CACvBE,SAAS,CAAEA,SAAU,CACrBO,OAAO,CAAEA,OAAQ,CACjBC,MAAM,CAAEA,MAAO,CACfC,OAAO,CAAEA,OAAQ,CACjBC,YAAY,CAAEA,YAAa,CAC3BC,WAAW,CAAEA,WAAY,CACzBC,WAAW,CAAEA,WAAY,CACzBC,aAAa,CAAEA,aAAc,CAC7BC,cAAc,CAAEA,cAAe,CAC/BC,YAAY,CAAEA,YAAa,CAC3BC,UAAU,CAAEA,UAAW,CAAA/B,QAAA,CAEtBA,QAAQ,CACC,CAAC,CACgB,CAAA,CAAC,CAEpC,CAAC,CAEK,IAAAgD,oBAAoB,CAAGC,wBAAwB,CAACC,cAAK,CAACC,UAAU,CAACtD,qBAAqB,CAAC,CAAE,CAC7FuD,WAAW,CAAE,sBAAsB,CACnCC,WAAW,CAAE,sBACf,CAAC;;;;"}
@@ -7,8 +7,9 @@ import { padHexForPicker } from './ColorInput.utils.js';
7
7
  import { jsx } from 'react/jsx-runtime';
8
8
  import { size } from '../../../tokens/global/size.js';
9
9
  import useTheme from '../../BladeProvider/useTheme.js';
10
+ import { opacity } from '../../../tokens/global/opacity.js';
10
11
 
11
- var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Input/ColorInput/ColorSwatch.native.tsx";var swatchSizeTokens={xsmall:size['20'],small:size['24'],medium:size['28'],large:size['40']};var ColorSwatch=function ColorSwatch(_ref){var color=_ref.color,inputSize=_ref.size,isDisabled=_ref.isDisabled,_onChange=_ref.onChange,onPress=_ref.onPress;var dimension=swatchSizeTokens[inputSize];var _useTheme=useTheme(),theme=_useTheme.theme;var borderColor=getIn(theme.colors,'interactive.border.gray.default');var handlePress=function handlePress(){onPress==null?void 0:onPress();if(__DEV__){console.warn('[Blade ColorInput]: Native color picker is not supported. The swatch is display-only on React Native.');}};return jsx(Pressable,{onPress:handlePress,disabled:isDisabled,children:jsx(View,{style:{width:dimension,height:dimension,backgroundColor:padHexForPicker(color),borderRadius:theme.border.radius.xsmall,borderWidth:theme.border.width.thin,borderColor:borderColor,opacity:isDisabled?0.5:1}})});};
12
+ var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Input/ColorInput/ColorSwatch.native.tsx";var swatchSizeTokens={xsmall:size['16'],small:size['16'],medium:size['20'],large:size['24']};var swatchLeftPaddingTokens={xsmall:2,small:2,medium:2,large:3};var ColorSwatch=function ColorSwatch(_ref){var color=_ref.color,inputSize=_ref.size,isDisabled=_ref.isDisabled,_onChange=_ref.onChange,onPress=_ref.onPress;var dimension=swatchSizeTokens[inputSize];var _useTheme=useTheme(),theme=_useTheme.theme;var borderColor=getIn(theme.colors,'interactive.border.gray.default');var handlePress=function handlePress(){onPress==null?void 0:onPress();if(__DEV__){console.warn('[Blade ColorInput]: Native color picker is not supported. The swatch is display-only on React Native.');}};return jsx(Pressable,{onPress:handlePress,disabled:isDisabled,style:{paddingLeft:theme.spacing[swatchLeftPaddingTokens[inputSize]]},children:jsx(View,{style:{width:dimension,height:dimension,backgroundColor:padHexForPicker(color),borderRadius:theme.border.radius.xsmall,borderWidth:theme.border.width.thin,borderColor:borderColor,opacity:isDisabled?opacity['500']:1}})});};
12
13
 
13
14
  export { ColorSwatch };
14
15
  //# sourceMappingURL=ColorSwatch.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorSwatch.native.js","sources":["../../../../../../src/components/Input/ColorInput/ColorSwatch.native.tsx"],"sourcesContent":["import React from 'react';\nimport { Pressable, View } from 'react-native';\nimport type { BaseInputProps } from '~components/Input/BaseInput';\nimport { useTheme } from '~components/BladeProvider';\nimport { size } from '~tokens/global';\nimport getIn from '~utils/lodashButBetter/get';\nimport { padHexForPicker } from './ColorInput.utils';\n\ntype ColorSwatchProps = {\n color: string;\n size: NonNullable<BaseInputProps['size']>;\n isDisabled?: boolean;\n // eslint-disable-next-line react/no-unused-prop-types -- kept for API consistency with web; native picker not supported\n onChange: (hex: string) => void;\n onPress?: () => void;\n};\n\nconst swatchSizeTokens = {\n xsmall: size['20'],\n small: size['24'],\n medium: size['28'],\n large: size['40'],\n} as const;\n\nconst ColorSwatch = ({\n color,\n size: inputSize,\n isDisabled,\n onChange: _onChange,\n onPress,\n}: ColorSwatchProps): React.ReactElement => {\n const dimension = swatchSizeTokens[inputSize];\n const { theme } = useTheme();\n const borderColor = getIn(theme.colors, 'interactive.border.gray.default');\n\n const handlePress = (): void => {\n onPress?.();\n if (__DEV__) {\n console.warn(\n '[Blade ColorInput]: Native color picker is not supported. The swatch is display-only on React Native.',\n );\n }\n };\n\n return (\n <Pressable onPress={handlePress} disabled={isDisabled}>\n <View\n style={{\n width: dimension,\n height: dimension,\n backgroundColor: padHexForPicker(color),\n borderRadius: theme.border.radius.xsmall,\n borderWidth: theme.border.width.thin,\n borderColor,\n opacity: isDisabled ? 0.5 : 1,\n }}\n />\n </Pressable>\n );\n};\n\nexport { ColorSwatch };\n"],"names":["swatchSizeTokens","xsmall","size","small","medium","large","ColorSwatch","_ref","color","inputSize","isDisabled","_onChange","onChange","onPress","dimension","_useTheme","useTheme","theme","borderColor","getIn","colors","handlePress","__DEV__","console","warn","_jsx","Pressable","disabled","children","View","style","width","height","backgroundColor","padHexForPicker","borderRadius","border","radius","borderWidth","thin","opacity"],"mappings":";;;;;;;;;;uIAiBA,IAAMA,gBAAgB,CAAG,CACvBC,MAAM,CAAEC,IAAI,CAAC,IAAI,CAAC,CAClBC,KAAK,CAAED,IAAI,CAAC,IAAI,CAAC,CACjBE,MAAM,CAAEF,IAAI,CAAC,IAAI,CAAC,CAClBG,KAAK,CAAEH,IAAI,CAAC,IAAI,CAClB,CAAU,CAEJ,IAAAI,WAAW,CAAG,SAAdA,WAAWA,CAAAC,IAAA,CAM2B,CAL1C,IAAAC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACCC,SAAS,CAAAF,IAAA,CAAfL,IAAI,CACJQ,UAAU,CAAAH,IAAA,CAAVG,UAAU,CACAC,SAAS,CAAAJ,IAAA,CAAnBK,QAAQ,CACRC,OAAO,CAAAN,IAAA,CAAPM,OAAO,CAEP,IAAMC,SAAS,CAAGd,gBAAgB,CAACS,SAAS,CAAC,CAC7C,IAAAM,SAAA,CAAkBC,QAAQ,EAAE,CAApBC,KAAK,CAAAF,SAAA,CAALE,KAAK,CACb,IAAMC,WAAW,CAAGC,KAAK,CAACF,KAAK,CAACG,MAAM,CAAE,iCAAiC,CAAC,CAE1E,IAAMC,WAAW,CAAG,SAAdA,WAAWA,EAAe,CAC9BR,OAAO,EAAA,IAAA,CAAA,KAAA,CAAA,CAAPA,OAAO,EAAI,CACX,GAAIS,OAAO,CAAE,CACXC,OAAO,CAACC,IAAI,CACV,uGACF,CAAC,CACH,CACF,CAAC,CAED,OACEC,GAAA,CAACC,SAAS,CAAA,CAACb,OAAO,CAAEQ,WAAY,CAACM,QAAQ,CAAEjB,UAAW,CAAAkB,QAAA,CACpDH,GAAA,CAACI,IAAI,CAAA,CACHC,KAAK,CAAE,CACLC,KAAK,CAAEjB,SAAS,CAChBkB,MAAM,CAAElB,SAAS,CACjBmB,eAAe,CAAEC,eAAe,CAAC1B,KAAK,CAAC,CACvC2B,YAAY,CAAElB,KAAK,CAACmB,MAAM,CAACC,MAAM,CAACpC,MAAM,CACxCqC,WAAW,CAAErB,KAAK,CAACmB,MAAM,CAACL,KAAK,CAACQ,IAAI,CACpCrB,WAAW,CAAXA,WAAW,CACXsB,OAAO,CAAE9B,UAAU,CAAG,GAAG,CAAG,CAC9B,CAAE,CACH,CAAC,CACO,CAAC,CAEhB;;;;"}
1
+ {"version":3,"file":"ColorSwatch.native.js","sources":["../../../../../../src/components/Input/ColorInput/ColorSwatch.native.tsx"],"sourcesContent":["import React from 'react';\nimport { Pressable, View } from 'react-native';\nimport type { BaseInputProps } from '~components/Input/BaseInput';\nimport { useTheme } from '~components/BladeProvider';\nimport { opacity, size } from '~tokens/global';\nimport getIn from '~utils/lodashButBetter/get';\nimport { padHexForPicker } from './ColorInput.utils';\n\ntype ColorSwatchProps = {\n color: string;\n size: NonNullable<BaseInputProps['size']>;\n isDisabled?: boolean;\n // eslint-disable-next-line react/no-unused-prop-types -- kept for API consistency with web; native picker not supported\n onChange: (hex: string) => void;\n onPress?: () => void;\n};\n\nconst swatchSizeTokens = {\n xsmall: size['16'],\n small: size['16'],\n medium: size['20'],\n large: size['24'],\n} as const;\n\n/**\n * BaseInput insets the leading interaction element by spacing.2 (4px). The spec places the\n * swatch 8px from the field edge, and 12px at large, so make up the difference here.\n */\nconst swatchLeftPaddingTokens = {\n xsmall: 2,\n small: 2,\n medium: 2,\n large: 3,\n} as const;\n\nconst ColorSwatch = ({\n color,\n size: inputSize,\n isDisabled,\n onChange: _onChange,\n onPress,\n}: ColorSwatchProps): React.ReactElement => {\n const dimension = swatchSizeTokens[inputSize];\n const { theme } = useTheme();\n const borderColor = getIn(theme.colors, 'interactive.border.gray.default');\n\n const handlePress = (): void => {\n onPress?.();\n if (__DEV__) {\n console.warn(\n '[Blade ColorInput]: Native color picker is not supported. The swatch is display-only on React Native.',\n );\n }\n };\n\n return (\n <Pressable\n onPress={handlePress}\n disabled={isDisabled}\n style={{ paddingLeft: theme.spacing[swatchLeftPaddingTokens[inputSize]] }}\n >\n <View\n style={{\n width: dimension,\n height: dimension,\n backgroundColor: padHexForPicker(color),\n borderRadius: theme.border.radius.xsmall,\n borderWidth: theme.border.width.thin,\n borderColor,\n opacity: isDisabled ? opacity['500'] : 1,\n }}\n />\n </Pressable>\n );\n};\n\nexport { ColorSwatch };\n"],"names":["this","swatchSizeTokens","xsmall","size","small","medium","large","swatchLeftPaddingTokens","ColorSwatch","_ref","color","inputSize","isDisabled","_onChange","onChange","onPress","dimension","_useTheme","useTheme","theme","borderColor","getIn","colors","handlePress","__DEV__","console","warn","_jsx","Pressable","disabled","style","paddingLeft","spacing","children","View","width","height","backgroundColor","padHexForPicker","borderRadius","border","radius","borderWidth","thin","opacity"],"mappings":";;;;;;;;;;;AAAA,IAAA,KAAA,CAAAA,SAAA,CAAA,YAAA,CAAA,qGAAA,CAiBA,IAAMC,gBAAgB,CAAG,CACvBC,MAAM,CAAEC,IAAI,CAAC,IAAI,CAAC,CAClBC,KAAK,CAAED,IAAI,CAAC,IAAI,CAAC,CACjBE,MAAM,CAAEF,IAAI,CAAC,IAAI,CAAC,CAClBG,KAAK,CAAEH,IAAI,CAAC,IAAI,CAClB,CAAU,CAMV,IAAMI,uBAAuB,CAAG,CAC9BL,MAAM,CAAE,CAAC,CACTE,KAAK,CAAE,CAAC,CACRC,MAAM,CAAE,CAAC,CACTC,KAAK,CAAE,CACT,CAAU,CAEJ,IAAAE,WAAW,CAAG,SAAdA,WAAWA,CAAAC,IAAA,CAM2B,CAAA,IAL1CC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACCC,SAAS,CAAAF,IAAA,CAAfN,IAAI,CACJS,UAAU,CAAAH,IAAA,CAAVG,UAAU,CACAC,SAAS,CAAAJ,IAAA,CAAnBK,QAAQ,CACRC,OAAO,CAAAN,IAAA,CAAPM,OAAO,CAEP,IAAMC,SAAS,CAAGf,gBAAgB,CAACU,SAAS,CAAC,CAC7C,IAAAM,SAAA,CAAkBC,QAAQ,EAAE,CAApBC,KAAK,CAAAF,SAAA,CAALE,KAAK,CACb,IAAMC,WAAW,CAAGC,KAAK,CAACF,KAAK,CAACG,MAAM,CAAE,iCAAiC,CAAC,CAE1E,IAAMC,WAAW,CAAG,SAAdA,WAAWA,EAAe,CAC9BR,OAAO,EAAPA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,OAAO,EAAI,CACX,GAAIS,OAAO,CAAE,CACXC,OAAO,CAACC,IAAI,CACV,uGACF,CAAC,CACH,CACF,CAAC,CAED,OACEC,GAAA,CAACC,SAAS,CAAA,CACRb,OAAO,CAAEQ,WAAY,CACrBM,QAAQ,CAAEjB,UAAW,CACrBkB,KAAK,CAAE,CAAEC,WAAW,CAAEZ,KAAK,CAACa,OAAO,CAACzB,uBAAuB,CAACI,SAAS,CAAC,CAAE,CAAE,CAAAsB,QAAA,CAE1EN,GAAA,CAACO,IAAI,CAAA,CACHJ,KAAK,CAAE,CACLK,KAAK,CAAEnB,SAAS,CAChBoB,MAAM,CAAEpB,SAAS,CACjBqB,eAAe,CAAEC,eAAe,CAAC5B,KAAK,CAAC,CACvC6B,YAAY,CAAEpB,KAAK,CAACqB,MAAM,CAACC,MAAM,CAACvC,MAAM,CACxCwC,WAAW,CAAEvB,KAAK,CAACqB,MAAM,CAACL,KAAK,CAACQ,IAAI,CACpCvB,WAAW,CAAXA,WAAW,CACXwB,OAAO,CAAEhC,UAAU,CAAGgC,OAAO,CAAC,KAAK,CAAC,CAAG,CACzC,CAAE,CACH,CAAC,CACO,CAAC,CAEhB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"OTPInput.js","sources":["../../../../../../src/components/Input/OTPInput/OTPInput.tsx"],"sourcesContent":["import React, { useEffect, useImperativeHandle, useState } from 'react';\nimport type { BaseInputProps } from '../BaseInput';\nimport { BaseInput } from '../BaseInput';\nimport { getHintType } from '../BaseInput/BaseInput';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport type { FormInputOnEvent } from '~components/Form';\nimport { FormHint, FormLabel } from '~components/Form';\nimport { useFormId } from '~components/Form/useFormId';\nimport type { FormInputOnKeyDownEvent } from '~components/Form/FormTypes';\nimport BaseBox from '~components/Box/BaseBox';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getPlatformType } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeSize } from '~utils/makeSize';\nimport type { DataAnalyticsAttribute } from '~utils/types';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype FormInputOnEventWithIndex = ({\n name,\n value,\n inputIndex,\n}: {\n name?: string;\n value?: string;\n inputIndex: number;\n}) => void;\n\nexport type OTPInputCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\n | 'labelSuffix'\n | 'labelTrailing'\n | 'validationState'\n | 'helpText'\n | 'errorText'\n | 'successText'\n | 'name'\n | 'onChange'\n | 'value'\n | 'isDisabled'\n | 'autoFocus'\n | 'keyboardReturnKeyType'\n | 'keyboardType'\n | 'placeholder'\n | 'testID'\n | 'size'\n | keyof DataAnalyticsAttribute\n> & {\n /**\n * Determines the number of input fields to show for the OTP\n * @default 6\n */\n otpLength?: 4 | 6;\n /**\n * The callback function to be invoked when all the values of the OTPInput are filled\n */\n onOTPFilled?: FormInputOnEvent;\n /**\n * Masks input characters in all the fields\n */\n isMasked?: boolean;\n /**\n * Determines what autoComplete suggestion type to show. Defaults to `oneTimeCode`.\n *\n * It's not recommended to turn this off in favor of otp input practices.\n *\n *\n * Internally it'll render platform specific attributes:\n *\n * - web: `autocomplete`\n * - iOS: `textContentType`\n * - android: `autoComplete`\n *\n */\n autoCompleteSuggestionType?: Extract<\n BaseInputProps['autoCompleteSuggestionType'],\n 'none' | 'oneTimeCode'\n >;\n /**\n * The callback function to be invoked when one of the input fields gets focus\n */\n onFocus?: FormInputOnEventWithIndex;\n /**\n * The callback function to be invoked when one of the input fields is blurred\n */\n onBlur?: FormInputOnEventWithIndex;\n} & StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype OTPInputPropsWithA11yLabel = {\n /**\n * Label to be shown for the input field\n */\n label?: undefined;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel: string;\n};\n\n/*\n Optional accessibilityLabel prop when label is provided\n*/\ntype OTPInputPropsWithLabel = {\n /**\n * Label to be shown for the input field\n */\n label: string;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel?: string;\n};\n\ntype OTPInputProps = (OTPInputPropsWithA11yLabel | OTPInputPropsWithLabel) & OTPInputCommonProps;\n\nconst isReactNative = getPlatformType() === 'react-native';\n\n/**\n * Converts a string value of otp to array if passed otherwise returns an array of 6 empty strings\n */\nconst otpToArray = (code?: string): string[] => code?.split('') ?? Array(6).fill('');\n\n/**\n * OTPInput component can be used for accepting OTPs sent to users for authentication/verification purposes.\n *\n * ## Usage\n *\n * ```tsx\n * <OTPInput\n * label=\"Enter OTP\"\n * name=\"otpInput\"\n * onChange={({ name, value }): void => console.log({ name, value })}\n * onOTPFilled={({ name, value }): void => console.log({ name, value })}\n * />\n * ```\n */\nconst _OTPInput: React.ForwardRefRenderFunction<HTMLInputElement[], OTPInputProps> = (\n {\n autoFocus,\n errorText,\n helpText,\n isDisabled,\n keyboardReturnKeyType,\n keyboardType = 'decimal',\n label,\n accessibilityLabel,\n labelPosition,\n labelSuffix,\n labelTrailing,\n name,\n onChange,\n onFocus,\n onBlur,\n onOTPFilled,\n otpLength = 6,\n placeholder,\n successText,\n validationState,\n value: inputValue,\n isMasked,\n autoCompleteSuggestionType = 'oneTimeCode',\n testID,\n size = 'medium',\n ...rest\n },\n incomingRef,\n) => {\n const inputRefs: React.RefObject<HTMLInputElement>[] = [];\n const [otpValue, setOtpValue] = useState<string[]>(otpToArray(inputValue));\n const [inputType, setInputType] = useState<('password' | undefined)[]>([]);\n const isLabelLeftPositioned = labelPosition === 'left';\n const { inputId, helpTextId, errorTextId, successTextId } = useFormId('otp');\n\n useImperativeHandle(\n incomingRef,\n () => {\n return inputRefs.map((ref) => ref.current!);\n },\n [inputRefs],\n );\n\n useEffect(() => {\n // Effect for calling `onOTPFilled` callback\n if (inputValue && inputValue.length >= otpLength) {\n // callback for when the OTPInput is controlled and inputValue reaches the same or greater length as the otpLength\n onOTPFilled?.({ value: inputValue.slice(0, otpLength), name });\n } else if (!inputValue && otpValue.join('').length >= otpLength) {\n // callback for when the OTPInput is uncontrolled and otpValue stored in state reaches the same or greater length as the otpLength\n onOTPFilled?.({ value: otpValue.slice(0, otpLength).join(''), name });\n }\n }, [otpValue, otpLength, name, inputValue, onOTPFilled]);\n\n useEffect(() => {\n /* We want to disable the password managers for OTPInput when isMasked is set.\n The issue with only setting autocomplete='off' is that its not an enforcement but a suggestion to the browser to follow.\n This workaround unsets type on first render and sets it to `password` only once a value is entered by the user.\n */\n otpValue.forEach((otp, index) => {\n // Set inputType as 'password' only when a value is entered when isMasked is set\n if (!isEmpty(otp) && !inputType[index] && isMasked) {\n const newInputType = Array.from(inputType);\n newInputType[index] = 'password';\n setInputType(newInputType);\n }\n // Cleanup the inputType array whenever the value is empty but inputType[index] is set\n if (isEmpty(otp) && inputType[index]) {\n const newInputType = Array.from(inputType);\n newInputType[index] = undefined;\n setInputType(newInputType);\n }\n });\n }, [otpValue, inputType, isMasked]);\n\n /**\n * Changes the value of the otp at a given index and updates the otpValue stored in state\n *\n * @param {{ value: string; index: number }} { value, index }\n * @returns {string} updated otpValue\n */\n const setOtpValueByIndex = ({ value, index }: { value: string; index: number }): string => {\n const newOtpValue = Array.from(otpValue);\n newOtpValue[index] = value;\n setOtpValue(newOtpValue);\n return newOtpValue.join('');\n };\n\n /**\n * Sets focus to the desired otp input by index\n *\n * @param {number} index the index of the otp input to be focused\n */\n const focusOnOtpByIndex = (index: number): void => {\n inputRefs[index]?.current?.focus();\n if (!isReactNative) {\n // React Native doesn't support imperatively selecting the value of input\n inputRefs[index]?.current?.select();\n }\n };\n\n const handleOnChange = ({\n value,\n currentOtpIndex,\n }: {\n value?: string;\n currentOtpIndex: number;\n }): void => {\n if (value && value === ' ') {\n // React native doesn't support `event.preventDefault()` hence have to add this check to ensure that empty space is not allowed\n return;\n }\n if (inputValue && inputValue.length > 0) {\n // When OTPInput is controlled, set the otpValue as the consumer passed `inputValue` and append the value on current index based on user's input.\n // User's input will not reflect on the otp but will trigger `onChange` callback with the user's input appended so that the consumer can take appropriate action.\n const newOtpValue = Array.from(inputValue);\n newOtpValue[currentOtpIndex] = value ?? '';\n setOtpValue(newOtpValue);\n onChange?.({ name, value: newOtpValue.join('') });\n } else if (value && value.trim().length > 1) {\n // When the entered value is more that 1 character (when value is pasted), set the otpValue to the newly received value.\n // Could have used `onPaste` for web to achieve this but 1. React Native doesn't support onPaste and 2. Safari's autofill on web doesn't trigger onPaste\n setOtpValue(Array.from(value));\n onChange?.({ name, value: value.trim().slice(0, otpLength) });\n // Move focus to the last filled input box after paste\n const lastFilledIndex = Math.min(value.trim().length, otpLength) - 1;\n focusOnOtpByIndex(lastFilledIndex);\n } else if (otpValue[currentOtpIndex] !== value?.trim()) {\n // Set the value at the current index to the entered value\n // only as long as its not the same as the already existing value (this prevents `onChange` being triggered unnecessarily)\n const newValue = setOtpValueByIndex({\n value: value?.trim() ?? '',\n index: currentOtpIndex,\n });\n onChange?.({ name, value: newValue });\n }\n };\n\n const handleOnInput = ({\n value,\n currentOtpIndex,\n }: {\n value?: string;\n currentOtpIndex: number;\n }): void => {\n // Moves focus to next input whenever a value is entered in the current input\n if (value && value.trim().length === 1) {\n focusOnOtpByIndex(++currentOtpIndex);\n }\n };\n\n const handleOnKeyDown = ({\n key,\n code,\n event,\n currentOtpIndex,\n }: FormInputOnKeyDownEvent & { currentOtpIndex: number }): void => {\n if (key === 'Backspace' || code === 'Backspace' || code === 'Delete' || key === 'Delete') {\n event.preventDefault?.();\n if (otpValue[currentOtpIndex]) {\n // Clear the value at the current index if value exists\n handleOnChange({ value: '', currentOtpIndex });\n } else {\n // Move focus to the previous input if the current input is empty\n // and clear the value at the new active (previous) index\n focusOnOtpByIndex(--currentOtpIndex);\n handleOnChange({ value: '', currentOtpIndex });\n }\n } else if (key === 'ArrowLeft' || code === 'ArrowLeft') {\n event.preventDefault?.();\n focusOnOtpByIndex(--currentOtpIndex);\n } else if (key === 'ArrowRight' || code === 'ArrowRight') {\n event.preventDefault?.();\n focusOnOtpByIndex(++currentOtpIndex);\n } else if (key === ' ' || code === 'Space') {\n event.preventDefault?.();\n }\n };\n\n const getHiddenInput = (): React.ReactNode => {\n if (!isReactNative) {\n return (\n <input\n hidden={true}\n id={inputId}\n name={name}\n value={inputValue ?? otpValue.join('') ?? ''}\n readOnly\n />\n );\n }\n return null;\n };\n\n const getOTPInputFields = (): React.ReactNode => {\n const inputs = [];\n for (let index = 0; index < otpLength; index++) {\n const currentValue = inputValue ? otpToArray(inputValue)[index] || '' : otpValue[index] || '';\n const ref = React.createRef<HTMLInputElement>();\n // if an inputValue is passed (controlled) and isMasked is set, inputType will always be password\n let currentInputType: 'password' | undefined;\n if (isMasked) {\n // if inputValue is passed (controlled component) then the inputType will always be password\n currentInputType = inputValue ? 'password' : inputType[index];\n }\n inputRefs.push(ref);\n inputs.push(\n <BaseBox\n flex={1}\n marginLeft={index == 0 ? 'spacing.0' : 'spacing.3'}\n key={`${inputId}-${index}`}\n >\n <BaseInput\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus && index === 0}\n accessibilityLabel={`${index === 0 ? label || accessibilityLabel : ''} character ${\n index + 1\n }`}\n label={label}\n hideLabelText={true}\n id={`${inputId}-${index}`}\n textAlign=\"center\"\n ref={ref as never}\n name={name}\n value={currentValue}\n maxCharacters={otpValue[index]?.length > 0 ? 1 : undefined}\n onChange={(formEvent) => handleOnChange({ ...formEvent, currentOtpIndex: index })}\n onFocus={(formEvent) => onFocus?.({ ...formEvent, inputIndex: index })}\n onBlur={(formEvent) => onBlur?.({ ...formEvent, inputIndex: index })}\n onInput={(formEvent) => handleOnInput({ ...formEvent, currentOtpIndex: index })}\n onKeyDown={(keyboardEvent) =>\n handleOnKeyDown({ ...keyboardEvent, currentOtpIndex: index })\n }\n isDisabled={isDisabled}\n placeholder={Array.from(placeholder ?? '')[index] ?? ''}\n isRequired={true}\n autoCompleteSuggestionType={autoCompleteSuggestionType}\n keyboardType={keyboardType}\n keyboardReturnKeyType={keyboardReturnKeyType}\n validationState={validationState}\n successText={successText}\n errorText={errorText}\n helpText={helpText}\n hideFormHint={true}\n type={currentInputType}\n size={size}\n valueComponentType=\"heading\"\n {...makeAnalyticsAttribute(rest)}\n />\n </BaseBox>,\n );\n }\n return inputs;\n };\n\n return (\n <BaseBox {...metaAttribute({ name: MetaConstants.OTPInput, testID })} {...getStyledProps(rest)}>\n <BaseBox\n display=\"flex\"\n flexDirection={isLabelLeftPositioned ? 'row' : 'column'}\n alignItems={isLabelLeftPositioned ? 'center' : undefined}\n position=\"relative\"\n >\n {Boolean(label) && (\n <FormLabel\n as=\"label\"\n position={labelPosition}\n htmlFor={inputId}\n size={size}\n labelSuffix={labelSuffix}\n labelTrailing={labelTrailing}\n >\n {label}\n </FormLabel>\n )}\n <BaseBox display=\"flex\" flexDirection=\"row\">\n {getHiddenInput()}\n {getOTPInputFields()}\n </BaseBox>\n </BaseBox>\n {/* the magic number 136 is basically max-width of label i.e 120 and then right margin i.e 16 which is the spacing between label and input field */}\n {/*Refer `BaseInput`'s implementation of FormHint which uses similar logic */}\n <BaseBox marginLeft={makeSize(isLabelLeftPositioned ? 136 : 0)}>\n <FormHint\n type={getHintType({ validationState, hasHelpText: Boolean(helpText) })}\n helpText={helpText}\n errorText={errorText}\n successText={successText}\n helpTextId={helpTextId}\n errorTextId={errorTextId}\n successTextId={successTextId}\n size={size}\n />\n </BaseBox>\n </BaseBox>\n );\n};\n\nconst OTPInput = React.forwardRef<HTMLInputElement[], OTPInputProps>(_OTPInput);\n\nexport type { OTPInputProps };\nexport { OTPInput };\n"],"names":["isReactNative","getPlatformType","otpToArray","code","_code$split","split","Array","fill","_OTPInput","_ref","incomingRef","autoFocus","errorText","helpText","isDisabled","keyboardReturnKeyType","_ref$keyboardType","keyboardType","label","accessibilityLabel","labelPosition","labelSuffix","labelTrailing","name","onChange","onFocus","onBlur","onOTPFilled","_ref$otpLength","otpLength","placeholder","successText","validationState","inputValue","value","isMasked","_ref$autoCompleteSugg","autoCompleteSuggestionType","testID","_ref$size","size","rest","_objectWithoutProperties","_excluded","inputRefs","_useState","useState","_useState2","_slicedToArray","otpValue","setOtpValue","_useState3","_useState4","inputType","setInputType","isLabelLeftPositioned","_useFormId","useFormId","inputId","helpTextId","errorTextId","successTextId","useImperativeHandle","map","ref","current","useEffect","length","slice","join","forEach","otp","index","isEmpty","newInputType","from","undefined","setOtpValueByIndex","_ref2","newOtpValue","focusOnOtpByIndex","_inputRefs$index","_inputRefs$index$curr","focus","_inputRefs$index2","_inputRefs$index2$cur","select","handleOnChange","_ref3","currentOtpIndex","trim","lastFilledIndex","Math","min","_value$trim","newValue","handleOnInput","_ref4","handleOnKeyDown","_ref5","key","event","preventDefault","getHiddenInput","_ref6","_jsx","hidden","id","readOnly","getOTPInputFields","inputs","_loop","_otpValue$index","_Array$from$index","currentValue","React","createRef","currentInputType","push","BaseBox","flex","marginLeft","children","BaseInput","Object","assign","hideLabelText","textAlign","maxCharacters","formEvent","inputIndex","onInput","onKeyDown","keyboardEvent","isRequired","hideFormHint","type","valueComponentType","makeAnalyticsAttribute","_jsxs","metaAttribute","MetaConstants","OTPInput","getStyledProps","display","flexDirection","alignItems","position","Boolean","FormLabel","as","htmlFor","makeSize","FormHint","getHintType","hasHelpText","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;0dAyHA,IAAMA,aAAa,CAAGC,eAAe,EAAE,GAAK,cAAc,CAK1D,IAAMC,UAAU,CAAG,SAAbA,UAAUA,CAAIC,IAAa,CAAAC,CAAAA,IAAAA,WAAA,CAAAA,OAAAA,CAAAA,WAAA,CAAeD,IAAI,EAAJA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,IAAI,CAAEE,KAAK,CAAC,EAAE,CAAC,GAAAD,IAAAA,CAAAA,WAAA,CAAIE,KAAK,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,EAAE,CAAC,CAgBpF,CAAA,CAAA,IAAMC,SAA4E,CAAG,SAA/EA,SAA4EA,CAAAC,IAAA,CA6BhFC,WAAW,CACR,CAAA,IA5BDC,SAAS,CAAAF,IAAA,CAATE,SAAS,CACTC,SAAS,C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AAK,CACG,CACZ,CACDyH,IAAA,CAACpB,OAAO,CAAA,CAACyB,OAAO,CAAC,MAAM,CAACC,aAAa,CAAC,KAAK,CAAAvB,QAAA,CACxCnB,CAAAA,cAAc,EAAE,CAChBM,iBAAiB,EAAE,CACb,CAAA,CAAC,EACH,CAAC,CAGVJ,GAAA,CAACc,OAAO,CAAA,CAACE,UAAU,CAAE+B,QAAQ,CAACjG,qBAAqB,CAAG,GAAG,CAAG,CAAC,CAAE,CAAAmE,QAAA,CAC7DjB,GAAA,CAACgD,QAAQ,CACPjB,CAAAA,IAAI,CAAEkB,WAAW,CAAC,CAAE1H,eAAe,CAAfA,eAAe,CAAE2H,WAAW,CAAEP,OAAO,CAACvI,QAAQ,CAAE,CAAC,CAAE,CACvEA,QAAQ,CAAEA,QAAS,CACnBD,SAAS,CAAEA,SAAU,CACrBmB,WAAW,CAAEA,WAAY,CACzB4B,UAAU,CAAEA,UAAW,CACvBC,WAAW,CAAEA,WAAY,CACzBC,aAAa,CAAEA,aAAc,CAC7BrB,IAAI,CAAEA,IAAK,CACZ,CAAC,CACK,CAAC,CAAA,CAAA,CACH,CAAC,CAEd,CAAC,CAEK,IAAAsG,QAAQ,CAAG3B,cAAK,CAACyC,UAAU,CAAoCpJ,SAAS;;;;"}
1
+ {"version":3,"file":"OTPInput.js","sources":["../../../../../../src/components/Input/OTPInput/OTPInput.tsx"],"sourcesContent":["import React, { useEffect, useImperativeHandle, useState } from 'react';\nimport type { BaseInputProps } from '../BaseInput';\nimport { BaseInput } from '../BaseInput';\nimport { getHintType } from '../BaseInput/BaseInput';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport type { FormInputOnEvent } from '~components/Form';\nimport { FormHint, FormLabel } from '~components/Form';\nimport { useFormId } from '~components/Form/useFormId';\nimport type { FormInputOnKeyDownEvent } from '~components/Form/FormTypes';\nimport BaseBox from '~components/Box/BaseBox';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getPlatformType } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeSize } from '~utils/makeSize';\nimport type { DataAnalyticsAttribute } from '~utils/types';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype FormInputOnEventWithIndex = ({\n name,\n value,\n inputIndex,\n}: {\n name?: string;\n value?: string;\n inputIndex: number;\n}) => void;\n\nexport type OTPInputCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\n | 'labelSuffix'\n | 'labelTrailing'\n | 'validationState'\n | 'helpText'\n | 'errorText'\n | 'successText'\n | 'name'\n | 'onChange'\n | 'value'\n | 'isDisabled'\n | 'autoFocus'\n | 'keyboardReturnKeyType'\n | 'keyboardType'\n | 'placeholder'\n | 'testID'\n | 'size'\n | keyof DataAnalyticsAttribute\n> & {\n /**\n * Determines the number of input fields to show for the OTP\n * @default 6\n */\n otpLength?: 4 | 6 | 8;\n /**\n * The callback function to be invoked when all the values of the OTPInput are filled\n */\n onOTPFilled?: FormInputOnEvent;\n /**\n * Masks input characters in all the fields\n */\n isMasked?: boolean;\n /**\n * Determines what autoComplete suggestion type to show. Defaults to `oneTimeCode`.\n *\n * It's not recommended to turn this off in favor of otp input practices.\n *\n *\n * Internally it'll render platform specific attributes:\n *\n * - web: `autocomplete`\n * - iOS: `textContentType`\n * - android: `autoComplete`\n *\n */\n autoCompleteSuggestionType?: Extract<\n BaseInputProps['autoCompleteSuggestionType'],\n 'none' | 'oneTimeCode'\n >;\n /**\n * The callback function to be invoked when one of the input fields gets focus\n */\n onFocus?: FormInputOnEventWithIndex;\n /**\n * The callback function to be invoked when one of the input fields is blurred\n */\n onBlur?: FormInputOnEventWithIndex;\n} & StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype OTPInputPropsWithA11yLabel = {\n /**\n * Label to be shown for the input field\n */\n label?: undefined;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel: string;\n};\n\n/*\n Optional accessibilityLabel prop when label is provided\n*/\ntype OTPInputPropsWithLabel = {\n /**\n * Label to be shown for the input field\n */\n label: string;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel?: string;\n};\n\ntype OTPInputProps = (OTPInputPropsWithA11yLabel | OTPInputPropsWithLabel) & OTPInputCommonProps;\n\nconst isReactNative = getPlatformType() === 'react-native';\n\n/**\n * Converts a string value of otp to array if passed otherwise returns an array of 6 empty strings\n */\nconst otpToArray = (code?: string): string[] => code?.split('') ?? Array(6).fill('');\n\n/**\n * OTPInput component can be used for accepting OTPs sent to users for authentication/verification purposes.\n *\n * ## Usage\n *\n * ```tsx\n * <OTPInput\n * label=\"Enter OTP\"\n * name=\"otpInput\"\n * onChange={({ name, value }): void => console.log({ name, value })}\n * onOTPFilled={({ name, value }): void => console.log({ name, value })}\n * />\n * ```\n */\nconst _OTPInput: React.ForwardRefRenderFunction<HTMLInputElement[], OTPInputProps> = (\n {\n autoFocus,\n errorText,\n helpText,\n isDisabled,\n keyboardReturnKeyType,\n keyboardType = 'decimal',\n label,\n accessibilityLabel,\n labelPosition,\n labelSuffix,\n labelTrailing,\n name,\n onChange,\n onFocus,\n onBlur,\n onOTPFilled,\n otpLength = 6,\n placeholder,\n successText,\n validationState,\n value: inputValue,\n isMasked,\n autoCompleteSuggestionType = 'oneTimeCode',\n testID,\n size = 'medium',\n ...rest\n },\n incomingRef,\n) => {\n const inputRefs: React.RefObject<HTMLInputElement>[] = [];\n const [otpValue, setOtpValue] = useState<string[]>(otpToArray(inputValue));\n const [inputType, setInputType] = useState<('password' | undefined)[]>([]);\n const isLabelLeftPositioned = labelPosition === 'left';\n const { inputId, helpTextId, errorTextId, successTextId } = useFormId('otp');\n\n useImperativeHandle(\n incomingRef,\n () => {\n return inputRefs.map((ref) => ref.current!);\n },\n [inputRefs],\n );\n\n useEffect(() => {\n // Effect for calling `onOTPFilled` callback\n if (inputValue && inputValue.length >= otpLength) {\n // callback for when the OTPInput is controlled and inputValue reaches the same or greater length as the otpLength\n onOTPFilled?.({ value: inputValue.slice(0, otpLength), name });\n } else if (!inputValue && otpValue.join('').length >= otpLength) {\n // callback for when the OTPInput is uncontrolled and otpValue stored in state reaches the same or greater length as the otpLength\n onOTPFilled?.({ value: otpValue.slice(0, otpLength).join(''), name });\n }\n }, [otpValue, otpLength, name, inputValue, onOTPFilled]);\n\n useEffect(() => {\n /* We want to disable the password managers for OTPInput when isMasked is set.\n The issue with only setting autocomplete='off' is that its not an enforcement but a suggestion to the browser to follow.\n This workaround unsets type on first render and sets it to `password` only once a value is entered by the user.\n */\n otpValue.forEach((otp, index) => {\n // Set inputType as 'password' only when a value is entered when isMasked is set\n if (!isEmpty(otp) && !inputType[index] && isMasked) {\n const newInputType = Array.from(inputType);\n newInputType[index] = 'password';\n setInputType(newInputType);\n }\n // Cleanup the inputType array whenever the value is empty but inputType[index] is set\n if (isEmpty(otp) && inputType[index]) {\n const newInputType = Array.from(inputType);\n newInputType[index] = undefined;\n setInputType(newInputType);\n }\n });\n }, [otpValue, inputType, isMasked]);\n\n /**\n * Changes the value of the otp at a given index and updates the otpValue stored in state\n *\n * @param {{ value: string; index: number }} { value, index }\n * @returns {string} updated otpValue\n */\n const setOtpValueByIndex = ({ value, index }: { value: string; index: number }): string => {\n const newOtpValue = Array.from(otpValue);\n newOtpValue[index] = value;\n setOtpValue(newOtpValue);\n return newOtpValue.join('');\n };\n\n /**\n * Sets focus to the desired otp input by index\n *\n * @param {number} index the index of the otp input to be focused\n */\n const focusOnOtpByIndex = (index: number): void => {\n inputRefs[index]?.current?.focus();\n if (!isReactNative) {\n // React Native doesn't support imperatively selecting the value of input\n inputRefs[index]?.current?.select();\n }\n };\n\n const handleOnChange = ({\n value,\n currentOtpIndex,\n }: {\n value?: string;\n currentOtpIndex: number;\n }): void => {\n if (value && value === ' ') {\n // React native doesn't support `event.preventDefault()` hence have to add this check to ensure that empty space is not allowed\n return;\n }\n if (inputValue && inputValue.length > 0) {\n // When OTPInput is controlled, set the otpValue as the consumer passed `inputValue` and append the value on current index based on user's input.\n // User's input will not reflect on the otp but will trigger `onChange` callback with the user's input appended so that the consumer can take appropriate action.\n const newOtpValue = Array.from(inputValue);\n newOtpValue[currentOtpIndex] = value ?? '';\n setOtpValue(newOtpValue);\n onChange?.({ name, value: newOtpValue.join('') });\n } else if (value && value.trim().length > 1) {\n // When the entered value is more that 1 character (when value is pasted), set the otpValue to the newly received value.\n // Could have used `onPaste` for web to achieve this but 1. React Native doesn't support onPaste and 2. Safari's autofill on web doesn't trigger onPaste\n setOtpValue(Array.from(value));\n onChange?.({ name, value: value.trim().slice(0, otpLength) });\n // Move focus to the last filled input box after paste\n const lastFilledIndex = Math.min(value.trim().length, otpLength) - 1;\n focusOnOtpByIndex(lastFilledIndex);\n } else if (otpValue[currentOtpIndex] !== value?.trim()) {\n // Set the value at the current index to the entered value\n // only as long as its not the same as the already existing value (this prevents `onChange` being triggered unnecessarily)\n const newValue = setOtpValueByIndex({\n value: value?.trim() ?? '',\n index: currentOtpIndex,\n });\n onChange?.({ name, value: newValue });\n }\n };\n\n const handleOnInput = ({\n value,\n currentOtpIndex,\n }: {\n value?: string;\n currentOtpIndex: number;\n }): void => {\n // Moves focus to next input whenever a value is entered in the current input\n if (value && value.trim().length === 1) {\n focusOnOtpByIndex(++currentOtpIndex);\n }\n };\n\n const handleOnKeyDown = ({\n key,\n code,\n event,\n currentOtpIndex,\n }: FormInputOnKeyDownEvent & { currentOtpIndex: number }): void => {\n if (key === 'Backspace' || code === 'Backspace' || code === 'Delete' || key === 'Delete') {\n event.preventDefault?.();\n if (otpValue[currentOtpIndex]) {\n // Clear the value at the current index if value exists\n handleOnChange({ value: '', currentOtpIndex });\n } else {\n // Move focus to the previous input if the current input is empty\n // and clear the value at the new active (previous) index\n focusOnOtpByIndex(--currentOtpIndex);\n handleOnChange({ value: '', currentOtpIndex });\n }\n } else if (key === 'ArrowLeft' || code === 'ArrowLeft') {\n event.preventDefault?.();\n focusOnOtpByIndex(--currentOtpIndex);\n } else if (key === 'ArrowRight' || code === 'ArrowRight') {\n event.preventDefault?.();\n focusOnOtpByIndex(++currentOtpIndex);\n } else if (key === ' ' || code === 'Space') {\n event.preventDefault?.();\n }\n };\n\n const getHiddenInput = (): React.ReactNode => {\n if (!isReactNative) {\n return (\n <input\n hidden={true}\n id={inputId}\n name={name}\n value={inputValue ?? otpValue.join('') ?? ''}\n readOnly\n />\n );\n }\n return null;\n };\n\n const getOTPInputFields = (): React.ReactNode => {\n const inputs = [];\n for (let index = 0; index < otpLength; index++) {\n const currentValue = inputValue ? otpToArray(inputValue)[index] || '' : otpValue[index] || '';\n const ref = React.createRef<HTMLInputElement>();\n // if an inputValue is passed (controlled) and isMasked is set, inputType will always be password\n let currentInputType: 'password' | undefined;\n if (isMasked) {\n // if inputValue is passed (controlled component) then the inputType will always be password\n currentInputType = inputValue ? 'password' : inputType[index];\n }\n inputRefs.push(ref);\n inputs.push(\n <BaseBox\n flex={1}\n marginLeft={index == 0 ? 'spacing.0' : 'spacing.3'}\n key={`${inputId}-${index}`}\n >\n <BaseInput\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus && index === 0}\n accessibilityLabel={`${index === 0 ? label || accessibilityLabel : ''} character ${\n index + 1\n }`}\n label={label}\n hideLabelText={true}\n id={`${inputId}-${index}`}\n textAlign=\"center\"\n ref={ref as never}\n name={name}\n value={currentValue}\n maxCharacters={otpValue[index]?.length > 0 ? 1 : undefined}\n onChange={(formEvent) => handleOnChange({ ...formEvent, currentOtpIndex: index })}\n onFocus={(formEvent) => onFocus?.({ ...formEvent, inputIndex: index })}\n onBlur={(formEvent) => onBlur?.({ ...formEvent, inputIndex: index })}\n onInput={(formEvent) => handleOnInput({ ...formEvent, currentOtpIndex: index })}\n onKeyDown={(keyboardEvent) =>\n handleOnKeyDown({ ...keyboardEvent, currentOtpIndex: index })\n }\n isDisabled={isDisabled}\n placeholder={Array.from(placeholder ?? '')[index] ?? ''}\n isRequired={true}\n autoCompleteSuggestionType={autoCompleteSuggestionType}\n keyboardType={keyboardType}\n keyboardReturnKeyType={keyboardReturnKeyType}\n validationState={validationState}\n successText={successText}\n errorText={errorText}\n helpText={helpText}\n hideFormHint={true}\n type={currentInputType}\n size={size}\n valueComponentType=\"heading\"\n {...makeAnalyticsAttribute(rest)}\n />\n </BaseBox>,\n );\n }\n return inputs;\n };\n\n return (\n <BaseBox {...metaAttribute({ name: MetaConstants.OTPInput, testID })} {...getStyledProps(rest)}>\n <BaseBox\n display=\"flex\"\n flexDirection={isLabelLeftPositioned ? 'row' : 'column'}\n alignItems={isLabelLeftPositioned ? 'center' : undefined}\n position=\"relative\"\n >\n {Boolean(label) && (\n <FormLabel\n as=\"label\"\n position={labelPosition}\n htmlFor={inputId}\n size={size}\n labelSuffix={labelSuffix}\n labelTrailing={labelTrailing}\n >\n {label}\n </FormLabel>\n )}\n <BaseBox display=\"flex\" flexDirection=\"row\">\n {getHiddenInput()}\n {getOTPInputFields()}\n </BaseBox>\n </BaseBox>\n {/* the magic number 136 is basically max-width of label i.e 120 and then right margin i.e 16 which is the spacing between label and input field */}\n {/*Refer `BaseInput`'s implementation of FormHint which uses similar logic */}\n <BaseBox marginLeft={makeSize(isLabelLeftPositioned ? 136 : 0)}>\n <FormHint\n type={getHintType({ validationState, hasHelpText: Boolean(helpText) })}\n helpText={helpText}\n errorText={errorText}\n successText={successText}\n helpTextId={helpTextId}\n errorTextId={errorTextId}\n successTextId={successTextId}\n size={size}\n />\n </BaseBox>\n </BaseBox>\n );\n};\n\nconst OTPInput = React.forwardRef<HTMLInputElement[], OTPInputProps>(_OTPInput);\n\nexport type { OTPInputProps };\nexport { OTPInput };\n"],"names":["isReactNative","getPlatformType","otpToArray","code","_code$split","split","Array","fill","_OTPInput","_ref","incomingRef","autoFocus","errorText","helpText","isDisabled","keyboardReturnKeyType","_ref$keyboardType","keyboardType","label","accessibilityLabel","labelPosition","labelSuffix","labelTrailing","name","onChange","onFocus","onBlur","onOTPFilled","_ref$otpLength","otpLength","placeholder","successText","validationState","inputValue","value","isMasked","_ref$autoCompleteSugg","autoCompleteSuggestionType","testID","_ref$size","size","rest","_objectWithoutProperties","_excluded","inputRefs","_useState","useState","_useState2","_slicedToArray","otpValue","setOtpValue","_useState3","_useState4","inputType","setInputType","isLabelLeftPositioned","_useFormId","useFormId","inputId","helpTextId","errorTextId","successTextId","useImperativeHandle","map","ref","current","useEffect","length","slice","join","forEach","otp","index","isEmpty","newInputType","from","undefined","setOtpValueByIndex","_ref2","newOtpValue","focusOnOtpByIndex","_inputRefs$index","_inputRefs$index$curr","focus","_inputRefs$index2","_inputRefs$index2$cur","select","handleOnChange","_ref3","currentOtpIndex","trim","lastFilledIndex","Math","min","_value$trim","newValue","handleOnInput","_ref4","handleOnKeyDown","_ref5","key","event","preventDefault","getHiddenInput","_ref6","_jsx","hidden","id","readOnly","getOTPInputFields","inputs","_loop","_otpValue$index","_Array$from$index","currentValue","React","createRef","currentInputType","push","BaseBox","flex","marginLeft","children","BaseInput","Object","assign","hideLabelText","textAlign","maxCharacters","formEvent","inputIndex","onInput","onKeyDown","keyboardEvent","isRequired","hideFormHint","type","valueComponentType","makeAnalyticsAttribute","_jsxs","metaAttribute","MetaConstants","OTPInput","getStyledProps","display","flexDirection","alignItems","position","Boolean","FormLabel","as","htmlFor","makeSize","FormHint","getHintType","hasHelpText","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;0dAyHA,IAAMA,aAAa,CAAGC,eAAe,EAAE,GAAK,cAAc,CAK1D,IAAMC,UAAU,CAAG,SAAbA,UAAUA,CAAIC,IAAa,CAAAC,CAAAA,IAAAA,WAAA,CAAAA,OAAAA,CAAAA,WAAA,CAAeD,IAAI,EAAJA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,IAAI,CAAEE,KAAK,CAAC,EAAE,CAAC,GAAAD,IAAAA,CAAAA,WAAA,CAAIE,KAAK,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC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CACVH,QAAQ,CAAE/H,aAAc,CACxBmI,OAAO,CAAE7F,OAAQ,CACjBlB,IAAI,CAAEA,IAAK,CACXnB,WAAW,CAAEA,WAAY,CACzBC,aAAa,CAAEA,aAAc,CAAAoG,QAAA,CAE5BxG,KAAK,CACG,CACZ,CACDyH,IAAA,CAACpB,OAAO,CAAA,CAACyB,OAAO,CAAC,MAAM,CAACC,aAAa,CAAC,KAAK,CAAAvB,QAAA,CACxCnB,CAAAA,cAAc,EAAE,CAChBM,iBAAiB,EAAE,CACb,CAAA,CAAC,EACH,CAAC,CAGVJ,GAAA,CAACc,OAAO,CAAA,CAACE,UAAU,CAAE+B,QAAQ,CAACjG,qBAAqB,CAAG,GAAG,CAAG,CAAC,CAAE,CAAAmE,QAAA,CAC7DjB,GAAA,CAACgD,QAAQ,CACPjB,CAAAA,IAAI,CAAEkB,WAAW,CAAC,CAAE1H,eAAe,CAAfA,eAAe,CAAE2H,WAAW,CAAEP,OAAO,CAACvI,QAAQ,CAAE,CAAC,CAAE,CACvEA,QAAQ,CAAEA,QAAS,CACnBD,SAAS,CAAEA,SAAU,CACrBmB,WAAW,CAAEA,WAAY,CACzB4B,UAAU,CAAEA,UAAW,CACvBC,WAAW,CAAEA,WAAY,CACzBC,aAAa,CAAEA,aAAc,CAC7BrB,IAAI,CAAEA,IAAK,CACZ,CAAC,CACK,CAAC,CAAA,CAAA,CACH,CAAC,CAEd,CAAC,CAEK,IAAAsG,QAAQ,CAAG3B,cAAK,CAACyC,UAAU,CAAoCpJ,SAAS;;;;"}
@@ -21,7 +21,7 @@ import { makeAccessible } from '../../../utils/makeAccessible/makeAccessible.nat
21
21
  import { makeSize } from '../../../utils/makeSize/makeSize.js';
22
22
  import { Text } from '../../Typography/Text/Text.js';
23
23
 
24
- var _excluded=["label","labelPosition","accessibilityLabel","color","size","testID"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Spinner/BaseSpinner/BaseSpinner.tsx";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!=='neutral'){return getIn(theme.colors,`interactive.icon.${color}.subtle`);}return getIn(theme.colors,'interactive.icon.gray.muted');};var _BaseSpinner=function _BaseSpinner(_ref2,ref){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({ref:ref},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]}))}));};var BaseSpinner=React__default.forwardRef(_BaseSpinner);
24
+ var _excluded=["label","labelPosition","accessibilityLabel","color","size","testID"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Spinner/BaseSpinner/BaseSpinner.tsx";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==='onNeutral'){return getIn(theme.colors,'interactive.icon.onNeutral.normal');}if(color&&color!=='neutral'){return getIn(theme.colors,`interactive.icon.${color}.subtle`);}return getIn(theme.colors,'interactive.icon.gray.muted');};var _BaseSpinner=function _BaseSpinner(_ref2,ref){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({ref:ref},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]}))}));};var BaseSpinner=React__default.forwardRef(_BaseSpinner);
25
25
 
26
26
  export { BaseSpinner };
27
27
  //# 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 { BladeElementRef, 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 !== 'neutral') {\n return getIn(theme.colors, `interactive.icon.${color}.subtle`);\n }\n return getIn(theme.colors, 'interactive.icon.gray.muted');\n};\n\nconst _BaseSpinner = (\n {\n label,\n labelPosition = 'right',\n accessibilityLabel,\n color = 'neutral',\n size = 'medium',\n testID,\n ...styledProps\n }: BaseSpinnerProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n const { theme } = useTheme();\n return (\n <BaseBox\n ref={ref as never}\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\nconst BaseSpinner = React.forwardRef(_BaseSpinner);\n\nexport type { BaseSpinnerProps };\nexport { BaseSpinner };\n"],"names":["getColor","_ref","color","theme","getIn","colors","_BaseSpinner","_ref2","ref","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","BaseSpinner","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;wNAiDA,IAAMA,QAAQ,CAAG,SAAXA,QAAQA,CAAAC,IAAA,CAAqF,CAAA,IAA/EC,KAAK,CAAAD,IAAA,CAALC,KAAK,CAAEC,KAAK,CAAAF,IAAA,CAALE,KAAK,CAC9B,GAAID,KAAK,EAAIA,KAAK,GAAK,OAAO,CAAE,CAC9B,OAAOE,KAAK,CAACD,KAAK,CAACE,MAAM,CAAE,qCAAqC,CAAC,CACnE,CACA,GAAIH,KAAK,EAAIA,KAAK,GAAK,SAAS,CAAE,CAChC,OAAOE,KAAK,CAACD,KAAK,CAACE,MAAM,CAAE,oBAAoBH,KAAK,CAAA,OAAA,CAAS,CAAC,CAChE,CACA,OAAOE,KAAK,CAACD,KAAK,CAACE,MAAM,CAAE,6BAA6B,CAAC,CAC3D,CAAC,CAED,IAAMC,YAAY,CAAG,SAAfA,YAAYA,CAAAC,KAAA,CAUhBC,GAA+B,CACR,CAAA,IATrBC,KAAK,CAAAF,KAAA,CAALE,KAAK,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,CAAEE,KAAK,CAALA,KAAK,CAAEC,KAAK,CAALA,KAAM,CAAC,CAAE,CAAE,CAAC,CAC/E,CAAC,CACbM,KAAK,EAAIA,KAAK,CAACiC,IAAI,EAAE,CAACC,MAAM,CAAG,CAAC,CAC/BrB,GAAA,CAACC,OAAO,CAAA,CACNqB,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,CAACC,CAAAA,OAAO,CAAC,MAAM,CAACC,MAAM,CAAC,SAAS,CAACjC,IAAI,CAAC,OAAO,CAACb,KAAK,CAAC,yBAAyB,CAAA6B,QAAA,CAC/EtB,KAAK,CACF,CAAC,CACA,CAAC,CACR,IAAI,GACD,CAAC,CAAA,CACH,CAAC,CAEd,CAAC,CAEK,IAAAwC,WAAW,CAAGC,cAAK,CAACC,UAAU,CAAC7C,YAAY;;;;"}
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 { BladeElementRef, 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' | 'onNeutral' | 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 // `onNeutral` renders on a filled neutral surface, which inverts with the\n // theme, so it tracks the surface instead of resolving to a static color.\n if (color && color === 'onNeutral') {\n return getIn(theme.colors, 'interactive.icon.onNeutral.normal');\n }\n if (color && color !== 'neutral') {\n return getIn(theme.colors, `interactive.icon.${color}.subtle`);\n }\n return getIn(theme.colors, 'interactive.icon.gray.muted');\n};\n\nconst _BaseSpinner = (\n {\n label,\n labelPosition = 'right',\n accessibilityLabel,\n color = 'neutral',\n size = 'medium',\n testID,\n ...styledProps\n }: BaseSpinnerProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n const { theme } = useTheme();\n return (\n <BaseBox\n ref={ref as never}\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\nconst BaseSpinner = React.forwardRef(_BaseSpinner);\n\nexport type { BaseSpinnerProps };\nexport { BaseSpinner };\n"],"names":["getColor","_ref","color","theme","getIn","colors","_BaseSpinner","_ref2","ref","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","BaseSpinner","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;wNAiDA,IAAMA,QAAQ,CAAG,SAAXA,QAAQA,CAAAC,IAAA,CAAqF,CAA/E,IAAAC,KAAK,CAAAD,IAAA,CAALC,KAAK,CAAEC,KAAK,CAAAF,IAAA,CAALE,KAAK,CAC9B,GAAID,KAAK,EAAIA,KAAK,GAAK,OAAO,CAAE,CAC9B,OAAOE,KAAK,CAACD,KAAK,CAACE,MAAM,CAAE,qCAAqC,CAAC,CACnE,CAGA,GAAIH,KAAK,EAAIA,KAAK,GAAK,WAAW,CAAE,CAClC,OAAOE,KAAK,CAACD,KAAK,CAACE,MAAM,CAAE,mCAAmC,CAAC,CACjE,CACA,GAAIH,KAAK,EAAIA,KAAK,GAAK,SAAS,CAAE,CAChC,OAAOE,KAAK,CAACD,KAAK,CAACE,MAAM,CAAE,oBAAoBH,KAAK,CAAA,OAAA,CAAS,CAAC,CAChE,CACA,OAAOE,KAAK,CAACD,KAAK,CAACE,MAAM,CAAE,6BAA6B,CAAC,CAC3D,CAAC,CAED,IAAMC,YAAY,CAAG,SAAfA,YAAYA,CAAAC,KAAA,CAUhBC,GAA+B,CACR,CATrB,IAAAC,KAAK,CAAAF,KAAA,CAALE,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KAAK,CAAEF,QAAQ,CAAC,CAAEE,KAAK,CAALA,KAAK,CAAEC,KAAK,CAALA,KAAM,CAAC,CAAE,CAAE,CAAC,CAC/E,CAAC,CACbM,KAAK,EAAIA,KAAK,CAACiC,IAAI,EAAE,CAACC,MAAM,CAAG,CAAC,CAC/BrB,GAAA,CAACC,OAAO,CACNqB,CAAAA,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,CAACC,CAAAA,OAAO,CAAC,MAAM,CAACC,MAAM,CAAC,SAAS,CAACjC,IAAI,CAAC,OAAO,CAACb,KAAK,CAAC,yBAAyB,CAAA6B,QAAA,CAC/EtB,KAAK,CACF,CAAC,CACA,CAAC,CACR,IAAI,CACD,CAAA,CAAA,CAAC,CACH,CAAA,CAAC,CAEd,CAAC,CAEK,IAAAwC,WAAW,CAAGC,cAAK,CAACC,UAAU,CAAC7C,YAAY;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Spinner.js","sources":["../../../../../../src/components/Spinner/Spinner/Spinner.tsx"],"sourcesContent":["import React from 'react';\nimport { BaseSpinner } from '../BaseSpinner';\nimport type { BaseSpinnerProps } from '../BaseSpinner';\nimport type { BladeElementRef } from '~utils/types';\n\ntype SpinnerProps = BaseSpinnerProps & {\n /**\n * Sets the color of the spinner.\n *\n * @default 'default'\n */\n color?: 'primary' | 'neutral' | 'white';\n};\n\nconst _Spinner = (\n {\n label,\n labelPosition,\n accessibilityLabel,\n color = 'neutral',\n size = 'medium',\n testID,\n ...styledProps\n }: SpinnerProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n return (\n <BaseSpinner\n ref={ref as never}\n label={label}\n labelPosition={labelPosition}\n accessibilityLabel={accessibilityLabel ?? label ?? 'Loading'}\n color={color}\n size={size}\n testID={testID}\n {...styledProps}\n />\n );\n};\n\nconst Spinner = React.forwardRef(_Spinner);\n\nexport type { SpinnerProps };\nexport { Spinner };\n"],"names":["this","_Spinner","_ref","ref","_ref2","label","labelPosition","accessibilityLabel","_ref$color","color","_ref$size","size","testID","styledProps","_objectWithoutProperties","_excluded","_jsx","BaseSpinner","Object","assign","Spinner","React","forwardRef"],"mappings":";;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,eAAA,CAAA,oBAAA,CAAA,OAAA,CAAA,MAAA,CAAA,QAAA,CAAA,CAAA,IAAA,KAAA,CAAAA,SAAA,CAAA,YAAA,CAAA,yFAAA,CAcA,IAAMC,QAAQ,CAAG,SAAXA,QAAQA,CAAAC,IAAA,CAUZC,GAA+B,CACR,CAAAC,IAAAA,KAAA,CATrB,IAAAC,KAAK,CAAAH,IAAA,CAALG,KAAK,CACLC,aAAa,CAAAJ,IAAA,CAAbI,aAAa,CACbC,kBAAkB,CAAAL,IAAA,CAAlBK,kBAAkB,CAAAC,UAAA,CAAAN,IAAA,CAClBO,KAAK,CAALA,KAAK,CAAAD,UAAA,GAAA,KAAA,CAAA,CAAG,SAAS,CAAAA,UAAA,CAAAE,SAAA,CAAAR,IAAA,CACjBS,IAAI,CAAJA,IAAI,CAAAD,SAAA,GAAG,KAAA,CAAA,CAAA,QAAQ,CAAAA,SAAA,CACfE,MAAM,CAAAV,IAAA,CAANU,MAAM,CACHC,WAAW,CAAAC,wBAAA,CAAAZ,IAAA,CAAAa,SAAA,CAAA,CAIhB,OACEC,GAAA,CAACC,WAAW,CAAAC,MAAA,CAAAC,MAAA,CAAA,CACVhB,GAAG,CAAEA,GAAa,CAClBE,KAAK,CAAEA,KAAM,CACbC,aAAa,CAAEA,aAAc,CAC7BC,kBAAkB,CAAAH,CAAAA,KAAA,CAAEG,kBAAkB,EAAA,IAAA,CAAlBA,kBAAkB,CAAIF,KAAK,GAAAD,IAAAA,CAAAA,KAAA,CAAI,SAAU,CAC7DK,KAAK,CAAEA,KAAM,CACbE,IAAI,CAAEA,IAAK,CACXC,MAAM,CAAEA,MAAO,CAAA,CACXC,WAAW,CAChB,CAAC,CAEN,CAAC,CAEK,IAAAO,OAAO,CAAGC,cAAK,CAACC,UAAU,CAACrB,QAAQ;;;;"}
1
+ {"version":3,"file":"Spinner.js","sources":["../../../../../../src/components/Spinner/Spinner/Spinner.tsx"],"sourcesContent":["import React from 'react';\nimport { BaseSpinner } from '../BaseSpinner';\nimport type { BaseSpinnerProps } from '../BaseSpinner';\nimport type { BladeElementRef } from '~utils/types';\n\ntype SpinnerProps = BaseSpinnerProps & {\n /**\n * Sets the color of the spinner.\n *\n * @default 'default'\n */\n color?: 'primary' | 'neutral' | 'white' | 'onNeutral';\n};\n\nconst _Spinner = (\n {\n label,\n labelPosition,\n accessibilityLabel,\n color = 'neutral',\n size = 'medium',\n testID,\n ...styledProps\n }: SpinnerProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n return (\n <BaseSpinner\n ref={ref as never}\n label={label}\n labelPosition={labelPosition}\n accessibilityLabel={accessibilityLabel ?? label ?? 'Loading'}\n color={color}\n size={size}\n testID={testID}\n {...styledProps}\n />\n );\n};\n\nconst Spinner = React.forwardRef(_Spinner);\n\nexport type { SpinnerProps };\nexport { Spinner };\n"],"names":["this","_Spinner","_ref","ref","_ref2","label","labelPosition","accessibilityLabel","_ref$color","color","_ref$size","size","testID","styledProps","_objectWithoutProperties","_excluded","_jsx","BaseSpinner","Object","assign","Spinner","React","forwardRef"],"mappings":";;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,eAAA,CAAA,oBAAA,CAAA,OAAA,CAAA,MAAA,CAAA,QAAA,CAAA,CAAA,IAAA,KAAA,CAAAA,SAAA,CAAA,YAAA,CAAA,yFAAA,CAcA,IAAMC,QAAQ,CAAG,SAAXA,QAAQA,CAAAC,IAAA,CAUZC,GAA+B,CACR,CAAAC,IAAAA,KAAA,CATrB,IAAAC,KAAK,CAAAH,IAAA,CAALG,KAAK,CACLC,aAAa,CAAAJ,IAAA,CAAbI,aAAa,CACbC,kBAAkB,CAAAL,IAAA,CAAlBK,kBAAkB,CAAAC,UAAA,CAAAN,IAAA,CAClBO,KAAK,CAALA,KAAK,CAAAD,UAAA,GAAA,KAAA,CAAA,CAAG,SAAS,CAAAA,UAAA,CAAAE,SAAA,CAAAR,IAAA,CACjBS,IAAI,CAAJA,IAAI,CAAAD,SAAA,GAAG,KAAA,CAAA,CAAA,QAAQ,CAAAA,SAAA,CACfE,MAAM,CAAAV,IAAA,CAANU,MAAM,CACHC,WAAW,CAAAC,wBAAA,CAAAZ,IAAA,CAAAa,SAAA,CAAA,CAIhB,OACEC,GAAA,CAACC,WAAW,CAAAC,MAAA,CAAAC,MAAA,CAAA,CACVhB,GAAG,CAAEA,GAAa,CAClBE,KAAK,CAAEA,KAAM,CACbC,aAAa,CAAEA,aAAc,CAC7BC,kBAAkB,CAAAH,CAAAA,KAAA,CAAEG,kBAAkB,EAAA,IAAA,CAAlBA,kBAAkB,CAAIF,KAAK,GAAAD,IAAAA,CAAAA,KAAA,CAAI,SAAU,CAC7DK,KAAK,CAAEA,KAAM,CACbE,IAAI,CAAEA,IAAK,CACXC,MAAM,CAAEA,MAAO,CAAA,CACXC,WAAW,CAChB,CAAC,CAEN,CAAC,CAEK,IAAAO,OAAO,CAAGC,cAAK,CAACC,UAAU,CAACrB,QAAQ;;;;"}
@@ -1,2 +1,2 @@
1
- import '../node_modules/es-toolkit/dist/array/flatten.js';
1
+ import '../node_modules/es-toolkit/dist/compat/array/flatten.js';
2
2
  //# sourceMappingURL=flatten.js.map
@@ -1,2 +1,2 @@
1
- import '../node_modules/es-toolkit/dist/compat/array/flatten.js';
1
+ import '../node_modules/es-toolkit/dist/array/flatten.js';
2
2
  //# sourceMappingURL=flatten3.js.map
@@ -26,8 +26,8 @@ import '../../../utils/getStringChildren/index.js';
26
26
  import '../../../utils/logger/index.js';
27
27
  import '../../../utils/makeAnalyticsAttribute/index.js';
28
28
  import { jsx, jsxs } from 'react/jsx-runtime';
29
- import { throwBladeError } from '../../../utils/logger/logger.js';
30
29
  import { isReactNative } from '../../../utils/platform/isReactNative.js';
30
+ import { throwBladeError } from '../../../utils/logger/logger.js';
31
31
  import { makeSize } from '../../../utils/makeSize/makeSize.js';
32
32
  import { makeSpace } from '../../../utils/makeSpace/makeSpace.js';
33
33
  import { makeBorderSize } from '../../../utils/makeBorderSize/makeBorderSize.js';
@@ -52,34 +52,30 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
52
52
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
53
53
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
54
54
  /**
55
- * `white`, `black` and `transparent` are not feedback colors, so the token
56
- * factories are still called with `primary` and the value is looked up under its
57
- * own key instead of under `base`.
55
+ * `white` and `transparent` are not feedback colors, so the token factories are
56
+ * still called with `primary` and the value is looked up under its own key
57
+ * instead of under `base`.
58
58
  */
59
59
  var isStaticOrTransparentColor = function isStaticOrTransparentColor(color) {
60
- return color === 'white' || color === 'black' || color === 'transparent';
60
+ return color === 'white' || color === 'transparent';
61
+ };
62
+
63
+ /**
64
+ * The filled `neutral` surface needs inverted content and a heavier inner shadow
65
+ * than the shared feedback treatment, so its `primary` emphasis is looked up
66
+ * under a dedicated key. The remaining emphases fall back to `base`.
67
+ */
68
+ var isFilledNeutral = function isFilledNeutral(color, variant) {
69
+ return color === 'neutral' && variant === 'primary';
61
70
  };
62
71
  var getSpinnerColor = function getSpinnerColor(_ref) {
63
72
  var variant = _ref.variant,
64
73
  color = _ref.color;
65
- // `black` only exists as a primary button, so it is looked up separately from
66
- // the colors that carry a full variant record.
67
- if (color === 'black') {
68
- return spinnerColor.black.primary;
69
- }
70
74
  if (color !== 'primary' && color !== 'transparent' && color in spinnerColor) {
71
75
  return spinnerColor[color][variant];
72
76
  }
73
77
  return spinnerColor.base[variant];
74
78
  };
75
- var assertBlackIsPrimary = function assertBlackIsPrimary(variant) {
76
- if (variant !== 'primary') {
77
- throwBladeError({
78
- moduleName: 'BaseButton',
79
- message: "Black color can only be used with primary variant but received \"".concat(variant, "\"")
80
- });
81
- }
82
- };
83
79
  var getRenderElement = function getRenderElement(href) {
84
80
  if (isReactNative()) {
85
81
  return undefined; // as property doesn't work with react native
@@ -95,17 +91,13 @@ var getBackgroundColorToken = function getBackgroundColorToken(_ref2) {
95
91
  color = _ref2.color;
96
92
  var _state = state === 'focus' || state === 'hover' ? 'highlighted' : state;
97
93
 
98
- // For white, black and transparent colors, we use 'primary' as the base color
99
- // since the actual token lookup uses the white/black/transparent specific paths
94
+ // For white and transparent colors, we use 'primary' as the base color
95
+ // since the actual token lookup uses the white/transparent specific paths
100
96
  var gradientColor = isStaticOrTransparentColor(color) || !color ? 'primary' : color;
101
97
  var tokens = backgroundGradient(gradientColor);
102
98
  if (color === 'white') {
103
99
  return tokens.white[variant][_state];
104
100
  }
105
- if (color === 'black') {
106
- assertBlackIsPrimary(variant);
107
- return tokens.black.primary[_state];
108
- }
109
101
  if (color === 'transparent') {
110
102
  if (variant !== 'tertiary') {
111
103
  throw new Error("Transparent color can only be used with tertiary variant but received \"".concat(variant, "\""));
@@ -129,9 +121,8 @@ var getBoxShadowToken = function getBoxShadowToken(_ref3) {
129
121
  if (color === 'white') {
130
122
  return tokens.white[variant][_state];
131
123
  }
132
- if (color === 'black') {
133
- assertBlackIsPrimary(variant);
134
- return tokens.black.primary[_state];
124
+ if (isFilledNeutral(color, variant)) {
125
+ return tokens.neutral.primary[_state];
135
126
  }
136
127
  if (color === 'transparent') {
137
128
  if (variant !== 'tertiary') {
@@ -151,9 +142,8 @@ var getTextColorToken = function getTextColorToken(_ref4) {
151
142
  if (color === 'white') {
152
143
  return tokens.white[variant][_state];
153
144
  }
154
- if (color === 'black') {
155
- assertBlackIsPrimary(variant);
156
- return tokens.black.primary[_state];
145
+ if (isFilledNeutral(color, variant)) {
146
+ return tokens.neutral.primary[_state];
157
147
  }
158
148
  if (color === 'transparent') {
159
149
  if (variant !== 'tertiary') {
@@ -323,7 +313,9 @@ var getProps = function getProps(_ref5) {
323
313
  state: 'focus'
324
314
  })),
325
315
  focusBoxShadow: getBoxShadow('focus', color),
326
- focusRingColor: getIn(theme.colors, 'surface.border.primary.muted'),
316
+ // The system focus ring is a faded primary blue, which the design replaces
317
+ // with a faded neutral ring on the filled neutral surface.
318
+ focusRingColor: getIn(theme.colors, isFilledNeutral(color, variant) ? 'interactive.border.neutral.faded' : 'surface.border.primary.muted'),
327
319
  borderRadius: makeBorderSize(theme.border.radius[_borderRadius !== null && _borderRadius !== void 0 ? _borderRadius : buttonBorderRadius[size]]),
328
320
  motionDuration: 'duration.xquick',
329
321
  motionEasing: 'easing.standard'