@0xsequence/marketplace-sdk 0.3.6 → 0.3.7

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.
@@ -31,7 +31,7 @@ import {
31
31
  quantityInputWrapper,
32
32
  tokenPreview,
33
33
  transferModalContent
34
- } from "./chunk-RZSZNVEH.js";
34
+ } from "./chunk-L6GSYPCR.js";
35
35
  import {
36
36
  AlertMessage,
37
37
  switchChainModal_default,
@@ -48,7 +48,7 @@ import {
48
48
  useSwitchChainModal,
49
49
  useTransactionMachine,
50
50
  useTransferTokens
51
- } from "./chunk-Z3VR2KMP.js";
51
+ } from "./chunk-QGELCUYG.js";
52
52
  import {
53
53
  iconVariants
54
54
  } from "./chunk-SBVLWSRZ.js";
@@ -362,11 +362,11 @@ var ERC1155QuantityModal = observer2(
362
362
  maxQuantity: order.quantityRemaining
363
363
  }
364
364
  ),
365
- /* @__PURE__ */ jsxs3(Box3, { display: "flex", flexDirection: "column", gap: "2", children: [
365
+ /* @__PURE__ */ jsxs3(Box3, { display: "flex", justifyContent: "space-between", children: [
366
366
  /* @__PURE__ */ jsx3(Text2, { color: "text50", fontSize: "small", children: "Total Price" }),
367
367
  /* @__PURE__ */ jsxs3(Box3, { display: "flex", alignItems: "center", gap: "2", children: [
368
368
  /* @__PURE__ */ jsx3(TokenImage, { src: currency?.imageUrl, size: "xs" }),
369
- /* @__PURE__ */ jsx3(Text2, { color: "text", fontSize: "large", fontWeight: "bold", children: formatUnits(BigInt(totalPrice), currency?.decimals || 0) })
369
+ /* @__PURE__ */ jsx3(Text2, { color: "text100", fontSize: "small", fontWeight: "bold", children: formatUnits(BigInt(totalPrice), currency?.decimals || 0) })
370
370
  ] })
371
371
  ] })
372
372
  ] })
@@ -437,7 +437,7 @@ var LoadingModal = ({ store, onClose, title }) => /* @__PURE__ */ jsx5(ActionMod
437
437
 
438
438
  // src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx
439
439
  import { useState as useState2 } from "react";
440
- import { Box as Box6, Text as Text3 } from "@0xsequence/design-system";
440
+ import { Box as Box6, Skeleton, Text as Text3 } from "@0xsequence/design-system";
441
441
  import { observer as observer3 } from "@legendapp/state/react";
442
442
  import { addDays, isSameDay } from "date-fns";
443
443
 
@@ -462,13 +462,13 @@ var CustomSelectItem = React.forwardRef(({ children, ...props }, forwardedRef) =
462
462
  });
