rebill-web-components-sdk 1.8.18 → 1.8.20
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/dist/cjs/index-C-VTnc0I.js.map +1 -1
- package/dist/collection/index.js +3 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/components/p-8BpuJ_V5.js.map +1 -1
- package/dist/esm/index-D8cwEAmw.js.map +1 -1
- package/dist/rebill-web-components-sdk/p-D8cwEAmw.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/jsx.d.ts +73 -0
- package/package.json +6 -3
- package/readme.md +22 -0
package/dist/types/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* to consume components of this package as outlined in the `README.md`.
|
|
9
9
|
*/
|
|
10
10
|
export type * from './components.d.ts';
|
|
11
|
+
import './jsx.d.ts';
|
|
11
12
|
export { initializeRebillSDK, RebillSDK, type Environment, type RebillSDKConfig, } from './initialize';
|
|
12
13
|
export { getAPIConfig, getCurrentEnvironment, isDebugMode, type APIConfig } from './api/config';
|
|
13
14
|
export { getAssetURL, setAssetsURL } from './utils/assets';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declaraciones de tipos para usar los web components de Rebill en React/JSX
|
|
3
|
+
*
|
|
4
|
+
* Este archivo extiende el namespace JSX.IntrinsicElements para incluir
|
|
5
|
+
* todos los custom elements del SDK de Rebill.
|
|
6
|
+
*
|
|
7
|
+
* Los clientes pueden referenciar este archivo en su tsconfig.json:
|
|
8
|
+
*
|
|
9
|
+
* ```json
|
|
10
|
+
* {
|
|
11
|
+
* "compilerOptions": {
|
|
12
|
+
* "types": ["rebill-web-components-sdk/jsx"]
|
|
13
|
+
* }
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { JSX as LocalJSX } from './components';
|
|
19
|
+
|
|
20
|
+
type StencilToReact<T> = {
|
|
21
|
+
[P in keyof T]?: T[P] extends ((...args: any[]) => any) ? T[P] :
|
|
22
|
+
T[P] extends object ? Partial<T[P]> :
|
|
23
|
+
T[P];
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type HTMLAttributesBase = {
|
|
27
|
+
className?: string;
|
|
28
|
+
class?: string;
|
|
29
|
+
style?: any;
|
|
30
|
+
id?: string;
|
|
31
|
+
key?: string | number;
|
|
32
|
+
ref?: any;
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
declare global {
|
|
37
|
+
export namespace JSX {
|
|
38
|
+
interface IntrinsicElements {
|
|
39
|
+
'rebill-checkout': StencilToReact<LocalJSX.RebillCheckout> & HTMLAttributesBase;
|
|
40
|
+
'rebill-checkout-form': StencilToReact<LocalJSX.RebillCheckoutForm> & HTMLAttributesBase;
|
|
41
|
+
'rebill-checkout-single-column': StencilToReact<LocalJSX.RebillCheckoutSingleColumn> & HTMLAttributesBase;
|
|
42
|
+
'rebill-renewal': StencilToReact<LocalJSX.RebillRenewal> & HTMLAttributesBase;
|
|
43
|
+
'rebill-button': StencilToReact<LocalJSX.RebillButton> & HTMLAttributesBase;
|
|
44
|
+
'rebill-card': StencilToReact<LocalJSX.RebillCard> & HTMLAttributesBase;
|
|
45
|
+
'rebill-icon': StencilToReact<LocalJSX.RebillIcon> & HTMLAttributesBase;
|
|
46
|
+
'rebill-input-text': StencilToReact<LocalJSX.RebillInputText> & HTMLAttributesBase;
|
|
47
|
+
'rebill-input-select': StencilToReact<LocalJSX.RebillInputSelect> & HTMLAttributesBase;
|
|
48
|
+
'rebill-input-checkbox': StencilToReact<LocalJSX.RebillInputCheckbox> & HTMLAttributesBase;
|
|
49
|
+
'rebill-input-phone': StencilToReact<LocalJSX.RebillInputPhone> & HTMLAttributesBase;
|
|
50
|
+
'rebill-input-combo': StencilToReact<LocalJSX.RebillInputCombo> & HTMLAttributesBase;
|
|
51
|
+
'rebill-typography': StencilToReact<LocalJSX.RebillTypography> & HTMLAttributesBase;
|
|
52
|
+
'rebill-container': StencilToReact<LocalJSX.RebillContainer> & HTMLAttributesBase;
|
|
53
|
+
'rebill-flex-container': StencilToReact<LocalJSX.RebillFlexContainer> & HTMLAttributesBase;
|
|
54
|
+
'rebill-grid-container': StencilToReact<LocalJSX.RebillGridContainer> & HTMLAttributesBase;
|
|
55
|
+
'rebill-divider': StencilToReact<LocalJSX.RebillDivider> & HTMLAttributesBase;
|
|
56
|
+
'rebill-vertical-divider': StencilToReact<LocalJSX.RebillVerticalDivider> & HTMLAttributesBase;
|
|
57
|
+
'rebill-summary': StencilToReact<LocalJSX.RebillSummary> & HTMLAttributesBase;
|
|
58
|
+
'rebill-modal-overlay': StencilToReact<LocalJSX.RebillModalOverlay> & HTMLAttributesBase;
|
|
59
|
+
'rebill-footer': StencilToReact<LocalJSX.RebillFooter> & HTMLAttributesBase;
|
|
60
|
+
'rebill-form': StencilToReact<LocalJSX.RebillForm> & HTMLAttributesBase;
|
|
61
|
+
'rebill-bank-selector': StencilToReact<LocalJSX.RebillBankSelector> & HTMLAttributesBase;
|
|
62
|
+
'rebill-card-carousel': StencilToReact<LocalJSX.RebillCardCarousel> & HTMLAttributesBase;
|
|
63
|
+
'rebill-card-icon': StencilToReact<LocalJSX.RebillCardIcon> & HTMLAttributesBase;
|
|
64
|
+
'rebill-installments': StencilToReact<LocalJSX.RebillInstallments> & HTMLAttributesBase;
|
|
65
|
+
'rebill-processing-payment': StencilToReact<LocalJSX.RebillProcessingPayment> & HTMLAttributesBase;
|
|
66
|
+
'rebill-mode-sandbox': StencilToReact<LocalJSX.RebillModeSandbox> & HTMLAttributesBase;
|
|
67
|
+
'rebill-mode-sandbox-mobile': StencilToReact<LocalJSX.RebillModeSandboxMobile> & HTMLAttributesBase;
|
|
68
|
+
'rebill-timeline-debit-day': StencilToReact<LocalJSX.RebillTimelineDebitDay> & HTMLAttributesBase;
|
|
69
|
+
'rebill-timeline-free-trial': StencilToReact<LocalJSX.RebillTimelineFreeTrial> & HTMLAttributesBase;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rebill-web-components-sdk",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.20",
|
|
4
4
|
"description": "Stencil Component Starter",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
17
|
"import": "./dist/components/rebill-checkout.js",
|
|
18
|
-
"types": "./dist/
|
|
18
|
+
"types": "./dist/types/index.d.ts"
|
|
19
19
|
},
|
|
20
20
|
"./config": {
|
|
21
21
|
"import": "./dist/index.js",
|
|
@@ -24,12 +24,15 @@
|
|
|
24
24
|
},
|
|
25
25
|
"./rebill-checkout": {
|
|
26
26
|
"import": "./dist/components/rebill-checkout.js",
|
|
27
|
-
"types": "./dist/
|
|
27
|
+
"types": "./dist/types/index.d.ts"
|
|
28
28
|
},
|
|
29
29
|
"./components": {
|
|
30
30
|
"import": "./dist/components/index.js",
|
|
31
31
|
"types": "./dist/components/index.d.ts"
|
|
32
32
|
},
|
|
33
|
+
"./jsx": {
|
|
34
|
+
"types": "./dist/types/jsx.d.ts"
|
|
35
|
+
},
|
|
33
36
|
"./loader": {
|
|
34
37
|
"import": "./loader/index.js",
|
|
35
38
|
"require": "./loader/index.cjs.js",
|
package/readme.md
CHANGED
|
@@ -53,6 +53,28 @@ pnpm install
|
|
|
53
53
|
pnpm run dev
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
+
## 📘 TypeScript / JSX Support
|
|
57
|
+
|
|
58
|
+
**TypeScript support is now automatic!** 🎉
|
|
59
|
+
|
|
60
|
+
If you were experiencing this error:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
Property 'rebill-checkout' does not exist on type 'JSX.IntrinsicElements'.
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Just update to the latest version and import from the SDK:
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
import { initializeRebillSDK } from 'rebill-web-components-sdk/config';
|
|
70
|
+
// or
|
|
71
|
+
import { defineCustomElements } from 'rebill-web-components-sdk/loader';
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The JSX types will load automatically. **No `tsconfig.json` configuration needed!**
|
|
75
|
+
|
|
76
|
+
**See the [TypeScript JSX Setup Guide](./TYPESCRIPT_JSX_SETUP.md) for more details and alternative solutions.**
|
|
77
|
+
|
|
56
78
|
```typescript
|
|
57
79
|
// Or programmatically
|
|
58
80
|
import { defineCustomElements } from 'rebill-web-components-sdk/loader';
|