@hero-design/rn 8.74.1 → 8.75.0-alpha.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/es/index.js +411 -139
  3. package/lib/index.js +411 -138
  4. package/package.json +1 -1
  5. package/src/components/BottomSheet/__tests__/index.spec.tsx +17 -153
  6. package/src/components/BottomSheet/index.tsx +2 -0
  7. package/src/components/Collapse/__tests__/index.spec.tsx +2 -5
  8. package/src/components/FloatingIsland/StyledFloatingIsland.tsx +32 -0
  9. package/src/components/FloatingIsland/__tests__/__snapshots__/index.spec.tsx.snap +561 -0
  10. package/src/components/FloatingIsland/__tests__/index.spec.tsx +67 -0
  11. package/src/components/FloatingIsland/index.tsx +94 -0
  12. package/src/components/Toolbar/StyledToolbar.tsx +50 -1
  13. package/src/components/Toolbar/ToolbarMessage.tsx +169 -0
  14. package/src/components/Toolbar/__tests__/ToolbarMessage.spec.tsx +161 -0
  15. package/src/components/Toolbar/__tests__/__snapshots__/ToolbarMessage.spec.tsx.snap +382 -0
  16. package/src/components/Toolbar/index.tsx +2 -0
  17. package/src/index.ts +2 -0
  18. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +46 -0
  19. package/src/theme/components/floatingIsland.ts +31 -0
  20. package/src/theme/components/toolbar.ts +19 -1
  21. package/src/theme/getTheme.ts +3 -0
  22. package/stats/8.75.0/rn-stats.html +4844 -0
  23. package/types/components/CompoundSearch/CompoundSearchHandler.d.ts +31 -0
  24. package/types/components/CompoundSearch/CompoundSearchTextInput.d.ts +60 -0
  25. package/types/components/CompoundSearch/StyledCompoundSearch.d.ts +40 -0
  26. package/types/components/CompoundSearch/index.d.ts +8 -0
  27. package/types/components/CompoundSearch/utils.d.ts +8 -0
  28. package/types/components/FloatingIsland/SingleLine/StyledSingleLine.d.ts +15 -0
  29. package/types/components/FloatingIsland/SingleLine/index.d.ts +24 -0
  30. package/types/components/FloatingIsland/StyledFloatingIsland.d.ts +19 -0
  31. package/types/components/FloatingIsland/index.d.ts +23 -0
  32. package/types/components/Toolbar/StyledToolbar.d.ts +33 -2
  33. package/types/components/Toolbar/ToolbarMessage.d.ts +59 -0
  34. package/types/components/Toolbar/index.d.ts +1 -0
  35. package/types/index.d.ts +2 -1
  36. package/types/theme/components/compoundSearch.d.ts +36 -0
  37. package/types/theme/components/floatingIsland.d.ts +32 -0
  38. package/types/theme/components/toolbar.d.ts +16 -0
  39. package/types/theme/getTheme.d.ts +2 -0
  40. package/.turbo/turbo-build.log +0 -7
  41. package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +0 -751
@@ -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
  });
package/src/index.ts CHANGED
@@ -71,6 +71,7 @@ import {
71
71
  FlatListWithFAB,
72
72
  } from './components/AnimatedScroller';
73
73
  import Search from './components/Search';
74
+ import FloatingIsland from './components/FloatingIsland';
74
75
 
75
76
  export {
76
77
  theme,
@@ -143,6 +144,7 @@ export {
143
144
  Rate,
144
145
  RefreshControl,
145
146
  RichTextEditor,
147
+ FloatingIsland,
146
148
  };
147
149
 
148
150
  export * from './types';
@@ -590,6 +590,36 @@ exports[`theme returns correct theme object 1`] = `
590
590
  "titleMarginHorizontal": 8,
591
591
  },
592
592
  },
593
+ "floatingIsland": {
594
+ "colors": {
595
+ "wrapperBackground": "#ffffff",
596
+ },
597
+ "fontSizes": {
598
+ "iconSize": 14,
599
+ },
600
+ "radii": {
601
+ "wrapper": 999,
602
+ },
603
+ "shadows": {
604
+ "wrapper": {
605
+ "elevation": 3,
606
+ "shadowColor": "#001f23",
607
+ "shadowOffset": {
608
+ "height": 2,
609
+ "width": 0,
610
+ },
611
+ "shadowOpacity": 0.12,
612
+ "shadowRadius": 4,
613
+ },
614
+ },
615
+ "space": {
616
+ "iconPadding": 12,
617
+ "prefixMarginRight": 8,
618
+ "suffixMarginLeft": 16,
619
+ "wrapperPadding": 8,
620
+ "wrapperTop": 12,
621
+ },
622
+ },
593
623
  "icon": {
594
624
  "colors": {
595
625
  "danger": "#cb300a",
@@ -1286,20 +1316,36 @@ exports[`theme returns correct theme object 1`] = `
1286
1316
  "error": "#f46363",
1287
1317
  "iconButtonBackground": "#ece8ef",
1288
1318
  "info": "#b5c3fd",
1319
+ "inputContainerBackground": "#f6f6f7",
1289
1320
  "primary": "#401960",
1290
1321
  "secondary": "#4d6265",
1291
1322
  "success": "#5ace7d",
1292
1323
  },
