@wix/headless-gift-voucher 0.0.3 → 0.0.5

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 (57) hide show
  1. package/cjs/dist/__mocks__/gift-card.d.ts +0 -1
  2. package/cjs/dist/__mocks__/gift-card.js +29 -25
  3. package/cjs/dist/enums/index.d.ts +0 -1
  4. package/cjs/dist/enums/index.js +11 -8
  5. package/cjs/dist/react/GiftCard.d.ts +0 -1
  6. package/cjs/dist/react/GiftCard.js +147 -106
  7. package/cjs/dist/react/core/GiftCard.d.ts +0 -1
  8. package/cjs/dist/react/core/GiftCard.js +86 -64
  9. package/cjs/dist/react/index.d.ts +0 -1
  10. package/cjs/dist/react/index.js +37 -1
  11. package/cjs/dist/services/gift-card-checkout-service.d.ts +0 -1
  12. package/cjs/dist/services/gift-card-checkout-service.js +19 -16
  13. package/cjs/dist/services/gift-card-service.d.ts +0 -1
  14. package/cjs/dist/services/gift-card-service.js +19 -15
  15. package/cjs/dist/services/index.d.ts +0 -1
  16. package/cjs/dist/services/index.js +10 -2
  17. package/cjs/dist/utils/formatting-utils.d.ts +0 -1
  18. package/cjs/dist/utils/formatting-utils.js +8 -3
  19. package/cjs/dist/utils/gift-card-utils.d.ts +0 -1
  20. package/cjs/dist/utils/gift-card-utils.js +18 -11
  21. package/cjs/dist/utils/validation-utils.d.ts +0 -1
  22. package/cjs/dist/utils/validation-utils.js +6 -2
  23. package/cjs/package.json +3 -0
  24. package/dist/__mocks__/gift-card.d.ts +0 -1
  25. package/dist/enums/index.d.ts +0 -1
  26. package/dist/react/GiftCard.d.ts +0 -1
  27. package/dist/react/core/GiftCard.d.ts +0 -1
  28. package/dist/react/index.d.ts +0 -1
  29. package/dist/services/gift-card-checkout-service.d.ts +0 -1
  30. package/dist/services/gift-card-service.d.ts +0 -1
  31. package/dist/services/index.d.ts +0 -1
  32. package/dist/utils/formatting-utils.d.ts +0 -1
  33. package/dist/utils/gift-card-utils.d.ts +0 -1
  34. package/dist/utils/validation-utils.d.ts +0 -1
  35. package/package.json +5 -5
  36. package/cjs/dist/__mocks__/gift-card.d.ts.map +0 -1
  37. package/cjs/dist/enums/index.d.ts.map +0 -1
  38. package/cjs/dist/react/GiftCard.d.ts.map +0 -1
  39. package/cjs/dist/react/core/GiftCard.d.ts.map +0 -1
  40. package/cjs/dist/react/index.d.ts.map +0 -1
  41. package/cjs/dist/services/gift-card-checkout-service.d.ts.map +0 -1
  42. package/cjs/dist/services/gift-card-service.d.ts.map +0 -1
  43. package/cjs/dist/services/index.d.ts.map +0 -1
  44. package/cjs/dist/utils/formatting-utils.d.ts.map +0 -1
  45. package/cjs/dist/utils/gift-card-utils.d.ts.map +0 -1
  46. package/cjs/dist/utils/validation-utils.d.ts.map +0 -1
  47. package/dist/__mocks__/gift-card.d.ts.map +0 -1
  48. package/dist/enums/index.d.ts.map +0 -1
  49. package/dist/react/GiftCard.d.ts.map +0 -1
  50. package/dist/react/core/GiftCard.d.ts.map +0 -1
  51. package/dist/react/index.d.ts.map +0 -1
  52. package/dist/services/gift-card-checkout-service.d.ts.map +0 -1
  53. package/dist/services/gift-card-service.d.ts.map +0 -1
  54. package/dist/services/index.d.ts.map +0 -1
  55. package/dist/utils/formatting-utils.d.ts.map +0 -1
  56. package/dist/utils/gift-card-utils.d.ts.map +0 -1
  57. package/dist/utils/validation-utils.d.ts.map +0 -1
@@ -1,11 +1,50 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React from 'react';
3
- import * as CoreGiftCard from './core/GiftCard.js';
4
- import { AsChildSlot } from '@wix/headless-utils/react';
5
- import { WixMediaImage } from '@wix/headless-media/react';
6
- import { Money, Quantity as QuantityComponent, } from '@wix/headless-components/react';
7
- import { Commerce } from '@wix/headless-ecom/react';
8
- import { DEFAULT_LOADING_TEXT, GIFT_CARD_ROOT_COMPONENT_TAG, TestIds, } from '../enums/index.js';
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.Action = exports.ActionBuyNow = exports.ActionAddToCart = exports.RecipientForm = exports.RecipientMessage = exports.RecipientDate = exports.RecipientName = exports.RecipientEmail = exports.GiftToggle = exports.Quantity = exports.CustomAmountInput = exports.CustomVariantTrigger = exports.CurrentPrice = exports.PresetVariant = exports.PresetVariantRepeater = exports.PresetVariants = exports.Error = exports.Loading = exports.Description = exports.Name = exports.Image = exports.Raw = exports.Root = void 0;
40
+ const jsx_runtime_1 = require("react/jsx-runtime");
41
+ const react_1 = __importDefault(require("react"));
42
+ const CoreGiftCard = __importStar(require("./core/GiftCard.js"));
43
+ const react_2 = require("@wix/headless-utils/react");
44
+ const react_3 = require("@wix/headless-media/react");
45
+ const react_4 = require("@wix/headless-components/react");
46
+ const react_5 = require("@wix/headless-ecom/react");
47
+ const index_js_1 = require("../enums/index.js");
9
48
  /**
10
49
  * Root component that provides the GiftCard service context.
11
50
  * Supports both SSR (with product in config) and client-side auto-fetch (empty config).
@@ -24,11 +63,12 @@ import { DEFAULT_LOADING_TEXT, GIFT_CARD_ROOT_COMPONENT_TAG, TestIds, } from '..
24
63
  * </GiftCard.Root>
25
64
  * ```
26
65
  */
27
- export const Root = (props) => {
66
+ const Root = (props) => {
28
67
  const { children, giftCardServiceConfig, ...attrs } = props;
29
- return (_jsx(CoreGiftCard.Root, { giftCardServiceConfig: giftCardServiceConfig, children: _jsx("div", { "data-testid": TestIds.giftCardRoot, "data-component-tag": GIFT_CARD_ROOT_COMPONENT_TAG, ...attrs, children: children }) }));
68
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.Root, { giftCardServiceConfig: giftCardServiceConfig, children: (0, jsx_runtime_1.jsx)("div", { "data-testid": index_js_1.TestIds.giftCardRoot, "data-component-tag": index_js_1.GIFT_CARD_ROOT_COMPONENT_TAG, ...attrs, children: children }) }));
30
69
  };
