@shopify/hydrogen 0.11.1 → 0.12.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.
Files changed (183) hide show
  1. package/CHANGELOG.md +199 -0
  2. package/dist/esnext/components/AddToCartButton/AddToCartButton.client.d.ts +3 -4
  3. package/dist/esnext/components/AddToCartButton/AddToCartButton.client.js +9 -22
  4. package/dist/esnext/components/AddToCartButton/index.d.ts +1 -1
  5. package/dist/esnext/components/BuyNowButton/BuyNowButton.client.d.ts +4 -5
  6. package/dist/esnext/components/BuyNowButton/index.d.ts +1 -1
  7. package/dist/esnext/components/BuyNowButton/index.js +1 -1
  8. package/dist/esnext/components/CartCheckoutButton/CartCheckoutButton.client.d.ts +2 -3
  9. package/dist/esnext/components/CartEstimatedCost/CartEstimatedCost.client.d.ts +3 -3
  10. package/dist/esnext/components/CartLineImage/CartLineImage.client.d.ts +5 -3
  11. package/dist/esnext/components/CartLinePrice/CartLinePrice.client.d.ts +5 -5
  12. package/dist/esnext/components/CartLinePrice/CartLinePrice.client.js +1 -1
  13. package/dist/esnext/components/CartLineProductTitle/CartLineProductTitle.client.d.ts +1 -3
  14. package/dist/esnext/components/CartLineProvider/context.d.ts +0 -6
  15. package/dist/esnext/components/CartLineQuantity/CartLineQuantity.client.d.ts +1 -3
  16. package/dist/esnext/components/CartProvider/CartProvider.client.js +6 -1
  17. package/dist/esnext/components/CartProvider/graphql/CartAttributesUpdateMutation.d.ts +71 -4
  18. package/dist/esnext/components/CartProvider/graphql/CartBuyerIdentityUpdateMutation.d.ts +71 -4
  19. package/dist/esnext/components/CartProvider/graphql/CartCreateMutation.d.ts +71 -4
  20. package/dist/esnext/components/CartProvider/graphql/CartDiscountCodesUpdateMutation.d.ts +72 -5
  21. package/dist/esnext/components/CartProvider/graphql/CartFragment.d.ts +12 -10
  22. package/dist/esnext/components/CartProvider/graphql/CartLineAddMutation.d.ts +71 -4
  23. package/dist/esnext/components/CartProvider/graphql/CartLineRemoveMutation.d.ts +71 -4
  24. package/dist/esnext/components/CartProvider/graphql/CartLineUpdateMutation.d.ts +71 -4
  25. package/dist/esnext/components/CartProvider/graphql/CartNoteUpdateMutation.d.ts +72 -5
  26. package/dist/esnext/components/CartProvider/graphql/CartQuery.d.ts +71 -4
  27. package/dist/esnext/components/CartShopPayButton/CartShopPayButton.client.d.ts +3 -2
  28. package/dist/esnext/components/ExternalVideo/ExternalVideo.d.ts +5 -11
  29. package/dist/esnext/components/ExternalVideo/ExternalVideo.js +2 -5
  30. package/dist/esnext/components/ExternalVideo/ExternalVideoFragment.d.ts +5 -1
  31. package/dist/esnext/components/ExternalVideo/index.d.ts +1 -1
  32. package/dist/esnext/components/ExternalVideo/index.js +1 -1
  33. package/dist/esnext/components/Image/Image.d.ts +5 -9
  34. package/dist/esnext/components/Image/Image.js +0 -3
  35. package/dist/esnext/components/Image/ImageFragment.d.ts +4 -0
  36. package/dist/esnext/components/Image/index.d.ts +1 -1
  37. package/dist/esnext/components/Image/index.js +1 -1
  38. package/dist/esnext/components/Link/Link.client.js +1 -1
  39. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.d.ts +2 -3
  40. package/dist/esnext/components/LocalizationProvider/LocalizationQuery.d.ts +4 -0
  41. package/dist/esnext/components/MediaFile/MediaFile.d.ts +8 -20
  42. package/dist/esnext/components/MediaFile/MediaFile.js +7 -5
  43. package/dist/esnext/components/MediaFile/MediaFileFragment.d.ts +22 -8
  44. package/dist/esnext/components/MediaFile/index.d.ts +1 -1
  45. package/dist/esnext/components/MediaFile/index.js +1 -1
  46. package/dist/esnext/components/Metafield/Metafield.client.d.ts +0 -4
  47. package/dist/esnext/components/Metafield/Metafield.client.js +0 -3
  48. package/dist/esnext/components/Metafield/MetafieldFragment.d.ts +5 -2
  49. package/dist/esnext/components/Metafield/components/StarRating/StarRating.d.ts +1 -3
  50. package/dist/esnext/components/Metafield/index.d.ts +1 -2
  51. package/dist/esnext/components/Metafield/index.js +1 -1
  52. package/dist/esnext/components/ModelViewer/Model3DFragment.d.ts +4 -0
  53. package/dist/esnext/components/ModelViewer/ModelViewer.client.d.ts +3 -12
  54. package/dist/esnext/components/ModelViewer/ModelViewer.client.js +0 -3
  55. package/dist/esnext/components/ModelViewer/index.d.ts +1 -1
  56. package/dist/esnext/components/Money/Money.client.d.ts +5 -10
  57. package/dist/esnext/components/Money/Money.client.js +0 -3
  58. package/dist/esnext/components/Money/MoneyFragment.d.ts +4 -0
  59. package/dist/esnext/components/Money/index.d.ts +1 -1
  60. package/dist/esnext/components/Money/index.js +1 -1
  61. package/dist/esnext/components/ProductDescription/ProductDescription.client.d.ts +3 -3
  62. package/dist/esnext/components/ProductPrice/ProductPrice.client.d.ts +5 -5
  63. package/dist/esnext/components/ProductProvider/ProductProvider.client.d.ts +5 -6
  64. package/dist/esnext/components/ProductProvider/ProductProvider.client.js +1 -4
  65. package/dist/esnext/components/ProductProvider/ProductProviderFragment.d.ts +183 -16
  66. package/dist/esnext/components/ProductProvider/index.d.ts +1 -1
  67. package/dist/esnext/components/ProductProvider/index.js +1 -1
  68. package/dist/esnext/components/RawHtml/RawHtml.d.ts +1 -3
  69. package/dist/esnext/components/RawHtml/index.d.ts +1 -1
  70. package/dist/esnext/components/Seo/CollectionSeo.client.d.ts +2 -2
  71. package/dist/esnext/components/Seo/CollectionSeo.client.js +1 -1
  72. package/dist/esnext/components/Seo/DefaultPageSeo.client.js +2 -2
  73. package/dist/esnext/components/Seo/DescriptionSeo.client.d.ts +3 -3
  74. package/dist/esnext/components/Seo/DescriptionSeo.client.js +1 -1
  75. package/dist/esnext/components/Seo/ImageSeo.client.d.ts +2 -2
  76. package/dist/esnext/components/Seo/ImageSeo.client.js +1 -1
  77. package/dist/esnext/components/Seo/PageSeo.client.d.ts +2 -2
  78. package/dist/esnext/components/Seo/PageSeo.client.js +2 -2
  79. package/dist/esnext/components/Seo/ProductSeo.client.d.ts +5 -2
  80. package/dist/esnext/components/Seo/Seo.client.d.ts +8 -7
  81. package/dist/esnext/components/Seo/Seo.client.js +8 -14
  82. package/dist/esnext/components/Seo/SeoFragment.d.ts +66 -0
  83. package/dist/esnext/components/Seo/SeoFragment.js +1 -0
  84. package/dist/esnext/components/Seo/TitleSeo.client.d.ts +2 -2
  85. package/dist/esnext/components/Seo/types.d.ts +8 -60
  86. package/dist/esnext/components/ShopPayButton/ShopPayButton.client.d.ts +2 -1
  87. package/dist/esnext/components/ShopPayButton/ShopPayButton.client.js +1 -9
  88. package/dist/esnext/components/ShopPayButton/index.d.ts +1 -1
  89. package/dist/esnext/components/UnitPrice/UnitPrice.client.d.ts +4 -10
  90. package/dist/esnext/components/UnitPrice/UnitPrice.client.js +8 -3
  91. package/dist/esnext/components/UnitPrice/UnitPriceFragment.d.ts +5 -2
  92. package/dist/esnext/components/UnitPrice/index.d.ts +1 -1
  93. package/dist/esnext/components/UnitPrice/index.js +1 -1
  94. package/dist/esnext/components/Video/Video.d.ts +5 -14
  95. package/dist/esnext/components/Video/Video.js +1 -4
  96. package/dist/esnext/components/Video/VideoFragment.d.ts +4 -0
  97. package/dist/esnext/components/Video/index.d.ts +1 -2
  98. package/dist/esnext/components/Video/index.js +1 -1
  99. package/dist/esnext/components/index.d.ts +3 -13
  100. package/dist/esnext/components/index.js +2 -2
  101. package/dist/esnext/entry-client.js +19 -5
  102. package/dist/esnext/entry-server.d.ts +1 -1
  103. package/dist/esnext/entry-server.js +27 -73
  104. package/dist/esnext/foundation/Boomerang/Boomerang.client.d.ts +3 -1
  105. package/dist/esnext/foundation/Boomerang/Boomerang.client.js +17 -3
  106. package/dist/esnext/foundation/Router/FileRoutes.d.ts +18 -0
  107. package/dist/esnext/foundation/Router/{DefaultRoutes.js → FileRoutes.js} +9 -18
  108. package/dist/esnext/foundation/Router/Route.server.d.ts +9 -0
  109. package/dist/esnext/foundation/Router/Route.server.js +6 -0
  110. package/dist/esnext/foundation/Router/{Router.client.d.ts → Router.d.ts} +0 -0
  111. package/dist/esnext/foundation/Router/{Router.client.js → Router.js} +4 -2
  112. package/dist/esnext/foundation/Router/Router.server.d.ts +8 -0
  113. package/dist/esnext/foundation/Router/Router.server.js +23 -0
  114. package/dist/esnext/foundation/Router/useParams.d.ts +1 -0
  115. package/dist/esnext/foundation/Router/useParams.js +5 -0
  116. package/dist/esnext/foundation/ServerStateProvider/{ServerStateProvider.client.d.ts → ServerStateProvider.d.ts} +0 -0
  117. package/dist/esnext/foundation/ServerStateProvider/{ServerStateProvider.client.js → ServerStateProvider.js} +0 -0
  118. package/dist/esnext/foundation/ServerStateProvider/index.d.ts +2 -2
  119. package/dist/esnext/foundation/ServerStateProvider/index.js +1 -1
  120. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.client.js +3 -0
  121. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.js +3 -0
  122. package/dist/esnext/foundation/index.d.ts +0 -1
  123. package/dist/esnext/foundation/index.js +0 -1
  124. package/dist/esnext/fragments.d.ts +20 -0
  125. package/dist/esnext/fragments.js +10 -0
  126. package/dist/esnext/framework/Hydration/Html.d.ts +2 -0
  127. package/dist/esnext/framework/Hydration/Html.js +71 -2
  128. package/dist/esnext/framework/Hydration/rsc.js +1 -1
  129. package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +15 -17
  130. package/dist/esnext/graphql/graphql-constants.d.ts +11 -6
  131. package/dist/esnext/graphql/graphql-constants.js +89 -6
  132. package/dist/esnext/graphql/types/types.d.ts +1645 -1579
  133. package/dist/esnext/graphql/types/types.js +699 -702
  134. package/dist/esnext/hooks/useCartLine/useCartLine.d.ts +0 -8
  135. package/dist/esnext/hooks/useNavigate/useNavigate.js +1 -1
  136. package/dist/esnext/hooks/useProduct/useProduct.d.ts +7 -47
  137. package/dist/esnext/hooks/useProductOptions/SellingPlanFragment.d.ts +6 -3
  138. package/dist/esnext/hooks/useProductOptions/SellingPlanGroupsFragment.d.ts +28 -2
  139. package/dist/esnext/hooks/useProductOptions/VariantFragment.d.ts +57 -15
  140. package/dist/esnext/hooks/useShopQuery/hooks.js +16 -7
  141. package/dist/esnext/index.d.ts +4 -0
  142. package/dist/esnext/index.js +4 -0
  143. package/dist/esnext/streaming.server.d.ts +0 -1
  144. package/dist/esnext/streaming.server.js +0 -9
  145. package/dist/esnext/types.d.ts +2 -2
  146. package/dist/esnext/utilities/apiRoutes.d.ts +15 -3
  147. package/dist/esnext/utilities/apiRoutes.js +25 -4
  148. package/dist/esnext/utilities/fetch.js +0 -8
  149. package/dist/esnext/utilities/video_parameters.js +0 -4
  150. package/dist/esnext/version.d.ts +1 -1
  151. package/dist/esnext/version.js +1 -1
  152. package/dist/node/entry-server.d.ts +1 -1
  153. package/dist/node/entry-server.js +24 -70
  154. package/dist/node/foundation/ServerStateProvider/{ServerStateProvider.client.d.ts → ServerStateProvider.d.ts} +0 -0
  155. package/dist/node/foundation/ServerStateProvider/{ServerStateProvider.client.js → ServerStateProvider.js} +0 -0
  156. package/dist/node/foundation/ServerStateProvider/index.d.ts +2 -2
  157. package/dist/node/foundation/ServerStateProvider/index.js +3 -3
  158. package/dist/node/framework/Hydration/Html.d.ts +2 -0
  159. package/dist/node/framework/Hydration/Html.js +73 -3
  160. package/dist/node/framework/Hydration/rsc.js +1 -1
  161. package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +15 -17
  162. package/dist/node/graphql/types/types.d.ts +1645 -1579
  163. package/dist/node/graphql/types/types.js +700 -703
  164. package/dist/node/streaming.server.d.ts +0 -1
  165. package/dist/node/streaming.server.js +1 -11
  166. package/dist/node/types.d.ts +2 -2
  167. package/dist/node/utilities/apiRoutes.d.ts +15 -3
  168. package/dist/node/utilities/apiRoutes.js +27 -6
  169. package/dist/node/utilities/fetch.d.ts +4 -0
  170. package/dist/node/utilities/fetch.js +40 -0
  171. package/dist/node/version.d.ts +1 -0
  172. package/dist/node/version.js +4 -0
  173. package/fragments.d.ts +1 -0
  174. package/fragments.js +1 -0
  175. package/package.json +15 -12
  176. package/vendor/react-server-dom-vite/esm/react-server-dom-vite-client-proxy.js +3 -3
  177. package/dist/esnext/components/Router/index.d.ts +0 -1
  178. package/dist/esnext/components/Router/index.js +0 -1
  179. package/dist/esnext/foundation/Boomerang/BoomerangPageTemplate.client.d.ts +0 -3
  180. package/dist/esnext/foundation/Boomerang/BoomerangPageTemplate.client.js +0 -14
  181. package/dist/esnext/foundation/Router/DefaultRoutes.d.ts +0 -22
  182. package/dist/esnext/foundation/Router/index.d.ts +0 -1
  183. package/dist/esnext/foundation/Router/index.js +0 -1
