Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ttdung11t2/react-native-confirmation-code-input
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: retyui/react-native-confirmation-code-field
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
Loading
Showing with 13,419 additions and 8,005 deletions.
  1. +11 −0 .editorconfig
  2. +21 −0 .eslintrc.js
  3. +36 −0 .github/workflows/nodejs.yml
  4. +9 −67 .gitignore
  5. +0 −3 .npmignore
  6. +6 −0 .size-limit.json
  7. +934 −0 .yarn/releases/yarn-4.6.0.cjs
  8. +3 −0 .yarnrc.yml
  9. +198 −0 API.md
  10. +231 −0 CHANGELOG.md
  11. +2 −2 LICENSE
  12. +139 −106 README.md
  13. +3 −0 babel.config.js
  14. +0 −296 components/ConfirmationCodeInput.js
  15. +0 −3 example/.babelrc
  16. +0 −6 example/.buckconfig
  17. +0 −45 example/.flowconfig
  18. +0 −1 example/.gitattributes
  19. +0 −53 example/.gitignore
  20. +0 −12 example/__tests__/index.android.js
  21. +0 −12 example/__tests__/index.ios.js
  22. +0 −65 example/android/app/BUCK
  23. +0 −146 example/android/app/build.gradle
  24. +0 −70 example/android/app/proguard-rules.pro
  25. +0 −32 example/android/app/src/main/AndroidManifest.xml
  26. +0 −15 example/android/app/src/main/java/com/example/MainActivity.java
  27. +0 −40 example/android/app/src/main/java/com/example/MainApplication.java
  28. BIN example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
  29. BIN example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
  30. BIN example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
  31. BIN example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  32. +0 −3 example/android/app/src/main/res/values/strings.xml
  33. +0 −8 example/android/app/src/main/res/values/styles.xml
  34. +0 −24 example/android/build.gradle
  35. +0 −20 example/android/gradle.properties
  36. BIN example/android/gradle/wrapper/gradle-wrapper.jar
  37. +0 −164 example/android/gradlew
  38. +0 −8 example/android/keystores/BUCK
  39. +0 −4 example/android/keystores/debug.keystore.properties
  40. +0 −3 example/android/settings.gradle
  41. +0 −4 example/app.json
  42. +0 −1 example/index.android.js
  43. +0 −1 example/index.ios.js
  44. +0 −54 example/ios/example-tvOS/Info.plist
  45. +0 −24 example/ios/example-tvOSTests/Info.plist
  46. +0 −1,251 example/ios/example.xcodeproj/project.pbxproj
  47. +0 −129 example/ios/example.xcodeproj/xcshareddata/xcschemes/example-tvOS.xcscheme
  48. +0 −129 example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme
  49. +0 −16 example/ios/example/AppDelegate.h
  50. +0 −37 example/ios/example/AppDelegate.m
  51. +0 −42 example/ios/example/Base.lproj/LaunchScreen.xib
  52. +0 −38 example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json
  53. +0 −56 example/ios/example/Info.plist
  54. +0 −18 example/ios/example/main.m
  55. +0 −24 example/ios/exampleTests/Info.plist
  56. +0 −70 example/ios/exampleTests/exampleTests.m
  57. +0 −28 example/package.json
  58. +0 −293 example/src/components/ConfirmationCodeInput.js
  59. +0 −199 example/src/index.js
  60. +0 −4,244 example/yarn.lock
  61. +14 −0 examples/DemoCodeField/.gitignore
  62. 0 {example → examples/DemoCodeField}/.watchmanconfig
  63. +30 −0 examples/DemoCodeField/android/build.gradle
  64. +42 −0 examples/DemoCodeField/android/gradle.properties
  65. BIN examples/DemoCodeField/android/gradle/wrapper/gradle-wrapper.jar
  66. +1 −1 {example → examples/DemoCodeField}/android/gradle/wrapper/gradle-wrapper.properties
  67. +234 −0 examples/DemoCodeField/android/gradlew
  68. +89 −90 {example → examples/DemoCodeField}/android/gradlew.bat
  69. +12 −0 examples/DemoCodeField/android/settings.gradle
  70. +28 −0 examples/DemoCodeField/app.json
  71. +3 −0 examples/DemoCodeField/babel.config.js
  72. +5 −0 examples/DemoCodeField/index.js
  73. +7 −0 examples/DemoCodeField/ios/Podfile
  74. +50 −0 examples/DemoCodeField/metro.config.js
  75. +34 −0 examples/DemoCodeField/package.json
  76. +30 −0 examples/DemoCodeField/react-native.config.js
  77. +5 −0 examples/DemoCodeField/src/AnimatedExample/README.md
  78. +125 −0 examples/DemoCodeField/src/AnimatedExample/index.js
  79. +83 −0 examples/DemoCodeField/src/AnimatedExample/styles.js
  80. +24 −0 examples/DemoCodeField/src/App.js
  81. +3 −0 examples/DemoCodeField/src/BasicExample/README.md
  82. +48 −0 examples/DemoCodeField/src/BasicExample/index.js
  83. +19 −0 examples/DemoCodeField/src/BasicExample/styles.js
  84. +3 −0 examples/DemoCodeField/src/FormattingExample/README.md
  85. +53 −0 examples/DemoCodeField/src/FormattingExample/index.js
  86. +26 −0 examples/DemoCodeField/src/FormattingExample/styles.js
  87. +5 −0 examples/DemoCodeField/src/MaskExample/README.md
  88. +67 −0 examples/DemoCodeField/src/MaskExample/index.js
  89. +19 −0 examples/DemoCodeField/src/MaskExample/styles.js
  90. +31 −0 examples/DemoCodeField/src/UnderlineExample/README.md
  91. +51 −0 examples/DemoCodeField/src/UnderlineExample/index.js
  92. +29 −0 examples/DemoCodeField/src/UnderlineExample/styles.js
  93. +3 −0 examples/DemoCodeField/src/UnmaskExample/README.md
  94. +69 −0 examples/DemoCodeField/src/UnmaskExample/index.js
  95. +32 −0 examples/DemoCodeField/src/UnmaskExample/styles.js
  96. +0 −26 index.d.ts
  97. +0 −2 index.js
  98. +15 −0 jest.config.js
  99. +69 −20 package.json
  100. +6 −0 prettier.config.js
  101. +23 −0 src/CodeField.styles.tsx
  102. +122 −0 src/CodeField.tsx
  103. +17 −0 src/Cursor.tsx
  104. +30 −0 src/MaskSymbol.tsx
  105. +153 −0 src/__tests__/CodeField.test.tsx
  106. +33 −0 src/__tests__/Cursor.test.tsx
  107. +40 −0 src/__tests__/MaskSymbol.test.tsx
  108. +2 −0 src/__tests__/delay.ts
  109. +52 −0 src/__tests__/useBlurOnFulfill.test.ts
  110. +154 −0 src/__tests__/useClearByFocusCell.test.ts
  111. +88 −0 src/__tests__/useFocusState.test.ts
  112. +47 −0 src/__tests__/utils.test.ts
  113. +7 −0 src/index.tsx
  114. +23 −0 src/useBlurOnFulfill.ts
  115. +94 −0 src/useClearByFocusCell.ts
  116. +18 −0 src/useEvent.ts
  117. +32 −0 src/useFocusState.ts
  118. +31 −0 src/useTimer.ts
  119. +26 −0 src/utils.ts
  120. +12 −0 tsconfig.json
  121. +9,458 −0 yarn.lock
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 233


[*.md]
trim_trailing_whitespace = false
21 changes: 21 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
parserOptions: {
ecmaVersion: 2023,
sourceType: 'module',
ecmaFeatures: {jsx: true},
},
settings: {
react: {
version: '18.0.0',
},
},
rules: {
"@typescript-eslint/no-explicit-any": "off",
}
};
36 changes: 36 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Code quality

on:
push:
branches:
- master
paths:
- '.github/**'
- 'yarn.lock'
- '**.js'
- '**.ts'
- '**.tsx'
pull_request:
paths:
- '.github/**'
- 'yarn.lock'
- '**.js'
- '**.ts'
- '**.tsx'

jobs:
test_and_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/cache@v4
id: node_modules_cache
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}

- run: yarn install --immutable
if: steps.node_modules_cache.outputs.cache-hit != 'true'

- run: yarn ci
76 changes: 9 additions & 67 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,68 +1,10 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# IDEA
.idea

# IML
*.iml

# OSX
.DS_Store

coverage/
esm/
# yarn berry
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
3 changes: 0 additions & 3 deletions .npmignore

This file was deleted.

6 changes: 6 additions & 0 deletions .size-limit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"limit": "3800 B",
"path": "esm/*.js"
}
]
Loading