@getopenpay/openpay-js-react 0.0.1-alpha.09717a2
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.
- package/.env.development +1 -0
- package/.env.production +1 -0
- package/.env.staging +1 -0
- package/.eslintrc.cjs +18 -0
- package/.github/workflows/alpha-release.yml +39 -0
- package/.github/workflows/release.yml +30 -0
- package/Makefile +37 -0
- package/README.md +14 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.js +3685 -0
- package/example/.eslintrc.json +3 -0
- package/example/Makefile +10 -0
- package/example/README.md +36 -0
- package/example/next.config.mjs +4 -0
- package/example/package-lock.json +5283 -0
- package/example/package.json +27 -0
- package/example/postcss.config.mjs +8 -0
- package/example/public/next.svg +1 -0
- package/example/public/vercel.svg +1 -0
- package/example/src/app/elements/_components/FormWrapper.tsx +18 -0
- package/example/src/app/elements/_components/InputField.tsx +11 -0
- package/example/src/app/elements/card/page.tsx +54 -0
- package/example/src/app/elements/card-cvc/page.tsx +29 -0
- package/example/src/app/elements/card-expiry/page.tsx +29 -0
- package/example/src/app/elements/card-number/page.tsx +29 -0
- package/example/src/app/favicon.ico +0 -0
- package/example/src/app/globals.css +14 -0
- package/example/src/app/layout.tsx +22 -0
- package/example/src/app/page.tsx +119 -0
- package/example/tailwind.config.ts +11 -0
- package/example/tsconfig.json +26 -0
- package/lib/components/_common/frame.tsx +73 -0
- package/lib/components/card-cvc.tsx +11 -0
- package/lib/components/card-expiry.tsx +11 -0
- package/lib/components/card-number.tsx +11 -0
- package/lib/components/card.tsx +11 -0
- package/lib/components/form.tsx +100 -0
- package/lib/hooks/context.ts +17 -0
- package/lib/hooks/use-openpay-elements.ts +12 -0
- package/lib/index.ts +16 -0
- package/lib/utils/constants.ts +1 -0
- package/lib/utils/element.ts +5 -0
- package/lib/utils/event.ts +66 -0
- package/lib/utils/style.ts +17 -0
- package/lib/vite-env.d.ts +1 -0
- package/ngrok.example.yml +6 -0
- package/package.json +44 -0
- package/playwright.config.ts +37 -0
- package/tests/card-cvc.test.ts +68 -0
- package/tests/card-element.test.ts +113 -0
- package/tests/card-expiry.test.ts +61 -0
- package/tests/card-number.test.ts +61 -0
- package/tests/constants.ts +97 -0
- package/tsconfig.build.json +28 -0
- package/tsconfig.json +11 -0
- package/tsconfig.node.json +13 -0
- package/vite.config.ts +36 -0
package/vite.config.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import { resolve } from 'path'
|
|
3
|
+
import react from '@vitejs/plugin-react'
|
|
4
|
+
import dts from 'vite-plugin-dts'
|
|
5
|
+
|
|
6
|
+
// https://vitejs.dev/config/
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
esbuild: {
|
|
9
|
+
drop: process.env.NODE_ENV === 'development' ? [] : ['console', 'debugger'],
|
|
10
|
+
},
|
|
11
|
+
build: {
|
|
12
|
+
copyPublicDir: false,
|
|
13
|
+
lib: {
|
|
14
|
+
entry: resolve(__dirname, 'lib/index.ts'),
|
|
15
|
+
formats: ['es'],
|
|
16
|
+
},
|
|
17
|
+
rollupOptions: {
|
|
18
|
+
external: ['react', 'react-dom', 'react/jsx-runtime'],
|
|
19
|
+
output: {
|
|
20
|
+
globals: {
|
|
21
|
+
react: 'React',
|
|
22
|
+
'react-dom': 'ReactDOM',
|
|
23
|
+
},
|
|
24
|
+
assetFileNames: 'assets/[name][extname]',
|
|
25
|
+
entryFileNames: '[name].js',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
plugins: [
|
|
30
|
+
react(),
|
|
31
|
+
dts({
|
|
32
|
+
rollupTypes: true,
|
|
33
|
+
tsconfigPath: resolve(__dirname, 'tsconfig.build.json'),
|
|
34
|
+
}),
|
|
35
|
+
],
|
|
36
|
+
});
|