@@ -1,14 +1,81 @@
1
+ /**
2
+ * THIS FILE IS AUTO-GENERATED, DO NOT EDIT.
3
+ * Instead, you can edit the associated .graphql file to query for additional fields and this file will be updated when you run `yarn graphql-types`
4
+ */
1
5
  import * as Types from '../../../graphql/types/types';
2
- import { CartFragmentFragment } from './CartFragment';
3
6
  export declare type CartQueryQueryVariables = Types.Exact<{
4
7
  id: Types.Scalars['ID'];
5
- numCartLines?: Types.Maybe<Types.Scalars['Int']>;
6
- country?: Types.Maybe<Types.CountryCode>;
8
+ numCartLines?: Types.InputMaybe<Types.Scalars['Int']>;
9
+ country?: Types.InputMaybe<Types.CountryCode>;
7
10
  }>;
8
11
  export declare type CartQueryQuery = {
9
12
  __typename?: 'QueryRoot';
10
13
  } & {
11
14
  cart?: Types.Maybe<{
12
15
  __typename?: 'Cart';
13
- } & CartFragmentFragment>;
16
+ } & Pick<Types.Cart, 'id' | 'checkoutUrl' | 'note'> & {
17
+ buyerIdentity: {
18
+ __typename?: 'CartBuyerIdentity';
19
+ } & Pick<Types.CartBuyerIdentity, 'countryCode' | 'email' | 'phone'> & {
20
+ customer?: Types.Maybe<{
21
+ __typename?: 'Customer';
22
+ } & Pick<Types.Customer, 'id' | 'email' | 'firstName' | 'lastName' | 'displayName'>>;
23
+ };
24
+ lines: {
25
+ __typename?: 'CartLineConnection';
26
+ } & {
27
+ edges: Array<{
28
+ __typename?: 'CartLineEdge';
29
+ } & {
30
+ node: {
31
+ __typename?: 'CartLine';
32
+ } & Pick<Types.CartLine, 'id' | 'quantity'> & {
33
+ attributes: Array<{
34
+ __typename?: 'Attribute';
35
+ } & Pick<Types.Attribute, 'key' | 'value'>>;
36
+ merchandise: {
37
+ __typename?: 'ProductVariant';
38
+ } & Pick<Types.ProductVariant, 'id' | 'availableForSale' | 'requiresShipping' | 'title'> & {
39
+ compareAtPriceV2?: Types.Maybe<{
40
+ __typename?: 'MoneyV2';
41
+ } & Pick<Types.MoneyV2, 'currencyCode' | 'amount'>>;
42
+ priceV2: {
43
+ __typename?: 'MoneyV2';
44
+ } & Pick<Types.MoneyV2, 'currencyCode' | 'amount'>;
45
+ image?: Types.Maybe<{
46
+ __typename?: 'Image';
47
+ } & Pick<Types.Image, 'id' | 'url' | 'altText' | 'width' | 'height'>>;
48
+ product: {
49
+ __typename?: 'Product';
50
+ } & Pick<Types.Product, 'handle' | 'title'>;
51
+ selectedOptions: Array<{
52
+ __typename?: 'SelectedOption';
53
+ } & Pick<Types.SelectedOption, 'name' | 'value'>>;
54
+ };
55
+ };
56
+ }>;
57
+ };
58
+ estimatedCost: {
59
+ __typename?: 'CartEstimatedCost';
60
+ } & {
61
+ subtotalAmount: {
62
+ __typename?: 'MoneyV2';
63
+ } & Pick<Types.MoneyV2, 'currencyCode' | 'amount'>;
64
+ totalAmount: {
65
+ __typename?: 'MoneyV2';
66
+ } & Pick<Types.MoneyV2, 'currencyCode' | 'amount'>;
67
+ totalDutyAmount?: Types.Maybe<{
68
+ __typename?: 'MoneyV2';
69
+ } & Pick<Types.MoneyV2, 'currencyCode' | 'amount'>>;
70
+ totalTaxAmount?: Types.Maybe<{
71
+ __typename?: 'MoneyV2';
72
+ } & Pick<Types.MoneyV2, 'currencyCode' | 'amount'>>;
73
+ };
74
+ attributes: Array<{
75
+ __typename?: 'Attribute';
76
+ } & Pick<Types.Attribute, 'key' | 'value'>>;
77
+ discountCodes: Array<{
78
+ __typename?: 'CartDiscountCode';
79
+ } & Pick<Types.CartDiscountCode, 'code' | 'applicable'>>;
80
+ }>;
14
81
  };
