react-native-hilal 0.0.0-stage → 0.1.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 (85) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +221 -2
  3. package/lib/module/calendar/Chevron.js +60 -0
  4. package/lib/module/calendar/Chevron.js.map +1 -0
  5. package/lib/module/calendar/DayCell.js +48 -0
  6. package/lib/module/calendar/DayCell.js.map +1 -0
  7. package/lib/module/calendar/HilalCalendar.js +288 -0
  8. package/lib/module/calendar/HilalCalendar.js.map +1 -0
  9. package/lib/module/calendar/index.js +5 -0
  10. package/lib/module/calendar/index.js.map +1 -0
  11. package/lib/module/calendar/month.js +178 -0
  12. package/lib/module/calendar/month.js.map +1 -0
  13. package/lib/module/calendar/styles.js +125 -0
  14. package/lib/module/calendar/styles.js.map +1 -0
  15. package/lib/module/calendar/theme.js +49 -0
  16. package/lib/module/calendar/theme.js.map +1 -0
  17. package/lib/module/calendar/types.js +4 -0
  18. package/lib/module/calendar/types.js.map +1 -0
  19. package/lib/module/core/convert.js +160 -0
  20. package/lib/module/core/convert.js.map +1 -0
  21. package/lib/module/core/days.js +61 -0
  22. package/lib/module/core/days.js.map +1 -0
  23. package/lib/module/core/format.js +37 -0
  24. package/lib/module/core/format.js.map +1 -0
  25. package/lib/module/core/index.js +6 -0
  26. package/lib/module/core/index.js.map +1 -0
  27. package/lib/module/core/locale.js +59 -0
  28. package/lib/module/core/locale.js.map +1 -0
  29. package/lib/module/core/types.js +2 -0
  30. package/lib/module/core/types.js.map +1 -0
  31. package/lib/module/core/umalqura-data.js +24 -0
  32. package/lib/module/core/umalqura-data.js.map +1 -0
  33. package/lib/module/index.js +5 -0
  34. package/lib/module/index.js.map +1 -0
  35. package/lib/module/package.json +1 -0
  36. package/lib/typescript/package.json +1 -0
  37. package/lib/typescript/src/calendar/Chevron.d.ts +13 -0
  38. package/lib/typescript/src/calendar/Chevron.d.ts.map +1 -0
  39. package/lib/typescript/src/calendar/DayCell.d.ts +22 -0
  40. package/lib/typescript/src/calendar/DayCell.d.ts.map +1 -0
  41. package/lib/typescript/src/calendar/HilalCalendar.d.ts +7 -0
  42. package/lib/typescript/src/calendar/HilalCalendar.d.ts.map +1 -0
  43. package/lib/typescript/src/calendar/index.d.ts +4 -0
  44. package/lib/typescript/src/calendar/index.d.ts.map +1 -0
  45. package/lib/typescript/src/calendar/month.d.ts +63 -0
  46. package/lib/typescript/src/calendar/month.d.ts.map +1 -0
  47. package/lib/typescript/src/calendar/styles.d.ts +119 -0
  48. package/lib/typescript/src/calendar/styles.d.ts.map +1 -0
  49. package/lib/typescript/src/calendar/theme.d.ts +31 -0
  50. package/lib/typescript/src/calendar/theme.d.ts.map +1 -0
  51. package/lib/typescript/src/calendar/types.d.ts +58 -0
  52. package/lib/typescript/src/calendar/types.d.ts.map +1 -0
  53. package/lib/typescript/src/core/convert.d.ts +54 -0
  54. package/lib/typescript/src/core/convert.d.ts.map +1 -0
  55. package/lib/typescript/src/core/days.d.ts +24 -0
  56. package/lib/typescript/src/core/days.d.ts.map +1 -0
  57. package/lib/typescript/src/core/format.d.ts +23 -0
  58. package/lib/typescript/src/core/format.d.ts.map +1 -0
  59. package/lib/typescript/src/core/index.d.ts +5 -0
  60. package/lib/typescript/src/core/index.d.ts.map +1 -0
  61. package/lib/typescript/src/core/locale.d.ts +21 -0
  62. package/lib/typescript/src/core/locale.d.ts.map +1 -0
  63. package/lib/typescript/src/core/types.d.ts +7 -0
  64. package/lib/typescript/src/core/types.d.ts.map +1 -0
  65. package/lib/typescript/src/core/umalqura-data.d.ts +15 -0
  66. package/lib/typescript/src/core/umalqura-data.d.ts.map +1 -0
  67. package/lib/typescript/src/index.d.ts +3 -0
  68. package/lib/typescript/src/index.d.ts.map +1 -0
  69. package/package.json +180 -4
  70. package/src/calendar/Chevron.tsx +55 -0
  71. package/src/calendar/DayCell.tsx +83 -0
  72. package/src/calendar/HilalCalendar.tsx +399 -0
  73. package/src/calendar/index.ts +8 -0
  74. package/src/calendar/month.ts +213 -0
  75. package/src/calendar/styles.ts +127 -0
  76. package/src/calendar/theme.ts +69 -0
  77. package/src/calendar/types.ts +61 -0
  78. package/src/core/convert.ts +192 -0
  79. package/src/core/days.ts +64 -0
  80. package/src/core/format.ts +65 -0
  81. package/src/core/index.ts +18 -0
  82. package/src/core/locale.ts +138 -0
  83. package/src/core/types.ts +6 -0
  84. package/src/core/umalqura-data.ts +34 -0
  85. package/src/index.tsx +2 -0