463
463
  var CustomSelect = ({
464
464
  items,
465
- placeholder = "Select an item...",
465
+ value,
466
466
  onValueChange,
467
467
  defaultValue
468
468
  }) => {
469
469
  return /* @__PURE__ */ jsxs4(Select.Root, { onValueChange, defaultValue, children: [
470
- /* @__PURE__ */ jsxs4(Select.Trigger, { className: trigger, children: [
471
- /* @__PURE__ */ jsx6(Select.Value, { placeholder }),
470
+ /* @__PURE__ */ jsxs4(Select.Trigger, { className: trigger, value, children: [
471
+ /* @__PURE__ */ jsx6(Select.Value, {}),
472
472
  /* @__PURE__ */ jsx6(Select.Icon, { children: /* @__PURE__ */ jsx6(ChevronDownIcon, { size: "xs" }) })
473
473
  ] }),
474
474
  /* @__PURE__ */ jsx6(Select.Portal, { children: /* @__PURE__ */ jsx6(Select.Content, { className: content, children: /* @__PURE__ */ jsx6(Select.Viewport, { children: items.map((item2, index) => /* @__PURE__ */ jsx6(
@@ -602,11 +602,12 @@ var ExpirationDateSelect = observer3(function ExpirationDateSelect2({
602
602
  className,
603
603
  $date
604
604
  }) {
605
- const [_, setRange] = useState2("1_week");
606
- function handleSelectPresetRange(range) {
607
- setRange(range);
605
+ const defaultRange = "1_week";
606
+ const [range, setRange] = useState2(defaultRange);
607
+ function handleSelectPresetRange(range2) {
608
+ setRange(range2);
608
609
  const presetRange = Object.values(PRESET_RANGES).find(
609
- (preset) => preset.value === range
610
+ (preset) => preset.value === range2
610
611
  );
611
612
  if (!presetRange) {
612
613
  return;
@@ -623,6 +624,9 @@ var ExpirationDateSelect = observer3(function ExpirationDateSelect2({
623
624
  }
624
625
  $date.set(date);
625
626
  }
627
+ if (!$date.get()) {
628
+ return /* @__PURE__ */ jsx9(Skeleton, { borderRadius: "lg", width: "20", height: "7", marginRight: "3" });
629
+ }
626
630
  return /* @__PURE__ */ jsxs6(Box6, { width: "full", position: "relative", children: [
627
631
  /* @__PURE__ */ jsx9(
628
632
  Text3,
@@ -660,19 +664,9 @@ var ExpirationDateSelect = observer3(function ExpirationDateSelect2({
660
664
  label: preset.label,
661
665
  value: preset.value
662
666
  })),
663
- placeholder: Object.values(PRESET_RANGES).find(
664
- (preset) => isSameDay(
665
- new Date($date.get()),
666
- addDays(/* @__PURE__ */ new Date(), preset.offset)
667
- )
668
- )?.label,
669
- onValueChange: (value) => handleSelectPresetRange(value),
670
- defaultValue: Object.values(PRESET_RANGES).find(
671
- (preset) => isSameDay(
672
- new Date($date.get()),
673
- addDays(/* @__PURE__ */ new Date(), preset.offset)
674
- )
675
- )?.value
667
+ value: range,
668
+ defaultValue: defaultRange,
669
+ onValueChange: (value) => handleSelectPresetRange(value)
676
670
  }
677
671
  )
678
672
  }
@@ -740,40 +734,49 @@ import { erc20Abi, parseUnits as parseUnits2 } from "viem";
740
734
  import { useAccount as useAccount2, useReadContract } from "wagmi";
741
735
 
742
736
  // src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx
743
- import { Skeleton } from "@0xsequence/design-system";
737
+ import { Skeleton as Skeleton2 } from "@0xsequence/design-system";
744
738
  import { observer as observer4 } from "@legendapp/state/react";
745
739
  import { useEffect as useEffect2 } from "react";
746
740
  import { jsx as jsx11 } from "react/jsx-runtime";
747
741
  var CurrencyOptionsSelect = observer4(function CurrencyOptionsSelect2({
748
742
  chainId,
749
743
  collectionAddress,
750
- $selectedCurrency
744
+ selectedCurrency$
751
745
  }) {
746
+ const currency = selectedCurrency$.get();
752
747
  const { data: currencies, isLoading: currenciesLoading } = useCurrencies({
753
748
  collectionAddress,
754
749
  chainId
755
750
  });
756
751
  useEffect2(() => {
757
- if (currencies && currencies.length > 0 && !$selectedCurrency.contractAddress.get()) {
758
- $selectedCurrency.set(currencies[0]);
752
+ if (currencies && currencies.length > 0 && !selectedCurrency$.contractAddress.get()) {
753
+ selectedCurrency$.set(currencies[0]);
759
754
  }
760
755
  }, [currencies]);
761
- if (!currencies || currenciesLoading) {
762
- return /* @__PURE__ */ jsx11(Skeleton, { borderRadius: "lg", width: "20", height: "7", marginRight: "3" });
756
+ if (!currencies || currenciesLoading || !currency.symbol) {
757
+ return /* @__PURE__ */ jsx11(Skeleton2, { borderRadius: "lg", width: "20", height: "7", marginRight: "3" });
763
758
  }
764
759
  const options = currencies.map(
765
- (currency) => ({
766
- label: currency.symbol,
767
- value: currency.contractAddress
760
+ (currency2) => ({
761
+ label: currency2.symbol,
762
+ value: currency2.contractAddress
768
763
  })
769
764
  );
770
765
  const onChange = (value) => {
771
766
  const c = currencies.find(
772
- (currency) => currency.contractAddress === value
767
+ (currency2) => currency2.contractAddress === value
773
768
  );
774
- $selectedCurrency.set(c);
769
+ selectedCurrency$.set(c);
775
770
  };
776
- return /* @__PURE__ */ jsx11(CustomSelect, { items: options, onValueChange: onChange, placeholder: "" });
771
+ console.log("currency", currency);
772
+ return /* @__PURE__ */ jsx11(
773
+ CustomSelect,
774
+ {
775
+ items: options,
776
+ value: currency.symbol,
777
+ onValueChange: onChange
778
+ }
779
+ );
777
780
  });
778
781
  var currencyOptionsSelect_default = CurrencyOptionsSelect;
779
782
 
@@ -837,7 +840,7 @@ var PriceInput = observer5(function PriceInput2({
837
840
  controls: /* @__PURE__ */ jsx12(
838
841
  currencyOptionsSelect_default,
839
842
  {
840
- $selectedCurrency: $listingPrice?.currency,
843
+ selectedCurrency$: $listingPrice?.currency,
841
844
  collectionAddress,
842
845
  chainId
843
846
  }
@@ -853,7 +856,7 @@ var PriceInput = observer5(function PriceInput2({
853
856
  var priceInput_default = PriceInput;
854
857
 
855
858
  // src/react/ui/modals/_internal/components/tokenPreview/index.tsx
856
- import { Box as Box8, Image, Skeleton as Skeleton2, Text as Text5 } from "@0xsequence/design-system";
859
+ import { Box as Box8, Image, Skeleton as Skeleton3, Text as Text5 } from "@0xsequence/design-system";
857
860
 
858
861
  // src/react/ui/images/chess-tile.png
859
862
  var chess_tile_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK8AAACuCAYAAABAzl3QAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAInSURBVHgB7dyxbUMxEAXBs6FEjagv91/AD+keeNFCMw1csmBEvJ/P53Nm4Xme2Xi/37Ph/nfeP+f8/Q5EiZcs8ZIlXrLES5Z4yRIvWeIlS7xkiZcs8ZIlXrLES5Z4yRIvWS//Ud2v3vfykiVessRLlnjJEi9Z4iVLvGSJlyzxkiVessRLlnjJEi9Z4iVLvGS9/Ed1v3j/nOPlpUu8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPGSJV6yxEuWeMmyz+v+bNjnhQviJUu8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPGSJV6yxEuWfV73Z8M+L1wQL1niJUu8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPGSJV6y7PO6Pxv2eeGCeMkSL1niJUu8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPGSZZ/X/dmwzwsXxEuWeMkSL1niJUu8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPu87s+GfV64IF6yxEuWeMkSL1niJUu8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZNnndX827PPCBfGSJV6yxEuWeMkSL1niJUu8ZImXLPGSJV6yxEuWeMkSL1niJcs+r/uzYZ8XLoiXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPGSJV6yxEuWeMkSL1n2ed2fDfu8cEG8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPGSJV6y/gF97MkwfJRH7QAAAABJRU5ErkJggg==";
@@ -873,10 +876,10 @@ function TokenPreview({
873
876
  });
874
877
  if (collectibleLoading) {
875
878
  return /* @__PURE__ */ jsxs8(Box8, { display: "flex", alignItems: "center", gap: "3", width: "full", children: [
876
- /* @__PURE__ */ jsx13(Skeleton2, { width: "9", height: "9", borderRadius: "xs" }),
879
+ /* @__PURE__ */ jsx13(Skeleton3, { width: "9", height: "9", borderRadius: "xs" }),
877
880
  /* @__PURE__ */ jsxs8(Box8, { display: "flex", flexGrow: "1", gap: "1", flexDirection: "column", children: [
878
- /* @__PURE__ */ jsx13(Skeleton2, { width: "1/3", height: "3" }),
879
- /* @__PURE__ */ jsx13(Skeleton2, { width: "1/2", height: "3" })
881
+ /* @__PURE__ */ jsx13(Skeleton3, { width: "1/3", height: "3" }),
882
+ /* @__PURE__ */ jsx13(Skeleton3, { width: "1/2", height: "3" })
880
883
  ] })
881
884
  ] });
882
885
  }
@@ -917,7 +920,7 @@ function TokenPreview({
917
920
  }
918
921
 
919
922
  // src/react/ui/modals/_internal/components/transactionDetails/index.tsx
920
- import { Box as Box9, Image as Image2, Skeleton as Skeleton3, Text as Text6 } from "@0xsequence/design-system";
923
+ import { Box as Box9, Image as Image2, Skeleton as Skeleton4, Text as Text6 } from "@0xsequence/design-system";
921
924
  import { formatUnits as formatUnits2 } from "viem";
922
925
  import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
923
926
  var DEFAULT_MARKETPLACE_FEE_PERCENTAGE = 2.5;
@@ -956,7 +959,7 @@ function TransactionDetails({
956
959
  /* @__PURE__ */ jsx14(Text6, { fontSize: "small", color: "text50", fontFamily: "body", children: "Total earnings" }),
957
960
  /* @__PURE__ */ jsxs9(Box9, { display: "flex", alignItems: "center", gap: "2", children: [
958
961
  /* @__PURE__ */ jsx14(Image2, { src: currencyImageUrl, width: "3", height: "3" }),
959
- priceLoading ? /* @__PURE__ */ jsx14(Skeleton3, { width: "16", height: "4" }) : /* @__PURE__ */ jsxs9(Text6, { fontSize: "small", color: "text100", fontFamily: "body", children: [
962
+ priceLoading ? /* @__PURE__ */ jsx14(Skeleton4, { width: "16", height: "4" }) : /* @__PURE__ */ jsxs9(Text6, { fontSize: "small", color: "text100", fontFamily: "body", children: [
960
963
  formattedAmount,
961
964
  " ",
962
965
  price.currency.symbol
@@ -971,7 +974,7 @@ function TransactionDetails({
971
974
  import {
972
975
  CloseIcon,
973
976
  IconButton as IconButton2,
974
- Skeleton as Skeleton5,
977
+ Skeleton as Skeleton6,
975
978
  Text as Text10
976
979
  } from "@0xsequence/design-system";
977
980
  import { observer as observer7 } from "@legendapp/state/react";
@@ -1039,7 +1042,7 @@ import {
1039
1042
  Box as Box12,
1040
1043
  Image as Image3,
1041
1044
  NetworkImage,
1042
- Skeleton as Skeleton4,
1045
+ Skeleton as Skeleton5,
1043
1046
  Text as Text9
1044
1047
  } from "@0xsequence/design-system";
1045
1048
  import { observer as observer6 } from "@legendapp/state/react";
@@ -1202,7 +1205,7 @@ var TransactionPreview = observer6(
1202
1205
  const collectionName = collection?.name;
1203
1206
  const priceFormatted = price ? formatUnits3(BigInt(price.amountRaw), price.currency.decimals) : void 0;
1204
1207
  if (collectibleLoading || collectionLoading) {
1205
- return /* @__PURE__ */ jsx17(Box12, { style: { height: 83 }, width: "full", borderRadius: "md", children: /* @__PURE__ */ jsx17(Skeleton4, { style: { width: "100%", height: "100%" } }) });
1208
+ return /* @__PURE__ */ jsx17(Box12, { style: { height: 83 }, width: "full", borderRadius: "md", children: /* @__PURE__ */ jsx17(Skeleton5, { style: { width: "100%", height: "100%" } }) });
1206
1209
  }
1207
1210
  return /* @__PURE__ */ jsxs11(Box12, { padding: "3", background: "backgroundSecondary", borderRadius: "md", children: [
1208
1211
  /* @__PURE__ */ jsxs11(Box12, { display: "flex", alignItems: "center", children: [
@@ -1435,8 +1438,8 @@ var TransactionStatusModal = observer7(() => {
1435
1438
  fontFamily: "body",
1436
1439
  children: title
1437
1440
  }
1438
- ) : /* @__PURE__ */ jsx18(Skeleton5, { width: "16", height: "6" }),
1439
- message ? /* @__PURE__ */ jsx18(Text10, { fontSize: "small", color: "text80", fontFamily: "body", children: message }) : /* @__PURE__ */ jsx18(Skeleton5, { width: "20", height: "4" }),
1441
+ ) : /* @__PURE__ */ jsx18(Skeleton6, { width: "16", height: "6" }),
1442
+ message ? /* @__PURE__ */ jsx18(Text10, { fontSize: "small", color: "text80", fontFamily: "body", children: message }) : /* @__PURE__ */ jsx18(Skeleton6, { width: "20", height: "4" }),
1440
1443
  /* @__PURE__ */ jsx18(
1441
1444
  transactionPreview_default,
1442
1445
  {
@@ -2017,7 +2020,7 @@ var useSell = ({
2017
2020
  };
2018
2021
 
2019
2022
  // src/react/ui/modals/_internal/components/transactionHeader/index.tsx
2020
- import { Box as Box14, Image as Image4, Skeleton as Skeleton6, Text as Text11 } from "@0xsequence/design-system";
2023
+ import { Box as Box14, Image as Image4, Skeleton as Skeleton7, Text as Text11 } from "@0xsequence/design-system";
2021
2024
  import { formatDistanceToNow as formatDistanceToNow2 } from "date-fns";
2022
2025
  import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
2023
2026
  function TransactionHeader({
@@ -2051,7 +2054,7 @@ function TransactionHeader({
2051
2054
  " ago"
2052
2055
  ]
2053
2056
  }
2054
- ) || /* @__PURE__ */ jsx21(Skeleton6, { width: "8", height: "4" })
2057
+ ) || /* @__PURE__ */ jsx21(Skeleton7, { width: "8", height: "4" })
2055
2058
  ] });
2056
2059
  }
2057
2060
 
@@ -2761,7 +2764,7 @@ var ModalProvider = observer14(() => {
2761
2764
 
2762
2765
  // src/react/ui/components/collectible-card/CollectibleCard.tsx
2763
2766
  import { useState as useState9 } from "react";
2764
- import { Box as Box21, IconButton as IconButton6, Skeleton as Skeleton7 } from "@0xsequence/design-system";
2767
+ import { Box as Box21, IconButton as IconButton6, Skeleton as Skeleton8 } from "@0xsequence/design-system";
2765
2768
  import { useAccount as useAccount7 } from "wagmi";
2766
2769
 
2767
2770
  // src/react/ui/icons/DiamondEye.tsx
@@ -3075,7 +3078,7 @@ function CollectibleSkeleton() {
3075
3078
  background: "backgroundPrimary",
3076
3079
  children: [
3077
3080
  /* @__PURE__ */ jsx32(
3078
- Skeleton7,
3081
+ Skeleton8,
3079
3082
  {
3080
3083
  size: "lg",
3081
3084
  style: { width: "100%", height: 164, borderRadius: 0, paddingTop: 16 }
@@ -3091,8 +3094,8 @@ function CollectibleSkeleton() {
3091
3094
  paddingBottom: "4",
3092
3095
  marginTop: "2",
3093
3096
  children: [
3094
- /* @__PURE__ */ jsx32(Skeleton7, { size: "lg" }),
3095
- /* @__PURE__ */ jsx32(Skeleton7, { size: "sm" })
3097
+ /* @__PURE__ */ jsx32(Skeleton8, { size: "lg" }),
3098
+ /* @__PURE__ */ jsx32(Skeleton8, { size: "sm" })
3096
3099
  ]
3097
3100
  }
3098
3101
  )
@@ -3232,4 +3235,4 @@ export {
3232
3235
  ModalProvider,
3233
3236
  CollectibleCard
3234
3237
  };
3235
- //# sourceMappingURL=chunk-F42XMKDS.js.map
3238
+ //# sourceMappingURL=chunk-3LGNSRBR.js.map