@@ -1,8 +1,9 @@
1
- import { ShopPayButtonProps } from '../ShopPayButton';
1
+ import React from 'react';
2
+ import { ShopPayButton } from '../ShopPayButton';
2
3
  /**
3
4
  * The `CartShopPayButton` component renders a `ShopPayButton` for the items in the cart.
4
5
  * It must be a descendent of a `CartProvider` component.
5
6
  */
6
7
  export declare function CartShopPayButton({
7
8
  /** A string of classes to apply to the `div` that wraps the `shop-pay-button` web component. */
8
- className, }: Omit<ShopPayButtonProps, 'variantIds'>): JSX.Element;
9
+ className, }: Omit<React.ComponentProps<typeof ShopPayButton>, 'variantIds'>): JSX.Element;
@@ -1,12 +1,10 @@
1
- import * as React from 'react';
2
1
  import { YouTube, Vimeo } from '../../utilities';
3
- import { Props } from '../types';
4
- import { ExternalVideo as ExternalVideoType } from '../../graphql/types/types';
5
- export interface ExternalVideoProps {
6
- /** An object with the keys `host`, `embeddedUrl`, and `id`. Refer to the Storefront API's
2
+ import type { ExternalVideoFragmentFragment } from './ExternalVideoFragment';
3
+ interface ExternalVideoProps {
4
+ /** An object with the keys `host`, `embedUrl`, and `id`. Refer to the Storefront API's
7
5
  * [`ExternalVideo` type](/api/storefront/reference/products/externalvideo).
8
6
  */
9
- data: Pick<ExternalVideoType, 'host' | 'embeddedUrl' | 'id'>;
7
+ data: ExternalVideoFragmentFragment;
10
8
  /** An object containing the options available for either
11
9
  * [YouTube](https://developers.google.com/youtube/player_parameters#Parameters) or
12
10
  * [Vimeo](https://vimeo.zendesk.com/hc/en-us/articles/360001494447-Using-Player-Parameters).
@@ -18,9 +16,5 @@ declare type PropsWeControl = 'src';
18
16
  * The `ExternalVideo` component renders an embedded video for the Storefront
19
17
  * API's [`ExternalVideo` object](/api/storefront/reference/products/externalvideo).
20
18
  */
21
- export declare function ExternalVideo<TTag extends React.ElementType = 'iframe'>(props: Props<TTag, PropsWeControl> & ExternalVideoProps): JSX.Element;
22
- export declare namespace ExternalVideo {
23
- var Fragment: string;
24
- }
25
- export declare const ExternalVideoFragment = "fragment ExternalVideoFragment on ExternalVideo {\n id\n embeddedUrl\n host\n}\n\n";
19
+ export declare function ExternalVideo(props: Omit<JSX.IntrinsicElements['iframe'], PropsWeControl> & ExternalVideoProps): JSX.Element;
26
20
  export {};
@@ -1,14 +1,11 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { useEmbeddedVideoUrl } from '../../utilities';
3
- import { ExternalVideoFragment as Fragment } from '../../graphql/graphql-constants';
4
3
  /**
5
4
  * The `ExternalVideo` component renders an embedded video for the Storefront
6
5
  * API's [`ExternalVideo` object](/api/storefront/reference/products/externalvideo).
7
6
  */
8
7
  export function ExternalVideo(props) {
9
8
  const { data, options, id = data.id, frameBorder = '0', allow = 'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture', allowFullScreen = true, ...passthroughProps } = props;
10
- const url = useEmbeddedVideoUrl(data.embeddedUrl, options);
9
+ const url = useEmbeddedVideoUrl(data.embedUrl, options);
11
10
  return (React.createElement("iframe", { ...passthroughProps, id: id, frameBorder: frameBorder, allow: allow, allowFullScreen: allowFullScreen, src: url }));
12
11
  }
13
- ExternalVideo.Fragment = Fragment;
14
- export const ExternalVideoFragment = Fragment;
@@ -1,4 +1,8 @@
1
+ /**
2
+ * THIS FILE IS AUTO-GENERATED, DO NOT EDIT.
3
+ * Instead, you can edit the associated .graphql file to query for additional fields and this file will be updated when you run `yarn graphql-types`
4
+ */
1
5
  import * as Types from '../../graphql/types/types';
2
6
  export declare type ExternalVideoFragmentFragment = {
3
7
  __typename?: 'ExternalVideo';
4
- } & Pick<Types.ExternalVideo, 'id' | 'embeddedUrl' | 'host'>;
8
+ } & Pick<Types.ExternalVideo, 'id' | 'embedUrl' | 'host'>;
@@ -1 +1 @@
1
- export { ExternalVideo, ExternalVideoProps, ExternalVideoFragment, } from './ExternalVideo';
1
+ export { ExternalVideo } from './ExternalVideo';
@@ -1 +1 @@
1
- export { ExternalVideo, ExternalVideoFragment, } from './ExternalVideo';
1
+ export { ExternalVideo } from './ExternalVideo';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Props } from '../types';
3
3
  import { ImageSizeOptions, ImageLoaderOptions } from '../../utilities';
