react-native-hilal 0.1.0 → 0.3.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 (62) hide show
  1. package/README.md +165 -49
  2. package/lib/module/calendar/Appear.js +75 -0
  3. package/lib/module/calendar/Appear.js.map +1 -0
  4. package/lib/module/calendar/DayCell.js +32 -5
  5. package/lib/module/calendar/DayCell.js.map +1 -1
  6. package/lib/module/calendar/HilalCalendar.js +434 -76
  7. package/lib/module/calendar/HilalCalendar.js.map +1 -1
  8. package/lib/module/calendar/PickerGrid.js +66 -0
  9. package/lib/module/calendar/PickerGrid.js.map +1 -0
  10. package/lib/module/calendar/month.js +135 -22
  11. package/lib/module/calendar/month.js.map +1 -1
  12. package/lib/module/calendar/range.js +103 -0
  13. package/lib/module/calendar/range.js.map +1 -0
  14. package/lib/module/calendar/styles.js +233 -7
  15. package/lib/module/calendar/styles.js.map +1 -1
  16. package/lib/module/calendar/theme.js +3 -3
  17. package/lib/module/calendar/theme.js.map +1 -1
  18. package/lib/module/core/convert.js +52 -21
  19. package/lib/module/core/convert.js.map +1 -1
  20. package/lib/module/core/index.js.map +1 -1
  21. package/lib/module/core/locale.js +5 -2
  22. package/lib/module/core/locale.js.map +1 -1
  23. package/lib/typescript/src/calendar/Appear.d.ts +22 -0
  24. package/lib/typescript/src/calendar/Appear.d.ts.map +1 -0
  25. package/lib/typescript/src/calendar/DayCell.d.ts +8 -1
  26. package/lib/typescript/src/calendar/DayCell.d.ts.map +1 -1
  27. package/lib/typescript/src/calendar/HilalCalendar.d.ts +1 -1
  28. package/lib/typescript/src/calendar/HilalCalendar.d.ts.map +1 -1
  29. package/lib/typescript/src/calendar/PickerGrid.d.ts +28 -0
  30. package/lib/typescript/src/calendar/PickerGrid.d.ts.map +1 -0
  31. package/lib/typescript/src/calendar/index.d.ts +1 -1
  32. package/lib/typescript/src/calendar/index.d.ts.map +1 -1
  33. package/lib/typescript/src/calendar/month.d.ts +30 -7
  34. package/lib/typescript/src/calendar/month.d.ts.map +1 -1
  35. package/lib/typescript/src/calendar/range.d.ts +39 -0
  36. package/lib/typescript/src/calendar/range.d.ts.map +1 -0
  37. package/lib/typescript/src/calendar/styles.d.ts +207 -113
  38. package/lib/typescript/src/calendar/styles.d.ts.map +1 -1
  39. package/lib/typescript/src/calendar/theme.d.ts +21 -1
  40. package/lib/typescript/src/calendar/theme.d.ts.map +1 -1
  41. package/lib/typescript/src/calendar/types.d.ts +153 -2
  42. package/lib/typescript/src/calendar/types.d.ts.map +1 -1
  43. package/lib/typescript/src/core/convert.d.ts +38 -15
  44. package/lib/typescript/src/core/convert.d.ts.map +1 -1
  45. package/lib/typescript/src/core/index.d.ts +1 -1
  46. package/lib/typescript/src/core/index.d.ts.map +1 -1
  47. package/lib/typescript/src/core/locale.d.ts +1 -1
  48. package/lib/typescript/src/core/locale.d.ts.map +1 -1
  49. package/package.json +1 -1
  50. package/src/calendar/Appear.tsx +94 -0
  51. package/src/calendar/DayCell.tsx +41 -1
  52. package/src/calendar/HilalCalendar.tsx +541 -85
  53. package/src/calendar/PickerGrid.tsx +99 -0
  54. package/src/calendar/index.ts +8 -1
  55. package/src/calendar/month.ts +174 -23
  56. package/src/calendar/range.ts +114 -0
  57. package/src/calendar/styles.ts +249 -6
  58. package/src/calendar/theme.ts +23 -3
  59. package/src/calendar/types.ts +156 -2
  60. package/src/core/convert.ts +87 -23
  61. package/src/core/index.ts +1 -0
  62. package/src/core/locale.ts +4 -1
@@ -1,11 +1,175 @@
1
1
  import { StyleSheet } from 'react-native';
2
2
 
3
3
  import type { HilalTheme } from './theme';