31
- Root.displayName = 'GiftCard.Root';
70
+ exports.Root = Root;
71
+ exports.Root.displayName = 'GiftCard.Root';
32
72
  /**
33
73
  * Provides direct access to the gift card data via render props.
34
74
  * Should be used only when you need full control over rendering all states.
@@ -52,16 +92,16 @@ Root.displayName = 'GiftCard.Root';
52
92
  * </GiftCard.Raw>
53
93
  * ```
54
94
  */
55
- export const Raw = React.forwardRef((props, ref) => {
95
+ exports.Raw = react_1.default.forwardRef((props, ref) => {
56
96
  const { asChild, children, className } = props;
57
- return (_jsx(CoreGiftCard.Raw, { children: (rawData) => {
97
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.Raw, { children: (rawData) => {
58
98
  if (!asChild || !children) {
59
99
  return null;
60
100
  }
61
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.giftCardRaw, customElement: children, customElementProps: rawData }));
101
+ return ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": index_js_1.TestIds.giftCardRaw, customElement: children, customElementProps: rawData }));
62
102
  } }));
63
103
  });
64
- Raw.displayName = 'GiftCard.Raw';
104
+ exports.Raw.displayName = 'GiftCard.Raw';
65
105
  /**
66
106
  * Displays the gift card image using WixMediaImage
67
107
  *
@@ -84,7 +124,7 @@ Raw.displayName = 'GiftCard.Raw';
84
124
  * </GiftCard.Image>
85
125
  * ```
86
126
  */
87
- export const Image = React.forwardRef((props, ref) => (_jsx(CoreGiftCard.Image, { children: (renderProps) => (_jsx(WixMediaImage, { ...props, ref: ref, media: { image: renderProps.image }, "data-testid": TestIds.giftCardImage })) })));
127
+ exports.Image = react_1.default.forwardRef((props, ref) => ((0, jsx_runtime_1.jsx)(CoreGiftCard.Image, { children: (renderProps) => ((0, jsx_runtime_1.jsx)(react_3.WixMediaImage, { ...props, ref: ref, media: { image: renderProps.image }, "data-testid": index_js_1.TestIds.giftCardImage })) })));
88
128
  /**
89
129
  * Displays the gift card product name with customizable rendering.
90
130
  *
@@ -109,13 +149,13 @@ export const Image = React.forwardRef((props, ref) => (_jsx(CoreGiftCard.Image,
109
149
  * </GiftCard.Name>
110
150
  * ```
111
151
  */
112
- export const Name = React.forwardRef((props, ref) => {
152
+ exports.Name = react_1.default.forwardRef((props, ref) => {
113
153
  const { asChild, children, className, ...otherProps } = props;
114
- return (_jsx(CoreGiftCard.Name, { children: ({ name }) => {
115
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.giftCardName, customElement: children, customElementProps: { name }, content: name, ...otherProps, children: _jsx("div", { children: name }) }));
154
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.Name, { children: ({ name }) => {
155
+ return ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": index_js_1.TestIds.giftCardName, customElement: children, customElementProps: { name }, content: name, ...otherProps, children: (0, jsx_runtime_1.jsx)("div", { children: name }) }));
116
156
  } }));
117
157
  });
118
- Name.displayName = 'GiftCard.Name';
158
+ exports.Name.displayName = 'GiftCard.Name';
119
159
  /**
120
160
  * Renders the gift card product description.
121
161
  *
@@ -138,11 +178,11 @@ Name.displayName = 'GiftCard.Name';
138
178
  * </GiftCard.Description>
139
179
  * ```
140
180
  */
141
- export const Description = React.forwardRef((props, ref) => {
181
+ exports.Description = react_1.default.forwardRef((props, ref) => {
142
182
  const { asChild, children, className, ...otherProps } = props;
143
- return (_jsx(CoreGiftCard.Description, { children: ({ description }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.giftCardDescription, customElement: children, customElementProps: { description }, content: description, ...otherProps, children: _jsx("div", { children: description }) })) }));
183
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.Description, { children: ({ description }) => ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": index_js_1.TestIds.giftCardDescription, customElement: children, customElementProps: { description }, content: description, ...otherProps, children: (0, jsx_runtime_1.jsx)("div", { children: description }) })) }));
144
184
  });
145
- Description.displayName = 'GiftCard.Description';
185
+ exports.Description.displayName = 'GiftCard.Description';
146
186
  /**
147
187
  * Displays loading state indicator.
148
188
  * Only renders content when isLoading is true.
@@ -155,15 +195,15 @@ Description.displayName = 'GiftCard.Description';
155
195
  * </GiftCard.Loading>
156
196
  * ```
157
197
  */
158
- export const Loading = React.forwardRef((props, ref) => {
198
+ exports.Loading = react_1.default.forwardRef((props, ref) => {
159
199
  const { className, children, ...otherProps } = props;
160
- return (_jsx(CoreGiftCard.Loading, { children: ({ isLoading }) => {
200
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.Loading, { children: ({ isLoading }) => {
161
201
  if (!isLoading)
162
202
  return null;
163
- return (_jsx("div", { ref: ref, className: className, "data-testid": TestIds.giftCardLoading, ...otherProps, children: children ?? DEFAULT_LOADING_TEXT }));
203
+ return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: className, "data-testid": index_js_1.TestIds.giftCardLoading, ...otherProps, children: children ?? index_js_1.DEFAULT_LOADING_TEXT }));
164
204
  } }));
165
205
  });
166
- Loading.displayName = 'GiftCard.Loading';
206
+ exports.Loading.displayName = 'GiftCard.Loading';
167
207
  /**
168
208
  * Displays error state.
169
209
  * Only renders when there's an error.
@@ -174,24 +214,24 @@ Loading.displayName = 'GiftCard.Loading';
174
214
  * <GiftCard.Error className="text-red-500" />
175
215
  * ```
176
216
  */
177
- export const Error = React.forwardRef((props, ref) => {
217
+ exports.Error = react_1.default.forwardRef((props, ref) => {
178
218
  const { className, ...otherProps } = props;
179
- return (_jsx(CoreGiftCard.Error, { children: ({ error }) => {
219
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.Error, { children: ({ error }) => {
180
220
  if (!error)
181
221
  return null;
182
- return (_jsx("div", { ref: ref, className: className, "data-testid": TestIds.giftCardError, ...otherProps, children: error }));
222
+ return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: className, "data-testid": index_js_1.TestIds.giftCardError, ...otherProps, children: error }));
183
223
  } }));
184
224
  });
185
- Error.displayName = 'GiftCard.Error';
225
+ exports.Error.displayName = 'GiftCard.Error';
186
226
  /**
187
227
  * Context for individual preset variant data
188
228
  */
189
- const PresetVariantContext = React.createContext(null);
229
+ const PresetVariantContext = react_1.default.createContext(null);
190
230
  /**
191
231
  * Hook to access PresetVariant context
192
232
  */
193
233
  function usePresetVariantContext() {
194
- const context = React.useContext(PresetVariantContext);
234
+ const context = react_1.default.useContext(PresetVariantContext);
195
235
  if (!context) {
196
236
  // Use globalThis.Error to avoid conflict with exported Error component
197
237
  throw new globalThis.Error('PresetVariant components must be used within PresetVariantRepeater');
@@ -214,16 +254,16 @@ function usePresetVariantContext() {
214
254
  * </GiftCard.PresetVariants>
215
255
  * ```
216
256
  */
217
- export const PresetVariants = React.forwardRef((props, ref) => {
257
+ exports.PresetVariants = react_1.default.forwardRef((props, ref) => {
218
258
  const { asChild, children, className, label, emptyState, ...otherProps } = props;
219
- return (_jsx(CoreGiftCard.PresetVariants, { children: (variantsData) => {
259
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.PresetVariants, { children: (variantsData) => {
220
260
  if (variantsData.presetVariants.length === 0 && emptyState) {
221
- return _jsx(_Fragment, { children: emptyState });
261
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: emptyState });
222
262
  }
223
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.giftCardPresetVariants, customElement: children, customElementProps: variantsData, ...otherProps, children: _jsxs("div", { children: [label && _jsx("label", { children: label }), children] }) }));
263
+ return ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": index_js_1.TestIds.giftCardPresetVariants, customElement: children, customElementProps: variantsData, ...otherProps, children: (0, jsx_runtime_1.jsxs)("div", { children: [label && (0, jsx_runtime_1.jsx)("label", { children: label }), children] }) }));
224
264
  } }));
225
265
  });
226
- PresetVariants.displayName = 'GiftCard.PresetVariants';
266
+ exports.PresetVariants.displayName = 'GiftCard.PresetVariants';
227
267
  /**
228
268
  * Repeater component that renders children for each preset variant.
229
269
  * Creates a PresetVariant context for each variant that child components can access.
@@ -236,11 +276,12 @@ PresetVariants.displayName = 'GiftCard.PresetVariants';
236
276
  * </GiftCard.PresetVariantRepeater>
237
277
  * ```
238
278
  */
239
- export const PresetVariantRepeater = (props) => {
279
+ const PresetVariantRepeater = (props) => {
240
280
  const { children, className } = props;
241
- return (_jsx(CoreGiftCard.PresetVariantRepeater, { children: ({ presetVariants }) => (_jsx(_Fragment, { children: presetVariants.map((variant) => (_jsx(PresetVariantContext.Provider, { value: variant, children: _jsx("div", { "data-testid": TestIds.giftCardPresetVariant, "data-variant-id": variant.id, "data-selected": variant.isSelected || undefined, "data-has-discount": variant.hasDiscount || undefined, className: className, children: children }) }, variant.id))) })) }));
281
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.PresetVariantRepeater, { children: ({ presetVariants }) => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: presetVariants.map((variant) => ((0, jsx_runtime_1.jsx)(PresetVariantContext.Provider, { value: variant, children: (0, jsx_runtime_1.jsx)("div", { "data-testid": index_js_1.TestIds.giftCardPresetVariant, "data-variant-id": variant.id, "data-selected": variant.isSelected || undefined, "data-has-discount": variant.hasDiscount || undefined, className: className, children: children }) }, variant.id))) })) }));
242
282
  };
243
- PresetVariantRepeater.displayName = 'GiftCard.PresetVariantRepeater';
283
+ exports.PresetVariantRepeater = PresetVariantRepeater;
284
+ exports.PresetVariantRepeater.displayName = 'GiftCard.PresetVariantRepeater';
244
285
  /**
245
286
  * Clickable button for selecting a preset variant amount.
246
287
  * Default renders a button with Money-formatted value.
@@ -268,7 +309,7 @@ PresetVariantRepeater.displayName = 'GiftCard.PresetVariantRepeater';
268
309
  * </GiftCard.PresetVariant.Amount>
269
310
  * ```
270
311
  */
271
- const PresetVariantAmount = React.forwardRef((props, ref) => {
312
+ const PresetVariantAmount = react_1.default.forwardRef((props, ref) => {
272
313
  const { asChild, children, className, ...otherProps } = props;
273
314
  const variant = usePresetVariantContext();
274
315
  const amountData = {
@@ -281,7 +322,7 @@ const PresetVariantAmount = React.forwardRef((props, ref) => {
281
322
  currencyCode: variant.currencyCode,
282
323
  locale: variant.locale,
283
324
  };
284
- const moneyContent = (_jsx(Money, { money: {
325
+ const moneyContent = ((0, jsx_runtime_1.jsx)(react_4.Money, { money: {
285
326
  amount: variant.value,
286
327
  currency: variant.currencyCode,
287
328
  locale: variant.locale,
@@ -290,13 +331,13 @@ const PresetVariantAmount = React.forwardRef((props, ref) => {
290
331
  maximumFractionDigits: 2,
291
332
  },
292
333
  } }));
293
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.giftCardPresetVariantAmount, "data-selected": variant.isSelected || undefined, "data-has-discount": variant.hasDiscount || undefined, onClick: variant.select, customElement: children, customElementProps: amountData, content: moneyContent, ...otherProps, children: _jsx("button", { onClick: variant.select, children: moneyContent }) }));
334
+ return ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": index_js_1.TestIds.giftCardPresetVariantAmount, "data-selected": variant.isSelected || undefined, "data-has-discount": variant.hasDiscount || undefined, onClick: variant.select, customElement: children, customElementProps: amountData, content: moneyContent, ...otherProps, children: (0, jsx_runtime_1.jsx)("button", { onClick: variant.select, children: moneyContent }) }));
294
335
  });
295
336
  PresetVariantAmount.displayName = 'GiftCard.PresetVariant.Amount';
296
337
  /**
297
338
  == * PresetVariant namespace containing preset variant sub-components
298
339
  */
299
- export const PresetVariant = {
340
+ exports.PresetVariant = {
300
341
  Amount: PresetVariantAmount,
301
342
  };
302
343
  /**
@@ -332,10 +373,10 @@ export const PresetVariant = {
332
373
  * </GiftCard.CurrentPrice>
333
374
  * ```
334
375
  */
335
- export const CurrentPrice = React.forwardRef((props, ref) => {
376
+ exports.CurrentPrice = react_1.default.forwardRef((props, ref) => {
336
377
  const { asChild, children, className, ...otherProps } = props;
337
- return (_jsx(CoreGiftCard.CurrentPrice, { children: (priceData) => {
338
- const priceContent = (_jsxs(_Fragment, { children: [priceData.hasDiscount && (_jsx("span", { style: { textDecoration: 'line-through', marginRight: '8px' }, children: _jsx(Money, { money: {
378
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.CurrentPrice, { children: (priceData) => {
379
+ const priceContent = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [priceData.hasDiscount && ((0, jsx_runtime_1.jsx)("span", { style: { textDecoration: 'line-through', marginRight: '8px' }, children: (0, jsx_runtime_1.jsx)(react_4.Money, { money: {
339
380
  amount: priceData.value,
340
381
  currency: priceData.currencyCode,
341
382
  locale: priceData.locale,
@@ -343,7 +384,7 @@ export const CurrentPrice = React.forwardRef((props, ref) => {
343
384
  minimumFractionDigits: 0,
344
385
  maximumFractionDigits: 2,
345
386
  },
346
- } }) })), _jsx("span", { children: _jsx(Money, { money: {
387
+ } }) })), (0, jsx_runtime_1.jsx)("span", { children: (0, jsx_runtime_1.jsx)(react_4.Money, { money: {
347
388
  amount: priceData.price,
348
389
  currency: priceData.currencyCode,
349
390
  locale: priceData.locale,
@@ -352,10 +393,10 @@ export const CurrentPrice = React.forwardRef((props, ref) => {
352
393
  maximumFractionDigits: 2,
353
394
  },
354
395
  } }) })] }));
355
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.giftCardCurrentPrice, "data-has-discount": priceData.hasDiscount || undefined, customElement: children, customElementProps: priceData, content: priceContent, ...otherProps, children: _jsx("div", { children: priceContent }) }));
396
+ return ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": index_js_1.TestIds.giftCardCurrentPrice, "data-has-discount": priceData.hasDiscount || undefined, customElement: children, customElementProps: priceData, content: priceContent, ...otherProps, children: (0, jsx_runtime_1.jsx)("div", { children: priceContent }) }));
356
397
  } }));
357
398
  });
358
- CurrentPrice.displayName = 'GiftCard.CurrentPrice';
399
+ exports.CurrentPrice.displayName = 'GiftCard.CurrentPrice';
359
400
  /**
360
401
  * Trigger button for selecting custom amount option.
361
402
  * Use alongside PresetVariantRepeater to allow custom amounts.
@@ -388,11 +429,11 @@ CurrentPrice.displayName = 'GiftCard.CurrentPrice';
388
429
  * </GiftCard.CustomVariantTrigger>
389
430
  * ```
390
431
  */
391
- export const CustomVariantTrigger = React.forwardRef((props, ref) => {
432
+ exports.CustomVariantTrigger = react_1.default.forwardRef((props, ref) => {
392
433
  const { label = 'Other amount', asChild, children, className, ...otherProps } = props;
393
- return (_jsx(CoreGiftCard.CustomVariantTrigger, { children: ({ isSelected, onClick }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.giftCardCustomVariantTrigger, "data-selected": isSelected || undefined, customElement: children, customElementProps: { isSelected, onClick }, onClick: onClick, content: label, ...otherProps, children: _jsx("button", { onClick: onClick, children: label }) })) }));
434
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.CustomVariantTrigger, { children: ({ isSelected, onClick }) => ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": index_js_1.TestIds.giftCardCustomVariantTrigger, "data-selected": isSelected || undefined, customElement: children, customElementProps: { isSelected, onClick }, onClick: onClick, content: label, ...otherProps, children: (0, jsx_runtime_1.jsx)("button", { onClick: onClick, children: label }) })) }));
394
435
  });
395
- CustomVariantTrigger.displayName = 'GiftCard.CustomVariantTrigger';
436
+ exports.CustomVariantTrigger.displayName = 'GiftCard.CustomVariantTrigger';
396
437
  /**
397
438
  * Input for entering a custom gift card amount.
398
439
  * Only renders when custom variant is selected.
@@ -450,17 +491,17 @@ CustomVariantTrigger.displayName = 'GiftCard.CustomVariantTrigger';
450
491
  * </GiftCard.CustomAmountInput>
451
492
  * ```
452
493
  */
453
- export const CustomAmountInput = React.forwardRef((props, ref) => {
494
+ exports.CustomAmountInput = react_1.default.forwardRef((props, ref) => {
454
495
  const { label, asChild, children, className, ...otherProps } = props;
455
- return (_jsx(CoreGiftCard.CustomAmountInput, { children: (inputData) => {
496
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.CustomAmountInput, { children: (inputData) => {
456
497
  // Don't render if not visible (not custom variant) unless using asChild
457
498
  if (!inputData.isVisible && !asChild) {
458
499
  return null;
459
500
  }
460
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.giftCardCustomAmountInput, "data-invalid": !inputData.isValid || undefined, "data-visible": inputData.isVisible || undefined, customElement: children, customElementProps: inputData, ...otherProps, children: _jsx("div", { children: inputData.isVisible && (_jsxs("div", { children: [label && _jsx("label", { children: label }), _jsxs("div", { children: [_jsx("span", { children: inputData.currencySymbol }), _jsx("input", { prefix: inputData.currencySymbol, type: "number", value: inputData.value, onChange: (e) => inputData.setValue(parseFloat(e.target.value) || 0), min: inputData.min ?? undefined, max: inputData.max ?? undefined, className: className })] })] })) }) }));
501
+ return ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": index_js_1.TestIds.giftCardCustomAmountInput, "data-invalid": !inputData.isValid || undefined, "data-visible": inputData.isVisible || undefined, customElement: children, customElementProps: inputData, ...otherProps, children: (0, jsx_runtime_1.jsx)("div", { children: inputData.isVisible && ((0, jsx_runtime_1.jsxs)("div", { children: [label && (0, jsx_runtime_1.jsx)("label", { children: label }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("span", { children: inputData.currencySymbol }), (0, jsx_runtime_1.jsx)("input", { prefix: inputData.currencySymbol, type: "number", value: inputData.value, onChange: (e) => inputData.setValue(parseFloat(e.target.value) || 0), min: inputData.min ?? undefined, max: inputData.max ?? undefined, className: className })] })] })) }) }));
461
502
  } }));
462
503
  });
463
- CustomAmountInput.displayName = 'GiftCard.CustomAmountInput';
504
+ exports.CustomAmountInput.displayName = 'GiftCard.CustomAmountInput';
464
505
  /**
465
506
  * Container for quantity selection controls.
466
507
  * Renders a Quantity.Root from @wix/headless-components connected to the gift card service state.
@@ -523,11 +564,11 @@ CustomAmountInput.displayName = 'GiftCard.CustomAmountInput';
523
564
  * </GiftCard.Quantity>
524
565
  * ```
525
566
  */
526
- export const Quantity = React.forwardRef((props, ref) => {
567
+ exports.Quantity = react_1.default.forwardRef((props, ref) => {
527
568
  const { asChild, children, className, steps = 1, label, ...otherProps } = props;
528
- return (_jsx(CoreGiftCard.Quantity, { children: ({ quantity, setQuantity }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.giftCardQuantity, customElement: children, customElementProps: { quantity, setQuantity }, ...otherProps, children: _jsxs("div", { children: [label && _jsx("label", { children: label }), _jsxs(QuantityComponent.Root, { initialValue: quantity, onValueChange: setQuantity, steps: steps, min: 1, className: className, children: [_jsx(QuantityComponent.Decrement, {}), _jsx(QuantityComponent.Input, {}), _jsx(QuantityComponent.Increment, {})] })] }) })) }));
569
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.Quantity, { children: ({ quantity, setQuantity }) => ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": index_js_1.TestIds.giftCardQuantity, customElement: children, customElementProps: { quantity, setQuantity }, ...otherProps, children: (0, jsx_runtime_1.jsxs)("div", { children: [label && (0, jsx_runtime_1.jsx)("label", { children: label }), (0, jsx_runtime_1.jsxs)(react_4.Quantity.Root, { initialValue: quantity, onValueChange: setQuantity, steps: steps, min: 1, className: className, children: [(0, jsx_runtime_1.jsx)(react_4.Quantity.Decrement, {}), (0, jsx_runtime_1.jsx)(react_4.Quantity.Input, {}), (0, jsx_runtime_1.jsx)(react_4.Quantity.Increment, {})] })] }) })) }));
529
570
  });
530
- Quantity.displayName = 'GiftCard.Quantity';
571
+ exports.Quantity.displayName = 'GiftCard.Quantity';
531
572
  /**
532
573
  * Toggle between "For someone else" (gift) and "For myself" purchase modes.
533
574
  * When isGift is true, the recipient form should be shown.
@@ -580,11 +621,11 @@ Quantity.displayName = 'GiftCard.Quantity';
580
621
  * </GiftCard.GiftToggle>
581
622
  * ```
582
623
  */
583
- export const GiftToggle = React.forwardRef((props, ref) => {
624
+ exports.GiftToggle = react_1.default.forwardRef((props, ref) => {
584
625
  const { label, forSomeoneLabel = 'For someone else', forMyselfLabel = 'For myself', asChild, children, className, ...otherProps } = props;
585
- return (_jsx(CoreGiftCard.GiftToggle, { children: ({ isGift, setIsGift }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.giftCardGiftToggle, customElement: children, customElementProps: { isGift, setIsGift }, ...otherProps, children: _jsxs("div", { children: [label && _jsx("label", { children: label }), _jsxs("div", { className: className, children: [_jsx("button", { type: "button", onClick: () => setIsGift(true), "data-selected": isGift || undefined, "data-testid": TestIds.giftCardGiftToggleSomeone, children: forSomeoneLabel }), _jsx("button", { type: "button", onClick: () => setIsGift(false), "data-selected": !isGift || undefined, "data-testid": TestIds.giftCardGiftToggleMyself, children: forMyselfLabel })] })] }) })) }));
626
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.GiftToggle, { children: ({ isGift, setIsGift }) => ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": index_js_1.TestIds.giftCardGiftToggle, customElement: children, customElementProps: { isGift, setIsGift }, ...otherProps, children: (0, jsx_runtime_1.jsxs)("div", { children: [label && (0, jsx_runtime_1.jsx)("label", { children: label }), (0, jsx_runtime_1.jsxs)("div", { className: className, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", onClick: () => setIsGift(true), "data-selected": isGift || undefined, "data-testid": index_js_1.TestIds.giftCardGiftToggleSomeone, children: forSomeoneLabel }), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: () => setIsGift(false), "data-selected": !isGift || undefined, "data-testid": index_js_1.TestIds.giftCardGiftToggleMyself, children: forMyselfLabel })] })] }) })) }));
586
627
  });
587
- GiftToggle.displayName = 'GiftCard.GiftToggle';
628
+ exports.GiftToggle.displayName = 'GiftCard.GiftToggle';
588
629
  /**
589
630
  * Input for entering recipient email address.
590
631
  * Provides email state, validation, and error display control.
@@ -628,24 +669,24 @@ GiftToggle.displayName = 'GiftCard.GiftToggle';
628
669
  * </GiftCard.RecipientEmail>
629
670
  * ```
630
671
  */
631
- export const RecipientEmail = React.forwardRef((props, ref) => {
672
+ exports.RecipientEmail = react_1.default.forwardRef((props, ref) => {
632
673
  const { label, asChild, children, className, ...otherProps } = props;
633
- return (_jsx(CoreGiftCard.RecipientEmail, { children: ({ value, setValue, isValid, showError, isVisible }) => {
674
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.RecipientEmail, { children: ({ value, setValue, isValid, showError, isVisible }) => {
634
675
  // Don't render if not visible (isGift is false) unless using asChild
635
676
  if (!isVisible && !asChild) {
636
677
  return null;
637
678
  }
638
679
  const showInvalidState = showError && !isValid;
639
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.giftCardRecipientEmail, "data-invalid": showInvalidState || undefined, "data-visible": isVisible || undefined, customElement: children, customElementProps: {
680
+ return ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": index_js_1.TestIds.giftCardRecipientEmail, "data-invalid": showInvalidState || undefined, "data-visible": isVisible || undefined, customElement: children, customElementProps: {
640
681
  value,
641
682
  setValue,
642
683
  isValid,
643
684
  showError,
644
685
  isVisible,
645
- }, ...otherProps, children: _jsx("div", { children: isVisible && (_jsxs(_Fragment, { children: [label && _jsx("label", { children: label }), _jsx("input", { type: "email", value: value, onChange: (e) => setValue(e.target.value), className: className, "data-invalid": showInvalidState || undefined })] })) }) }));
686
+ }, ...otherProps, children: (0, jsx_runtime_1.jsx)("div", { children: isVisible && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [label && (0, jsx_runtime_1.jsx)("label", { children: label }), (0, jsx_runtime_1.jsx)("input", { type: "email", value: value, onChange: (e) => setValue(e.target.value), className: className, "data-invalid": showInvalidState || undefined })] })) }) }));
646
687
  } }));
647
688
  });
648
- RecipientEmail.displayName = 'GiftCard.RecipientEmail';
689
+ exports.RecipientEmail.displayName = 'GiftCard.RecipientEmail';
649
690
  /**
650
691
  * Input for entering recipient name.
651
692
  * Only renders when isGift is true (purchasing for someone else).
@@ -682,21 +723,21 @@ RecipientEmail.displayName = 'GiftCard.RecipientEmail';
682
723
  * </GiftCard.RecipientName>
683
724
  * ```
684
725
  */
685
- export const RecipientName = React.forwardRef((props, ref) => {
726
+ exports.RecipientName = react_1.default.forwardRef((props, ref) => {
686
727
  const { label, asChild, children, className, ...otherProps } = props;
687
- return (_jsx(CoreGiftCard.RecipientName, { children: ({ value, setValue, isVisible }) => {
728
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.RecipientName, { children: ({ value, setValue, isVisible }) => {
688
729
  // Don't render if not visible (isGift is false) unless using asChild
689
730
  if (!isVisible && !asChild) {
690
731
  return null;
691
732
  }
692
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.giftCardRecipientName, "data-visible": isVisible || undefined, customElement: children, customElementProps: {
733
+ return ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": index_js_1.TestIds.giftCardRecipientName, "data-visible": isVisible || undefined, customElement: children, customElementProps: {
693
734
  value,
694
735
  setValue,
695
736
  isVisible,
696
- }, ...otherProps, children: _jsx("div", { children: isVisible && (_jsxs(_Fragment, { children: [label && _jsx("label", { children: label }), _jsx("input", { type: "text", value: value, onChange: (e) => setValue(e.target.value), className: className })] })) }) }));
737
+ }, ...otherProps, children: (0, jsx_runtime_1.jsx)("div", { children: isVisible && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [label && (0, jsx_runtime_1.jsx)("label", { children: label }), (0, jsx_runtime_1.jsx)("input", { type: "text", value: value, onChange: (e) => setValue(e.target.value), className: className })] })) }) }));
697
738
  } }));
