@momo-kits/calendar 0.0.61-beta.9 → 0.0.62-alpha.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/calendar",
3
- "version": "0.0.61-beta.9",
3
+ "version": "0.0.62-alpha.2",
4
4
  "private": false,
5
5
  "main": "index.js",
6
6
  "dependencies": {
@@ -12,7 +12,7 @@
12
12
  "react": "16.9.0",
13
13
  "react-native": ">=0.55",
14
14
  "prop-types": "^15.7.2",
15
- "@momo-kits/core": ">=0.0.5-beta"
15
+ "@momo-kits/core-v2": ">=0.0.5-beta"
16
16
  },
17
17
  "devDependencies": {},
18
18
  "license": "MoMo"
package/src/Calendar.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  Spacing,
16
16
  Radius,
17
17
  ScaleSize,
18
- } from '@momo-kits/core';
18
+ } from '@momo-kits/core-v2';
19
19
  import Switch from '@momo-kits/switch';
20
20
  import CalendarPro from './CalendarPro';
21
21
  import TabHeader from './TabHeader';
@@ -349,9 +349,9 @@ class Calendar extends Component {
349
349
  return (
350
350
  <View style={styles.headerContainer}>
351
351
  <View style={styles.viewSwitch}>
352
- <Text.Title weight="medium" style={styles.textSwitch}>
352
+ <Text.Label1 weight="medium" style={styles.textSwitch}>
353
353
  {SwitchLanguage.chooseRoundtrip}
354
- </Text.Title>
354
+ </Text.Label1>
355
355
  <Switch
356
356
  value={isDoubleDateMode}
357
357
  onChange={this.toggleSelectionDateMode}
@@ -19,7 +19,7 @@ import {
19
19
  Colors,
20
20
  Spacing,
21
21
  Radius,
22
- } from '@momo-kits/core';
22
+ } from '@momo-kits/core-v2';
23
23
  import MonthList from './MonthList';
24
24
  import HeaderControl from './HeaderControl';
25
25
  import LunarDateConverter from './LunarDateConverter';
@@ -254,19 +254,20 @@ export default class CalendarPro extends Component {
254
254
  <View>
255
255
  <View style={styles.viewDay}>
256
256
  {[1, 2, 3, 4, 5, 6, 7].map((item) => (
257
- <Text
257
+ <Text.Label2
258
+ weight="medium"
258
259
  style={[
259
260
  styles.textDay,
260
261
  {
261
262
  color:
262
263
  item === 6 || item === 7
263
- ? Colors.red_05
264
- : Colors.black_12,
264
+ ? Colors.red_03
265
+ : Colors.black_17,
265
266
  },
266
267
  ]}
267
268
  key={item}>
268
269
  {Util.mapWeeKDate(item)}
269
- </Text>
270
+ </Text.Label2>
270
271
  ))}
271
272
  </View>
272
273
  <MonthList
@@ -298,9 +299,7 @@ export default class CalendarPro extends Component {
298
299
  onPress={this.toggleLunarDate}>
299
300
  <Image
300
301
  tintColor={
301
- showLunar
302
- ? Colors.pink_05_b
303
- : Colors.black_17
302
+ showLunar ? Colors.pink_03 : Colors.black_17
304
303
  }
305
304
  source={
306
305
  showLunar
@@ -310,11 +309,11 @@ export default class CalendarPro extends Component {
310
309
  style={styles.iconSelected}
311
310
  />
312
311
  </TouchableWithoutFeedback>
313
- <Text
312
+ <Text.Description1
314
313
  style={styles.txtLunar}
315
314
  onPress={this.toggleLunarDate}>
316
315
  {SwitchLanguage.showLunar}
317
- </Text>
316
+ </Text.Description1>
318
317
  </View>
319
318
  )}
320
319
 
@@ -343,14 +342,14 @@ export default class CalendarPro extends Component {
343
342
  <View
344
343
  style={styles.row}
345
344
  key={idx.toString()}>
346
- <Text.SubTitle
345
+ <Text.Description2
347
346
  style={styles.txtMonthLunar}>
348
347
  {labelDate}
349
- </Text.SubTitle>
350
- <Text.SubTitle
348
+ </Text.Description2>
349
+ <Text.Description2
351
350
  style={styles.subTextLunar}>
352
351
  {`${labelHoliday} `}
353
- </Text.SubTitle>
352
+ </Text.Description2>
354
353
  </View>
355
354
  );
356
355
  })}
