react-native-timer-picker 2.1.1 → 2.2.1

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 (139) hide show
  1. package/README.md +250 -174
  2. package/dist/commonjs/components/DurationScroll/DurationScroll.js +417 -0
  3. package/dist/commonjs/components/DurationScroll/DurationScroll.js.map +1 -0
  4. package/dist/commonjs/components/DurationScroll/index.js +20 -392
  5. package/dist/commonjs/components/DurationScroll/index.js.map +1 -1
  6. package/dist/commonjs/components/DurationScroll/types.js.map +1 -1
  7. package/dist/commonjs/components/Modal/Modal.js +107 -0
  8. package/dist/commonjs/components/Modal/Modal.js.map +1 -0
  9. package/dist/commonjs/components/Modal/index.js +20 -101
  10. package/dist/commonjs/components/Modal/index.js.map +1 -1
  11. package/dist/commonjs/components/TimerPicker/TimerPicker.js +225 -0
  12. package/dist/commonjs/components/TimerPicker/TimerPicker.js.map +1 -0
  13. package/dist/commonjs/components/TimerPicker/index.js +29 -166
  14. package/dist/commonjs/components/TimerPicker/index.js.map +1 -1
  15. package/dist/commonjs/components/TimerPicker/styles.js.map +1 -1
  16. package/dist/commonjs/components/TimerPicker/types.js.map +1 -1
  17. package/dist/commonjs/components/TimerPickerModal/TimerPickerModal.js +143 -0
  18. package/dist/commonjs/components/TimerPickerModal/TimerPickerModal.js.map +1 -0
  19. package/dist/commonjs/components/TimerPickerModal/index.js +30 -131
  20. package/dist/commonjs/components/TimerPickerModal/index.js.map +1 -1
  21. package/dist/commonjs/components/TimerPickerModal/types.js.map +1 -1
  22. package/dist/commonjs/index.js +9 -13
  23. package/dist/commonjs/index.js.map +1 -1
  24. package/dist/commonjs/tests/DurationScroll.test.js +94 -0
  25. package/dist/commonjs/tests/DurationScroll.test.js.map +1 -1
  26. package/dist/commonjs/tests/Modal.test.js +79 -2
  27. package/dist/commonjs/tests/Modal.test.js.map +1 -1
  28. package/dist/commonjs/tests/TimerPicker.test.js +119 -1
  29. package/dist/commonjs/tests/TimerPicker.test.js.map +1 -1
  30. package/dist/commonjs/tests/TimerPickerModal.test.js +120 -0
  31. package/dist/commonjs/tests/TimerPickerModal.test.js.map +1 -1
  32. package/dist/commonjs/tests/colorToRgba.test.js +176 -0
  33. package/dist/commonjs/tests/colorToRgba.test.js.map +1 -0
  34. package/dist/commonjs/tests/generateNumbers.test.js +350 -0
  35. package/dist/commonjs/tests/generateNumbers.test.js.map +1 -0
  36. package/dist/commonjs/tests/getAdjustedLimit.test.js +324 -0
  37. package/dist/commonjs/tests/getAdjustedLimit.test.js.map +1 -0
  38. package/dist/commonjs/tests/getDurationAndIndexFromScrollOffset.test.js +424 -0
  39. package/dist/commonjs/tests/getDurationAndIndexFromScrollOffset.test.js.map +1 -0
  40. package/dist/commonjs/tests/getInitialScrollIndex.test.js +396 -0
  41. package/dist/commonjs/tests/getInitialScrollIndex.test.js.map +1 -0
  42. package/dist/commonjs/tests/getSafeInitialValue.test.js +497 -0
  43. package/dist/commonjs/tests/getSafeInitialValue.test.js.map +1 -0
  44. package/dist/commonjs/tests/padNumber.test.js +301 -0
  45. package/dist/commonjs/tests/padNumber.test.js.map +1 -0
  46. package/dist/commonjs/utils/colorToRgba.js +40 -4
  47. package/dist/commonjs/utils/colorToRgba.js.map +1 -1
  48. package/dist/commonjs/utils/generateNumbers.js +67 -0
  49. package/dist/commonjs/utils/generateNumbers.js.map +1 -1
  50. package/dist/commonjs/utils/getAdjustedLimit.js +28 -3
  51. package/dist/commonjs/utils/getAdjustedLimit.js.map +1 -1
  52. package/dist/commonjs/utils/getDurationAndIndexFromScrollOffset.js +38 -0
  53. package/dist/commonjs/utils/getDurationAndIndexFromScrollOffset.js.map +1 -1
  54. package/dist/commonjs/utils/getInitialScrollIndex.js +38 -0
  55. package/dist/commonjs/utils/getInitialScrollIndex.js.map +1 -1
  56. package/dist/commonjs/utils/getSafeInitialValue.js +28 -0
  57. package/dist/commonjs/utils/getSafeInitialValue.js.map +1 -1
  58. package/dist/commonjs/utils/padNumber.js +25 -0
  59. package/dist/commonjs/utils/padNumber.js.map +1 -1
  60. package/dist/module/components/DurationScroll/DurationScroll.js +410 -0
  61. package/dist/module/components/DurationScroll/DurationScroll.js.map +1 -0
  62. package/dist/module/components/DurationScroll/index.js +2 -390
  63. package/dist/module/components/DurationScroll/index.js.map +1 -1
  64. package/dist/module/components/DurationScroll/types.js.map +1 -1
  65. package/dist/module/components/Modal/Modal.js +99 -0
  66. package/dist/module/components/Modal/Modal.js.map +1 -0
  67. package/dist/module/components/Modal/index.js +2 -98
  68. package/dist/module/components/Modal/index.js.map +1 -1
  69. package/dist/module/components/TimerPicker/TimerPicker.js +217 -0
  70. package/dist/module/components/TimerPicker/TimerPicker.js.map +1 -0
  71. package/dist/module/components/TimerPicker/index.js +3 -166
  72. package/dist/module/components/TimerPicker/index.js.map +1 -1
  73. package/dist/module/components/TimerPicker/styles.js.map +1 -1
  74. package/dist/module/components/TimerPicker/types.js.map +1 -1
  75. package/dist/module/components/TimerPickerModal/TimerPickerModal.js +135 -0
  76. package/dist/module/components/TimerPickerModal/TimerPickerModal.js.map +1 -0
  77. package/dist/module/components/TimerPickerModal/index.js +3 -130
  78. package/dist/module/components/TimerPickerModal/index.js.map +1 -1
  79. package/dist/module/components/TimerPickerModal/types.js.map +1 -1
  80. package/dist/module/index.js +2 -6
  81. package/dist/module/index.js.map +1 -1
  82. package/dist/module/tests/DurationScroll.test.js +94 -0
  83. package/dist/module/tests/DurationScroll.test.js.map +1 -1
  84. package/dist/module/tests/Modal.test.js +80 -3
  85. package/dist/module/tests/Modal.test.js.map +1 -1
  86. package/dist/module/tests/TimerPicker.test.js +119 -1
  87. package/dist/module/tests/TimerPicker.test.js.map +1 -1
  88. package/dist/module/tests/TimerPickerModal.test.js +121 -1
  89. package/dist/module/tests/TimerPickerModal.test.js.map +1 -1
  90. package/dist/module/tests/colorToRgba.test.js +174 -0
  91. package/dist/module/tests/colorToRgba.test.js.map +1 -0
  92. package/dist/module/tests/generateNumbers.test.js +348 -0
  93. package/dist/module/tests/generateNumbers.test.js.map +1 -0
  94. package/dist/module/tests/getAdjustedLimit.test.js +322 -0
  95. package/dist/module/tests/getAdjustedLimit.test.js.map +1 -0
  96. package/dist/module/tests/getDurationAndIndexFromScrollOffset.test.js +422 -0
  97. package/dist/module/tests/getDurationAndIndexFromScrollOffset.test.js.map +1 -0
  98. package/dist/module/tests/getInitialScrollIndex.test.js +394 -0
  99. package/dist/module/tests/getInitialScrollIndex.test.js.map +1 -0
  100. package/dist/module/tests/getSafeInitialValue.test.js +495 -0
  101. package/dist/module/tests/getSafeInitialValue.test.js.map +1 -0
  102. package/dist/module/tests/padNumber.test.js +299 -0
  103. package/dist/module/tests/padNumber.test.js.map +1 -0
  104. package/dist/module/utils/colorToRgba.js +40 -4
  105. package/dist/module/utils/colorToRgba.js.map +1 -1
  106. package/dist/module/utils/generateNumbers.js +68 -0
  107. package/dist/module/utils/generateNumbers.js.map +1 -1
  108. package/dist/module/utils/getAdjustedLimit.js +28 -3
  109. package/dist/module/utils/getAdjustedLimit.js.map +1 -1
  110. package/dist/module/utils/getDurationAndIndexFromScrollOffset.js +38 -0
  111. package/dist/module/utils/getDurationAndIndexFromScrollOffset.js.map +1 -1
  112. package/dist/module/utils/getInitialScrollIndex.js +38 -0
  113. package/dist/module/utils/getInitialScrollIndex.js.map +1 -1
  114. package/dist/module/utils/getSafeInitialValue.js +28 -0
  115. package/dist/module/utils/getSafeInitialValue.js.map +1 -1
  116. package/dist/module/utils/padNumber.js +25 -0
  117. package/dist/module/utils/padNumber.js.map +1 -1
  118. package/dist/typescript/components/DurationScroll/DurationScroll.d.ts +4 -0
  119. package/dist/typescript/components/DurationScroll/index.d.ts +2 -4
  120. package/dist/typescript/components/DurationScroll/types.d.ts +13 -9
  121. package/dist/typescript/components/Modal/Modal.d.ts +5 -0
  122. package/dist/typescript/components/Modal/index.d.ts +2 -5
  123. package/dist/typescript/components/TimerPicker/TimerPicker.d.ts +4 -0
  124. package/dist/typescript/components/TimerPicker/index.d.ts +3 -4
  125. package/dist/typescript/components/TimerPicker/styles.d.ts +922 -771
  126. package/dist/typescript/components/TimerPicker/types.d.ts +26 -10
  127. package/dist/typescript/components/TimerPickerModal/TimerPickerModal.d.ts +4 -0
  128. package/dist/typescript/components/TimerPickerModal/index.d.ts +3 -4
  129. package/dist/typescript/components/TimerPickerModal/styles.d.ts +570 -474
  130. package/dist/typescript/components/TimerPickerModal/types.d.ts +8 -5
  131. package/dist/typescript/index.d.ts +2 -6
  132. package/dist/typescript/utils/colorToRgba.d.ts +34 -0
  133. package/dist/typescript/utils/generateNumbers.d.ts +66 -0
  134. package/dist/typescript/utils/getAdjustedLimit.d.ts +27 -2
  135. package/dist/typescript/utils/getDurationAndIndexFromScrollOffset.d.ts +38 -0
  136. package/dist/typescript/utils/getInitialScrollIndex.d.ts +38 -0
  137. package/dist/typescript/utils/getSafeInitialValue.d.ts +29 -0
  138. package/dist/typescript/utils/padNumber.d.ts +25 -0
  139. package/package.json +12 -30
