@lightspeed/online-payments-sdk 1.8.0 → 1.9.1

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.
Files changed (39) hide show
  1. package/README.md +37 -0
  2. package/dist/cjs/index.js +4 -1
  3. package/dist/cjs/v1/EventBroadcaster.js +1 -0
  4. package/dist/cjs/v1/adyen/widget.js +4 -13
  5. package/dist/cjs/v1/stripe/localizedText.js +32 -0
  6. package/dist/cjs/v1/stripe/session.js +9 -0
  7. package/dist/cjs/v1/stripe/shared.js +55 -14
  8. package/dist/cjs/v1/stripe/terms.js +1 -1
  9. package/dist/cjs/v1/stripe/themes.js +2 -2
  10. package/dist/cjs/v1/stripe/widget.js +64 -25
  11. package/dist/cjs/v1/stripe/widgets/deferredMoto.js +203 -0
  12. package/dist/cjs/v1/widget.js +32 -4
  13. package/dist/cjs/version.js +1 -1
  14. package/dist/index.d.ts +3 -0
  15. package/dist/index.js +3 -0
  16. package/dist/v1/EventBroadcaster.d.ts +18 -1
  17. package/dist/v1/EventBroadcaster.js +1 -0
  18. package/dist/v1/adyen/widget.js +4 -13
  19. package/dist/v1/common.d.ts +8 -2
  20. package/dist/v1/index.d.ts +2 -2
  21. package/dist/v1/stripe/localizedText.d.ts +3 -0
  22. package/dist/v1/stripe/localizedText.js +28 -0
  23. package/dist/v1/stripe/session.d.ts +29 -6
  24. package/dist/v1/stripe/session.js +7 -1
  25. package/dist/v1/stripe/shared.d.ts +8 -5
  26. package/dist/v1/stripe/shared.js +55 -15
  27. package/dist/v1/stripe/terms.d.ts +1 -1
  28. package/dist/v1/stripe/terms.js +1 -1
  29. package/dist/v1/stripe/themes.js +2 -2
  30. package/dist/v1/stripe/widget.js +62 -23
  31. package/dist/v1/stripe/widgets/deferredMoto.d.ts +5 -0
  32. package/dist/v1/stripe/widgets/deferredMoto.js +200 -0
  33. package/dist/v1/stripe/widgets/moto.d.ts +2 -2
  34. package/dist/v1/stripe/widgets/payment.d.ts +2 -2
  35. package/dist/v1/widget.js +32 -4
  36. package/dist/version.d.ts +1 -1
  37. package/dist/version.js +1 -1
  38. package/package.json +8 -3
  39. package/styles/lightspeed-global-styles.css +81 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightspeed/online-payments-sdk",
3
- "version": "1.8.0",
3
+ "version": "1.9.1",
4
4
  "description": "Process online-payments with Lightspeed Payments",
5
5
  "author": "Lightspeed Commerce Inc.",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -14,8 +14,11 @@
14
14
  "dist",
15
15
  "styles"
16
16
  ],
17
- "sideEffects": false,
17
+ "sideEffects": [
18
+ "styles/**/*.css"
19
+ ],
18
20
  "scripts": {
21
+ "pretest": "node scripts/generate-version.js",
19
22
  "test": "jest --no-cache --detectOpenHandles",
20
23
  "lint": "gts lint",
21
24
  "fix": "gts fix",
@@ -25,8 +28,10 @@
25
28
  "check-package-content": "npm pack --dry-run",
26
29
  "prebuild": "node scripts/generate-version.js",
27
30
  "build": "npm run build:esm && npm run build:cjs",
31
+ "postbuild": "node scripts/check-version.js",
28
32
  "build:esm": "tsc --module esnext --target es5 --outDir dist --downlevelIteration",
29
- "build:cjs": "tsc --module commonjs --target es5 --outDir dist/cjs --downlevelIteration --declaration false"
33
+ "build:cjs": "tsc --module commonjs --target es5 --outDir dist/cjs --downlevelIteration --declaration false",
34
+ "prepack": "node scripts/check-version.js"
30
35
  },
31
36
  "devDependencies": {
32
37
  "@eslint/js": "^9.33.0",
@@ -84,6 +84,84 @@
84
84
  color: #30313d;
85
85
  }
86
86
 
87
+ .stripe-save-payment-method-container {
88
+ display: flex;
89
+ align-items: center;
90
+ gap: 6px;
91
+ margin: 16px 0 0;
92
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
93
+ Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
94
+ font-size: 0.93rem;
95
+ font-weight: 400;
96
+ line-height: 1.5;
97
+ color: #30313d;
98
+ cursor: pointer;
99
+ -webkit-tap-highlight-color: transparent;
100
+ -webkit-user-select: none;
101
+ user-select: none;
102
+ }
103
+
104
+ .stripe-save-payment-method-checkbox {
105
+ appearance: none;
106
+ -webkit-appearance: none;
107
+ -webkit-user-select: none;
108
+ box-sizing: border-box;
109
+ flex: 0 0 20px;
110
+ width: 20px;
111
+ height: 20px;
112
+ margin: 0;
113
+ border: 1px solid #cfd7df;
114
+ border-radius: 5px;
115
+ background-color: #ffffff;
116
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
117
+ cursor: pointer;
118
+ transition:
119
+ background-color 100ms ease,
120
+ border-color 100ms ease,
121
+ box-shadow 100ms ease;
122
+ user-select: none;
123
+ }
124
+
125
+ .stripe-save-payment-method-checkbox:hover {
126
+ border-color: #8792a2;
127
+ }
128
+
129
+ .stripe-save-payment-method-checkbox:focus-visible {
130
+ border-color: #0570de;
131
+ outline: none;
132
+ box-shadow: 0 0 0 3px rgba(5, 112, 222, 0.2);
133
+ }
134
+
135
+ .stripe-save-payment-method-checkbox:checked {
136
+ border-color: #0570de;
137
+ background-color: #0570de;
138
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.25' d='m3.25 8.25 3 3 6.5-6.5'/%3E%3C/svg%3E");
139
+ background-position: center;
140
+ background-repeat: no-repeat;
141
+ background-size: 16px 16px;
142
+ box-shadow: 0 0 0 3px rgba(5, 112, 222, 0.2);
143
+ }
144
+
145
+ .stripe-save-payment-method-checkbox:checked:focus-visible {
146
+ box-shadow: 0 0 0 3px rgba(5, 112, 222, 0.28);
147
+ }
148
+
149
+ .stripe-save-payment-method-text {
150
+ min-width: 0;
151
+ -webkit-user-select: none;
152
+ user-select: none;
153
+ }
154
+
155
+ .stripe-finalization-error {
156
+ margin: 12px 0 0;
157
+ color: #df1b41;
158
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
159
+ Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
160
+ font-size: 0.93rem;
161
+ font-weight: 400;
162
+ line-height: 1.5;
163
+ }
164
+
87
165
  /* Invoicing theme: only override font-family to match the Inter font
88
166
  passed to Stripe Elements via the invoicing theme config. */
89
167
 
@@ -93,7 +171,9 @@
93
171
 
94
172
  .lsp-theme-invoicing .stripe-custom-terms-text,
95
173
  .lsp-theme-invoicing .stripe-expandable-terms-content p,
96
- .lsp-theme-invoicing .stripe-card-consent-text {
174
+ .lsp-theme-invoicing .stripe-card-consent-text,
175
+ .lsp-theme-invoicing .stripe-save-payment-method-container,
176
+ .lsp-theme-invoicing .stripe-finalization-error {
97
177
  font-family: 'Inter', system-ui, sans-serif;
98
178
  }
99
179