@razorpay/blade 8.10.1 → 8.10.3
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 +122 -99
- package/build/components/index.native.d.ts +60 -37
- package/build/components/index.native.js +9 -6
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.web.js +321 -146
- 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/build/utils/index.d.ts +4 -1
- package/build/utils/index.native.d.ts +4 -1
- package/build/utils/index.native.js +3 -1
- package/build/utils/index.native.js.map +1 -1
- package/build/utils/index.web.js +14 -1
- package/build/utils/index.web.js.map +1 -1
- package/package.json +3 -3
|
@@ -1090,9 +1090,10 @@ type SpacingValueType$1 =
|
|
|
1090
1090
|
| DotNotationSpacingStringToken
|
|
1091
1091
|
| `${string}${SpaceUnits$1}`
|
|
1092
1092
|
| `calc(${string})`
|
|
1093
|
+
| 'auto'
|
|
1093
1094
|
| `min(${string})`
|
|
1094
1095
|
| `max(${string})`
|
|
1095
|
-
| '
|
|
1096
|
+
| 'max-content'
|
|
1096
1097
|
| 'none';
|
|
1097
1098
|
|
|
1098
1099
|
type MarginProps$1 = MakeObjectResponsive$1<{
|
|
@@ -1772,7 +1773,7 @@ declare type MakeObjectResponsive<T, K extends keyof T = Extract<keyof T, string
|
|
|
1772
1773
|
|
|
1773
1774
|
declare type ArrayOfMaxLength4<T> = readonly [T?, T?, T?, T?];
|
|
1774
1775
|
declare type SpaceUnits = 'px' | '%' | 'fr' | 'rem' | 'em' | 'vh' | 'vw';
|
|
1775
|
-
declare type SpacingValueType = DotNotationSpacingStringToken | `${string}${SpaceUnits}` | `calc(${string})` | `min(${string})` | `max(${string})` | '
|
|
1776
|
+
declare type SpacingValueType = DotNotationSpacingStringToken | `${string}${SpaceUnits}` | `calc(${string})` | 'auto' | `min(${string})` | `max(${string})` | 'max-content' | 'none';
|
|
1776
1777
|
/**
|
|
1777
1778
|
* @IMPORTANT
|
|
1778
1779
|
*
|
|
@@ -2331,6 +2332,14 @@ declare const Box: React__default.ForwardRefExoticComponent<Partial<PaddingProps
|
|
|
2331
2332
|
readonly l?: "none" | "flex" | undefined;
|
|
2332
2333
|
readonly xl?: "none" | "flex" | undefined;
|
|
2333
2334
|
} | undefined;
|
|
2335
|
+
overflow?: "hidden" | "scroll" | "visible" | {
|
|
2336
|
+
readonly base?: "hidden" | "scroll" | "visible" | undefined;
|
|
2337
|
+
readonly xs?: "hidden" | "scroll" | "visible" | undefined;
|
|
2338
|
+
readonly s?: "hidden" | "scroll" | "visible" | undefined;
|
|
2339
|
+
readonly m?: "hidden" | "scroll" | "visible" | undefined;
|
|
2340
|
+
readonly l?: "hidden" | "scroll" | "visible" | undefined;
|
|
2341
|
+
readonly xl?: "hidden" | "scroll" | "visible" | undefined;
|
|
2342
|
+
} | undefined;
|
|
2334
2343
|
height: SpacingValueType | {
|
|
2335
2344
|
readonly base?: SpacingValueType | undefined;
|
|
2336
2345
|
readonly xs?: SpacingValueType | undefined;
|
|
@@ -2374,14 +2383,6 @@ declare const Box: React__default.ForwardRefExoticComponent<Partial<PaddingProps
|
|
|
2374
2383
|
overflowX: never;
|
|
2375
2384
|
overflowY: never;
|
|
2376
2385
|
textAlign: never;
|
|
2377
|
-
overflow?: "hidden" | "scroll" | "visible" | {
|
|
2378
|
-
readonly base?: "hidden" | "scroll" | "visible" | undefined;
|
|
2379
|
-
readonly xs?: "hidden" | "scroll" | "visible" | undefined;
|
|
2380
|
-
readonly s?: "hidden" | "scroll" | "visible" | undefined;
|
|
2381
|
-
readonly m?: "hidden" | "scroll" | "visible" | undefined;
|
|
2382
|
-
readonly l?: "hidden" | "scroll" | "visible" | undefined;
|
|
2383
|
-
readonly xl?: "hidden" | "scroll" | "visible" | undefined;
|
|
2384
|
-
} | undefined;
|
|
2385
2386
|
__brand__?: "platform-native" | {
|
|
2386
2387
|
readonly base?: "platform-native" | undefined;
|
|
2387
2388
|
readonly xs?: "platform-native" | undefined;
|
|
@@ -2391,6 +2392,7 @@ declare const Box: React__default.ForwardRefExoticComponent<Partial<PaddingProps
|
|
|
2391
2392
|
readonly xl?: "platform-native" | undefined;
|
|
2392
2393
|
} | undefined;
|
|
2393
2394
|
} & {
|
|
2395
|
+
order: never;
|
|
2394
2396
|
alignContent?: "center" | "flex-end" | "flex-start" | "stretch" | "space-around" | "space-between" | {
|
|
2395
2397
|
readonly base?: "center" | "flex-end" | "flex-start" | "stretch" | "space-around" | "space-between" | undefined;
|
|
2396
2398
|
readonly xs?: "center" | "flex-end" | "flex-start" | "stretch" | "space-around" | "space-between" | undefined;
|
|
@@ -2473,7 +2475,6 @@ declare const Box: React__default.ForwardRefExoticComponent<Partial<PaddingProps
|
|
|
2473
2475
|
} | undefined;
|
|
2474
2476
|
justifyItems: never;
|
|
2475
2477
|
justifySelf: never;
|
|
2476
|
-
order: never;
|
|
2477
2478
|
rowGap: SpacingValueType | {
|
|
2478
2479
|
readonly base?: SpacingValueType | undefined;
|
|
2479
2480
|
readonly xs?: SpacingValueType | undefined;
|
|
@@ -2685,7 +2686,7 @@ declare const CardBody: ({ children, testID }: CardBodyProps) => React__default.
|
|
|
2685
2686
|
|
|
2686
2687
|
type BladeElementRef = Platform.Select<{
|
|
2687
2688
|
web:
|
|
2688
|
-
| Pick<HTMLElement, 'focus' | 'scrollIntoView' | 'getBoundingClientRect'>
|
|
2689
|
+
| Pick<HTMLElement, 'focus' | 'scrollIntoView' | 'getBoundingClientRect' | 'clientHeight'>
|
|
2689
2690
|
| Pick<View, 'focus'>;
|
|
2690
2691
|
native: React.MutableRefObject<any>;
|
|
2691
2692
|
}>;
|
|
@@ -2941,6 +2942,21 @@ type BadgeTextColors$1 = `badge.text.${DotNotationColorStringToken<
|
|
|
2941
2942
|
Theme$1['colors']['badge']['text']
|
|
2942
2943
|
>}`;
|
|
2943
2944
|
|
|
2945
|
+
type As$1 =
|
|
2946
|
+
| 'code'
|
|
2947
|
+
| 'h1'
|
|
2948
|
+
| 'h2'
|
|
2949
|
+
| 'h3'
|
|
2950
|
+
| 'h4'
|
|
2951
|
+
| 'h5'
|
|
2952
|
+
| 'h6'
|
|
2953
|
+
| 'p'
|
|
2954
|
+
| 'span'
|
|
2955
|
+
| 'abbr'
|
|
2956
|
+
| 'q'
|
|
2957
|
+
| 'cite'
|
|
2958
|
+
| 'figcaption'
|
|
2959
|
+
| 'div';
|
|
2944
2960
|
type BaseTextProps$1 = {
|
|
2945
2961
|
id?: string;
|
|
2946
2962
|
color?: ActionColors$1 | FeedbackColors$1 | SurfaceColors$1 | FeedbackActionColors$1 | BadgeTextColors$1;
|
|
@@ -2953,7 +2969,7 @@ type BaseTextProps$1 = {
|
|
|
2953
2969
|
/**
|
|
2954
2970
|
* Web only
|
|
2955
2971
|
*/
|
|
2956
|
-
as?:
|
|
2972
|
+
as?: As$1;
|
|
2957
2973
|
textAlign?: 'center' | 'justify' | 'left' | 'right';
|
|
2958
2974
|
truncateAfterLines?: number;
|
|
2959
2975
|
className?: string;
|
|
@@ -2971,11 +2987,13 @@ type BaseTextProps$1 = {
|
|
|
2971
2987
|
/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */
|
|
2972
2988
|
|
|
2973
2989
|
|
|
2990
|
+
declare const validAsValues$3 = ['p', 'span', 'div', 'abbr', 'figcaption', 'cite', 'q'] as const;
|
|
2974
2991
|
type TextCommonProps$1 = {
|
|
2992
|
+
as?: typeof validAsValues$3[number];
|
|
2975
2993
|
type?: TextTypes;
|
|
2976
2994
|
contrast?: ColorContrastTypes;
|
|
2977
2995
|
truncateAfterLines?: number;
|
|
2978
|
-
children:
|
|
2996
|
+
children: React__default.ReactNode;
|
|
2979
2997
|
weight?: keyof Theme$1['typography']['fonts']['weight'];
|
|
2980
2998
|
/**
|
|
2981
2999
|
* Overrides the color of the Text component.
|
|
@@ -3287,6 +3305,7 @@ declare const Checkbox: React__default.ForwardRefExoticComponent<{
|
|
|
3287
3305
|
*/
|
|
3288
3306
|
tabIndex?: number | undefined;
|
|
3289
3307
|
} & TestID & Partial<Omit<MarginProps & Pick<{
|
|
3308
|
+
order: never;
|
|
3290
3309
|
alignContent?: "center" | "flex-end" | "flex-start" | "stretch" | "space-around" | "space-between" | {
|
|
3291
3310
|
readonly base?: "center" | "flex-end" | "flex-start" | "stretch" | "space-around" | "space-between" | undefined;
|
|
3292
3311
|
readonly xs?: "center" | "flex-end" | "flex-start" | "stretch" | "space-around" | "space-between" | undefined;
|
|
@@ -3369,7 +3388,6 @@ declare const Checkbox: React__default.ForwardRefExoticComponent<{
|
|
|
3369
3388
|
} | undefined;
|
|
3370
3389
|
justifyItems: never;
|
|
3371
3390
|
justifySelf: never;
|
|
3372
|
-
order: never;
|
|
3373
3391
|
rowGap: SpacingValueType | {
|
|
3374
3392
|
readonly base?: SpacingValueType | undefined;
|
|
3375
3393
|
readonly xs?: SpacingValueType | undefined;
|
|
@@ -3403,7 +3421,7 @@ declare const Checkbox: React__default.ForwardRefExoticComponent<{
|
|
|
3403
3421
|
readonly l?: "platform-native" | undefined;
|
|
3404
3422
|
readonly xl?: "platform-native" | undefined;
|
|
3405
3423
|
} | undefined;
|
|
3406
|
-
}, "
|
|
3424
|
+
}, "order" | "alignSelf" | "justifySelf" | "placeSelf"> & {
|
|
3407
3425
|
bottom: SpacingValueType | {
|
|
3408
3426
|
readonly base?: SpacingValueType | undefined;
|
|
3409
3427
|
readonly xs?: SpacingValueType | undefined;
|
|
@@ -4457,7 +4475,7 @@ declare type TextInputProps = Pick<BaseInputProps, 'label' | 'labelPosition' | '
|
|
|
4457
4475
|
*/
|
|
4458
4476
|
type?: Type;
|
|
4459
4477
|
} & StyledPropsBlade;
|
|
4460
|
-
declare const TextInput: React__default.ForwardRefExoticComponent<Pick<BaseInputProps, "testID" | "name" | "placeholder" | "label" | "value" | "prefix" | "
|
|
4478
|
+
declare const TextInput: React__default.ForwardRefExoticComponent<Pick<BaseInputProps, "testID" | "name" | "placeholder" | "label" | "value" | "prefix" | "onBlur" | "onFocus" | "onChange" | "onSubmit" | "defaultValue" | "autoCapitalize" | "autoFocus" | "isDisabled" | "labelPosition" | "validationState" | "helpText" | "errorText" | "necessityIndicator" | "successText" | "isRequired" | "suffix" | "maxCharacters" | "keyboardReturnKeyType" | "autoCompleteSuggestionType"> & {
|
|
4461
4479
|
/**
|
|
4462
4480
|
* Decides whether to render a clear icon button
|
|
4463
4481
|
*/
|
|
@@ -4489,6 +4507,7 @@ declare const TextInput: React__default.ForwardRefExoticComponent<Pick<BaseInput
|
|
|
4489
4507
|
*/
|
|
4490
4508
|
type?: Type;
|
|
4491
4509
|
} & Partial<Omit<MarginProps & Pick<{
|
|
4510
|
+
order: never;
|
|
4492
4511
|
alignContent?: "center" | "flex-end" | "flex-start" | "stretch" | "space-around" | "space-between" | {
|
|
4493
4512
|
readonly base?: "center" | "flex-end" | "flex-start" | "stretch" | "space-around" | "space-between" | undefined;
|
|
4494
4513
|
readonly xs?: "center" | "flex-end" | "flex-start" | "stretch" | "space-around" | "space-between" | undefined;
|
|
@@ -4571,7 +4590,6 @@ declare const TextInput: React__default.ForwardRefExoticComponent<Pick<BaseInput
|
|
|
4571
4590
|
} | undefined;
|
|
4572
4591
|
justifyItems: never;
|
|
4573
4592
|
justifySelf: never;
|
|
4574
|
-
order: never;
|
|
4575
4593
|
rowGap: SpacingValueType | {
|
|
4576
4594
|
readonly base?: SpacingValueType | undefined;
|
|
4577
4595
|
readonly xs?: SpacingValueType | undefined;
|
|
@@ -4605,7 +4623,7 @@ declare const TextInput: React__default.ForwardRefExoticComponent<Pick<BaseInput
|
|
|
4605
4623
|
readonly l?: "platform-native" | undefined;
|
|
4606
4624
|
readonly xl?: "platform-native" | undefined;
|
|
4607
4625
|
} | undefined;
|
|
4608
|
-
}, "
|
|
4626
|
+
}, "order" | "alignSelf" | "justifySelf" | "placeSelf"> & {
|
|
4609
4627
|
bottom: SpacingValueType | {
|
|
4610
4628
|
readonly base?: SpacingValueType | undefined;
|
|
4611
4629
|
readonly xs?: SpacingValueType | undefined;
|
|
@@ -4719,7 +4737,8 @@ declare type PasswordInputExtraProps = {
|
|
|
4719
4737
|
autoCompleteSuggestionType?: Extract<BaseInputProps['autoCompleteSuggestionType'], 'none' | 'password' | 'newPassword'>;
|
|
4720
4738
|
};
|
|
4721
4739
|
declare type PasswordInputProps = Pick<BaseInputProps, 'label' | 'labelPosition' | 'maxCharacters' | 'validationState' | 'errorText' | 'successText' | 'helpText' | 'isDisabled' | 'defaultValue' | 'placeholder' | 'isRequired' | 'value' | 'onChange' | 'onBlur' | 'onSubmit' | 'onFocus' | 'name' | 'autoFocus' | 'keyboardReturnKeyType' | 'autoCompleteSuggestionType' | 'testID'> & PasswordInputExtraProps & StyledPropsBlade;
|
|
4722
|
-
declare const PasswordInput: React__default.ForwardRefExoticComponent<Pick<BaseInputProps, "testID" | "name" | "placeholder" | "label" | "value" | "
|
|
4740
|
+
declare const PasswordInput: React__default.ForwardRefExoticComponent<Pick<BaseInputProps, "testID" | "name" | "placeholder" | "label" | "value" | "onBlur" | "onFocus" | "onChange" | "onSubmit" | "defaultValue" | "autoFocus" | "isDisabled" | "labelPosition" | "validationState" | "helpText" | "errorText" | "successText" | "isRequired" | "maxCharacters" | "keyboardReturnKeyType" | "autoCompleteSuggestionType"> & PasswordInputExtraProps & Partial<Omit<MarginProps & Pick<{
|
|
4741
|
+
order: never;
|
|
4723
4742
|
alignContent?: "center" | "flex-end" | "flex-start" | "stretch" | "space-around" | "space-between" | {
|
|
4724
4743
|
readonly base?: "center" | "flex-end" | "flex-start" | "stretch" | "space-around" | "space-between" | undefined;
|
|
4725
4744
|
readonly xs?: "center" | "flex-end" | "flex-start" | "stretch" | "space-around" | "space-between" | undefined;
|
|
@@ -4802,7 +4821,6 @@ declare const PasswordInput: React__default.ForwardRefExoticComponent<Pick<BaseI
|
|
|
4802
4821
|
} | undefined;
|
|
4803
4822
|
justifyItems: never;
|
|
4804
4823
|
justifySelf: never;
|
|
4805
|
-
order: never;
|
|
4806
4824
|
rowGap: SpacingValueType | {
|
|
4807
4825
|
readonly base?: SpacingValueType | undefined;
|
|
4808
4826
|
readonly xs?: SpacingValueType | undefined;
|
|
@@ -4836,7 +4854,7 @@ declare const PasswordInput: React__default.ForwardRefExoticComponent<Pick<BaseI
|
|
|
4836
4854
|
readonly l?: "platform-native" | undefined;
|
|
4837
4855
|
readonly xl?: "platform-native" | undefined;
|
|
4838
4856
|
} | undefined;
|
|
4839
|
-
}, "
|
|
4857
|
+
}, "order" | "alignSelf" | "justifySelf" | "placeSelf"> & {
|
|
4840
4858
|
bottom: SpacingValueType | {
|
|
4841
4859
|
readonly base?: SpacingValueType | undefined;
|
|
4842
4860
|
readonly xs?: SpacingValueType | undefined;
|
|
@@ -4929,7 +4947,7 @@ declare type TextAreaProps = Pick<BaseInputProps, 'label' | 'labelPosition' | 'n
|
|
|
4929
4947
|
*/
|
|
4930
4948
|
onClearButtonClick?: () => void;
|
|
4931
4949
|
} & StyledPropsBlade;
|
|
4932
|
-
declare const TextArea: React__default.ForwardRefExoticComponent<Pick<BaseInputProps, "testID" | "name" | "placeholder" | "label" | "value" | "numberOfLines" | "
|
|
4950
|
+
declare const TextArea: React__default.ForwardRefExoticComponent<Pick<BaseInputProps, "testID" | "name" | "placeholder" | "label" | "value" | "numberOfLines" | "onBlur" | "onFocus" | "onChange" | "onSubmit" | "defaultValue" | "autoFocus" | "isDisabled" | "labelPosition" | "validationState" | "helpText" | "errorText" | "necessityIndicator" | "successText" | "isRequired" | "maxCharacters"> & {
|
|
4933
4951
|
/**
|
|
4934
4952
|
* Decides whether to render a clear icon button
|
|
4935
4953
|
*/
|
|
@@ -4939,6 +4957,7 @@ declare const TextArea: React__default.ForwardRefExoticComponent<Pick<BaseInputP
|
|
|
4939
4957
|
*/
|
|
4940
4958
|
onClearButtonClick?: (() => void) | undefined;
|
|
4941
4959
|
} & Partial<Omit<MarginProps & Pick<{
|
|
4960
|
+
order: never;
|
|
4942
4961
|
alignContent?: "center" | "flex-end" | "flex-start" | "stretch" | "space-around" | "space-between" | {
|
|
4943
4962
|
readonly base?: "center" | "flex-end" | "flex-start" | "stretch" | "space-around" | "space-between" | undefined;
|
|
4944
4963
|
readonly xs?: "center" | "flex-end" | "flex-start" | "stretch" | "space-around" | "space-between" | undefined;
|
|
@@ -5021,7 +5040,6 @@ declare const TextArea: React__default.ForwardRefExoticComponent<Pick<BaseInputP
|
|
|
5021
5040
|
} | undefined;
|
|
5022
5041
|
justifyItems: never;
|
|
5023
5042
|
justifySelf: never;
|
|
5024
|
-
order: never;
|
|
5025
5043
|
rowGap: SpacingValueType | {
|
|
5026
5044
|
readonly base?: SpacingValueType | undefined;
|
|
5027
5045
|
readonly xs?: SpacingValueType | undefined;
|
|
@@ -5055,7 +5073,7 @@ declare const TextArea: React__default.ForwardRefExoticComponent<Pick<BaseInputP
|
|
|
5055
5073
|
readonly l?: "platform-native" | undefined;
|
|
5056
5074
|
readonly xl?: "platform-native" | undefined;
|
|
5057
5075
|
} | undefined;
|
|
5058
|
-
}, "
|
|
5076
|
+
}, "order" | "alignSelf" | "justifySelf" | "placeSelf"> & {
|
|
5059
5077
|
bottom: SpacingValueType | {
|
|
5060
5078
|
readonly base?: SpacingValueType | undefined;
|
|
5061
5079
|
readonly xs?: SpacingValueType | undefined;
|
|
@@ -5240,7 +5258,7 @@ declare type SelectInputProps = Pick<BaseInputProps, 'label' | 'labelPosition' |
|
|
|
5240
5258
|
*
|
|
5241
5259
|
* Checkout {@link https://blade.razorpay.com/?path=/docs/components-dropdown-with-select--with-single-select SelectInput Documentation}.
|
|
5242
5260
|
*/
|
|
5243
|
-
declare const SelectInput: React__default.ForwardRefExoticComponent<Pick<BaseInputProps, "testID" | "name" | "placeholder" | "label" | "prefix" | "
|
|
5261
|
+
declare const SelectInput: React__default.ForwardRefExoticComponent<Pick<BaseInputProps, "testID" | "name" | "placeholder" | "label" | "prefix" | "onBlur" | "onFocus" | "onClick" | "autoFocus" | "isDisabled" | "labelPosition" | "validationState" | "helpText" | "errorText" | "necessityIndicator" | "successText" | "isRequired" | "suffix"> & {
|
|
5244
5262
|
icon?: IconComponent$1 | undefined;
|
|
5245
5263
|
/**
|
|
5246
5264
|
* Controlled value of the Select. Use it in combination of `onChange`.
|
|
@@ -5352,6 +5370,7 @@ declare type FeedbackActionColors = `feedback.${Feedback}.action.text.${DotNotat
|
|
|
5352
5370
|
declare type SurfaceColors = `surface.text.${DotNotationColorStringToken<Theme$1['colors']['surface']['text']>}`;
|
|
5353
5371
|
declare type ActionColors = `action.text.${DotNotationColorStringToken<Theme$1['colors']['action']['text']>}`;
|
|
5354
5372
|
declare type BadgeTextColors = `badge.text.${DotNotationColorStringToken<Theme$1['colors']['badge']['text']>}`;
|
|
5373
|
+
declare type As = 'code' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'abbr' | 'q' | 'cite' | 'figcaption' | 'div';
|
|
5355
5374
|
declare type BaseTextProps = {
|
|
5356
5375
|
id?: string;
|
|
5357
5376
|
color?: ActionColors | FeedbackColors | SurfaceColors | FeedbackActionColors | BadgeTextColors;
|
|
@@ -5364,7 +5383,7 @@ declare type BaseTextProps = {
|
|
|
5364
5383
|
/**
|
|
5365
5384
|
* Web only
|
|
5366
5385
|
*/
|
|
5367
|
-
as?:
|
|
5386
|
+
as?: As;
|
|
5368
5387
|
textAlign?: 'center' | 'justify' | 'left' | 'right';
|
|
5369
5388
|
truncateAfterLines?: number;
|
|
5370
5389
|
className?: string;
|
|
@@ -5378,7 +5397,9 @@ declare type BaseTextProps = {
|
|
|
5378
5397
|
componentName?: 'text' | 'title' | 'heading' | 'code';
|
|
5379
5398
|
} & TestID & StyledPropsBlade;
|
|
5380
5399
|
|
|
5400
|
+
declare const validAsValues$2: readonly ["span", "h1", "h2", "h3", "h4", "h5", "h6"];
|
|
5381
5401
|
declare type TitleProps = {
|
|
5402
|
+
as?: typeof validAsValues$2[number];
|
|
5382
5403
|
/**
|
|
5383
5404
|
* Overrides the color of the Title component.
|
|
5384
5405
|
*
|
|
@@ -5389,12 +5410,15 @@ declare type TitleProps = {
|
|
|
5389
5410
|
contrast?: ColorContrastTypes;
|
|
5390
5411
|
type?: TextTypes;
|
|
5391
5412
|
children: StringChildrenType;
|
|
5413
|
+
textAlign?: BaseTextProps['textAlign'];
|
|
5392
5414
|
} & TestID & StyledPropsBlade;
|
|
5393
|
-
declare const Title: ({ size, type, contrast, color, children, testID, ...styledProps }: TitleProps) => ReactElement;
|
|
5415
|
+
declare const Title: ({ as, size, type, contrast, color, children, testID, textAlign, ...styledProps }: TitleProps) => ReactElement;
|
|
5394
5416
|
|
|
5395
5417
|
declare type HeadingVariant = 'regular' | 'subheading';
|
|
5396
5418
|
declare type HeadingSize = 'small' | 'medium' | 'large';
|
|
5419
|
+
declare const validAsValues$1: readonly ["span", "h1", "h2", "h3", "h4", "h5", "h6"];
|
|
5397
5420
|
declare type HeadingCommonProps = {
|
|
5421
|
+
as?: typeof validAsValues$1[number];
|
|
5398
5422
|
/**
|
|
5399
5423
|
* Overrides the color of the Heading component.
|
|
5400
5424
|
*
|
|
@@ -5432,13 +5456,15 @@ declare type HeadingProps<T> = T extends {
|
|
|
5432
5456
|
} ? Variant extends Exclude<HeadingVariant, 'subheading'> ? HeadingNormalVariant : Variant extends 'subheading' ? HeadingSubHeadingVariant : T : T;
|
|
5433
5457
|
declare const Heading: <T extends {
|
|
5434
5458
|
variant: HeadingVariant;
|
|
5435
|
-
}>({ variant, size, type, weight, contrast, color, children, testID, textAlign, ...styledProps }: HeadingProps<T>) => ReactElement;
|
|
5459
|
+
}>({ as, variant, size, type, weight, contrast, color, children, testID, textAlign, ...styledProps }: HeadingProps<T>) => ReactElement;
|
|
5436
5460
|
|
|
5461
|
+
declare const validAsValues: readonly ["p", "span", "div", "abbr", "figcaption", "cite", "q"];
|
|
5437
5462
|
declare type TextCommonProps = {
|
|
5463
|
+
as?: typeof validAsValues[number];
|
|
5438
5464
|
type?: TextTypes;
|
|
5439
5465
|
contrast?: ColorContrastTypes;
|
|
5440
5466
|
truncateAfterLines?: number;
|
|
5441
|
-
children:
|
|
5467
|
+
children: React__default.ReactNode;
|
|
5442
5468
|
weight?: keyof Theme$1['typography']['fonts']['weight'];
|
|
5443
5469
|
/**
|
|
5444
5470
|
* Overrides the color of the Text component.
|
|
@@ -5464,10 +5490,7 @@ declare type TextCaptionVariant = TextCommonProps & {
|
|
|
5464
5490
|
declare type TextProps<T> = T extends {
|
|
5465
5491
|
variant: infer Variant;
|
|
5466
5492
|
} ? Variant extends 'caption' ? TextCaptionVariant : Variant extends 'body' ? TextBodyVariant : T : T;
|
|
5467
|
-
declare type
|
|
5468
|
-
forwardedAs?: BaseTextProps['as'];
|
|
5469
|
-
};
|
|
5470
|
-
declare type GetTextPropsReturn = Omit<BaseTextProps, 'children'> & TextForwardedAs;
|
|
5493
|
+
declare type GetTextPropsReturn = Omit<BaseTextProps, 'children'>;
|
|
5471
5494
|
declare type GetTextProps<T extends {
|
|
5472
5495
|
variant: TextVariant;
|
|
5473
5496
|
}> = Pick<TextProps<T>, 'type' | 'variant' | 'weight' | 'size' | 'contrast' | 'color' | 'testID' | 'textAlign'>;
|
|
@@ -5476,7 +5499,7 @@ declare const getTextProps: <T extends {
|
|
|
5476
5499
|
}>({ variant, type, weight, size, color, contrast, testID, textAlign, }: GetTextProps<T>) => GetTextPropsReturn;
|
|
5477
5500
|
declare const Text: <T extends {
|
|
5478
5501
|
variant: TextVariant;
|
|
5479
|
-
}>({ variant, weight, size, type, contrast, truncateAfterLines, children, color, testID, textAlign, ...styledProps }: TextProps<T>) => ReactElement;
|
|
5502
|
+
}>({ as, variant, weight, size, type, contrast, truncateAfterLines, children, color, testID, textAlign, ...styledProps }: TextProps<T>) => ReactElement;
|
|
5480
5503
|
|
|
5481
5504
|
declare type CodeCommonProps = {
|
|
5482
5505
|
/**
|
|
@@ -5747,6 +5770,7 @@ declare const Radio: React__default.ForwardRefExoticComponent<{
|
|
|
5747
5770
|
*/
|
|
5748
5771
|
size?: "small" | "medium" | undefined;
|
|
5749
5772
|
} & TestID & Partial<Omit<MarginProps & Pick<{
|
|
5773
|
+
order: never;
|
|
5750
5774
|
alignContent?: "center" | "flex-end" | "flex-start" | "stretch" | "space-around" | "space-between" | {
|
|
5751
5775
|
readonly base?: "center" | "flex-end" | "flex-start" | "stretch" | "space-around" | "space-between" | undefined;
|
|
5752
5776
|
readonly xs?: "center" | "flex-end" | "flex-start" | "stretch" | "space-around" | "space-between" | undefined;
|
|
@@ -5829,7 +5853,6 @@ declare const Radio: React__default.ForwardRefExoticComponent<{
|
|
|
5829
5853
|
} | undefined;
|
|
5830
5854
|
justifyItems: never;
|
|
5831
5855
|
justifySelf: never;
|
|
5832
|
-
order: never;
|
|
5833
5856
|
rowGap: SpacingValueType | {
|
|
5834
5857
|
readonly base?: SpacingValueType | undefined;
|
|
5835
5858
|
readonly xs?: SpacingValueType | undefined;
|
|
@@ -5863,7 +5886,7 @@ declare const Radio: React__default.ForwardRefExoticComponent<{
|
|
|
5863
5886
|
readonly l?: "platform-native" | undefined;
|
|
5864
5887
|
readonly xl?: "platform-native" | undefined;
|
|
5865
5888
|
} | undefined;
|
|
5866
|
-
}, "
|
|
5889
|
+
}, "order" | "alignSelf" | "justifySelf" | "placeSelf"> & {
|
|
5867
5890
|
bottom: SpacingValueType | {
|
|
5868
5891
|
readonly base?: SpacingValueType | undefined;
|
|
5869
5892
|
readonly xs?: SpacingValueType | undefined;
|
|
@@ -12,8 +12,9 @@ import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
|
12
12
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
13
13
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
14
14
|
import GorhomBottomSheet, { BottomSheetSectionList, BottomSheetScrollView, BottomSheetBackdrop as BottomSheetBackdrop$1, BottomSheetFooter as BottomSheetFooter$1 } from '@gorhom/bottom-sheet';
|
|
15
|
-
import { ClipPath as ClipPath$1, Circle as Circle$1, Defs as Defs$1, G as G$1, Path as Path$1, Rect as Rect$1, Svg as Svg$1 } from 'react-native-svg';
|
|
16
15
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
16
|
+
import '@floating-ui/react';
|
|
17
|
+
import { ClipPath as ClipPath$1, Circle as Circle$1, Defs as Defs$1, G as G$1, Path as Path$1, Rect as Rect$1, Svg as Svg$1 } from 'react-native-svg';
|
|
17
18
|
import { useFloating, shift, flip, offset, arrow } from '@floating-ui/react-native';
|
|
18
19
|
|
|
19
20
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -3270,7 +3271,7 @@ var BottomSheetContext=React__default.createContext({headerHeight:0,contentHeigh
|
|
|
3270
3271
|
|
|
3271
3272
|
var _excluded$4U=["isOpen","setIsOpen","close","selectedIndices","setSelectedIndices","activeIndex","setActiveIndex","shouldIgnoreBlur","setShouldIgnoreBlur","isKeydownPressed","setIsKeydownPressed","options","selectionType","changeCallbackTriggerer","setChangeCallbackTriggerer","isControlled","setControlledValueIndices"];var noop=function noop(){};var DropdownContext=React__default.createContext({isOpen:false,setIsOpen:noop,close:noop,selectedIndices:[],setSelectedIndices:noop,controlledValueIndices:[],setControlledValueIndices:noop,options:[],setOptions:noop,activeIndex:-1,setActiveIndex:noop,shouldIgnoreBlur:false,setShouldIgnoreBlur:noop,shouldIgnoreBlurAnimation:false,setShouldIgnoreBlurAnimation:noop,hasFooterAction:false,setHasFooterAction:noop,hasLabelOnLeft:false,setHasLabelOnLeft:noop,isKeydownPressed:false,setIsKeydownPressed:noop,changeCallbackTriggerer:0,setChangeCallbackTriggerer:noop,isControlled:false,setIsControlled:noop,dropdownBaseId:'',actionListItemRef:{current:null},triggererRef:{current:null}});var searchTimeout;var searchString='';var useDropdown=function useDropdown(){var _React$useContext=React__default.useContext(DropdownContext),isOpen=_React$useContext.isOpen,setIsOpen=_React$useContext.setIsOpen,close=_React$useContext.close,selectedIndices=_React$useContext.selectedIndices,setSelectedIndices=_React$useContext.setSelectedIndices,activeIndex=_React$useContext.activeIndex,setActiveIndex=_React$useContext.setActiveIndex,shouldIgnoreBlur=_React$useContext.shouldIgnoreBlur,setShouldIgnoreBlur=_React$useContext.setShouldIgnoreBlur,isKeydownPressed=_React$useContext.isKeydownPressed,setIsKeydownPressed=_React$useContext.setIsKeydownPressed,options=_React$useContext.options,selectionType=_React$useContext.selectionType,changeCallbackTriggerer=_React$useContext.changeCallbackTriggerer,setChangeCallbackTriggerer=_React$useContext.setChangeCallbackTriggerer,isControlled=_React$useContext.isControlled,setControlledValueIndices=_React$useContext.setControlledValueIndices,rest=_objectWithoutProperties(_React$useContext,_excluded$4U);var bottomSheetAndDropdownGlue=useBottomSheetAndDropdownGlue();var setIndices=function setIndices(indices){if(isControlled){setControlledValueIndices(indices);}else {setSelectedIndices(indices);}};var selectOption=function selectOption(index){var properties=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{closeOnSelection:true};var isSelected=false;if(index<0||index>options.length-1){return isSelected;}if(selectionType==='multiple'){if(selectedIndices.includes(index)){var existingItemIndex=selectedIndices.indexOf(index);setIndices([].concat(_toConsumableArray(selectedIndices.slice(0,existingItemIndex)),_toConsumableArray(selectedIndices.slice(existingItemIndex+1))));isSelected=false;}else {setIndices([].concat(_toConsumableArray(selectedIndices),[index]));isSelected=true;}}else {setIndices([index]);isSelected=true;}setChangeCallbackTriggerer(changeCallbackTriggerer+1);if(activeIndex!==index){setActiveIndex(index);}if(properties!=null&&properties.closeOnSelection&&selectionType!=='multiple'){close();}return isSelected;};var onTriggerClick=function onTriggerClick(){if(isOpen){close();}else {setIsOpen(true);}};var onTriggerBlur=function onTriggerBlur(_ref){var name=_ref.name,value=_ref.value,onBlurCallback=_ref.onBlurCallback;if(rest.hasFooterAction){setActiveIndex(-1);}if(bottomSheetAndDropdownGlue!=null&&bottomSheetAndDropdownGlue.dropdownHasBottomSheet){setShouldIgnoreBlur(true);return;}if(shouldIgnoreBlur){setShouldIgnoreBlur(false);return;}onBlurCallback==null?void 0:onBlurCallback({name:name,value:value});if(isOpen){if(selectionType!=='multiple'){selectOption(activeIndex);}if(!(bottomSheetAndDropdownGlue!=null&&bottomSheetAndDropdownGlue.dropdownHasBottomSheet)){close();}}};var onOptionChange=function onOptionChange(actionType,index){var max=options.length-1;var newIndex=index!=null?index:activeIndex;setActiveIndex(getUpdatedIndex(newIndex,max,actionType));var optionValues=options.map(function(option){return option.value;});ensureScrollVisiblity(newIndex,rest.actionListItemRef.current,optionValues);};var onOptionClick=function onOptionClick(e,index){var actionType=getActionFromKey(e,isOpen);if(typeof actionType==='number'){onOptionChange(actionType,index);}selectOption(index);if(!isReactNative$4()){var _rest$triggererRef$cu;(_rest$triggererRef$cu=rest.triggererRef.current)==null?void 0:_rest$triggererRef$cu.focus();}};var onComboType=function onComboType(letter,actionType){setIsOpen(true);if(typeof searchTimeout==='number'){window.clearTimeout(searchTimeout);}searchTimeout=window.setTimeout(function(){searchString='';},500);searchString=searchString+letter;var optionTitles=options.map(function(option){return option.title;});var searchIndex=getIndexByLetter(optionTitles,searchString,activeIndex+1);if(searchIndex>=0){onOptionChange(actionType,searchIndex);}else {window.clearTimeout(searchTimeout);searchString='';}};var onTriggerKeydown=function onTriggerKeydown(e){if(e.event.key==='Tab'&&rest.hasFooterAction){setShouldIgnoreBlur(true);}if(bottomSheetAndDropdownGlue!=null&&bottomSheetAndDropdownGlue.dropdownHasBottomSheet){setShouldIgnoreBlur(true);}if(!isKeydownPressed&&![' ','Enter','Escape','Meta'].includes(e.event.key)){setIsKeydownPressed(true);}var actionType=getActionFromKey(e.event,isOpen);if(actionType){performAction(actionType,e,{setIsOpen:setIsOpen,close:close,onOptionChange:onOptionChange,onComboType:onComboType,selectCurrentOption:function selectCurrentOption(){var _options$activeIndex$,_options$activeIndex;var isSelected=selectOption(activeIndex);if(rest.hasFooterAction&&!isReactNative$4()){var _rest$triggererRef$cu2;(_rest$triggererRef$cu2=rest.triggererRef.current)==null?void 0:_rest$triggererRef$cu2.focus();}(_options$activeIndex$=(_options$activeIndex=options[activeIndex]).onClickTrigger)==null?void 0:_options$activeIndex$.call(_options$activeIndex,isSelected);}});}};return _extends({isOpen:isOpen,setIsOpen:setIsOpen,close:close,selectedIndices:selectedIndices,setSelectedIndices:setSelectedIndices,setControlledValueIndices:setControlledValueIndices,onTriggerClick:onTriggerClick,onTriggerKeydown:onTriggerKeydown,onTriggerBlur:onTriggerBlur,onOptionClick:onOptionClick,activeIndex:activeIndex,setActiveIndex:setActiveIndex,shouldIgnoreBlur:shouldIgnoreBlur,setShouldIgnoreBlur:setShouldIgnoreBlur,isKeydownPressed:isKeydownPressed,setIsKeydownPressed:setIsKeydownPressed,changeCallbackTriggerer:changeCallbackTriggerer,setChangeCallbackTriggerer:setChangeCallbackTriggerer,isControlled:isControlled,options:options,value:makeInputValue(selectedIndices,options),displayValue:makeInputDisplayValue(selectedIndices,options),selectionType:selectionType},rest);};
|
|
3272
3273
|
|
|
3273
|
-
var getBaseTextStyles=function getBaseTextStyles(_ref){var _ref$color=_ref.color,color=_ref$color===void 0?'surface.text.normal.lowContrast':_ref$color,_ref$fontFamily=_ref.fontFamily,fontFamily=_ref$fontFamily===void 0?'text':_ref$fontFamily,_ref$fontSize=_ref.fontSize,fontSize=_ref$fontSize===void 0?200:_ref$fontSize,_ref$fontWeight=_ref.fontWeight,fontWeight=_ref$fontWeight===void 0?'regular':_ref$fontWeight,_ref$fontStyle=_ref.fontStyle,fontStyle=_ref$fontStyle===void 0?'normal':_ref$fontStyle,_ref$textDecorationLi=_ref.textDecorationLine,textDecorationLine=_ref$textDecorationLi===void 0?'none':_ref$textDecorationLi,_ref$lineHeight=_ref.lineHeight,lineHeight=_ref$lineHeight===void 0?100:_ref$lineHeight,textAlign=_ref.textAlign,theme=_ref.theme;var textColor=get_1(theme.colors,color);var themeFontFamily=theme.typography.fonts.family[fontFamily];var themeFontSize=makeTypographySize(theme.typography.fonts.size[fontSize]);var themeFontWeight=theme.typography.fonts.weight[fontWeight];var themeLineHeight=makeTypographySize(theme.typography.lineHeights[lineHeight]);return {color:textColor,fontFamily:themeFontFamily,fontSize:themeFontSize,fontWeight:themeFontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine,lineHeight:themeLineHeight,textAlign:textAlign,margin:0,padding:0};};
|
|
3274
|
+
var getBaseTextStyles=function getBaseTextStyles(_ref){var _ref$color=_ref.color,color=_ref$color===void 0?'surface.text.normal.lowContrast':_ref$color,_ref$fontFamily=_ref.fontFamily,fontFamily=_ref$fontFamily===void 0?'text':_ref$fontFamily,_ref$fontSize=_ref.fontSize,fontSize=_ref$fontSize===void 0?200:_ref$fontSize,_ref$fontWeight=_ref.fontWeight,fontWeight=_ref$fontWeight===void 0?'regular':_ref$fontWeight,_ref$fontStyle=_ref.fontStyle,fontStyle=_ref$fontStyle===void 0?'normal':_ref$fontStyle,_ref$textDecorationLi=_ref.textDecorationLine,textDecorationLine=_ref$textDecorationLi===void 0?'none':_ref$textDecorationLi,numberOfLines=_ref.numberOfLines,_ref$lineHeight=_ref.lineHeight,lineHeight=_ref$lineHeight===void 0?100:_ref$lineHeight,textAlign=_ref.textAlign,theme=_ref.theme;var textColor=get_1(theme.colors,color);var themeFontFamily=theme.typography.fonts.family[fontFamily];var themeFontSize=makeTypographySize(theme.typography.fonts.size[fontSize]);var themeFontWeight=theme.typography.fonts.weight[fontWeight];var themeLineHeight=makeTypographySize(theme.typography.lineHeights[lineHeight]);var truncateStyles={};if(numberOfLines!==undefined){if(isReactNative$4()){truncateStyles={};}truncateStyles={overflow:'hidden',display:'-webkit-box','line-clamp':""+numberOfLines,'-webkit-line-clamp':""+numberOfLines,'-webkit-box-orient':'vertical'};}return _extends({color:textColor,fontFamily:themeFontFamily,fontSize:themeFontSize,fontWeight:themeFontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine,lineHeight:themeLineHeight,textAlign:textAlign,margin:0,padding:0},truncateStyles);};
|
|
3274
3275
|
|
|
3275
3276
|
var removeUndefinedStyledProps=function removeUndefinedStyledProps(obj){var onlyDefinedStyledProps={};for(var key in obj){if(obj[key]!==undefined){onlyDefinedStyledProps[key]=obj[key];}}return onlyDefinedStyledProps;};var makeStyledProps=function makeStyledProps(props){return {alignSelf:props.alignSelf,justifySelf:props.justifySelf,placeSelf:props.placeSelf,order:props.order,position:props.position,zIndex:props.zIndex,gridColumn:props.gridColumn,gridColumnStart:props.gridColumnStart,gridColumnEnd:props.gridColumnEnd,gridRow:props.gridRow,gridRowStart:props.gridRowStart,gridRowEnd:props.gridRowEnd,gridArea:props.gridArea,margin:props.margin,marginX:props.marginX,marginY:props.marginY,marginBottom:props.marginBottom,marginTop:props.marginTop,marginRight:props.marginRight,marginLeft:props.marginLeft,top:props.top,right:props.right,bottom:props.bottom,left:props.left};};var getStyledProps=function getStyledProps(props){return removeUndefinedStyledProps(makeStyledProps(props));};
|
|
3276
3277
|
|
|
@@ -3278,13 +3279,15 @@ var useMemoizedStyles=function useMemoizedStyles(boxProps){return getBaseBoxStyl
|
|
|
3278
3279
|
|
|
3279
3280
|
var useStyledProps=function useStyledProps(props){var styledPropsStyles=getStyledProps(props);var styledPropsCSSObject=useMemoizedStyles(_extends({},styledPropsStyles,{theme:props.theme}));var styledPropsWithoutUndefined=removeUndefinedStyledProps(styledPropsCSSObject);return styledPropsWithoutUndefined;};
|
|
3280
3281
|
|
|
3281
|
-
var _excluded$4T=["color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","lineHeight","textAlign","as"],_excluded2$1=["id","color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","lineHeight","
|
|
3282
|
+
var _excluded$4T=["color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","numberOfLines","lineHeight","textAlign","as"],_excluded2$1=["id","color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","lineHeight","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,numberOfLines=_ref.numberOfLines,lineHeight=_ref.lineHeight,textAlign=_ref.textAlign;_ref.as;var props=_objectWithoutProperties(_ref,_excluded$4T);var styledPropsCSSObject=useStyledProps(props);return _extends({},getBaseTextStyles({color:color,fontFamily:fontFamily,fontSize:fontSize,fontWeight:fontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine,numberOfLines:numberOfLines,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,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:undefined,textAlign:textAlign,numberOfLines:truncateAfterLines,className:className,style:style,id:id},makeAccessible(accessibilityProps),metaAttribute({name:componentName,testID:testID}),{children:children}));};
|
|
3283
|
+
|
|
3284
|
+
var useValidateAsProp=function useValidateAsProp(_ref){var as=_ref.as,componentName=_ref.componentName,validAsValues=_ref.validAsValues;React__default.useEffect(function(){if(as&&!validAsValues.includes(as)){throw new Error("[Blade "+componentName+"]: Invalid `as` prop value - "+as+". Only "+validAsValues.join(', ')+" are accepted");}},[as,componentName,validAsValues]);};
|
|
3282
3285
|
|
|
3283
|
-
var _excluded$4S=["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$4S);var props=getProps$3({size:size,type:type,contrast:contrast,color:color,testID:testID});return jsx(BaseText,_extends({},props,getStyledProps(styledProps),{children:children}));};
|
|
3286
|
+
var _excluded$4S=["as","size","type","contrast","color","children","testID","textAlign"];var validAsValues$2=['span','h1','h2','h3','h4','h5','h6'];var getProps$3=function getProps(_ref){var as=_ref.as,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;}props.as=as||props.as;return props;};var Title=function Title(_ref2){var as=_ref2.as,_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,textAlign=_ref2.textAlign,styledProps=_objectWithoutProperties(_ref2,_excluded$4S);useValidateAsProp({componentName:'Title',as:as,validAsValues:validAsValues$2});var props=getProps$3({as:as,size:size,type:type,contrast:contrast,color:color,testID:testID});return jsx(BaseText,_extends({},props,{textAlign:textAlign},getStyledProps(styledProps),{children:children}));};
|
|
3284
3287
|
|
|
3285
|
-
var _excluded$4R=["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
|
|
3288
|
+
var _excluded$4R=["as","variant","size","type","weight","contrast","color","children","testID","textAlign"];var validAsValues$1=['span','h1','h2','h3','h4','h5','h6'];var getProps$2=function getProps(_ref){var as=_ref.as,variant=_ref.variant,size=_ref.size,type=_ref.type,weight=_ref.weight,contrast=_ref.contrast,color=_ref.color,testID=_ref.testID;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:isReactNative$4()?{role:'heading'}:{},componentName:'heading',testID:testID};if(variant==='regular'){if(!size||size==='small'){props.fontSize=200;props.lineHeight=300;props.as='h6';}else if(size==='medium'){props.fontSize=300;props.lineHeight=200;props.as='h5';}else if(size==='large'){props.fontSize=400;props.lineHeight=400;props.as='h4';}}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='p';}props.as=as||props.as;return props;};var Heading=function Heading(_ref2){var as=_ref2.as,_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$4R);useValidateAsProp({componentName:'Heading',as:as,validAsValues:validAsValues$1});var props=getProps$2({as:as,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}));};
|
|
3286
3289
|
|
|
3287
|
-
var _excluded$4Q=["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
|
|
3290
|
+
var _excluded$4Q=["as","variant","weight","size","type","contrast","truncateAfterLines","children","color","testID","textAlign"];var validAsValues=['p','span','div','abbr','figcaption','cite','q'];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 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',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 _Text=function _Text(_ref2){var _ref2$as=_ref2.as,as=_ref2$as===void 0?'p':_ref2$as,_ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'body':_ref2$variant,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'regular':_ref2$weight,_ref2$size=_ref2.size,size=_ref2$size===void 0?'medium':_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,truncateAfterLines=_ref2.truncateAfterLines,children=_ref2.children,color=_ref2.color,testID=_ref2.testID,textAlign=_ref2.textAlign,styledProps=_objectWithoutProperties(_ref2,_excluded$4Q);var props=_extends({as:as,truncateAfterLines:truncateAfterLines},getTextProps({variant:variant,type:type,weight:weight,color:color,size:size,contrast:contrast,testID:testID,textAlign:textAlign}));useValidateAsProp({componentName:'Text',as:as,validAsValues:validAsValues});return jsx(BaseText,_extends({},props,getStyledProps(styledProps),{children:children}));};var Text=assignWithoutSideEffects(_Text,{displayName:'Text',componentId:'Text'});
|
|
3288
3291
|
|
|
3289
3292
|
var _excluded$4P=["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$4P);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})}));};
|
|
3290
3293
|
|