@@ -0,0 +1,23 @@
1
+ import { type Digits, type Locale } from './locale.js';
2
+ import type { CivilDate } from './days.js';
3
+ import type { HijriDate } from './types.js';
4
+ export type FormatHijriOptions = {
5
+ /** Default: 'ar'. */
6
+ locale?: Locale;
7
+ /** Default: 'arabic' when locale is 'ar', 'latin' otherwise. */
8
+ digits?: Digits;
9
+ };
10
+ /**
11
+ * Formats a Hijri date as "day month year era", for example
12
+ * "١ رمضان ١٤٤٦ هـ" or "1 Ramadan 1446 AH".
13
+ *
14
+ * @throws {RangeError} if `hijri` is not a valid date in the supported
15
+ * range.
16
+ */
17
+ export declare function formatHijri(hijri: HijriDate, options?: FormatHijriOptions): string;
18
+ /**
19
+ * Formats a Gregorian date as "day month year", for example
20
+ * "١١ مارس ٢٠٢٤" or "11 March 2024". Internal: used by the calendar.
21
+ */
22
+ export declare function formatGregorian(date: CivilDate, options?: FormatHijriOptions): string;
23
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/core/format.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,MAAM,EACX,KAAK,MAAM,EACZ,MAAM,aAAU,CAAC;AAClB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAS,CAAC;AAEzC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,qBAAqB;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAIF;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,SAAS,EAChB,OAAO,GAAE,kBAAuB,GAC/B,MAAM,CAgBR;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,SAAS,EACf,OAAO,GAAE,kBAAuB,GAC/B,MAAM,CASR"}
@@ -0,0 +1,5 @@
1
+ export { getHijriMonthLength, getSupportedRange, isValidHijri, toGregorian, toHijri, } from './convert.js';
2
+ export { formatHijri, type FormatHijriOptions } from './format.js';
3
+ export { getMonthNames, getWeekdayNames, toArabicDigits, type CalendarType, type Digits, type Locale, type WeekdayFormat, } from './locale.js';
4
+ export type { HijriDate } from './types.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,OAAO,GACR,MAAM,cAAW,CAAC;AACnB,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAU,CAAC;AAChE,OAAO,EACL,aAAa,EACb,eAAe,EACf,cAAc,EACd,KAAK,YAAY,EACjB,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,aAAa,GACnB,MAAM,aAAU,CAAC;AAClB,YAAY,EAAE,SAAS,EAAE,MAAM,YAAS,CAAC"}
@@ -0,0 +1,21 @@
1
+ export type Locale = 'ar' | 'en';
2
+ export type Digits = 'arabic' | 'latin';
3
+ export type CalendarType = 'hijri' | 'gregorian';
4
+ export type WeekdayFormat = 'short' | 'long';
5
+ /**
6
+ * The 12 month names of a calendar, January / Muharram first. Returns a
7
+ * new array on every call.
8
+ */
9
+ export declare function getMonthNames(calendar: CalendarType, locale: Locale): string[];
10
+ /**
11
+ * The 7 weekday names, Sunday first (index matches `Date#getDay()`).
12
+ * Returns a new array on every call.
13
+ */
14
+ export declare function getWeekdayNames(locale: Locale, format?: WeekdayFormat): string[];
15
+ /** Replaces the Latin digits 0-9 with Arabic-Indic digits (٠-٩). */
16
+ export declare function toArabicDigits(input: string | number): string;
17
+ /** The default digits for a locale: Arabic-Indic for 'ar', Latin otherwise. */
18
+ export declare function defaultDigits(locale: Locale): Digits;
19
+ /** Formats a number with the requested digits. */
20
+ export declare function formatNumber(value: number, digits: Digits): string;
21
+ //# sourceMappingURL=locale.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../../../src/core/locale.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;AACjC,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AACxC,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,WAAW,CAAC;AACjD,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AA8F7C;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,MAAM,GACb,MAAM,EAAE,CAGV;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,MAAM,GAAE,aAAsB,GAC7B,MAAM,EAAE,CAEV;AAID,oEAAoE;AACpE,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAI7D;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,kDAAkD;AAClD,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAElE"}
@@ -0,0 +1,7 @@
1
+ /** A date in the Umm al-Qura Hijri calendar. `month` is 1-12. */
2
+ export type HijriDate = {
3
+ year: number;
4
+ month: number;
5
+ day: number;
6
+ };
7
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/core/types.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb,CAAC"}
@@ -0,0 +1,15 @@
1
+ /** First Hijri year in the table. */
2
+ export declare const UMALQURA_MIN_YEAR = 1356;
3
+ /** Last Hijri year in the table. */
4
+ export declare const UMALQURA_MAX_YEAR = 1500;
5
+ /**
6
+ * Days since 1970-01-01 (in the proleptic Gregorian calendar) of
7
+ * 1 Muharram 1356.
8
+ */
9
+ export declare const UMALQURA_START_EPOCH_DAY = -11981;
10
+ /**
11
+ * One entry per Hijri year from 1356 to 1500. Bit (month - 1) is
12
+ * set when that month has 30 days and clear when it has 29.
13
+ */
14
+ export declare const UMALQURA_MONTH_LENGTH_MASKS: readonly number[];
15
+ //# sourceMappingURL=umalqura-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"umalqura-data.d.ts","sourceRoot":"","sources":["../../../../src/core/umalqura-data.ts"],"names":[],"mappings":"AAIA,qCAAqC;AACrC,eAAO,MAAM,iBAAiB,OAAO,CAAC;AAEtC,oCAAoC;AACpC,eAAO,MAAM,iBAAiB,OAAO,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,wBAAwB,SAAS,CAAC;AAE/C;;;GAGG;AACH,eAAO,MAAM,2BAA2B,EAAE,SAAS,MAAM,EAaxD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './core/index.js';
2
+ export * from './calendar/index.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,iBAAQ,CAAC;AACvB,cAAc,qBAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,182 @@
1
1
  {
2
2
  "name": "react-native-hilal",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Hijri (Umm al-Qura) and Gregorian date picker for React Native. Cross-platform, Expo Go ready, zero dependencies.",
5
+ "main": "./lib/module/index.js",
6
+ "types": "./lib/typescript/src/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "react-native-hilal-source": "./src/index.tsx",
10
+ "types": "./lib/typescript/src/index.d.ts",
11
+ "default": "./lib/module/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
15
+ "files": [
16
+ "src",
17
+ "lib",
18
+ "!**/__tests__",
19
+ "!**/__fixtures__",
20
+ "!**/__mocks__",
21
+ "!**/.*"
22
+ ],
23
+ "scripts": {
24
+ "example": "yarn workspace react-native-hilal-example",
25
+ "clean": "del-cli lib",
26
+ "prepare": "husky && bob build",
27
+ "typecheck": "tsc",
28
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
29
+ "test": "jest",
30
+ "release": "release-it",
31
+ "generate:umalqura": "node scripts/generate-umalqura-table.ts && prettier --write src/core/umalqura-data.ts"
32
+ },
33
+ "keywords": [
34
+ "react-native",
35
+ "hijri",
36
+ "umm-al-qura",
37
+ "calendar",
38
+ "date-picker",
39
+ "arabic",
40
+ "rtl",
41
+ "expo",
42
+ "islamic-calendar"
43
+ ],
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "git+https://github.com/2ve2/hilal.git"
47
+ },
48
+ "author": "2ve2 (https://github.com/2ve2)",
49
+ "license": "MIT",
50
+ "bugs": {
51
+ "url": "https://github.com/2ve2/hilal/issues"
52
+ },
53
+ "homepage": "https://github.com/2ve2/hilal#readme",
54
+ "publishConfig": {
55
+ "registry": "https://registry.npmjs.org/",
56
+ "access": "public"
57
+ },
58
+ "devDependencies": {
59
+ "@commitlint/cli": "^21.2.4",
60
+ "@commitlint/config-conventional": "^21.2.4",
61
+ "@eslint/compat": "^2.1.1",
62
+ "@eslint/eslintrc": "^3.3.7",
63
+ "@eslint/js": "^9.39.5",
64
+ "@jest/globals": "^29.7.0",
65
+ "@react-native/babel-preset": "0.88.0",
66
+ "@react-native/eslint-config": "0.88.0",
67
+ "@react-native/jest-preset": "0.88.0",
68
+ "@release-it/conventional-changelog": "^12.0.2",
69
+ "@testing-library/react-native": "^14.1.0",
70
+ "@types/node": "^24",
71
+ "@types/react": "^19.2.0",
72
+ "del-cli": "^8.0.1",
73
+ "eslint": "^9.39.5",
74
+ "eslint-config-prettier": "^10.1.8",
75
+ "eslint-plugin-ft-flow": "^3.0.11",
76
+ "eslint-plugin-prettier": "^5.5.7",
77
+ "husky": "^9.1.7",
78
+ "jest": "^29.7.0",
79
+ "lint-staged": "^17.6.0",
80
+ "prettier": "^3.9.10",
81
+ "react": "19.3.0",
82
+ "react-native": "0.88.0",
83
+ "react-native-builder-bob": "^0.44.1",
84
+ "release-it": "^21.1.1",
85
+ "test-renderer": "^1.3.1",
86
+ "typescript": "^6.0.3"
87
+ },
88
+ "peerDependencies": {
89
+ "react": "*",
90
+ "react-native": "*"
91
+ },
92
+ "workspaces": [
93
+ "example"
94
+ ],
95
+ "packageManager": "yarn@4.18.1",
96
+ "react-native-builder-bob": {
97
+ "source": "src",
98
+ "output": "lib",
99
+ "targets": [
100
+ [
101
+ "module",
102
+ {
103
+ "esm": true
104
+ }
105
+ ],
106
+ [
107
+ "typescript",
108
+ {
109
+ "project": "tsconfig.build.json"
110
+ }
111
+ ]
112
+ ]
113
+ },
114
+ "prettier": {
115
+ "quoteProps": "consistent",
116
+ "singleQuote": true,
117
+ "tabWidth": 2,
118
+ "trailingComma": "es5",
119
+ "useTabs": false
120
+ },
121
+ "jest": {
122
+ "preset": "@react-native/jest-preset",
123
+ "testEnvironmentOptions": {
124
+ "customExportConditions": [
125
+ "require",
126
+ "react-native",
127
+ "react-native-hilal-source"
128
+ ]
129
+ },
130
+ "modulePathIgnorePatterns": [
131
+ "<rootDir>/example/node_modules",
132
+ "<rootDir>/lib/"
133
+ ],
134
+ "globalSetup": "<rootDir>/jest.global-setup.js"
135
+ },
136
+ "release-it": {
137
+ "git": {
138
+ "commitMessage": "chore: release ${version}",
139
+ "requireBranch": "release/*",
140
+ "requireCleanWorkingDir": true,
141
+ "requireUpstream": false,
142
+ "tag": false,
143
+ "push": true
144
+ },
145
+ "hooks": {
146
+ "before:init": [
147
+ "yarn lint",
148
+ "yarn typecheck",
149
+ "yarn test"
150
+ ]
151
+ },
152
+ "npm": {
153
+ "publish": false
154
+ },
155
+ "github": {
156
+ "release": false
157
+ },
158
+ "plugins": {
159
+ "@release-it/conventional-changelog": {
160
+ "preset": {
161
+ "name": "conventionalcommits"
162
+ },
163
+ "infile": "CHANGELOG.md",
164
+ "header": "# Changelog"
165
+ }
166
+ }
167
+ },
168
+ "create-react-native-library": {
169
+ "type": "library",
170
+ "languages": "js",
171
+ "tools": [
172
+ "eslint",
173
+ "jest",
174
+ "release-it"
175
+ ],
176
+ "version": "0.64.0"
177
+ },
178
+ "lint-staged": {
179
+ "*.{js,mjs,cjs,ts,tsx}": "eslint --fix",
180
+ "*.{json,md,yml,yaml}": "prettier --write"
181
+ }
182
+ }
@@ -0,0 +1,55 @@
1
+ import { StyleSheet, View } from 'react-native';
2
+
3
+ type ChevronProps = {
4
+ direction: 'left' | 'right';
5
+ color: string;
6
+ };
7
+
8
+ const SIZE = 14;
9
+ const LENGTH = 10;
10
+ const THICKNESS = 2.5;
11
+ // Vertical offset of each stroke's center so their ends meet at the tip.
12
+ const OFFSET = LENGTH / (2 * Math.SQRT2);
13
+
14
+ /**
15
+ * A chevron drawn with two rotated strokes. Not a text glyph: '‹' and '›'
16
+ * are mirrored by the Unicode bidi algorithm in right-to-left text, so they
17
+ * would point the wrong way in RTL apps. No left/right styles either, since
18
+ * React Native swaps those in RTL layouts.
19
+ */
20
+ export function Chevron({ direction, color }: ChevronProps) {
21
+ const upper = direction === 'left' ? '-45deg' : '45deg';
22
+ const lower = direction === 'left' ? '45deg' : '-45deg';
23
+ return (
24
+ <View testID={`hilal-chevron-${direction}`} style={styles.box}>
25
+ <View
26
+ style={[
27
+ styles.stroke,
28
+ { backgroundColor: color, top: SIZE / 2 - OFFSET - THICKNESS / 2 },
29
+ { transform: [{ rotate: upper }] },
30
+ ]}
31
+ />
32
+ <View
33
+ style={[
34
+ styles.stroke,
35
+ { backgroundColor: color, top: SIZE / 2 + OFFSET - THICKNESS / 2 },
36
+ { transform: [{ rotate: lower }] },
37
+ ]}
38
+ />
39
+ </View>
40
+ );
41
+ }
42
+
43
+ const styles = StyleSheet.create({
44
+ box: {
45
+ alignItems: 'center',
46
+ height: SIZE,
47
+ width: SIZE,
48
+ },
49
+ stroke: {
50
+ borderRadius: THICKNESS / 2,
51
+ height: THICKNESS,
52
+ position: 'absolute',
53
+ width: LENGTH,
54
+ },
55
+ });
@@ -0,0 +1,83 @@
1
+ import { memo } from 'react';
2
+ import {
3
+ Pressable,
4
+ Text,
5
+ View,
6
+ type StyleProp,
7
+ type ViewStyle,
8
+ } from 'react-native';
9
+
10
+ import type { CalendarStyles } from './styles';
11
+
12
+ export type DayCellProps = {
13
+ epochDay: number;
14
+ label: string;
15
+ secondaryLabel: string | null;
16
+ accessibilityLabel: string;
17
+ selected: boolean;
18
+ today: boolean;
19
+ disabled: boolean;
20
+ styles: CalendarStyles;
21
+ dayStyle: StyleProp<ViewStyle>;
22
+ onSelect: (epochDay: number) => void;
23
+ };
24
+
25
+ /**
26
+ * One day of the grid. Memoized: every prop is either a primitive or kept
27
+ * stable by the calendar, so pressing a day only re-renders the old and
28
+ * the new selected day.
29
+ */
30
+ export function DayCellView({
31
+ epochDay,
32
+ label,
33
+ secondaryLabel,
34
+ accessibilityLabel,
35
+ selected,
36
+ today,
37
+ disabled,
38
+ styles,
39
+ dayStyle,
40
+ onSelect,
41
+ }: DayCellProps) {
42
+ return (
43
+ <View style={styles.slot}>
44
+ <Pressable
45
+ accessibilityRole="button"
46
+ accessibilityLabel={accessibilityLabel}
47
+ accessibilityState={{ selected, disabled }}
48
+ disabled={disabled}
49
+ onPress={() => onSelect(epochDay)}
50
+ style={({ pressed }) => [
51
+ styles.day,
52
+ today && styles.today,
53
+ selected && styles.selected,
54
+ pressed && !selected && styles.pressed,
55
+ dayStyle,
56
+ ]}
57
+ >
58
+ <Text
59
+ style={[
60
+ styles.dayText,
61
+ disabled && styles.disabledText,
62
+ selected && styles.selectedText,
63
+ ]}
64
+ >
65
+ {label}
66
+ </Text>
67
+ {secondaryLabel !== null && (
68
+ <Text
69
+ style={[
70
+ styles.secondaryText,
71
+ disabled && styles.disabledText,
72
+ selected && styles.selectedSecondaryText,
73
+ ]}
74
+ >
75
+ {secondaryLabel}
76
+ </Text>
77
+ )}
78
+ </Pressable>
79
+ </View>
80
+ );
81
+ }
82
+
83
+ export const DayCell = memo(DayCellView);