@razorpay/blade 10.13.1 → 10.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/build/components/index.d.ts +114 -46
  2. package/build/components/index.development.web.js +166 -147
  3. package/build/components/index.development.web.js.map +1 -1
  4. package/build/components/index.native.d.ts +114 -46
  5. package/build/components/index.native.js +18 -18
  6. package/build/components/index.native.js.map +1 -1
  7. package/build/components/index.production.web.js +166 -147
  8. package/build/components/index.production.web.js.map +1 -1
  9. package/build/css/bankingThemeDarkDesktop.css +333 -157
  10. package/build/css/bankingThemeDarkMobile.css +333 -157
  11. package/build/css/bankingThemeLightDesktop.css +332 -156
  12. package/build/css/bankingThemeLightMobile.css +332 -156
  13. package/build/css/paymentThemeDarkDesktop.css +333 -157
  14. package/build/css/paymentThemeDarkMobile.css +333 -157
  15. package/build/css/paymentThemeLightDesktop.css +332 -156
  16. package/build/css/paymentThemeLightMobile.css +332 -156
  17. package/build/tokens/index.d.ts +46 -25
  18. package/build/tokens/index.development.web.js +3344 -1488
  19. package/build/tokens/index.development.web.js.map +1 -1
  20. package/build/tokens/index.native.d.ts +46 -25
  21. package/build/tokens/index.native.js +2 -2
  22. package/build/tokens/index.native.js.map +1 -1
  23. package/build/tokens/index.production.web.js +3344 -1488
  24. package/build/tokens/index.production.web.js.map +1 -1
  25. package/build/utils/index.d.ts +46 -25
  26. package/build/utils/index.development.web.js.map +1 -1
  27. package/build/utils/index.native.d.ts +46 -25
  28. package/build/utils/index.native.js.map +1 -1
  29. package/package.json +1 -1
@@ -367,23 +367,46 @@ declare type ActionStatesWithContrast = {
367
367
  active: ColorContrast;
368
368
  disabled: ColorContrast;
369
369
  };
370
+ declare type ActionStatesWithLowContrast = {
371
+ default: Pick<ColorContrast, 'lowContrast'>;
372
+ hover: Pick<ColorContrast, 'lowContrast'>;
373
+ focus: Pick<ColorContrast, 'lowContrast'>;
374
+ active: Pick<ColorContrast, 'lowContrast'>;
375
+ disabled: Pick<ColorContrast, 'lowContrast'>;
376
+ };
370
377
  declare type ActionVariants = {
371
378
  primary: ActionStates;
372
379
  secondary: ActionStates;
373
380
  tertiary: ActionStates;
374
381
  link: LinkActionStates;
375
382
  };
376
- declare type ActionVariantsWithContrast = {
377
- primary: ActionStatesWithContrast;
378
- secondary: ActionStatesWithContrast;
379
- tertiary: ActionStatesWithContrast;
380
- link: ActionStatesWithContrast;
381
- };
382
383
  declare type FeedbackActions = {
383
- background: Pick<ActionVariantsWithContrast, 'primary'>;
384
- border: Pick<ActionVariantsWithContrast, 'primary'>;
385
- text: Pick<ActionVariantsWithContrast, 'link' | 'primary'>;
386
- icon: Pick<ActionVariantsWithContrast, 'link' | 'primary'>;
384
+ action: {
385
+ background: {
386
+ primary: ActionStatesWithContrast;
387
+ secondary: ActionStatesWithLowContrast;
388
+ };
389
+ border: {
390
+ primary: ActionStatesWithContrast;
391
+ secondary: ActionStatesWithLowContrast;
392
+ };
393
+ text: {
394
+ link: ActionStatesWithContrast;
395
+ primary: ActionStatesWithContrast;
396
+ secondary: ActionStatesWithLowContrast;
397
+ };
398
+ icon: {
399
+ link: ActionStatesWithContrast;
400
+ primary: ActionStatesWithContrast;
401
+ secondary: ActionStatesWithLowContrast;
402
+ };
403
+ };
404
+ };
405
+ declare type WhiteColors = {
406
+ background: Pick<ActionVariants, 'primary' | 'secondary' | 'tertiary'>;
407
+ border: Pick<ActionVariants, 'primary' | 'secondary' | 'tertiary'>;
408
+ text: Pick<ActionVariants, 'link' | 'primary' | 'secondary' | 'tertiary'>;
409
+ icon: Pick<ActionVariants, 'link' | 'primary' | 'secondary' | 'tertiary'>;
387
410
  };