698
739
  });
699
- RecipientName.displayName = 'GiftCard.RecipientName';
740
+ exports.RecipientName.displayName = 'GiftCard.RecipientName';
700
741
  /**
701
742
  * Input for selecting gift card delivery date.
702
743
  * Only renders when isGift is true (purchasing for someone else).
@@ -734,27 +775,27 @@ RecipientName.displayName = 'GiftCard.RecipientName';
734
775
  * </GiftCard.RecipientDate>
735
776
  * ```
736
777
  */
737
- export const RecipientDate = React.forwardRef((props, ref) => {
778
+ exports.RecipientDate = react_1.default.forwardRef((props, ref) => {
738
779
  const { label, asChild, children, className, ...otherProps } = props;
739
- return (_jsx(CoreGiftCard.RecipientDate, { children: ({ value, formattedValue, inputValue, setValue, isVisible }) => {
780
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.RecipientDate, { children: ({ value, formattedValue, inputValue, setValue, isVisible }) => {
740
781
  // Don't render if not visible (isGift is false) unless using asChild
741
782
  if (!isVisible && !asChild) {
742
783
  return null;
743
784
  }
744
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.giftCardRecipientDate, "data-visible": isVisible || undefined, customElement: children, customElementProps: {
785
+ return ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": index_js_1.TestIds.giftCardRecipientDate, "data-visible": isVisible || undefined, customElement: children, customElementProps: {
745
786
  value,
746
787
  formattedValue,
747
788
  inputValue,
748
789
  setValue,
749
790
  isVisible,
750
- }, ...otherProps, children: _jsx("div", { children: isVisible && (_jsxs(_Fragment, { children: [label && _jsx("label", { children: label }), _jsx("input", { type: "date", value: inputValue, onChange: (e) => {
791
+ }, ...otherProps, children: (0, jsx_runtime_1.jsx)("div", { children: isVisible && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [label && (0, jsx_runtime_1.jsx)("label", { children: label }), (0, jsx_runtime_1.jsx)("input", { type: "date", value: inputValue, onChange: (e) => {
751
792
  if (e.target.value) {
752
793
  setValue(new Date(e.target.value));
753
794
  }
754
795
  }, className: className })] })) }) }));
755
796
  } }));
756
797
  });
757
- RecipientDate.displayName = 'GiftCard.RecipientDate';
798
+ exports.RecipientDate.displayName = 'GiftCard.RecipientDate';
758
799
  /**
759
800
  * Textarea for entering a personal message to include with the gift card.
760
801
  * Only renders when isGift is true (purchasing for someone else).
@@ -791,21 +832,21 @@ RecipientDate.displayName = 'GiftCard.RecipientDate';
791
832
  * </GiftCard.RecipientMessage>
792
833
  * ```
793
834
  */
794
- export const RecipientMessage = React.forwardRef((props, ref) => {
835
+ exports.RecipientMessage = react_1.default.forwardRef((props, ref) => {
795
836
  const { label, asChild, children, className, ...otherProps } = props;
796
- return (_jsx(CoreGiftCard.RecipientMessage, { children: ({ value, setValue, isVisible }) => {
837
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.RecipientMessage, { children: ({ value, setValue, isVisible }) => {
797
838
  // Don't render if not visible (isGift is false) unless using asChild
798
839
  if (!isVisible && !asChild) {
799
840
  return null;
800
841
  }
801
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.giftCardRecipientMessage, "data-visible": isVisible || undefined, customElement: children, customElementProps: {
842
+ return ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": index_js_1.TestIds.giftCardRecipientMessage, "data-visible": isVisible || undefined, customElement: children, customElementProps: {
802
843
  value,
803
844
  setValue,
804
845
  isVisible,
805
- }, ...otherProps, children: _jsx("div", { children: isVisible && (_jsxs(_Fragment, { children: [label && _jsx("label", { children: label }), _jsx("textarea", { value: value, onChange: (e) => setValue(e.target.value), className: className, rows: 4 })] })) }) }));
846
+ }, ...otherProps, children: (0, jsx_runtime_1.jsx)("div", { children: isVisible && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [label && (0, jsx_runtime_1.jsx)("label", { children: label }), (0, jsx_runtime_1.jsx)("textarea", { value: value, onChange: (e) => setValue(e.target.value), className: className, rows: 4 })] })) }) }));
806
847
  } }));
807
848
  });
