@bosonprotocol/react-kit 0.33.0-alpha.1 → 0.33.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/image/Image.js +2 -2
- package/dist/cjs/components/image/Image.js.map +1 -1
- package/dist/cjs/components/image/Image.styles.d.ts +2 -1
- package/dist/cjs/components/image/Image.styles.d.ts.map +1 -1
- package/dist/cjs/components/image/Image.styles.js +2 -2
- package/dist/cjs/components/image/Image.styles.js.map +1 -1
- package/dist/cjs/components/modal/components/Commit/DetailView/InnerCommitDetailView.js +3 -3
- package/dist/cjs/components/modal/components/Commit/DetailView/InnerCommitDetailView.js.map +1 -1
- package/dist/cjs/components/modal/components/Redeem/ExchangeView/RedeemSuccess.js +3 -3
- package/dist/cjs/components/modal/components/Redeem/ExchangeView/RedeemSuccess.js.map +1 -1
- package/dist/cjs/components/modal/components/common/OfferFullDescription/DigitalProductData.js +2 -2
- package/dist/cjs/components/modal/components/common/OfferFullDescription/DigitalProductData.js.map +1 -1
- package/dist/cjs/components/modal/components/common/detail/DetailSlider.js +2 -2
- package/dist/cjs/components/modal/components/common/detail/DetailSlider.js.map +1 -1
- package/dist/cjs/components/modal/components/common/detail/PhygitalProduct.js +2 -2
- package/dist/cjs/components/modal/components/common/detail/PhygitalProduct.js.map +1 -1
- package/dist/cjs/components/modal/components/common/detail/SlickSlider.js +2 -2
- package/dist/cjs/components/modal/components/common/detail/SlickSlider.js.map +1 -1
- package/dist/cjs/components/ui/CardCTA.d.ts +21 -0
- package/dist/cjs/components/ui/CardCTA.d.ts.map +1 -0
- package/dist/cjs/components/ui/CardCTA.js +77 -0
- package/dist/cjs/components/ui/CardCTA.js.map +1 -0
- package/dist/cjs/components/ui/Grid.d.ts.map +1 -1
- package/dist/cjs/components/ui/Grid.js +22 -21
- package/dist/cjs/components/ui/Grid.js.map +1 -1
- package/dist/cjs/components/ui/IpfsImage.d.ts +2 -2
- package/dist/cjs/components/ui/IpfsImage.d.ts.map +1 -1
- package/dist/cjs/components/ui/IpfsImage.js +2 -1
- package/dist/cjs/components/ui/IpfsImage.js.map +1 -1
- package/dist/cjs/components/ui/Typography.d.ts.map +1 -1
- package/dist/cjs/components/ui/Typography.js +29 -28
- package/dist/cjs/components/ui/Typography.js.map +1 -1
- package/dist/cjs/components/ui/Video.d.ts.map +1 -1
- package/dist/cjs/components/ui/Video.js +22 -12
- package/dist/cjs/components/ui/Video.js.map +1 -1
- package/dist/cjs/components/ui/common.d.ts +2 -0
- package/dist/cjs/components/ui/common.d.ts.map +1 -0
- package/dist/cjs/components/ui/common.js +6 -0
- package/dist/cjs/components/ui/common.js.map +1 -0
- package/dist/cjs/components/wallet/ConnectButton.js +2 -2
- package/dist/cjs/components/wallet/ConnectButton.js.map +1 -1
- package/dist/cjs/components/widgets/finance/convertion-rate/ConvertionRateContext.js +2 -2
- package/dist/cjs/components/widgets/finance/convertion-rate/ConvertionRateContext.js.map +1 -1
- package/dist/cjs/components/widgets/finance/convertion-rate/ConvertionRateProvider.js +2 -2
- package/dist/cjs/components/widgets/finance/convertion-rate/ConvertionRateProvider.js.map +1 -1
- package/dist/cjs/components/widgets/finance/useOffersBacked.js +1 -1
- package/dist/cjs/components/widgets/finance/useOffersBacked.js.map +1 -1
- package/dist/cjs/hooks/connection/connection.d.ts +2 -2
- package/dist/cjs/hooks/connection/connection.d.ts.map +1 -1
- package/dist/cjs/hooks/connection/connection.js +15 -6
- package/dist/cjs/hooks/connection/connection.js.map +1 -1
- package/dist/cjs/hooks/core-sdk/useCoreSdk.d.ts.map +1 -1
- package/dist/cjs/hooks/core-sdk/useCoreSdk.js +2 -2
- package/dist/cjs/hooks/core-sdk/useCoreSdk.js.map +1 -1
- package/dist/cjs/hooks/form/useForm.d.ts +55 -0
- package/dist/cjs/hooks/form/useForm.d.ts.map +1 -0
- package/dist/cjs/hooks/form/useForm.js +11 -0
- package/dist/cjs/hooks/form/useForm.js.map +1 -0
- package/dist/cjs/hooks/index.d.ts +6 -0
- package/dist/cjs/hooks/index.d.ts.map +1 -1
- package/dist/cjs/hooks/index.js +8 -1
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/ipfs/useIpfsStorage.d.ts +2 -0
- package/dist/cjs/hooks/ipfs/useIpfsStorage.d.ts.map +1 -0
- package/dist/cjs/hooks/ipfs/useIpfsStorage.js +14 -0
- package/dist/cjs/hooks/ipfs/useIpfsStorage.js.map +1 -0
- package/dist/cjs/hooks/location/buildUseSearchParams.d.ts +12 -0
- package/dist/cjs/hooks/location/buildUseSearchParams.d.ts.map +1 -0
- package/dist/cjs/hooks/location/buildUseSearchParams.js +36 -0
- package/dist/cjs/hooks/location/buildUseSearchParams.js.map +1 -0
- package/dist/cjs/{components/widgets/finance/storage/useLocalStorage.d.ts → hooks/storage/useBosonLocalStorage.d.ts} +3 -3
- package/dist/cjs/hooks/storage/useBosonLocalStorage.d.ts.map +1 -0
- package/dist/cjs/hooks/storage/useBosonLocalStorage.js +22 -0
- package/dist/cjs/hooks/storage/useBosonLocalStorage.js.map +1 -0
- package/dist/cjs/hooks/storage/useLocalStorage.d.ts +6 -0
- package/dist/cjs/hooks/storage/useLocalStorage.d.ts.map +1 -0
- package/dist/cjs/hooks/storage/useLocalStorage.js.map +1 -0
- package/dist/cjs/hooks/useIpfsMetadataStorage.d.ts.map +1 -1
- package/dist/cjs/hooks/useIpfsMetadataStorage.js +1 -1
- package/dist/cjs/hooks/useIpfsMetadataStorage.js.map +1 -1
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/url/url.d.ts +1 -0
- package/dist/cjs/lib/url/url.d.ts.map +1 -1
- package/dist/cjs/lib/url/url.js +2 -1
- package/dist/cjs/lib/url/url.js.map +1 -1
- package/dist/cjs/types/helpers.d.ts +3 -0
- package/dist/cjs/types/helpers.d.ts.map +1 -1
- package/dist/cjs/types/helpers.js.map +1 -1
- package/dist/esm/components/image/Image.js +2 -2
- package/dist/esm/components/image/Image.js.map +1 -1
- package/dist/esm/components/image/Image.styles.d.ts +2 -1
- package/dist/esm/components/image/Image.styles.d.ts.map +1 -1
- package/dist/esm/components/image/Image.styles.js +2 -2
- package/dist/esm/components/image/Image.styles.js.map +1 -1
- package/dist/esm/components/modal/components/Commit/DetailView/InnerCommitDetailView.js +1 -1
- package/dist/esm/components/modal/components/Commit/DetailView/InnerCommitDetailView.js.map +1 -1
- package/dist/esm/components/modal/components/Redeem/ExchangeView/RedeemSuccess.js +1 -1
- package/dist/esm/components/modal/components/Redeem/ExchangeView/RedeemSuccess.js.map +1 -1
- package/dist/esm/components/modal/components/common/OfferFullDescription/DigitalProductData.js +1 -1
- package/dist/esm/components/modal/components/common/OfferFullDescription/DigitalProductData.js.map +1 -1
- package/dist/esm/components/modal/components/common/detail/DetailSlider.js +1 -1
- package/dist/esm/components/modal/components/common/detail/DetailSlider.js.map +1 -1
- package/dist/esm/components/modal/components/common/detail/PhygitalProduct.js +1 -1
- package/dist/esm/components/modal/components/common/detail/PhygitalProduct.js.map +1 -1
- package/dist/esm/components/modal/components/common/detail/SlickSlider.js +1 -1
- package/dist/esm/components/modal/components/common/detail/SlickSlider.js.map +1 -1
- package/dist/esm/components/ui/CardCTA.d.ts +21 -0
- package/dist/esm/components/ui/CardCTA.d.ts.map +1 -0
- package/dist/esm/components/ui/CardCTA.js +35 -0
- package/dist/esm/components/ui/CardCTA.js.map +1 -0
- package/dist/esm/components/ui/Grid.d.ts.map +1 -1
- package/dist/esm/components/ui/Grid.js +22 -21
- package/dist/esm/components/ui/Grid.js.map +1 -1
- package/dist/esm/components/ui/IpfsImage.d.ts +2 -2
- package/dist/esm/components/ui/IpfsImage.d.ts.map +1 -1
- package/dist/esm/components/ui/IpfsImage.js +1 -2
- package/dist/esm/components/ui/IpfsImage.js.map +1 -1
- package/dist/esm/components/ui/Typography.d.ts.map +1 -1
- package/dist/esm/components/ui/Typography.js +29 -28
- package/dist/esm/components/ui/Typography.js.map +1 -1
- package/dist/esm/components/ui/Video.d.ts.map +1 -1
- package/dist/esm/components/ui/Video.js +22 -12
- package/dist/esm/components/ui/Video.js.map +1 -1
- package/dist/esm/components/ui/common.d.ts +2 -0
- package/dist/esm/components/ui/common.d.ts.map +1 -0
- package/dist/esm/components/ui/common.js +2 -0
- package/dist/esm/components/ui/common.js.map +1 -0
- package/dist/esm/components/wallet/ConnectButton.js +1 -1
- package/dist/esm/components/wallet/ConnectButton.js.map +1 -1
- package/dist/esm/components/widgets/finance/convertion-rate/ConvertionRateContext.js +1 -1
- package/dist/esm/components/widgets/finance/convertion-rate/ConvertionRateContext.js.map +1 -1
- package/dist/esm/components/widgets/finance/convertion-rate/ConvertionRateProvider.js +1 -1
- package/dist/esm/components/widgets/finance/convertion-rate/ConvertionRateProvider.js.map +1 -1
- package/dist/esm/components/widgets/finance/useOffersBacked.js +1 -1
- package/dist/esm/components/widgets/finance/useOffersBacked.js.map +1 -1
- package/dist/esm/hooks/connection/connection.d.ts +2 -2
- package/dist/esm/hooks/connection/connection.d.ts.map +1 -1
- package/dist/esm/hooks/connection/connection.js +14 -6
- package/dist/esm/hooks/connection/connection.js.map +1 -1
- package/dist/esm/hooks/core-sdk/useCoreSdk.d.ts.map +1 -1
- package/dist/esm/hooks/core-sdk/useCoreSdk.js +3 -3
- package/dist/esm/hooks/core-sdk/useCoreSdk.js.map +1 -1
- package/dist/esm/hooks/form/useForm.d.ts +55 -0
- package/dist/esm/hooks/form/useForm.d.ts.map +1 -0
- package/dist/esm/hooks/form/useForm.js +10 -0
- package/dist/esm/hooks/form/useForm.js.map +1 -0
- package/dist/esm/hooks/index.d.ts +6 -0
- package/dist/esm/hooks/index.d.ts.map +1 -1
- package/dist/esm/hooks/index.js +6 -0
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/hooks/ipfs/useIpfsStorage.d.ts +2 -0
- package/dist/esm/hooks/ipfs/useIpfsStorage.d.ts.map +1 -0
- package/dist/esm/hooks/ipfs/useIpfsStorage.js +10 -0
- package/dist/esm/hooks/ipfs/useIpfsStorage.js.map +1 -0
- package/dist/esm/hooks/location/buildUseSearchParams.d.ts +12 -0
- package/dist/esm/hooks/location/buildUseSearchParams.d.ts.map +1 -0
- package/dist/esm/hooks/location/buildUseSearchParams.js +32 -0
- package/dist/esm/hooks/location/buildUseSearchParams.js.map +1 -0
- package/dist/esm/{components/widgets/finance/storage/useLocalStorage.d.ts → hooks/storage/useBosonLocalStorage.d.ts} +3 -3
- package/dist/esm/hooks/storage/useBosonLocalStorage.d.ts.map +1 -0
- package/dist/esm/hooks/storage/useBosonLocalStorage.js +15 -0
- package/dist/esm/hooks/storage/useBosonLocalStorage.js.map +1 -0
- package/dist/esm/hooks/storage/useLocalStorage.d.ts +6 -0
- package/dist/esm/hooks/storage/useLocalStorage.d.ts.map +1 -0
- package/dist/esm/hooks/storage/useLocalStorage.js.map +1 -0
- package/dist/esm/hooks/useIpfsMetadataStorage.d.ts.map +1 -1
- package/dist/esm/hooks/useIpfsMetadataStorage.js +2 -2
- package/dist/esm/hooks/useIpfsMetadataStorage.js.map +1 -1
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/url/url.d.ts +1 -0
- package/dist/esm/lib/url/url.d.ts.map +1 -1
- package/dist/esm/lib/url/url.js +1 -0
- package/dist/esm/lib/url/url.js.map +1 -1
- package/dist/esm/types/helpers.d.ts +3 -0
- package/dist/esm/types/helpers.d.ts.map +1 -1
- package/dist/esm/types/helpers.js.map +1 -1
- package/package.json +5 -5
- package/src/components/image/Image.styles.ts +7 -5
- package/src/components/image/Image.tsx +2 -2
- package/src/components/modal/components/Commit/DetailView/InnerCommitDetailView.tsx +1 -1
- package/src/components/modal/components/Redeem/ExchangeView/RedeemSuccess.tsx +1 -1
- package/src/components/modal/components/common/OfferFullDescription/DigitalProductData.tsx +1 -1
- package/src/components/modal/components/common/detail/DetailSlider.tsx +1 -1
- package/src/components/modal/components/common/detail/PhygitalProduct.tsx +1 -1
- package/src/components/modal/components/common/detail/SlickSlider.tsx +1 -1
- package/src/components/ui/CardCTA.tsx +77 -0
- package/src/components/ui/Grid.tsx +33 -21
- package/src/components/ui/IpfsImage.tsx +3 -3
- package/src/components/ui/Typography.tsx +39 -29
- package/src/components/ui/Video.tsx +28 -14
- package/src/components/ui/common.ts +2 -0
- package/src/components/wallet/ConnectButton.tsx +1 -1
- package/src/components/widgets/finance/convertion-rate/ConvertionRateContext.tsx +1 -1
- package/src/components/widgets/finance/convertion-rate/ConvertionRateProvider.tsx +1 -1
- package/src/components/widgets/finance/useOffersBacked.ts +1 -1
- package/src/hooks/connection/connection.ts +18 -8
- package/src/hooks/core-sdk/useCoreSdk.tsx +4 -3
- package/src/hooks/form/useForm.ts +12 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/ipfs/useIpfsStorage.ts +16 -0
- package/src/hooks/location/buildUseSearchParams.tsx +45 -0
- package/src/hooks/storage/useBosonLocalStorage.ts +40 -0
- package/src/{components/widgets/finance → hooks}/storage/useLocalStorage.ts +5 -17
- package/src/hooks/useIpfsMetadataStorage.tsx +6 -2
- package/src/index.tsx +4 -0
- package/src/lib/url/url.ts +3 -0
- package/src/types/helpers.ts +4 -0
- package/dist/cjs/components/widgets/finance/storage/useLocalStorage.d.ts.map +0 -1
- package/dist/cjs/components/widgets/finance/storage/useLocalStorage.js.map +0 -1
- package/dist/esm/components/widgets/finance/storage/useLocalStorage.d.ts.map +0 -1
- package/dist/esm/components/widgets/finance/storage/useLocalStorage.js.map +0 -1
- /package/dist/cjs/{components/widgets/finance → hooks}/storage/useLocalStorage.js +0 -0
- /package/dist/esm/{components/widgets/finance → hooks}/storage/useLocalStorage.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIpfsMetadataStorage.js","sourceRoot":"","sources":["../../../src/hooks/useIpfsMetadataStorage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"useIpfsMetadataStorage.js","sourceRoot":"","sources":["../../../src/hooks/useIpfsMetadataStorage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EACL,gBAAgB,EAEhB,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGlE;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CACpC,OAAwB,EACxB,QAAkB,EAClB,GAAY,EACZ,OAA0C;IAE1C,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GACjD,QAAQ,CACN,uBAAuB,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,CAAC,CACzD,CAAC;IAEJ,SAAS,CAAC,GAAG,EAAE;QACb,sBAAsB,CACpB,uBAAuB,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,CAAC,CACzD,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;IAEtC,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAED,SAAS,uBAAuB,CAC9B,OAAwB,EACxB,QAAkB,EAClB,GAAY,EACZ,OAA0C;IAE1C,OAAO,IAAI,mBAAmB,CAAC,gBAAgB,EAAE;QAC/C,GAAG,EAAE,GAAG,IAAI,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,eAAe;QAC/D,OAAO;KACR,CAAC,CAAC;AACL,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export * from "./components/cta/funds/WithdrawAllFundsButton";
|
|
|
28
28
|
export * from "./components/currencyDisplay/CurrencyDisplay";
|
|
29
29
|
export * from "./components/exchangeCard/ExchangeCard";
|
|
30
30
|
export * from "./components/image/Image";
|
|
31
|
+
export * from "./components/ui/IpfsImage";
|
|
31
32
|
export * from "./components/ui/loading/Loading";
|
|
32
33
|
export * from "./components/productCard/ProductCard";
|
|
33
34
|
export * from "./components/productCard/const";
|
|
@@ -63,6 +64,7 @@ export * from "./components/ui/Grid";
|
|
|
63
64
|
export * from "./components/ui/GridContainer";
|
|
64
65
|
export * from "./components/ui/Typography";
|
|
65
66
|
export * from "./components/ui/MuteButton";
|
|
67
|
+
export * from "./components/ui/CardCTA";
|
|
66
68
|
export * from "./components/form";
|
|
67
69
|
export * from "./lib/magicLink/logout";
|
|
68
70
|
export * from "./lib/magicLink/provider";
|
|
@@ -82,4 +84,6 @@ export * from "./components/error/SimpleError";
|
|
|
82
84
|
export * from "./components/step/MultiSteps";
|
|
83
85
|
export * from "./components/ipfs/IpfsProvider";
|
|
84
86
|
export * from "./types/helpers";
|
|
87
|
+
export * from "./lib/url/url";
|
|
88
|
+
export * from "./lib/promises/promises";
|
|
85
89
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EACL,OAAO,IAAI,YAAY,EACvB,OAAO,EACP,iBAAiB,EAClB,MAAM,8BAA8B,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iC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AACxB,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wFAAwF,CAAC;AACvG,cAAc,mEAAmE,CAAC;AAClF,cAAc,iEAAiE,CAAC;AAChF,cAAc,qEAAqE,CAAC;AACpF,cAAc,0EAA0E,CAAC;AACzF,cAAc,4EAA4E,CAAC;AAC3F,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6CAA6C,CAAC;AAC5D,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -28,6 +28,7 @@ export * from "./components/cta/funds/WithdrawAllFundsButton";
|
|
|
28
28
|
export * from "./components/currencyDisplay/CurrencyDisplay";
|
|
29
29
|
export * from "./components/exchangeCard/ExchangeCard";
|
|
30
30
|
export * from "./components/image/Image";
|
|
31
|
+
export * from "./components/ui/IpfsImage";
|
|
31
32
|
export * from "./components/ui/loading/Loading";
|
|
32
33
|
export * from "./components/productCard/ProductCard";
|
|
33
34
|
export * from "./components/productCard/const";
|
|
@@ -63,6 +64,7 @@ export * from "./components/ui/Grid";
|
|
|
63
64
|
export * from "./components/ui/GridContainer";
|
|
64
65
|
export * from "./components/ui/Typography";
|
|
65
66
|
export * from "./components/ui/MuteButton";
|
|
67
|
+
export * from "./components/ui/CardCTA";
|
|
66
68
|
export * from "./components/form";
|
|
67
69
|
export * from "./lib/magicLink/logout";
|
|
68
70
|
export * from "./lib/magicLink/provider";
|
|
@@ -82,4 +84,6 @@ export * from "./components/error/SimpleError";
|
|
|
82
84
|
export * from "./components/step/MultiSteps";
|
|
83
85
|
export * from "./components/ipfs/IpfsProvider";
|
|
84
86
|
export * from "./types/helpers";
|
|
87
|
+
export * from "./lib/url/url";
|
|
88
|
+
export * from "./lib/promises/promises";
|
|
85
89
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EACL,OAAO,IAAI,YAAY,EAEvB,iBAAiB,EAClB,MAAM,8BAA8B,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,wCAAwC,CAAC;AACvD,cAAc,0CAA0C,CAAC;AACzD,cAAc,wCAAwC,CAAC;AACvD,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,cAAc,0EAA0E,CAAC;AACzF,cAAc,4EAA4E,CAAC;AAC3F,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6CAA6C,CAAC;AAC5D,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../../src/lib/url/url.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../../src/lib/url/url.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,cAAc,mGACuE,CAAC;AAWnG,wBAAgB,WAAW,CAAC,GAAG,SAAgB,GAAG,MAAM,CAEvD"}
|
package/dist/esm/lib/url/url.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi;
|
|
2
2
|
/** A pattern that matches safe data URLs. It only matches image, video, and audio types. */
|
|
3
3
|
const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\\/]+=*$/i;
|
|
4
|
+
export const websitePattern = "^(http://|https://)?(www.)?([a-zA-Z0-9]+).[a-zA-Z0-9]*.[a-z]{1}.([-a-z-A-Z-0-9:_+.?/@#%&=]+)?$";
|
|
4
5
|
function _sanitizeUrl(url) {
|
|
5
6
|
url = String(url);
|
|
6
7
|
if (url === "null" || url.length === 0 || url === "about:blank")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../../../src/lib/url/url.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GACpB,iEAAiE,CAAC;AAEpE,4FAA4F;AAC5F,MAAM,gBAAgB,GACpB,uIAAuI,CAAC;AAE1I,SAAS,YAAY,CAAC,GAAW;IAC/B,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAClB,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,GAAG,KAAK,aAAa;QAC7D,OAAO,aAAa,CAAC;IACvB,IAAI,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC;QAAE,OAAO,GAAG,CAAC;IAE3E,OAAO,UAAU,GAAG,EAAE,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,GAAG,GAAG,aAAa;IAC7C,OAAO,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAC1C,CAAC"}
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../../../src/lib/url/url.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GACpB,iEAAiE,CAAC;AAEpE,4FAA4F;AAC5F,MAAM,gBAAgB,GACpB,uIAAuI,CAAC;AAE1I,MAAM,CAAC,MAAM,cAAc,GACzB,gGAAgG,CAAC;AAEnG,SAAS,YAAY,CAAC,GAAW;IAC/B,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAClB,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,GAAG,KAAK,aAAa;QAC7D,OAAO,aAAa,CAAC;IACvB,IAAI,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC;QAAE,OAAO,GAAG,CAAC;IAE3E,OAAO,UAAU,GAAG,EAAE,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,GAAG,GAAG,aAAa;IAC7C,OAAO,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -4,6 +4,9 @@ export type DeepReadonly<T> = {
|
|
|
4
4
|
export type WithRequired<T, K extends keyof T> = T & {
|
|
5
5
|
[P in K]-?: T[P];
|
|
6
6
|
};
|
|
7
|
+
export type Prettify<T> = {
|
|
8
|
+
[K in keyof T]: T[K];
|
|
9
|
+
} & {};
|
|
7
10
|
type Falsy = false | 0 | "" | null | undefined;
|
|
8
11
|
export declare const isTruthy: <T>(x: Falsy | T) => x is T;
|
|
9
12
|
type KnownKeys<T> = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/types/helpers.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;IAE5B,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC5C,CAAC;AACF,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG;KAA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,KAAK,CAAC;AACZ,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,GACtE,CAAC,MAAM,SAAS,CAAC,GACb,EAAE,GACF,MAAM,SAAS,MAAM,CAAC,GACpB;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAA;CAAE,GAC5C,EAAE,CAAC,GAAG,0BAA0B;AACtC,CAAC,MAAM,SAAS,CAAC,GACb,EAAE,GACF,MAAM,SAAS,MAAM,CAAC,GACpB;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAA;CAAE,GAC5C,EAAE,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/types/helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/types/helpers.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAI,CAAY,EAAU,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AA4BzD,YAAY"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bosonprotocol/react-kit",
|
|
3
3
|
"description": "React toolkit with smart components and hooks for building on top of the Boson Protocol.",
|
|
4
|
-
"version": "0.33.0-alpha.
|
|
4
|
+
"version": "0.33.0-alpha.10",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
7
7
|
"types": "./dist/cjs/index.d.ts",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"license": "Apache-2.0",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@bosonprotocol/chat-sdk": "^1.3.1-alpha.9",
|
|
18
|
-
"@bosonprotocol/core-sdk": "^1.40.5-alpha.
|
|
19
|
-
"@bosonprotocol/ethers-sdk": "^1.14.5-alpha.
|
|
20
|
-
"@bosonprotocol/ipfs-storage": "^1.11.
|
|
18
|
+
"@bosonprotocol/core-sdk": "^1.40.5-alpha.9",
|
|
19
|
+
"@bosonprotocol/ethers-sdk": "^1.14.5-alpha.9",
|
|
20
|
+
"@bosonprotocol/ipfs-storage": "^1.11.4-alpha.4",
|
|
21
21
|
"@davatar/react": "1.11.1",
|
|
22
22
|
"@ethersproject/units": "5.6.0",
|
|
23
23
|
"@glidejs/glide": "3.6.0",
|
|
@@ -188,5 +188,5 @@
|
|
|
188
188
|
"overrides": {
|
|
189
189
|
"typescript": "^5.1.6"
|
|
190
190
|
},
|
|
191
|
-
"gitHead": "
|
|
191
|
+
"gitHead": "47e2384cd1da7b4fe343833b8cc47a032775b1c2"
|
|
192
192
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import styled, { css } from "styled-components";
|
|
1
|
+
import styled, { CSSProperties, css } from "styled-components";
|
|
2
2
|
import { theme } from "../../theme";
|
|
3
3
|
|
|
4
4
|
export const ImageWrapper = styled.div<{ $hide?: boolean }>`
|
|
@@ -27,11 +27,13 @@ const buttonText = css`
|
|
|
27
27
|
line-height: 24px;
|
|
28
28
|
`;
|
|
29
29
|
|
|
30
|
-
export const ImagePlaceholder = styled.div<{
|
|
31
|
-
$
|
|
32
|
-
|
|
30
|
+
export const ImagePlaceholder = styled.div<{
|
|
31
|
+
$position?: CSSProperties["position"];
|
|
32
|
+
}>`
|
|
33
|
+
${({ $position }) =>
|
|
34
|
+
$position
|
|
33
35
|
? css`
|
|
34
|
-
position: ${position};
|
|
36
|
+
position: ${$position};
|
|
35
37
|
`
|
|
36
38
|
: css`
|
|
37
39
|
position: absolute;
|
|
@@ -48,7 +48,7 @@ export const Image: React.FC<IBaseImage> = ({
|
|
|
48
48
|
return (
|
|
49
49
|
<>
|
|
50
50
|
<ImageWrapper {...rest} data-image-wrapper $hide={!isError}>
|
|
51
|
-
<ImagePlaceholder data-image-placeholder position="static">
|
|
51
|
+
<ImagePlaceholder data-image-placeholder $position="static">
|
|
52
52
|
{errorConfig.errorIcon ?? null}
|
|
53
53
|
<ImageErrorText>
|
|
54
54
|
{errorConfig.errorImageText || "Failed to load image"}
|
|
@@ -56,7 +56,7 @@ export const Image: React.FC<IBaseImage> = ({
|
|
|
56
56
|
</ImagePlaceholder>
|
|
57
57
|
</ImageWrapper>
|
|
58
58
|
<ImageWrapper {...rest} data-image-wrapper $hide={!isLoading}>
|
|
59
|
-
<ImagePlaceholder data-image-placeholder position="static">
|
|
59
|
+
<ImagePlaceholder data-image-placeholder $position="static">
|
|
60
60
|
<Loading />
|
|
61
61
|
</ImagePlaceholder>
|
|
62
62
|
</ImageWrapper>
|
|
@@ -28,7 +28,7 @@ import { Typography } from "../../../../ui/Typography";
|
|
|
28
28
|
import {
|
|
29
29
|
getItemFromStorage,
|
|
30
30
|
saveItemInStorage
|
|
31
|
-
} from "
|
|
31
|
+
} from "../../../../../hooks/storage/useBosonLocalStorage";
|
|
32
32
|
import { useModal } from "../../../useModal";
|
|
33
33
|
import { InnerDetailViewWithPortal } from "../../common/detail/InnerDetailViewWithPortal";
|
|
34
34
|
import { BuyOrSwapContainer } from "../../common/detail/BuyOrSwapContainer";
|
|
@@ -4,7 +4,7 @@ import styled from "styled-components";
|
|
|
4
4
|
import { useExchanges } from "../../../../../hooks/useExchanges";
|
|
5
5
|
import { getOfferDetails } from "../../../../../lib/offer/getOfferDetails";
|
|
6
6
|
import { Grid } from "../../../../ui/Grid";
|
|
7
|
-
import IpfsImage from "../../../../ui/IpfsImage";
|
|
7
|
+
import { IpfsImage } from "../../../../ui/IpfsImage";
|
|
8
8
|
import Loading from "../../../../ui/loading/LoadingWrapper";
|
|
9
9
|
import { Typography } from "../../../../ui/Typography";
|
|
10
10
|
import DetailOpenSea from "../../common/DetailOpenSea";
|
|
@@ -19,7 +19,7 @@ import { useCoreSDKWithContext } from "../../../../../hooks/core-sdk/useCoreSdkW
|
|
|
19
19
|
import { isNftItem } from "../../../../../lib/bundle/filter";
|
|
20
20
|
import { isTruthy } from "../../../../../types/helpers";
|
|
21
21
|
import Video from "../../../../ui/Video";
|
|
22
|
-
import IpfsImage from "../../../../ui/IpfsImage";
|
|
22
|
+
import { IpfsImage } from "../../../../ui/IpfsImage";
|
|
23
23
|
|
|
24
24
|
const StyledDetailsSummary = styled(DetailsSummary)`
|
|
25
25
|
.icon-wrapper {
|
|
@@ -13,7 +13,7 @@ import styled, { css } from "styled-components";
|
|
|
13
13
|
import { breakpointNumbers } from "../../../../../lib/ui/breakpoint";
|
|
14
14
|
import { theme } from "../../../../../theme";
|
|
15
15
|
import { Grid } from "../../../../ui/Grid";
|
|
16
|
-
import IpfsImage from "../../../../ui/IpfsImage";
|
|
16
|
+
import { IpfsImage } from "../../../../ui/IpfsImage";
|
|
17
17
|
import Video from "../../../../ui/Video";
|
|
18
18
|
import { zIndex } from "../../../../ui/zIndex";
|
|
19
19
|
import { GlideSlide } from "./Detail.style";
|
|
@@ -12,7 +12,7 @@ import { theme } from "../../../../../theme";
|
|
|
12
12
|
import { Offer } from "../../../../../types/offer";
|
|
13
13
|
import { Tooltip } from "../../../../tooltip/Tooltip";
|
|
14
14
|
import { Grid } from "../../../../ui/Grid";
|
|
15
|
-
import IpfsImage from "../../../../ui/IpfsImage";
|
|
15
|
+
import { IpfsImage } from "../../../../ui/IpfsImage";
|
|
16
16
|
import ThemedButton from "../../../../ui/ThemedButton";
|
|
17
17
|
import { Typography } from "../../../../ui/Typography";
|
|
18
18
|
import Video from "../../../../ui/Video";
|
|
@@ -3,7 +3,7 @@ import "slick-carousel/slick/slick.css";
|
|
|
3
3
|
import "slick-carousel/slick/slick-theme.css";
|
|
4
4
|
import _Slider, { Settings } from "react-slick";
|
|
5
5
|
|
|
6
|
-
import IpfsImage from "../../../../ui/IpfsImage";
|
|
6
|
+
import { IpfsImage } from "../../../../ui/IpfsImage";
|
|
7
7
|
import Video from "../../../../ui/Video";
|
|
8
8
|
import styled, { CSSProperties, css } from "styled-components";
|
|
9
9
|
import { theme } from "../../../../../theme";
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
import styled, { CSSProperties, css } from "styled-components";
|
|
3
|
+
import { Grid, GridProps } from "./Grid";
|
|
4
|
+
import { Typography, TypographyProps } from "./Typography";
|
|
5
|
+
|
|
6
|
+
export type CardCTAProps = GridProps & {
|
|
7
|
+
title: string;
|
|
8
|
+
text: string;
|
|
9
|
+
icon: ReactElement;
|
|
10
|
+
cta: ReactElement;
|
|
11
|
+
titleProps?: TypographyProps;
|
|
12
|
+
textProps?: TypographyProps;
|
|
13
|
+
theme: {
|
|
14
|
+
background: CSSProperties["background"];
|
|
15
|
+
color: CSSProperties["color"];
|
|
16
|
+
padding: CSSProperties["padding"];
|
|
17
|
+
border: CSSProperties["border"];
|
|
18
|
+
borderRadius: CSSProperties["borderRadius"];
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const StyledGrid = styled(Grid)<{ theme: CardCTAProps["theme"] }>`
|
|
23
|
+
${(props) => {
|
|
24
|
+
return css`
|
|
25
|
+
background: ${props.theme.background};
|
|
26
|
+
color: ${props.theme.color};
|
|
27
|
+
padding: ${props.theme.padding};
|
|
28
|
+
border: ${props.theme.border};
|
|
29
|
+
border-radius: ${props.theme.borderRadius};
|
|
30
|
+
`;
|
|
31
|
+
}}
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
const IconContainer = styled(Grid)`
|
|
35
|
+
top: 0.5rem;
|
|
36
|
+
right: 0;
|
|
37
|
+
margin-bottom: 1rem;
|
|
38
|
+
svg {
|
|
39
|
+
> * {
|
|
40
|
+
stroke-width: 14px;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
export const CardCTA: React.FC<CardCTAProps> = ({
|
|
46
|
+
title,
|
|
47
|
+
text,
|
|
48
|
+
icon,
|
|
49
|
+
cta,
|
|
50
|
+
theme,
|
|
51
|
+
titleProps,
|
|
52
|
+
textProps,
|
|
53
|
+
...rest
|
|
54
|
+
}) => {
|
|
55
|
+
return (
|
|
56
|
+
<StyledGrid
|
|
57
|
+
flexDirection="column"
|
|
58
|
+
alignItems="flex-start"
|
|
59
|
+
padding="1.5rem"
|
|
60
|
+
theme={theme}
|
|
61
|
+
{...rest}
|
|
62
|
+
>
|
|
63
|
+
<>
|
|
64
|
+
<div>
|
|
65
|
+
<IconContainer>{icon}</IconContainer>
|
|
66
|
+
<Typography fontWeight="600" fontSize="1.25rem" {...titleProps}>
|
|
67
|
+
{title}
|
|
68
|
+
</Typography>
|
|
69
|
+
</div>
|
|
70
|
+
<Typography tag="p" {...textProps}>
|
|
71
|
+
{text}
|
|
72
|
+
</Typography>
|
|
73
|
+
{cta}
|
|
74
|
+
</>
|
|
75
|
+
</StyledGrid>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { ElementRef, HTMLAttributes, forwardRef } from "react";
|
|
2
2
|
import styled, { CSSProperties } from "styled-components";
|
|
3
3
|
import { getTransientCustomProps } from "./getTransientCustomProps";
|
|
4
|
+
import { isDefined } from "./common";
|
|
4
5
|
const pickedProps = {
|
|
5
6
|
alignItems: true,
|
|
6
7
|
flexBasis: true,
|
|
@@ -29,31 +30,42 @@ type IGrid = Pick<CSSProperties, keyof typeof pickedProps>;
|
|
|
29
30
|
type InnerGridProps = Record<`$${keyof IGrid}`, IGrid[keyof IGrid]>;
|
|
30
31
|
|
|
31
32
|
const Container = styled.div<InnerGridProps>`
|
|
32
|
-
|
|
33
|
-
height: ${({ $height }) => $height
|
|
33
|
+
${({ $width }) => (isDefined($width) ? `width:${$width};` : "width: 100%;")}
|
|
34
|
+
height: ${({ $height }) => (isDefined($height) ? $height : "initial")};
|
|
34
35
|
display: flex;
|
|
35
|
-
align-items: ${({ $alignItems }) =>
|
|
36
|
-
|
|
37
|
-
flex-
|
|
38
|
-
|
|
39
|
-
flex-
|
|
36
|
+
align-items: ${({ $alignItems }) =>
|
|
37
|
+
isDefined($alignItems) ? $alignItems : "center"};
|
|
38
|
+
flex-basis: ${({ $flexBasis }) =>
|
|
39
|
+
isDefined($flexBasis) ? $flexBasis : "auto"};
|
|
40
|
+
flex-direction: ${({ $flexDirection }) =>
|
|
41
|
+
isDefined($flexDirection) ? $flexDirection : "row"};
|
|
42
|
+
flex-grow: ${({ $flexGrow }) =>
|
|
43
|
+
isDefined($flexGrow) ? $flexGrow : "initial"};
|
|
44
|
+
flex-shrink: ${({ $flexShrink }) =>
|
|
45
|
+
isDefined($flexShrink) ? $flexShrink : "initial"};
|
|
40
46
|
justify-content: ${({ $justifyContent }) =>
|
|
41
|
-
$justifyContent
|
|
47
|
+
isDefined($justifyContent) ? $justifyContent : "space-between"};
|
|
42
48
|
|
|
43
|
-
${({ $flexWrap }) => ($flexWrap ? `flex-wrap:${$flexWrap};` : "")}
|
|
44
|
-
${({ $rowGap }) => ($rowGap ? `row-gap:${$rowGap};` : "")}
|
|
45
|
-
${({ $columnGap }) =>
|
|
46
|
-
|
|
47
|
-
${({ $
|
|
48
|
-
${({ $
|
|
49
|
-
${({ $
|
|
50
|
-
${({ $
|
|
51
|
-
${({ $
|
|
49
|
+
${({ $flexWrap }) => (isDefined($flexWrap) ? `flex-wrap:${$flexWrap};` : "")}
|
|
50
|
+
${({ $rowGap }) => (isDefined($rowGap) ? `row-gap:${$rowGap};` : "")}
|
|
51
|
+
${({ $columnGap }) =>
|
|
52
|
+
isDefined($columnGap) ? `column-gap:${$columnGap};` : ""}
|
|
53
|
+
${({ $gap }) => (isDefined($gap) ? `gap:${$gap};` : "")}
|
|
54
|
+
${({ $flex }) => (isDefined($flex) ? `> * { flex: ${$flex}; }` : "")}
|
|
55
|
+
${({ $padding }) => (isDefined($padding) ? `padding:${$padding};` : "")}
|
|
56
|
+
${({ $margin }) => (isDefined($margin) ? `margin:${$margin};` : "")}
|
|
57
|
+
${({ $marginTop }) =>
|
|
58
|
+
isDefined($marginTop) ? `margin-top:${$marginTop};` : ""}
|
|
59
|
+
${({ $marginRight }) =>
|
|
60
|
+
isDefined($marginRight) ? `margin-right:${$marginRight};` : ""}
|
|
52
61
|
${({ $marginBottom }) =>
|
|
53
|
-
$marginBottom ? `margin-bottom:${$marginBottom};` : ""}
|
|
54
|
-
${({ $marginLeft }) =>
|
|
55
|
-
|
|
56
|
-
${({ $
|
|
62
|
+
isDefined($marginBottom) ? `margin-bottom:${$marginBottom};` : ""}
|
|
63
|
+
${({ $marginLeft }) =>
|
|
64
|
+
isDefined($marginLeft) ? `margin-left:${$marginLeft};` : ""}
|
|
65
|
+
${({ $alignSelf }) =>
|
|
66
|
+
isDefined($alignSelf) ? `align-self:${$alignSelf};` : ""}
|
|
67
|
+
${({ $justifySelf }) =>
|
|
68
|
+
isDefined($justifySelf) ? `justify-self:${$justifySelf};` : ""}
|
|
57
69
|
`;
|
|
58
70
|
export type GridProps = {
|
|
59
71
|
children?: React.ReactNode;
|
|
@@ -86,7 +86,9 @@ interface IImage {
|
|
|
86
86
|
ipfsGateway?: string;
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
const IpfsImage: React.FC<
|
|
89
|
+
export const IpfsImage: React.FC<
|
|
90
|
+
IImage & React.HTMLAttributes<HTMLDivElement>
|
|
91
|
+
> = ({
|
|
90
92
|
src,
|
|
91
93
|
children,
|
|
92
94
|
dataTestId = "image",
|
|
@@ -179,5 +181,3 @@ const IpfsImage: React.FC<IImage & React.HTMLAttributes<HTMLDivElement>> = ({
|
|
|
179
181
|
</>
|
|
180
182
|
);
|
|
181
183
|
};
|
|
182
|
-
|
|
183
|
-
export default IpfsImage;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { HTMLAttributes, forwardRef } from "react";
|
|
2
2
|
import styled, { CSSProperties } from "styled-components";
|
|
3
3
|
import { getTransientCustomProps } from "./getTransientCustomProps";
|
|
4
|
+
import { isDefined } from "./common";
|
|
4
5
|
|
|
5
6
|
const pickedProps = {
|
|
6
7
|
alignItems: true,
|
|
@@ -38,43 +39,52 @@ type InnerTypographyProps = Record<
|
|
|
38
39
|
`$${keyof WrapperProps}`,
|
|
39
40
|
WrapperProps[keyof WrapperProps]
|
|
40
41
|
>;
|
|
41
|
-
|
|
42
42
|
const Wrapper = styled.div<InnerTypographyProps>`
|
|
43
43
|
display: flex;
|
|
44
|
-
${({ $display }) => ($display ? `display:${$display};` : "")}
|
|
45
|
-
${({ $alignItems }) =>
|
|
46
|
-
|
|
44
|
+
${({ $display }) => (isDefined($display) ? `display:${$display};` : "")}
|
|
45
|
+
${({ $alignItems }) =>
|
|
46
|
+
isDefined($alignItems) && `align-items: ${$alignItems}`};
|
|
47
|
+
${({ $flexBasis }) => isDefined($flexBasis) && `flex-basis: ${$flexBasis}`};
|
|
47
48
|
${({ $flexDirection }) =>
|
|
48
|
-
$flexDirection && `flex-direction: ${$flexDirection}`};
|
|
49
|
-
${({ $flexGrow }) => $flexGrow && `flex-grow: ${$flexGrow}`};
|
|
50
|
-
${({ $flexShrink }) =>
|
|
49
|
+
isDefined($flexDirection) && `flex-direction: ${$flexDirection}`};
|
|
50
|
+
${({ $flexGrow }) => isDefined($flexGrow) && `flex-grow: ${$flexGrow}`};
|
|
51
|
+
${({ $flexShrink }) =>
|
|
52
|
+
isDefined($flexShrink) && `flex-shrink: ${$flexShrink}`};
|
|
51
53
|
${({ $justifyContent }) =>
|
|
52
|
-
$justifyContent && `justify-content: ${$justifyContent}`};
|
|
53
|
-
${({ $flexWrap }) => ($flexWrap ? `flex-wrap:${$flexWrap};` : "")}
|
|
54
|
-
${({ $rowGap }) => ($rowGap ? `row-gap:${$rowGap};` : "")}
|
|
55
|
-
${({ $columnGap }) =>
|
|
56
|
-
|
|
57
|
-
${({ $
|
|
58
|
-
${({ $
|
|
59
|
-
${({ $
|
|
60
|
-
${({ $
|
|
61
|
-
${({ $
|
|
54
|
+
isDefined($justifyContent) && `justify-content: ${$justifyContent}`};
|
|
55
|
+
${({ $flexWrap }) => (isDefined($flexWrap) ? `flex-wrap:${$flexWrap};` : "")}
|
|
56
|
+
${({ $rowGap }) => (isDefined($rowGap) ? `row-gap:${$rowGap};` : "")}
|
|
57
|
+
${({ $columnGap }) =>
|
|
58
|
+
isDefined($columnGap) ? `column-gap:${$columnGap};` : ""}
|
|
59
|
+
${({ $gap }) => (isDefined($gap) ? `gap:${$gap};` : "")}
|
|
60
|
+
${({ $flex }) => (isDefined($flex) ? `> * { flex: ${$flex}; }` : "")}
|
|
61
|
+
${({ $padding }) => (isDefined($padding) ? `padding:${$padding};` : "")}
|
|
62
|
+
${({ $margin }) => (isDefined($margin) ? `margin:${$margin};` : "")}
|
|
63
|
+
${({ $marginTop }) =>
|
|
64
|
+
isDefined($marginTop) ? `margin-top:${$marginTop};` : ""}
|
|
65
|
+
${({ $marginRight }) =>
|
|
66
|
+
isDefined($marginRight) ? `margin-right:${$marginRight};` : ""}
|
|
62
67
|
${({ $marginBottom }) =>
|
|
63
|
-
$marginBottom ? `margin-bottom:${$marginBottom};` : ""}
|
|
64
|
-
${({ $marginLeft }) =>
|
|
68
|
+
isDefined($marginBottom) ? `margin-bottom:${$marginBottom};` : ""}
|
|
69
|
+
${({ $marginLeft }) =>
|
|
70
|
+
isDefined($marginLeft) ? `margin-left:${$marginLeft};` : ""}
|
|
65
71
|
|
|
66
72
|
|
|
67
|
-
${({ $fontSize }) => ($fontSize ? `font-size:${$fontSize};` : "")}
|
|
68
|
-
${({ $fontWeight }) =>
|
|
69
|
-
|
|
70
|
-
${({ $
|
|
71
|
-
|
|
72
|
-
${({ $
|
|
73
|
+
${({ $fontSize }) => (isDefined($fontSize) ? `font-size:${$fontSize};` : "")}
|
|
74
|
+
${({ $fontWeight }) =>
|
|
75
|
+
isDefined($fontWeight) ? `font-weight:${$fontWeight};` : ""}
|
|
76
|
+
${({ $lineHeight }) =>
|
|
77
|
+
isDefined($lineHeight) ? `line-height:${$lineHeight};` : ""}
|
|
78
|
+
${({ $color }) => (isDefined($color) ? `color:${$color};` : "")}
|
|
79
|
+
${({ $background }) =>
|
|
80
|
+
isDefined($background) ? `background:${$background};` : ""}
|
|
81
|
+
${({ $cursor }) => (isDefined($cursor) ? `cursor:${$cursor};` : "")}
|
|
73
82
|
${({ $letterSpacing }) =>
|
|
74
|
-
$letterSpacing ? `letter-spacing:${$letterSpacing};` : ""}
|
|
75
|
-
${({ $textAlign }) =>
|
|
76
|
-
|
|
77
|
-
${({ $
|
|
83
|
+
isDefined($letterSpacing) ? `letter-spacing:${$letterSpacing};` : ""}
|
|
84
|
+
${({ $textAlign }) =>
|
|
85
|
+
isDefined($textAlign) ? `text-align:${$textAlign};` : ""}
|
|
86
|
+
${({ $opacity }) => (isDefined($opacity) ? `opacity:${$opacity};` : "")}
|
|
87
|
+
${({ $width }) => (isDefined($width) ? `width:${$width};` : "")}
|
|
78
88
|
`;
|
|
79
89
|
|
|
80
90
|
export type TypographyProps = WrapperProps &
|