1324
+ "fontSizes": {
1325
+ "text": 16,
1326
+ },
1327
+ "fonts": {
1328
+ "text": "BeVietnamPro-Regular",
1329
+ },
1293
1330
  "radii": {
1294
1331
  "iconButtonWrapperBorderRadius": 24,
1332
+ "messageContainer": 999,
1295
1333
  },
1296
1334
  "sizes": {
1297
1335
  "itemWrapperHeight": 64,
1336
+ "messageInputHeight": 40,
1337
+ "messageWrapperHeight": 64,
1298
1338
  },
1299
1339
  "space": {
1340
+ "affixInnerMargin": 16,
1300
1341
  "horizontalPadding": 8,
1301
1342
  "iconButtonLabelMarginLeft": 8,
1302
1343
  "iconButtonWrapperPadding": 12,
1344
+ "messageInputPaddingHorizontal": 12,
1345
+ "messageInputPaddingVertical": 8,
1346
+ "messageWrapperMarginHorizontal": 8,
1347
+ "messageWrapperPaddingHorizontal": 8,
1348
+ "messageWrapperPaddingVertical": 12,
1303
1349
  "verticalPadding": 8,
1304
1350
  },
1305
1351
  },
@@ -0,0 +1,31 @@
1
+ import type { GlobalTheme } from '../global';
2
+
3
+ const getFloatingIslandTheme = (theme: GlobalTheme) => {
4
+ const colors = {
5
+ wrapperBackground: theme.colors.defaultGlobalSurface,
6
+ };
7
+
8
+ const radii = {
9
+ wrapper: theme.radii.rounded,
10
+ };
11
+
12
+ const shadows = {
13
+ wrapper: theme.shadows.default,
14
+ };
15
+
16
+ const space = {
17
+ wrapperPadding: theme.space.small,
18
+ wrapperTop: theme.space.smallMedium,
19
+ prefixMarginRight: theme.space.small,
20
+ suffixMarginLeft: theme.space.medium,
21
+ iconPadding: theme.space.smallMedium,
22
+ };
23
+
24
+ const fontSizes = {
25
+ iconSize: theme.fontSizes.medium,
26
+ };
27
+
28
+ return { colors, radii, shadows, space, fontSizes };
29
+ };
30
+
31
+ export default getFloatingIslandTheme;
@@ -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
- return { colors, space, borderWidths, sizes, radii };
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;
@@ -50,6 +50,7 @@ import getTypographyTheme from './components/typography';
50
50
  import type { GlobalTheme, Scale, SystemPalette } from './global';
51
51
  import getSearchTheme from './components/search';
52
52
  import getMapPinTheme from './components/mapPin';
53
+ import getFloatingIslandTheme from './components/floatingIsland';
53
54
 
54
55
  type Theme = GlobalTheme & {
55
56
  __hd__: {
@@ -101,6 +102,7 @@ type Theme = GlobalTheme & {
101
102
  toast: ReturnType<typeof getToastTheme>;
102
103
  toolbar: ReturnType<typeof getToolbarTheme>;
103
104
  typography: ReturnType<typeof getTypographyTheme>;
105
+ floatingIsland: ReturnType<typeof getFloatingIslandTheme>;
104
106
  };
105
107
  };
106
108
 
@@ -160,6 +162,7 @@ const getTheme = (
160
162
  toast: getToastTheme(globalTheme),
161
163
  toolbar: getToolbarTheme(globalTheme),
162
164
  typography: getTypographyTheme(globalTheme),
165
+ floatingIsland: getFloatingIslandTheme(globalTheme),
163
166
  },
164
167
  };
165
168
  };