808
- RecipientMessage.displayName = 'GiftCard.RecipientMessage';
849
+ exports.RecipientMessage.displayName = 'GiftCard.RecipientMessage';
809
850
  /**
810
851
  * Form for entering recipient details when purchasing a gift card for someone else.
811
852
  * Only renders when isGift is true (purchasing for someone else).
@@ -906,22 +947,22 @@ RecipientMessage.displayName = 'GiftCard.RecipientMessage';
906
947
  * </GiftCard.RecipientForm>
907
948
  * ```
908
949
  */
909
- export const RecipientForm = React.forwardRef((props, ref) => {
950
+ exports.RecipientForm = react_1.default.forwardRef((props, ref) => {
910
951
  const { emailLabel, nameLabel, dateLabel, messageLabel, asChild, children, className, ...otherProps } = props;
911
- return (_jsx(CoreGiftCard.RecipientForm, { children: (formData) => {
952
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.RecipientForm, { children: (formData) => {
912
953
  // Don't render if not visible (isGift is false) unless using asChild
913
954
  if (!formData.isVisible && !asChild) {
914
955
  return null;
915
956
  }
916
957
  const showEmailError = formData.showErrors && !formData.email.isValid;
917
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.giftCardRecipientForm, "data-visible": formData.isVisible || undefined, customElement: children, customElementProps: formData, ...otherProps, children: _jsx("div", { className: className, children: formData.isVisible && (_jsxs(_Fragment, { children: [_jsxs("div", { "data-testid": TestIds.giftCardRecipientEmail, children: [emailLabel && _jsx("label", { children: emailLabel }), _jsx("input", { type: "email", value: formData.email.value, onChange: (e) => formData.email.setValue(e.target.value), "data-invalid": showEmailError || undefined })] }), _jsxs("div", { "data-testid": TestIds.giftCardRecipientName, children: [nameLabel && _jsx("label", { children: nameLabel }), _jsx("input", { type: "text", value: formData.name.value, onChange: (e) => formData.name.setValue(e.target.value) })] }), _jsxs("div", { "data-testid": TestIds.giftCardRecipientDate, children: [dateLabel && _jsx("label", { children: dateLabel }), _jsx("input", { type: "date", value: formData.deliverAt.inputValue, onChange: (e) => {
958
+ return ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": index_js_1.TestIds.giftCardRecipientForm, "data-visible": formData.isVisible || undefined, customElement: children, customElementProps: formData, ...otherProps, children: (0, jsx_runtime_1.jsx)("div", { className: className, children: formData.isVisible && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { "data-testid": index_js_1.TestIds.giftCardRecipientEmail, children: [emailLabel && (0, jsx_runtime_1.jsx)("label", { children: emailLabel }), (0, jsx_runtime_1.jsx)("input", { type: "email", value: formData.email.value, onChange: (e) => formData.email.setValue(e.target.value), "data-invalid": showEmailError || undefined })] }), (0, jsx_runtime_1.jsxs)("div", { "data-testid": index_js_1.TestIds.giftCardRecipientName, children: [nameLabel && (0, jsx_runtime_1.jsx)("label", { children: nameLabel }), (0, jsx_runtime_1.jsx)("input", { type: "text", value: formData.name.value, onChange: (e) => formData.name.setValue(e.target.value) })] }), (0, jsx_runtime_1.jsxs)("div", { "data-testid": index_js_1.TestIds.giftCardRecipientDate, children: [dateLabel && (0, jsx_runtime_1.jsx)("label", { children: dateLabel }), (0, jsx_runtime_1.jsx)("input", { type: "date", value: formData.deliverAt.inputValue, onChange: (e) => {
918
959
  if (e.target.value) {
919
960
  formData.deliverAt.setValue(new Date(e.target.value));
920
961
  }
921
- } })] }), _jsxs("div", { "data-testid": TestIds.giftCardRecipientMessage, children: [messageLabel && _jsx("label", { children: messageLabel }), _jsx("textarea", { value: formData.message.value, onChange: (e) => formData.message.setValue(e.target.value), rows: 4 })] })] })) }) }));
962
+ } })] }), (0, jsx_runtime_1.jsxs)("div", { "data-testid": index_js_1.TestIds.giftCardRecipientMessage, children: [messageLabel && (0, jsx_runtime_1.jsx)("label", { children: messageLabel }), (0, jsx_runtime_1.jsx)("textarea", { value: formData.message.value, onChange: (e) => formData.message.setValue(e.target.value), rows: 4 })] })] })) }) }));
922
963
  } }));
