react-native-drum-picker 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 (36) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/LICENSE +21 -0
  3. package/README.md +252 -0
  4. package/android/build.gradle +68 -0
  5. package/android/src/main/AndroidManifest.xml +2 -0
  6. package/android/src/main/java/com/drumpicker/DrumPickerAdapter.kt +108 -0
  7. package/android/src/main/java/com/drumpicker/DrumPickerChangeEvent.kt +25 -0
  8. package/android/src/main/java/com/drumpicker/DrumPickerDefaults.kt +19 -0
  9. package/android/src/main/java/com/drumpicker/DrumPickerPackage.kt +17 -0
  10. package/android/src/main/java/com/drumpicker/DrumPickerView.kt +583 -0
  11. package/android/src/main/java/com/drumpicker/DrumPickerViewManager.kt +108 -0
  12. package/lib/module/DateDrumPicker.js +153 -0
  13. package/lib/module/DrumPicker.js +6 -0
  14. package/lib/module/DrumPicker.native.js +63 -0
  15. package/lib/module/DrumPickerViewNativeComponent.ts +31 -0
  16. package/lib/module/dateDrumPickerLogic.js +82 -0
  17. package/lib/module/index.js +5 -0
  18. package/lib/module/package.json +1 -0
  19. package/lib/module/types.js +4 -0
  20. package/lib/typescript/package.json +1 -0
  21. package/lib/typescript/src/DateDrumPicker.d.ts +32 -0
  22. package/lib/typescript/src/DrumPicker.d.ts +3 -0
  23. package/lib/typescript/src/DrumPicker.native.d.ts +3 -0
  24. package/lib/typescript/src/DrumPickerViewNativeComponent.d.ts +25 -0
  25. package/lib/typescript/src/dateDrumPickerLogic.d.ts +20 -0
  26. package/lib/typescript/src/index.d.ts +5 -0
  27. package/lib/typescript/src/types.d.ts +24 -0
  28. package/package.json +189 -0
  29. package/react-native.config.js +13 -0
  30. package/src/DateDrumPicker.tsx +267 -0
  31. package/src/DrumPicker.native.tsx +68 -0
  32. package/src/DrumPicker.tsx +7 -0
  33. package/src/DrumPickerViewNativeComponent.ts +31 -0
  34. package/src/dateDrumPickerLogic.ts +95 -0
  35. package/src/index.tsx +15 -0
  36. package/src/types.ts +25 -0
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+
3
+ import { useCallback, useMemo, useState } from 'react';
4
+ import { StyleSheet, View } from 'react-native';
5
+ import { buildDayItems, buildMonthItems, buildYearItems, clampDateDrumPickerValue, clampDayForMonth, clampYear, normalizeYearRange, parseMonthFromLabel } from "./dateDrumPickerLogic.js";
6
+ import { DrumPicker } from './DrumPicker';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ export { clampDateDrumPickerValue, getDaysInMonth, normalizeYearRange } from "./dateDrumPickerLogic.js";
9
+ const COLUMN_ORDER = {
10
+ 'day': ['day'],
11
+ 'month': ['month'],
12
+ 'year': ['year'],
13
+ 'day-month': ['day', 'month'],
14
+ 'month-year': ['month', 'year'],
15
+ 'day-month-year': ['day', 'month', 'year'],
16
+ 'month-day-year': ['month', 'day', 'year'],
17
+ 'year-month-day': ['year', 'month', 'day']
18
+ };
19
+ const COLUMN_WIDTH = {
20
+ day: 64,
21
+ month: 110,
22
+ year: 86
23
+ };
24
+ const DEFAULT_ITEM_HEIGHT = 44;
25
+ const DEFAULT_VISIBLE_ITEM_COUNT = 5;
26
+ export function DateDrumPicker({
27
+ mode = 'day-month-year',
28
+ value,
29
+ onChange,
30
+ minYear: minYearProp,
31
+ maxYear: maxYearProp,
32
+ monthFormat = 'short',
33
+ locale = 'en',
34
+ itemHeight = DEFAULT_ITEM_HEIGHT,
35
+ visibleItemCount = DEFAULT_VISIBLE_ITEM_COUNT,
36
+ textColor,
37
+ selectedTextColor,
38
+ textSize,
39
+ selectedTextSize,
40
+ showSelectionIndicator,
41
+ selectionIndicatorColor,
42
+ selectionIndicatorHeight,
43
+ backgroundColor = 'transparent',
44
+ itemBackgroundColor = 'transparent',
45
+ containerBackgroundColor = 'transparent',
46
+ style,
47
+ columnStyle,
48
+ columnStyles
49
+ }) {
50
+ const currentYear = new Date().getFullYear();
51
+ const {
52
+ minYear,
53
+ maxYear
54
+ } = useMemo(() => normalizeYearRange(minYearProp ?? currentYear - 100, maxYearProp ?? currentYear + 50), [minYearProp, maxYearProp, currentYear]);
55
+ const isControlled = value !== undefined;
56
+ const [internalValue, setInternalValue] = useState(() => clampDateDrumPickerValue(value ?? {}, minYear, maxYear));
57
+ const resolvedValue = useMemo(() => {
58
+ if (isControlled) {
59
+ return clampDateDrumPickerValue(value, minYear, maxYear);
60
+ }
61
+ return internalValue;
62
+ }, [isControlled, value, internalValue, minYear, maxYear]);
63
+ const columns = COLUMN_ORDER[mode];
64
+ const dayItems = useMemo(() => buildDayItems(resolvedValue.month, resolvedValue.year), [resolvedValue.month, resolvedValue.year]);
65
+ const monthItems = useMemo(() => buildMonthItems(monthFormat, locale), [monthFormat, locale]);
66
+ const yearItems = useMemo(() => buildYearItems(minYear, maxYear), [minYear, maxYear]);
67
+ const pickerHeight = itemHeight * visibleItemCount;
68
+ const emitChange = useCallback(patch => {
69
+ const next = clampDateDrumPickerValue({
70
+ ...resolvedValue,
71
+ ...patch
72
+ }, minYear, maxYear);
73
+ if (!isControlled) {
74
+ setInternalValue(next);
75
+ }
76
+ onChange?.(next);
77
+ }, [isControlled, onChange, resolvedValue, minYear, maxYear]);
78
+ const sharedPickerProps = {
79
+ itemHeight,
80
+ visibleItemCount,
81
+ textColor,
82
+ selectedTextColor,
83
+ textSize,
84
+ selectedTextSize,
85
+ showSelectionIndicator,
86
+ selectionIndicatorColor,
87
+ selectionIndicatorHeight,
88
+ backgroundColor,
89
+ itemBackgroundColor,
90
+ containerBackgroundColor
91
+ };
92
+ const columnContainerStyle = column => [styles.column, {
93
+ width: COLUMN_WIDTH[column],
94
+ height: pickerHeight
95
+ }, columnStyle, columnStyles?.[column]];
96
+ const renderColumn = column => {
97
+ if (column === 'day') {
98
+ return /*#__PURE__*/_jsx(DrumPicker, {
99
+ ...sharedPickerProps,
100
+ style: columnContainerStyle('day'),
101
+ items: dayItems,
102
+ selectedIndex: Math.min(resolvedValue.day - 1, dayItems.length - 1),
103
+ onChange: event => {
104
+ const day = clampDayForMonth(event.nativeEvent.index + 1, resolvedValue.month, resolvedValue.year);
105
+ emitChange({
106
+ day
107
+ });
108
+ }
109
+ }, "day");
110
+ }
111
+ if (column === 'month') {
112
+ return /*#__PURE__*/_jsx(DrumPicker, {
113
+ ...sharedPickerProps,
114
+ style: columnContainerStyle('month'),
115
+ items: monthItems,
116
+ selectedIndex: resolvedValue.month - 1,
117
+ onChange: event => {
118
+ const month = parseMonthFromLabel(event.nativeEvent.value, monthFormat, monthItems);
119
+ emitChange({
120
+ month
121
+ });
122
+ }
123
+ }, "month");
124
+ }
125
+ return /*#__PURE__*/_jsx(DrumPicker, {
126
+ ...sharedPickerProps,
127
+ style: columnContainerStyle('year'),
128
+ items: yearItems,
129
+ selectedIndex: resolvedValue.year - minYear,
130
+ onChange: event => {
131
+ const year = clampYear(minYear + event.nativeEvent.index, minYear, maxYear);
132
+ emitChange({
133
+ year
134
+ });
135
+ }
136
+ }, "year");
137
+ };
138
+ return /*#__PURE__*/_jsx(View, {
139
+ style: [styles.row, style],
140
+ children: columns.map(column => renderColumn(column))
141
+ });
142
+ }
143
+ const styles = StyleSheet.create({
144
+ row: {
145
+ flexDirection: 'row',
146
+ alignItems: 'center',
147
+ backgroundColor: 'transparent'
148
+ },
149
+ column: {
150
+ backgroundColor: 'transparent'
151
+ }
152
+ });
153
+ //# sourceMappingURL=DateDrumPicker.js.map
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ export function DrumPicker(_props) {
4
+ throw new Error("'react-native-drum-picker' is only supported on native platforms.");
5
+ }
6
+ //# sourceMappingURL=DrumPicker.js.map
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ import { StyleSheet } from 'react-native';
4
+ import DrumPickerNative from './DrumPickerViewNativeComponent';
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ const DEFAULTS = {
7
+ selectedIndex: 0,
8
+ itemHeight: 44,
9
+ visibleItemCount: 5,
10
+ textColor: '#8E8E93',
11
+ selectedTextColor: '#1C1C1E',
12
+ textSize: 20,
13
+ selectedTextSize: 22,
14
+ showSelectionIndicator: true,
15
+ selectionIndicatorColor: '#D1D1D6',
16
+ selectionIndicatorHeight: 1,
17
+ backgroundColor: 'transparent',
18
+ itemBackgroundColor: 'transparent',
19
+ containerBackgroundColor: 'transparent'
20
+ };
21
+ export function DrumPicker({
22
+ items,
23
+ selectedIndex = DEFAULTS.selectedIndex,
24
+ itemHeight = DEFAULTS.itemHeight,
25
+ visibleItemCount = DEFAULTS.visibleItemCount,
26
+ textColor = DEFAULTS.textColor,
27
+ selectedTextColor = DEFAULTS.selectedTextColor,
28
+ textSize = DEFAULTS.textSize,
29
+ selectedTextSize = DEFAULTS.selectedTextSize,
30
+ showSelectionIndicator = DEFAULTS.showSelectionIndicator,
31
+ selectionIndicatorColor = DEFAULTS.selectionIndicatorColor,
32
+ selectionIndicatorHeight = DEFAULTS.selectionIndicatorHeight,
33
+ backgroundColor = DEFAULTS.backgroundColor,
34
+ itemBackgroundColor = DEFAULTS.itemBackgroundColor,
35
+ containerBackgroundColor = DEFAULTS.containerBackgroundColor,
36
+ onChange,
37
+ style
38
+ }) {
39
+ const pickerHeight = itemHeight * visibleItemCount;
40
+ const pickerStyle = StyleSheet.flatten([{
41
+ height: pickerHeight
42
+ }, style]);
43
+ return /*#__PURE__*/_jsx(DrumPickerNative, {
44
+ collapsable: false,
45
+ items: items,
46
+ selectedIndex: selectedIndex,
47
+ itemHeight: itemHeight,
48
+ visibleItemCount: visibleItemCount,
49
+ textColor: textColor,
50
+ selectedTextColor: selectedTextColor,
51
+ textSize: textSize,
52
+ selectedTextSize: selectedTextSize,
53
+ showSelectionIndicator: showSelectionIndicator,
54
+ selectionIndicatorColor: selectionIndicatorColor,
55
+ selectionIndicatorHeight: selectionIndicatorHeight,
56
+ backgroundColor: backgroundColor,
57
+ itemBackgroundColor: itemBackgroundColor,
58
+ containerBackgroundColor: containerBackgroundColor,
59
+ onValueChange: onChange,
60
+ style: pickerStyle
61
+ });
62
+ }
63
+ //# sourceMappingURL=DrumPicker.native.js.map
@@ -0,0 +1,31 @@
1
+ import {
2
+ codegenNativeComponent,
3
+ type CodegenTypes,
4
+ type ColorValue,
5
+ type ViewProps,
6
+ } from 'react-native';
7
+
8
+ export type DrumPickerChangeEventPayload = {
9
+ index: CodegenTypes.Int32;
10
+ value: string;
11
+ };
12
+
13
+ interface NativeProps extends ViewProps {
14
+ items: ReadonlyArray<string>;
15
+ selectedIndex?: CodegenTypes.Int32;
16
+ itemHeight?: CodegenTypes.Float;
17
+ visibleItemCount?: CodegenTypes.Int32;
18
+ textColor?: ColorValue;
19
+ selectedTextColor?: ColorValue;
20
+ textSize?: CodegenTypes.Float;
21
+ selectedTextSize?: CodegenTypes.Float;
22
+ showSelectionIndicator?: CodegenTypes.WithDefault<boolean, true>;
23
+ selectionIndicatorColor?: ColorValue;
24
+ selectionIndicatorHeight?: CodegenTypes.Float;
25
+ backgroundColor?: ColorValue;
26
+ containerBackgroundColor?: ColorValue;
27
+ itemBackgroundColor?: ColorValue;
28
+ onValueChange?: CodegenTypes.DirectEventHandler<DrumPickerChangeEventPayload>;
29
+ }
30
+
31
+ export default codegenNativeComponent<NativeProps>('DrumPickerView');
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+
3
+ export function getDaysInMonth(month, year) {
4
+ return new Date(year, clampMonth(month), 0).getDate();
5
+ }
6
+ export function normalizeYearRange(minYear, maxYear) {
7
+ if (minYear <= maxYear) {
8
+ return {
9
+ minYear,
10
+ maxYear
11
+ };
12
+ }
13
+ return {
14
+ minYear: maxYear,
15
+ maxYear: minYear
16
+ };
17
+ }
18
+ export function clampMonth(month) {
19
+ return Math.min(12, Math.max(1, Math.round(month)));
20
+ }
21
+ export function clampYear(year, minYear, maxYear) {
22
+ return Math.min(maxYear, Math.max(minYear, Math.round(year)));
23
+ }
24
+ export function clampDayForMonth(day, month, year) {
25
+ const maxDay = getDaysInMonth(month, year);
26
+ return Math.min(maxDay, Math.max(1, Math.round(day)));
27
+ }
28
+ export function clampDateDrumPickerValue(value, minYear, maxYear) {
29
+ const {
30
+ minYear: min,
31
+ maxYear: max
32
+ } = normalizeYearRange(minYear, maxYear);
33
+ const now = new Date();
34
+ const month = clampMonth(value.month ?? now.getMonth() + 1);
35
+ const year = clampYear(value.year ?? now.getFullYear(), min, max);
36
+ const day = clampDayForMonth(value.day ?? now.getDate(), month, year);
37
+ return {
38
+ day,
39
+ month,
40
+ year
41
+ };
42
+ }
43
+ export function buildDayItems(month, year) {
44
+ const count = getDaysInMonth(month, year);
45
+ return Array.from({
46
+ length: count
47
+ }, (_, index) => String(index + 1));
48
+ }
49
+ export function buildMonthItems(monthFormat, locale) {
50
+ if (monthFormat === 'number') {
51
+ return Array.from({
52
+ length: 12
53
+ }, (_, index) => String(index + 1).padStart(2, '0'));
54
+ }
55
+ const monthStyle = monthFormat === 'long' ? 'long' : 'short';
56
+ return Array.from({
57
+ length: 12
58
+ }, (_, index) => {
59
+ const date = new Date(2020, index, 1);
60
+ return new Intl.DateTimeFormat(locale, {
61
+ month: monthStyle
62
+ }).format(date);
63
+ });
64
+ }
65
+ export function buildYearItems(minYear, maxYear) {
66
+ const {
67
+ minYear: min,
68
+ maxYear: max
69
+ } = normalizeYearRange(minYear, maxYear);
70
+ const length = max - min + 1;
71
+ return Array.from({
72
+ length
73
+ }, (_, index) => String(min + index));
74
+ }
75
+ export function parseMonthFromLabel(label, monthFormat, monthItems) {
76
+ if (monthFormat === 'number') {
77
+ return clampMonth(Number.parseInt(label, 10));
78
+ }
79
+ const index = monthItems.indexOf(label);
80
+ return index >= 0 ? index + 1 : 1;
81
+ }
82
+ //# sourceMappingURL=dateDrumPickerLogic.js.map
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ export { DrumPicker } from './DrumPicker';
4
+ export { DateDrumPicker, clampDateDrumPickerValue, getDaysInMonth, normalizeYearRange } from "./DateDrumPicker.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,32 @@
1
+ import { type StyleProp, type ViewStyle } from 'react-native';
2
+ import { type DateDrumPickerMonthFormat, type DateDrumPickerValue } from './dateDrumPickerLogic';
3
+ export type DateDrumPickerMode = 'day' | 'month' | 'year' | 'day-month' | 'month-year' | 'day-month-year' | 'month-day-year' | 'year-month-day';
4
+ export type { DateDrumPickerMonthFormat, DateDrumPickerValue };
5
+ export { clampDateDrumPickerValue, getDaysInMonth, normalizeYearRange, } from './dateDrumPickerLogic';
6
+ export type DateDrumPickerColumnKey = 'day' | 'month' | 'year';
7
+ export type DateDrumPickerProps = {
8
+ mode?: DateDrumPickerMode;
9
+ value?: DateDrumPickerValue;
10
+ onChange?: (value: DateDrumPickerValue) => void;
11
+ minYear?: number;
12
+ maxYear?: number;
13
+ monthFormat?: DateDrumPickerMonthFormat;
14
+ locale?: string;
15
+ itemHeight?: number;
16
+ visibleItemCount?: number;
17
+ textColor?: string;
18
+ selectedTextColor?: string;
19
+ textSize?: number;
20
+ selectedTextSize?: number;
21
+ showSelectionIndicator?: boolean;
22
+ selectionIndicatorColor?: string;
23
+ selectionIndicatorHeight?: number;
24
+ backgroundColor?: string;
25
+ itemBackgroundColor?: string;
26
+ containerBackgroundColor?: string;
27
+ style?: StyleProp<ViewStyle>;
28
+ columnStyle?: StyleProp<ViewStyle>;
29
+ columnStyles?: Partial<Record<DateDrumPickerColumnKey, StyleProp<ViewStyle>>>;
30
+ };
31
+ export declare function DateDrumPicker({ mode, value, onChange, minYear: minYearProp, maxYear: maxYearProp, monthFormat, locale, itemHeight, visibleItemCount, textColor, selectedTextColor, textSize, selectedTextSize, showSelectionIndicator, selectionIndicatorColor, selectionIndicatorHeight, backgroundColor, itemBackgroundColor, containerBackgroundColor, style, columnStyle, columnStyles, }: DateDrumPickerProps): import("react/jsx-runtime").JSX.Element;
32
+ //# sourceMappingURL=DateDrumPicker.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { DrumPickerProps } from './types';
2
+ export declare function DrumPicker(_props: DrumPickerProps): never;
3
+ //# sourceMappingURL=DrumPicker.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { DrumPickerProps } from './types';
2
+ export declare function DrumPicker({ items, selectedIndex, itemHeight, visibleItemCount, textColor, selectedTextColor, textSize, selectedTextSize, showSelectionIndicator, selectionIndicatorColor, selectionIndicatorHeight, backgroundColor, itemBackgroundColor, containerBackgroundColor, onChange, style, }: DrumPickerProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=DrumPicker.native.d.ts.map
@@ -0,0 +1,25 @@
1
+ import { type CodegenTypes, type ColorValue, type ViewProps } from 'react-native';
2
+ export type DrumPickerChangeEventPayload = {
3
+ index: CodegenTypes.Int32;
4
+ value: string;
5
+ };
6
+ interface NativeProps extends ViewProps {
7
+ items: ReadonlyArray<string>;
8
+ selectedIndex?: CodegenTypes.Int32;
9
+ itemHeight?: CodegenTypes.Float;
10
+ visibleItemCount?: CodegenTypes.Int32;
11
+ textColor?: ColorValue;
12
+ selectedTextColor?: ColorValue;
13
+ textSize?: CodegenTypes.Float;
14
+ selectedTextSize?: CodegenTypes.Float;
15
+ showSelectionIndicator?: CodegenTypes.WithDefault<boolean, true>;
16
+ selectionIndicatorColor?: ColorValue;
17
+ selectionIndicatorHeight?: CodegenTypes.Float;
18
+ backgroundColor?: ColorValue;
19
+ containerBackgroundColor?: ColorValue;
20
+ itemBackgroundColor?: ColorValue;
21
+ onValueChange?: CodegenTypes.DirectEventHandler<DrumPickerChangeEventPayload>;
22
+ }
23
+ declare const _default: import("react-native/types_generated/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
24
+ export default _default;
25
+ //# sourceMappingURL=DrumPickerViewNativeComponent.d.ts.map
@@ -0,0 +1,20 @@
1
+ export type DateDrumPickerValue = {
2
+ day?: number;
3
+ month?: number;
4
+ year?: number;
5
+ };
6
+ export type DateDrumPickerMonthFormat = 'short' | 'long' | 'number';
7
+ export declare function getDaysInMonth(month: number, year: number): number;
8
+ export declare function normalizeYearRange(minYear: number, maxYear: number): {
9
+ minYear: number;
10
+ maxYear: number;
11
+ };
12
+ export declare function clampMonth(month: number): number;
13
+ export declare function clampYear(year: number, minYear: number, maxYear: number): number;
14
+ export declare function clampDayForMonth(day: number, month: number, year: number): number;
15
+ export declare function clampDateDrumPickerValue(value: DateDrumPickerValue, minYear: number, maxYear: number): Required<DateDrumPickerValue>;
16
+ export declare function buildDayItems(month: number, year: number): string[];
17
+ export declare function buildMonthItems(monthFormat: DateDrumPickerMonthFormat, locale: string): string[];
18
+ export declare function buildYearItems(minYear: number, maxYear: number): string[];
19
+ export declare function parseMonthFromLabel(label: string, monthFormat: DateDrumPickerMonthFormat, monthItems: string[]): number;
20
+ //# sourceMappingURL=dateDrumPickerLogic.d.ts.map
@@ -0,0 +1,5 @@
1
+ export { DrumPicker } from './DrumPicker';
2
+ export { DateDrumPicker, clampDateDrumPickerValue, getDaysInMonth, normalizeYearRange, } from './DateDrumPicker';
3
+ export type { DrumPickerChangeEvent, DrumPickerProps } from './types';
4
+ export type { DateDrumPickerColumnKey, DateDrumPickerMode, DateDrumPickerMonthFormat, DateDrumPickerProps, DateDrumPickerValue, } from './DateDrumPicker';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,24 @@
1
+ import type { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';
2
+ export type DrumPickerChangeEvent = {
3
+ index: number;
4
+ value: string;
5
+ };
6
+ export type DrumPickerProps = {
7
+ items: string[];
8
+ selectedIndex?: number;
9
+ itemHeight?: number;
10
+ visibleItemCount?: number;
11
+ textColor?: string;
12
+ selectedTextColor?: string;
13
+ textSize?: number;
14
+ selectedTextSize?: number;
15
+ showSelectionIndicator?: boolean;
16
+ selectionIndicatorColor?: string;
17
+ selectionIndicatorHeight?: number;
18
+ backgroundColor?: string;
19
+ itemBackgroundColor?: string;
20
+ containerBackgroundColor?: string;
21
+ onChange?: (event: NativeSyntheticEvent<DrumPickerChangeEvent>) => void;
22
+ style?: StyleProp<ViewStyle>;
23
+ };
24
+ //# sourceMappingURL=types.d.ts.map
package/package.json ADDED
@@ -0,0 +1,189 @@
1
+ {
2
+ "name": "react-native-drum-picker",
3
+ "version": "0.1.0",
4
+ "description": "Android-native iOS-style drum/wheel picker for React Native (Fabric)",
5
+ "main": "./lib/module/index.js",
6
+ "module": "./lib/module/index.js",
7
+ "types": "./lib/typescript/src/index.d.ts",
8
+ "react-native": "./src/index.tsx",
9
+ "source": "./src/index.tsx",
10
+ "sideEffects": false,
11
+ "exports": {
12
+ ".": {
13
+ "source": "./src/index.tsx",
14
+ "types": "./lib/typescript/src/index.d.ts",
15
+ "default": "./lib/module/index.js"
16
+ },
17
+ "./package.json": "./package.json"
18
+ },
19
+ "files": [
20
+ "README.md",
21
+ "LICENSE",
22
+ "CHANGELOG.md",
23
+ "react-native.config.js",
24
+ "src",
25
+ "lib",
26
+ "android",
27
+ "!android/build",
28
+ "!android/gradle",
29
+ "!android/gradlew",
30
+ "!android/gradlew.bat",
31
+ "!android/local.properties",
32
+ "!example",
33
+ "!ios",
34
+ "!**/__tests__",
35
+ "!**/__fixtures__",
36
+ "!**/__mocks__",
37
+ "!**/*.map",
38
+ "!**/.*"
39
+ ],
40
+ "scripts": {
41
+ "example": "yarn workspace react-native-drum-picker-example",
42
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
43
+ "build": "bob build",
44
+ "prepublishOnly": "bob build",
45
+ "typecheck": "tsc",
46
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
47
+ "test": "jest",
48
+ "release": "release-it --only-version"
49
+ },
50
+ "keywords": [
51
+ "react-native",
52
+ "react-native-library",
53
+ "android",
54
+ "kotlin",
55
+ "fabric",
56
+ "new-architecture",
57
+ "picker",
58
+ "wheel-picker",
59
+ "drum-picker",
60
+ "date-picker",
61
+ "ios-style"
62
+ ],
63
+ "repository": {
64
+ "type": "git",
65
+ "url": "git+https://github.com/scrollDynasty/react-native-drum-picker.git"
66
+ },
67
+ "author": "Umar Matyokubov <ymarumar502@gmail.com> (https://github.com/scrollDynasty)",
68
+ "license": "MIT",
69
+ "bugs": {
70
+ "url": "https://github.com/scrollDynasty/react-native-drum-picker/issues"
71
+ },
72
+ "homepage": "https://github.com/scrollDynasty/react-native-drum-picker#readme",
73
+ "publishConfig": {
74
+ "registry": "https://registry.npmjs.org/"
75
+ },
76
+ "devDependencies": {
77
+ "@babel/core": "^7.25.2",
78
+ "@eslint/compat": "^2.0.3",
79
+ "@eslint/eslintrc": "^3.3.5",
80
+ "@eslint/js": "^10.0.1",
81
+ "@jest/globals": "^30.0.0",
82
+ "@react-native/babel-preset": "0.85.0",
83
+ "@react-native/eslint-config": "0.85.0",
84
+ "@react-native/jest-preset": "0.85.0",
85
+ "@release-it/conventional-changelog": "^10.0.6",
86
+ "@types/react": "^19.2.0",
87
+ "babel-jest": "^30.3.0",
88
+ "del-cli": "^7.0.0",
89
+ "eslint": "^9.39.4",
90
+ "eslint-config-prettier": "^10.1.8",
91
+ "eslint-plugin-ft-flow": "^3.0.11",
92
+ "eslint-plugin-prettier": "^5.5.5",
93
+ "jest": "^30.3.0",
94
+ "prettier": "^3.8.1",
95
+ "react": "19.2.3",
96
+ "react-native": "0.85.0",
97
+ "react-native-builder-bob": "^0.41.0",
98
+ "release-it": "^19.2.4",
99
+ "turbo": "^2.8.21",
100
+ "typescript": "^6.0.2"
101
+ },
102
+ "peerDependencies": {
103
+ "react": ">=18.0.0",
104
+ "react-native": ">=0.76.0"
105
+ },
106
+ "workspaces": [
107
+ "example"
108
+ ],
109
+ "packageManager": "yarn@4.11.0",
110
+ "react-native-builder-bob": {
111
+ "source": "src",
112
+ "output": "lib",
113
+ "targets": [
114
+ [
115
+ "module",
116
+ {
117
+ "esm": true
118
+ }
119
+ ],
120
+ [
121
+ "typescript",
122
+ {
123
+ "project": "tsconfig.build.json"
124
+ }
125
+ ]
126
+ ]
127
+ },
128
+ "codegenConfig": {
129
+ "name": "DrumPickerViewSpec",
130
+ "type": "components",
131
+ "jsSrcsDir": "src",
132
+ "android": {
133
+ "javaPackageName": "com.drumpicker"
134
+ }
135
+ },
136
+ "prettier": {
137
+ "quoteProps": "consistent",
138
+ "singleQuote": true,
139
+ "tabWidth": 2,
140
+ "trailingComma": "es5",
141
+ "useTabs": false
142
+ },
143
+ "jest": {
144
+ "testEnvironment": "node",
145
+ "modulePathIgnorePatterns": [
146
+ "<rootDir>/example/node_modules",
147
+ "<rootDir>/lib/"
148
+ ],
149
+ "transform": {
150
+ "^.+\\.(js|ts|tsx)$": [
151
+ "babel-jest",
152
+ {
153
+ "presets": [
154
+ "module:@react-native/babel-preset"
155
+ ]
156
+ }
157
+ ]
158
+ }
159
+ },
160
+ "release-it": {
161
+ "git": {
162
+ "commitMessage": "chore: release ${version}",
163
+ "tagName": "v${version}"
164
+ },
165
+ "npm": {
166
+ "publish": true
167
+ },
168
+ "github": {
169
+ "release": true
170
+ },
171
+ "plugins": {
172
+ "@release-it/conventional-changelog": {
173
+ "preset": {
174
+ "name": "angular"
175
+ }
176
+ }
177
+ }
178
+ },
179
+ "create-react-native-library": {
180
+ "type": "fabric-view",
181
+ "languages": "kotlin-objc",
182
+ "tools": [
183
+ "eslint",
184
+ "jest",
185
+ "release-it"
186
+ ],
187
+ "version": "0.62.0"
188
+ }
189
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @type {import('@react-native-community/cli-types').Config}
3
+ */
4
+ module.exports = {
5
+ dependency: {
6
+ platforms: {
7
+ android: {
8
+ sourceDir: './android',
9
+ },
10
+ ios: null,
11
+ },
12
+ },
13
+ };