@hero-design/rn 8.75.0 → 8.76.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/.turbo/turbo-build.log +2 -2
- package/CHANGELOG.md +10 -0
- package/es/index.js +246 -88
- package/lib/index.js +246 -88
- package/package.json +1 -1
- package/src/components/BottomSheet/index.tsx +2 -0
- package/src/components/Toolbar/StyledToolbar.tsx +50 -1
- package/src/components/Toolbar/ToolbarMessage.tsx +169 -0
- package/src/components/Toolbar/__tests__/ToolbarMessage.spec.tsx +161 -0
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarMessage.spec.tsx.snap +382 -0
- package/src/components/Toolbar/index.tsx +2 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +16 -0
- package/src/theme/components/toolbar.ts +19 -1
- package/stats/8.76.0/rn-stats.html +4844 -0
- package/types/components/Toolbar/StyledToolbar.d.ts +33 -2
- package/types/components/Toolbar/ToolbarMessage.d.ts +59 -0
- package/types/components/Toolbar/index.d.ts +1 -0
- package/types/theme/components/toolbar.d.ts +16 -0
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`ToolbarMessage disabled renders correctly 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
style={
|
|
6
|
+
{
|
|
7
|
+
"flex": 1,
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
>
|
|
11
|
+
<View
|
|
12
|
+
style={
|
|
13
|
+
[
|
|
14
|
+
{
|
|
15
|
+
"alignItems": "center",
|
|
16
|
+
"flex": 1,
|
|
17
|
+
"flexDirection": "row",
|
|
18
|
+
"height": 64,
|
|
19
|
+
"justifyContent": "space-between",
|
|
20
|
+
"paddingHorizontal": 8,
|
|
21
|
+
"paddingVertical": 12,
|
|
22
|
+
},
|
|
23
|
+
undefined,
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
testID="toolbar-message"
|
|
27
|
+
>
|
|
28
|
+
<View
|
|
29
|
+
pointerEvents="none"
|
|
30
|
+
style={
|
|
31
|
+
[
|
|
32
|
+
{
|
|
33
|
+
"alignItems": "center",
|
|
34
|
+
"backgroundColor": "#f6f6f7",
|
|
35
|
+
"borderRadius": 999,
|
|
36
|
+
"flex": 1,
|
|
37
|
+
"flexDirection": "row",
|
|
38
|
+
"height": 40,
|
|
39
|
+
"paddingHorizontal": 12,
|
|
40
|
+
"paddingVertical": 8,
|
|
41
|
+
},
|
|
42
|
+
undefined,
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
testID="toolbar-message-input-container"
|
|
46
|
+
>
|
|
47
|
+
<TextInput
|
|
48
|
+
editable={true}
|
|
49
|
+
onChangeText={[MockFunction]}
|
|
50
|
+
placeholder="Message"
|
|
51
|
+
style={
|
|
52
|
+
[
|
|
53
|
+
{
|
|
54
|
+
"alignSelf": "stretch",
|
|
55
|
+
"flexGrow": 1,
|
|
56
|
+
"flexShrink": 1,
|
|
57
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
58
|
+
"fontSize": 16,
|
|
59
|
+
"textAlignVertical": "center",
|
|
60
|
+
},
|
|
61
|
+
undefined,
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
testID="toolbar-message-input"
|
|
65
|
+
value="Jisoo"
|
|
66
|
+
/>
|
|
67
|
+
</View>
|
|
68
|
+
</View>
|
|
69
|
+
<View
|
|
70
|
+
pointerEvents="box-none"
|
|
71
|
+
position="bottom"
|
|
72
|
+
style={
|
|
73
|
+
[
|
|
74
|
+
{
|
|
75
|
+
"bottom": 0,
|
|
76
|
+
"elevation": 9999,
|
|
77
|
+
"flexDirection": "column-reverse",
|
|
78
|
+
"left": 0,
|
|
79
|
+
"paddingHorizontal": 24,
|
|
80
|
+
"paddingVertical": 16,
|
|
81
|
+
"position": "absolute",
|
|
82
|
+
"right": 0,
|
|
83
|
+
"top": 0,
|
|
84
|
+
},
|
|
85
|
+
undefined,
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
/>
|
|
89
|
+
</View>
|
|
90
|
+
`;
|
|
91
|
+
|
|
92
|
+
exports[`ToolbarMessage filled renders correctly 1`] = `
|
|
93
|
+
<View
|
|
94
|
+
style={
|
|
95
|
+
{
|
|
96
|
+
"flex": 1,
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
>
|
|
100
|
+
<View
|
|
101
|
+
style={
|
|
102
|
+
[
|
|
103
|
+
{
|
|
104
|
+
"alignItems": "center",
|
|
105
|
+
"flex": 1,
|
|
106
|
+
"flexDirection": "row",
|
|
107
|
+
"height": 64,
|
|
108
|
+
"justifyContent": "space-between",
|
|
109
|
+
"paddingHorizontal": 8,
|
|
110
|
+
"paddingVertical": 12,
|
|
111
|
+
},
|
|
112
|
+
undefined,
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
testID="toolbar-message"
|
|
116
|
+
>
|
|
117
|
+
<View
|
|
118
|
+
pointerEvents="auto"
|
|
119
|
+
style={
|
|
120
|
+
[
|
|
121
|
+
{
|
|
122
|
+
"alignItems": "center",
|
|
123
|
+
"backgroundColor": "#f6f6f7",
|
|
124
|
+
"borderRadius": 999,
|
|
125
|
+
"flex": 1,
|
|
126
|
+
"flexDirection": "row",
|
|
127
|
+
"height": 40,
|
|
128
|
+
"paddingHorizontal": 12,
|
|
129
|
+
"paddingVertical": 8,
|
|
130
|
+
},
|
|
131
|
+
undefined,
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
testID="toolbar-message-input-container"
|
|
135
|
+
>
|
|
136
|
+
<TextInput
|
|
137
|
+
editable={true}
|
|
138
|
+
placeholder="Message"
|
|
139
|
+
style={
|
|
140
|
+
[
|
|
141
|
+
{
|
|
142
|
+
"alignSelf": "stretch",
|
|
143
|
+
"flexGrow": 1,
|
|
144
|
+
"flexShrink": 1,
|
|
145
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
146
|
+
"fontSize": 16,
|
|
147
|
+
"textAlignVertical": "center",
|
|
148
|
+
},
|
|
149
|
+
undefined,
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
testID="toolbar-message-input"
|
|
153
|
+
value="Jennie Kim"
|
|
154
|
+
/>
|
|
155
|
+
</View>
|
|
156
|
+
</View>
|
|
157
|
+
<View
|
|
158
|
+
pointerEvents="box-none"
|
|
159
|
+
position="bottom"
|
|
160
|
+
style={
|
|
161
|
+
[
|
|
162
|
+
{
|
|
163
|
+
"bottom": 0,
|
|
164
|
+
"elevation": 9999,
|
|
165
|
+
"flexDirection": "column-reverse",
|
|
166
|
+
"left": 0,
|
|
167
|
+
"paddingHorizontal": 24,
|
|
168
|
+
"paddingVertical": 16,
|
|
169
|
+
"position": "absolute",
|
|
170
|
+
"right": 0,
|
|
171
|
+
"top": 0,
|
|
172
|
+
},
|
|
173
|
+
undefined,
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
/>
|
|
177
|
+
</View>
|
|
178
|
+
`;
|
|
179
|
+
|
|
180
|
+
exports[`ToolbarMessage idle renders correctly 1`] = `
|
|
181
|
+
<View
|
|
182
|
+
style={
|
|
183
|
+
{
|
|
184
|
+
"flex": 1,
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
>
|
|
188
|
+
<View
|
|
189
|
+
style={
|
|
190
|
+
[
|
|
191
|
+
{
|
|
192
|
+
"alignItems": "center",
|
|
193
|
+
"flex": 1,
|
|
194
|
+
"flexDirection": "row",
|
|
195
|
+
"height": 64,
|
|
196
|
+
"justifyContent": "space-between",
|
|
197
|
+
"paddingHorizontal": 8,
|
|
198
|
+
"paddingVertical": 12,
|
|
199
|
+
},
|
|
200
|
+
undefined,
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
testID="toolbar-message"
|
|
204
|
+
>
|
|
205
|
+
<View
|
|
206
|
+
style={
|
|
207
|
+
[
|
|
208
|
+
{
|
|
209
|
+
"marginRight": 16,
|
|
210
|
+
"maxHeight": "100%",
|
|
211
|
+
},
|
|
212
|
+
undefined,
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
testID="toolbar-message-prefix"
|
|
216
|
+
>
|
|
217
|
+
prefix
|
|
218
|
+
</View>
|
|
219
|
+
<View
|
|
220
|
+
pointerEvents="auto"
|
|
221
|
+
style={
|
|
222
|
+
[
|
|
223
|
+
{
|
|
224
|
+
"alignItems": "center",
|
|
225
|
+
"backgroundColor": "#f6f6f7",
|
|
226
|
+
"borderRadius": 999,
|
|
227
|
+
"flex": 1,
|
|
228
|
+
"flexDirection": "row",
|
|
229
|
+
"height": 40,
|
|
230
|
+
"paddingHorizontal": 12,
|
|
231
|
+
"paddingVertical": 8,
|
|
232
|
+
},
|
|
233
|
+
undefined,
|
|
234
|
+
]
|
|
235
|
+
}
|
|
236
|
+
testID="toolbar-message-input-container"
|
|
237
|
+
>
|
|
238
|
+
<TextInput
|
|
239
|
+
editable={true}
|
|
240
|
+
placeholder="Message"
|
|
241
|
+
style={
|
|
242
|
+
[
|
|
243
|
+
{
|
|
244
|
+
"alignSelf": "stretch",
|
|
245
|
+
"flexGrow": 1,
|
|
246
|
+
"flexShrink": 1,
|
|
247
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
248
|
+
"fontSize": 16,
|
|
249
|
+
"textAlignVertical": "center",
|
|
250
|
+
},
|
|
251
|
+
undefined,
|
|
252
|
+
]
|
|
253
|
+
}
|
|
254
|
+
testID="toolbar-message-input"
|
|
255
|
+
/>
|
|
256
|
+
</View>
|
|
257
|
+
<View
|
|
258
|
+
style={
|
|
259
|
+
[
|
|
260
|
+
{
|
|
261
|
+
"marginLeft": 16,
|
|
262
|
+
"maxHeight": "100%",
|
|
263
|
+
},
|
|
264
|
+
undefined,
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
testID="toolbar-message-suffix"
|
|
268
|
+
>
|
|
269
|
+
suffix
|
|
270
|
+
</View>
|
|
271
|
+
</View>
|
|
272
|
+
<View
|
|
273
|
+
pointerEvents="box-none"
|
|
274
|
+
position="bottom"
|
|
275
|
+
style={
|
|
276
|
+
[
|
|
277
|
+
{
|
|
278
|
+
"bottom": 0,
|
|
279
|
+
"elevation": 9999,
|
|
280
|
+
"flexDirection": "column-reverse",
|
|
281
|
+
"left": 0,
|
|
282
|
+
"paddingHorizontal": 24,
|
|
283
|
+
"paddingVertical": 16,
|
|
284
|
+
"position": "absolute",
|
|
285
|
+
"right": 0,
|
|
286
|
+
"top": 0,
|
|
287
|
+
},
|
|
288
|
+
undefined,
|
|
289
|
+
]
|
|
290
|
+
}
|
|
291
|
+
/>
|
|
292
|
+
</View>
|
|
293
|
+
`;
|
|
294
|
+
|
|
295
|
+
exports[`ToolbarMessage readonly renders correctly 1`] = `
|
|
296
|
+
<View
|
|
297
|
+
style={
|
|
298
|
+
{
|
|
299
|
+
"flex": 1,
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
>
|
|
303
|
+
<View
|
|
304
|
+
style={
|
|
305
|
+
[
|
|
306
|
+
{
|
|
307
|
+
"alignItems": "center",
|
|
308
|
+
"flex": 1,
|
|
309
|
+
"flexDirection": "row",
|
|
310
|
+
"height": 64,
|
|
311
|
+
"justifyContent": "space-between",
|
|
312
|
+
"paddingHorizontal": 8,
|
|
313
|
+
"paddingVertical": 12,
|
|
314
|
+
},
|
|
315
|
+
undefined,
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
testID="toolbar-message"
|
|
319
|
+
>
|
|
320
|
+
<View
|
|
321
|
+
pointerEvents="auto"
|
|
322
|
+
style={
|
|
323
|
+
[
|
|
324
|
+
{
|
|
325
|
+
"alignItems": "center",
|
|
326
|
+
"backgroundColor": "#f6f6f7",
|
|
327
|
+
"borderRadius": 999,
|
|
328
|
+
"flex": 1,
|
|
329
|
+
"flexDirection": "row",
|
|
330
|
+
"height": 40,
|
|
331
|
+
"paddingHorizontal": 12,
|
|
332
|
+
"paddingVertical": 8,
|
|
333
|
+
},
|
|
334
|
+
undefined,
|
|
335
|
+
]
|
|
336
|
+
}
|
|
337
|
+
testID="toolbar-message-input-container"
|
|
338
|
+
>
|
|
339
|
+
<TextInput
|
|
340
|
+
editable={true}
|
|
341
|
+
onChangeText={[MockFunction]}
|
|
342
|
+
placeholder="Message"
|
|
343
|
+
style={
|
|
344
|
+
[
|
|
345
|
+
{
|
|
346
|
+
"alignSelf": "stretch",
|
|
347
|
+
"flexGrow": 1,
|
|
348
|
+
"flexShrink": 1,
|
|
349
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
350
|
+
"fontSize": 16,
|
|
351
|
+
"textAlignVertical": "center",
|
|
352
|
+
},
|
|
353
|
+
undefined,
|
|
354
|
+
]
|
|
355
|
+
}
|
|
356
|
+
testID="toolbar-message-input"
|
|
357
|
+
value="Lalisa"
|
|
358
|
+
/>
|
|
359
|
+
</View>
|
|
360
|
+
</View>
|
|
361
|
+
<View
|
|
362
|
+
pointerEvents="box-none"
|
|
363
|
+
position="bottom"
|
|
364
|
+
style={
|
|
365
|
+
[
|
|
366
|
+
{
|
|
367
|
+
"bottom": 0,
|
|
368
|
+
"elevation": 9999,
|
|
369
|
+
"flexDirection": "column-reverse",
|
|
370
|
+
"left": 0,
|
|
371
|
+
"paddingHorizontal": 24,
|
|
372
|
+
"paddingVertical": 16,
|
|
373
|
+
"position": "absolute",
|
|
374
|
+
"right": 0,
|
|
375
|
+
"top": 0,
|
|
376
|
+
},
|
|
377
|
+
undefined,
|
|
378
|
+
]
|
|
379
|
+
}
|
|
380
|
+
/>
|
|
381
|
+
</View>
|
|
382
|
+
`;
|
|
@@ -3,6 +3,7 @@ import type { ReactNode } from 'react';
|
|
|
3
3
|
import { ViewProps } from 'react-native';
|
|
4
4
|
import { ToolbarWrapper } from './StyledToolbar';
|
|
5
5
|
import ToolbarGroup from './ToolbarGroup';
|
|
6
|
+
import ToolbarMessage from './ToolbarMessage';
|
|
6
7
|
|
|
7
8
|
export interface ToolbarProps extends Omit<ViewProps, 'style'> {
|
|
8
9
|
/**
|
|
@@ -17,4 +18,5 @@ const Toolbar = ({ children, ...rest }: ToolbarProps) => (
|
|
|
17
18
|
|
|
18
19
|
export default Object.assign(Toolbar, {
|
|
19
20
|
Group: ToolbarGroup,
|
|
21
|
+
Message: ToolbarMessage,
|
|
20
22
|
});
|
|
@@ -1316,20 +1316,36 @@ exports[`theme returns correct theme object 1`] = `
|
|
|
1316
1316
|
"error": "#f46363",
|
|
1317
1317
|
"iconButtonBackground": "#ece8ef",
|
|
1318
1318
|
"info": "#b5c3fd",
|
|
1319
|
+
"inputContainerBackground": "#f6f6f7",
|
|
1319
1320
|
"primary": "#401960",
|
|
1320
1321
|
"secondary": "#4d6265",
|
|
1321
1322
|
"success": "#5ace7d",
|
|
1322
1323
|
},
|
|
1324
|
+
"fontSizes": {
|
|
1325
|
+
"text": 16,
|
|
1326
|
+
},
|
|
1327
|
+
"fonts": {
|
|
1328
|
+
"text": "BeVietnamPro-Regular",
|
|
1329
|
+
},
|
|
1323
1330
|
"radii": {
|
|
1324
1331
|
"iconButtonWrapperBorderRadius": 24,
|
|
1332
|
+
"messageContainer": 999,
|
|
1325
1333
|
},
|
|
1326
1334
|
"sizes": {
|
|
1327
1335
|
"itemWrapperHeight": 64,
|
|
1336
|
+
"messageInputHeight": 40,
|
|
1337
|
+
"messageWrapperHeight": 64,
|
|
1328
1338
|
},
|
|
1329
1339
|
"space": {
|
|
1340
|
+
"affixInnerMargin": 16,
|
|
1330
1341
|
"horizontalPadding": 8,
|
|
1331
1342
|
"iconButtonLabelMarginLeft": 8,
|
|
1332
1343
|
"iconButtonWrapperPadding": 12,
|
|
1344
|
+
"messageInputPaddingHorizontal": 12,
|
|
1345
|
+
"messageInputPaddingVertical": 8,
|
|
1346
|
+
"messageWrapperMarginHorizontal": 8,
|
|
1347
|
+
"messageWrapperPaddingHorizontal": 8,
|
|
1348
|
+
"messageWrapperPaddingVertical": 12,
|
|
1333
1349
|
"verticalPadding": 8,
|
|
1334
1350
|
},
|
|
1335
1351
|
},
|
|
@@ -13,6 +13,7 @@ const getToolbarTheme = (theme: GlobalTheme) => {
|
|
|
13
13
|
error: theme.colors.error,
|
|
14
14
|
disabled: theme.colors.disabledOnDefaultGlobalSurface,
|
|
15
15
|
iconButtonBackground: theme.colors.highlightedSurface,
|
|
16
|
+
inputContainerBackground: theme.colors.neutralGlobalSurface,
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
const space = {
|
|
@@ -20,6 +21,12 @@ const getToolbarTheme = (theme: GlobalTheme) => {
|
|
|
20
21
|
horizontalPadding: theme.space.small,
|
|
21
22
|
iconButtonLabelMarginLeft: theme.space.small,
|
|
22
23
|
iconButtonWrapperPadding: theme.space.smallMedium,
|
|
24
|
+
messageWrapperMarginHorizontal: theme.space.small,
|
|
25
|
+
messageWrapperPaddingVertical: theme.space.smallMedium,
|
|
26
|
+
messageWrapperPaddingHorizontal: theme.space.small,
|
|
27
|
+
messageInputPaddingHorizontal: theme.space.smallMedium,
|
|
28
|
+
messageInputPaddingVertical: theme.space.small,
|
|
29
|
+
affixInnerMargin: theme.space.medium,
|
|
23
30
|
};
|
|
24
31
|
|
|
25
32
|
const borderWidths = {
|
|
@@ -28,13 +35,24 @@ const getToolbarTheme = (theme: GlobalTheme) => {
|
|
|
28
35
|
|
|
29
36
|
const sizes = {
|
|
30
37
|
itemWrapperHeight: scale(64),
|
|
38
|
+
messageWrapperHeight: scale(64),
|
|
39
|
+
messageInputHeight: 40,
|
|
31
40
|
};
|
|
32
41
|
|
|
33
42
|
const radii = {
|
|
34
43
|
iconButtonWrapperBorderRadius: theme.radii.xxxlarge,
|
|
44
|
+
messageContainer: theme.radii.rounded,
|
|
35
45
|
};
|
|
36
46
|
|
|
37
|
-
|
|
47
|
+
const fontSizes = {
|
|
48
|
+
text: theme.fontSizes.large,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const fonts = {
|
|
52
|
+
text: theme.fonts.neutral.regular,
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return { colors, space, borderWidths, sizes, radii, fontSizes, fonts };
|
|
38
56
|
};
|
|
39
57
|
|
|
40
58
|
export default getToolbarTheme;
|