923
964
  });
924
- RecipientForm.displayName = 'GiftCard.RecipientForm';
965
+ exports.RecipientForm.displayName = 'GiftCard.RecipientForm';
925
966
  /**
926
967
  * Add to cart button for gift cards.
927
968
  * Validates the form (triggers showErrors), then adds the gift card to cart.
@@ -978,19 +1019,19 @@ RecipientForm.displayName = 'GiftCard.RecipientForm';
978
1019
  * />
979
1020
  * ```
980
1021
  */
981
- export const ActionAddToCart = React.forwardRef((props, ref) => {
1022
+ exports.ActionAddToCart = react_1.default.forwardRef((props, ref) => {
982
1023
  const { label = 'Add to Cart', loadingLabel, asChild, children, className, onSuccess, ...otherProps } = props;
983
- return (_jsx(CoreGiftCard.Actions, { children: ({ lineItems, validateAndShowErrors }) => {
1024
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.Actions, { children: ({ lineItems, validateAndShowErrors }) => {
984
1025
  // asChild
985
1026
  if (asChild && children) {
986
- return (_jsx(Commerce.Actions.AddToCart, { ref: ref, lineItems: lineItems, asChild: true, onSuccess: onSuccess, children: (commerceProps, commerceRef) => {
1027
+ return ((0, jsx_runtime_1.jsx)(react_5.Commerce.Actions.AddToCart, { ref: ref, lineItems: lineItems, asChild: true, onSuccess: onSuccess, children: (commerceProps, commerceRef) => {
987
1028
  const onClick = async () => {
988
1029
  if (!validateAndShowErrors()) {
989
1030
  return;
990
1031
  }
991
1032
  await commerceProps.onClick();
992
1033
  };
993
- return (_jsx(AsChildSlot, { ref: commerceRef, asChild: asChild, className: className, "data-testid": TestIds.giftCardAddToCart, customElement: children, customElementProps: {
1034
+ return ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: commerceRef, asChild: asChild, className: className, "data-testid": index_js_1.TestIds.giftCardAddToCart, customElement: children, customElementProps: {
994
1035
  onClick,
995
1036
  isLoading: commerceProps.isLoading,
996
1037
  }, content: commerceProps.isLoading && loadingLabel
@@ -999,20 +1040,20 @@ export const ActionAddToCart = React.forwardRef((props, ref) => {
999
1040
  } }));
1000
1041
  }
1001
1042
  // default rendering
1002
- return (_jsx(Commerce.Actions.AddToCart, { ref: ref, lineItems: lineItems, asChild: true, onSuccess: onSuccess, children: (commerceProps, commerceRef) => {
1043
+ return ((0, jsx_runtime_1.jsx)(react_5.Commerce.Actions.AddToCart, { ref: ref, lineItems: lineItems, asChild: true, onSuccess: onSuccess, children: (commerceProps, commerceRef) => {
1003
1044
  const onClick = async () => {
1004
1045
  if (!validateAndShowErrors()) {
1005
1046
  return;
1006
1047
  }
1007
1048
  await commerceProps.onClick();
1008
1049
  };
1009
- return (_jsx("button", { ref: commerceRef, className: className, disabled: commerceProps.isLoading, onClick: onClick, "data-testid": TestIds.giftCardAddToCart, "data-loading": commerceProps.isLoading || undefined, ...otherProps, children: commerceProps.isLoading && loadingLabel
1050
+ return ((0, jsx_runtime_1.jsx)("button", { ref: commerceRef, className: className, disabled: commerceProps.isLoading, onClick: onClick, "data-testid": index_js_1.TestIds.giftCardAddToCart, "data-loading": commerceProps.isLoading || undefined, ...otherProps, children: commerceProps.isLoading && loadingLabel
1010
1051
  ? loadingLabel
1011
1052
  : label }));
1012
1053
  } }));
1013
1054
  } }));
1014
1055
  });
1015
- ActionAddToCart.displayName = 'GiftCard.Action.AddToCart';
1056
+ exports.ActionAddToCart.displayName = 'GiftCard.Action.AddToCart';
1016
1057
  /**
1017
1058
  * Buy now button for gift cards.
1018
1059
  * Validates the form (triggers showErrors), then redirects to checkout.
@@ -1061,19 +1102,19 @@ ActionAddToCart.displayName = 'GiftCard.Action.AddToCart';
1061
1102
  * </GiftCard.Action.BuyNow>
1062
1103
  * ```
1063
1104
  */
1064
- export const ActionBuyNow = React.forwardRef((props, ref) => {
1105
+ exports.ActionBuyNow = react_1.default.forwardRef((props, ref) => {
1065
1106
  const { label = 'Buy Now', loadingLabel, asChild, children, className, ...otherProps } = props;
1066
- return (_jsx(CoreGiftCard.Actions, { children: ({ lineItems, validateAndShowErrors }) => {
1107
+ return ((0, jsx_runtime_1.jsx)(CoreGiftCard.Actions, { children: ({ lineItems, validateAndShowErrors }) => {
1067
1108
  // asChild
1068
1109
  if (asChild && children) {
1069
- return (_jsx(Commerce.Actions.BuyNow, { ref: ref, lineItems: lineItems, asChild: true, children: (commerceProps, commerceRef) => {
1110
+ return ((0, jsx_runtime_1.jsx)(react_5.Commerce.Actions.BuyNow, { ref: ref, lineItems: lineItems, asChild: true, children: (commerceProps, commerceRef) => {
1070
1111
  const onClick = async () => {
1071
1112
  if (!validateAndShowErrors()) {
1072
1113
  return;
1073
1114
  }
1074
1115
  await commerceProps.onClick();
1075
1116
  };
1076
- return (_jsx(AsChildSlot, { ref: commerceRef, asChild: asChild, className: className, "data-testid": TestIds.giftCardBuyNow, customElement: children, customElementProps: {
1117
+ return ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: commerceRef, asChild: asChild, className: className, "data-testid": index_js_1.TestIds.giftCardBuyNow, customElement: children, customElementProps: {
1077
1118
  onClick,
1078
1119
  isLoading: commerceProps.isLoading,
1079
1120
  }, content: commerceProps.isLoading && loadingLabel
@@ -1082,20 +1123,20 @@ export const ActionBuyNow = React.forwardRef((props, ref) => {
1082
1123
  } }));
1083
1124
  }
1084
1125
  // default rendering
1085
- return (_jsx(Commerce.Actions.BuyNow, { ref: ref, lineItems: lineItems, asChild: true, children: (commerceProps, commerceRef) => {
1126
+ return ((0, jsx_runtime_1.jsx)(react_5.Commerce.Actions.BuyNow, { ref: ref, lineItems: lineItems, asChild: true, children: (commerceProps, commerceRef) => {
1086
1127
  const onClick = async () => {
1087
1128
  if (!validateAndShowErrors()) {
1088
1129
  return;
1089
1130
  }
1090
1131
  await commerceProps.onClick();
1091
1132
  };
1092
- return (_jsx("button", { ref: commerceRef, className: className, disabled: commerceProps.isLoading, onClick: onClick, "data-testid": TestIds.giftCardBuyNow, "data-loading": commerceProps.isLoading || undefined, ...otherProps, children: commerceProps.isLoading && loadingLabel
1133
+ return ((0, jsx_runtime_1.jsx)("button", { ref: commerceRef, className: className, disabled: commerceProps.isLoading, onClick: onClick, "data-testid": index_js_1.TestIds.giftCardBuyNow, "data-loading": commerceProps.isLoading || undefined, ...otherProps, children: commerceProps.isLoading && loadingLabel
1093
1134
  ? loadingLabel
1094
1135
  : label }));
1095
1136
  } }));
1096
1137
  } }));
1097
1138
  });
1098
- ActionBuyNow.displayName = 'GiftCard.Action.BuyNow';
1139
+ exports.ActionBuyNow.displayName = 'GiftCard.Action.BuyNow';
1099
1140
  /**
1100
1141
  * Namespace containing all gift card action components.
1101
1142
  * These components provide consistent interfaces for gift card purchase actions.
@@ -1118,9 +1159,9 @@ ActionBuyNow.displayName = 'GiftCard.Action.BuyNow';
1118
1159
  * />
1119
1160
  * ```
1120
1161
  */
1121
- export const Action = {
1162
+ exports.Action = {
1122
1163
  /** Add to Cart button for adding gift card to the current cart */
1123
- AddToCart: ActionAddToCart,
1164
+ AddToCart: exports.ActionAddToCart,
1124
1165
  /** Buy Now button for immediate checkout with the gift card */
1125
- BuyNow: ActionBuyNow,
1166
+ BuyNow: exports.ActionBuyNow,
1126
1167
  };