@razorpay/blade 8.6.1 → 8.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/index.d.ts +63 -17
- package/build/components/index.native.d.ts +63 -17
- package/build/components/index.native.js +4 -4
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.web.js +58 -22
- package/build/components/index.web.js.map +1 -1
- package/build/css/bankingThemeDarkDesktop.css +1 -1
- package/build/css/bankingThemeDarkMobile.css +1 -1
- package/build/css/bankingThemeLightDesktop.css +1 -1
- package/build/css/bankingThemeLightMobile.css +1 -1
- package/build/css/paymentThemeDarkDesktop.css +1 -1
- package/build/css/paymentThemeDarkMobile.css +1 -1
- package/build/css/paymentThemeLightDesktop.css +1 -1
- package/build/css/paymentThemeLightMobile.css +1 -1
- package/codemods/migrate-typography/transformers/migrate-typography.ts +0 -0
- package/package.json +2 -2
|
@@ -2670,7 +2670,9 @@ type TextCommonProps$1 = {
|
|
|
2670
2670
|
children: React.ReactNode;
|
|
2671
2671
|
weight?: keyof Theme$1['typography']['fonts']['weight'];
|
|
2672
2672
|
/**
|
|
2673
|
-
*
|
|
2673
|
+
* Overrides the color of the Text component.
|
|
2674
|
+
*
|
|
2675
|
+
* **Note** This takes priority over `type` and `constrast` prop to decide color of text
|
|
2674
2676
|
*/
|
|
2675
2677
|
color?: BaseTextProps$1['color'];
|
|
2676
2678
|
textAlign?: BaseTextProps$1['textAlign'];
|
|
@@ -4389,14 +4391,6 @@ declare const List: ({ variant, size, children, icon, testID, ...styledProps }:
|
|
|
4389
4391
|
declare type ListItemLinkProps = Exclude<LinkProps, 'size' | 'variant' | 'isDisabled'>;
|
|
4390
4392
|
declare const ListItemLink: ({ accessibilityLabel, children, href, icon, iconPosition, onClick, rel, target, testID, }: ListItemLinkProps) => React.ReactElement;
|
|
4391
4393
|
|
|
4392
|
-
declare type TitleProps = {
|
|
4393
|
-
size?: 'small' | 'medium' | 'large' | 'xlarge';
|
|
4394
|
-
contrast?: ColorContrastTypes;
|
|
4395
|
-
type?: TextTypes;
|
|
4396
|
-
children: StringChildrenType;
|
|
4397
|
-
} & TestID & StyledPropsBlade;
|
|
4398
|
-
declare const Title: ({ size, type, contrast, children, testID, ...styledProps }: TitleProps) => ReactElement;
|
|
4399
|
-
|
|
4400
4394
|
declare type FeedbackColors = `feedback.text.${DotNotationColorStringToken<Theme$1['colors']['feedback']['text']>}`;
|
|
4401
4395
|
declare type FeedbackActionColors = `feedback.${Feedback}.action.text.${DotNotationColorStringToken<Theme$1['colors']['feedback'][Feedback]['action']['text']>}`;
|
|
4402
4396
|
declare type SurfaceColors = `surface.text.${DotNotationColorStringToken<Theme$1['colors']['surface']['text']>}`;
|
|
@@ -4428,9 +4422,29 @@ declare type BaseTextProps = {
|
|
|
4428
4422
|
componentName?: 'text' | 'title' | 'heading' | 'code';
|
|
4429
4423
|
} & TestID & StyledPropsBlade;
|
|
4430
4424
|
|
|
4425
|
+
declare type TitleProps = {
|
|
4426
|
+
/**
|
|
4427
|
+
* Overrides the color of the Title component.
|
|
4428
|
+
*
|
|
4429
|
+
* **Note** This takes priority over `type` and `constrast` prop to decide color of title
|
|
4430
|
+
*/
|
|
4431
|
+
color?: BaseTextProps['color'];
|
|
4432
|
+
size?: 'small' | 'medium' | 'large' | 'xlarge';
|
|
4433
|
+
contrast?: ColorContrastTypes;
|
|
4434
|
+
type?: TextTypes;
|
|
4435
|
+
children: StringChildrenType;
|
|
4436
|
+
} & TestID & StyledPropsBlade;
|
|
4437
|
+
declare const Title: ({ size, type, contrast, color, children, testID, ...styledProps }: TitleProps) => ReactElement;
|
|
4438
|
+
|
|
4431
4439
|
declare type HeadingVariant = 'regular' | 'subheading';
|
|
4432
4440
|
declare type HeadingSize = 'small' | 'medium' | 'large';
|
|
4433
4441
|
declare type HeadingCommonProps = {
|
|
4442
|
+
/**
|
|
4443
|
+
* Overrides the color of the Heading component.
|
|
4444
|
+
*
|
|
4445
|
+
* **Note** This takes priority over `type` and `constrast` prop to decide color of heading
|
|
4446
|
+
*/
|
|
4447
|
+
color?: BaseTextProps['color'];
|
|
4434
4448
|
type?: TextTypes;
|
|
4435
4449
|
contrast?: ColorContrastTypes;
|
|
4436
4450
|
children: StringChildrenType;
|
|
@@ -4462,7 +4476,7 @@ declare type HeadingProps<T> = T extends {
|
|
|
4462
4476
|
} ? Variant extends Exclude<HeadingVariant, 'subheading'> ? HeadingNormalVariant : Variant extends 'subheading' ? HeadingSubHeadingVariant : T : T;
|
|
4463
4477
|
declare const Heading: <T extends {
|
|
4464
4478
|
variant: HeadingVariant;
|
|
4465
|
-
}>({ variant, size, type, weight, contrast, children, testID, textAlign, ...styledProps }: HeadingProps<T>) => ReactElement;
|
|
4479
|
+
}>({ variant, size, type, weight, contrast, color, children, testID, textAlign, ...styledProps }: HeadingProps<T>) => ReactElement;
|
|
4466
4480
|
|
|
4467
4481
|
declare type TextCommonProps = {
|
|
4468
4482
|
type?: TextTypes;
|
|
@@ -4471,7 +4485,9 @@ declare type TextCommonProps = {
|
|
|
4471
4485
|
children: React.ReactNode;
|
|
4472
4486
|
weight?: keyof Theme$1['typography']['fonts']['weight'];
|
|
4473
4487
|
/**
|
|
4474
|
-
*
|
|
4488
|
+
* Overrides the color of the Text component.
|
|
4489
|
+
*
|
|
4490
|
+
* **Note** This takes priority over `type` and `constrast` prop to decide color of text
|
|
4475
4491
|
*/
|
|
4476
4492
|
color?: BaseTextProps['color'];
|
|
4477
4493
|
textAlign?: BaseTextProps['textAlign'];
|
|
@@ -4498,15 +4514,18 @@ declare type TextForwardedAs = {
|
|
|
4498
4514
|
declare type GetTextPropsReturn = Omit<BaseTextProps, 'children'> & TextForwardedAs;
|
|
4499
4515
|
declare type GetTextProps<T extends {
|
|
4500
4516
|
variant: TextVariant;
|
|
4501
|
-
}> = Pick<TextProps<T>, 'type' | 'variant' | 'weight' | 'size' | 'contrast' | 'testID' | 'textAlign'>;
|
|
4517
|
+
}> = Pick<TextProps<T>, 'type' | 'variant' | 'weight' | 'size' | 'contrast' | 'color' | 'testID' | 'textAlign'>;
|
|
4502
4518
|
declare const getTextProps: <T extends {
|
|
4503
4519
|
variant: TextVariant;
|
|
4504
|
-
}>({ variant, type, weight, size, contrast, testID, textAlign, }: GetTextProps<T>) => GetTextPropsReturn;
|
|
4520
|
+
}>({ variant, type, weight, size, color, contrast, testID, textAlign, }: GetTextProps<T>) => GetTextPropsReturn;
|
|
4505
4521
|
declare const Text: <T extends {
|
|
4506
4522
|
variant: TextVariant;
|
|
4507
4523
|
}>({ variant, weight, size, type, contrast, truncateAfterLines, children, color, testID, textAlign, ...styledProps }: TextProps<T>) => ReactElement;
|
|
4508
4524
|
|
|
4509
|
-
declare type
|
|
4525
|
+
declare type CodeCommonProps = {
|
|
4526
|
+
/**
|
|
4527
|
+
* Sets the color of the Heading component.
|
|
4528
|
+
*/
|
|
4510
4529
|
children: StringChildrenType;
|
|
4511
4530
|
/**
|
|
4512
4531
|
* Decides the fontSize and padding of Code
|
|
@@ -4515,7 +4534,34 @@ declare type CodeProps = {
|
|
|
4515
4534
|
*/
|
|
4516
4535
|
size?: 'small' | 'medium';
|
|
4517
4536
|
weight?: 'regular' | 'bold';
|
|
4537
|
+
isHighlighted?: boolean;
|
|
4538
|
+
color?: BaseTextProps['color'];
|
|
4518
4539
|
} & TestID & StyledPropsBlade;
|
|
4540
|
+
declare type CodeHighlightedProps = CodeCommonProps & {
|
|
4541
|
+
/**
|
|
4542
|
+
* Adds background color to highlight the text
|
|
4543
|
+
*
|
|
4544
|
+
* @default true
|
|
4545
|
+
*/
|
|
4546
|
+
isHighlighted?: true;
|
|
4547
|
+
/**
|
|
4548
|
+
* color prop can only be added when `isHighlighted` is set to `false`
|
|
4549
|
+
*/
|
|
4550
|
+
color?: undefined;
|
|
4551
|
+
};
|
|
4552
|
+
declare type CodeNonHighlightedProps = CodeCommonProps & {
|
|
4553
|
+
/**
|
|
4554
|
+
* Adds background color to highlight the text
|
|
4555
|
+
*
|
|
4556
|
+
* @default true
|
|
4557
|
+
*/
|
|
4558
|
+
isHighlighted: false;
|
|
4559
|
+
/**
|
|
4560
|
+
* color prop to set color of text when `isHighlighted` is set to false
|
|
4561
|
+
*/
|
|
4562
|
+
color?: BaseTextProps['color'];
|
|
4563
|
+
};
|
|
4564
|
+
declare type CodeProps = CodeHighlightedProps | CodeNonHighlightedProps;
|
|
4519
4565
|
/**
|
|
4520
4566
|
* Code component can be used for displaying token, variable names, or inlined code snippets.
|
|
4521
4567
|
*
|
|
@@ -4535,14 +4581,14 @@ declare type CodeProps = {
|
|
|
4535
4581
|
* In React Native, you would have to align it using flex to make sure the Code and the surrounding text is correctly aligned
|
|
4536
4582
|
*
|
|
4537
4583
|
* ```tsx
|
|
4538
|
-
* <
|
|
4584
|
+
* <Box flexWrap="wrap" flexDirection="row" alignItems="flex-start">
|
|
4539
4585
|
* <Text>Lorem ipsum </Text>
|
|
4540
4586
|
* <Code>SENTRY_TOKEN</Code>
|
|
4541
4587
|
* <Text> normal text</Text>
|
|
4542
|
-
* </
|
|
4588
|
+
* </Box>
|
|
4543
4589
|
* ```
|
|
4544
4590
|
*/
|
|
4545
|
-
declare const Code: ({ children, size, weight, testID, ...styledProps }: CodeProps) => JSX.Element;
|
|
4591
|
+
declare const Code: ({ children, size, weight, isHighlighted, color, testID, ...styledProps }: CodeProps) => JSX.Element;
|
|
4546
4592
|
|
|
4547
4593
|
declare type ListItemCodeProps = Exclude<CodeProps, 'size'>;
|
|
4548
4594
|
declare const ListItemCode: ({ children, testID }: ListItemCodeProps) => React.ReactElement;
|
|
@@ -2672,7 +2672,9 @@ type TextCommonProps$1 = {
|
|
|
2672
2672
|
children: React.ReactNode;
|
|
2673
2673
|
weight?: keyof Theme$1['typography']['fonts']['weight'];
|
|
2674
2674
|
/**
|
|
2675
|
-
*
|
|
2675
|
+
* Overrides the color of the Text component.
|
|
2676
|
+
*
|
|
2677
|
+
* **Note** This takes priority over `type` and `constrast` prop to decide color of text
|
|
2676
2678
|
*/
|
|
2677
2679
|
color?: BaseTextProps$1['color'];
|
|
2678
2680
|
textAlign?: BaseTextProps$1['textAlign'];
|
|
@@ -4392,14 +4394,6 @@ declare const List: ({ variant, size, children, icon, testID, ...styledProps }:
|
|
|
4392
4394
|
declare type ListItemLinkProps = Exclude<LinkProps, 'size' | 'variant' | 'isDisabled'>;
|
|
4393
4395
|
declare const ListItemLink: ({ accessibilityLabel, children, href, icon, iconPosition, onClick, rel, target, testID, }: ListItemLinkProps) => React.ReactElement;
|
|
4394
4396
|
|
|
4395
|
-
declare type TitleProps = {
|
|
4396
|
-
size?: 'small' | 'medium' | 'large' | 'xlarge';
|
|
4397
|
-
contrast?: ColorContrastTypes;
|
|
4398
|
-
type?: TextTypes;
|
|
4399
|
-
children: StringChildrenType;
|
|
4400
|
-
} & TestID & StyledPropsBlade;
|
|
4401
|
-
declare const Title: ({ size, type, contrast, children, testID, ...styledProps }: TitleProps) => ReactElement;
|
|
4402
|
-
|
|
4403
4397
|
declare type FeedbackColors = `feedback.text.${DotNotationColorStringToken<Theme$1['colors']['feedback']['text']>}`;
|
|
4404
4398
|
declare type FeedbackActionColors = `feedback.${Feedback}.action.text.${DotNotationColorStringToken<Theme$1['colors']['feedback'][Feedback]['action']['text']>}`;
|
|
4405
4399
|
declare type SurfaceColors = `surface.text.${DotNotationColorStringToken<Theme$1['colors']['surface']['text']>}`;
|
|
@@ -4431,9 +4425,29 @@ declare type BaseTextProps = {
|
|
|
4431
4425
|
componentName?: 'text' | 'title' | 'heading' | 'code';
|
|
4432
4426
|
} & TestID & StyledPropsBlade;
|
|
4433
4427
|
|
|
4428
|
+
declare type TitleProps = {
|
|
4429
|
+
/**
|
|
4430
|
+
* Overrides the color of the Title component.
|
|
4431
|
+
*
|
|
4432
|
+
* **Note** This takes priority over `type` and `constrast` prop to decide color of title
|
|
4433
|
+
*/
|
|
4434
|
+
color?: BaseTextProps['color'];
|
|
4435
|
+
size?: 'small' | 'medium' | 'large' | 'xlarge';
|
|
4436
|
+
contrast?: ColorContrastTypes;
|
|
4437
|
+
type?: TextTypes;
|
|
4438
|
+
children: StringChildrenType;
|
|
4439
|
+
} & TestID & StyledPropsBlade;
|
|
4440
|
+
declare const Title: ({ size, type, contrast, color, children, testID, ...styledProps }: TitleProps) => ReactElement;
|
|
4441
|
+
|
|
4434
4442
|
declare type HeadingVariant = 'regular' | 'subheading';
|
|
4435
4443
|
declare type HeadingSize = 'small' | 'medium' | 'large';
|
|
4436
4444
|
declare type HeadingCommonProps = {
|
|
4445
|
+
/**
|
|
4446
|
+
* Overrides the color of the Heading component.
|
|
4447
|
+
*
|
|
4448
|
+
* **Note** This takes priority over `type` and `constrast` prop to decide color of heading
|
|
4449
|
+
*/
|
|
4450
|
+
color?: BaseTextProps['color'];
|
|
4437
4451
|
type?: TextTypes;
|
|
4438
4452
|
contrast?: ColorContrastTypes;
|
|
4439
4453
|
children: StringChildrenType;
|
|
@@ -4465,7 +4479,7 @@ declare type HeadingProps<T> = T extends {
|
|
|
4465
4479
|
} ? Variant extends Exclude<HeadingVariant, 'subheading'> ? HeadingNormalVariant : Variant extends 'subheading' ? HeadingSubHeadingVariant : T : T;
|
|
4466
4480
|
declare const Heading: <T extends {
|
|
4467
4481
|
variant: HeadingVariant;
|
|
4468
|
-
}>({ variant, size, type, weight, contrast, children, testID, textAlign, ...styledProps }: HeadingProps<T>) => ReactElement;
|
|
4482
|
+
}>({ variant, size, type, weight, contrast, color, children, testID, textAlign, ...styledProps }: HeadingProps<T>) => ReactElement;
|
|
4469
4483
|
|
|
4470
4484
|
declare type TextCommonProps = {
|
|
4471
4485
|
type?: TextTypes;
|
|
@@ -4474,7 +4488,9 @@ declare type TextCommonProps = {
|
|
|
4474
4488
|
children: React.ReactNode;
|
|
4475
4489
|
weight?: keyof Theme$1['typography']['fonts']['weight'];
|
|
4476
4490
|
/**
|
|
4477
|
-
*
|
|
4491
|
+
* Overrides the color of the Text component.
|
|
4492
|
+
*
|
|
4493
|
+
* **Note** This takes priority over `type` and `constrast` prop to decide color of text
|
|
4478
4494
|
*/
|
|
4479
4495
|
color?: BaseTextProps['color'];
|
|
4480
4496
|
textAlign?: BaseTextProps['textAlign'];
|
|
@@ -4501,15 +4517,18 @@ declare type TextForwardedAs = {
|
|
|
4501
4517
|
declare type GetTextPropsReturn = Omit<BaseTextProps, 'children'> & TextForwardedAs;
|
|
4502
4518
|
declare type GetTextProps<T extends {
|
|
4503
4519
|
variant: TextVariant;
|
|
4504
|
-
}> = Pick<TextProps<T>, 'type' | 'variant' | 'weight' | 'size' | 'contrast' | 'testID' | 'textAlign'>;
|
|
4520
|
+
}> = Pick<TextProps<T>, 'type' | 'variant' | 'weight' | 'size' | 'contrast' | 'color' | 'testID' | 'textAlign'>;
|
|
4505
4521
|
declare const getTextProps: <T extends {
|
|
4506
4522
|
variant: TextVariant;
|
|
4507
|
-
}>({ variant, type, weight, size, contrast, testID, textAlign, }: GetTextProps<T>) => GetTextPropsReturn;
|
|
4523
|
+
}>({ variant, type, weight, size, color, contrast, testID, textAlign, }: GetTextProps<T>) => GetTextPropsReturn;
|
|
4508
4524
|
declare const Text: <T extends {
|
|
4509
4525
|
variant: TextVariant;
|
|
4510
4526
|
}>({ variant, weight, size, type, contrast, truncateAfterLines, children, color, testID, textAlign, ...styledProps }: TextProps<T>) => ReactElement;
|
|
4511
4527
|
|
|
4512
|
-
declare type
|
|
4528
|
+
declare type CodeCommonProps = {
|
|
4529
|
+
/**
|
|
4530
|
+
* Sets the color of the Heading component.
|
|
4531
|
+
*/
|
|
4513
4532
|
children: StringChildrenType;
|
|
4514
4533
|
/**
|
|
4515
4534
|
* Decides the fontSize and padding of Code
|
|
@@ -4518,7 +4537,34 @@ declare type CodeProps = {
|
|
|
4518
4537
|
*/
|
|
4519
4538
|
size?: 'small' | 'medium';
|
|
4520
4539
|
weight?: 'regular' | 'bold';
|
|
4540
|
+
isHighlighted?: boolean;
|
|
4541
|
+
color?: BaseTextProps['color'];
|
|
4521
4542
|
} & TestID & StyledPropsBlade;
|
|
4543
|
+
declare type CodeHighlightedProps = CodeCommonProps & {
|
|
4544
|
+
/**
|
|
4545
|
+
* Adds background color to highlight the text
|
|
4546
|
+
*
|
|
4547
|
+
* @default true
|
|
4548
|
+
*/
|
|
4549
|
+
isHighlighted?: true;
|
|
4550
|
+
/**
|
|
4551
|
+
* color prop can only be added when `isHighlighted` is set to `false`
|
|
4552
|
+
*/
|
|
4553
|
+
color?: undefined;
|
|
4554
|
+
};
|
|
4555
|
+
declare type CodeNonHighlightedProps = CodeCommonProps & {
|
|
4556
|
+
/**
|
|
4557
|
+
* Adds background color to highlight the text
|
|
4558
|
+
*
|
|
4559
|
+
* @default true
|
|
4560
|
+
*/
|
|
4561
|
+
isHighlighted: false;
|
|
4562
|
+
/**
|
|
4563
|
+
* color prop to set color of text when `isHighlighted` is set to false
|
|
4564
|
+
*/
|
|
4565
|
+
color?: BaseTextProps['color'];
|
|
4566
|
+
};
|
|
4567
|
+
declare type CodeProps = CodeHighlightedProps | CodeNonHighlightedProps;
|
|
4522
4568
|
/**
|
|
4523
4569
|
* Code component can be used for displaying token, variable names, or inlined code snippets.
|
|
4524
4570
|
*
|
|
@@ -4538,14 +4584,14 @@ declare type CodeProps = {
|
|
|
4538
4584
|
* In React Native, you would have to align it using flex to make sure the Code and the surrounding text is correctly aligned
|
|
4539
4585
|
*
|
|
4540
4586
|
* ```tsx
|
|
4541
|
-
* <
|
|
4587
|
+
* <Box flexWrap="wrap" flexDirection="row" alignItems="flex-start">
|
|
4542
4588
|
* <Text>Lorem ipsum </Text>
|
|
4543
4589
|
* <Code>SENTRY_TOKEN</Code>
|
|
4544
4590
|
* <Text> normal text</Text>
|
|
4545
|
-
* </
|
|
4591
|
+
* </Box>
|
|
4546
4592
|
* ```
|
|
4547
4593
|
*/
|
|
4548
|
-
declare const Code: ({ children, size, weight, testID, ...styledProps }: CodeProps) => JSX.Element;
|
|
4594
|
+
declare const Code: ({ children, size, weight, isHighlighted, color, testID, ...styledProps }: CodeProps) => JSX.Element;
|
|
4549
4595
|
|
|
4550
4596
|
declare type ListItemCodeProps = Exclude<CodeProps, 'size'>;
|
|
4551
4597
|
declare const ListItemCode: ({ children, testID }: ListItemCodeProps) => React.ReactElement;
|
|
@@ -3279,13 +3279,13 @@ var useStyledProps=function useStyledProps(props){var styledPropsStyles=getStyle
|
|
|
3279
3279
|
|
|
3280
3280
|
var _excluded$4Q=["color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","lineHeight","textAlign","as"],_excluded2$1=["id","color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","lineHeight","as","textAlign","children","truncateAfterLines","className","style","accessibilityProps","componentName","testID"];var StyledBaseText=styled.Text(function(_ref){var color=_ref.color,fontFamily=_ref.fontFamily,fontSize=_ref.fontSize,fontWeight=_ref.fontWeight,fontStyle=_ref.fontStyle,textDecorationLine=_ref.textDecorationLine,lineHeight=_ref.lineHeight,textAlign=_ref.textAlign,as=_ref.as,props=_objectWithoutProperties(_ref,_excluded$4Q);var styledPropsCSSObject=useStyledProps(props);if(as){throw new Error("[Blade: BaseText]: \"as\" prop is not supported for BaseText on React Native");}else {return _extends({},getBaseTextStyles({color:color,fontFamily:fontFamily,fontSize:fontSize,fontWeight:fontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine,lineHeight:lineHeight,textAlign:textAlign,theme:props.theme}),styledPropsCSSObject);}});var BaseText=function BaseText(_ref2){var id=_ref2.id,color=_ref2.color,fontFamily=_ref2.fontFamily,fontSize=_ref2.fontSize,fontWeight=_ref2.fontWeight,fontStyle=_ref2.fontStyle,textDecorationLine=_ref2.textDecorationLine,lineHeight=_ref2.lineHeight,as=_ref2.as,textAlign=_ref2.textAlign,children=_ref2.children,truncateAfterLines=_ref2.truncateAfterLines,className=_ref2.className,style=_ref2.style,_ref2$accessibilityPr=_ref2.accessibilityProps,accessibilityProps=_ref2$accessibilityPr===void 0?{}:_ref2$accessibilityPr,componentName=_ref2.componentName,testID=_ref2.testID,styledProps=_objectWithoutProperties(_ref2,_excluded2$1);return jsx(StyledBaseText,_extends({},styledProps,{color:color,fontFamily:fontFamily,fontSize:fontSize,fontWeight:fontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine,lineHeight:lineHeight,as:as,textAlign:textAlign,numberOfLines:truncateAfterLines,className:className,style:style,id:id},makeAccessible(accessibilityProps),metaAttribute({name:componentName,testID:testID}),{children:children}));};
|
|
3281
3281
|
|
|
3282
|
-
var _excluded$4P=["size","type","contrast","children","testID"];var getProps$3=function getProps(_ref){var size=_ref.size,type=_ref.type,contrast=_ref.contrast,testID=_ref.testID;var isPlatformWeb=getPlatformType()==='browser'||getPlatformType()==='node';var colorContrast=contrast?contrast+"Contrast":'lowContrast';var props={color:"surface.text."+(type!=null?type:'normal')+"."+colorContrast,fontSize:600,fontWeight:'bold',fontStyle:'normal',lineHeight:700,fontFamily:'text',accessibilityProps:isPlatformWeb?{}:{role:'heading'},componentName:'title',testID:testID};if(size==='small'){props.fontSize=600;props.lineHeight=500;props.as=isPlatformWeb?'h3':undefined;}else if(size==='medium'){props.fontSize=700;props.lineHeight=600;props.as=isPlatformWeb?'h2':undefined;}else if(size==='large'){props.fontSize=800;props.lineHeight=700;props.as=isPlatformWeb?'h1':undefined;}else if(size==='xlarge'){props.fontSize=1000;props.lineHeight=800;props.as=isPlatformWeb?'h1':undefined;}return props;};var Title=function Title(_ref2){var _ref2$size=_ref2.size,size=_ref2$size===void 0?'small':_ref2$size,_ref2$type=_ref2.type,type=_ref2$type===void 0?'normal':_ref2$type,_ref2$contrast=_ref2.contrast,contrast=_ref2$contrast===void 0?'low':_ref2$contrast,children=_ref2.children,testID=_ref2.testID,styledProps=_objectWithoutProperties(_ref2,_excluded$4P);var props=getProps$3({size:size,type:type,contrast:contrast,testID:testID});return jsx(BaseText,_extends({},props,getStyledProps(styledProps),{children:children}));};
|
|
3282
|
+
var _excluded$4P=["size","type","contrast","color","children","testID"];var getProps$3=function getProps(_ref){var size=_ref.size,type=_ref.type,contrast=_ref.contrast,color=_ref.color,testID=_ref.testID;var isPlatformWeb=getPlatformType()==='browser'||getPlatformType()==='node';var colorContrast=contrast?contrast+"Contrast":'lowContrast';var props={color:color!=null?color:"surface.text."+(type!=null?type:'normal')+"."+colorContrast,fontSize:600,fontWeight:'bold',fontStyle:'normal',lineHeight:700,fontFamily:'text',accessibilityProps:isPlatformWeb?{}:{role:'heading'},componentName:'title',testID:testID};if(size==='small'){props.fontSize=600;props.lineHeight=500;props.as=isPlatformWeb?'h3':undefined;}else if(size==='medium'){props.fontSize=700;props.lineHeight=600;props.as=isPlatformWeb?'h2':undefined;}else if(size==='large'){props.fontSize=800;props.lineHeight=700;props.as=isPlatformWeb?'h1':undefined;}else if(size==='xlarge'){props.fontSize=1000;props.lineHeight=800;props.as=isPlatformWeb?'h1':undefined;}return props;};var Title=function Title(_ref2){var _ref2$size=_ref2.size,size=_ref2$size===void 0?'small':_ref2$size,_ref2$type=_ref2.type,type=_ref2$type===void 0?'normal':_ref2$type,_ref2$contrast=_ref2.contrast,contrast=_ref2$contrast===void 0?'low':_ref2$contrast,color=_ref2.color,children=_ref2.children,testID=_ref2.testID,styledProps=_objectWithoutProperties(_ref2,_excluded$4P);var props=getProps$3({size:size,type:type,contrast:contrast,color:color,testID:testID});return jsx(BaseText,_extends({},props,getStyledProps(styledProps),{children:children}));};
|
|
3283
3283
|
|
|
3284
|
-
var _excluded$4O=["variant","size","type","weight","contrast","children","testID","textAlign"];var getProps$2=function getProps(_ref){var variant=_ref.variant,size=_ref.size,type=_ref.type,weight=_ref.weight,contrast=_ref.contrast,testID=_ref.testID;var isPlatformWeb=getPlatformType()==='browser'||getPlatformType()==='node';var colorContrast=contrast?contrast+"Contrast":'lowContrast';var props={color:"surface.text."+(type!=null?type:'normal')+"."+colorContrast,fontSize:200,fontWeight:weight!=null?weight:'bold',fontStyle:'normal',lineHeight:300,fontFamily:'text',accessibilityProps:isPlatformWeb?{}:{role:'heading'},componentName:'heading',testID:testID};if(variant==='regular'){if(!size||size==='small'){props.fontSize=200;props.lineHeight=300;props.as=isPlatformWeb?'h6':undefined;}else if(size==='medium'){props.fontSize=300;props.lineHeight=200;props.as=isPlatformWeb?'h5':undefined;}else if(size==='large'){props.fontSize=400;props.lineHeight=400;props.as=isPlatformWeb?'h4':undefined;}}else if(variant==='subheading'){if(weight==='regular'){throw new Error("[Blade: Heading]: weight cannot be 'regular' when variant is 'subheading'");}if(size){throw new Error("[Blade: Heading]: size prop cannot be added when variant is 'subheading'. Use variant 'regular' or remove size prop");}props.fontSize=75;props.lineHeight=50;props.as=isPlatformWeb?'h6':undefined;}return props;};var Heading=function Heading(_ref2){var _ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'regular':_ref2$variant,size=_ref2.size,_ref2$type=_ref2.type,type=_ref2$type===void 0?'normal':_ref2$type,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'bold':_ref2$weight,_ref2$contrast=_ref2.contrast,contrast=_ref2$contrast===void 0?'low':_ref2$contrast,children=_ref2.children,testID=_ref2.testID,textAlign=_ref2.textAlign,styledProps=_objectWithoutProperties(_ref2,_excluded$4O);var props=getProps$2({variant:variant,size:size,type:type,weight:weight,contrast:contrast,testID:testID});return jsx(BaseText,_extends({},props,{textAlign:textAlign},getStyledProps(styledProps),{children:children}));};
|
|
3284
|
+
var _excluded$4O=["variant","size","type","weight","contrast","color","children","testID","textAlign"];var getProps$2=function getProps(_ref){var variant=_ref.variant,size=_ref.size,type=_ref.type,weight=_ref.weight,contrast=_ref.contrast,color=_ref.color,testID=_ref.testID;var isPlatformWeb=getPlatformType()==='browser'||getPlatformType()==='node';var colorContrast=contrast?contrast+"Contrast":'lowContrast';var props={color:color!=null?color:"surface.text."+(type!=null?type:'normal')+"."+colorContrast,fontSize:200,fontWeight:weight!=null?weight:'bold',fontStyle:'normal',lineHeight:300,fontFamily:'text',accessibilityProps:isPlatformWeb?{}:{role:'heading'},componentName:'heading',testID:testID};if(variant==='regular'){if(!size||size==='small'){props.fontSize=200;props.lineHeight=300;props.as=isPlatformWeb?'h6':undefined;}else if(size==='medium'){props.fontSize=300;props.lineHeight=200;props.as=isPlatformWeb?'h5':undefined;}else if(size==='large'){props.fontSize=400;props.lineHeight=400;props.as=isPlatformWeb?'h4':undefined;}}else if(variant==='subheading'){if(weight==='regular'){throw new Error("[Blade: Heading]: weight cannot be 'regular' when variant is 'subheading'");}if(size){throw new Error("[Blade: Heading]: size prop cannot be added when variant is 'subheading'. Use variant 'regular' or remove size prop");}props.fontSize=75;props.lineHeight=50;props.as=isPlatformWeb?'h6':undefined;}return props;};var Heading=function Heading(_ref2){var _ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'regular':_ref2$variant,size=_ref2.size,_ref2$type=_ref2.type,type=_ref2$type===void 0?'normal':_ref2$type,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'bold':_ref2$weight,_ref2$contrast=_ref2.contrast,contrast=_ref2$contrast===void 0?'low':_ref2$contrast,color=_ref2.color,children=_ref2.children,testID=_ref2.testID,textAlign=_ref2.textAlign,styledProps=_objectWithoutProperties(_ref2,_excluded$4O);var props=getProps$2({variant:variant,size:size,type:type,weight:weight,color:color,contrast:contrast,testID:testID});return jsx(BaseText,_extends({},props,{textAlign:textAlign},getStyledProps(styledProps),{children:children}));};
|
|
3285
3285
|
|
|
3286
|
-
var _excluded$4N=["variant","weight","size","type","contrast","truncateAfterLines","children","color","testID","textAlign"];var getTextProps=function getTextProps(_ref){var variant=_ref.variant,type=_ref.type,weight=_ref.weight,size=_ref.size,contrast=_ref.contrast,testID=_ref.testID,textAlign=_ref.textAlign;var isPlatformWeb=getPlatformType()==='browser'||getPlatformType()==='node';var colorContrast=contrast?contrast+"Contrast":'lowContrast';var props={color:"surface.text."+(type!=null?type:'normal')+"."+colorContrast,fontSize:100,fontWeight:weight!=null?weight:'regular',fontStyle:'normal',lineHeight:100,fontFamily:'text',forwardedAs:isPlatformWeb?'p':undefined,componentName:'text',testID:testID,textAlign:textAlign};if(variant==='body'){if(size==='xsmall'){props.fontSize=25;props.lineHeight=50;}if(size==='small'){props.fontSize=75;props.lineHeight=50;}if(size==='medium'){props.fontSize=100;props.lineHeight=100;}if(size==='large'){props.fontSize=200;props.lineHeight=300;}}if(variant==='caption'){if(size==='medium'){props.fontSize=50;props.lineHeight=50;}else {throw new Error("[Blade: Text]: size cannot be '"+size+"' when variant is 'caption'");}props.fontStyle='italic';}return props;};var StyledText=styled(BaseText)(function(_ref2){var truncateAfterLines=_ref2.truncateAfterLines;if(truncateAfterLines){if(getPlatformType()==='react-native'){return null;}return {overflow:'hidden',display:'-webkit-box','line-clamp':""+truncateAfterLines,'-webkit-line-clamp':""+truncateAfterLines,'-webkit-box-orient':'vertical'};}return {};});var _Text=function _Text(_ref3){var _ref3$variant=_ref3.variant,variant=_ref3$variant===void 0?'body':_ref3$variant,_ref3$weight=_ref3.weight,weight=_ref3$weight===void 0?'regular':_ref3$weight,_ref3$size=_ref3.size,size=_ref3$size===void 0?'medium':_ref3$size,_ref3$type=_ref3.type,type=_ref3$type===void 0?'normal':_ref3$type,_ref3$contrast=_ref3.contrast,contrast=_ref3$contrast===void 0?'low':_ref3$contrast,truncateAfterLines=_ref3.truncateAfterLines,children=_ref3.children,color=_ref3.color,testID=_ref3.testID,textAlign=_ref3.textAlign,styledProps=_objectWithoutProperties(_ref3,_excluded$4N);var props=_extends({truncateAfterLines:truncateAfterLines},getTextProps({variant:variant,type:type,weight:weight,size:size,contrast:contrast,testID:testID,textAlign:textAlign})
|
|
3286
|
+
var _excluded$4N=["variant","weight","size","type","contrast","truncateAfterLines","children","color","testID","textAlign"];var getTextProps=function getTextProps(_ref){var variant=_ref.variant,type=_ref.type,weight=_ref.weight,size=_ref.size,color=_ref.color,contrast=_ref.contrast,testID=_ref.testID,textAlign=_ref.textAlign;var isPlatformWeb=getPlatformType()==='browser'||getPlatformType()==='node';var colorContrast=contrast?contrast+"Contrast":'lowContrast';var props={color:color!=null?color:"surface.text."+(type!=null?type:'normal')+"."+colorContrast,fontSize:100,fontWeight:weight!=null?weight:'regular',fontStyle:'normal',lineHeight:100,fontFamily:'text',forwardedAs:isPlatformWeb?'p':undefined,componentName:'text',testID:testID,textAlign:textAlign};if(variant==='body'){if(size==='xsmall'){props.fontSize=25;props.lineHeight=50;}if(size==='small'){props.fontSize=75;props.lineHeight=50;}if(size==='medium'){props.fontSize=100;props.lineHeight=100;}if(size==='large'){props.fontSize=200;props.lineHeight=300;}}if(variant==='caption'){if(size==='medium'){props.fontSize=50;props.lineHeight=50;}else {throw new Error("[Blade: Text]: size cannot be '"+size+"' when variant is 'caption'");}props.fontStyle='italic';}return props;};var StyledText=styled(BaseText)(function(_ref2){var truncateAfterLines=_ref2.truncateAfterLines;if(truncateAfterLines){if(getPlatformType()==='react-native'){return null;}return {overflow:'hidden',display:'-webkit-box','line-clamp':""+truncateAfterLines,'-webkit-line-clamp':""+truncateAfterLines,'-webkit-box-orient':'vertical'};}return {};});var _Text=function _Text(_ref3){var _ref3$variant=_ref3.variant,variant=_ref3$variant===void 0?'body':_ref3$variant,_ref3$weight=_ref3.weight,weight=_ref3$weight===void 0?'regular':_ref3$weight,_ref3$size=_ref3.size,size=_ref3$size===void 0?'medium':_ref3$size,_ref3$type=_ref3.type,type=_ref3$type===void 0?'normal':_ref3$type,_ref3$contrast=_ref3.contrast,contrast=_ref3$contrast===void 0?'low':_ref3$contrast,truncateAfterLines=_ref3.truncateAfterLines,children=_ref3.children,color=_ref3.color,testID=_ref3.testID,textAlign=_ref3.textAlign,styledProps=_objectWithoutProperties(_ref3,_excluded$4N);var props=_extends({truncateAfterLines:truncateAfterLines},getTextProps({variant:variant,type:type,weight:weight,color:color,size:size,contrast:contrast,testID:testID,textAlign:textAlign}));return jsx(StyledText,_extends({},props,getStyledProps(styledProps),{children:children}));};var Text=assignWithoutSideEffects(_Text,{displayName:'Text',componentId:'Text'});
|
|
3287
3287
|
|
|
3288
|
-
var _excluded$4M=["children","size","weight","testID"];var platformType=getPlatformType();var isPlatformWeb=platformType==='browser'||platformType==='node';var getCodeFontSizeAndLineHeight=function getCodeFontSizeAndLineHeight(size){switch(size){case'medium':return {fontSize:75,lineHeight:75};case'small':return {fontSize:25,lineHeight:25};default:throw new Error("[Blade Code]: Unexpected size: "+size);}};var CodeContainer=styled(BaseBox)(function(props){var padding=makeSpace(props.theme.spacing[0])+" "+makeSpace(props.theme.spacing[2]);return {padding:padding,backgroundColor:props.theme.colors.brand.gray.
|
|
3288
|
+
var _excluded$4M=["children","size","weight","isHighlighted","color","testID"];var platformType=getPlatformType();var isPlatformWeb=platformType==='browser'||platformType==='node';var getCodeFontSizeAndLineHeight=function getCodeFontSizeAndLineHeight(size){switch(size){case'medium':return {fontSize:75,lineHeight:75};case'small':return {fontSize:25,lineHeight:25};default:throw new Error("[Blade Code]: Unexpected size: "+size);}};var CodeContainer=styled(BaseBox)(function(props){var padding=makeSpace(props.theme.spacing[0])+" "+makeSpace(props.theme.spacing[2]);return {padding:padding,backgroundColor:props.isHighlighted?props.theme.colors.brand.gray.a100.lowContrast:undefined,borderRadius:props.theme.border.radius.medium,display:isPlatformWeb?'inline-block':'flex',alignSelf:isPlatformWeb?undefined:'center',verticalAlign:'middle',lineHeight:makeTypographySize(props.theme.typography.lineHeights[0])};});var getCodeColor=function getCodeColor(_ref){var isHighlighted=_ref.isHighlighted,color=_ref.color;if(isHighlighted){if(color){throw new Error('[Blade: Code]: `color` prop cannot be used without `isHighlighted={false}`');}return 'surface.text.subtle.lowContrast';}if(color){return color;}return 'surface.text.normal.lowContrast';};var Code=function Code(_ref2){var children=_ref2.children,_ref2$size=_ref2.size,size=_ref2$size===void 0?'small':_ref2$size,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'regular':_ref2$weight,_ref2$isHighlighted=_ref2.isHighlighted,isHighlighted=_ref2$isHighlighted===void 0?true:_ref2$isHighlighted,color=_ref2.color,testID=_ref2.testID,styledProps=_objectWithoutProperties(_ref2,_excluded$4M);var _getCodeFontSizeAndLi=getCodeFontSizeAndLineHeight(size),fontSize=_getCodeFontSizeAndLi.fontSize,lineHeight=_getCodeFontSizeAndLi.lineHeight;var codeTextColor=React__default.useMemo(function(){return getCodeColor({isHighlighted:isHighlighted,color:color});},[isHighlighted,color]);return jsx(CodeContainer,_extends({size:size,isHighlighted:isHighlighted,as:isPlatformWeb?'span':undefined},metaAttribute({name:MetaConstants.Code,testID:testID}),getStyledProps(styledProps),{children:jsx(BaseText,{color:codeTextColor,fontFamily:"code",fontSize:fontSize,fontWeight:weight,as:isPlatformWeb?'code':undefined,lineHeight:lineHeight,children:children})}));};
|
|
3289
3289
|
|
|
3290
3290
|
/**
|
|
3291
3291
|
* Checks if `value` is `undefined`.
|