4
+ import type { HilalStyles } from './types';
5
+
6
+ /** Fills the parent; left/right are both 0, so RTL mirroring can't move it. */
7
+ const fill = {
8
+ bottom: 0,
9
+ left: 0,
10
+ position: 'absolute',
11
+ right: 0,
12
+ top: 0,
13
+ } as const;
4
14
 
5
15
  export type CalendarStyles = ReturnType<typeof createStyles>;
6
16
 
17
+ /** Space above and below each day cell. */
18
+ const SLOT_PADDING_VERTICAL = 2;
19
+
20
+ /**
21
+ * How far the phone's text size setting may grow the text of day cells,
22
+ * weekday names and picker buttons, which have a fixed size: up to 1.3 a
23
+ * day number and the date under it still fit a 48 pt cell.
24
+ */
25
+ export const MAX_CELL_FONT_SCALE = 1.3;
26
+ /** The same for the header and the toggle, which have room to grow. */
27
+ export const MAX_HEADER_FONT_SCALE = 2;
28
+
29
+ /** The text styles, which take the theme's fonts and font scale. */
30
+ const TEXT_STYLES = [
31
+ 'toggleText',
32
+ 'title',
33
+ 'subtitle',
34
+ 'weekday',
35
+ 'dayText',
36
+ 'secondaryText',
37
+ 'pickerText',
38
+ // Only a weight, for the bold font.
39
+ 'selectedText',
40
+ 'todayText',
41
+ ] as const;
42
+
43
+ /** Text in columns of a fixed width: shrinks with the font scale only. */
44
+ const FIXED_WIDTH_TEXT = new Set<string>(['weekday', 'pickerText']);
45
+
46
+ type TextStyleObject = {
47
+ fontSize?: number;
48
+ lineHeight?: number;
49
+ fontWeight?: string;
50
+ fontFamily?: string;
51
+ };
52
+
7
53
  export function createStyles(theme: HilalTheme) {
8
- return StyleSheet.create({
54
+ return StyleSheet.create(applyFonts(baseStyles(theme), theme));
55
+ }
56
+
57
+ /**
58
+ * Applies `fontFamily`, `fontFamilyBold` and `fontScale`. Only adds keys
59
+ * when the theme sets them, so a theme without fonts gives exactly the
60
+ * base styles.
61
+ */
62
+ function applyFonts<T extends Record<string, object>>(
63
+ styles: T,
64
+ theme: HilalTheme
65
+ ): T {
66
+ const scale = theme.fontScale ?? 1;
67
+ if (!(Number.isFinite(scale) && scale > 0)) {
68
+ throw new RangeError(
69
+ `HilalCalendar: theme.fontScale must be a positive number, got ${scale}`
70
+ );
71
+ }
72
+ const { fontFamily, fontFamilyBold } = theme;
73
+ if (scale === 1 && !fontFamily && !fontFamilyBold) {
74
+ return styles;
75
+ }
76
+ const out: Record<string, object> = { ...styles };
77
+ for (const key of TEXT_STYLES) {
78
+ const style = { ...(styles[key] as TextStyleObject) };
79
+ // Weekday names (أربعاء خميس) only just fit seven columns on small
80
+ // phones, and long month names (Dhu al-Qi'dah) three, so these never
81
+ // grow.
82
+ const factor = FIXED_WIDTH_TEXT.has(key) ? Math.min(scale, 1) : scale;
83
+ if (factor !== 1) {
84
+ if (style.fontSize) style.fontSize = round(style.fontSize * factor);
85
+ if (style.lineHeight) style.lineHeight = round(style.lineHeight * factor);
86
+ }
87
+ const bold = style.fontWeight === '600' || style.fontWeight === '700';
88
+ if (bold && fontFamilyBold) {
89
+ // A bold font file plus a bold weight would be bolded twice.
90
+ style.fontFamily = fontFamilyBold;
91
+ style.fontWeight = 'normal';
92
+ } else if (fontFamily) {
93
+ style.fontFamily = fontFamily;
94
+ }
95
+ out[key] = style;
96
+ }
97
+ if (scale > 1) {
98
+ // Larger text needs larger day cells.
99
+ const day = styles.day as { height: number; maxWidth: number };
100
+ out.day = {
101
+ ...day,
102
+ height: round(day.height * scale),
103
+ maxWidth: round(day.maxWidth * scale),
104
+ };
105
+ }
106
+ return out as T;
107
+ }
108
+
109
+ const round = (n: number) => Math.round(n * 10) / 10;
110
+
111
+ /** The calendar style each `styles` slot is merged into. */
112
+ const SLOTS = {
113
+ container: 'container',
114
+ toggle: 'toggle',
115
+ toggleOption: 'toggleOption',
116
+ toggleText: 'toggleText',
117
+ header: 'header',
118
+ title: 'title',
119
+ subtitle: 'subtitle',
120
+ arrow: 'arrow',
121
+ weekdayText: 'weekday',
122
+ day: 'day',
123
+ dayText: 'dayText',
124
+ secondaryDayText: 'secondaryText',
125
+ pickerItem: 'pickerItem',
126
+ pickerText: 'pickerText',
127
+ rangeBand: 'rangeBand',
128
+ } as const;
129
+
130
+ /**
131
+ * The slots for day states. The picker shares these calendar styles, so
132
+ * they are merged into a copy used only by the day cells.
133
+ */
134
+ const DAY_SLOTS = {
135
+ selectedDay: 'selected',
136
+ selectedDayText: 'selectedText',
137
+ today: 'today',
138
+ disabledDayText: 'disabledText',
139
+ todayDayText: 'todayText',
140
+ } as const;
141
+
142
+ /**
143
+ * Merges the `styles` prop over the calendar styles: `styles` for the
144
+ * calendar and the picker, `dayStyles` for the day cells. Slots that are
145
+ * not set leave the calendar styles as they are.
146
+ */
147
+ export function withSlots(
148
+ styles: CalendarStyles,
149
+ slots: HilalStyles | undefined
150
+ ): { styles: CalendarStyles; dayStyles: CalendarStyles } {
151
+ if (!slots) {
152
+ return { styles, dayStyles: styles };
153
+ }
154
+ const merge = (
155
+ target: CalendarStyles,
156
+ map: Record<string, keyof CalendarStyles>
157
+ ) => {
158
+ const out: Record<string, unknown> = { ...target };
159
+ for (const [slot, key] of Object.entries(map)) {
160
+ const style = slots[slot as keyof HilalStyles];
161
+ if (style) {
162
+ out[key] = StyleSheet.flatten([target[key], style]);
163
+ }
164
+ }
165
+ return out as CalendarStyles;
166
+ };
167
+ const merged = merge(styles, SLOTS);
168
+ return { styles: merged, dayStyles: merge(merged, DAY_SLOTS) };
169
+ }
170
+
171
+ function baseStyles(theme: HilalTheme) {
172
+ return {
9
173
  container: {
10
174
  backgroundColor: theme.background,
11
175
  borderRadius: 20,
@@ -64,7 +228,7 @@ export function createStyles(theme: HilalTheme) {
64
228
  backgroundColor: theme.border,
65
229
  },
66
230
  weekdays: {
67
- marginBottom: 4,
231
+ marginBottom: 8,
68
232
  },
69
233
  weekday: {
70
234
  color: theme.textSecondary,
@@ -81,7 +245,16 @@ export function createStyles(theme: HilalTheme) {
81
245
  // than 7 full-size cells, so today's ring never touches the
82
246
  // selected day.
83
247
  paddingHorizontal: 3,
84
- paddingVertical: 2,
248
+ paddingVertical: SLOT_PADDING_VERTICAL,
249
+ },
250
+ // The band behind a range: as tall as a day, across the whole slot so
251
+ // neighbouring days join. A layer with opacity, so any color works.
252
+ rangeBand: {
253
+ backgroundColor: theme.primary,
254
+ bottom: SLOT_PADDING_VERTICAL,
255
+ opacity: 0.15,
256
+ position: 'absolute',
257
+ top: SLOT_PADDING_VERTICAL,
85
258
  },
86
259
  day: {
87
260
  alignItems: 'center',
@@ -103,18 +276,27 @@ export function createStyles(theme: HilalTheme) {
103
276
  pressed: {
104
277
  backgroundColor: theme.border,
105
278
  },
279
+ // Medium, so the selected day and today stand out in bold. Fixed line
280
+ // heights: fonts with tall lines (Noto Naskh, many custom fonts) would
281
+ // otherwise push the date under the number to the next row.
106
282
  dayText: {
107
283
  color: theme.text,
108
284
  fontSize: 16,
109
- fontWeight: '600',
285
+ fontWeight: '500',
286
+ lineHeight: 20,
110
287
  },
111
288
  secondaryText: {
112
289
  color: theme.textSecondary,
113
- fontSize: 10,
290
+ fontSize: 11,
291
+ lineHeight: 14,
114
292
  marginTop: 1,
115
293
  },
116
294
  selectedText: {
117
295
  color: theme.onPrimary,
296
+ fontWeight: '700',
297
+ },
298
+ todayText: {
299
+ fontWeight: '700',
118
300
  },
119
301
  selectedSecondaryText: {
120
302
  color: theme.onPrimary,
@@ -123,5 +305,66 @@ export function createStyles(theme: HilalTheme) {
123
305
  disabledText: {
124
306
  color: theme.disabled,
125
307
  },
126
- });
308
+ // Month and year picker.
309
+ titleButton: {
310
+ alignItems: 'center',
311
+ borderRadius: 10,
312
+ overflow: 'hidden',
313
+ paddingHorizontal: 10,
314
+ paddingVertical: 2,
315
+ },
316
+ // The title inside the button: centered and shrinkable when a long
317
+ // name wraps on a narrow phone.
318
+ titleInButton: {
319
+ flexShrink: 1,
320
+ textAlign: 'center',
321
+ },
322
+ // The title of the year picker, which is not a button.
323
+ titleStatic: {
324
+ paddingVertical: 2,
325
+ },
326
+ titleButtonPressed: {
327
+ backgroundColor: theme.border,
328
+ },
329
+ // Tints are layers with opacity, so any theme color format works.
330
+ titleTint: {
331
+ ...fill,
332
+ backgroundColor: theme.primary,
333
+ opacity: 0.1,
334
+ },
335
+ picker: {
336
+ marginTop: 4,
337
+ },
338
+ pickerSlot: {
339
+ flex: 1,
340
+ padding: 3,
341
+ },
342
+ pickerItem: {
343
+ alignItems: 'center',
344
+ borderColor: 'transparent',
345
+ borderRadius: theme.radius,
346
+ borderWidth: 1.5,
347
+ justifyContent: 'center',
348
+ minHeight: 52,
349
+ overflow: 'hidden',
350
+ paddingHorizontal: 4,
351
+ paddingVertical: 6,
352
+ },
353
+ // Grows into the free height of its parent.
354
+ grow: {
355
+ flexGrow: 1,
356
+ },
357
+ pickerItemTint: {
358
+ ...fill,
359
+ backgroundColor: theme.text,
360
+ opacity: 0.05,
361
+ },
362
+ pickerText: {
363
+ color: theme.text,
364
+ fontSize: 14,
365
+ fontWeight: '600',
366
+ lineHeight: 18,
367
+ textAlign: 'center',
368
+ },
369
+ } as const;
127
370
  }
@@ -1,4 +1,4 @@
1
- /** Colors and shape of the calendar. */
1
+ /** Colors, fonts and shape of the calendar. */
2
2
  export type HilalTheme = {
3
3
  /** Calendar background. */
4
4
  background: string;
@@ -18,6 +18,26 @@ export type HilalTheme = {
18
18
  border: string;
19
19
  /** Corner radius of a day cell. */
20
20
  radius: number;
21
+ /** Month arrows. Default: `text`. */
22
+ arrow?: string;
23
+ /**
24
+ * Font of all text, for example 'Cairo-Regular'. Default: the system
25
+ * font.
26
+ */
27
+ fontFamily?: string;
28
+ /**
29
+ * Font of the bold text (month title, selected day and today, toggle,
30
+ * weekdays, picker), for example 'Cairo-Bold'. When set, it is used as is,
31
+ * without a fontWeight on top. Default: `fontFamily` with a bold weight.
32
+ */
33
+ fontFamilyBold?: string;
34
+ /**
35
+ * Multiplies every font size, for example 1.15 for larger text. Day
36
+ * cells grow with it. Weekday names and the picker's month and year
37
+ * names shrink with it but never grow, so they still fit their columns
38
+ * on small phones. Default 1.
39
+ */
40
+ fontScale?: number;
21
41
  };
22
42
 
23
43
  export type ThemeProp = 'light' | 'dark' | 'auto' | Partial<HilalTheme>;
@@ -29,7 +49,7 @@ export const lightTheme: HilalTheme = {
29
49
  primary: '#0F766E',
30
50
  onPrimary: '#FFFFFF',
31
51
  today: '#0F766E',
32
- disabled: '#C5CAD1',
52
+ disabled: '#9EA5AF',
33
53
  border: '#E3E6EA',
34
54
  radius: 12,
35
55
  };
@@ -41,7 +61,7 @@ export const darkTheme: HilalTheme = {
41
61
  primary: '#2DD4BF',
42
62
  onPrimary: '#042F2C',
43
63
  today: '#2DD4BF',
44
- disabled: '#4A525C',
64
+ disabled: '#56606B',
45
65
  border: '#2A3038',
46
66
  radius: 12,
47
67
  };
@@ -1,4 +1,4 @@
1
- import type { StyleProp, ViewStyle } from 'react-native';
1
+ import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
2
2
 
3
3
  import type { CalendarType, Digits, Locale } from '../core/locale';
4
4
  import type { HijriDate } from '../core/types';
@@ -13,6 +13,98 @@ export type SelectedDate = {
13
13
  formatted: { gregorian: string; hijri: string };
14
14
  };
15
15
 
16
+ /** A range of days picked in the calendar (`selectionMode="range"`). */
17
+ export type SelectedRange = {
18
+ start: SelectedDate;
19
+ /** Null while only the start is picked. */
20
+ end: SelectedDate | null;
21
+ /** Days in the range, both ends included, or null while `end` is null. */
22
+ days: number | null;
23
+ };
24
+
25
+ /** A range to show as picked. Leave `end` out while only the start is picked. */
26
+ export type DateRange = { start: Date; end?: Date | null };
27
+
28
+ type ViewSlot = StyleProp<ViewStyle>;
29
+ type TextSlot = StyleProp<TextStyle>;
30
+
31
+ /**
32
+ * Styles for parts of the calendar, merged over the theme's styles. Each
33
+ * is optional.
34
+ */
35
+ export type HilalStyles = {
36
+ /** The outer container (the same as the `style` prop). */
37
+ container?: ViewSlot;
38
+ /** The Hijri / Gregorian toggle. */
39
+ toggle?: ViewSlot;
40
+ /** Each option of the toggle. */
41
+ toggleOption?: ViewSlot;
42
+ toggleText?: TextSlot;
43
+ /** The row of arrows and titles. */
44
+ header?: ViewSlot;
45
+ /** The month title. */
46
+ title?: TextSlot;
47
+ /** The other calendar's months under the title. */
48
+ subtitle?: TextSlot;
49
+ /** Each arrow button. */
50
+ arrow?: ViewSlot;
51
+ /** Each weekday name. */
52
+ weekdayText?: TextSlot;
53
+ /** Each day cell (the pressable circle). */
54
+ day?: ViewSlot;
55
+ /** The day number. */
56
+ dayText?: TextSlot;
57
+ /** The other calendar's day under the day number. */
58
+ secondaryDayText?: TextSlot;
59
+ /** The selected day cell. */
60
+ selectedDay?: ViewSlot;
61
+ /** The selected day's number. */
62
+ selectedDayText?: TextSlot;
63
+ /** Today's day cell. */
64
+ today?: ViewSlot;
65
+ /** Today's day number, bold by default. */
66
+ todayDayText?: TextSlot;
67
+ /** Both texts of a disabled day. */
68
+ disabledDayText?: TextSlot;
69
+ /** The band behind the days of a picked range. */
70
+ rangeBand?: ViewSlot;
71
+ /** Each month or year in the month and year picker. */
72
+ pickerItem?: ViewSlot;
73
+ pickerText?: TextSlot;
74
+ };
75
+
76
+ /**
77
+ * Texts of the calendar's buttons, read by screen readers too. Each is
78
+ * optional; the rest come from the locale.
79
+ */
80
+ export type HilalLabels = {
81
+ /** The toggle's Hijri option. */
82
+ hijri?: string;
83
+ /** The toggle's Gregorian option. */
84
+ gregorian?: string;
85
+ /** Read by screen readers after today's date. */
86
+ today?: string;
87
+ /** Read after the first day of a picked range. */
88
+ rangeStart?: string;
89
+ /** Read after the last day of a picked range. */
90
+ rangeEnd?: string;
91
+ /** Read after the current month in the month picker. */
92
+ thisMonth?: string;
93
+ /** Read after the current year in the year picker. */
94
+ thisYear?: string;
95
+ /** Arrows, read by screen readers. */
96
+ previousMonth?: string;
97
+ nextMonth?: string;
98
+ previousYear?: string;
99
+ nextYear?: string;
100
+ previousYears?: string;
101
+ nextYears?: string;
102
+ /** The month title button, read by screen readers before the title. */
103
+ chooseMonth?: string;
104
+ /** The year title button in the month picker. */
105
+ chooseYear?: string;
106
+ };
107
+
16
108
  export type HilalCalendarProps = {
17
109
  /** Selected day (controlled). Only the local calendar day is used. */
18
110
  value?: Date;
@@ -21,6 +113,35 @@ export type HilalCalendarProps = {
21
113
  /** Called when the user picks a day. */
22
114
  onChange?: (date: SelectedDate) => void;
23
115
 
116
+ /**
117
+ * 'single' (default) picks one day. 'range' picks a start and an end:
118
+ * the first press picks the start, the second the end, and a third
119
+ * starts over. A range never crosses a disabled day. In range mode,
120
+ * `value`, `defaultValue` and `onChange` are not used.
121
+ */
122
+ selectionMode?: 'single' | 'range';
123
+ /**
124
+ * Picked range (controlled), with `selectionMode="range"`. `null` shows
125
+ * no range.
126
+ */
127
+ rangeValue?: DateRange | null;
128
+ /** Initially picked range (uncontrolled), with `selectionMode="range"`. */
129
+ defaultRangeValue?: DateRange;
130
+ /** Called when the user changes the range, after each press. */
131
+ onRangeChange?: (range: SelectedRange) => void;
132
+ /**
133
+ * Fewest days a range may have, both ends included (so 3 nights are 4
134
+ * days). After the start is picked, days that would make the range
135
+ * shorter can't be pressed. Default 1.
136
+ */
137
+ minRangeDays?: number;
138
+ /**
139
+ * Most days a range may have, both ends included. After the start is
140
+ * picked, days that would make the range longer can't be pressed.
141
+ * Default: no limit.
142
+ */
143
+ maxRangeDays?: number;
144
+
24
145
  /** Calendar of the month grid. Default 'hijri'. */
25
146
  calendar?: CalendarType;
26
147
  /** Called when the user switches calendars with the toggle. */
@@ -41,6 +162,11 @@ export type HilalCalendarProps = {
41
162
  direction?: 'rtl' | 'ltr' | 'auto';
42
163
  /** 0 = Sunday (default), 1 = Monday, 6 = Saturday. */
43
164
  firstDayOfWeek?: 0 | 1 | 6;
165
+ /**
166
+ * Weekday names above the days: 'short' (default, أحد / Sun) or
167
+ * 'narrow' (ح / S). Full names don't fit seven columns on a phone.
168
+ */
169
+ weekdayFormat?: 'short' | 'narrow';
44
170
 
45
171
  /** Earliest selectable day. */
46
172
  minDate?: Date;
@@ -49,13 +175,41 @@ export type HilalCalendarProps = {
49
175
  /** Return true to disable a day. */
50
176
  isDateDisabled?: (date: SelectedDate) => boolean;
51
177
 
178
+ /**
179
+ * Shift the Hijri calendar by whole days, from -2 to 2, for places where
180
+ * the month started before or after Umm al-Qura. `1` makes every Hijri
181
+ * date one day later. Gregorian dates never change. Default 0.
182
+ */
183
+ hijriAdjustment?: number;
184
+ /**
185
+ * Pressing the month title opens a grid of months, and from there a
186
+ * grid of years, to jump far without paging month by month. Default
187
+ * true.
188
+ */
189
+ showMonthYearPicker?: boolean;
190
+
52
191
  /**
53
192
  * 'light', 'dark', 'auto' (default, follows the system color scheme),
54
193
  * or a partial theme merged over the 'auto' theme.
55
194
  */
56
195
  theme?: ThemeProp;
196
+ /** Texts of the toggle and buttons, see `HilalLabels`. */
197
+ labels?: HilalLabels;
198
+ /** Styles for parts of the calendar, see `HilalStyles`. */
199
+ styles?: HilalStyles;
57
200
  /** Style of the outer container. */
58
201
  style?: StyleProp<ViewStyle>;
59
- /** Style of every day cell (the pressable circle). */
202
+ /**
203
+ * Style of every day cell (the pressable circle). Unlike `styles.day`,
204
+ * it also wins over the selected and today styles.
205
+ */
60
206
  dayStyle?: StyleProp<ViewStyle>;
207
+ /**
208
+ * How far the phone's text size setting may grow the calendar's text,
209
+ * like React Native's prop of the same name: `1` turns it off, `0`
210
+ * removes the limit. By default, text in day cells, weekday names and
211
+ * picker buttons grows up to 1.3 times (as far as it fits a cell), and
212
+ * the header and toggle up to 2 times.
213
+ */
214
+ maxFontSizeMultiplier?: number;
61
215
  };