@kmeltzer127/react-pelcro-js 1.0.0-beta.2

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Pelcro Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,135 @@
1
+
2
+
3
+ <p align="center">
4
+ <img src="https://docs-react-elements.pelcro.com/img/logo.png" width="100px" alt="Pelcro logo"/>
5
+ </p>
6
+
7
+ <h1 align="center" style="border-bottom: none;">Pelcro React Elements</h1>
8
+
9
+ <p align="center">
10
+ Tailor your <a href="https://www.pelcro.com/">Pelcro</a> experience to the needs of your clients using our React components
11
+ </p>
12
+
13
+ <p align="center">
14
+ <img src="https://github.com/pelcro-inc/react-pelcro-js/actions/workflows/release.yml/badge.svg">
15
+ <img src="https://github.com/pelcro-inc/react-pelcro-js/actions/workflows/tests.yml/badge.svg">
16
+ <img src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
17
+ </br>
18
+ <img src="https://img.shields.io/npm/v/@pelcro/react-pelcro-js/latest">
19
+ <img src="https://img.shields.io/npm/v/@pelcro/react-pelcro-js/beta">
20
+ </p>
21
+
22
+
23
+ ## Features
24
+
25
+ - Integrates with our JS SDK out-of-the-box
26
+ - Supports different levels of customization, need modal-level control? use [Modals](https://docs-react-elements.pelcro.com/Modals/introduction), want fine-grained control? use [Containers](https://docs-react-elements.pelcro.com/Containers/introduction)
27
+ - Provides [`usePelcro` hook](https://docs-react-elements.pelcro.com/usePelcro) which provides a global store for all Pelcro related data and actions
28
+ - Consistent UX across different browsers
29
+ - Easy styling customization using `className` prop and regular CSS
30
+ - First-class Localization support using [react-i18next](https://react.i18next.com/)
31
+ ## Documentation
32
+
33
+ For a complete reference with live examples, check the
34
+ [React Pelcro elements docs](https://docs-react-elements.pelcro.com/)
35
+
36
+
37
+ ## Installation
38
+
39
+ To use Pelcro components, all you need to do is install the `@pelcro/react-pelcro-js` package
40
+
41
+ ```bash
42
+ yarn add @pelcro/react-pelcro-js
43
+
44
+ or
45
+
46
+ npm install @pelcro/react-pelcro-js
47
+ ```
48
+
49
+ ## Minimal example
50
+
51
+ ```javascript
52
+ import React from "react";
53
+ import {
54
+ usePelcro,
55
+ PelcroModalController,
56
+ Dashboard,
57
+ DashboardOpenButton,
58
+ SelectModal,
59
+ LoginModal,
60
+ RegisterModal,
61
+ PaymentMethodUpdateModal,
62
+ PaymentMethodSelectModal,
63
+ SubscriptionCreateModal,
64
+ SubscriptionRenewModal,
65
+ NewsLetter,
66
+ PaymentSuccessModal,
67
+ MeterModal,
68
+ UserUpdateModal,
69
+ AddressCreateModal,
70
+ AddressUpdateModal,
71
+ PasswordResetModal,
72
+ PasswordForgotModal,
73
+ CartModal,
74
+ ShopView,
75
+ OrderConfirmModal,
76
+ OrderCreateModal,
77
+ GiftCreateModal,
78
+ GiftRedeemModal,
79
+ PasswordChangeModal,
80
+ AddressSelectModal,
81
+ ProfilePicChangeModal,
82
+ Notification
83
+ } from "@pelcro/react-pelcro-js";
84
+ import "@pelcro/react-pelcro-js/dist/pelcro.css";
85
+
86
+ export default function Main() {
87
+ const { switchView } = usePelcro();
88
+
89
+ return (
90
+ <>
91
+ <button onClick={() => switchView("login")}>Login</button>
92
+ <button onClick={() => switchView("dashboard")}>My dashboard</button>
93
+ <button onClick={() => switchView("plan-select")}>Subscribe</button>
94
+
95
+ <PelcroModalController>
96
+ <MeterModal />
97
+ <LoginModal />
98
+ <RegisterModal />
99
+ <UserUpdateModal />
100
+ <Dashboard />
101
+ <DashboardOpenButton />
102
+ <ProfilePicChangeModal />
103
+ <PasswordForgotModal />
104
+ <PasswordChangeModal />
105
+ <PasswordResetModal />
106
+ <PaymentMethodUpdateModal />
107
+ <PaymentMethodSelectModal />
108
+ <SelectModal />
109
+ <NewsLetter />
110
+ <AddressCreateModal />
111
+ <AddressSelectModal />
112
+ <AddressUpdateModal />
113
+ <SubscriptionCreateModal />
114
+ <SubscriptionRenewModal />
115
+ <PaymentSuccessModal />
116
+ <GiftCreateModal />
117
+ <GiftRedeemModal />
118
+ <ShopView />
119
+ <CartModal />
120
+ <OrderCreateModal />
121
+ <OrderConfirmModal />
122
+ <Notification />
123
+ </PelcroModalController>
124
+ </>
125
+ );
126
+ }
127
+
128
+ ```
129
+
130
+
131
+ ## License
132
+
133
+ [MIT](https://choosealicense.com/licenses/mit/)
134
+
135
+