@tactics/toddle-styleguide 2.0.3 → 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/App.tsx +0 -12
- package/app.json +1 -0
- package/babel.config.js +14 -1
- package/index.d.ts +2 -5
- package/index.tsx +0 -8
- package/metro.config.js +11 -0
- package/package.json +1 -1
- package/src/components/atoms/animated-wave/animated-wave.styles.d.ts +19 -19
- package/src/components/atoms/backdrop/backdrop.styles.d.ts +9 -9
- package/src/components/atoms/background-gradient/background-gradient.styles.d.ts +6 -6
- package/src/components/atoms/count/count.component.d.ts +1 -1
- package/src/components/atoms/count/count.component.tsx +12 -13
- package/src/components/atoms/count/count.preview.tsx +5 -5
- package/src/components/atoms/count/count.styles.d.ts +23 -20
- package/src/components/atoms/count/count.styles.js +25 -17
- package/src/components/atoms/footer/footer.component.d.ts +1 -4
- package/src/components/atoms/footer/footer.component.tsx +9 -13
- package/src/components/atoms/footer/footer.preview.tsx +0 -17
- package/src/components/atoms/footer/footer.styles.d.ts +16 -13
- package/src/components/atoms/footer/footer.styles.js +1 -1
- package/src/components/atoms/increment-input/increment-input.styles.d.ts +33 -33
- package/src/components/atoms/quick-message/quick-message.styles.d.ts +16 -13
- package/src/components/atoms/split-container/split-container.styles.d.ts +12 -12
- package/src/components/molecules/amount/amount.component.d.ts +3 -3
- package/src/components/molecules/amount/amount.component.tsx +125 -100
- package/src/components/molecules/amount/amount.preview.tsx +59 -11
- package/src/components/molecules/amount/amount.styles.d.ts +34 -34
- package/src/components/molecules/amount/amount.styles.js +7 -7
- package/src/components/molecules/avatar/avatar.component.d.ts +1 -1
- package/src/components/molecules/avatar/avatar.component.tsx +8 -6
- package/src/components/molecules/avatar/avatar.styles.d.ts +96 -78
- package/src/components/molecules/avatar/avatar.styles.js +18 -16
- package/src/components/molecules/bare-time-picker/bare-time-picker.component.d.ts +1 -1
- package/src/components/molecules/bare-time-picker/bare-time-picker.component.native.tsx +78 -0
- package/src/components/molecules/bare-time-picker/bare-time-picker.component.tsx +39 -67
- package/src/components/molecules/bare-time-picker/bare-time-picker.preview.tsx +1 -1
- package/src/components/molecules/bare-time-picker/bare-time-picker.styles.d.ts +6 -0
- package/src/components/molecules/bare-time-picker/bare-time-picker.styles.js +14 -8
- package/src/components/molecules/calendar-select/calendar-select.component.d.ts +2 -1
- package/src/components/molecules/calendar-select/calendar-select.component.tsx +76 -73
- package/src/components/molecules/calendar-select/calendar-select.styles.d.ts +31 -31
- package/src/components/molecules/calendar-select/calendar-select.styles.js +33 -33
- package/src/components/molecules/context-label/context-label.component.tsx +21 -23
- package/src/components/molecules/context-label/context-label.preview.tsx +45 -30
- package/src/components/molecules/context-label/context-label.styles.d.ts +7 -5
- package/src/components/molecules/date-input/date-input.styles.d.ts +16 -16
- package/src/components/molecules/day/day.component.d.ts +10 -6
- package/src/components/molecules/default-select/default-select.styles.d.ts +11 -11
- package/src/components/molecules/filter-range/filter-range.styles.d.ts +20 -20
- package/src/components/molecules/filter-tab/filter-tab.styles.d.ts +58 -53
- package/src/components/molecules/info/info.component.tsx +13 -5
- package/src/components/molecules/info/info.preview.tsx +4 -5
- package/src/components/molecules/info/info.styles.d.ts +14 -14
- package/src/components/molecules/inline-error/inline-error.component.tsx +10 -3
- package/src/components/molecules/inline-error/inline-error.preview.tsx +4 -2
- package/src/components/molecules/inline-error/inline-error.styles.d.ts +16 -16
- package/src/components/molecules/inline-error/inline-error.styles.js +2 -2
- package/src/components/molecules/inline-notice/inline-notice.component.tsx +16 -12
- package/src/components/molecules/inline-notice/inline-notice.preview.tsx +4 -2
- package/src/components/molecules/inline-notice/inline-notice.styles.d.ts +16 -16
- package/src/components/molecules/inline-notice/inline-notice.styles.js +18 -18
- package/src/components/molecules/message-input/message-input.styles.d.ts +31 -31
- package/src/components/molecules/password-input/password-input.component.tsx +1 -1
- package/src/components/molecules/password-input/password-input.styles.d.ts +27 -27
- package/src/components/molecules/quick-filter/quick-filter.component.tsx +1 -1
- package/src/components/molecules/quick-filter/quick-filter.preview.tsx +1 -1
- package/src/components/molecules/quick-filter/quick-filter.styles.js +1 -1
- package/src/components/molecules/search-input/search.styles.d.ts +31 -31
- package/src/components/molecules/select-list-item/select-list-item.component.d.ts +1 -1
- package/src/components/molecules/select-list-item/select-list-item.component.tsx +13 -9
- package/src/components/molecules/select-list-item/select-list-item.styles.d.ts +27 -22
- package/src/components/molecules/select-picker/select-picker.styles.d.ts +30 -30
- package/src/components/molecules/selectable-list-item/selectable-list-item-preview.tsx +1 -1
- package/src/components/molecules/selectable-list-item/selectable-list-item.component.d.ts +1 -1
- package/src/components/molecules/selectable-list-item/selectable-list-item.component.tsx +17 -5
- package/src/components/molecules/selectable-list-item/selectable-list-item.styles.d.ts +31 -27
- package/src/components/molecules/swipe/swipe.component.native.tsx +78 -0
- package/src/components/molecules/swipe/swipe.component.tsx +5 -63
- package/src/components/molecules/time-picker/time-picker.component.tsx +8 -2
- package/src/components/molecules/time-picker/time-picker.styles.d.ts +25 -25
- package/src/components/molecules/wide-button/wide-button.styles.d.ts +14 -10
- package/src/components/organisms/child-list-item/child-list-item.component.d.ts +1 -1
- package/src/components/organisms/child-list-item/child-list-item.component.tsx +29 -26
- package/src/components/organisms/child-list-item/child-list-item.styles.d.ts +56 -53
- package/src/components/organisms/child-list-item/child-list-item.styles.js +5 -5
- package/src/components/organisms/contact-item/contact-item.styles.d.ts +13 -13
- package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.component.d.ts +1 -1
- package/src/components/organisms/journal-entry/components/journal-entry-type/journal-entry-type.component.tsx +5 -4
- package/src/components/organisms/journal-entry/journal-entry.component.d.ts +1 -1
- package/src/components/organisms/journal-entry/journal-entry.styles.d.ts +25 -22
- package/src/components/organisms/my-child-list-item/my-child-list-item.styles.d.ts +31 -31
- package/src/components/organisms/text-bubble/text-bubble.styles.d.ts +14 -14
- package/src/components/organisms/timetable-edit/timetable-edit.component.d.ts +1 -1
- package/src/components/organisms/timetable-edit/timetable-edit.component.tsx +58 -56
- package/src/components/organisms/timetable-edit/timetable-edit.preview.tsx +20 -18
- package/src/components/organisms/timetable-edit/timetable-edit.styles.d.ts +19 -19
- package/src/components/organisms/timetable-edit/timetable-edit.styles.js +21 -21
- package/src/components/organisms/timetable-editor/components/timetable-edit-wrapper.d.ts +4 -4
- package/src/components/organisms/timetable-editor/components/timetable-edit-wrapper.tsx +65 -58
- package/src/components/organisms/timetable-editor/timetable-editor-staff.component.d.ts +8 -0
- package/src/components/organisms/timetable-editor/timetable-editor-staff.component.tsx +66 -47
- package/src/components/organisms/timetable-editor/timetable-editor.component.d.ts +2 -2
- package/src/components/organisms/timetable-editor/timetable-editor.component.tsx +76 -53
- package/src/components/organisms/timetable-editor/timetable-editor.preview.tsx +7 -7
- package/src/components/organisms/timetable-editor/timetable-editor.styles.d.ts +6 -6
- package/src/components/organisms/timetable-editor/timetable-editor.styles.js +8 -8
- package/src/components/templates/modal/components/fade-panel.styles.d.ts +17 -13
- package/src/components/templates/modal/modal.styles.d.ts +21 -21
- package/src/components/templates/popover/components/foreground/foreground.styles.d.ts +10 -10
- package/src/components/templates/popover/components/modal/heading/heading.styles.d.ts +12 -12
- package/src/components/templates/popover/components/modal/modal.styles.d.ts +17 -17
- package/src/components/templates/popover/popover.styles.d.ts +9 -9
- package/src/components/templates/popover-action/popover-action.component.d.ts +8 -4
- package/src/components/templates/popover-action/popover-action.component.tsx +7 -4
- package/src/components/templates/popover-action/popover-action.styles.d.ts +26 -26
- package/src/context/theme.context.ts +4 -4
- package/src/hooks/use-debounce.ts +8 -8
- package/src/icons/crown.icon.tsx +18 -5
- package/src/icons/outline/outline-default.preview.tsx +2 -2
- package/src/icons/outline/outline.tsx +4 -4
- package/src/icons/outline/photograph/photograph.icon.tsx +3 -6
- package/src/icons/solid/photograph/photograph-solid.icon.tsx +4 -4
- package/src/icons/solid/share/share.icon.tsx +1 -3
- package/src/icons/solid/solid.tsx +4 -4
- package/src/models/time-slot-sequence.ts +13 -9
- package/src/theme/provider/parent.theme.ts +4 -4
- package/src/theme/provider/staff-member.theme.ts +4 -4
- package/src/types/state.enum.ts +5 -5
- package/src/utilities/color-handler/color-handler.ts +2 -3
- package/tsconfig.json +2 -1
- package/src/components/organisms/day-select/day-select.component.d.ts +0 -9
- package/src/components/organisms/day-select/day-select.component.tsx +0 -108
- package/src/components/organisms/day-select/day-select.preview.d.ts +0 -2
- package/src/components/organisms/day-select/day-select.preview.tsx +0 -23
- package/src/components/organisms/day-select/day-select.styles.d.ts +0 -18
- package/src/components/organisms/day-select/day-select.styles.js +0 -22
- package/src/components/organisms/tab-view/__snapshots__/tab-view.test.js.snap +0 -421
- package/src/components/organisms/tab-view/tab-view.component.d.ts +0 -12
- package/src/components/organisms/tab-view/tab-view.component.tsx +0 -49
- package/src/components/organisms/tab-view/tab-view.preview.d.ts +0 -2
- package/src/components/organisms/tab-view/tab-view.preview.tsx +0 -37
- package/src/components/organisms/tab-view/tab-view.styles.d.ts +0 -10
- package/src/components/organisms/tab-view/tab-view.styles.js +0 -14
- package/src/components/organisms/tab-view/tab-view.test.js +0 -37
|
@@ -1,421 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`TabView should render correctly 1`] = `
|
|
4
|
-
<View
|
|
5
|
-
style={
|
|
6
|
-
{
|
|
7
|
-
"gap": 24,
|
|
8
|
-
"height": "100%",
|
|
9
|
-
"width": "100%",
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
>
|
|
13
|
-
<View
|
|
14
|
-
style={
|
|
15
|
-
{
|
|
16
|
-
"backgroundColor": "#E5E8EB",
|
|
17
|
-
"borderRadius": 16,
|
|
18
|
-
"display": "flex",
|
|
19
|
-
"paddingBottom": 4,
|
|
20
|
-
"paddingLeft": 8,
|
|
21
|
-
"paddingRight": 8,
|
|
22
|
-
"paddingTop": 4,
|
|
23
|
-
"width": "100%",
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
>
|
|
27
|
-
<View
|
|
28
|
-
onLayout={[Function]}
|
|
29
|
-
style={
|
|
30
|
-
{
|
|
31
|
-
"display": "flex",
|
|
32
|
-
"width": "100%",
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
>
|
|
36
|
-
<View
|
|
37
|
-
style={
|
|
38
|
-
{
|
|
39
|
-
"alignItems": "stretch",
|
|
40
|
-
"display": "flex",
|
|
41
|
-
"flexDirection": "column",
|
|
42
|
-
"position": "relative",
|
|
43
|
-
"width": "100%",
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
>
|
|
47
|
-
<View
|
|
48
|
-
accessibilityState={
|
|
49
|
-
{
|
|
50
|
-
"busy": undefined,
|
|
51
|
-
"checked": undefined,
|
|
52
|
-
"disabled": undefined,
|
|
53
|
-
"expanded": undefined,
|
|
54
|
-
"selected": undefined,
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
accessibilityValue={
|
|
58
|
-
{
|
|
59
|
-
"max": undefined,
|
|
60
|
-
"min": undefined,
|
|
61
|
-
"now": undefined,
|
|
62
|
-
"text": undefined,
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
accessible={true}
|
|
66
|
-
collapsable={false}
|
|
67
|
-
focusable={true}
|
|
68
|
-
onBlur={[Function]}
|
|
69
|
-
onClick={[Function]}
|
|
70
|
-
onFocus={[Function]}
|
|
71
|
-
onResponderGrant={[Function]}
|
|
72
|
-
onResponderMove={[Function]}
|
|
73
|
-
onResponderRelease={[Function]}
|
|
74
|
-
onResponderTerminate={[Function]}
|
|
75
|
-
onResponderTerminationRequest={[Function]}
|
|
76
|
-
onStartShouldSetResponder={[Function]}
|
|
77
|
-
style={
|
|
78
|
-
{
|
|
79
|
-
"alignItems": "center",
|
|
80
|
-
"backgroundColor": "transparent",
|
|
81
|
-
"borderRadius": 16,
|
|
82
|
-
"paddingBottom": 8,
|
|
83
|
-
"paddingLeft": 16,
|
|
84
|
-
"paddingRight": 16,
|
|
85
|
-
"paddingTop": 8,
|
|
86
|
-
"width": 0,
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
>
|
|
90
|
-
<Text
|
|
91
|
-
style={
|
|
92
|
-
[
|
|
93
|
-
[
|
|
94
|
-
{
|
|
95
|
-
"fontFamily": "SourceSansPro",
|
|
96
|
-
"fontSize": 16,
|
|
97
|
-
"lineHeight": 22.4,
|
|
98
|
-
},
|
|
99
|
-
],
|
|
100
|
-
{
|
|
101
|
-
"color": "#FFFFFF",
|
|
102
|
-
"textAlign": "center",
|
|
103
|
-
"width": "100%",
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"maxHeight": 32,
|
|
107
|
-
"overflow": "hidden",
|
|
108
|
-
"width": "100%",
|
|
109
|
-
},
|
|
110
|
-
]
|
|
111
|
-
}
|
|
112
|
-
>
|
|
113
|
-
Tab1
|
|
114
|
-
</Text>
|
|
115
|
-
</View>
|
|
116
|
-
<View
|
|
117
|
-
accessibilityState={
|
|
118
|
-
{
|
|
119
|
-
"busy": undefined,
|
|
120
|
-
"checked": undefined,
|
|
121
|
-
"disabled": undefined,
|
|
122
|
-
"expanded": undefined,
|
|
123
|
-
"selected": undefined,
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
accessibilityValue={
|
|
127
|
-
{
|
|
128
|
-
"max": undefined,
|
|
129
|
-
"min": undefined,
|
|
130
|
-
"now": undefined,
|
|
131
|
-
"text": undefined,
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
accessible={true}
|
|
135
|
-
collapsable={false}
|
|
136
|
-
focusable={true}
|
|
137
|
-
onBlur={[Function]}
|
|
138
|
-
onClick={[Function]}
|
|
139
|
-
onFocus={[Function]}
|
|
140
|
-
onResponderGrant={[Function]}
|
|
141
|
-
onResponderMove={[Function]}
|
|
142
|
-
onResponderRelease={[Function]}
|
|
143
|
-
onResponderTerminate={[Function]}
|
|
144
|
-
onResponderTerminationRequest={[Function]}
|
|
145
|
-
onStartShouldSetResponder={[Function]}
|
|
146
|
-
style={
|
|
147
|
-
{
|
|
148
|
-
"alignItems": "center",
|
|
149
|
-
"backgroundColor": "transparent",
|
|
150
|
-
"borderRadius": 16,
|
|
151
|
-
"paddingBottom": 8,
|
|
152
|
-
"paddingLeft": 16,
|
|
153
|
-
"paddingRight": 16,
|
|
154
|
-
"paddingTop": 8,
|
|
155
|
-
"width": 0,
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
>
|
|
159
|
-
<Text
|
|
160
|
-
style={
|
|
161
|
-
[
|
|
162
|
-
[
|
|
163
|
-
{
|
|
164
|
-
"fontFamily": "SourceSansPro",
|
|
165
|
-
"fontSize": 16,
|
|
166
|
-
"lineHeight": 22.4,
|
|
167
|
-
},
|
|
168
|
-
],
|
|
169
|
-
{
|
|
170
|
-
"color": "#19216C",
|
|
171
|
-
"textAlign": "center",
|
|
172
|
-
"width": "100%",
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
"maxHeight": 32,
|
|
176
|
-
"overflow": "hidden",
|
|
177
|
-
"width": "100%",
|
|
178
|
-
},
|
|
179
|
-
]
|
|
180
|
-
}
|
|
181
|
-
>
|
|
182
|
-
Tab2
|
|
183
|
-
</Text>
|
|
184
|
-
</View>
|
|
185
|
-
<View
|
|
186
|
-
accessibilityState={
|
|
187
|
-
{
|
|
188
|
-
"busy": undefined,
|
|
189
|
-
"checked": undefined,
|
|
190
|
-
"disabled": undefined,
|
|
191
|
-
"expanded": undefined,
|
|
192
|
-
"selected": undefined,
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
accessibilityValue={
|
|
196
|
-
{
|
|
197
|
-
"max": undefined,
|
|
198
|
-
"min": undefined,
|
|
199
|
-
"now": undefined,
|
|
200
|
-
"text": undefined,
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
accessible={true}
|
|
204
|
-
collapsable={false}
|
|
205
|
-
focusable={true}
|
|
206
|
-
onBlur={[Function]}
|
|
207
|
-
onClick={[Function]}
|
|
208
|
-
onFocus={[Function]}
|
|
209
|
-
onResponderGrant={[Function]}
|
|
210
|
-
onResponderMove={[Function]}
|
|
211
|
-
onResponderRelease={[Function]}
|
|
212
|
-
onResponderTerminate={[Function]}
|
|
213
|
-
onResponderTerminationRequest={[Function]}
|
|
214
|
-
onStartShouldSetResponder={[Function]}
|
|
215
|
-
style={
|
|
216
|
-
{
|
|
217
|
-
"alignItems": "center",
|
|
218
|
-
"backgroundColor": "transparent",
|
|
219
|
-
"borderRadius": 16,
|
|
220
|
-
"paddingBottom": 8,
|
|
221
|
-
"paddingLeft": 16,
|
|
222
|
-
"paddingRight": 16,
|
|
223
|
-
"paddingTop": 8,
|
|
224
|
-
"width": 0,
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
>
|
|
228
|
-
<Text
|
|
229
|
-
style={
|
|
230
|
-
[
|
|
231
|
-
[
|
|
232
|
-
{
|
|
233
|
-
"fontFamily": "SourceSansPro",
|
|
234
|
-
"fontSize": 16,
|
|
235
|
-
"lineHeight": 22.4,
|
|
236
|
-
},
|
|
237
|
-
],
|
|
238
|
-
{
|
|
239
|
-
"color": "#19216C",
|
|
240
|
-
"textAlign": "center",
|
|
241
|
-
"width": "100%",
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
"maxHeight": 32,
|
|
245
|
-
"overflow": "hidden",
|
|
246
|
-
"width": "100%",
|
|
247
|
-
},
|
|
248
|
-
]
|
|
249
|
-
}
|
|
250
|
-
>
|
|
251
|
-
Tab3
|
|
252
|
-
</Text>
|
|
253
|
-
</View>
|
|
254
|
-
<View
|
|
255
|
-
collapsable={false}
|
|
256
|
-
style={
|
|
257
|
-
{
|
|
258
|
-
"alignItems": "center",
|
|
259
|
-
"backgroundColor": "#647ACB",
|
|
260
|
-
"borderRadius": 12,
|
|
261
|
-
"marginTop": 3,
|
|
262
|
-
"maxHeight": 32,
|
|
263
|
-
"paddingBottom": 8,
|
|
264
|
-
"paddingLeft": 16,
|
|
265
|
-
"paddingRight": 16,
|
|
266
|
-
"paddingTop": 8,
|
|
267
|
-
"position": "absolute",
|
|
268
|
-
"transform": [
|
|
269
|
-
{
|
|
270
|
-
"translateY": 0,
|
|
271
|
-
},
|
|
272
|
-
],
|
|
273
|
-
"width": 0,
|
|
274
|
-
"zIndex": -1,
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
>
|
|
278
|
-
<Text
|
|
279
|
-
style={
|
|
280
|
-
[
|
|
281
|
-
[
|
|
282
|
-
{
|
|
283
|
-
"fontFamily": "SourceSansPro",
|
|
284
|
-
"fontSize": 16,
|
|
285
|
-
"lineHeight": 22.4,
|
|
286
|
-
},
|
|
287
|
-
],
|
|
288
|
-
{
|
|
289
|
-
"color": "#19216C",
|
|
290
|
-
"textAlign": undefined,
|
|
291
|
-
"width": "100%",
|
|
292
|
-
},
|
|
293
|
-
[
|
|
294
|
-
{
|
|
295
|
-
"maxHeight": 32,
|
|
296
|
-
"overflow": "hidden",
|
|
297
|
-
"width": "100%",
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
"opacity": 0,
|
|
301
|
-
},
|
|
302
|
-
],
|
|
303
|
-
]
|
|
304
|
-
}
|
|
305
|
-
>
|
|
306
|
-
Hidden
|
|
307
|
-
</Text>
|
|
308
|
-
</View>
|
|
309
|
-
</View>
|
|
310
|
-
</View>
|
|
311
|
-
</View>
|
|
312
|
-
<RNCViewPager
|
|
313
|
-
collapsable={false}
|
|
314
|
-
layoutDirection="ltr"
|
|
315
|
-
onMoveShouldSetResponderCapture={[Function]}
|
|
316
|
-
onPageScroll={[Function]}
|
|
317
|
-
onPageScrollStateChanged={[Function]}
|
|
318
|
-
onPageSelected={[Function]}
|
|
319
|
-
scrollEnabled={false}
|
|
320
|
-
style={
|
|
321
|
-
{
|
|
322
|
-
"flex": 1,
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
>
|
|
326
|
-
<View
|
|
327
|
-
collapsable={false}
|
|
328
|
-
style={
|
|
329
|
-
{
|
|
330
|
-
"bottom": 0,
|
|
331
|
-
"left": 0,
|
|
332
|
-
"position": "absolute",
|
|
333
|
-
"right": 0,
|
|
334
|
-
"top": 0,
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
>
|
|
338
|
-
<View
|
|
339
|
-
style={
|
|
340
|
-
[
|
|
341
|
-
undefined,
|
|
342
|
-
{
|
|
343
|
-
"bottom": 0,
|
|
344
|
-
"left": 0,
|
|
345
|
-
"position": "absolute",
|
|
346
|
-
"right": 0,
|
|
347
|
-
"top": 0,
|
|
348
|
-
},
|
|
349
|
-
]
|
|
350
|
-
}
|
|
351
|
-
>
|
|
352
|
-
<Text>
|
|
353
|
-
Tab1
|
|
354
|
-
</Text>
|
|
355
|
-
</View>
|
|
356
|
-
</View>
|
|
357
|
-
<View
|
|
358
|
-
collapsable={false}
|
|
359
|
-
style={
|
|
360
|
-
{
|
|
361
|
-
"bottom": 0,
|
|
362
|
-
"left": 0,
|
|
363
|
-
"position": "absolute",
|
|
364
|
-
"right": 0,
|
|
365
|
-
"top": 0,
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
>
|
|
369
|
-
<View
|
|
370
|
-
style={
|
|
371
|
-
[
|
|
372
|
-
undefined,
|
|
373
|
-
{
|
|
374
|
-
"bottom": 0,
|
|
375
|
-
"left": 0,
|
|
376
|
-
"position": "absolute",
|
|
377
|
-
"right": 0,
|
|
378
|
-
"top": 0,
|
|
379
|
-
},
|
|
380
|
-
]
|
|
381
|
-
}
|
|
382
|
-
>
|
|
383
|
-
<Text>
|
|
384
|
-
Tab2
|
|
385
|
-
</Text>
|
|
386
|
-
</View>
|
|
387
|
-
</View>
|
|
388
|
-
<View
|
|
389
|
-
collapsable={false}
|
|
390
|
-
style={
|
|
391
|
-
{
|
|
392
|
-
"bottom": 0,
|
|
393
|
-
"left": 0,
|
|
394
|
-
"position": "absolute",
|
|
395
|
-
"right": 0,
|
|
396
|
-
"top": 0,
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
>
|
|
400
|
-
<View
|
|
401
|
-
style={
|
|
402
|
-
[
|
|
403
|
-
undefined,
|
|
404
|
-
{
|
|
405
|
-
"bottom": 0,
|
|
406
|
-
"left": 0,
|
|
407
|
-
"position": "absolute",
|
|
408
|
-
"right": 0,
|
|
409
|
-
"top": 0,
|
|
410
|
-
},
|
|
411
|
-
]
|
|
412
|
-
}
|
|
413
|
-
>
|
|
414
|
-
<Text>
|
|
415
|
-
Tab3
|
|
416
|
-
</Text>
|
|
417
|
-
</View>
|
|
418
|
-
</View>
|
|
419
|
-
</RNCViewPager>
|
|
420
|
-
</View>
|
|
421
|
-
`;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
interface TabViewProps {
|
|
4
|
-
tabItem: {
|
|
5
|
-
value: string;
|
|
6
|
-
label: string;
|
|
7
|
-
}[];
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
setTabValue: (value: string) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare const TabView: ({ tabItem, setTabValue, children }: TabViewProps) => React.JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import {FilterTab} from '../../molecules/filter-tab/filter-tab.component';
|
|
2
|
-
import {View} from 'react-native';
|
|
3
|
-
import PagerView, {PagerViewOnPageSelectedEvent} from 'react-native-pager-view';
|
|
4
|
-
import {ReactNode, useEffect, useRef, useState} from 'react';
|
|
5
|
-
import {Stylesheet} from './tab-view.styles';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
|
|
8
|
-
interface TabViewProps {
|
|
9
|
-
tabItem: {
|
|
10
|
-
value: string;
|
|
11
|
-
label: string;
|
|
12
|
-
}[];
|
|
13
|
-
children: ReactNode;
|
|
14
|
-
setTabValue: (value: string) => void;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const TabView = ({tabItem, setTabValue, children}: TabViewProps) => {
|
|
18
|
-
const styles = Stylesheet();
|
|
19
|
-
const viewPagerRef = useRef<PagerView>(null);
|
|
20
|
-
const [activePage, setActivePage] = useState(0);
|
|
21
|
-
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
viewPagerRef.current?.setPage(activePage);
|
|
24
|
-
}, [activePage, tabItem]);
|
|
25
|
-
|
|
26
|
-
const handleActivePage = (event: PagerViewOnPageSelectedEvent) => {
|
|
27
|
-
const currentIndex = event.nativeEvent.position;
|
|
28
|
-
setActivePage(currentIndex);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<View style={styles.rootContainer}>
|
|
33
|
-
<FilterTab
|
|
34
|
-
tabItem={tabItem}
|
|
35
|
-
setFilterValue={setTabValue}
|
|
36
|
-
setActivePage={setActivePage}
|
|
37
|
-
/>
|
|
38
|
-
<PagerView
|
|
39
|
-
ref={viewPagerRef}
|
|
40
|
-
scrollEnabled={false}
|
|
41
|
-
style={styles.swipeContainer}
|
|
42
|
-
collapsable={false}
|
|
43
|
-
onPageSelected={handleActivePage}
|
|
44
|
-
>
|
|
45
|
-
{children}
|
|
46
|
-
</PagerView>
|
|
47
|
-
</View>
|
|
48
|
-
);
|
|
49
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {Text, View} from 'react-native';
|
|
2
|
-
import {TabView} from './tab-view.component';
|
|
3
|
-
import {useState} from 'react';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
|
|
6
|
-
export const TabViewPreview = () => {
|
|
7
|
-
const tabs = [
|
|
8
|
-
{value: 'Registration', label: 'Registration'},
|
|
9
|
-
{value: 'Products', label: 'Products'},
|
|
10
|
-
];
|
|
11
|
-
|
|
12
|
-
const [tabValue, setTabValue] = useState<string>(tabs[0].value);
|
|
13
|
-
|
|
14
|
-
console.log('Active tab: ', tabValue);
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<View
|
|
18
|
-
style={{
|
|
19
|
-
flex: 1,
|
|
20
|
-
flexDirection: 'row',
|
|
21
|
-
alignItems: 'center',
|
|
22
|
-
justifyContent: 'center',
|
|
23
|
-
backgroundColor: 'white',
|
|
24
|
-
padding: 32,
|
|
25
|
-
}}
|
|
26
|
-
>
|
|
27
|
-
<TabView tabItem={tabs} setTabValue={setTabValue}>
|
|
28
|
-
<View style={{height: 500, alignItems: 'center'}}>
|
|
29
|
-
<Text>Tab 1</Text>
|
|
30
|
-
</View>
|
|
31
|
-
<View style={{height: 500, alignItems: 'center'}}>
|
|
32
|
-
<Text>Tab 2</Text>
|
|
33
|
-
</View>
|
|
34
|
-
</TabView>
|
|
35
|
-
</View>
|
|
36
|
-
);
|
|
37
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {StyleSheet} from 'react-native';
|
|
2
|
-
import {Scale} from '../../../theme/scale/index';
|
|
3
|
-
|
|
4
|
-
export const Stylesheet = () =>
|
|
5
|
-
StyleSheet.create({
|
|
6
|
-
rootContainer: {
|
|
7
|
-
width: '100%',
|
|
8
|
-
height: '100%',
|
|
9
|
-
gap: Scale.l,
|
|
10
|
-
},
|
|
11
|
-
swipeContainer: {
|
|
12
|
-
flex: 1,
|
|
13
|
-
},
|
|
14
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {render} from '@testing-library/react-native';
|
|
2
|
-
import {TabView} from './tab-view.component';
|
|
3
|
-
import {View, Text} from 'react-native';
|
|
4
|
-
|
|
5
|
-
describe('TabView', () => {
|
|
6
|
-
it('should render correctly', () => {
|
|
7
|
-
const tabs = [
|
|
8
|
-
{
|
|
9
|
-
value: 'Tab1',
|
|
10
|
-
label: 'Tab1',
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
value: 'Tab2',
|
|
14
|
-
label: 'Tab2',
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
value: 'Tab3',
|
|
18
|
-
label: 'Tab3',
|
|
19
|
-
},
|
|
20
|
-
];
|
|
21
|
-
|
|
22
|
-
const {toJSON} = render(
|
|
23
|
-
<TabView tabItem={tabs} setTabValue={() => 'Tab2'}>
|
|
24
|
-
<View>
|
|
25
|
-
<Text>Tab1</Text>
|
|
26
|
-
</View>
|
|
27
|
-
<View>
|
|
28
|
-
<Text>Tab2</Text>
|
|
29
|
-
</View>
|
|
30
|
-
<View>
|
|
31
|
-
<Text>Tab3</Text>
|
|
32
|
-
</View>
|
|
33
|
-
</TabView>
|
|
34
|
-
);
|
|
35
|
-
expect(toJSON()).toMatchSnapshot();
|
|
36
|
-
});
|
|
37
|
-
});
|