4
- import { Image as ImageType } from '../../graphql/types/types';
4
+ import type { ImageFragmentFragment } from './ImageFragment';
5
5
  export interface BaseImageProps {
6
6
  /** A custom function that generates the image URL. Parameters passed into this function includes
7
7
  * `src` and an `options` object that contains the provided `width`, `height` and `loaderOptions` values.
@@ -12,15 +12,15 @@ export interface BaseImageProps {
12
12
  */
13
13
  loaderOptions?: ImageLoaderOptions['options'];
14
14
  }
15
- export interface MediaImageProps extends BaseImageProps {
15
+ interface MediaImageProps extends BaseImageProps {
16
16
  /** An object with the keys `url`, `altText`, `id`, `width` and `height`. Refer to the
17
17
  * Storefront API's [`Image` object](/api/storefront/reference/common-objects/image).
18
18
  */
19
- data: Pick<ImageType, 'altText' | 'url' | 'id' | 'width' | 'height'>;
19
+ data: ImageFragmentFragment;
20
20
  /** An object of image size options for Shopify CDN images. */
21
21
  options?: ImageSizeOptions;
22
22
  }
23
- export interface ExternalImageProps extends BaseImageProps {
23
+ interface ExternalImageProps extends BaseImageProps {
24
24
  /** A URL string. This string can be an absolute path or a relative path depending on the `loader`. */
25
25
  src: string;
26
26
  /** The integer value for the width of the image. This is a required prop when `src` is present. */
@@ -28,15 +28,11 @@ export interface ExternalImageProps extends BaseImageProps {
28
28
  /** The integer value for the height of the image. This is a required prop when `src` is present. */
29
29
  height: number;
30
30
  }
31
- export declare type ImageProps = MediaImageProps | ExternalImageProps;
31
+ declare type ImageProps = MediaImageProps | ExternalImageProps;
32
32
  declare type PropsWeControl = 'src' | 'width' | 'height';
33
33
  /**
34
34
  * The `Image` component renders an image for the Storefront API's
35
35
  * [`Image` object](/api/storefront/reference/common-objects/image).
36
36
  */
37
37
  export declare function Image<TTag extends React.ElementType = 'img'>(props: Props<TTag, PropsWeControl> & ImageProps): JSX.Element;
38
- export declare namespace Image {
39
- var Fragment: string;
40
- }
41
- export declare const ImageFragment = "fragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n}\n\n";
42
38
  export {};
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { ImageFragment as Fragment } from '../../graphql/graphql-constants';
3
2
  import { shopifyImageLoader, getShopifyImageDimensions, } from '../../utilities';
4
3
  function convertShopifyImageData({ data, options, loader, loaderOptions, id: propId, alt, }) {
5
4
  const { url: src, altText, id } = data;
@@ -50,5 +49,3 @@ export function Image(props) {
50
49
  : imgProps.src;
51
50
  return (React.createElement("img", { id: (_a = imgProps.id) !== null && _a !== void 0 ? _a : '', loading: "lazy", alt: (_b = imgProps.alt) !== null && _b !== void 0 ? _b : '', ...passthroughProps, src: srcPath, width: (_c = imgProps.width) !== null && _c !== void 0 ? _c : undefined, height: (_d = imgProps.height) !== null && _d !== void 0 ? _d : undefined }));
52
51
  }
53
- Image.Fragment = Fragment;
54
- export const ImageFragment = Fragment;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * THIS FILE IS AUTO-GENERATED, DO NOT EDIT.
3
+ * Instead, you can edit the associated .graphql file to query for additional fields and this file will be updated when you run `yarn graphql-types`
4
+ */
1
5
  import * as Types from '../../graphql/types/types';
2
6
  export declare type ImageFragmentFragment = {
3
7
  __typename?: 'Image';
@@ -1 +1 @@
1
- export { Image, ImageProps, ImageFragment, MediaImageProps } from './Image';
1
+ export { Image } from './Image';
@@ -1 +1 @@
1
- export { Image, ImageFragment } from './Image';
1
+ export { Image } from './Image';
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback } from 'react';
2
- import { useRouter } from '../Router';
2
+ import { useRouter } from '../../foundation/Router/Router';
3
3
  import { createPath } from 'history';
4
4
  import { useNavigate } from '../../hooks/useNavigate';
5
5
  /**
@@ -1,6 +1,5 @@
1
- import { ReactNode, ElementType } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { PreloadOptions } from '../../types';
3
- import { Props } from '../types';
4
3
  export interface LocalizationProviderProps {
5
4
  /** A `ReactNode` element. */
6
5
  children: ReactNode;
@@ -19,4 +18,4 @@ export interface LocalizationProviderProps {
19
18
  * The `isoCode` of the `country` can be used in the Storefront API's
20
19
  * `@inContext` directive as the `country` value.
21
20
  */
22
- export declare function LocalizationProvider<TTag extends ElementType>(props: Props<TTag> & LocalizationProviderProps): JSX.Element;
21
+ export declare function LocalizationProvider(props: LocalizationProviderProps): JSX.Element;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * THIS FILE IS AUTO-GENERATED, DO NOT EDIT.
3
+ * Instead, you can edit the associated .graphql file to query for additional fields and this file will be updated when you run `yarn graphql-types`
4
+ */
1
5
  import * as Types from '../../graphql/types/types';
2
6
  export declare type LocalizationQueryVariables = Types.Exact<{
3
7
  [key: string]: never;
@@ -1,20 +1,13 @@
1
- import { MediaImageProps } from '../Image';
2
- import { VideoProps } from '../Video';
3
- import { ExternalVideoProps } from '../ExternalVideo';
4
- import { ModelViewerProps } from '../ModelViewer';
5
- import { Media as MediaType } from '../../graphql/types/types';
6
- export declare type Media = Pick<MediaType, 'mediaContentType'>;
7
- declare type MediaImageMedia = Media & {
8
- image: MediaImageProps['data'];
9
- };
10
- declare type ModelViewerMedia = Media & ModelViewerProps['data'];
11
- declare type ExternalVideoMedia = Media & ExternalVideoProps['data'];
12
- declare type VideoMedia = Media & VideoProps['data'];
1
+ import React from 'react';
2
+ import { Image } from '../Image';
3
+ import { Video } from '../Video';
4
+ import { ExternalVideo } from '../ExternalVideo';
5
+ import type { MediaFileFragmentFragment } from './MediaFileFragment';
13
6
  export interface MediaFileProps {
14
7
  /** A [Media object](/api/storefront/reference/products/media). */
15
- data: MediaImageMedia | ModelViewerMedia | ExternalVideoMedia | VideoMedia;
16
- /** The options for the `Image`, `Video`, `ExternalVideo`, or `ModelViewer` components. */
17
- options?: VideoProps['options'] | ExternalVideoProps['options'];
8
+ data: MediaFileFragmentFragment;
9
+ /** The options for the `Image`, `Video`, or `ExternalVideo` components. */
10
+ options?: React.ComponentProps<typeof Image>['options'] | React.ComponentProps<typeof Video>['options'] | React.ComponentProps<typeof ExternalVideo>['options'];
18
11
  }
19
12
  /**
20
13
  * The `MediaFile` component renders the media for the Storefront API's
@@ -23,8 +16,3 @@ export interface MediaFileProps {
23
16
  * `media` provided as a prop.
24
17
  */
25
18
  export declare function MediaFile({ data, options, ...passthroughProps }: MediaFileProps): JSX.Element | null;
26
- export declare namespace MediaFile {
27
- var Fragment: string;
28
- }
29
- export declare const MediaFileFragment = "\nfragment MediaFileFragment on Media {\n ... on MediaImage {\n mediaContentType\n image {\n ...ImageFragment\n }\n }\n ... on Video {\n mediaContentType\n ...VideoFragment\n }\n ... on ExternalVideo {\n mediaContentType\n ...ExternalVideoFragment\n }\n ... on Model3d {\n mediaContentType\n ...Model3DFragment\n }\n}\n\nfragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n}\n\nfragment VideoFragment on Video {\n id\n previewImage {\n url\n }\n sources {\n mimeType\n url\n }\n}\n\nfragment ExternalVideoFragment on ExternalVideo {\n id\n embeddedUrl\n host\n}\n\nfragment Model3DFragment on Model3d {\n id\n alt\n mediaContentType\n previewImage {\n url\n }\n sources {\n url\n }\n}\n";
30
- export {};
@@ -1,9 +1,8 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { Image } from '../Image';
3
3
  import { Video } from '../Video';
4
4
  import { ExternalVideo } from '../ExternalVideo';
5
5
  import { ModelViewer } from '../ModelViewer';
6
- import { MediaFileFragment as Fragment } from '../../graphql/graphql-constants';
7
6
  /**
8
7
  * The `MediaFile` component renders the media for the Storefront API's
9
8
  * [Media object](/api/storefront/reference/products/media). It renders an `Image`, a
@@ -13,7 +12,12 @@ import { MediaFileFragment as Fragment } from '../../graphql/graphql-constants';
13
12
  export function MediaFile({ data, options, ...passthroughProps }) {
14
13
  switch (data.mediaContentType) {
15
14
  case 'IMAGE': {
16
- return (React.createElement(Image, { ...passthroughProps, data: data.image, options: options }));
15
+ const dataImage = data.image;
16
+ if (!dataImage) {
17
+ console.warn(`No "image" property was found on the "data" prop for <MediaFile/>, for the "type='image'"`);
18
+ return null;
19
+ }
20
+ return (React.createElement(Image, { ...passthroughProps, data: dataImage, options: options }));
17
21
  }
18
22
  case 'VIDEO':
19
23
  return (React.createElement(Video, { ...passthroughProps, data: data, options: options }));
@@ -25,5 +29,3 @@ export function MediaFile({ data, options, ...passthroughProps }) {
25
29
  return null;
26
30
  }
27
31
  }
28
- MediaFile.Fragment = Fragment;
29
- export const MediaFileFragment = Fragment;
@@ -1,22 +1,36 @@
1
+ /**
2
+ * THIS FILE IS AUTO-GENERATED, DO NOT EDIT.
3
+ * Instead, you can edit the associated .graphql file to query for additional fields and this file will be updated when you run `yarn graphql-types`
4
+ */
1
5
  import * as Types from '../../graphql/types/types';
2
- import { ImageFragmentFragment } from '../Image/ImageFragment';
3
- import { VideoFragmentFragment } from '../Video/VideoFragment';
4
- import { ExternalVideoFragmentFragment } from '../ExternalVideo/ExternalVideoFragment';
5
- import { Model3DFragmentFragment } from '../ModelViewer/Model3DFragment';
6
6
  export declare type MediaFileFragment_ExternalVideo_Fragment = {
7
7
  __typename?: 'ExternalVideo';
8
- } & Pick<Types.ExternalVideo, 'mediaContentType'> & ExternalVideoFragmentFragment;
8
+ } & Pick<Types.ExternalVideo, 'mediaContentType' | 'id' | 'embedUrl' | 'host'>;
9
9
  export declare type MediaFileFragment_MediaImage_Fragment = {
10
10
  __typename?: 'MediaImage';
11
11
  } & Pick<Types.MediaImage, 'mediaContentType'> & {
12
12
  image?: Types.Maybe<{
13
13
  __typename?: 'Image';
14
- } & ImageFragmentFragment>;
14
+ } & Pick<Types.Image, 'id' | 'url' | 'altText' | 'width' | 'height'>>;
15
15
  };
16
16
  export declare type MediaFileFragment_Model3d_Fragment = {
17
17
  __typename?: 'Model3d';
18
- } & Pick<Types.Model3d, 'mediaContentType'> & Model3DFragmentFragment;
18
+ } & Pick<Types.Model3d, 'mediaContentType' | 'id' | 'alt'> & {
19
+ previewImage?: Types.Maybe<{
20
+ __typename?: 'Image';
21
+ } & Pick<Types.Image, 'url'>>;
22
+ sources: Array<{
23
+ __typename?: 'Model3dSource';
24
+ } & Pick<Types.Model3dSource, 'url'>>;
25
+ };
19
26
  export declare type MediaFileFragment_Video_Fragment = {
20
27
  __typename?: 'Video';
21
- } & Pick<Types.Video, 'mediaContentType'> & VideoFragmentFragment;
28
+ } & Pick<Types.Video, 'mediaContentType' | 'id'> & {
29
+ previewImage?: Types.Maybe<{
30
+ __typename?: 'Image';
31
+ } & Pick<Types.Image, 'url'>>;
32
+ sources: Array<{
33
+ __typename?: 'VideoSource';
34
+ } & Pick<Types.VideoSource, 'mimeType' | 'url'>>;
35
+ };
22
36
  export declare type MediaFileFragmentFragment = MediaFileFragment_ExternalVideo_Fragment | MediaFileFragment_MediaImage_Fragment | MediaFileFragment_Model3d_Fragment | MediaFileFragment_Video_Fragment;
@@ -1 +1 @@
1
- export { MediaFile, MediaFileProps, MediaFileFragment } from './MediaFile';
1
+ export { MediaFile, MediaFileProps } from './MediaFile';
@@ -1 +1 @@
1
- export { MediaFile, MediaFileFragment } from './MediaFile';
1
+ export { MediaFile } from './MediaFile';
@@ -15,7 +15,3 @@ export interface MetafieldProps<TTag> {
15
15
  * Metafield's `value`. For more information, refer to the [Default Output](#default-output) section.
16
16
  */
17
17
  export declare function Metafield<TTag extends ElementType>(props: Props<TTag> & MetafieldProps<TTag>): JSX.Element | null;
18
- export declare namespace Metafield {
19
- var Fragment: string;
20
- }
21
- export declare const MetafieldFragment = "\nfragment MetafieldFragment on Metafield {\n id\n type\n namespace\n key\n value\n createdAt\n updatedAt\n description\n reference @include(if: $includeReferenceMetafieldDetails) {\n __typename\n ... on MediaImage {\n id\n mediaContentType\n image {\n ...ImageFragment\n }\n }\n }\n}\nfragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n}\n";
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import { useShop } from '../../foundation';
3
3
  import { getMeasurementAsString } from '../../utilities';
4
4
  import { RawHtml } from '../RawHtml';
5
- import { MetafieldFragment as Fragment } from '../../graphql/graphql-constants';
6
5
  import { Image } from '../Image';
7
6
  /**
8
7
  * The `Metafield` component renders the value of a Storefront
@@ -61,5 +60,3 @@ export function Metafield(props) {
61
60
  }
62
61
  }
63
62
  }
64
- Metafield.Fragment = Fragment;
65
- export const MetafieldFragment = Fragment;
@@ -1,5 +1,8 @@
1
+ /**
2
+ * THIS FILE IS AUTO-GENERATED, DO NOT EDIT.
3
+ * Instead, you can edit the associated .graphql file to query for additional fields and this file will be updated when you run `yarn graphql-types`
4
+ */
1
5
  import * as Types from '../../graphql/types/types';
2
- import { ImageFragmentFragment } from '../Image/ImageFragment';
3
6
  export declare type MetafieldFragmentFragment = {
4
7
  __typename?: 'Metafield';
5
8
  } & Pick<Types.Metafield, 'id' | 'type' | 'namespace' | 'key' | 'value' | 'createdAt' | 'updatedAt' | 'description'> & {
@@ -8,7 +11,7 @@ export declare type MetafieldFragmentFragment = {
8
11
  } & Pick<Types.MediaImage, 'id' | 'mediaContentType'> & {
9
12
  image?: Types.Maybe<{
10
13
  __typename?: 'Image';
11
- } & ImageFragmentFragment>;
14
+ } & Pick<Types.Image, 'id' | 'url' | 'altText' | 'width' | 'height'>>;
12
15
  }) | {
13
16
  __typename: 'Page';
14
17
  } | {
@@ -1,5 +1,3 @@
1
- import { ElementType } from 'react';
2
- import { Props } from '../../../types';
3
1
  import { Rating } from '../../../../types';
4
2
  export declare const STAR_EMPTY = "\u2606";
5
3
  export declare const STAR_FILLED = "\u2605";
@@ -8,7 +6,7 @@ export interface StarRatingProps<TTag> {
8
6
  /** An HTML tag to be rendered as the base element wrapper. The default is `div`. */
9
7
  as?: TTag;
10
8
  }
11
- export declare function StarRating<TTag extends ElementType>(props: Props<TTag> & StarRatingProps<TTag>): JSX.Element;
9
+ export declare function StarRating<TTag extends keyof JSX.IntrinsicElements = 'div'>(props: JSX.IntrinsicElements[TTag] & StarRatingProps<TTag>): JSX.Element;
12
10
  export declare function Star({ percentFilled }: {
13
11
  percentFilled: number;
14
12
  }): JSX.Element;
@@ -1,3 +1,2 @@
1
- export { Metafield, MetafieldFragment } from './Metafield.client';
1
+ export { Metafield } from './Metafield.client';
2
2
  export type { MetafieldType } from './types';
3
- export type { MetafieldFragmentFragment } from './MetafieldFragment';
@@ -1 +1 @@
1
- export { Metafield, MetafieldFragment } from './Metafield.client';
1
+ export { Metafield } from './Metafield.client';
@@ -1,3 +1,7 @@
1
+ /**
2
+ * THIS FILE IS AUTO-GENERATED, DO NOT EDIT.
3
+ * Instead, you can edit the associated .graphql file to query for additional fields and this file will be updated when you run `yarn graphql-types`
4
+ */
1
5
  import * as Types from '../../graphql/types/types';
2
6
  export declare type Model3DFragmentFragment = {
3
7
  __typename?: 'Model3d';
@@ -1,16 +1,11 @@
1
1
  import { ReactNode, ElementType } from 'react';
2
- import { Model3d as Model3DType, Model3dSource, Image } from '../../graphql/types/types';
3
2
  import { Props } from '../types';
4
- export interface ModelViewerProps {
3
+ import type { Model3DFragmentFragment } from './Model3DFragment';
4
+ interface ModelViewerProps {
5
5
  /** Any ReactNode elements. */
6
6
  children?: ReactNode;
7
7
  /** An object with the same fields as the [GraphQL fragment](#graphql-fragment). */
8
- data: {
9
- id?: Model3DType['id'];
10
- alt: Model3DType['alt'];
11
- previewImage?: Pick<Image, 'url'>;
12
- sources: Pick<Model3dSource, 'url'>[];
13
- };
8
+ data: Model3DFragmentFragment;
14
9
  /** A string of either `auto`, `lazy`, or `eager` to indicate the conditions for preloading. Refer to [`loading` in the <model-viewer> documentation](https://modelviewer.dev/docs/index.html#entrydocs-loading-attributes-loading). */
15
10
  loading?: 'auto' | 'lazy' | 'eager';
16
11
  /** A url to display an image instead of the model, useful for showing the user something before a model is loaded and ready to render. If none is provided, [Model3d.previewImage](https://shopify.dev/api/storefront/reference/products/model3d#previewimage-2021-10) is used. Refer to [`poster` in the <model-viewer> documentation](https://modelviewer.dev/docs/index.html#entrydocs-loading-attributes-poster). */
@@ -129,8 +124,4 @@ declare global {
129
124
  * the Storefront API's [`Model3d` object](/api/storefront/reference/products/model3d).
130
125
  */
131
126
  export declare function ModelViewer<TTag extends ElementType>(props: Props<TTag, PropsWeControl> & ModelViewerProps): JSX.Element | null;
132
- export declare namespace ModelViewer {
133
- var Fragment: string;
134
- }
135
- export declare const Model3DFragment = "fragment Model3DFragment on Model3d {\n id\n alt\n mediaContentType\n previewImage {\n url\n }\n sources {\n url\n }\n}\n\n";
136
127
  export {};
@@ -1,6 +1,5 @@
1
1
  import React, { useState, useEffect, useCallback, } from 'react';
2
2
  import { useLoadScript } from '../../hooks/useLoadScript/useLoadScript';
3
- import { Model3DFragment as Fragment } from '../../graphql/graphql-constants';
4
3
  /**
5
4
  * The `ModelViewer` component renders a 3D model (with the `model-viewer` tag) for
6
5
  * the Storefront API's [`Model3d` object](/api/storefront/reference/products/model3d).
@@ -98,5 +97,3 @@ export function ModelViewer(props) {
98
97
  }
99
98
  return (React.createElement("model-viewer", { ref: callbackRef, ...passthroughProps, class: className, id: id, src: model.sources[0].url, alt: model.alt, "camera-controls": (_a = passthroughProps.cameraControls) !== null && _a !== void 0 ? _a : true, poster: passthroughProps.poster || ((_b = model.previewImage) === null || _b === void 0 ? void 0 : _b.url), autoplay: (_c = passthroughProps.autoplay) !== null && _c !== void 0 ? _c : true, loading: passthroughProps.loading, reveal: passthroughProps.reveal, ar: passthroughProps.ar, "ar-modes": passthroughProps.arModes, "ar-scale": passthroughProps.arScale, "ar-placement": passthroughProps.arPlacement, "ios-src": passthroughProps.iosSrc, "touch-action": passthroughProps.touchAction, "disable-zoom": passthroughProps.disableZoom, "orbit-sensitivity": passthroughProps.orbitSensitivity, "auto-rotate": passthroughProps.autoRotate, "auto-rotate-delay": passthroughProps.autoRotateDelay, "rotation-per-second": passthroughProps.rotationPerSecond, "interaction-policy": passthroughProps.interactionPolicy, "interaction-prompt": passthroughProps.interactionPrompt, "interaction-prompt-style": passthroughProps.interactionPromptStyle, "interaction-prompt-threshold": passthroughProps.interactionPromptThreshold, "camera-orbit": passthroughProps.cameraOrbit, "camera-target": passthroughProps.cameraTarget, "field-of-view": passthroughProps.fieldOfView, "max-camera-orbit": passthroughProps.maxCameraOrbit, "min-camera-orbit": passthroughProps.minCameraOrbit, "max-field-of-view": passthroughProps.maxFieldOfView, "min-field-of-view": passthroughProps.minFieldOfView, bounds: passthroughProps.bounds, "interpolation-decay": (_d = passthroughProps.interpolationDecay) !== null && _d !== void 0 ? _d : 100, "skybox-image": passthroughProps.skyboxImage, "environment-image": passthroughProps.environmentImage, exposure: passthroughProps.exposure, "shadow-intensity": (_e = passthroughProps.shadowIntensity) !== null && _e !== void 0 ? _e : 0, "shadow-softness": (_f = passthroughProps.shadowSoftness) !== null && _f !== void 0 ? _f : 0, "animation-name": passthroughProps.animationName, "animation-crossfade-duration": passthroughProps.animationCrossfadeDuration, "variant-name": passthroughProps.variantName, orientation: passthroughProps.orientation, scale: passthroughProps.scale }, children));
100
99
  }
101
- ModelViewer.Fragment = Fragment;
102
- export const Model3DFragment = Fragment;
@@ -1 +1 @@
1
- export { ModelViewer, ModelViewerProps } from './ModelViewer.client';
1
+ export { ModelViewer } from './ModelViewer.client';
@@ -1,19 +1,14 @@
1
- import { ElementType } from 'react';
2
- import { Props } from '../types';
3
- import { MoneyV2 } from '../../graphql/types/types';
4
- export interface MoneyProps<TTag> {
1
+ import type { MoneyFragmentFragment } from './MoneyFragment';
2
+ interface MoneyProps<TTag> {
5
3
  /** An HTML tag to be rendered as the base element wrapper. The default is `div`. */
6
4
  as?: TTag;
7
5
  /** A [`MoneyV2` object](/api/storefront/reference/common-objects/moneyv2). */
8
- data: MoneyV2;
6
+ data: MoneyFragmentFragment;
9
7
  }
10
8
  /**
11
9
  * The `Money` component renders a string of the Storefront API's
12
10
  * [`MoneyV2` object](/api/storefront/reference/common-objects/moneyv2) according to the
13
11
  * `defaultLocale` in the `shopify.config.js` file.
14
12
  */
15
- export declare function Money<TTag extends ElementType>(props: Props<TTag> & MoneyProps<TTag>): JSX.Element;
16
- export declare namespace Money {
17
- var Fragment: string;
18
- }
19
- export declare const MoneyFragment = "fragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n}\n";
13
+ export declare function Money<TTag extends keyof JSX.IntrinsicElements = 'div'>(props: JSX.IntrinsicElements[TTag] & MoneyProps<TTag>): JSX.Element;
14
+ export {};
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { useMoney } from '../../hooks';
3
- import { MoneyFragment as Fragment } from '../../graphql/graphql-constants';
4
3
  /**
5
4
  * The `Money` component renders a string of the Storefront API's
6
5
  * [`MoneyV2` object](/api/storefront/reference/common-objects/moneyv2) according to the
@@ -12,5 +11,3 @@ export function Money(props) {
12
11
  const Wrapper = as !== null && as !== void 0 ? as : 'div';
13
12
  return React.createElement(Wrapper, { ...passthroughProps }, moneyObject.localizedString);
14
13
  }
15
- Money.Fragment = Fragment;
16
- export const MoneyFragment = Fragment;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * THIS FILE IS AUTO-GENERATED, DO NOT EDIT.
3
+ * Instead, you can edit the associated .graphql file to query for additional fields and this file will be updated when you run `yarn graphql-types`
4
+ */
1
5
  import * as Types from '../../graphql/types/types';
2
6
  export declare type MoneyFragmentFragment = {
3
7
  __typename?: 'MoneyV2';
@@ -1 +1 @@
1
- export { Money, MoneyProps, MoneyFragment } from './Money.client';
1
+ export { Money } from './Money.client';
@@ -1 +1 @@
1
- export { Money, MoneyFragment } from './Money.client';
1
+ export { Money } from './Money.client';
@@ -1,8 +1,8 @@
1
- import { ElementType } from 'react';
2
- import { Props } from '../types';
1
+ import React from 'react';
2
+ import { RawHtml } from '../RawHtml';
3
3
  /**
4
4
  * The `ProductDescription` component renders a `RawHtml` component with
5
5
  * the product's [`descriptionHtml`](/api/storefront/reference/products/product).
6
6
  * It must be a descendent of the `ProductProvider` component.
7
7
  */
8
- export declare function ProductDescription<TTag extends ElementType = 'div'>(props: Props<TTag>): JSX.Element | null;
8
+ export declare function ProductDescription(props: Omit<React.ComponentProps<typeof RawHtml>, 'string'>): JSX.Element | null;
@@ -1,7 +1,7 @@
1
- import { ElementType } from 'react';
2
- import { MoneyProps } from '../Money';
3
- import { Props } from '../types';
4
- export interface ProductPriceProps<TTag> extends Omit<MoneyProps<TTag>, 'data'> {
1
+ import React from 'react';
2
+ import { Money } from '../Money';
3
+ import { UnitPrice } from '../UnitPrice';
4
+ export interface ProductPriceProps {
5
5
  /** The type of price. Valid values: `regular` (default) or `compareAt`. */
6
6
  priceType?: 'regular' | 'compareAt';
7
7
  /** The type of value. Valid values: `min` (default), `max` or `unit`. */
@@ -13,4 +13,4 @@ export interface ProductPriceProps<TTag> extends Omit<MoneyProps<TTag>, 'data'>
13
13
  * The `ProductPrice` component renders a `Money` component with the product
14
14
  * [`priceRange`](/api/storefront/reference/products/productpricerange)'s `maxVariantPrice` or `minVariantPrice`, for either the regular price or compare at price range. It must be a descendent of the `ProductProvider` component.
15
15
  */
16
- export declare function ProductPrice<TTag extends ElementType>(props: Props<TTag> & ProductPriceProps<TTag>): JSX.Element | null;
16
+ export declare function ProductPrice<TTag extends keyof JSX.IntrinsicElements>(props: (Omit<React.ComponentProps<typeof UnitPrice>, 'data' | 'measurement'> | Omit<React.ComponentProps<typeof Money>, 'data'>) & ProductPriceProps): JSX.Element | null;