@storepecker/storefront-core 1.0.0
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/address-DQEZzyUG.d.cts +19 -0
- package/dist/address-DQEZzyUG.d.ts +19 -0
- package/dist/api/index.cjs +367 -0
- package/dist/api/index.d.cts +127 -0
- package/dist/api/index.d.ts +127 -0
- package/dist/api/index.js +131 -0
- package/dist/booking-ClX-dhX7.d.ts +131 -0
- package/dist/booking-Drl7-IL7.d.cts +131 -0
- package/dist/cart-DVrn8hD0.d.cts +367 -0
- package/dist/cart-DVrn8hD0.d.ts +367 -0
- package/dist/checkout/index.cjs +228 -0
- package/dist/checkout/index.d.cts +251 -0
- package/dist/checkout/index.d.ts +251 -0
- package/dist/checkout/index.js +122 -0
- package/dist/chunk-4CVKE6CC.cjs +312 -0
- package/dist/chunk-4MJMNIAB.js +123 -0
- package/dist/chunk-57ZBPAXU.js +114 -0
- package/dist/chunk-7MQOVWLW.js +40 -0
- package/dist/chunk-7UH6REGV.js +12 -0
- package/dist/chunk-A6IO3HIN.cjs +151 -0
- package/dist/chunk-CFF632IQ.cjs +100 -0
- package/dist/chunk-CSISWBZZ.js +121 -0
- package/dist/chunk-E7WPE3PV.js +98 -0
- package/dist/chunk-FLBJKM6G.js +83 -0
- package/dist/chunk-GB3HW6DM.js +61 -0
- package/dist/chunk-GH75WUO2.cjs +42 -0
- package/dist/chunk-GQTO5ZE2.cjs +96 -0
- package/dist/chunk-JHGXIIBZ.cjs +37 -0
- package/dist/chunk-JQMLHRWL.js +21 -0
- package/dist/chunk-K44JZ5NL.cjs +212 -0
- package/dist/chunk-K5B62JZO.cjs +154 -0
- package/dist/chunk-KWKHHRRJ.cjs +15 -0
- package/dist/chunk-LBGIUNM6.js +30 -0
- package/dist/chunk-LC5ZAUKL.cjs +220 -0
- package/dist/chunk-N3CTXRFT.cjs +30 -0
- package/dist/chunk-QCQCFYYR.js +206 -0
- package/dist/chunk-QM73PI5L.cjs +218 -0
- package/dist/chunk-RCXQJ6XC.cjs +131 -0
- package/dist/chunk-UM24VDYB.js +216 -0
- package/dist/chunk-UXLUE3HW.cjs +69 -0
- package/dist/chunk-WFDKKOO7.js +210 -0
- package/dist/chunk-YUPBTD4M.js +289 -0
- package/dist/components/index.cjs +576 -0
- package/dist/components/index.css +329 -0
- package/dist/components/index.d.cts +58 -0
- package/dist/components/index.d.ts +58 -0
- package/dist/components/index.js +569 -0
- package/dist/coupons-C7iJ-1cy.d.cts +37 -0
- package/dist/coupons-CnfTKL1i.d.ts +37 -0
- package/dist/hooks/index.cjs +381 -0
- package/dist/hooks/index.d.cts +123 -0
- package/dist/hooks/index.d.ts +123 -0
- package/dist/hooks/index.js +364 -0
- package/dist/index-DTyIuLuI.d.cts +18 -0
- package/dist/index-DTyIuLuI.d.ts +18 -0
- package/dist/index.cjs +14 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/models/index.cjs +2 -0
- package/dist/models/index.d.cts +53 -0
- package/dist/models/index.d.ts +53 -0
- package/dist/models/index.js +1 -0
- package/dist/orders-CkUzv5Xh.d.ts +159 -0
- package/dist/orders-D0oC9ugD.d.cts +159 -0
- package/dist/phonepe-D7vn-9SR.d.cts +27 -0
- package/dist/phonepe-D7vn-9SR.d.ts +27 -0
- package/dist/store/index.cjs +149 -0
- package/dist/store/index.d.cts +46 -0
- package/dist/store/index.d.ts +46 -0
- package/dist/store/index.js +141 -0
- package/dist/useAddressForm-C-Uzug4d.d.ts +42 -0
- package/dist/useAddressForm-DgkCP1nG.d.cts +42 -0
- package/dist/utils/index.cjs +535 -0
- package/dist/utils/index.d.cts +507 -0
- package/dist/utils/index.d.ts +507 -0
- package/dist/utils/index.js +342 -0
- package/dist/wishlist-BzhnCAQD.d.ts +41 -0
- package/dist/wishlist-CBCZD66Y.d.cts +41 -0
- package/package.json +134 -0
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
/* src/components/search-dropdown/search-dropdown.module.css */
|
|
2
|
+
.searchDropdown {
|
|
3
|
+
position: relative;
|
|
4
|
+
width: 100%;
|
|
5
|
+
font-family: var(--body-font, "Inter", sans-serif);
|
|
6
|
+
}
|
|
7
|
+
.label {
|
|
8
|
+
display: block;
|
|
9
|
+
margin-bottom: var(--sm, 8px);
|
|
10
|
+
font-size: var(--fs-md, 14px);
|
|
11
|
+
color: var(--text-secondary, #666);
|
|
12
|
+
font-weight: 400;
|
|
13
|
+
}
|
|
14
|
+
.dropdownContainer {
|
|
15
|
+
position: relative;
|
|
16
|
+
}
|
|
17
|
+
.dropdownButton {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
width: 100%;
|
|
22
|
+
padding: 0 var(--smd, 12px);
|
|
23
|
+
font-size: var(--fs-md, 14px);
|
|
24
|
+
color: var(--text-primary, #000);
|
|
25
|
+
background-color: transparent;
|
|
26
|
+
border-radius: var(--xs, 4px);
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
transition: var(--transition-all, all 0.25s ease);
|
|
29
|
+
text-align: left;
|
|
30
|
+
min-height: 38px;
|
|
31
|
+
border: none !important;
|
|
32
|
+
outline: none !important;
|
|
33
|
+
box-shadow: 0px 0px 0px 1px var(--bg-border, #d0d0d0);
|
|
34
|
+
}
|
|
35
|
+
.dropdownButton:focus {
|
|
36
|
+
outline: none;
|
|
37
|
+
box-shadow: 0px 0px 0px 1.5px var(--bg-dark, #3d3b40);
|
|
38
|
+
}
|
|
39
|
+
.dropdownButton:disabled {
|
|
40
|
+
cursor: not-allowed;
|
|
41
|
+
opacity: 0.6;
|
|
42
|
+
background-color: var(--bg-secondary, rgb(243 244 246));
|
|
43
|
+
}
|
|
44
|
+
.selectedValue {
|
|
45
|
+
flex: 1;
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
text-overflow: ellipsis;
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
color: var(--text-primary, #000);
|
|
50
|
+
font-weight: 500;
|
|
51
|
+
}
|
|
52
|
+
.chevron {
|
|
53
|
+
flex-shrink: 0;
|
|
54
|
+
margin-left: var(--sm, 8px);
|
|
55
|
+
color: var(--text-secondary, #666);
|
|
56
|
+
transition: transform 0.25s ease;
|
|
57
|
+
}
|
|
58
|
+
.chevronOpen {
|
|
59
|
+
transform: rotate(180deg);
|
|
60
|
+
}
|
|
61
|
+
.dropdownMenu {
|
|
62
|
+
position: absolute;
|
|
63
|
+
top: calc(100% + var(--xs, 4px));
|
|
64
|
+
left: 0;
|
|
65
|
+
right: 0;
|
|
66
|
+
z-index: 1000;
|
|
67
|
+
background-color: var(--bg-primary, #fefefe);
|
|
68
|
+
border: 1px solid var(--bg-border, #d0d0d0);
|
|
69
|
+
border-radius: var(--xs, 4px);
|
|
70
|
+
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
|
|
71
|
+
overflow: hidden;
|
|
72
|
+
animation: slideDown 0.2s ease-out;
|
|
73
|
+
min-width: 260px;
|
|
74
|
+
}
|
|
75
|
+
@keyframes slideDown {
|
|
76
|
+
from {
|
|
77
|
+
opacity: 0;
|
|
78
|
+
transform: translateY(-8px);
|
|
79
|
+
}
|
|
80
|
+
to {
|
|
81
|
+
opacity: 1;
|
|
82
|
+
transform: translateY(0);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
.searchContainer {
|
|
86
|
+
position: relative;
|
|
87
|
+
padding: var(--sm, 8px);
|
|
88
|
+
border-bottom: 1px solid var(--bg-border, #d0d0d0);
|
|
89
|
+
background-color: var(--bg-primary-smoke, #efefef);
|
|
90
|
+
}
|
|
91
|
+
.searchIcon {
|
|
92
|
+
position: absolute;
|
|
93
|
+
left: var(--md, 16px);
|
|
94
|
+
top: 50%;
|
|
95
|
+
transform: translateY(-50%);
|
|
96
|
+
color: var(--text-secondary, #666);
|
|
97
|
+
pointer-events: none;
|
|
98
|
+
}
|
|
99
|
+
.searchInput {
|
|
100
|
+
width: 100%;
|
|
101
|
+
padding: var(--sm, 8px) var(--sm, 8px) var(--sm, 8px) var(--xl, 32px);
|
|
102
|
+
font-size: var(--fs-md, 14px);
|
|
103
|
+
color: var(--text-primary, #000);
|
|
104
|
+
background-color: var(--bg-primary, #fefefe);
|
|
105
|
+
border: 1px solid var(--bg-border, #d0d0d0);
|
|
106
|
+
border-radius: var(--xs, 4px);
|
|
107
|
+
outline: none;
|
|
108
|
+
transition: var(--transition-all, all 0.25s ease);
|
|
109
|
+
}
|
|
110
|
+
.searchInput:focus {
|
|
111
|
+
border-color: var(--bg-dark, #3d3b40);
|
|
112
|
+
box-shadow: 0px 0px 0px 1.5px var(--bg-dark, #3d3b40);
|
|
113
|
+
}
|
|
114
|
+
.searchInput::placeholder {
|
|
115
|
+
color: var(--text-secondary, #666);
|
|
116
|
+
}
|
|
117
|
+
.optionsList {
|
|
118
|
+
list-style: none;
|
|
119
|
+
padding: 0;
|
|
120
|
+
margin: 0;
|
|
121
|
+
overflow-y: auto;
|
|
122
|
+
max-height: inherit;
|
|
123
|
+
}
|
|
124
|
+
.option {
|
|
125
|
+
padding: var(--smd, 12px) var(--md, 16px);
|
|
126
|
+
font-size: var(--fs-md, 14px);
|
|
127
|
+
color: var(--text-primary, #000);
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
transition: var(--transition-all, all 0.25s ease);
|
|
130
|
+
border-bottom: 1px solid var(--bg-border, #d0d0d0);
|
|
131
|
+
}
|
|
132
|
+
.option:last-child {
|
|
133
|
+
border-bottom: none;
|
|
134
|
+
}
|
|
135
|
+
.option:hover:not(.optionDisabled) {
|
|
136
|
+
background-color: var(--bg-primary-smoke, #efefef);
|
|
137
|
+
color: var(--text-primary, #000);
|
|
138
|
+
}
|
|
139
|
+
.optionFocused:not(.optionDisabled) {
|
|
140
|
+
background-color: var(--primary-lighter, #f0f4f8);
|
|
141
|
+
color: var(--text-primary, #000);
|
|
142
|
+
}
|
|
143
|
+
.optionSelected {
|
|
144
|
+
background-color: var(--primary-lighter2, #d8e4f0);
|
|
145
|
+
color: var(--primary, #003d29);
|
|
146
|
+
font-weight: 500;
|
|
147
|
+
}
|
|
148
|
+
.optionDisabled {
|
|
149
|
+
opacity: 0.5;
|
|
150
|
+
cursor: not-allowed;
|
|
151
|
+
background-color: var(--bg-secondary, rgb(243 244 246));
|
|
152
|
+
}
|
|
153
|
+
.emptyMessage {
|
|
154
|
+
padding: var(--md, 16px);
|
|
155
|
+
text-align: center;
|
|
156
|
+
color: var(--text-secondary, #666);
|
|
157
|
+
font-size: var(--fs-md, 14px);
|
|
158
|
+
font-style: italic;
|
|
159
|
+
}
|
|
160
|
+
.errorMessage {
|
|
161
|
+
display: block;
|
|
162
|
+
margin-top: var(--xs, 4px);
|
|
163
|
+
font-size: var(--fs-sm, 12px);
|
|
164
|
+
color: var(--error, #bc3232);
|
|
165
|
+
position: absolute;
|
|
166
|
+
bottom: -20px;
|
|
167
|
+
left: 0;
|
|
168
|
+
}
|
|
169
|
+
.error .dropdownButton {
|
|
170
|
+
border-color: var(--error, #bc3232);
|
|
171
|
+
}
|
|
172
|
+
.error .dropdownButton:focus {
|
|
173
|
+
border-color: var(--error, #bc3232);
|
|
174
|
+
box-shadow: 0px 0px 0px 1.5px var(--error, #bc3232);
|
|
175
|
+
}
|
|
176
|
+
.disabled {
|
|
177
|
+
opacity: 0.6;
|
|
178
|
+
pointer-events: none;
|
|
179
|
+
}
|
|
180
|
+
.open .dropdownButton {
|
|
181
|
+
border-color: var(--bg-dark, #3d3b40);
|
|
182
|
+
box-shadow: 0px 0px 0px 1.5px var(--bg-dark, #3d3b40);
|
|
183
|
+
}
|
|
184
|
+
.countryCodeDropdown .label {
|
|
185
|
+
display: none;
|
|
186
|
+
}
|
|
187
|
+
.countryCodeDropdown .dropdownButton {
|
|
188
|
+
min-height: auto;
|
|
189
|
+
padding: 0.5rem 0.625rem;
|
|
190
|
+
font-size: var(--fs-md, 14px);
|
|
191
|
+
}
|
|
192
|
+
.countryCodeDropdown .selectedValue {
|
|
193
|
+
font-size: var(--fs-md, 14px);
|
|
194
|
+
font-weight: 500;
|
|
195
|
+
}
|
|
196
|
+
@media screen and (max-width: 768px) {
|
|
197
|
+
.dropdownMenu {
|
|
198
|
+
max-height: 250px;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/* src/components/address-form/address-form.module.css */
|
|
203
|
+
.addressForm {
|
|
204
|
+
font-family: var(--body-font, "Inter", sans-serif);
|
|
205
|
+
}
|
|
206
|
+
.formBody {
|
|
207
|
+
max-height: 350px;
|
|
208
|
+
overflow-y: auto;
|
|
209
|
+
}
|
|
210
|
+
@media screen and (min-width: 640px) {
|
|
211
|
+
.formBody {
|
|
212
|
+
max-height: 480px;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
.formGroup {
|
|
216
|
+
position: relative;
|
|
217
|
+
margin-bottom: 1.5rem;
|
|
218
|
+
}
|
|
219
|
+
.formGroup label {
|
|
220
|
+
display: block;
|
|
221
|
+
color: var(--text-primary, #000);
|
|
222
|
+
font-size: var(--fs-md, 14px);
|
|
223
|
+
margin-bottom: 0.5rem;
|
|
224
|
+
}
|
|
225
|
+
.formControl {
|
|
226
|
+
display: block;
|
|
227
|
+
width: 100%;
|
|
228
|
+
padding: 0.5rem 0.625rem;
|
|
229
|
+
color: var(--text-primary, #000);
|
|
230
|
+
font-size: var(--fs-md, 14px);
|
|
231
|
+
transition: all 0.2s ease-in;
|
|
232
|
+
border: 1px solid var(--bg-border, #d0d0d0);
|
|
233
|
+
border-radius: 4px;
|
|
234
|
+
outline: none;
|
|
235
|
+
box-shadow: none;
|
|
236
|
+
background-color: #fafafa;
|
|
237
|
+
}
|
|
238
|
+
.formControl:focus {
|
|
239
|
+
border-color: var(--text-primary, #000);
|
|
240
|
+
}
|
|
241
|
+
.formControl::placeholder {
|
|
242
|
+
color: var(--text-secondary, #666);
|
|
243
|
+
}
|
|
244
|
+
.error {
|
|
245
|
+
font-size: 0.75rem;
|
|
246
|
+
color: var(--error, #bc3232);
|
|
247
|
+
position: absolute;
|
|
248
|
+
font-weight: 400;
|
|
249
|
+
bottom: -20px;
|
|
250
|
+
left: 0;
|
|
251
|
+
}
|
|
252
|
+
.row {
|
|
253
|
+
display: flex;
|
|
254
|
+
gap: 0.75rem;
|
|
255
|
+
}
|
|
256
|
+
.col {
|
|
257
|
+
flex: 1;
|
|
258
|
+
min-width: 0;
|
|
259
|
+
}
|
|
260
|
+
.phoneRow {
|
|
261
|
+
display: flex;
|
|
262
|
+
gap: 0.5rem;
|
|
263
|
+
}
|
|
264
|
+
.phoneCodeCol {
|
|
265
|
+
width: 8rem;
|
|
266
|
+
flex-shrink: 0;
|
|
267
|
+
}
|
|
268
|
+
.phoneInputCol {
|
|
269
|
+
flex: 1;
|
|
270
|
+
min-width: 0;
|
|
271
|
+
}
|
|
272
|
+
.divider {
|
|
273
|
+
border: none;
|
|
274
|
+
border-top: 1px solid var(--bg-border, #d0d0d0);
|
|
275
|
+
margin: 0.75rem 0;
|
|
276
|
+
}
|
|
277
|
+
.checkboxLabel {
|
|
278
|
+
display: flex;
|
|
279
|
+
align-items: center;
|
|
280
|
+
font-size: var(--fs-md, 14px);
|
|
281
|
+
cursor: pointer;
|
|
282
|
+
gap: 0.5rem;
|
|
283
|
+
}
|
|
284
|
+
.checkboxInput {
|
|
285
|
+
width: 16px;
|
|
286
|
+
height: 16px;
|
|
287
|
+
accent-color: var(--primary, #003d29);
|
|
288
|
+
cursor: pointer;
|
|
289
|
+
}
|
|
290
|
+
.formFooter {
|
|
291
|
+
display: flex;
|
|
292
|
+
align-items: center;
|
|
293
|
+
justify-content: flex-end;
|
|
294
|
+
gap: 0.5rem;
|
|
295
|
+
padding-top: 0.75rem;
|
|
296
|
+
}
|
|
297
|
+
.cancelBtn {
|
|
298
|
+
padding: 0.5rem 1rem;
|
|
299
|
+
border: none;
|
|
300
|
+
border-radius: 4px;
|
|
301
|
+
background-color: var(--bg-secondary, rgb(243 244 246));
|
|
302
|
+
color: var(--text-primary, #000);
|
|
303
|
+
font-size: var(--fs-md, 14px);
|
|
304
|
+
cursor: pointer;
|
|
305
|
+
transition: var(--transition-all, all 0.25s ease);
|
|
306
|
+
}
|
|
307
|
+
.cancelBtn:hover {
|
|
308
|
+
background-color: var(--bg-border, #d0d0d0);
|
|
309
|
+
}
|
|
310
|
+
.selectWrapper {
|
|
311
|
+
position: relative;
|
|
312
|
+
}
|
|
313
|
+
.selectArrow {
|
|
314
|
+
position: absolute;
|
|
315
|
+
right: 12px;
|
|
316
|
+
top: 50%;
|
|
317
|
+
transform: translateY(-50%);
|
|
318
|
+
pointer-events: none;
|
|
319
|
+
color: var(--text-secondary, #666);
|
|
320
|
+
}
|
|
321
|
+
.formControl[data-select] {
|
|
322
|
+
-webkit-appearance: none;
|
|
323
|
+
-moz-appearance: none;
|
|
324
|
+
appearance: none;
|
|
325
|
+
padding-right: 2rem;
|
|
326
|
+
}
|
|
327
|
+
.phoneCodeCol .dropdownButton {
|
|
328
|
+
min-height: auto;
|
|
329
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { U as UseAddressFormOptions, u as useAddressForm } from '../useAddressForm-DgkCP1nG.cjs';
|
|
3
|
+
import 'formik';
|
|
4
|
+
import '../address-DQEZzyUG.cjs';
|
|
5
|
+
|
|
6
|
+
interface SearchDropdownOption {
|
|
7
|
+
value: string | number;
|
|
8
|
+
label: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
interface SearchDropdownProps {
|
|
13
|
+
options: SearchDropdownOption[];
|
|
14
|
+
value?: string | number;
|
|
15
|
+
onChange?: (value: string | number, option: SearchDropdownOption) => void;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
searchPlaceholder?: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
error?: string;
|
|
21
|
+
label?: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
renderOption?: (option: SearchDropdownOption) => React.ReactNode;
|
|
24
|
+
renderSelected?: (option: SearchDropdownOption | null) => React.ReactNode;
|
|
25
|
+
filterFunction?: (option: SearchDropdownOption, searchTerm: string) => boolean;
|
|
26
|
+
emptyMessage?: string;
|
|
27
|
+
maxHeight?: string;
|
|
28
|
+
}
|
|
29
|
+
declare const SearchDropdown: React.FC<SearchDropdownProps>;
|
|
30
|
+
|
|
31
|
+
interface AddressFormRef {
|
|
32
|
+
formik: ReturnType<typeof useAddressForm>["formik"];
|
|
33
|
+
resetForm: () => void;
|
|
34
|
+
}
|
|
35
|
+
interface AddressFormProps extends UseAddressFormOptions {
|
|
36
|
+
/** Custom Button component rendered for the submit action. Receives type, disabled, children. */
|
|
37
|
+
renderButton?: (props: {
|
|
38
|
+
type: "submit";
|
|
39
|
+
disabled: boolean;
|
|
40
|
+
loading: boolean;
|
|
41
|
+
children: React.ReactNode;
|
|
42
|
+
}) => React.ReactNode;
|
|
43
|
+
/** Called when formik instance is ready (alternative to ref) */
|
|
44
|
+
onFormikReady?: (formik: ReturnType<typeof useAddressForm>["formik"]) => void;
|
|
45
|
+
/** Called when cancel is clicked */
|
|
46
|
+
onCancel?: () => void;
|
|
47
|
+
/** Show cancel button. Default: true */
|
|
48
|
+
showCancel?: boolean;
|
|
49
|
+
/** Show "Make default address" checkbox. Default: true */
|
|
50
|
+
showDefaultCheckbox?: boolean;
|
|
51
|
+
/** Custom class name for the form wrapper */
|
|
52
|
+
className?: string;
|
|
53
|
+
/** Submit button text. Default: "Save" */
|
|
54
|
+
submitLabel?: string;
|
|
55
|
+
}
|
|
56
|
+
declare const AddressForm: React.ForwardRefExoticComponent<AddressFormProps & React.RefAttributes<AddressFormRef>>;
|
|
57
|
+
|
|
58
|
+
export { AddressForm, type AddressFormProps, type AddressFormRef, SearchDropdown, type SearchDropdownOption, type SearchDropdownProps };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { U as UseAddressFormOptions, u as useAddressForm } from '../useAddressForm-C-Uzug4d.js';
|
|
3
|
+
import 'formik';
|
|
4
|
+
import '../address-DQEZzyUG.js';
|
|
5
|
+
|
|
6
|
+
interface SearchDropdownOption {
|
|
7
|
+
value: string | number;
|
|
8
|
+
label: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
interface SearchDropdownProps {
|
|
13
|
+
options: SearchDropdownOption[];
|
|
14
|
+
value?: string | number;
|
|
15
|
+
onChange?: (value: string | number, option: SearchDropdownOption) => void;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
searchPlaceholder?: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
error?: string;
|
|
21
|
+
label?: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
renderOption?: (option: SearchDropdownOption) => React.ReactNode;
|
|
24
|
+
renderSelected?: (option: SearchDropdownOption | null) => React.ReactNode;
|
|
25
|
+
filterFunction?: (option: SearchDropdownOption, searchTerm: string) => boolean;
|
|
26
|
+
emptyMessage?: string;
|
|
27
|
+
maxHeight?: string;
|
|
28
|
+
}
|
|
29
|
+
declare const SearchDropdown: React.FC<SearchDropdownProps>;
|
|
30
|
+
|
|
31
|
+
interface AddressFormRef {
|
|
32
|
+
formik: ReturnType<typeof useAddressForm>["formik"];
|
|
33
|
+
resetForm: () => void;
|
|
34
|
+
}
|
|
35
|
+
interface AddressFormProps extends UseAddressFormOptions {
|
|
36
|
+
/** Custom Button component rendered for the submit action. Receives type, disabled, children. */
|
|
37
|
+
renderButton?: (props: {
|
|
38
|
+
type: "submit";
|
|
39
|
+
disabled: boolean;
|
|
40
|
+
loading: boolean;
|
|
41
|
+
children: React.ReactNode;
|
|
42
|
+
}) => React.ReactNode;
|
|
43
|
+
/** Called when formik instance is ready (alternative to ref) */
|
|
44
|
+
onFormikReady?: (formik: ReturnType<typeof useAddressForm>["formik"]) => void;
|
|
45
|
+
/** Called when cancel is clicked */
|
|
46
|
+
onCancel?: () => void;
|
|
47
|
+
/** Show cancel button. Default: true */
|
|
48
|
+
showCancel?: boolean;
|
|
49
|
+
/** Show "Make default address" checkbox. Default: true */
|
|
50
|
+
showDefaultCheckbox?: boolean;
|
|
51
|
+
/** Custom class name for the form wrapper */
|
|
52
|
+
className?: string;
|
|
53
|
+
/** Submit button text. Default: "Save" */
|
|
54
|
+
submitLabel?: string;
|
|
55
|
+
}
|
|
56
|
+
declare const AddressForm: React.ForwardRefExoticComponent<AddressFormProps & React.RefAttributes<AddressFormRef>>;
|
|
57
|
+
|
|
58
|
+
export { AddressForm, type AddressFormProps, type AddressFormRef, SearchDropdown, type SearchDropdownOption, type SearchDropdownProps };
|