@stripe/connect-js 3.3.39-preview-1 → 3.3.39
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/connect.esm.js +34 -91
- package/dist/connect.js +34 -91
- package/dist/pure.esm.js +26 -83
- package/dist/pure.js +26 -83
- package/dist/src/shared.d.ts +1 -1
- package/dist/types/config.d.ts +19 -76
- package/package.json +4 -4
- package/src/shared.ts +25 -42
- package/types/config.ts +22 -121
- package/types/shared.d.ts +97 -19
- package/LICENSE +0 -21
- package/README.md +0 -76
package/types/shared.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type {
|
|
|
2
2
|
ConnectElementCustomMethodConfig,
|
|
3
3
|
ConnectElementCommonMethodConfig,
|
|
4
4
|
} from "./config";
|
|
5
|
+
|
|
5
6
|
export declare type LoadConnectAndInitialize = (
|
|
6
7
|
initParams: IStripeConnectInitParams
|
|
7
8
|
) => StripeConnectInstance;
|
|
@@ -142,6 +143,44 @@ export declare type AppearanceVariables = {
|
|
|
142
143
|
*/
|
|
143
144
|
buttonSecondaryColorText?: string;
|
|
144
145
|
|
|
146
|
+
// Danger Button Colors
|
|
147
|
+
/**
|
|
148
|
+
* The color used as a background for danger buttons to indicate destructive actions. This accepts hex values or RGB/HSL strings.
|
|
149
|
+
*/
|
|
150
|
+
buttonDangerColorBackground?: string;
|
|
151
|
+
/**
|
|
152
|
+
* The color used as a border for danger buttons to indicate destructive actions. This accepts hex values or RGB/HSL strings.
|
|
153
|
+
*/
|
|
154
|
+
buttonDangerColorBorder?: string;
|
|
155
|
+
/**
|
|
156
|
+
* The text color used for danger buttons to indicate destructive actions. This accepts hex values or RGB/HSL strings.
|
|
157
|
+
*/
|
|
158
|
+
buttonDangerColorText?: string;
|
|
159
|
+
|
|
160
|
+
// Button Padding
|
|
161
|
+
/**
|
|
162
|
+
* The horizontal padding used for buttons. This supports pixel values only.
|
|
163
|
+
*/
|
|
164
|
+
buttonPaddingX?: string;
|
|
165
|
+
/**
|
|
166
|
+
* The vertical padding used for buttons. This supports pixel values only.
|
|
167
|
+
*/
|
|
168
|
+
buttonPaddingY?: string;
|
|
169
|
+
|
|
170
|
+
// Button Label Typography
|
|
171
|
+
/**
|
|
172
|
+
* The font size for button label typography. Button label typography variables accept a valid font size value ranging from 1px to 200px, 0.1em to 12em, and 0.1rem to 12rem.
|
|
173
|
+
*/
|
|
174
|
+
buttonLabelFontSize?: string;
|
|
175
|
+
/**
|
|
176
|
+
* The font weight for button label typography. Button label typography variables accept a valid font weight value.
|
|
177
|
+
*/
|
|
178
|
+
buttonLabelFontWeight?: string;
|
|
179
|
+
/**
|
|
180
|
+
* The text transform for button label typography. Button label typography variables accept a valid text transform value.
|
|
181
|
+
*/
|
|
182
|
+
buttonLabelTextTransform?: string;
|
|
183
|
+
|
|
145
184
|
/**
|
|
146
185
|
* The color used for secondary text. This accepts hex values or RGB/RGBA/HSL strings.
|
|
147
186
|
*/
|
|
@@ -166,6 +205,10 @@ export declare type AppearanceVariables = {
|
|
|
166
205
|
* The thickness of text decoration of primary actions and links. This accepts a valid text decoration thickness value.
|
|
167
206
|
*/
|
|
168
207
|
actionPrimaryTextDecorationThickness?: string;
|
|
208
|
+
/**
|
|
209
|
+
* The text transform for the primary actions and links. This accepts a valid text transform value.
|
|
210
|
+
*/
|
|
211
|
+
actionPrimaryTextTransform?: string;
|
|
169
212
|
/**
|
|
170
213
|
* The color used for secondary actions and links. This accepts hex values or RGB/HSL strings.
|
|
171
214
|
*/
|
|
@@ -186,6 +229,10 @@ export declare type AppearanceVariables = {
|
|
|
186
229
|
* The thickness of text decoration of secondary actions and links. This accepts a valid text decoration thickness value.
|
|
187
230
|
*/
|
|
188
231
|
actionSecondaryTextDecorationThickness?: string;
|
|
232
|
+
/**
|
|
233
|
+
* The text transform for the secondary actions and links. This accepts a valid text transform value.
|
|
234
|
+
*/
|
|
235
|
+
actionSecondaryTextTransform?: string;
|
|
189
236
|
|
|
190
237
|
// Neutral Badge Colors
|
|
191
238
|
/**
|
|
@@ -243,6 +290,30 @@ export declare type AppearanceVariables = {
|
|
|
243
290
|
*/
|
|
244
291
|
badgeDangerColorBorder?: string;
|
|
245
292
|
|
|
293
|
+
// Badge Padding
|
|
294
|
+
/**
|
|
295
|
+
* The horizontal padding used for badges. This supports pixel values only.
|
|
296
|
+
*/
|
|
297
|
+
badgePaddingX?: string;
|
|
298
|
+
/**
|
|
299
|
+
* The vertical padding used for badges. This supports pixel values only.
|
|
300
|
+
*/
|
|
301
|
+
badgePaddingY?: string;
|
|
302
|
+
|
|
303
|
+
// Badge Label Typography
|
|
304
|
+
/**
|
|
305
|
+
* The font size for badge label typography. Badge label typography variables accept a valid font size value ranging from 1px to 200px, 0.1em to 12em, and 0.1rem to 12rem.
|
|
306
|
+
*/
|
|
307
|
+
badgeLabelFontSize?: string;
|
|
308
|
+
/**
|
|
309
|
+
* The font weight for badge label typography. Badge label typography variables accept a valid font weight value.
|
|
310
|
+
*/
|
|
311
|
+
badgeLabelFontWeight?: string;
|
|
312
|
+
/**
|
|
313
|
+
* The text transform for badge label typography. Badge label typography variables accept a valid text transform value.
|
|
314
|
+
*/
|
|
315
|
+
badgeLabelTextTransform?: string;
|
|
316
|
+
|
|
246
317
|
// Background
|
|
247
318
|
/**
|
|
248
319
|
* The background color used when highlighting information, like the selected row on a table or particular piece of UI. This accepts hex values or RGB/HSL strings.
|
|
@@ -267,6 +338,24 @@ export declare type AppearanceVariables = {
|
|
|
267
338
|
* The color used for to fill in form items like checkboxes, radio buttons and switches. This accepts hex values or RGB/HSL strings.
|
|
268
339
|
*/
|
|
269
340
|
formAccentColor?: string;
|
|
341
|
+
/**
|
|
342
|
+
* The color used for placeholder text in form items. This accepts hex values or RGB/HSL strings.
|
|
343
|
+
*/
|
|
344
|
+
formPlaceholderTextColor?: string;
|
|
345
|
+
/**
|
|
346
|
+
* The horizontal padding used for input fields in forms. This supports pixel values only.
|
|
347
|
+
*/
|
|
348
|
+
inputFieldPaddingX?: string;
|
|
349
|
+
/**
|
|
350
|
+
* The vertical padding used for input fields in forms. This supports pixel values only.
|
|
351
|
+
*/
|
|
352
|
+
inputFieldPaddingY?: string;
|
|
353
|
+
|
|
354
|
+
// Table
|
|
355
|
+
/**
|
|
356
|
+
* The vertical padding used for table rows. This supports pixel values only.
|
|
357
|
+
*/
|
|
358
|
+
tableRowPaddingY?: string;
|
|
270
359
|
|
|
271
360
|
// Border Sizing
|
|
272
361
|
/**
|
|
@@ -487,35 +576,24 @@ export interface StripeConnectInstance {
|
|
|
487
576
|
* Tagnames to be used with the `create` method of the Connect instance.
|
|
488
577
|
*/
|
|
489
578
|
export type ConnectElementTagName =
|
|
579
|
+
| "account-onboarding"
|
|
580
|
+
| "disputes-list"
|
|
490
581
|
| "payments"
|
|
491
|
-
| "payouts"
|
|
492
582
|
| "payment-details"
|
|
493
583
|
| "payment-disputes"
|
|
494
|
-
| "disputes-list"
|
|
495
|
-
| "account-onboarding"
|
|
496
|
-
| "payment-method-settings"
|
|
497
584
|
| "account-management"
|
|
498
585
|
| "notification-banner"
|
|
499
|
-
| "instant-payouts"
|
|
500
586
|
| "instant-payouts-promotion"
|
|
501
587
|
| "issuing-card"
|
|
502
588
|
| "issuing-cards-list"
|
|
503
589
|
| "financial-account"
|
|
504
590
|
| "financial-account-transactions"
|
|
505
|
-
| "
|
|
506
|
-
| "
|
|
507
|
-
| "
|
|
508
|
-
| "
|
|
509
|
-
| "capital-overview"
|
|
591
|
+
| "payouts"
|
|
592
|
+
| "payouts-list"
|
|
593
|
+
| "payout-details"
|
|
594
|
+
| "balances"
|
|
510
595
|
| "documents"
|
|
511
|
-
| "product-tax-code-selector"
|
|
512
|
-
| "export-tax-transactions"
|
|
513
596
|
| "tax-registrations"
|
|
514
597
|
| "tax-settings"
|
|
515
|
-
| "
|
|
516
|
-
| "
|
|
517
|
-
| "payouts-list"
|
|
518
|
-
| "payout-details"
|
|
519
|
-
| "app-install"
|
|
520
|
-
| "app-viewport"
|
|
521
|
-
| "reporting-chart";
|
|
598
|
+
| "balance-report"
|
|
599
|
+
| "payout-reconciliation-report";
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 Stripe, 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
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# Connect.js ES Module
|
|
2
|
-
|
|
3
|
-
The [Connect.js library](https://stripe.com/docs/connect/get-started-connect-embedded-components) and its supporting API allows you to add connected account dashboard functionality to your website.
|
|
4
|
-
This NPM package contains initialization logic for Connect embedded components along with related types.
|
|
5
|
-
|
|
6
|
-
Calling `loadConnectAndInitialize` always loads the latest version of Connect.js, regardless of which version of `@stripe/connect-js` you use. Updates for this package only impact tooling around the `loadConnectAndInitialize` helper itself and the TypeScript type definitions provided for Connect.js. Updates do not affect runtime availability of features of Connect.js.
|
|
7
|
-
|
|
8
|
-
The embedded onboarding component is generally available now. Please refer to our [documentation](https://stripe.com/docs/connect/supported-embedded-components#account-onboarding) for more information.
|
|
9
|
-
|
|
10
|
-
Note: Some Connect embedded components are currently still in preview. These can be [viewed on our doc site](https://docs.stripe.com/connect/supported-embedded-components), where you can also request preview access.
|
|
11
|
-
|
|
12
|
-
## Installation
|
|
13
|
-
|
|
14
|
-
Use `npm` to install the Connect.js module:
|
|
15
|
-
|
|
16
|
-
```sh
|
|
17
|
-
npm install @stripe/connect-js
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Documentation
|
|
21
|
-
|
|
22
|
-
- [Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components)
|
|
23
|
-
- [Quickstart guide](https://stripe.com/docs/connect/connect-embedded-components/quickstart)
|
|
24
|
-
|
|
25
|
-
## Usage
|
|
26
|
-
|
|
27
|
-
### `loadConnectAndInitialize`
|
|
28
|
-
|
|
29
|
-
This synchronous function takes in a publishable key, a function to retrieve the client secret returned from the [Account Session API](https://stripe.com/docs/api/account_sessions/create), and other [initialization parameters](https://stripe.com/docs/connect/get-started-connect-embedded-components#configuring-connect-js). It returns a `StripeConnectInstance`. If necessary, it will load Connect.js for you by inserting the Connect.js script tag.
|
|
30
|
-
|
|
31
|
-
```js
|
|
32
|
-
import { loadConnectAndInitialize } from "@stripe/connect-js";
|
|
33
|
-
const fetchClientSecret = async () => {
|
|
34
|
-
// Fetch the AccountSession client secret by making an API call to your service
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const instance = loadConnectAndInitialize({
|
|
38
|
-
publishableKey: "{{pk test123}}",
|
|
39
|
-
fetchClientSecret: fetchClientSecret,
|
|
40
|
-
});
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
We’ve placed a random API key in this example. Replace it with your
|
|
44
|
-
[actual publishable API keys](https://dashboard.stripe.com/account/apikeys) to
|
|
45
|
-
test this code through your Connect account.
|
|
46
|
-
|
|
47
|
-
If you have deployed a
|
|
48
|
-
[Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/Security/CSP),
|
|
49
|
-
make sure to
|
|
50
|
-
[include Connect.js in your directives](https://stripe.com/docs/connect/get-started-connect-embedded-components?platform=web#csp-and-http-header-requirements).
|
|
51
|
-
|
|
52
|
-
### Import as a side effect
|
|
53
|
-
|
|
54
|
-
Import `@stripe/connect-js` as a side effect in code that will be included
|
|
55
|
-
throughout your site (e.g. your root module). This will make sure the Connect.js
|
|
56
|
-
script tag is inserted immediately upon page load.
|
|
57
|
-
|
|
58
|
-
```js
|
|
59
|
-
import "@stripe/connect-js";
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### Importing `loadConnectAndInitialize` without side effects
|
|
63
|
-
|
|
64
|
-
If you would like to use `loadConnectAndInitialize` in your application, but defer loading the
|
|
65
|
-
Connect.js script until `loadConnectAndInitialize` is first called, use the alternative
|
|
66
|
-
`@stripe/connect-js/pure` import path:
|
|
67
|
-
|
|
68
|
-
```js
|
|
69
|
-
import { loadConnectAndInitialize } from "@stripe/connect-js/pure";
|
|
70
|
-
|
|
71
|
-
// Connect.js will not be loaded until `loadConnect` is called
|
|
72
|
-
const instance = loadConnectAndInitialize({
|
|
73
|
-
publishableKey: "{{pk test123}}",
|
|
74
|
-
fetchClientSecret: fetchClientSecret,
|
|
75
|
-
});
|
|
76
|
-
```
|