@@ -1,3 +1,41 @@
1
+ /**
2
+ * Calculates the initial scroll index for a number picker based on the desired value and configuration.
3
+ * Handles both infinite and non-infinite scroll modes, taking into account padding and repetition.
4
+ *
5
+ * @param {Object} variables - Configuration object for scroll index calculation
6
+ * @param {boolean} variables.disableInfiniteScroll - Whether infinite scroll is disabled
7
+ * @param {number} variables.interval - The interval between consecutive numbers
8
+ * @param {number} variables.numberOfItems - Total number of items in the picker
9
+ * @param {number} variables.padWithNItems - Number of empty items to pad with
10
+ * @param {number} variables.repeatNumbersNTimes - How many times to repeat the number sequence
11
+ * @param {number} variables.value - The desired initial value
12
+ *
13
+ * @returns {number} The calculated initial scroll index
14
+ *
15
+ * @example
16
+ * // With infinite scroll enabled
17
+ * getInitialScrollIndex({
18
+ * disableInfiniteScroll: false,
19
+ * interval: 1,
20
+ * numberOfItems: 24,
21
+ * padWithNItems: 2,
22
+ * repeatNumbersNTimes: 3,
23
+ * value: 12
24
+ * })
25
+ * // Returns: 38
26
+ *
27
+ * @example
28
+ * // With infinite scroll disabled
29
+ * getInitialScrollIndex({
30
+ * disableInfiniteScroll: true,
31
+ * interval: 1,
32
+ * numberOfItems: 24,
33
+ * padWithNItems: 2,
34
+ * repeatNumbersNTimes: 1,
35
+ * value: 12
36
+ * })
37
+ * // Returns: 12
38
+ */
1
39
  export const getInitialScrollIndex = variables => {
2
40
  const {
3
41
  disableInfiniteScroll,
@@ -1 +1 @@
1
- {"version":3,"names":["getInitialScrollIndex","variables","disableInfiniteScroll","interval","numberOfItems","padWithNItems","repeatNumbersNTimes","value","Math","max","floor"],"sources":["getInitialScrollIndex.ts"],"sourcesContent":["export const getInitialScrollIndex = (variables: {\n disableInfiniteScroll: boolean;\n interval: number;\n numberOfItems: number;\n padWithNItems: number;\n repeatNumbersNTimes: number;\n value: number;\n}) => {\n const {\n disableInfiniteScroll,\n interval,\n numberOfItems,\n padWithNItems,\n repeatNumbersNTimes,\n value,\n } = variables;\n\n return Math.max(\n numberOfItems * Math.floor(repeatNumbersNTimes / 2) +\n ((value / interval + numberOfItems) % numberOfItems) -\n (!disableInfiniteScroll ? padWithNItems : 0),\n 0\n );\n};\n"],"mappings":"AAAA,OAAO,MAAMA,qBAAqB,GAAIC,SAOrC,IAAK;EACF,MAAM;IACFC,qBAAqB;IACrBC,QAAQ;IACRC,aAAa;IACbC,aAAa;IACbC,mBAAmB;IACnBC;EACJ,CAAC,GAAGN,SAAS;EAEb,OAAOO,IAAI,CAACC,GAAG,CACXL,aAAa,GAAGI,IAAI,CAACE,KAAK,CAACJ,mBAAmB,GAAG,CAAC,CAAC,GAC9C,CAACC,KAAK,GAAGJ,QAAQ,GAAGC,aAAa,IAAIA,aAAc,IACnD,CAACF,qBAAqB,GAAGG,aAAa,GAAG,CAAC,CAAC,EAChD,CACJ,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["getInitialScrollIndex","variables","disableInfiniteScroll","interval","numberOfItems","padWithNItems","repeatNumbersNTimes","value","Math","max","floor"],"sources":["getInitialScrollIndex.ts"],"sourcesContent":["/**\n * Calculates the initial scroll index for a number picker based on the desired value and configuration.\n * Handles both infinite and non-infinite scroll modes, taking into account padding and repetition.\n * \n * @param {Object} variables - Configuration object for scroll index calculation\n * @param {boolean} variables.disableInfiniteScroll - Whether infinite scroll is disabled\n * @param {number} variables.interval - The interval between consecutive numbers\n * @param {number} variables.numberOfItems - Total number of items in the picker\n * @param {number} variables.padWithNItems - Number of empty items to pad with\n * @param {number} variables.repeatNumbersNTimes - How many times to repeat the number sequence\n * @param {number} variables.value - The desired initial value\n * \n * @returns {number} The calculated initial scroll index\n * \n * @example\n * // With infinite scroll enabled\n * getInitialScrollIndex({\n * disableInfiniteScroll: false,\n * interval: 1,\n * numberOfItems: 24,\n * padWithNItems: 2,\n * repeatNumbersNTimes: 3,\n * value: 12\n * })\n * // Returns: 38\n * \n * @example\n * // With infinite scroll disabled\n * getInitialScrollIndex({\n * disableInfiniteScroll: true,\n * interval: 1,\n * numberOfItems: 24,\n * padWithNItems: 2,\n * repeatNumbersNTimes: 1,\n * value: 12\n * })\n * // Returns: 12\n */\nexport const getInitialScrollIndex = (variables: {\n disableInfiniteScroll: boolean;\n interval: number;\n numberOfItems: number;\n padWithNItems: number;\n repeatNumbersNTimes: number;\n value: number;\n}) => {\n const {\n disableInfiniteScroll,\n interval,\n numberOfItems,\n padWithNItems,\n repeatNumbersNTimes,\n value,\n } = variables;\n\n return Math.max(\n numberOfItems * Math.floor(repeatNumbersNTimes / 2) +\n ((value / interval + numberOfItems) % numberOfItems) -\n (!disableInfiniteScroll ? padWithNItems : 0),\n 0\n );\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,qBAAqB,GAAIC,SAOrC,IAAK;EACF,MAAM;IACFC,qBAAqB;IACrBC,QAAQ;IACRC,aAAa;IACbC,aAAa;IACbC,mBAAmB;IACnBC;EACJ,CAAC,GAAGN,SAAS;EAEb,OAAOO,IAAI,CAACC,GAAG,CACXL,aAAa,GAAGI,IAAI,CAACE,KAAK,CAACJ,mBAAmB,GAAG,CAAC,CAAC,GAC9C,CAACC,KAAK,GAAGJ,QAAQ,GAAGC,aAAa,IAAIA,aAAc,IACnD,CAACF,qBAAqB,GAAGG,aAAa,GAAG,CAAC,CAAC,EAChD,CACJ,CAAC;AACL,CAAC","ignoreList":[]}
@@ -1,4 +1,32 @@
1
+ /**
2
+ * Safely extracts and validates initial duration values, ensuring all values are valid numbers.
3
+ * Returns a duration object with safe default values (0) for any invalid or missing inputs.
4
+ *
5
+ * @param {Object} [initialValue] - Optional initial duration values
6
+ * @param {number} [initialValue.days] - Initial days value
7
+ * @param {number} [initialValue.hours] - Initial hours value
8
+ * @param {number} [initialValue.minutes] - Initial minutes value
9
+ * @param {number} [initialValue.seconds] - Initial seconds value
10
+ *
11
+ * @returns {{ days: number; hours: number; minutes: number; seconds: number }} An object containing safe duration values
12
+ *
13
+ * @example
14
+ * // With valid values
15
+ * getSafeInitialValue({ days: 1, hours: 2, minutes: 30, seconds: 45 })
16
+ * // Returns: { days: 1, hours: 2, minutes: 30, seconds: 45 }
17
+ *
18
+ * @example
19
+ * // With invalid values
20
+ * getSafeInitialValue({ days: NaN, hours: 'invalid', minutes: undefined })
21
+ * // Returns: { days: 0, hours: 0, minutes: 0, seconds: 0 }
22
+ *
23
+ * @example
24
+ * // With undefined input
25
+ * getSafeInitialValue(undefined)
26
+ * // Returns: { days: 0, hours: 0, minutes: 0, seconds: 0 }
27
+ */
1
28
  export const getSafeInitialValue = initialValue => ({
29
+ days: typeof (initialValue === null || initialValue === void 0 ? void 0 : initialValue.days) === "number" && !isNaN(initialValue === null || initialValue === void 0 ? void 0 : initialValue.days) ? initialValue.days : 0,
2
30
  hours: typeof (initialValue === null || initialValue === void 0 ? void 0 : initialValue.hours) === "number" && !isNaN(initialValue === null || initialValue === void 0 ? void 0 : initialValue.hours) ? initialValue.hours : 0,
3
31
  minutes: typeof (initialValue === null || initialValue === void 0 ? void 0 : initialValue.minutes) === "number" && !isNaN(initialValue === null || initialValue === void 0 ? void 0 : initialValue.minutes) ? initialValue.minutes : 0,
4
32
  seconds: typeof (initialValue === null || initialValue === void 0 ? void 0 : initialValue.seconds) === "number" && !isNaN(initialValue === null || initialValue === void 0 ? void 0 : initialValue.seconds) ? initialValue.seconds : 0
@@ -1 +1 @@
1
- {"version":3,"names":["getSafeInitialValue","initialValue","hours","isNaN","minutes","seconds"],"sources":["getSafeInitialValue.ts"],"sourcesContent":["export const getSafeInitialValue = (\n initialValue:\n | {\n hours?: number;\n minutes?: number;\n seconds?: number;\n }\n | undefined\n) => ({\n hours:\n typeof initialValue?.hours === \"number\" && !isNaN(initialValue?.hours)\n ? initialValue.hours\n : 0,\n minutes:\n typeof initialValue?.minutes === \"number\" &&\n !isNaN(initialValue?.minutes)\n ? initialValue.minutes\n : 0,\n seconds:\n typeof initialValue?.seconds === \"number\" &&\n !isNaN(initialValue?.seconds)\n ? initialValue.seconds\n : 0,\n});\n"],"mappings":"AAAA,OAAO,MAAMA,mBAAmB,GAC5BC,YAMe,KACb;EACFC,KAAK,EACD,QAAOD,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEC,KAAK,MAAK,QAAQ,IAAI,CAACC,KAAK,CAACF,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEC,KAAK,CAAC,GAChED,YAAY,CAACC,KAAK,GAClB,CAAC;EACXE,OAAO,EACH,QAAOH,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEG,OAAO,MAAK,QAAQ,IACzC,CAACD,KAAK,CAACF,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEG,OAAO,CAAC,GACvBH,YAAY,CAACG,OAAO,GACpB,CAAC;EACXC,OAAO,EACH,QAAOJ,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEI,OAAO,MAAK,QAAQ,IACzC,CAACF,KAAK,CAACF,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEI,OAAO,CAAC,GACvBJ,YAAY,CAACI,OAAO,GACpB;AACd,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["getSafeInitialValue","initialValue","days","isNaN","hours","minutes","seconds"],"sources":["getSafeInitialValue.ts"],"sourcesContent":["/**\n * Safely extracts and validates initial duration values, ensuring all values are valid numbers.\n * Returns a duration object with safe default values (0) for any invalid or missing inputs.\n * \n * @param {Object} [initialValue] - Optional initial duration values\n * @param {number} [initialValue.days] - Initial days value\n * @param {number} [initialValue.hours] - Initial hours value\n * @param {number} [initialValue.minutes] - Initial minutes value\n * @param {number} [initialValue.seconds] - Initial seconds value\n * \n * @returns {{ days: number; hours: number; minutes: number; seconds: number }} An object containing safe duration values\n * \n * @example\n * // With valid values\n * getSafeInitialValue({ days: 1, hours: 2, minutes: 30, seconds: 45 })\n * // Returns: { days: 1, hours: 2, minutes: 30, seconds: 45 }\n * \n * @example\n * // With invalid values\n * getSafeInitialValue({ days: NaN, hours: 'invalid', minutes: undefined })\n * // Returns: { days: 0, hours: 0, minutes: 0, seconds: 0 }\n * \n * @example\n * // With undefined input\n * getSafeInitialValue(undefined)\n * // Returns: { days: 0, hours: 0, minutes: 0, seconds: 0 }\n */\nexport const getSafeInitialValue = (\n initialValue:\n | {\n days?: number;\n hours?: number;\n minutes?: number;\n seconds?: number;\n }\n | undefined\n) => ({\n days:\n typeof initialValue?.days === \"number\" && !isNaN(initialValue?.days)\n ? initialValue.days\n : 0,\n hours:\n typeof initialValue?.hours === \"number\" && !isNaN(initialValue?.hours)\n ? initialValue.hours\n : 0,\n minutes:\n typeof initialValue?.minutes === \"number\" &&\n !isNaN(initialValue?.minutes)\n ? initialValue.minutes\n : 0,\n seconds:\n typeof initialValue?.seconds === \"number\" &&\n !isNaN(initialValue?.seconds)\n ? initialValue.seconds\n : 0,\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,mBAAmB,GAC5BC,YAOe,KACb;EACFC,IAAI,EACA,QAAOD,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEC,IAAI,MAAK,QAAQ,IAAI,CAACC,KAAK,CAACF,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEC,IAAI,CAAC,GAC9DD,YAAY,CAACC,IAAI,GACjB,CAAC;EACXE,KAAK,EACD,QAAOH,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEG,KAAK,MAAK,QAAQ,IAAI,CAACD,KAAK,CAACF,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEG,KAAK,CAAC,GAChEH,YAAY,CAACG,KAAK,GAClB,CAAC;EACXC,OAAO,EACH,QAAOJ,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEI,OAAO,MAAK,QAAQ,IACzC,CAACF,KAAK,CAACF,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEI,OAAO,CAAC,GACvBJ,YAAY,CAACI,OAAO,GACpB,CAAC;EACXC,OAAO,EACH,QAAOL,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEK,OAAO,MAAK,QAAQ,IACzC,CAACH,KAAK,CAACF,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEK,OAAO,CAAC,GACvBL,YAAY,CAACK,OAAO,GACpB;AACd,CAAC,CAAC","ignoreList":[]}
@@ -1,3 +1,28 @@
1
+ /**
2
+ * Formats a number by optionally padding it with a leading zero or space.
3
+ * Numbers less than 10 are padded based on the options provided.
4
+ *
5
+ * @param {number} value - The number to format
6
+ * @param {Object} [options] - Optional formatting options
7
+ * @param {boolean} [options.padWithZero] - Whether to pad with zero (true) or space (false)
8
+ *
9
+ * @returns {string} The formatted number string
10
+ *
11
+ * @example
12
+ * // Pad with zero
13
+ * padNumber(5, { padWithZero: true })
14
+ * // Returns: '05'
15
+ *
16
+ * @example
17
+ * // Pad with space
18
+ * padNumber(5, { padWithZero: false })
19
+ * // Returns: ' 5'
20
+ *
21
+ * @example
22
+ * // No padding needed
23
+ * padNumber(15)
24
+ * // Returns: '15'
25
+ */
1
26
  export const padNumber = (value, options) => {
2
27
  if (value < 10) {
3
28
  return (options !== null && options !== void 0 && options.padWithZero ? "0" : " ") + value;
@@ -1 +1 @@
1
- {"version":3,"names":["padNumber","value","options","padWithZero","String"],"sources":["padNumber.ts"],"sourcesContent":["export const padNumber = (\n value: number,\n options?: { padWithZero?: boolean }\n): string => {\n if (value < 10) {\n return (options?.padWithZero ? \"0\" : \" \") + value;\n } else {\n return String(value);\n }\n};\n"],"mappings":"AAAA,OAAO,MAAMA,SAAS,GAAGA,CACrBC,KAAa,EACbC,OAAmC,KAC1B;EACT,IAAID,KAAK,GAAG,EAAE,EAAE;IACZ,OAAO,CAACC,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEC,WAAW,GAAG,GAAG,GAAG,GAAG,IAAIF,KAAK;EACrD,CAAC,MAAM;IACH,OAAOG,MAAM,CAACH,KAAK,CAAC;EACxB;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["padNumber","value","options","padWithZero","String"],"sources":["padNumber.ts"],"sourcesContent":["/**\n * Formats a number by optionally padding it with a leading zero or space.\n * Numbers less than 10 are padded based on the options provided.\n * \n * @param {number} value - The number to format\n * @param {Object} [options] - Optional formatting options\n * @param {boolean} [options.padWithZero] - Whether to pad with zero (true) or space (false)\n * \n * @returns {string} The formatted number string\n * \n * @example\n * // Pad with zero\n * padNumber(5, { padWithZero: true })\n * // Returns: '05'\n * \n * @example\n * // Pad with space\n * padNumber(5, { padWithZero: false })\n * // Returns: ' 5'\n * \n * @example\n * // No padding needed\n * padNumber(15)\n * // Returns: '15'\n */\nexport const padNumber = (\n value: number,\n options?: { padWithZero?: boolean }\n): string => {\n if (value < 10) {\n return (options?.padWithZero ? \"0\" : \" \") + value;\n } else {\n return String(value);\n }\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,SAAS,GAAGA,CACrBC,KAAa,EACbC,OAAmC,KAC1B;EACT,IAAID,KAAK,GAAG,EAAE,EAAE;IACZ,OAAO,CAACC,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEC,WAAW,GAAG,GAAG,GAAG,GAAG,IAAIF,KAAK;EACrD,CAAC,MAAM;IACH,OAAOG,MAAM,CAACH,KAAK,CAAC;EACxB;AACJ,CAAC","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { DurationScrollProps, DurationScrollRef } from "./types";
3
+ declare const _default: React.NamedExoticComponent<DurationScrollProps & React.RefAttributes<DurationScrollRef>>;
4
+ export default _default;
@@ -1,4 +1,2 @@
1
- import React from "react";
2
- import type { DurationScrollProps, DurationScrollRef } from "./types";
3
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<DurationScrollProps & React.RefAttributes<DurationScrollRef>>>;
4
- export default _default;
1
+ export { default } from "./DurationScroll";
2
+ export * from "./types";
@@ -1,24 +1,24 @@
1
- import type { MutableRefObject } from "react";
2
- import type { View, FlatList as RNFlatList, FlatListProps as RNFlatListProps } from "react-native";
1
+ import type { RefObject } from "react";
2
+ import type { View } from "react-native";
3
3
  import type { generateStyles } from "../TimerPicker/styles";
4
- export type CustomFlatList = <ItemT = any>(props: React.PropsWithChildren<RNFlatListProps<ItemT> & React.RefAttributes<RNFlatList<ItemT>>>, ref: React.ForwardedRef<RNFlatList<ItemT>>) => React.ReactElement | null;
5
4
  export interface DurationScrollProps {
6
5
  Audio?: any;
7
- FlatList?: CustomFlatList;
6
+ FlatList?: any;
8
7
  Haptics?: any;
9
8
  LinearGradient?: any;
10
9
  MaskedView?: any;
11
10
  aggressivelyGetLatestDuration: boolean;
12
11
  allowFontScaling?: boolean;
13
12
  amLabel?: string;
14
- clickSoundAsset?: SoundAssetType;
13
+ clickSoundAsset?: SoundAsset;
14
+ decelerationRate?: number | "normal" | "fast";
15
15
  disableInfiniteScroll?: boolean;
16
16
  initialValue?: number;
17
17
  interval: number;
18
18
  is12HourPicker?: boolean;
19
19
  isDisabled?: boolean;
20
20
  label?: string | React.ReactElement;
21
- limit?: LimitType;
21
+ limit?: Limit;
22
22
  maximumValue: number;
23
23
  onDurationChange: (duration: number) => void;
24
24
  padNumbersWithZero?: boolean;
@@ -32,7 +32,7 @@ export interface DurationScrollProps {
32
32
  testID?: string;
33
33
  }
34
34
  export interface DurationScrollRef {
35
- latestDuration: MutableRefObject<number>;
35
+ latestDuration: RefObject<number>;
36
36
  reset: (options?: {
37
37
  animated?: boolean;
38
38
  }) => void;
@@ -50,13 +50,17 @@ export type LinearGradientProps = React.ComponentProps<typeof View> & {
50
50
  locations?: number[] | null;
51
51
  start?: LinearGradientPoint | null;
52
52
  };
53
- export type LimitType = {
53
+ export type Limit = {
54
54
  max?: number;
55
55
  min?: number;
56
56
  };
57
- export type SoundAssetType = number | {
57
+ export type SoundAsset = number | {
58
58
  headers?: Record<string, string>;
59
59
  overrideFileExtensionAndroid?: string;
60
60
  uri: string;
61
61
  };
62
+ export type ExpoAvAudioInstance = {
63
+ replayAsync: () => Promise<void>;
64
+ unloadAsync: () => Promise<void>;
65
+ };
62
66
  export {};
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import type { ModalProps } from "./types";
3
+ export declare const Modal: (props: ModalProps) => React.JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<(props: ModalProps) => React.JSX.Element>;
5
+ export default _default;
@@ -1,5 +1,2 @@
1
- import React from "react";
2
- import type { ModalProps } from "./types";
3
- export declare const Modal: (props: ModalProps) => React.JSX.Element;
4
- declare const _default: React.MemoExoticComponent<(props: ModalProps) => React.JSX.Element>;
5
- export default _default;
1
+ export { default } from "./Modal";
2
+ export * from "./types";
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { TimerPickerProps, TimerPickerRef } from "./types";
3
+ declare const _default: React.NamedExoticComponent<TimerPickerProps & React.RefAttributes<TimerPickerRef>>;
4
+ export default _default;
@@ -1,4 +1,3 @@
1
- import React from "react";
2
- import type { TimerPickerProps, TimerPickerRef } from "./types";
3
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<TimerPickerProps & React.RefAttributes<TimerPickerRef>>>;
4
- export default _default;
1
+ export { default } from "./TimerPicker";
2
+ export * from "./types";
3
+ export * from "./styles";