dhre-ui-kit 2.0.23 → 3.0.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/lib/components/accordion/Accordion.styles.d.ts +0 -1
- package/lib/components/avatar/Avatar.d.ts +4 -0
- package/lib/components/avatar/Avatar.interface.d.ts +97 -0
- package/lib/components/avatar/Avatar.styles.d.ts +342 -0
- package/lib/components/avatar/index.d.ts +2 -0
- package/lib/components/background/Background.d.ts +4 -0
- package/lib/components/background/Background.interface.d.ts +16 -0
- package/lib/components/background/Background.styles.d.ts +10 -0
- package/lib/components/background/index.d.ts +2 -0
- package/lib/components/bottomDrawer/BottomDrawer.d.ts +2 -2
- package/lib/components/bottomDrawer/BottomDrawer.styles.d.ts +7 -1
- package/lib/components/button/Button.interface.d.ts +54 -2
- package/lib/components/button/Button.styles.d.ts +123 -0
- package/lib/components/checkBox/CheckBox.d.ts +2 -2
- package/lib/components/checkBox/CheckBox.interface.d.ts +35 -0
- package/lib/components/checkBox/CheckBox.styles.d.ts +4 -22
- package/lib/components/chip/Chip.d.ts +4 -0
- package/lib/components/chip/Chip.interface.d.ts +52 -0
- package/lib/components/chip/Chip.styles.d.ts +42 -0
- package/lib/components/chip/index.d.ts +2 -0
- package/lib/components/customDocumentPicker/CustomDocumentPicker.d.ts +0 -4
- package/lib/components/customDocumentPicker/CustomDocumentPicker.interface.d.ts +0 -16
- package/lib/components/customDocumentPicker/index.d.ts +0 -1
- package/lib/components/customHeader/CustomHeader.interface.d.ts +37 -6
- package/lib/components/customHeader/CustomHeader.styles.d.ts +10 -7
- package/lib/components/customIcon/CustomIcon.d.ts +2 -2
- package/lib/components/customIcon/CustomIcon.interface.d.ts +30 -1
- package/lib/components/customIcon/CustomIcon.styles.d.ts +76 -1
- package/lib/components/customInputText/CustomInputText.styles.d.ts +22 -53
- package/lib/components/customSearchBar/CustomSearchBar.d.ts +2 -2
- package/lib/components/customSearchBar/CustomSearchBar.interface.d.ts +1 -0
- package/lib/components/customSearchBar/CustomSearchBar.styles.d.ts +38 -59
- package/lib/components/dateRangePicker/DateRangePicker.styles.d.ts +22 -53
- package/lib/components/dropDown/DropDown.d.ts +7 -2
- package/lib/components/feedback/feedback.d.ts +1 -0
- package/lib/components/feedback/feedback.style.d.ts +20 -22
- package/lib/components/loader/Loader.d.ts +21 -0
- package/lib/components/loader/Loader.interface.d.ts +53 -0
- package/lib/components/loader/Loader.styles.d.ts +45 -0
- package/lib/components/loader/index.d.ts +2 -0
- package/lib/components/notificationBandge/NotificationBandge.styles.d.ts +22 -53
- package/lib/components/otp/otp.interface.d.ts +2 -0
- package/lib/components/otp/styles.d.ts +7 -4
- package/lib/components/progressBar/ProgressBar.d.ts +3 -23
- package/lib/components/progressBar/ProgressBar.interface.d.ts +94 -0
- package/lib/components/progressBar/ProgressBar.styles.d.ts +16 -0
- package/lib/components/scrollList/CategoryItem.d.ts +11 -0
- package/lib/components/scrollList/category.d.ts +2 -60
- package/lib/components/scrollList/category.interface.d.ts +46 -0
- package/lib/components/scrollList/category.styles.d.ts +67 -0
- package/lib/components/singleSelectionTag/TagSingleSelection.d.ts +2 -47
- package/lib/components/singleSelectionTag/TagSingleSelection.interface.d.ts +13 -0
- package/lib/components/singleSelectionTag/TagSingleSelection.styles.d.ts +33 -0
- package/lib/components/tabs/Tabs.styles.d.ts +1 -1
- package/lib/components/textInput/Textinput.d.ts +5 -7
- package/lib/components/toast/Toast.d.ts +2 -2
- package/lib/components/toast/Toast.styles.d.ts +19 -15
- package/lib/index.d.ts +13 -1
- package/lib/index.js +8373 -6416
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +8339 -6406
- package/lib/index.mjs.map +1 -1
- package/lib/theme/borderRadius.d.ts +34 -0
- package/lib/theme/colors.d.ts +74 -0
- package/lib/theme/fonts.d.ts +6 -6
- package/lib/theme/padding.d.ts +32 -0
- package/lib/theme/sizing.d.ts +53 -0
- package/lib/theme/spacing.d.ts +50 -0
- package/lib/theme/stroke.d.ts +15 -0
- package/lib/theme/themes.d.ts +176 -0
- package/lib/utils/appEnum.d.ts +77 -9
- package/package.json +9 -6
- package/src/assets/fonts/Inter-Bold.ttf +0 -0
- package/src/assets/fonts/Inter-Light.ttf +0 -0
- package/src/assets/fonts/Inter-Medium.ttf +0 -0
- package/src/assets/fonts/Meraas Aktiv Bold.ttf +0 -0
- package/src/assets/fonts/Meraas Aktiv Light.ttf +0 -0
- package/src/assets/fonts/Meraas Aktiv Regular.ttf +0 -0
- package/src/assets/fonts/Nakheel-HeadlineBold.otf +0 -0
- package/src/assets/fonts/Nakheel-HeadlineRegular.otf +0 -0
- package/src/assets/fonts/Nakheel-TextBold.otf +0 -0
- package/src/assets/fonts/Nakheel-TextRegular.otf +0 -0
|
@@ -65,5 +65,128 @@ declare const styles: {
|
|
|
65
65
|
functionNoticeText: {
|
|
66
66
|
color: string;
|
|
67
67
|
};
|
|
68
|
+
buttonText: {
|
|
69
|
+
alignSelf: "center";
|
|
70
|
+
};
|
|
68
71
|
};
|
|
69
72
|
export default styles;
|
|
73
|
+
/**
|
|
74
|
+
* Static color tokens mapped to DHDS Figma variables for the Button component.
|
|
75
|
+
*
|
|
76
|
+
* THEME-AWARE NOTE (v2):
|
|
77
|
+
* Background, text, and border colours for primary / secondary / link / default
|
|
78
|
+
* are now resolved at runtime via `useTheme()` in Button.tsx so that both light
|
|
79
|
+
* and dark modes are supported correctly. Only the gradient border constants
|
|
80
|
+
* below remain as static design tokens (they do not change between themes).
|
|
81
|
+
*
|
|
82
|
+
* The legacy constants (PRIMARY_DEFAULT_BG, PRIMARY_TEXT, etc.) are preserved
|
|
83
|
+
* for backward compatibility in case any consumer imports them directly.
|
|
84
|
+
*/
|
|
85
|
+
export declare const BUTTON_COLORS: {
|
|
86
|
+
/** @deprecated resolved via Theme.BUTTON_DEFAULT_FILL in Button.tsx */
|
|
87
|
+
readonly PRIMARY_DEFAULT_BG: string;
|
|
88
|
+
/** @deprecated resolved via Theme.BUTTON_DISABLED_FILL in Button.tsx */
|
|
89
|
+
readonly PRIMARY_DISABLED_BG: string;
|
|
90
|
+
/** @deprecated resolved via Theme.BUTTON_INVRTED_FILL in Button.tsx */
|
|
91
|
+
readonly SECONDARY_DEFAULT_BG: string;
|
|
92
|
+
/** @deprecated resolved via hardcoded transparent in Button.tsx */
|
|
93
|
+
readonly SECONDARY_DISABLED_BG: "transparent";
|
|
94
|
+
/** @deprecated resolved via Theme.CONTENT_INVERTED in Button.tsx */
|
|
95
|
+
readonly PRIMARY_TEXT: string;
|
|
96
|
+
/** @deprecated resolved via Theme.CONTENT_PRIMARY in Button.tsx */
|
|
97
|
+
readonly SECONDARY_TEXT: string;
|
|
98
|
+
/** @deprecated resolved via Theme.STROKE_DISABLED_DARK in Button.tsx */
|
|
99
|
+
readonly DISABLED_TEXT: string;
|
|
100
|
+
/** --DH-Gradient/Stroke/Primary-button start → cyan */
|
|
101
|
+
readonly GRADIENT_BORDER_START: string;
|
|
102
|
+
/** --DH-Gradient/Stroke/Primary-button end → blue */
|
|
103
|
+
readonly GRADIENT_BORDER_END: "#3590E1";
|
|
104
|
+
/** @deprecated resolved via Theme.BORDER_INVERTED in Button.tsx */
|
|
105
|
+
readonly SECONDARY_BORDER: string;
|
|
106
|
+
/** @deprecated resolved via Theme.STROKE_DISABLED_DARK in Button.tsx */
|
|
107
|
+
readonly DISABLED_BORDER: string;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Per-size layout styles.
|
|
111
|
+
* `pressable` → applied to the Pressable (all variants).
|
|
112
|
+
* `gradientWrapper`→ applied to the LinearGradient shell (primary default only);
|
|
113
|
+
* padding:1 creates the visible 1 dp gradient border.
|
|
114
|
+
*/
|
|
115
|
+
export declare const BUTTON_SIZE_STYLES: {
|
|
116
|
+
largePressable: {
|
|
117
|
+
minHeight: number;
|
|
118
|
+
paddingHorizontal: number;
|
|
119
|
+
paddingVertical: number;
|
|
120
|
+
gap: number;
|
|
121
|
+
flexDirection: "row";
|
|
122
|
+
alignItems: "center";
|
|
123
|
+
justifyContent: "center";
|
|
124
|
+
borderRadius: number;
|
|
125
|
+
overflow: "hidden";
|
|
126
|
+
};
|
|
127
|
+
largeGradientWrapper: {
|
|
128
|
+
borderRadius: number;
|
|
129
|
+
padding: number;
|
|
130
|
+
overflow: "hidden";
|
|
131
|
+
height: number;
|
|
132
|
+
};
|
|
133
|
+
mediumPressable: {
|
|
134
|
+
minHeight: number;
|
|
135
|
+
paddingHorizontal: number;
|
|
136
|
+
paddingVertical: number;
|
|
137
|
+
gap: number;
|
|
138
|
+
flexDirection: "row";
|
|
139
|
+
alignItems: "center";
|
|
140
|
+
justifyContent: "center";
|
|
141
|
+
borderRadius: number;
|
|
142
|
+
overflow: "hidden";
|
|
143
|
+
};
|
|
144
|
+
mediumGradientWrapper: {
|
|
145
|
+
borderRadius: number;
|
|
146
|
+
padding: number;
|
|
147
|
+
overflow: "hidden";
|
|
148
|
+
height: number;
|
|
149
|
+
};
|
|
150
|
+
smallPressable: {
|
|
151
|
+
minHeight: number;
|
|
152
|
+
paddingHorizontal: number;
|
|
153
|
+
paddingVertical: number;
|
|
154
|
+
gap: number;
|
|
155
|
+
flexDirection: "row";
|
|
156
|
+
alignItems: "center";
|
|
157
|
+
justifyContent: "center";
|
|
158
|
+
borderRadius: number;
|
|
159
|
+
overflow: "hidden";
|
|
160
|
+
};
|
|
161
|
+
smallGradientWrapper: {
|
|
162
|
+
borderRadius: number;
|
|
163
|
+
padding: number;
|
|
164
|
+
overflow: "hidden";
|
|
165
|
+
height: number;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Compact inline-layout containers for the `link` variant.
|
|
170
|
+
* No min-height, no padding, no background — purely a row with a gap.
|
|
171
|
+
* Content height is driven by the text/icon, matching DHDS Buttons/Link Text:
|
|
172
|
+
* Large → 32 dp content height (Body 1 Medium, 16px / 20px lh)
|
|
173
|
+
* Medium → 20 dp content height (Body 2 Medium, 14px / 18px lh)
|
|
174
|
+
* Small → 16 dp content height (Body 3 Medium, 12px / 16px lh)
|
|
175
|
+
*/
|
|
176
|
+
export declare const LINK_SIZE_STYLES: {
|
|
177
|
+
large: {
|
|
178
|
+
flexDirection: "row";
|
|
179
|
+
alignItems: "center";
|
|
180
|
+
gap: number;
|
|
181
|
+
};
|
|
182
|
+
medium: {
|
|
183
|
+
flexDirection: "row";
|
|
184
|
+
alignItems: "center";
|
|
185
|
+
gap: number;
|
|
186
|
+
};
|
|
187
|
+
small: {
|
|
188
|
+
flexDirection: "row";
|
|
189
|
+
alignItems: "center";
|
|
190
|
+
gap: number;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
@@ -6,11 +6,46 @@ export interface CheckBoxProps {
|
|
|
6
6
|
disable?: boolean;
|
|
7
7
|
isCircle?: boolean;
|
|
8
8
|
testID?: string;
|
|
9
|
+
/** Icon rendered when checkbox is checked and enabled (Selected / Default) */
|
|
9
10
|
checkedIcon: React.ReactElement;
|
|
11
|
+
/** Icon rendered when checkbox is unchecked and enabled (Unselected / Default) */
|
|
10
12
|
uncheckedIcon: React.ReactElement;
|
|
11
13
|
titleVariant?: string;
|
|
12
14
|
titleStyle?: TextStyle;
|
|
13
15
|
containerStyle?: ViewStyle;
|
|
14
16
|
onPress?: () => void;
|
|
15
17
|
hideCheckbox?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Controls the checkbox size and automatically selects the matching label
|
|
20
|
+
* typography variant (large → BODY1_LIGHT 16px, small → BODY2_LIGHT 14px).
|
|
21
|
+
* Overridden by `titleVariant` if that prop is also provided.
|
|
22
|
+
* @default 'large'
|
|
23
|
+
*/
|
|
24
|
+
size?: 'large' | 'small';
|
|
25
|
+
/**
|
|
26
|
+
* When true the partial/indeterminate icon is rendered instead of the
|
|
27
|
+
* checked or unchecked icon.
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
isPartial?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Icon for partial/indeterminate state when enabled (Partial / Default).
|
|
33
|
+
* Falls back to `checkedIcon` when not provided.
|
|
34
|
+
*/
|
|
35
|
+
partialIcon?: React.ReactElement;
|
|
36
|
+
/**
|
|
37
|
+
* Icon for partial/indeterminate state when disabled (Partial / Disabled).
|
|
38
|
+
* Falls back to `partialIcon` → `checkedIcon` when not provided.
|
|
39
|
+
*/
|
|
40
|
+
partialDisabledIcon?: React.ReactElement;
|
|
41
|
+
/**
|
|
42
|
+
* Icon for checked state when disabled (Selected / Disabled).
|
|
43
|
+
* Falls back to `checkedIcon` when not provided.
|
|
44
|
+
*/
|
|
45
|
+
checkedDisabledIcon?: React.ReactElement;
|
|
46
|
+
/**
|
|
47
|
+
* Icon for unchecked state when disabled (Unselected / Disabled).
|
|
48
|
+
* Falls back to `uncheckedIcon` when not provided.
|
|
49
|
+
*/
|
|
50
|
+
uncheckedDisabledIcon?: React.ReactElement;
|
|
16
51
|
}
|
|
@@ -1,30 +1,12 @@
|
|
|
1
1
|
declare const styles: {
|
|
2
|
-
checkboxContainer: {
|
|
3
|
-
alignItems: "center";
|
|
4
|
-
justifyContent: "center";
|
|
5
|
-
};
|
|
6
|
-
checkboxImage: {
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
backgroundColor: string;
|
|
10
|
-
resizeMode: "contain";
|
|
11
|
-
};
|
|
12
|
-
uncheckedCheckbox: {
|
|
13
|
-
width: number;
|
|
14
|
-
height: number;
|
|
15
|
-
overflow: "hidden";
|
|
16
|
-
borderRadius: number;
|
|
17
|
-
borderWidth: number;
|
|
18
|
-
borderColor: string;
|
|
19
|
-
};
|
|
20
2
|
directionStyle: {
|
|
21
3
|
flexDirection: "row";
|
|
22
|
-
|
|
23
|
-
alignItems: "center";
|
|
4
|
+
alignItems: "flex-start";
|
|
24
5
|
gap: number;
|
|
25
6
|
};
|
|
26
|
-
|
|
27
|
-
|
|
7
|
+
checkboxContainer: {
|
|
8
|
+
alignItems: "center";
|
|
9
|
+
justifyContent: "center";
|
|
28
10
|
};
|
|
29
11
|
};
|
|
30
12
|
export default styles;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
import { SvgProps } from 'react-native-svg';
|
|
4
|
+
export type ChipSize = 'large' | 'small';
|
|
5
|
+
export type ChipStatus = 'default' | 'disabled';
|
|
6
|
+
export interface ChipProps {
|
|
7
|
+
/** Label text rendered inside the chip. */
|
|
8
|
+
text?: string;
|
|
9
|
+
/** SVG icon rendered to the left of the label. */
|
|
10
|
+
leadIcon?: ReactElement<SvgProps>;
|
|
11
|
+
/** SVG icon rendered to the right of the label. */
|
|
12
|
+
trailIcon?: ReactElement<SvgProps>;
|
|
13
|
+
/**
|
|
14
|
+
* Controls height and horizontal padding.
|
|
15
|
+
* @default 'large'
|
|
16
|
+
*/
|
|
17
|
+
size?: ChipSize;
|
|
18
|
+
/**
|
|
19
|
+
* When true the chip renders with selected surface + inverted text colours.
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
selected?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* When true the chip renders with disabled surface colours and touch is blocked.
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/** Called when the chip is pressed (no-op when disabled). */
|
|
29
|
+
onPress?: () => void;
|
|
30
|
+
/**
|
|
31
|
+
* Merged last into the container Pressable style.
|
|
32
|
+
* Use to override background, border, dimensions, etc.
|
|
33
|
+
*/
|
|
34
|
+
style?: StyleProp<ViewStyle>;
|
|
35
|
+
/**
|
|
36
|
+
* Merged last into the label text style.
|
|
37
|
+
* Use to override colour, fontSize, fontFamily, etc.
|
|
38
|
+
*/
|
|
39
|
+
textStyle?: StyleProp<TextStyle>;
|
|
40
|
+
/**
|
|
41
|
+
* Merged last into the lead-icon wrapper View style.
|
|
42
|
+
* Use to adjust icon size or add spacing.
|
|
43
|
+
*/
|
|
44
|
+
leadIconStyle?: StyleProp<ViewStyle>;
|
|
45
|
+
/**
|
|
46
|
+
* Merged last into the trail-icon wrapper View style.
|
|
47
|
+
* Use to adjust icon size or add spacing.
|
|
48
|
+
*/
|
|
49
|
+
trailIconStyle?: StyleProp<ViewStyle>;
|
|
50
|
+
testID?: string;
|
|
51
|
+
accessibilityLabel?: string;
|
|
52
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ChipSize } from './Chip.interface';
|
|
2
|
+
declare const chipStyles: {
|
|
3
|
+
base: {
|
|
4
|
+
flexDirection: "row";
|
|
5
|
+
alignItems: "center";
|
|
6
|
+
justifyContent: "center";
|
|
7
|
+
borderWidth: number;
|
|
8
|
+
borderRadius: number;
|
|
9
|
+
gap: number;
|
|
10
|
+
};
|
|
11
|
+
sizeLarge: {
|
|
12
|
+
height: number;
|
|
13
|
+
minWidth: number;
|
|
14
|
+
paddingHorizontal: number;
|
|
15
|
+
paddingVertical: number;
|
|
16
|
+
};
|
|
17
|
+
sizeSmall: {
|
|
18
|
+
height: number;
|
|
19
|
+
minWidth: number;
|
|
20
|
+
paddingHorizontal: number;
|
|
21
|
+
paddingVertical: number;
|
|
22
|
+
};
|
|
23
|
+
iconLarge: {
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
};
|
|
27
|
+
iconSmall: {
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export declare const getIconStyle: (size: ChipSize) => {
|
|
33
|
+
width: number;
|
|
34
|
+
height: number;
|
|
35
|
+
};
|
|
36
|
+
export declare const getSizeStyle: (size: ChipSize) => {
|
|
37
|
+
height: number;
|
|
38
|
+
minWidth: number;
|
|
39
|
+
paddingHorizontal: number;
|
|
40
|
+
paddingVertical: number;
|
|
41
|
+
};
|
|
42
|
+
export default chipStyles;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TextStyle, ViewStyle } from 'react-native';
|
|
3
|
-
import { DocumentPickerResponse } from 'react-native-document-picker';
|
|
4
|
-
export interface CustomDocumentPickerProps {
|
|
5
|
-
onDocumentUpload: (base64: string, document?: DocumentPickerResponse) => void;
|
|
6
|
-
title?: string;
|
|
7
|
-
hint?: string;
|
|
8
|
-
maxFileSize?: number;
|
|
9
|
-
fileTypes?: string[];
|
|
10
|
-
containerStyle?: ViewStyle;
|
|
11
|
-
titleStyle?: TextStyle;
|
|
12
|
-
hintStyle?: TextStyle;
|
|
13
|
-
fileIcon: React.ReactElement;
|
|
14
|
-
uploadIcon: React.ReactElement;
|
|
15
|
-
deleteIcon: React.ReactElement;
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './CustomDocumentPicker';
|
|
@@ -1,10 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IconConfig {
|
|
3
|
+
/** Icon element to render. */
|
|
4
|
+
icon: React.ReactElement;
|
|
5
|
+
/** Callback invoked when the icon is pressed. */
|
|
6
|
+
onPress?: () => void;
|
|
7
|
+
/** Optional testID applied to the Pressable wrapper. */
|
|
8
|
+
testId?: string;
|
|
9
|
+
}
|
|
1
10
|
export interface CustomHeaderProps {
|
|
11
|
+
/** Header title text. */
|
|
2
12
|
title: string;
|
|
13
|
+
/** TestID for the root container. Defaults to `'CUSTOM-HEADER'`. */
|
|
3
14
|
testId?: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Icon on the far left of the header (e.g. a back arrow).
|
|
17
|
+
* Bundles the icon element, its press handler, and an optional testId.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* leftIcon={{ icon: <BackArrow />, onPress: navigation.goBack, testId: 'header-back' }}
|
|
21
|
+
*/
|
|
22
|
+
leftIcon?: IconConfig;
|
|
23
|
+
/**
|
|
24
|
+
* Optional non-interactive icon rendered immediately after the title text
|
|
25
|
+
* (e.g. a badge or info indicator).
|
|
26
|
+
* Width/height of 24×24 dp are applied automatically.
|
|
27
|
+
*/
|
|
28
|
+
titleSuffixIcon?: React.ReactElement;
|
|
29
|
+
/**
|
|
30
|
+
* Icons on the right side of the header.
|
|
31
|
+
* Each entry bundles the icon element, its press handler, and an optional testId.
|
|
32
|
+
* Renders in order, separated by a 12 dp gap.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* rightIcons={[
|
|
36
|
+
* { icon: <SearchIcon />, onPress: handleSearch, testId: 'header-search' },
|
|
37
|
+
* { icon: <MoreIcon />, onPress: handleMore, testId: 'header-more' },
|
|
38
|
+
* ]}
|
|
39
|
+
*/
|
|
40
|
+
rightIcons?: IconConfig[];
|
|
10
41
|
}
|
|
@@ -2,20 +2,23 @@ declare const styles: {
|
|
|
2
2
|
container: {
|
|
3
3
|
flexDirection: "row";
|
|
4
4
|
justifyContent: "space-between";
|
|
5
|
+
alignItems: "center";
|
|
5
6
|
paddingHorizontal: number;
|
|
6
7
|
paddingTop: number;
|
|
7
8
|
paddingBottom: number;
|
|
8
|
-
borderBottomWidth: number;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
/** Left cluster: back-icon · title text · optional title-suffix icon */
|
|
11
|
+
pageTitleContainer: {
|
|
11
12
|
flexDirection: "row";
|
|
12
13
|
alignItems: "center";
|
|
14
|
+
gap: number;
|
|
15
|
+
flexShrink: number;
|
|
13
16
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
/** Right cluster: array of action icons */
|
|
18
|
+
iconsContainer: {
|
|
19
|
+
flexDirection: "row";
|
|
20
|
+
alignItems: "center";
|
|
21
|
+
gap: number;
|
|
19
22
|
};
|
|
20
23
|
};
|
|
21
24
|
export default styles;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CustomIconProps } from './CustomIcon.interface';
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
3
|
+
declare const _default: (props: CustomIconProps) => React.JSX.Element;
|
|
4
|
+
export default _default;
|
|
@@ -1,11 +1,40 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
import { FontStyle } from '../../utils/appEnum';
|
|
4
|
+
/** Visual type variant — maps to Figma "Buttons/Icon" types */
|
|
5
|
+
export type CustomIconType = 'dark' | 'light' | 'blur' | 'outlined';
|
|
6
|
+
/** Size variant — maps to Figma "Buttons/Icon" sizes */
|
|
7
|
+
export type CustomIconSize = 'large' | 'medium' | 'small' | 'xSmall';
|
|
8
|
+
/** Label position relative to the icon — maps to Figma "Buttons/Icon with Text" */
|
|
9
|
+
export type CustomIconLabelPosition = 'left' | 'right' | 'bottom';
|
|
3
10
|
export interface CustomIconProps {
|
|
4
11
|
icon: React.ReactElement;
|
|
5
12
|
title?: string;
|
|
6
|
-
|
|
13
|
+
/** Typography variant for the label. Defaults to size-appropriate token (BODY1_MEDIUM / BODY3_MEDIUM). */
|
|
14
|
+
titleVariant?: FontStyle | string;
|
|
7
15
|
testId?: string;
|
|
8
16
|
onPress?: () => void;
|
|
9
17
|
containerStyle?: ViewStyle;
|
|
10
18
|
titleStyle?: TextStyle;
|
|
19
|
+
/**
|
|
20
|
+
* Figma design type variant.
|
|
21
|
+
* - `dark` : white bg + backdrop blur (light tint)
|
|
22
|
+
* - `light` : deep-navy bg + white stroke + backdrop blur (dark tint)
|
|
23
|
+
* - `blur` : semi-transparent blue bg (no blur effect)
|
|
24
|
+
* - `outlined` : transparent bg + cyan-to-blue gradient stroke
|
|
25
|
+
*
|
|
26
|
+
* When omitted the component renders in its original unstyled form
|
|
27
|
+
* (fully backward-compatible).
|
|
28
|
+
*/
|
|
29
|
+
type?: CustomIconType;
|
|
30
|
+
/**
|
|
31
|
+
* Size variant controlling the button container, icon slot, and padding.
|
|
32
|
+
* Has effect only when `type` is also provided.
|
|
33
|
+
*/
|
|
34
|
+
size?: CustomIconSize;
|
|
35
|
+
/**
|
|
36
|
+
* Position of the optional `title` label relative to the icon button.
|
|
37
|
+
* Adjusts the outer Pressable's flex direction and gap.
|
|
38
|
+
*/
|
|
39
|
+
labelPosition?: CustomIconLabelPosition;
|
|
11
40
|
}
|
|
@@ -1,10 +1,85 @@
|
|
|
1
|
+
import { FontStyle } from '../../utils/appEnum';
|
|
2
|
+
import type { CustomIconSize } from './CustomIcon.interface';
|
|
1
3
|
declare const styles: {
|
|
2
4
|
container: {
|
|
3
5
|
justifyContent: "center";
|
|
4
6
|
alignItems: "center";
|
|
5
7
|
};
|
|
6
8
|
title: {
|
|
7
|
-
|
|
9
|
+
alignSelf: "center";
|
|
8
10
|
};
|
|
9
11
|
};
|
|
10
12
|
export default styles;
|
|
13
|
+
export declare const ICON_BUTTON_RADIUS: number;
|
|
14
|
+
export interface IconSizeSpec {
|
|
15
|
+
containerSize: number;
|
|
16
|
+
iconSize: number;
|
|
17
|
+
padding: number;
|
|
18
|
+
}
|
|
19
|
+
export declare const ICON_SIZE_SPEC: Record<CustomIconSize, IconSizeSpec>;
|
|
20
|
+
export declare const ICON_BLUR_PADDING: {
|
|
21
|
+
readonly horizontal: number;
|
|
22
|
+
readonly vertical: number;
|
|
23
|
+
};
|
|
24
|
+
export declare const ICON_BLUR_BUTTON_STYLES: {
|
|
25
|
+
base: {
|
|
26
|
+
borderRadius: number;
|
|
27
|
+
alignItems: "center";
|
|
28
|
+
justifyContent: "center";
|
|
29
|
+
};
|
|
30
|
+
lightBorder: {
|
|
31
|
+
borderWidth: number;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export declare const ICON_BLUR_TYPE_BG = "rgba(37, 59, 149, 0.5)";
|
|
35
|
+
export declare const ICON_BLUR_TYPE_STYLE: {
|
|
36
|
+
container: {
|
|
37
|
+
backgroundColor: string;
|
|
38
|
+
borderRadius: number;
|
|
39
|
+
alignItems: "center";
|
|
40
|
+
justifyContent: "center";
|
|
41
|
+
overflow: "hidden";
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export declare const OUTLINED_GRADIENT_COLORS: readonly [string, "#438CB1"];
|
|
45
|
+
export declare const OUTLINED_GRADIENT_START: {
|
|
46
|
+
readonly x: 0;
|
|
47
|
+
readonly y: 0;
|
|
48
|
+
};
|
|
49
|
+
export declare const OUTLINED_GRADIENT_END: {
|
|
50
|
+
readonly x: 1;
|
|
51
|
+
readonly y: 1;
|
|
52
|
+
};
|
|
53
|
+
export declare const OUTLINED_BORDER_WIDTH = 1;
|
|
54
|
+
export declare const OUTLINED_BUTTON_STYLES: {
|
|
55
|
+
shell: {
|
|
56
|
+
borderRadius: number;
|
|
57
|
+
alignItems: "center";
|
|
58
|
+
justifyContent: "center";
|
|
59
|
+
overflow: "hidden";
|
|
60
|
+
};
|
|
61
|
+
inner: {
|
|
62
|
+
borderRadius: number;
|
|
63
|
+
alignItems: "center";
|
|
64
|
+
justifyContent: "center";
|
|
65
|
+
overflow: "hidden";
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
export declare const ICON_LABEL_POSITION_STYLES: {
|
|
69
|
+
left: {
|
|
70
|
+
flexDirection: "row-reverse";
|
|
71
|
+
alignItems: "center";
|
|
72
|
+
gap: number;
|
|
73
|
+
};
|
|
74
|
+
right: {
|
|
75
|
+
flexDirection: "row";
|
|
76
|
+
alignItems: "center";
|
|
77
|
+
gap: number;
|
|
78
|
+
};
|
|
79
|
+
bottom: {
|
|
80
|
+
flexDirection: "column";
|
|
81
|
+
alignItems: "center";
|
|
82
|
+
gap: number;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
export declare const ICON_TITLE_VARIANT_FOR_SIZE: Record<CustomIconSize, FontStyle>;
|