@razorpay/blade 6.0.5 → 6.2.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/CHANGELOG.md +20 -0
- package/build/components/index.d.ts +641 -210
- package/build/components/index.native.d.ts +658 -221
- package/build/components/index.native.js +174 -105
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.web.js +10903 -8086
- 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/tokens/index.native.js.map +1 -1
- package/build/utils/index.d.ts +14 -2
- package/build/utils/index.native.d.ts +14 -2
- package/build/utils/index.native.js +5 -3
- package/build/utils/index.native.js.map +1 -1
- package/build/utils/index.web.js +17 -1
- package/build/utils/index.web.js.map +1 -1
- package/package.json +4 -1
|
@@ -4,6 +4,59 @@ import React__default, { ReactChild, ReactElement, ReactNode, SyntheticEvent, Ke
|
|
|
4
4
|
import { AccessibilityRole, View, GestureResponderEvent } from 'react-native';
|
|
5
5
|
import { CSSObject } from 'styled-components';
|
|
6
6
|
|
|
7
|
+
declare type ActionListProps = {
|
|
8
|
+
children: React__default.ReactNode[];
|
|
9
|
+
/**
|
|
10
|
+
* Decides the backgroundColor of ActionList
|
|
11
|
+
*/
|
|
12
|
+
surfaceLevel?: 2 | 3;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* ### ActionList
|
|
16
|
+
*
|
|
17
|
+
* List of multiple actionable items. Can be used as menu items inside `Dropdown`,
|
|
18
|
+
* `BottomSheet` and as selectable items when combined with `SelectInput`
|
|
19
|
+
*
|
|
20
|
+
* #### Usage
|
|
21
|
+
*
|
|
22
|
+
* ```jsx
|
|
23
|
+
* <Dropdown>
|
|
24
|
+
* <SelectInput label="Select Action" />
|
|
25
|
+
* <DropdownOverlay>
|
|
26
|
+
* <ActionList>
|
|
27
|
+
* <ActionListHeader
|
|
28
|
+
* title="Recent Searches"
|
|
29
|
+
* leading={<ActionListHeaderIcon icon={HistoryIcon} />}
|
|
30
|
+
* />
|
|
31
|
+
* <ActionListItem
|
|
32
|
+
* title="Home"
|
|
33
|
+
* value="home"
|
|
34
|
+
* leading={<ActionListItemIcon icon={HomeIcon} />}
|
|
35
|
+
* />
|
|
36
|
+
* <ActionListItem
|
|
37
|
+
* title="Pricing"
|
|
38
|
+
* value="pricing"
|
|
39
|
+
* leading={<ActionListItemAsset src="https://flagcdn.com/w20/in.png" alt="India Flag" />}
|
|
40
|
+
* />
|
|
41
|
+
* <ActionListHeader
|
|
42
|
+
* title="Search Tips"
|
|
43
|
+
* leading={<ActionListFooterIcon icon={SearchIcon} />}
|
|
44
|
+
* trailing={
|
|
45
|
+
* <Button
|
|
46
|
+
* onClick={() => console.log('clicked')}
|
|
47
|
+
* >
|
|
48
|
+
* Apply
|
|
49
|
+
* </Button>
|
|
50
|
+
* }
|
|
51
|
+
* />
|
|
52
|
+
* </ActionList>
|
|
53
|
+
* </DropdownOverlay>
|
|
54
|
+
* </Dropdown>
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
*/
|
|
58
|
+
declare const ActionList: ({ children, surfaceLevel }: ActionListProps) => JSX.Element;
|
|
59
|
+
|
|
7
60
|
type BorderRadius = Readonly<{
|
|
8
61
|
/** none: 0(px/rem/pt) */
|
|
9
62
|
none: 0;
|
|
@@ -848,6 +901,229 @@ type ThemeTokens = {
|
|
|
848
901
|
typography: TypographyWithPlatforms;
|
|
849
902
|
};
|
|
850
903
|
|
|
904
|
+
type Theme$1 = {
|
|
905
|
+
border: Border;
|
|
906
|
+
breakpoints: Breakpoints;
|
|
907
|
+
colors: Colors;
|
|
908
|
+
spacing: Spacing;
|
|
909
|
+
motion: Motion;
|
|
910
|
+
shadows: Omit<Shadows, 'color'> & {
|
|
911
|
+
color: {
|
|
912
|
+
level: Record<ShadowLevels, string>;
|
|
913
|
+
};
|
|
914
|
+
};
|
|
915
|
+
typography: Typography;
|
|
916
|
+
};
|
|
917
|
+
|
|
918
|
+
type FeedbackIconColors$1 = `feedback.icon.${DotNotationColorStringToken<
|
|
919
|
+
Theme$1['colors']['feedback']['icon']
|
|
920
|
+
>}`;
|
|
921
|
+
|
|
922
|
+
type FeedbackActionIconColors$1 = `feedback.${Feedback}.action.icon.${DotNotationColorStringToken<
|
|
923
|
+
Theme$1['colors']['feedback'][Feedback]['action']['icon']
|
|
924
|
+
>}`;
|
|
925
|
+
|
|
926
|
+
type ActionIconColors$1 = `action.icon.${DotNotationColorStringToken<
|
|
927
|
+
Theme$1['colors']['action']['icon']
|
|
928
|
+
>}`;
|
|
929
|
+
|
|
930
|
+
type TextIconColors$1 = `surface.text.${DotNotationColorStringToken<
|
|
931
|
+
Theme$1['colors']['surface']['text']
|
|
932
|
+
>}`;
|
|
933
|
+
|
|
934
|
+
type SurfaceActionIconColors$1 = `surface.action.icon.${DotNotationColorStringToken<
|
|
935
|
+
Theme$1['colors']['surface']['action']['icon']
|
|
936
|
+
>}`;
|
|
937
|
+
|
|
938
|
+
type BadgeIconColors$1 = `badge.icon.${DotNotationColorStringToken<
|
|
939
|
+
Theme$1['colors']['badge']['icon']
|
|
940
|
+
>}`;
|
|
941
|
+
|
|
942
|
+
type IconSize$1 = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge';
|
|
943
|
+
type IconProps$1 = {
|
|
944
|
+
/**
|
|
945
|
+
* Color token (not to be confused with actual hsla value)
|
|
946
|
+
*/
|
|
947
|
+
color:
|
|
948
|
+
| ActionIconColors$1
|
|
949
|
+
| SurfaceActionIconColors$1
|
|
950
|
+
| FeedbackIconColors$1
|
|
951
|
+
| FeedbackActionIconColors$1
|
|
952
|
+
| TextIconColors$1
|
|
953
|
+
| BadgeIconColors$1
|
|
954
|
+
| 'currentColor'; // currentColor is useful for letting the SVG inherit color property from its container
|
|
955
|
+
size: IconSize$1;
|
|
956
|
+
};
|
|
957
|
+
type IconComponent$1 = React.ComponentType<IconProps$1>;
|
|
958
|
+
|
|
959
|
+
declare type ActionListItemProps = {
|
|
960
|
+
title: string;
|
|
961
|
+
description?: string;
|
|
962
|
+
onClick?: (clickProps: {
|
|
963
|
+
name: string;
|
|
964
|
+
value?: boolean;
|
|
965
|
+
}) => void;
|
|
966
|
+
/**
|
|
967
|
+
* value that you get from `onChange` event on SelectInput or in form submissions.
|
|
968
|
+
*/
|
|
969
|
+
value: string;
|
|
970
|
+
/**
|
|
971
|
+
* Link to open when item is clicked.
|
|
972
|
+
*/
|
|
973
|
+
href?: string;
|
|
974
|
+
/**
|
|
975
|
+
* Item that goes on left-side of item.
|
|
976
|
+
*
|
|
977
|
+
* Valid elements - `<ActionListItemIcon />`, `<ActionListItemAsset />`
|
|
978
|
+
*
|
|
979
|
+
* Will be overriden in multiselect
|
|
980
|
+
*/
|
|
981
|
+
leading?: React__default.ReactNode;
|
|
982
|
+
/**
|
|
983
|
+
* Item that goes on right-side of item.
|
|
984
|
+
*
|
|
985
|
+
* Valid elements - `<ActionListItemText />`, `<ActionListItemIcon />`
|
|
986
|
+
*/
|
|
987
|
+
trailing?: React__default.ReactNode;
|
|
988
|
+
/**
|
|
989
|
+
* If item is selected on page load
|
|
990
|
+
*/
|
|
991
|
+
isDefaultSelected?: boolean;
|
|
992
|
+
isDisabled?: boolean;
|
|
993
|
+
intent?: Extract<Feedback, 'negative'>;
|
|
994
|
+
/**
|
|
995
|
+
* Internally passed from ActionList. No need to pass it explicitly
|
|
996
|
+
*
|
|
997
|
+
* @private
|
|
998
|
+
*/
|
|
999
|
+
_index?: number;
|
|
1000
|
+
};
|
|
1001
|
+
declare const ActionListSectionDivider: () => JSX.Element;
|
|
1002
|
+
declare type ActionListSectionProps = {
|
|
1003
|
+
title: string;
|
|
1004
|
+
children: React__default.ReactNode[] | React__default.ReactNode;
|
|
1005
|
+
/**
|
|
1006
|
+
* Internally used to hide the divider on final item in React Native.
|
|
1007
|
+
*
|
|
1008
|
+
* Should not be used by consumers (also won't work on web)
|
|
1009
|
+
*
|
|
1010
|
+
* @private
|
|
1011
|
+
*/
|
|
1012
|
+
_hideDivider?: boolean;
|
|
1013
|
+
};
|
|
1014
|
+
declare const ActionListSection: WithComponentId<ActionListSectionProps>;
|
|
1015
|
+
declare const ActionListItemIcon: WithComponentId<{
|
|
1016
|
+
icon: IconComponent$1;
|
|
1017
|
+
}>;
|
|
1018
|
+
declare const ActionListItemText: WithComponentId<{
|
|
1019
|
+
children: string;
|
|
1020
|
+
}>;
|
|
1021
|
+
/**
|
|
1022
|
+
* ### ActionListItem
|
|
1023
|
+
*
|
|
1024
|
+
* Creates option inside `ActionList`.
|
|
1025
|
+
*
|
|
1026
|
+
* #### Usage
|
|
1027
|
+
*
|
|
1028
|
+
* ```jsx
|
|
1029
|
+
* <ActionList>
|
|
1030
|
+
* <ActionListItem
|
|
1031
|
+
* title="Home"
|
|
1032
|
+
* value="home"
|
|
1033
|
+
* leading={<ActionListItemIcon icon={HomeIcon} />}
|
|
1034
|
+
* trailing={<ActionListItemText>⌘ + S</ActionListItemText>}
|
|
1035
|
+
* />
|
|
1036
|
+
* </ActionList>
|
|
1037
|
+
* ```
|
|
1038
|
+
*/
|
|
1039
|
+
declare const ActionListItem: WithComponentId<ActionListItemProps>;
|
|
1040
|
+
|
|
1041
|
+
declare type ActionListHeaderProps = {
|
|
1042
|
+
title: string;
|
|
1043
|
+
/**
|
|
1044
|
+
* Asset to be added on left side of Header.
|
|
1045
|
+
*
|
|
1046
|
+
* Valid children - `ActionListHeaderIcon`
|
|
1047
|
+
*/
|
|
1048
|
+
leading?: React__default.ReactNode;
|
|
1049
|
+
};
|
|
1050
|
+
/**
|
|
1051
|
+
* ### ActionListHeader
|
|
1052
|
+
*
|
|
1053
|
+
* To be used inside `ActionList`
|
|
1054
|
+
*
|
|
1055
|
+
* #### Usage
|
|
1056
|
+
*
|
|
1057
|
+
* ```jsx
|
|
1058
|
+
* <ActionListHeader
|
|
1059
|
+
* title="Search Tips"
|
|
1060
|
+
* leading={
|
|
1061
|
+
* <ActionListHeaderIcon
|
|
1062
|
+
* title="Recent Searches"
|
|
1063
|
+
* icon={HistoryIcon}
|
|
1064
|
+
* />
|
|
1065
|
+
* }
|
|
1066
|
+
* />
|
|
1067
|
+
* ```
|
|
1068
|
+
*/
|
|
1069
|
+
declare const ActionListHeader: WithComponentId<ActionListHeaderProps>;
|
|
1070
|
+
declare const ActionListHeaderIcon: WithComponentId<{
|
|
1071
|
+
icon: IconComponent$1;
|
|
1072
|
+
}>;
|
|
1073
|
+
|
|
1074
|
+
declare type ActionListFooterProps = {
|
|
1075
|
+
title?: string;
|
|
1076
|
+
/**
|
|
1077
|
+
* Asset to be added on left side of Footer.
|
|
1078
|
+
*
|
|
1079
|
+
* Valid children - `ActionListFooterIcon`
|
|
1080
|
+
*/
|
|
1081
|
+
leading?: React__default.ReactNode;
|
|
1082
|
+
/**
|
|
1083
|
+
* Elements to be added on right side of Footer.
|
|
1084
|
+
*
|
|
1085
|
+
* Anything can be passed here but maybe don't? Should ideally have Button or Tick Icon Buttons.
|
|
1086
|
+
*/
|
|
1087
|
+
trailing?: React__default.ReactNode;
|
|
1088
|
+
};
|
|
1089
|
+
/**
|
|
1090
|
+
* ### ActionListFooter
|
|
1091
|
+
*
|
|
1092
|
+
* To be used inside `ActionList`
|
|
1093
|
+
*
|
|
1094
|
+
* #### Usage
|
|
1095
|
+
*
|
|
1096
|
+
* ```jsx
|
|
1097
|
+
* <ActionListFooter
|
|
1098
|
+
* title="Search Tips"
|
|
1099
|
+
* leading={<ActionListFooterIcon icon={SearchIcon} />}
|
|
1100
|
+
* trailing={
|
|
1101
|
+
* <Button
|
|
1102
|
+
* onClick={() => { console.log('click') }}
|
|
1103
|
+
* >
|
|
1104
|
+
* Apply
|
|
1105
|
+
* </Button>
|
|
1106
|
+
* }
|
|
1107
|
+
* />
|
|
1108
|
+
* ```
|
|
1109
|
+
*/
|
|
1110
|
+
declare const ActionListFooter: WithComponentId<ActionListFooterProps>;
|
|
1111
|
+
declare const ActionListFooterIcon: WithComponentId<{
|
|
1112
|
+
icon: IconComponent$1;
|
|
1113
|
+
}>;
|
|
1114
|
+
|
|
1115
|
+
declare type ActionListItemAssetProps = {
|
|
1116
|
+
/**
|
|
1117
|
+
* Source of the image.
|
|
1118
|
+
*/
|
|
1119
|
+
src: string;
|
|
1120
|
+
/**
|
|
1121
|
+
* Alt tag for the image
|
|
1122
|
+
*/
|
|
1123
|
+
alt: string;
|
|
1124
|
+
};
|
|
1125
|
+
declare const ActionListItemAsset: WithComponentId<ActionListItemAssetProps>;
|
|
1126
|
+
|
|
851
1127
|
declare type PrimaryAction = {
|
|
852
1128
|
text: string;
|
|
853
1129
|
onClick: () => void;
|
|
@@ -921,61 +1197,6 @@ declare type AlertProps = {
|
|
|
921
1197
|
};
|
|
922
1198
|
declare const Alert: ({ description, title, isDismissible, onDismiss, contrast, isFullWidth, intent, actions, }: AlertProps) => ReactElement | null;
|
|
923
1199
|
|
|
924
|
-
type Theme$1 = {
|
|
925
|
-
border: Border;
|
|
926
|
-
breakpoints: Breakpoints;
|
|
927
|
-
colors: Colors;
|
|
928
|
-
spacing: Spacing;
|
|
929
|
-
motion: Motion;
|
|
930
|
-
shadows: Omit<Shadows, 'color'> & {
|
|
931
|
-
color: {
|
|
932
|
-
level: Record<ShadowLevels, string>;
|
|
933
|
-
};
|
|
934
|
-
};
|
|
935
|
-
typography: Typography;
|
|
936
|
-
};
|
|
937
|
-
|
|
938
|
-
type FeedbackIconColors$1 = `feedback.icon.${DotNotationColorStringToken<
|
|
939
|
-
Theme$1['colors']['feedback']['icon']
|
|
940
|
-
>}`;
|
|
941
|
-
|
|
942
|
-
type FeedbackActionIconColors$1 = `feedback.${Feedback}.action.icon.${DotNotationColorStringToken<
|
|
943
|
-
Theme$1['colors']['feedback'][Feedback]['action']['icon']
|
|
944
|
-
>}`;
|
|
945
|
-
|
|
946
|
-
type ActionIconColors$1 = `action.icon.${DotNotationColorStringToken<
|
|
947
|
-
Theme$1['colors']['action']['icon']
|
|
948
|
-
>}`;
|
|
949
|
-
|
|
950
|
-
type TextIconColors$1 = `surface.text.${DotNotationColorStringToken<
|
|
951
|
-
Theme$1['colors']['surface']['text']
|
|
952
|
-
>}`;
|
|
953
|
-
|
|
954
|
-
type SurfaceActionIconColors$1 = `surface.action.icon.${DotNotationColorStringToken<
|
|
955
|
-
Theme$1['colors']['surface']['action']['icon']
|
|
956
|
-
>}`;
|
|
957
|
-
|
|
958
|
-
type BadgeIconColors$1 = `badge.icon.${DotNotationColorStringToken<
|
|
959
|
-
Theme$1['colors']['badge']['icon']
|
|
960
|
-
>}`;
|
|
961
|
-
|
|
962
|
-
type IconSize$1 = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge';
|
|
963
|
-
type IconProps$1 = {
|
|
964
|
-
/**
|
|
965
|
-
* Color token (not to be confused with actual hsla value)
|
|
966
|
-
*/
|
|
967
|
-
color:
|
|
968
|
-
| ActionIconColors$1
|
|
969
|
-
| SurfaceActionIconColors$1
|
|
970
|
-
| FeedbackIconColors$1
|
|
971
|
-
| FeedbackActionIconColors$1
|
|
972
|
-
| TextIconColors$1
|
|
973
|
-
| BadgeIconColors$1
|
|
974
|
-
| 'currentColor'; // currentColor is useful for letting the SVG inherit color property from its container
|
|
975
|
-
size: IconSize$1;
|
|
976
|
-
};
|
|
977
|
-
type IconComponent$1 = React.ComponentType<IconProps$1>;
|
|
978
|
-
|
|
979
1200
|
declare type BadgeProps = {
|
|
980
1201
|
/**
|
|
981
1202
|
* Sets the label for the badge.
|
|
@@ -1474,6 +1695,11 @@ declare type CheckboxProps = {
|
|
|
1474
1695
|
* @default "medium"
|
|
1475
1696
|
*/
|
|
1476
1697
|
size?: 'small' | 'medium';
|
|
1698
|
+
/**
|
|
1699
|
+
* Sets the tab-index property on checkbox element
|
|
1700
|
+
*
|
|
1701
|
+
*/
|
|
1702
|
+
tabIndex?: number;
|
|
1477
1703
|
};
|
|
1478
1704
|
declare const Checkbox: React__default.ForwardRefExoticComponent<CheckboxProps & React__default.RefAttributes<BladeElementRef>>;
|
|
1479
1705
|
|
|
@@ -1553,6 +1779,48 @@ declare type CheckboxGroupProps = {
|
|
|
1553
1779
|
};
|
|
1554
1780
|
declare const CheckboxGroup: ({ children, label, helpText, isDisabled, necessityIndicator, labelPosition, validationState, errorText, name, defaultValue, onChange, value, size, }: CheckboxGroupProps) => React__default.ReactElement;
|
|
1555
1781
|
|
|
1782
|
+
declare type DropdownProps = {
|
|
1783
|
+
selectionType?: 'single' | 'multiple';
|
|
1784
|
+
children: React__default.ReactNode[];
|
|
1785
|
+
};
|
|
1786
|
+
/**
|
|
1787
|
+
* ### Dropdown component
|
|
1788
|
+
*
|
|
1789
|
+
* Dropdown component is generic component that controls the dropdown functionality.
|
|
1790
|
+
* It can be used with multiple triggers and mostly contains ActionList component inside it
|
|
1791
|
+
*
|
|
1792
|
+
* ---
|
|
1793
|
+
*
|
|
1794
|
+
* #### Usage
|
|
1795
|
+
*
|
|
1796
|
+
* ```jsx
|
|
1797
|
+
* <Dropdown selectionType="single">
|
|
1798
|
+
* <SelectInput />
|
|
1799
|
+
* <DropdownOverlay>
|
|
1800
|
+
* <ActionList>
|
|
1801
|
+
* <ActionListItem />
|
|
1802
|
+
* <ActionListItem />
|
|
1803
|
+
* </ActionList>
|
|
1804
|
+
* </DropdownOverlay>
|
|
1805
|
+
* </Dropdown>
|
|
1806
|
+
* ```
|
|
1807
|
+
*
|
|
1808
|
+
* ---
|
|
1809
|
+
*
|
|
1810
|
+
* Checkout {@link https://blade.razorpay.com/?path=/docs/components-dropdown-with-select--with-single-select Dropdown Documentation}
|
|
1811
|
+
*/
|
|
1812
|
+
declare const Dropdown: WithComponentId<DropdownProps>;
|
|
1813
|
+
|
|
1814
|
+
declare type DropdownOverlayProps = {
|
|
1815
|
+
children: React__default.ReactNode;
|
|
1816
|
+
};
|
|
1817
|
+
/**
|
|
1818
|
+
* Overlay of dropdown
|
|
1819
|
+
*
|
|
1820
|
+
* Wrap your ActionList within this component
|
|
1821
|
+
*/
|
|
1822
|
+
declare const DropdownOverlay: WithComponentId<DropdownOverlayProps>;
|
|
1823
|
+
|
|
1556
1824
|
declare const ArrowDownIcon: IconComponent;
|
|
1557
1825
|
|
|
1558
1826
|
declare const ArrowLeftIcon: IconComponent;
|
|
@@ -2171,9 +2439,9 @@ type FormInputOnKeyDownEvent = {
|
|
|
2171
2439
|
|
|
2172
2440
|
declare type BaseInputProps = FormInputLabelProps & FormInputValidationProps & {
|
|
2173
2441
|
/**
|
|
2174
|
-
* Determines if it needs to be rendered as input or
|
|
2442
|
+
* Determines if it needs to be rendered as input, textarea or button
|
|
2175
2443
|
*/
|
|
2176
|
-
as?: 'input' | 'textarea';
|
|
2444
|
+
as?: 'input' | 'textarea' | 'button';
|
|
2177
2445
|
/**
|
|
2178
2446
|
* ID that will be used for accessibility
|
|
2179
2447
|
*/
|
|
@@ -2206,6 +2474,10 @@ declare type BaseInputProps = FormInputLabelProps & FormInputValidationProps & {
|
|
|
2206
2474
|
* The callback function to be invoked when the value of the input field changes
|
|
2207
2475
|
*/
|
|
2208
2476
|
onChange?: FormInputOnEvent;
|
|
2477
|
+
/**
|
|
2478
|
+
* The callback function to be invoked when input is clicked
|
|
2479
|
+
*/
|
|
2480
|
+
onClick?: FormInputOnEvent;
|
|
2209
2481
|
/**
|
|
2210
2482
|
* The callback function to be invoked when the value of the input field has any input
|
|
2211
2483
|
*/
|
|
@@ -2220,6 +2492,10 @@ declare type BaseInputProps = FormInputLabelProps & FormInputValidationProps & {
|
|
|
2220
2492
|
* For React Native this will call `onEndEditing` event since we want to get the last value of the input field
|
|
2221
2493
|
*/
|
|
2222
2494
|
onBlur?: FormInputOnEvent;
|
|
2495
|
+
/**
|
|
2496
|
+
* Ignores the blur event animation (Used in Select to ignore blur animation when item in option is clicked)
|
|
2497
|
+
*/
|
|
2498
|
+
shouldIgnoreBlurAnimation?: boolean;
|
|
2223
2499
|
/**
|
|
2224
2500
|
* Used to turn the input field to controlled so user can control the value
|
|
2225
2501
|
*/
|
|
@@ -2313,6 +2589,16 @@ declare type BaseInputProps = FormInputLabelProps & FormInputValidationProps & {
|
|
|
2313
2589
|
* Sets the accessibility label for the input
|
|
2314
2590
|
*/
|
|
2315
2591
|
accessibilityLabel?: string;
|
|
2592
|
+
/**
|
|
2593
|
+
* Sets the id of the label
|
|
2594
|
+
*
|
|
2595
|
+
* (Useful when assigning one label to multiple elements using aria-labelledby)
|
|
2596
|
+
*/
|
|
2597
|
+
labelId?: string;
|
|
2598
|
+
/**
|
|
2599
|
+
* Can be used in select to set the id of the active descendant from the listbox
|
|
2600
|
+
*/
|
|
2601
|
+
activeDescendant?: string;
|
|
2316
2602
|
/**
|
|
2317
2603
|
* Hides the label text
|
|
2318
2604
|
*/
|
|
@@ -2326,6 +2612,18 @@ declare type BaseInputProps = FormInputLabelProps & FormInputValidationProps & {
|
|
|
2326
2612
|
* for internal metric collection purposes
|
|
2327
2613
|
*/
|
|
2328
2614
|
componentName?: string;
|
|
2615
|
+
/**
|
|
2616
|
+
* whether the input has a popup
|
|
2617
|
+
*/
|
|
2618
|
+
hasPopup?: AriaAttributes['hasPopup'];
|
|
2619
|
+
/**
|
|
2620
|
+
* id of the popup
|
|
2621
|
+
*/
|
|
2622
|
+
popupId?: string;
|
|
2623
|
+
/**
|
|
2624
|
+
* true if popup is in expanded state
|
|
2625
|
+
*/
|
|
2626
|
+
isPopupExpanded?: boolean;
|
|
2329
2627
|
};
|
|
2330
2628
|
|
|
2331
2629
|
declare type Type = Exclude<BaseInputProps['type'], 'password'>;
|
|
@@ -2353,7 +2651,7 @@ declare type TextInputProps = Pick<BaseInputProps, 'label' | 'labelPosition' | '
|
|
|
2353
2651
|
*/
|
|
2354
2652
|
type?: Type;
|
|
2355
2653
|
};
|
|
2356
|
-
declare const TextInput: React__default.ForwardRefExoticComponent<Pick<BaseInputProps, "placeholder" | "label" | "value" | "name" | "autoFocus" | "defaultValue" | "prefix" | "onFocus" | "onBlur" | "onChange" | "isDisabled" | "labelPosition" | "
|
|
2654
|
+
declare const TextInput: React__default.ForwardRefExoticComponent<Pick<BaseInputProps, "placeholder" | "label" | "value" | "name" | "autoFocus" | "defaultValue" | "prefix" | "onFocus" | "onBlur" | "onChange" | "isDisabled" | "labelPosition" | "validationState" | "helpText" | "errorText" | "necessityIndicator" | "successText" | "isRequired" | "suffix" | "maxCharacters" | "keyboardReturnKeyType" | "autoCompleteSuggestionType"> & {
|
|
2357
2655
|
/**
|
|
2358
2656
|
* Decides whether to render a clear icon button
|
|
2359
2657
|
*/
|
|
@@ -2477,6 +2775,48 @@ declare type OTPInputProps = Pick<BaseInputProps, 'label' | 'labelPosition' | 'v
|
|
|
2477
2775
|
*/
|
|
2478
2776
|
declare const OTPInput: ({ autoFocus, errorText, helpText, isDisabled, keyboardReturnKeyType, keyboardType, label, labelPosition, name, onChange, onOTPFilled, otpLength, placeholder, successText, validationState, value, isMasked, autoCompleteSuggestionType, }: OTPInputProps) => React__default.ReactElement;
|
|
2479
2777
|
|
|
2778
|
+
declare type SelectInputProps = Pick<BaseInputProps, 'label' | 'labelPosition' | 'necessityIndicator' | 'validationState' | 'helpText' | 'errorText' | 'successText' | 'name' | 'isDisabled' | 'isRequired' | 'prefix' | 'suffix' | 'autoFocus' | 'onClick' | 'onFocus' | 'onBlur' | 'placeholder'> & {
|
|
2779
|
+
icon?: IconComponent$1;
|
|
2780
|
+
onChange?: ({ name, values }: {
|
|
2781
|
+
name?: string;
|
|
2782
|
+
values: string[];
|
|
2783
|
+
}) => void;
|
|
2784
|
+
};
|
|
2785
|
+
/**
|
|
2786
|
+
* ### SelectInput
|
|
2787
|
+
*
|
|
2788
|
+
* Our equivalent of `<select>` tag. Lets you select items from given options.
|
|
2789
|
+
*
|
|
2790
|
+
* To be used in combination of `Dropdown` and `ActionList` component
|
|
2791
|
+
*
|
|
2792
|
+
* ---
|
|
2793
|
+
*
|
|
2794
|
+
* #### Usage
|
|
2795
|
+
*
|
|
2796
|
+
* ```diff
|
|
2797
|
+
* <Dropdown>
|
|
2798
|
+
* + <SelectInput label="Select Fruits" />
|
|
2799
|
+
* <DropdownOverlay>
|
|
2800
|
+
* <ActionList>
|
|
2801
|
+
* <ActionListItem title="Mango" value="mango" />
|
|
2802
|
+
* <ActionListItem title="Apple" value="apple" />
|
|
2803
|
+
* </ActionList>
|
|
2804
|
+
* </DropdownOverlay>
|
|
2805
|
+
* </Dropdown>
|
|
2806
|
+
* ```
|
|
2807
|
+
*
|
|
2808
|
+
* ---
|
|
2809
|
+
*
|
|
2810
|
+
* Checkout {@link https://blade.razorpay.com/?path=/docs/components-dropdown-with-select--with-single-select SelectInput Documentation}.
|
|
2811
|
+
*/
|
|
2812
|
+
declare const SelectInput: React__default.ForwardRefExoticComponent<Pick<BaseInputProps, "placeholder" | "label" | "name" | "autoFocus" | "prefix" | "onFocus" | "onBlur" | "onClick" | "isDisabled" | "labelPosition" | "validationState" | "helpText" | "errorText" | "necessityIndicator" | "successText" | "isRequired" | "suffix"> & {
|
|
2813
|
+
icon?: IconComponent$1 | undefined;
|
|
2814
|
+
onChange?: (({ name, values }: {
|
|
2815
|
+
name?: string | undefined;
|
|
2816
|
+
values: string[];
|
|
2817
|
+
}) => void) | undefined;
|
|
2818
|
+
} & React__default.RefAttributes<BladeElementRef>>;
|
|
2819
|
+
|
|
2480
2820
|
declare type IndicatorCommonProps = {
|
|
2481
2821
|
/**
|
|
2482
2822
|
* Sets the color tone
|
|
@@ -2514,9 +2854,244 @@ declare type IndicatorWithA11yLabel = {
|
|
|
2514
2854
|
declare type IndicatorProps = IndicatorCommonProps & (IndicatorWithA11yLabel | IndicatorWithoutA11yLabel);
|
|
2515
2855
|
declare const Indicator: ({ accessibilityLabel, children, size, intent, }: IndicatorProps) => ReactElement;
|
|
2516
2856
|
|
|
2517
|
-
declare type
|
|
2518
|
-
|
|
2519
|
-
|
|
2857
|
+
declare type ListItemProps = {
|
|
2858
|
+
/**
|
|
2859
|
+
* Children to be rendered for ListItem. This can be a text, ListItemLink or another List.
|
|
2860
|
+
*
|
|
2861
|
+
*/
|
|
2862
|
+
children: React__default.ReactNode;
|
|
2863
|
+
/**
|
|
2864
|
+
* Icon to be rendered for a ListItem's bullet.
|
|
2865
|
+
*
|
|
2866
|
+
*/
|
|
2867
|
+
icon?: IconComponent;
|
|
2868
|
+
/**
|
|
2869
|
+
* This is a private prop to be used only for internal logic purposes.
|
|
2870
|
+
*
|
|
2871
|
+
*/
|
|
2872
|
+
_itemNumber?: undefined;
|
|
2873
|
+
};
|
|
2874
|
+
declare const ListItem: {
|
|
2875
|
+
({ children, icon, _itemNumber }: ListItemProps): React__default.ReactElement;
|
|
2876
|
+
componentId: string;
|
|
2877
|
+
};
|
|
2878
|
+
|
|
2879
|
+
declare type ListCommonProps = {
|
|
2880
|
+
/**
|
|
2881
|
+
* ListItem to be rendered for the List.
|
|
2882
|
+
*
|
|
2883
|
+
*/
|
|
2884
|
+
children: React__default.ReactElement<ListItemProps> | React__default.ReactElement<ListItemProps>[];
|
|
2885
|
+
/**
|
|
2886
|
+
* Sets the variant to be rendered for the List.
|
|
2887
|
+
*
|
|
2888
|
+
* @default 'unordered'
|
|
2889
|
+
*/
|
|
2890
|
+
variant?: 'unordered' | 'ordered' | 'ordered-filled';
|
|
2891
|
+
/**
|
|
2892
|
+
* Sets the size for the List.
|
|
2893
|
+
*
|
|
2894
|
+
* @default 'medium'
|
|
2895
|
+
*/
|
|
2896
|
+
size?: 'small' | 'medium';
|
|
2897
|
+
};
|
|
2898
|
+
declare type ListWithIconProps = ListCommonProps & {
|
|
2899
|
+
variant?: 'unordered';
|
|
2900
|
+
icon?: IconComponent;
|
|
2901
|
+
};
|
|
2902
|
+
declare type ListWithoutIconProps = ListCommonProps & {
|
|
2903
|
+
variant?: 'ordered' | 'ordered-filled';
|
|
2904
|
+
icon?: undefined;
|
|
2905
|
+
};
|
|
2906
|
+
declare type ListProps = ListWithIconProps | ListWithoutIconProps;
|
|
2907
|
+
/**
|
|
2908
|
+
* List Component is used to display a set of related items that are composed of text/links. Each list item begins with a bullet or a number.
|
|
2909
|
+
*
|
|
2910
|
+
* ## Usage
|
|
2911
|
+
*
|
|
2912
|
+
* ```tsx
|
|
2913
|
+
* <List
|
|
2914
|
+
* variant='unordered'
|
|
2915
|
+
* size='medium'
|
|
2916
|
+
* >
|
|
2917
|
+
* <ListItem>
|
|
2918
|
+
* Item 1
|
|
2919
|
+
* <List>
|
|
2920
|
+
* <ListItem>Item 1.1</ListItem>
|
|
2921
|
+
* </List>
|
|
2922
|
+
* </ListItem>
|
|
2923
|
+
* <ListItem>Item 2</ListItem>
|
|
2924
|
+
* <List />
|
|
2925
|
+
* ```
|
|
2926
|
+
*/
|
|
2927
|
+
declare const List: {
|
|
2928
|
+
({ variant, size, children, icon }: ListProps): React__default.ReactElement;
|
|
2929
|
+
componentId: string;
|
|
2930
|
+
};
|
|
2931
|
+
|
|
2932
|
+
declare type ListItemLinkProps = Exclude<LinkProps, 'size' | 'variant' | 'isDisabled'>;
|
|
2933
|
+
declare const ListItemLink: {
|
|
2934
|
+
({ accessibilityLabel, children, href, icon, iconPosition, onClick, rel, target, }: ListItemLinkProps): React.ReactElement;
|
|
2935
|
+
componentId: string;
|
|
2936
|
+
};
|
|
2937
|
+
|
|
2938
|
+
declare type TitleProps = {
|
|
2939
|
+
size?: 'small' | 'medium' | 'large';
|
|
2940
|
+
contrast?: ColorContrastTypes;
|
|
2941
|
+
type?: TextTypes;
|
|
2942
|
+
children: string;
|
|
2943
|
+
};
|
|
2944
|
+
declare const Title: ({ size, type, contrast, children, }: TitleProps) => ReactElement;
|
|
2945
|
+
|
|
2946
|
+
declare type HeadingVariant = 'regular' | 'subheading';
|
|
2947
|
+
declare type HeadingSize = 'small' | 'medium' | 'large';
|
|
2948
|
+
declare type HeadingCommonProps = {
|
|
2949
|
+
type?: TextTypes;
|
|
2950
|
+
contrast?: ColorContrastTypes;
|
|
2951
|
+
children: string;
|
|
2952
|
+
};
|
|
2953
|
+
declare type HeadingNormalVariant = HeadingCommonProps & {
|
|
2954
|
+
variant?: Exclude<HeadingVariant, 'subheading'>;
|
|
2955
|
+
/**
|
|
2956
|
+
*
|
|
2957
|
+
* @default small
|
|
2958
|
+
*/
|
|
2959
|
+
size?: HeadingSize;
|
|
2960
|
+
weight?: keyof Theme$1['typography']['fonts']['weight'];
|
|
2961
|
+
};
|
|
2962
|
+
declare type HeadingSubHeadingVariant = HeadingCommonProps & {
|
|
2963
|
+
variant?: Extract<HeadingVariant, 'subheading'>;
|
|
2964
|
+
/**
|
|
2965
|
+
* `size` cannot be used with variant="subheading". Either change to variant="regular" or remove size prop
|
|
2966
|
+
*/
|
|
2967
|
+
size?: undefined;
|
|
2968
|
+
weight?: keyof Pick<Theme$1['typography']['fonts']['weight'], 'bold'>;
|
|
2969
|
+
};
|
|
2970
|
+
/**
|
|
2971
|
+
* Conditionally changing props based on variant.
|
|
2972
|
+
* Overloads or union gives wrong intellisense.
|
|
2973
|
+
*/
|
|
2974
|
+
declare type HeadingProps<T> = T extends {
|
|
2975
|
+
variant: infer Variant;
|
|
2976
|
+
} ? Variant extends Exclude<HeadingVariant, 'subheading'> ? HeadingNormalVariant : Variant extends 'subheading' ? HeadingSubHeadingVariant : T : T;
|
|
2977
|
+
declare const Heading: <T extends {
|
|
2978
|
+
variant: HeadingVariant;
|
|
2979
|
+
}>({ variant, size, type, weight, contrast, children, }: HeadingProps<T>) => ReactElement;
|
|
2980
|
+
|
|
2981
|
+
declare type FeedbackColors = `feedback.text.${DotNotationColorStringToken<Theme$1['colors']['feedback']['text']>}`;
|
|
2982
|
+
declare type FeedbackActionColors = `feedback.${Feedback}.action.text.${DotNotationColorStringToken<Theme$1['colors']['feedback'][Feedback]['action']['text']>}`;
|
|
2983
|
+
declare type SurfaceColors = `surface.text.${DotNotationColorStringToken<Theme$1['colors']['surface']['text']>}`;
|
|
2984
|
+
declare type ActionColors = `action.text.${DotNotationColorStringToken<Theme$1['colors']['action']['text']>}`;
|
|
2985
|
+
declare type BadgeTextColors = `badge.text.${DotNotationColorStringToken<Theme$1['colors']['badge']['text']>}`;
|
|
2986
|
+
declare type BaseTextProps = {
|
|
2987
|
+
id?: string;
|
|
2988
|
+
color?: ActionColors | FeedbackColors | SurfaceColors | FeedbackActionColors | BadgeTextColors;
|
|
2989
|
+
fontFamily?: keyof Theme$1['typography']['fonts']['family'];
|
|
2990
|
+
fontSize?: keyof Theme$1['typography']['fonts']['size'];
|
|
2991
|
+
fontWeight?: keyof Theme$1['typography']['fonts']['weight'];
|
|
2992
|
+
fontStyle?: 'italic' | 'normal';
|
|
2993
|
+
textDecorationLine?: 'line-through' | 'none' | 'underline';
|
|
2994
|
+
lineHeight?: keyof Theme$1['typography']['lineHeights'];
|
|
2995
|
+
/**
|
|
2996
|
+
* Web only
|
|
2997
|
+
*/
|
|
2998
|
+
as?: 'code' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span';
|
|
2999
|
+
textAlign?: 'center' | 'justify' | 'left' | 'right';
|
|
3000
|
+
truncateAfterLines?: number;
|
|
3001
|
+
className?: string;
|
|
3002
|
+
style?: React.CSSProperties;
|
|
3003
|
+
children: React.ReactNode;
|
|
3004
|
+
accessibilityProps?: Partial<AccessibilityProps>;
|
|
3005
|
+
/**
|
|
3006
|
+
* React Native only
|
|
3007
|
+
*/
|
|
3008
|
+
numberOfLines?: number;
|
|
3009
|
+
componentName?: 'text' | 'title' | 'heading' | 'code';
|
|
3010
|
+
};
|
|
3011
|
+
|
|
3012
|
+
declare type TextCommonProps = {
|
|
3013
|
+
type?: TextTypes;
|
|
3014
|
+
contrast?: ColorContrastTypes;
|
|
3015
|
+
truncateAfterLines?: number;
|
|
3016
|
+
children: React.ReactNode;
|
|
3017
|
+
weight?: keyof Theme$1['typography']['fonts']['weight'];
|
|
3018
|
+
/**
|
|
3019
|
+
* **For Internal use only**: Sets the color of the Text component
|
|
3020
|
+
*/
|
|
3021
|
+
color?: BaseTextProps['color'];
|
|
3022
|
+
};
|
|
3023
|
+
declare type TextVariant = 'body' | 'caption';
|
|
3024
|
+
declare type TextBodyVariant = TextCommonProps & {
|
|
3025
|
+
variant?: Extract<TextVariant, 'body'>;
|
|
3026
|
+
size?: 'xsmall' | 'small' | 'medium';
|
|
3027
|
+
};
|
|
3028
|
+
declare type TextCaptionVariant = TextCommonProps & {
|
|
3029
|
+
variant?: Extract<TextVariant, 'caption'>;
|
|
3030
|
+
size?: 'medium';
|
|
3031
|
+
};
|
|
3032
|
+
/**
|
|
3033
|
+
* Conditionally changing props based on variant.
|
|
3034
|
+
* Overloads or union gives wrong intellisense.
|
|
3035
|
+
*/
|
|
3036
|
+
declare type TextProps<T> = T extends {
|
|
3037
|
+
variant: infer Variant;
|
|
3038
|
+
} ? Variant extends 'caption' ? TextCaptionVariant : Variant extends 'body' ? TextBodyVariant : T : T;
|
|
3039
|
+
declare type TextForwardedAs = {
|
|
3040
|
+
forwardedAs?: BaseTextProps['as'];
|
|
3041
|
+
};
|
|
3042
|
+
declare const getTextProps: <T extends {
|
|
3043
|
+
variant: TextVariant;
|
|
3044
|
+
}>({ variant, type, weight, size, contrast, }: Pick<TextProps<T>, "size" | "variant" | "type" | "weight" | "contrast">) => Omit<BaseTextProps, 'children'> & TextForwardedAs;
|
|
3045
|
+
declare const Text: <T extends {
|
|
3046
|
+
variant: TextVariant;
|
|
3047
|
+
}>({ variant, weight, size, type, contrast, truncateAfterLines, children, color, }: TextProps<T>) => ReactElement;
|
|
3048
|
+
|
|
3049
|
+
declare type CodeProps = {
|
|
3050
|
+
children: string;
|
|
3051
|
+
/**
|
|
3052
|
+
* Decides the fontSize and padding of Code
|
|
3053
|
+
*
|
|
3054
|
+
* @default small
|
|
3055
|
+
*/
|
|
3056
|
+
size?: 'small' | 'medium';
|
|
3057
|
+
};
|
|
3058
|
+
/**
|
|
3059
|
+
* Code component can be used for displaying token, variable names, or inlined code snippets.
|
|
3060
|
+
*
|
|
3061
|
+
* ## Usage
|
|
3062
|
+
*
|
|
3063
|
+
* ### In Web
|
|
3064
|
+
* In web, you can use it inside `Text` component or individually. The component is set to display `inline-block`
|
|
3065
|
+
*
|
|
3066
|
+
* ```tsx
|
|
3067
|
+
* <Text>
|
|
3068
|
+
* Lorem ipsum <Code>SENTRY_TOKEN</Code> normal text
|
|
3069
|
+
* </Text>
|
|
3070
|
+
* ```
|
|
3071
|
+
*
|
|
3072
|
+
* ### In React Native
|
|
3073
|
+
*
|
|
3074
|
+
* In React Native, you would have to align it using flex to make sure the Code and the surrounding text is correctly aligned
|
|
3075
|
+
*
|
|
3076
|
+
* ```tsx
|
|
3077
|
+
* <Box flexWrap="wrap" flexDirection="row" alignItems="flex-start">
|
|
3078
|
+
* <Text>Lorem ipsum </Text>
|
|
3079
|
+
* <Code>SENTRY_TOKEN</Code>
|
|
3080
|
+
* <Text> normal text</Text>
|
|
3081
|
+
* </Box>
|
|
3082
|
+
* ```
|
|
3083
|
+
*/
|
|
3084
|
+
declare const Code: ({ children, size }: CodeProps) => JSX.Element;
|
|
3085
|
+
|
|
3086
|
+
declare type ListItemCodeProps = Exclude<CodeProps, 'size'>;
|
|
3087
|
+
declare const ListItemCode: {
|
|
3088
|
+
({ children }: ListItemCodeProps): React.ReactElement;
|
|
3089
|
+
componentId: string;
|
|
3090
|
+
};
|
|
3091
|
+
|
|
3092
|
+
declare type Assertiveness = AriaAttributes['liveRegion'];
|
|
3093
|
+
|
|
3094
|
+
/**
|
|
2520
3095
|
* Announces the message using screen reader technology.
|
|
2521
3096
|
*/
|
|
2522
3097
|
declare function announce(message: string, assertiveness?: Assertiveness): void;
|
|
@@ -2756,160 +3331,16 @@ declare type SkipNavContentProps = {
|
|
|
2756
3331
|
};
|
|
2757
3332
|
declare const SkipNavContent: ({ id }: SkipNavContentProps) => JSX.Element;
|
|
2758
3333
|
|
|
2759
|
-
declare type TitleProps = {
|
|
2760
|
-
size?: 'small' | 'medium' | 'large';
|
|
2761
|
-
contrast?: ColorContrastTypes;
|
|
2762
|
-
type?: TextTypes;
|
|
2763
|
-
children: string;
|
|
2764
|
-
};
|
|
2765
|
-
declare const Title: ({ size, type, contrast, children, }: TitleProps) => ReactElement;
|
|
2766
|
-
|
|
2767
|
-
declare type HeadingVariant = 'regular' | 'subheading';
|
|
2768
|
-
declare type HeadingSize = 'small' | 'medium' | 'large';
|
|
2769
|
-
declare type HeadingCommonProps = {
|
|
2770
|
-
type?: TextTypes;
|
|
2771
|
-
contrast?: ColorContrastTypes;
|
|
2772
|
-
children: string;
|
|
2773
|
-
};
|
|
2774
|
-
declare type HeadingNormalVariant = HeadingCommonProps & {
|
|
2775
|
-
variant?: Exclude<HeadingVariant, 'subheading'>;
|
|
2776
|
-
/**
|
|
2777
|
-
*
|
|
2778
|
-
* @default small
|
|
2779
|
-
*/
|
|
2780
|
-
size?: HeadingSize;
|
|
2781
|
-
weight?: keyof Theme$1['typography']['fonts']['weight'];
|
|
2782
|
-
};
|
|
2783
|
-
declare type HeadingSubHeadingVariant = HeadingCommonProps & {
|
|
2784
|
-
variant?: Extract<HeadingVariant, 'subheading'>;
|
|
2785
|
-
/**
|
|
2786
|
-
* `size` cannot be used with variant="subheading". Either change to variant="regular" or remove size prop
|
|
2787
|
-
*/
|
|
2788
|
-
size?: undefined;
|
|
2789
|
-
weight?: keyof Pick<Theme$1['typography']['fonts']['weight'], 'bold'>;
|
|
2790
|
-
};
|
|
2791
|
-
/**
|
|
2792
|
-
* Conditionally changing props based on variant.
|
|
2793
|
-
* Overloads or union gives wrong intellisense.
|
|
2794
|
-
*/
|
|
2795
|
-
declare type HeadingProps<T> = T extends {
|
|
2796
|
-
variant: infer Variant;
|
|
2797
|
-
} ? Variant extends Exclude<HeadingVariant, 'subheading'> ? HeadingNormalVariant : Variant extends 'subheading' ? HeadingSubHeadingVariant : T : T;
|
|
2798
|
-
declare const Heading: <T extends {
|
|
2799
|
-
variant: HeadingVariant;
|
|
2800
|
-
}>({ variant, size, type, weight, contrast, children, }: HeadingProps<T>) => ReactElement;
|
|
2801
|
-
|
|
2802
|
-
declare type FeedbackColors = `feedback.text.${DotNotationColorStringToken<Theme$1['colors']['feedback']['text']>}`;
|
|
2803
|
-
declare type FeedbackActionColors = `feedback.${Feedback}.action.text.${DotNotationColorStringToken<Theme$1['colors']['feedback'][Feedback]['action']['text']>}`;
|
|
2804
|
-
declare type SurfaceColors = `surface.text.${DotNotationColorStringToken<Theme$1['colors']['surface']['text']>}`;
|
|
2805
|
-
declare type ActionColors = `action.text.${DotNotationColorStringToken<Theme$1['colors']['action']['text']>}`;
|
|
2806
|
-
declare type BadgeTextColors = `badge.text.${DotNotationColorStringToken<Theme$1['colors']['badge']['text']>}`;
|
|
2807
|
-
declare type BaseTextProps = {
|
|
2808
|
-
id?: string;
|
|
2809
|
-
color?: ActionColors | FeedbackColors | SurfaceColors | FeedbackActionColors | BadgeTextColors;
|
|
2810
|
-
fontFamily?: keyof Theme$1['typography']['fonts']['family'];
|
|
2811
|
-
fontSize?: keyof Theme$1['typography']['fonts']['size'];
|
|
2812
|
-
fontWeight?: keyof Theme$1['typography']['fonts']['weight'];
|
|
2813
|
-
fontStyle?: 'italic' | 'normal';
|
|
2814
|
-
textDecorationLine?: 'line-through' | 'none' | 'underline';
|
|
2815
|
-
lineHeight?: keyof Theme$1['typography']['lineHeights'];
|
|
2816
|
-
/**
|
|
2817
|
-
* Web only
|
|
2818
|
-
*/
|
|
2819
|
-
as?: 'code' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span';
|
|
2820
|
-
textAlign?: 'center' | 'justify' | 'left' | 'right';
|
|
2821
|
-
truncateAfterLines?: number;
|
|
2822
|
-
className?: string;
|
|
2823
|
-
style?: React.CSSProperties;
|
|
2824
|
-
children: React.ReactNode;
|
|
2825
|
-
accessibilityProps?: Partial<AccessibilityProps>;
|
|
2826
|
-
/**
|
|
2827
|
-
* React Native only
|
|
2828
|
-
*/
|
|
2829
|
-
numberOfLines?: number;
|
|
2830
|
-
componentName?: 'text' | 'title' | 'heading' | 'code';
|
|
2831
|
-
};
|
|
2832
|
-
|
|
2833
|
-
declare type TextCommonProps = {
|
|
2834
|
-
type?: TextTypes;
|
|
2835
|
-
contrast?: ColorContrastTypes;
|
|
2836
|
-
truncateAfterLines?: number;
|
|
2837
|
-
children: React.ReactNode;
|
|
2838
|
-
weight?: keyof Theme$1['typography']['fonts']['weight'];
|
|
2839
|
-
/**
|
|
2840
|
-
* **For Internal use only**: Sets the color of the Text component
|
|
2841
|
-
*/
|
|
2842
|
-
color?: BaseTextProps['color'];
|
|
2843
|
-
};
|
|
2844
|
-
declare type TextVariant = 'body' | 'caption';
|
|
2845
|
-
declare type TextBodyVariant = TextCommonProps & {
|
|
2846
|
-
variant?: Extract<TextVariant, 'body'>;
|
|
2847
|
-
size?: 'xsmall' | 'small' | 'medium';
|
|
2848
|
-
};
|
|
2849
|
-
declare type TextCaptionVariant = TextCommonProps & {
|
|
2850
|
-
variant?: Extract<TextVariant, 'caption'>;
|
|
2851
|
-
size?: 'medium';
|
|
2852
|
-
};
|
|
2853
|
-
/**
|
|
2854
|
-
* Conditionally changing props based on variant.
|
|
2855
|
-
* Overloads or union gives wrong intellisense.
|
|
2856
|
-
*/
|
|
2857
|
-
declare type TextProps<T> = T extends {
|
|
2858
|
-
variant: infer Variant;
|
|
2859
|
-
} ? Variant extends 'caption' ? TextCaptionVariant : Variant extends 'body' ? TextBodyVariant : T : T;
|
|
2860
|
-
declare type TextForwardedAs = {
|
|
2861
|
-
forwardedAs?: BaseTextProps['as'];
|
|
2862
|
-
};
|
|
2863
|
-
declare const getTextProps: <T extends {
|
|
2864
|
-
variant: TextVariant;
|
|
2865
|
-
}>({ variant, type, weight, size, contrast, }: Pick<TextProps<T>, "size" | "variant" | "type" | "weight" | "contrast">) => Omit<BaseTextProps, 'children'> & TextForwardedAs;
|
|
2866
|
-
declare const Text: <T extends {
|
|
2867
|
-
variant: TextVariant;
|
|
2868
|
-
}>({ variant, weight, size, type, contrast, truncateAfterLines, children, color, }: TextProps<T>) => ReactElement;
|
|
2869
|
-
|
|
2870
|
-
declare type CodeProps = {
|
|
2871
|
-
children: string;
|
|
2872
|
-
/**
|
|
2873
|
-
* Decides the fontSize and padding of Code
|
|
2874
|
-
*
|
|
2875
|
-
* @default small
|
|
2876
|
-
*/
|
|
2877
|
-
size?: 'small' | 'medium';
|
|
2878
|
-
};
|
|
2879
|
-
/**
|
|
2880
|
-
* Code component can be used for displaying token, variable names, or inlined code snippets.
|
|
2881
|
-
*
|
|
2882
|
-
* ## Usage
|
|
2883
|
-
*
|
|
2884
|
-
* ### In Web
|
|
2885
|
-
* In web, you can use it inside `Text` component or individually. The component is set to display `inline-block`
|
|
2886
|
-
*
|
|
2887
|
-
* ```tsx
|
|
2888
|
-
* <Text>
|
|
2889
|
-
* Lorem ipsum <Code>SENTRY_TOKEN</Code> normal text
|
|
2890
|
-
* </Text>
|
|
2891
|
-
* ```
|
|
2892
|
-
*
|
|
2893
|
-
* ### In React Native
|
|
2894
|
-
*
|
|
2895
|
-
* In React Native, you would have to align it using flex to make sure the Code and the surrounding text is correctly aligned
|
|
2896
|
-
*
|
|
2897
|
-
* ```tsx
|
|
2898
|
-
* <Box flexWrap="wrap" flexDirection="row" alignItems="flex-start">
|
|
2899
|
-
* <Text>Lorem ipsum </Text>
|
|
2900
|
-
* <Code>SENTRY_TOKEN</Code>
|
|
2901
|
-
* <Text> normal text</Text>
|
|
2902
|
-
* </Box>
|
|
2903
|
-
* ```
|
|
2904
|
-
*/
|
|
2905
|
-
declare const Code: ({ children, size }: CodeProps) => JSX.Element;
|
|
2906
|
-
|
|
2907
3334
|
declare type VisuallyHiddenProps = {
|
|
2908
3335
|
children: React.ReactNode;
|
|
2909
3336
|
};
|
|
2910
3337
|
|
|
2911
3338
|
declare const VisuallyHidden: ({ children }: VisuallyHiddenProps) => JSX.Element;
|
|
2912
3339
|
|
|
3340
|
+
/**
|
|
3341
|
+
* Screen reader class adapted from webaim
|
|
3342
|
+
* https://webaim.org/techniques/css/invisiblecontent/#techniques
|
|
3343
|
+
*/
|
|
2913
3344
|
declare const screenReaderStyles: CSSObject;
|
|
2914
3345
|
|
|
2915
|
-
export { ActivityIcon, AirplayIcon, Alert, AlertCircleIcon, AlertTriangleIcon as AlertOctagonIcon, AlertOnlyIcon, AlertProps, AlertTriangleIcon$1 as AlertTriangleIcon, AlignCenterIcon, AlignJustifyIcon, AlignLeftIcon, AlignRightIcon, AnchorIcon, AnnouncementIcon, ApertureIcon, AppStoreIcon, ArrowDownIcon, ArrowDownLeftIcon, ArrowDownRightIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, ArrowUpLeftIcon, ArrowUpRightIcon, AtSignIcon, Attachment as AttachmentIcon, AwardIcon, Badge, BadgeProps, BankIcon, BarChartAltIcon, BarChartIcon, BatteryChargingIcon, BatteryIcon, BellIcon, BellOffIcon, BillIcon, BladeProvider, BladeProviderProps, BluetoothIcon, BoldIcon, BookIcon, BookmarkIcon, BoxIcon, BriefcaseIcon, Button, ButtonProps, CalendarIcon, CameraIcon, CameraOffIcon, Card, CardBody, CardFooter, CardFooterAction, CardFooterLeading, CardFooterTrailing, CardHeader, CardHeaderBadge, CardHeaderCounter, CardHeaderIcon, CardHeaderIconButton, CardHeaderLeading, CardHeaderLink, CardHeaderText, CardHeaderTrailing, CardProps, CastIcon, CheckCircleIcon, CheckIcon, CheckSquareIcon, Checkbox, CheckboxGroup, CheckboxGroupProps, CheckboxProps, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsDownIcon, ChevronsLeftIcon, ChevronsRightIcon, ChevronsUpIcon, ChromeIcon, CircleIcon, ClipboardIcon, ClockIcon, CloseIcon, CloudDrizzleIcon, CloudIcon, CloudLightningIcon, CloudOffIcon, CloudRainIcon, CloudSnowIcon, Code, CodeProps, CodepenIcon, CoinsIcon, CommandIcon, CompassIcon, ComponentIds, CopyIcon, CornerDownLeftIcon, CornerDownRightIcon, CornerLeftDownIcon, CornerLeftUpIcon, CornerRightDownIcon, CornerRightUpIcon, CornerUpLeftIcon, CornerUpRightIcon, Counter, CounterProps, CpuIcon, CreditCardIcon, CropIcon, CrosshairIcon, CustomersIcon, CutIcon, DashboardIcon, DeleteIcon, DiscIcon, DollarIcon, DollarsIcon, DownloadCloudIcon, DownloadIcon, DropletIcon, EditComposeIcon, EditIcon, EditInlineIcon, ExportIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FacebookIcon, FastForwardIcon, FeatherIcon, FileIcon, FileMinusIcon, FilePlusIcon, FileTextIcon, FilmIcon, FilterIcon, FlagIcon, FolderIcon, FullScreenEnterIcon, FullScreenExitIcon, GithubIcon, GitlabIcon, GlobeIcon, GridIcon, HashIcon, Heading, HeadingProps, HeadphonesIcon, HeartIcon, HelpCircleIcon, HistoryIcon, HomeIcon, IconButton, IconButtonProps, IconComponent, IconProps, IconSize, ImageIcon, InboxIcon, Indicator, IndicatorProps, InfoIcon, InstagramIcon, InvoicesIcon, ItalicIcon, LayersIcon, LayoutIcon, LifeBuoyIcon, Link, LinkIcon, LinkProps, ListIcon, LoaderIcon, LockIcon, LogInIcon, LogOutIcon, MailIcon, MailOpenIcon, MapIcon, MapPinIcon, MaximizeIcon, MenuDotsIcon, MenuIcon, MessageCircleIcon, MessageSquareIcon, MicIcon, MicOffIcon, MinimizeIcon, MinusCircleIcon, MinusIcon, MinusSquareIcon, MonitorIcon, MoonIcon, MoreHorizontalIcon, MoreVerticalIcon, MoveIcon, MusicIcon, MyAccountIcon, NavigationIcon, OTPInput, OTPInputProps, OctagonIcon, OffersIcon, PackageIcon, PaperclipIcon, PasswordInput, PasswordInputProps, PauseCircleIcon, PauseIcon, PaymentButtonsIcon, PaymentLinksIcon, PaymentPagesIcon, PercentIcon, PhoneCallIcon, PhoneForwardedIcon, PhoneIcon, PhoneIncomingIcon, PhoneMissedIcon, PhoneOffIcon, PhoneOutgoingIcon, PieChartIcon, PlayCircleIcon, PlayIcon, PlusCircleIcon, PlusIcon, PlusSquareIcon, PocketIcon, PowerIcon, PrinterIcon, ProgressBar, ProgressBarProps, ProgressBarVariant, QRCodeIcon, Radio, RadioGroup, RadioGroupProps, RadioIcon, RadioProps, RazorpayIcon, RazorpayXIcon, RefreshIcon, RepeatIcon, ReportsIcon, RewindIcon, RotateClockWiseIcon, RotateCounterClockWiseIcon, RoutesIcon, RupeeIcon, RupeesIcon, SaveIcon, ScissorsIcon, SearchIcon, SendIcon, ServerIcon, SettingsIcon, SettlementsIcon, ShareIcon, ShieldIcon, ShoppingCartIcon, ShuffleIcon, SidebarIcon, SkipBackIcon, SkipForwardIcon, SkipNavContent, SkipNavLink, SlackIcon, SlashIcon, SlidersIcon, SmartCollectIcon, SmartphoneIcon, SpeakerIcon, Spinner, SpinnerProps, SquareIcon, StampIcon, StarIcon, StopCircleIcon, SubscriptionsIcon, SunIcon, SunriseIcon, SunsetIcon, TabletIcon, TagIcon, TargetIcon, Text, TextArea, TextAreaProps, TextInput, TextInputProps, TextProps, TextVariant, Theme, ThermometerIcon, ThumbsDownIcon, ThumbsUpIcon, Title, TitleProps, ToggleLeftIcon, ToggleRightIcon, TransactionsIcon, TrashIcon, TrendingDownIcon, TrendingUpIcon, TriangleIcon, TvIcon, TwitterIcon, TypeIcon, UmbrellaIcon, UnderlineIcon, UnlockIcon, UploadCloudIcon, UploadIcon, UserCheckIcon, UserIcon, UserMinusIcon, UserPlusIcon, UserXIcon, UsersIcon, VideoIcon, VideoOffIcon, VisuallyHidden, VisuallyHiddenProps, VoicemailIcon, VolumeHighIcon, VolumeIcon, VolumeLowIcon, VolumeMuteIcon, WatchIcon, WifiIcon, WifiOffIcon, WindIcon, XCircleIcon, XSquareIcon, ZapIcon, ZoomInIcon, ZoomOutIcon, announce, clearAnnouncer, destroyAnnouncer, getTextProps, screenReaderStyles, useTheme };
|
|
3346
|
+
export { ActionList, ActionListFooter, ActionListFooterIcon, ActionListFooterProps, ActionListHeader, ActionListHeaderIcon, ActionListHeaderProps, ActionListItem, ActionListItemAsset, ActionListItemAssetProps, ActionListItemIcon, ActionListItemProps, ActionListItemText, ActionListProps, ActionListSection, ActionListSectionDivider, ActionListSectionProps, ActivityIcon, AirplayIcon, Alert, AlertCircleIcon, AlertTriangleIcon as AlertOctagonIcon, AlertOnlyIcon, AlertProps, AlertTriangleIcon$1 as AlertTriangleIcon, AlignCenterIcon, AlignJustifyIcon, AlignLeftIcon, AlignRightIcon, AnchorIcon, AnnouncementIcon, ApertureIcon, AppStoreIcon, ArrowDownIcon, ArrowDownLeftIcon, ArrowDownRightIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, ArrowUpLeftIcon, ArrowUpRightIcon, AtSignIcon, Attachment as AttachmentIcon, AwardIcon, Badge, BadgeProps, BankIcon, BarChartAltIcon, BarChartIcon, BatteryChargingIcon, BatteryIcon, BellIcon, BellOffIcon, BillIcon, BladeProvider, BladeProviderProps, BluetoothIcon, BoldIcon, BookIcon, BookmarkIcon, BoxIcon, BriefcaseIcon, Button, ButtonProps, CalendarIcon, CameraIcon, CameraOffIcon, Card, CardBody, CardFooter, CardFooterAction, CardFooterLeading, CardFooterTrailing, CardHeader, CardHeaderBadge, CardHeaderCounter, CardHeaderIcon, CardHeaderIconButton, CardHeaderLeading, CardHeaderLink, CardHeaderText, CardHeaderTrailing, CardProps, CastIcon, CheckCircleIcon, CheckIcon, CheckSquareIcon, Checkbox, CheckboxGroup, CheckboxGroupProps, CheckboxProps, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsDownIcon, ChevronsLeftIcon, ChevronsRightIcon, ChevronsUpIcon, ChromeIcon, CircleIcon, ClipboardIcon, ClockIcon, CloseIcon, CloudDrizzleIcon, CloudIcon, CloudLightningIcon, CloudOffIcon, CloudRainIcon, CloudSnowIcon, Code, CodeProps, CodepenIcon, CoinsIcon, CommandIcon, CompassIcon, ComponentIds, CopyIcon, CornerDownLeftIcon, CornerDownRightIcon, CornerLeftDownIcon, CornerLeftUpIcon, CornerRightDownIcon, CornerRightUpIcon, CornerUpLeftIcon, CornerUpRightIcon, Counter, CounterProps, CpuIcon, CreditCardIcon, CropIcon, CrosshairIcon, CustomersIcon, CutIcon, DashboardIcon, DeleteIcon, DiscIcon, DollarIcon, DollarsIcon, DownloadCloudIcon, DownloadIcon, Dropdown, DropdownOverlay, DropdownOverlayProps, DropdownProps, DropletIcon, EditComposeIcon, EditIcon, EditInlineIcon, ExportIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FacebookIcon, FastForwardIcon, FeatherIcon, FileIcon, FileMinusIcon, FilePlusIcon, FileTextIcon, FilmIcon, FilterIcon, FlagIcon, FolderIcon, FullScreenEnterIcon, FullScreenExitIcon, GithubIcon, GitlabIcon, GlobeIcon, GridIcon, HashIcon, Heading, HeadingProps, HeadphonesIcon, HeartIcon, HelpCircleIcon, HistoryIcon, HomeIcon, IconButton, IconButtonProps, IconComponent, IconProps, IconSize, ImageIcon, InboxIcon, Indicator, IndicatorProps, InfoIcon, InstagramIcon, InvoicesIcon, ItalicIcon, LayersIcon, LayoutIcon, LifeBuoyIcon, Link, LinkIcon, LinkProps, List, ListIcon, ListItem, ListItemCode, ListItemCodeProps, ListItemLink, ListItemLinkProps, ListItemProps, ListProps, LoaderIcon, LockIcon, LogInIcon, LogOutIcon, MailIcon, MailOpenIcon, MapIcon, MapPinIcon, MaximizeIcon, MenuDotsIcon, MenuIcon, MessageCircleIcon, MessageSquareIcon, MicIcon, MicOffIcon, MinimizeIcon, MinusCircleIcon, MinusIcon, MinusSquareIcon, MonitorIcon, MoonIcon, MoreHorizontalIcon, MoreVerticalIcon, MoveIcon, MusicIcon, MyAccountIcon, NavigationIcon, OTPInput, OTPInputProps, OctagonIcon, OffersIcon, PackageIcon, PaperclipIcon, PasswordInput, PasswordInputProps, PauseCircleIcon, PauseIcon, PaymentButtonsIcon, PaymentLinksIcon, PaymentPagesIcon, PercentIcon, PhoneCallIcon, PhoneForwardedIcon, PhoneIcon, PhoneIncomingIcon, PhoneMissedIcon, PhoneOffIcon, PhoneOutgoingIcon, PieChartIcon, PlayCircleIcon, PlayIcon, PlusCircleIcon, PlusIcon, PlusSquareIcon, PocketIcon, PowerIcon, PrinterIcon, ProgressBar, ProgressBarProps, ProgressBarVariant, QRCodeIcon, Radio, RadioGroup, RadioGroupProps, RadioIcon, RadioProps, RazorpayIcon, RazorpayXIcon, RefreshIcon, RepeatIcon, ReportsIcon, RewindIcon, RotateClockWiseIcon, RotateCounterClockWiseIcon, RoutesIcon, RupeeIcon, RupeesIcon, SaveIcon, ScissorsIcon, SearchIcon, SelectInput, SelectInputProps, SendIcon, ServerIcon, SettingsIcon, SettlementsIcon, ShareIcon, ShieldIcon, ShoppingCartIcon, ShuffleIcon, SidebarIcon, SkipBackIcon, SkipForwardIcon, SkipNavContent, SkipNavLink, SlackIcon, SlashIcon, SlidersIcon, SmartCollectIcon, SmartphoneIcon, SpeakerIcon, Spinner, SpinnerProps, SquareIcon, StampIcon, StarIcon, StopCircleIcon, SubscriptionsIcon, SunIcon, SunriseIcon, SunsetIcon, TabletIcon, TagIcon, TargetIcon, Text, TextArea, TextAreaProps, TextInput, TextInputProps, TextProps, TextVariant, Theme, ThermometerIcon, ThumbsDownIcon, ThumbsUpIcon, Title, TitleProps, ToggleLeftIcon, ToggleRightIcon, TransactionsIcon, TrashIcon, TrendingDownIcon, TrendingUpIcon, TriangleIcon, TvIcon, TwitterIcon, TypeIcon, UmbrellaIcon, UnderlineIcon, UnlockIcon, UploadCloudIcon, UploadIcon, UserCheckIcon, UserIcon, UserMinusIcon, UserPlusIcon, UserXIcon, UsersIcon, VideoIcon, VideoOffIcon, VisuallyHidden, VisuallyHiddenProps, VoicemailIcon, VolumeHighIcon, VolumeIcon, VolumeLowIcon, VolumeMuteIcon, WatchIcon, WifiIcon, WifiOffIcon, WindIcon, XCircleIcon, XSquareIcon, ZapIcon, ZoomInIcon, ZoomOutIcon, announce, clearAnnouncer, destroyAnnouncer, getTextProps, screenReaderStyles, useTheme };
|