388
411
  declare type Colors = {
389
412
  brand: {
@@ -396,21 +419,11 @@ declare type Colors = {
396
419
  border: Record<Feedback, ColorContrast>;
397
420
  text: Record<Feedback, ColorContrast>;
398
421
  icon: Record<Feedback, ColorContrast>;
399
- positive: {
400
- action: FeedbackActions;
401
- };
402
- negative: {
403
- action: FeedbackActions;
404
- };
405
- information: {
406
- action: FeedbackActions;
407
- };
408
- notice: {
409
- action: FeedbackActions;
410
- };
411
- neutral: {
412
- action: FeedbackActions;
413
- };
422
+ positive: FeedbackActions;
423
+ negative: FeedbackActions;
424
+ information: FeedbackActions;
425
+ notice: FeedbackActions;
426
+ neutral: FeedbackActions;
414
427
  };
415
428
  surface: {
416
429
  background: Record<'level1' | 'level2' | 'level3', ColorContrast>;
@@ -419,6 +432,8 @@ declare type Colors = {
419
432
  action: {
420
433
  icon: ActionStatesWithContrast;
421
434
  };
435
+ overlay: Record<'background', Record<400 | 800, string>>;
436
+ popup: Record<'background', string>;
422
437
  };
423
438
  overlay: Record<'background', string>;
424
439
  action: {
@@ -441,6 +456,12 @@ declare type Colors = {
441
456
  blue: ColorContrast;
442
457
  };
443
458
  };
459
+ static: {
460
+ white: string;
461
+ };
462
+ white: {
463
+ action: WhiteColors;
464
+ };
444
465
  };
445
466
  declare type ColorsWithModes = Record<ColorSchemeModes, Colors>;
446
467
  declare type ThemeTokens = {
@@ -1969,12 +1990,13 @@ declare type ActionIconColors = `action.icon.${DotNotationColorStringToken<Theme
1969
1990
  declare type TextIconColors = `surface.text.${DotNotationColorStringToken<Theme['colors']['surface']['text']>}`;
1970
1991
  declare type SurfaceActionIconColors = `surface.action.icon.${DotNotationColorStringToken<Theme['colors']['surface']['action']['icon']>}`;
1971
1992
  declare type BadgeIconColors = `badge.icon.${DotNotationColorStringToken<Theme['colors']['badge']['icon']>}`;
1993
+ declare type WhiteIconColors = `white.action.icon.${DotNotationColorStringToken<Theme['colors']['white']['action']['icon']>}`;
1972
1994
  declare type IconSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge';
1973
1995
  declare type IconProps = {
1974
1996
  /**
1975
1997
  * Color token (not to be confused with actual hsla value)
1976
1998
  */
1977
- color?: ActionIconColors | SurfaceActionIconColors | FeedbackIconColors | FeedbackActionIconColors | TextIconColors | BadgeIconColors | 'currentColor';
1999
+ color?: ActionIconColors | SurfaceActionIconColors | FeedbackIconColors | FeedbackActionIconColors | TextIconColors | BadgeIconColors | WhiteIconColors | 'currentColor';
1978
2000
  size?: IconSize;
1979
2001
  } & StyledPropsBlade;
1980
2002
  declare type IconComponent = React.ComponentType<IconProps>;
@@ -1986,11 +2008,18 @@ declare type BadgeProps = {
1986
2008
  */
1987
2009
  children: StringChildrenType;
1988
2010
  /**
1989
- * Sets the variant of the badge.
2011
+ * This prop is deprecated in favor of `color`.
1990
2012
  *
2013
+ * @deprecated Use the `color` prop instead
1991
2014
  * @default 'neutral'
1992
2015
  */
1993
2016
  variant?: Feedback | 'blue';
2017
+ /**
2018
+ * Sets the color of the badge.
2019
+ *
2020
+ * @default 'neutral'
2021
+ */
2022
+ color?: Feedback | 'default';
1994
2023
  /**
1995
2024
  * Sets the contrast of the badge.
1996
2025
  *
@@ -2016,7 +2045,7 @@ declare type BadgeProps = {
2016
2045
  */
2017
2046
  fontWeight?: 'regular' | 'bold';
2018
2047
  } & TestID & StyledPropsBlade;
2019
- declare const Badge: ({ children, contrast, fontWeight, icon, size, variant, testID, ...styledProps }: BadgeProps) => ReactElement;
2048
+ declare const Badge: ({ children, contrast, fontWeight, icon, size, variant, color, testID, ...styledProps }: BadgeProps) => ReactElement;
2020
2049
 
2021
2050
  declare type ActionListItemProps = {
2022
2051
  title: string;
@@ -2164,11 +2193,16 @@ declare type AlertProps = {
2164
2193
  */
2165
2194
  isFullWidth?: boolean;
2166
2195
  /**
2167
- * Sets the color tone
2196
+ * This prop is deprecated in favor of the `color` prop.
2168
2197
  *
2198
+ * @deprecated Use `color` instead
2169
2199
  * @default neutral
2170
2200
  */
2171
2201
  intent?: Feedback;
2202
+ /**
2203
+ * Sets the color tone
2204
+ */
2205
+ color?: Feedback;
2172
2206
  /**
2173
2207
  * Renders a primary action button and a secondary action link button
2174
2208
  */
@@ -2183,7 +2217,7 @@ declare type AlertProps = {
2183
2217
  secondary?: SecondaryAction;
2184
2218
  };
2185
2219
  } & TestID & StyledPropsBlade;
2186
- declare const Alert: ({ description, title, isDismissible, onDismiss, contrast, isFullWidth, intent, actions, testID, ...styledProps }: AlertProps) => ReactElement | null;
2220
+ declare const Alert: ({ description, title, isDismissible, onDismiss, contrast, isFullWidth, intent, color, actions, testID, ...styledProps }: AlertProps) => ReactElement | null;
2187
2221
 
2188
2222
  declare const Box: React__default.ForwardRefExoticComponent<Partial<PaddingProps & MarginProps & {
2189
2223
  width: SpacingValueType | {
@@ -2906,11 +2940,12 @@ declare type FeedbackActionColors = `feedback.${Feedback}.action.text.${DotNotat
2906
2940
  declare type SurfaceColors = `surface.text.${DotNotationColorStringToken<Theme['colors']['surface']['text']>}`;
2907
2941
  declare type ActionColors = `action.text.${DotNotationColorStringToken<Theme['colors']['action']['text']>}`;
2908
2942
  declare type BadgeTextColors = `badge.text.${DotNotationColorStringToken<Theme['colors']['badge']['text']>}`;
2943
+ declare type WhiteTextColors = `white.action.text.${DotNotationColorStringToken<Theme['colors']['white']['action']['text']>}`;
2909
2944
  declare type BrandPrimaryColors = `brand.primary.${keyof Theme['colors']['brand']['primary']}`;
2910
2945
  declare type As = 'code' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'abbr' | 'q' | 'cite' | 'figcaption' | 'div';
2911
2946
  declare type BaseTextProps = {
2912
2947
  id?: string;
2913
- color?: BrandPrimaryColors | ActionColors | FeedbackColors | SurfaceColors | FeedbackActionColors | BadgeTextColors;
2948
+ color?: BrandPrimaryColors | ActionColors | FeedbackColors | SurfaceColors | FeedbackActionColors | WhiteTextColors | BadgeTextColors;
2914
2949
  fontFamily?: keyof Theme['typography']['fonts']['family'];
2915
2950
  fontSize?: keyof Theme['typography']['fonts']['size'];
2916
2951
  fontWeight?: keyof Theme['typography']['fonts']['weight'];
@@ -2936,8 +2971,7 @@ declare type BaseTextProps = {
2936
2971
  declare type BaseTextSizes = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
2937
2972
 
2938
2973
  declare type BaseLinkCommonProps = {
2939
- intent?: 'positive' | 'negative' | 'notice' | 'information' | 'neutral';
2940
- contrast?: 'low' | 'high';
2974
+ color?: 'default' | 'white' | 'positive' | 'negative' | 'notice' | 'information' | 'neutral';
2941
2975
  icon?: IconComponent;
2942
2976
  iconPosition?: 'left' | 'right';
2943
2977
  onClick?: (event: SyntheticEvent) => void;
@@ -3002,6 +3036,7 @@ declare type BaseLinkProps = BaseLinkAnchorVariantProps | BaseLinkButtonVariantP
3002
3036
  declare type LinkCommonProps = {
3003
3037
  variant?: 'anchor' | 'button';
3004
3038
  icon?: IconComponent;
3039
+ color?: 'default' | 'white' | 'neutral';
3005
3040
  iconPosition?: 'left' | 'right';
3006
3041
  isDisabled?: boolean;
3007
3042
  onClick?: (event: SyntheticEvent) => void;
@@ -3093,8 +3128,7 @@ declare type BaseButtonCommonProps = {
3093
3128
  isLoading?: boolean;
3094
3129
  accessibilityProps?: Partial<AccessibilityProps>;
3095
3130
  variant?: 'primary' | 'secondary' | 'tertiary';
3096
- contrast?: 'low' | 'high';
3097
- intent?: 'positive' | 'negative' | 'notice' | 'information' | 'neutral';
3131
+ color?: 'default' | 'white' | 'positive' | 'negative' | 'notice' | 'information' | 'neutral';
3098
3132
  } & TestID & StyledPropsBlade & BladeCommonEvents;
3099
3133
  declare type BaseButtonWithoutIconProps = BaseButtonCommonProps & {
3100
3134
  icon?: undefined;
@@ -3124,6 +3158,7 @@ declare type ButtonCommonProps = {
3124
3158
  */
3125
3159
  rel?: BaseButtonProps['rel'];
3126
3160
  variant?: 'primary' | 'secondary' | 'tertiary';
3161
+ color?: 'default' | 'white' | 'positive' | 'negative';
3127
3162
  size?: 'xsmall' | 'small' | 'medium' | 'large';
3128
3163
  iconPosition?: 'left' | 'right';
3129
3164
  isDisabled?: boolean;
@@ -3164,18 +3199,25 @@ declare type CounterProps = {
3164
3199
  */
3165
3200
  max?: number;
3166
3201
  /**
3167
- * Sets the intent of the counter.
3202
+ * This prop is deprecated in favor of `color`.
3168
3203
  *
3169
3204
  * @default 'neutral'
3170
- * @deprecated Use `variant` instead
3205
+ * @deprecated Use `color` instead
3171
3206
  */
3172
3207
  intent?: Feedback;
3173
3208
  /**
3174
- * Sets the variant of the counter.
3209
+ * This prop is deprecated in favor of `color`.
3175
3210
  *
3176
3211
  * @default 'neutral'
3212
+ * @deprecated Use `color` instead
3177
3213
  */
3178
3214
  variant?: Feedback | 'blue';
3215
+ /**
3216
+ * Sets the color of the counter.
3217
+ *
3218
+ * @default 'neutral'
3219
+ */
3220
+ color?: Feedback | 'default';
3179
3221
  /**
3180
3222
  * Sets the contrast of the counter.
3181
3223
  *
@@ -3189,7 +3231,7 @@ declare type CounterProps = {
3189
3231
  */
3190
3232
  size?: 'small' | 'medium' | 'large';
3191
3233
  } & TestID & StyledPropsBlade;
3192
- declare const Counter: ({ value, max, intent, variant, contrast, size, testID, ...styledProps }: CounterProps) => React.ReactElement;
3234
+ declare const Counter: ({ value, max, intent, variant, color, contrast, size, testID, ...styledProps }: CounterProps) => React.ReactElement;
3193
3235
 
3194
3236
  declare const validAsValues$3: readonly ["span", "h1", "h2", "h3", "h4", "h5", "h6"];
3195
3237
  declare type TitleProps = {
@@ -4033,10 +4075,16 @@ declare type ChipProps = {
4033
4075
  */
4034
4076
  icon?: IconComponent;
4035
4077
  /**
4036
- * Sets the Chip's visual intent
4078
+ * This is deprecated in favor of the `color` prop.
4037
4079
  *
4080
+ * @deprecated Use the `color` prop instead.
4038
4081
  */
4039
4082
  intent?: 'positive' | 'negative' | 'none';
4083
+ /**
4084
+ * Sets the Chip's visual color.
4085
+ *
4086
+ */
4087
+ color?: 'positive' | 'negative' | 'default';
4040
4088
  /**
4041
4089
  * If `true`, the Chip will be disabled
4042
4090
  *
@@ -4105,17 +4153,24 @@ declare type ChipGroupProps = {
4105
4153
  */
4106
4154
  value?: string | string[];
4107
4155
  /**
4108
- * Sets the ChipGroups's visual intent, it will propagate down to all the Chips
4156
+ * This is deprecated in favor of the `color` prop.
4109
4157
  *
4110
4158
  * @default "none"
4159
+ * @deprecated Use the `color` prop instead.
4111
4160
  */
4112
4161
  intent?: 'positive' | 'negative' | 'none';
4162
+ /**
4163
+ * Sets the ChipGroups's visual color, it will propagate down to all the Chips
4164
+ *
4165
+ */
4166
+ color?: 'positive' | 'negative' | 'default';
4113
4167
  } & TestID & StyledPropsBlade;
4114
4168
 
4115
4169
  declare const Chip: React__default.ForwardRefExoticComponent<{
4116
4170
  children: StringChildrenType;
4117
4171
  icon?: IconComponent | undefined;
4118
4172
  intent?: "none" | "negative" | "positive" | undefined;
4173
+ color?: "negative" | "positive" | "default" | undefined;
4119
4174
  isDisabled?: boolean | undefined;
4120
4175
  value?: string | undefined;
4121
4176
  } & TestID & Partial<Omit<MarginProps & Pick<FlexboxProps, "alignSelf" | "justifySelf" | "order" | "placeSelf"> & {
@@ -4278,7 +4333,7 @@ declare const Chip: React__default.ForwardRefExoticComponent<{
4278
4333
  } | undefined;
4279
4334
  }, "display">, "__brand__">> & React__default.RefAttributes<BladeElementRef>>;
4280
4335
 
4281
- declare const ChipGroup: ({ accessibilityLabel, children, isDisabled, name, defaultValue, onChange, value, size, intent, testID, selectionType, ...styledProps }: ChipGroupProps) => React__default.ReactElement;
4336
+ declare const ChipGroup: ({ accessibilityLabel, children, isDisabled, name, defaultValue, onChange, value, size, intent, color, testID, selectionType, ...styledProps }: ChipGroupProps) => React__default.ReactElement;
4282
4337
 
4283
4338
  declare type DividerProps = {
4284
4339
  /**
@@ -5688,7 +5743,12 @@ declare type RadioGroupProps = {
5688
5743
  declare const RadioGroup: ({ children, label, helpText, isDisabled, isRequired, necessityIndicator, labelPosition, validationState, errorText, name, defaultValue, onChange, value, size, testID, ...styledProps }: RadioGroupProps) => React__default.ReactElement;
5689
5744
 
5690
5745
  declare type BaseSpinnerProps = {
5691
- intent?: Feedback;
5746
+ /**
5747
+ * Sets the color of the spinner.
5748
+ *
5749
+ * @default 'default'
5750
+ */
5751
+ color?: 'default' | 'white' | Feedback;
5692
5752
  /**
5693
5753
  * Sets the label of the spinner.
5694
5754
  *
@@ -5701,8 +5761,9 @@ declare type BaseSpinnerProps = {
5701
5761
  */
5702
5762
  labelPosition?: 'right' | 'bottom';
5703
5763
  /**
5704
- * Sets the contrast of the spinner.
5764
+ * This is deprecated in favor of the `color` prop.
5705
5765
  *
5766
+ * @deprecated Use `color="white"` for high contrast and `color="default"` for low contrast
5706
5767
  * @default 'low'
5707
5768
  */
5708
5769
  contrast?: ColorContrastTypes;
@@ -5719,8 +5780,15 @@ declare type BaseSpinnerProps = {
5719
5780
  accessibilityLabel: string;
5720
5781
  } & TestID & StyledPropsBlade;
5721
5782
 
5722
- declare type SpinnerProps = Omit<BaseSpinnerProps, 'intent'>;
5723
- declare const Spinner: ({ label, labelPosition, accessibilityLabel, contrast, size, testID, ...styledProps }: SpinnerProps) => React.ReactElement;
5783
+ declare type SpinnerProps = Omit<BaseSpinnerProps, 'intent'> & {
5784
+ /**
5785
+ * Sets the color of the spinner.
5786
+ *
5787
+ * @default 'default'
5788
+ */
5789
+ color?: 'default' | 'white';
5790
+ };
5791
+ declare const Spinner: ({ label, labelPosition, accessibilityLabel, color, contrast, size, testID, ...styledProps }: SpinnerProps) => React.ReactElement;
5724
5792
 
5725
5793
  declare type SkipNavLinkProps = {
5726
5794
  id?: string;