@@ -386,12 +385,9 @@ CalendarPro.defaultProps = {
386
385
 
387
386
  const styles = StyleSheet.create({
388
387
  row: { flexDirection: 'row' },
389
- txtMonthLunar: { color: Colors.red_05, marginRight: Spacing.S },
388
+ txtMonthLunar: { color: Colors.red_03, marginRight: Spacing.S },
390
389
  subTextLunar: {
391
- // fontSize: 12,
392
- color: '#222222',
393
- paddingLeft: 6,
394
- flexShrink: 1,
390
+ color: Colors.black_17,
395
391
  },
396
392
  contentScroll: { paddingHorizontal: 12, paddingVertical: 10 },
397
393
  iconSelected: { width: 24, height: 24, resizeMode: 'cover' },
@@ -411,11 +407,8 @@ const styles = StyleSheet.create({
411
407
  },
412
408
  viewDate: {},
413
409
  textDay: {
414
- fontSize: 12,
415
- lineHeight: 16,
416
410
  width: (widthScreen - 38) / 7,
417
411
  textAlign: 'center',
418
- fontWeight: 'bold',
419
412
  },
420
413
  viewDay: {
421
414
  flexDirection: 'row',
package/src/Day/index.js CHANGED
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
4
  import { View, TouchableHighlight } from 'react-native';
5
- import { Spacing, SwitchLanguage, Colors, Text } from '@momo-kits/core';
5
+ import { Spacing, SwitchLanguage, Colors, Text } from '@momo-kits/core-v2';
6
6
  import style from './style';
7
7
 
8
8
  class Day extends Component {
@@ -156,7 +156,7 @@ class Day extends Component {
156
156
  onPress={this.chooseDay}>
157
157
  <>
158
158
  {this.lunarDate && this.showLunar && (
159
- <Text.Caption
159
+ <Text.Label4
160
160
  style={[
161
161
  style.lunarDayText,
162
162
  (this.isLunarHoliday ||
@@ -168,9 +168,9 @@ class Day extends Component {
168
168
  {this.lunarDate.lunarDay === 1
169
169
  ? `${this.lunarDate.lunarDay}/${this.lunarDate.lunarMonth}`
170
170
  : this.lunarDate.lunarDay}
171
- </Text.Caption>
171
+ </Text.Label4>
172
172
  )}
173
- <Text.Title
173
+ <Text.Label1
174
174
  style={[
175
175
  style.dayText,
176
176
  { paddingTop: !!price ? 4 : 0 },
@@ -180,9 +180,9 @@ class Day extends Component {
180
180
  style.focusedText,
181
181
  ]}>
182
182
  {text}
183
- </Text.Title>
183
+ </Text.Label1>
184
184
  {!!price ? (
185
- <Text.Caption
185
+ <Text.Label3
186
186
  style={[
187
187
  this.isValid && this.isInScope
188
188
  ? style.price
@@ -195,7 +195,7 @@ class Day extends Component {
195
195
  },
196
196
  ]}>
197
197
  {price}
198
- </Text.Caption>
198
+ </Text.Label3>
199
199
  ) : (
200
200
  <View
201
201
  style={{
@@ -219,7 +219,7 @@ class Day extends Component {
219
219
  },
220
220
  ]}>
221
221
  {this.lunarDate && this.showLunar && text ? (
222
- <Text.Caption
222
+ <Text.Label4
223
223
  style={[
224
224
  style.lunarDayText,
225
225
  style.dayTextDisabled,
@@ -227,26 +227,26 @@ class Day extends Component {
227
227
  {this.lunarDate.lunarDay === 1
228
228
  ? `${this.lunarDate.lunarDay}/${this.lunarDate.lunarMonth}`
229
229
  : this.lunarDate.lunarDay}
230
- </Text.Caption>
230
+ </Text.Label4>
231
231
  ) : (
232
232
  <View />
233
233
  )}
234
- <Text.Title
234
+ <Text.Action2
235
235
  style={[style.dayText, style.dayTextDisabled]}>
236
236
  {text}
237
- </Text.Title>
237
+ </Text.Action2>
238
238
  {text && !!price ? (
239
- <Text.Caption
239
+ <Text.Label3
240
240
  style={[
241
241
  this.isValid && this.isInScope
242
242
  ? style.price
243
243
  : style.dayTextDisabled,
244
244
  isBestPrice && {
245
- color: Colors.pink_05_b,
245
+ color: Colors.pink_03,
246
246
  },
247
247
  ]}>
248
248
  {price}
249
- </Text.Caption>
249
+ </Text.Label3>
250
250
  ) : (
251
251
  <View
252
252
  style={{
package/src/Day/style.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Dimensions } from 'react-native';
2
- import { Spacing, Colors } from '@momo-kits/core';
2
+ import { Spacing, Colors } from '@momo-kits/core-v2';
3
3
 
4
4
  const dayWidth = (Dimensions.get('window').width - 38) / 7;
5
5
  const SCREEN_WIDTH = Dimensions.get('window').width;
@@ -29,7 +29,6 @@ export default {
29
29
  borderRadius: 4,
30
30
  },
31
31
  dayText: {
32
- lineHeight: 24,
33
32
  textAlign: 'center',
34
33
  },
35
34
  lunarDayText: {
@@ -38,7 +37,7 @@ export default {
38
37
  paddingRight: Spacing.XS,
39
38
  position: 'absolute',
40
39
  top: Spacing.XXS,
41
- lineHeight: 14,
40
+ color: Colors.black_12,
42
41
  },
43
42
  todayText: {
44
43
  color: 'blue',
@@ -51,7 +50,7 @@ export default {
51
50
  },
52
51
 
53
52
  focused: {
54
- backgroundColor: Colors.pink_05_b,
53
+ backgroundColor: Colors.pink_03,
55
54
  },
56
55
  focusedText: {
57
56
  fontWeight: 'bold',
@@ -60,15 +59,15 @@ export default {
60
59
  dayStartContainer: {
61
60
  borderTopLeftRadius: 4,
62
61
  borderBottomLeftRadius: 4,
63
- backgroundColor: Colors.pink_05_b,
62
+ backgroundColor: Colors.pink_03,
64
63
  },
65
64
  dayEndContainer: {
66
65
  borderTopRightRadius: 4,
67
66
  borderBottomRightRadius: 4,
68
- backgroundColor: Colors.pink_05_b,
67
+ backgroundColor: Colors.pink_03,
69
68
  },
70
69
  mid: {
71
- backgroundColor: Colors.pink_10,
70
+ backgroundColor: Colors.pink_09,
72
71
  // height: heightDefault
73
72
  },
74
73
  departLabel: {
@@ -1,7 +1,7 @@
1
1
  import React, { useState, forwardRef, useImperativeHandle } from 'react';
2
2
  import { View, TouchableOpacity, StyleSheet } from 'react-native';
3
3
  import moment from 'moment';
4
- import { Icon, ScaleSize, Text, Colors, Spacing } from '@momo-kits/core';
4
+ import { Icon, ScaleSize, Text, Colors, Spacing } from '@momo-kits/core-v2';
5
5
 
6
6
  import Util from './Util';
7
7
 
@@ -34,9 +34,11 @@ const HeaderControl = forwardRef(
34
34
  style={styles.icon}
35
35
  />
36
36
  </TouchableOpacity>
37
- <Text.Title style={styles.txtHeader}>
37
+ <Text.HeaderText2
38
+ weight="semibold"
39
+ style={styles.txtHeader}>
38
40
  {headerFormat}
39
- </Text.Title>
41
+ </Text.HeaderText2>
40
42
  <TouchableOpacity
41
43
  style={styles.btnRight}
42
44
  onPress={onPressNextArrow}>
@@ -58,7 +60,6 @@ const styles = StyleSheet.create({
58
60
  icon: { width: 24, height: 24, resizeMode: 'contain' },
59
61
  txtHeader: {
60
62
  // fontSize: 15,
61
- fontWeight: 'bold',
62
63
  textAlign: 'center',
63
64
  },
64
65
  btnRight: {
@@ -77,7 +78,7 @@ const styles = StyleSheet.create({
77
78
  height: ScaleSize(44),
78
79
  flexDirection: 'row',
79
80
  justifyContent: 'space-between',
80
- backgroundColor: Colors.blue_11,
81
+ backgroundColor: Colors.blue_10,
81
82
  alignItems: 'center',
82
83
  borderRadius: 4,
83
84
  },
@@ -3,7 +3,7 @@ import React, { PureComponent } from 'react';
3
3
  import { View, Dimensions } from 'react-native';
4
4
  import moment from 'moment';
5
5
  import Day from '../Day';
6
- import { Spacing, ScaleSize } from '@momo-kits/core';
6
+ import { Spacing, ScaleSize } from '@momo-kits/core-v2';
7
7
 
8
8
  const { width } = Dimensions.get('window');
9
9
 
package/src/MonthList.js CHANGED
@@ -5,7 +5,7 @@ import moment from 'moment';
5
5
  import Month from './Month';
6
6
  import style from './Day/style';
7
7
  import LunarDateConverter from './LunarDateConverter';
8
- import { ScaleSize } from '@momo-kits/core';
8
+ import { ScaleSize } from '@momo-kits/core-v2';
9
9
 
10
10
  const ITEM_WIDTH = Dimensions.get('window').width - ScaleSize(24);
11
11
  const MAX_RENDER_PER_BATCH = Platform.OS === 'android' ? 1 : 12;
package/src/TabHeader.js CHANGED
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { TouchableWithoutFeedback, View } from 'react-native';
3
3
  import Moment from 'moment';
4
4
  import Util from './Util';
5
- import { Colors, Text } from '@momo-kits/core';
5
+ import { Colors, Text } from '@momo-kits/core-v2';
6
6
 
7
7
  export default class TabHeader extends React.Component {
8
8
  constructor(props) {
@@ -55,26 +55,23 @@ export default class TabHeader extends React.Component {
55
55
  flex: 1,
56
56
  backgroundColor: Colors.white,
57
57
  }}>
58
- <Text.SubTitle
58
+ <Text.Description2
59
59
  style={{
60
60
  fontSize: 12,
61
61
  lineHeight: 16,
62
- color: Colors.black_09,
62
+ color: Colors.black_12,
63
63
  }}>
64
64
  {label}
65
- </Text.SubTitle>
66
- <Text.Title
67
- weight={active ? 'bold' : 'regular'}
68
- style={{
69
- marginTop: 3,
70
- }}>
65
+ </Text.Description2>
66
+ <Text.Description1
67
+ style={{ fontWeight: active ? '600' : '400' }}>
71
68
  {`${
72
69
  dayOfWeekFromState || dayOfWeekFromDefault || '--'
73
70
  } `}
74
71
  {formattedDateFromState ||
75
72
  formattedDateFromDefault ||
76
73
  '--/--/----'}
77
- </Text.Title>
74
+ </Text.Description1>
78
75
  </View>
79
76
  </TouchableWithoutFeedback>
80
77
  );
@@ -1,6 +1,4 @@
1
- import {
2
- SwitchLanguage
3
- } from '@momo-kits/core';
1
+ import { SwitchLanguage } from '@momo-kits/core-v2';
4
2
 
5
3
  module.exports = {
6
4
  solar: {
@@ -8,77 +6,77 @@ module.exports = {
8
6
  {
9
7
  day: 1,
10
8
  month: 1,
11
- label: SwitchLanguage.newYear
12
- }
9
+ label: SwitchLanguage.newYear,
10
+ },
13
11
  ],
14
12
  2: [
15
13
  {
16
14
  day: 14,
17
15
  month: 2,
18
- label: SwitchLanguage.valentine
19
- }
16
+ label: SwitchLanguage.valentine,
17
+ },
20
18
  ],
21
19
  3: [
22
20
  {
23
21
  day: 8,
24
22
  month: 3,
25
- label: SwitchLanguage.womenDay
26
- }
23
+ label: SwitchLanguage.womenDay,
24
+ },
27
25
  ],
28
26
  4: [
29
27
  {
30
28
  day: 30,
31
29
  month: 4,
32
- label: SwitchLanguage.liberationDay
33
- }
30
+ label: SwitchLanguage.liberationDay,
31
+ },
34
32
  ],
35
33
  5: [
36
34
  {
37
35
  day: 1,
38
36
  month: 5,
39
- label: SwitchLanguage.laborDay
40
- }
37
+ label: SwitchLanguage.laborDay,
38
+ },
41
39
  ],
42
40
  6: [
43
41
  {
44
42
  day: 1,
45
43
  month: 6,
46
- label: SwitchLanguage.childrenDay
47
- }
44
+ label: SwitchLanguage.childrenDay,
45
+ },
48
46
  ],
49
47
  9: [
50
48
  {
51
49
  day: 2,
52
50
  month: 9,
53
- label: SwitchLanguage.nationalDay
54
- }
51
+ label: SwitchLanguage.nationalDay,
52
+ },
55
53
  ],
56
54
  10: [
57
55
  {
58
56
  day: 20,
59
57
  month: 10,
60
- label: SwitchLanguage.womenDayVN
61
- }
58
+ label: SwitchLanguage.womenDayVN,
59
+ },
62
60
  ],
63
61
  11: [
64
62
  {
65
63
  day: 20,
66
64
  month: 11,
67
- label: SwitchLanguage.teacherDay
68
- }
65
+ label: SwitchLanguage.teacherDay,
66
+ },
69
67
  ],
70
68
  12: [
71
69
  {
72
70
  day: 24,
73
71
  month: 12,
74
- label: SwitchLanguage.christmasEve
72
+ label: SwitchLanguage.christmasEve,
75
73
  },
76
74
  {
77
75
  day: 25,
78
76
  month: 12,
79
- label: SwitchLanguage.christmas
80
- }
81
- ]
77
+ label: SwitchLanguage.christmas,
78
+ },
79
+ ],
82
80
  },
83
81
  lunar: [
84
82
  {
@@ -86,42 +84,42 @@ module.exports = {
86
84
  lunarMonth: 12,
87
85
  lunar: true,
88
86
  label: SwitchLanguage.lunarNewYear,
89
- highlight: '(30/12)'
87
+ highlight: '(30/12)',
90
88
  },
91
89
  {
92
90
  lunarDay: 1,
93
91
  lunarMonth: 1,
94
92
  lunar: true,
95
93
  label: SwitchLanguage.lunarNewYear,
96
- highlight: '(1/1)'
94
+ highlight: '(1/1)',
97
95
  },
98
96
  {
99
97
  lunarDay: 2,
100
98
  lunarMonth: 1,
101
99
  lunar: true,
102
100
  label: SwitchLanguage.lunarNewYear,
103
- highlight: '(2/1)'
101
+ highlight: '(2/1)',
104
102
  },
105
103
  {
106
104
  lunarDay: 3,
107
105
  lunarMonth: 1,
108
106
  lunar: true,
109
107
  label: SwitchLanguage.lunarNewYear,
110
- highlight: '(3/1)'
108
+ highlight: '(3/1)',
111
109
  },
112
110
  {
113
111
  lunarDay: 4,
114
112
  lunarMonth: 1,
115
113
  lunar: true,
116
114
  label: SwitchLanguage.lunarNewYear,
117
- highlight: '(4/1)'
115
+ highlight: '(4/1)',
118
116
  },
119
117
  {
120
118
  lunarDay: 10,
121
119
  lunarMonth: 3,
122
120
  lunar: true,
123
121
  label: SwitchLanguage.hungKingDay,
124
- highlight: '(10/3)'
125
- }
126
- ]
122
+ highlight: '(10/3)',
123
+ },
124
+ ],
127
125
  };